StringRef ElementOp; // copy, three_way_compare, splat_set, ...
StringRef FixedSizeArgs;
StringRef RuntimeSizeArgs;
- StringRef AlignArg1;
- StringRef AlignArg2;
StringRef DefaultReturnValue;
};
// A detailed representation of the function implementation mapped from the
"copy",
"(dst, src)",
"(dst, src, size)",
- "Arg::Dst",
- "Arg::Src",
""};
case FunctionType::MEMCMP:
return {"int",
"three_way_compare",
"(lhs, rhs)",
"(lhs, rhs, size)",
- "Arg::Lhs",
- "Arg::Rhs",
"0"};
case FunctionType::MEMSET:
return {"void",
"splat_set",
"(dst, value)",
"(dst, value, size)",
- "Arg::Dst",
- "Arg::Src",
""};
case FunctionType::BZERO:
return {"void", "(char * dst, size_t size)",
"splat_set", "(dst, 0)",
- "(dst, 0, size)", "Arg::Dst",
- "Arg::Src", ""};
+ "(dst, 0, size)", ""};
default:
report_fatal_error("Not yet implemented");
}
}
-static StringRef getAligntoString(const Context &Ctx, const AlignArg &AlignTo) {
+static StringRef getAligntoString(const AlignArg &AlignTo) {
switch (AlignTo) {
case AlignArg::_1:
- return Ctx.AlignArg1;
+ return "Arg::P1";
case AlignArg::_2:
- return Ctx.AlignArg2;
+ return "Arg::P2";
case AlignArg::ARRAY_SIZE:
report_fatal_error("logic error");
}
if (const auto &L = FD.Loop)
Impl.Loop = Loop{L->Span.End, ElementType{L->BlockSize}};
if (const auto &AL = FD.AlignedLoop)
- Impl.AlignedLoop = AlignedLoop{
- AL->Loop.Span.End, ElementType{AL->Loop.BlockSize},
- ElementType{AL->Alignment}, getAligntoString(Impl.Ctx, AL->AlignTo)};
+ Impl.AlignedLoop =
+ AlignedLoop{AL->Loop.Span.End, ElementType{AL->Loop.BlockSize},
+ ElementType{AL->Alignment}, getAligntoString(AL->AlignTo)};
if (const auto &A = FD.Accelerator)
Impl.Accelerator = Accelerator{A->Span.End};
return Impl;