@@ -51,18 +51,17 @@ class SYCLGenBase {
5151 SmallString<4 > NewLine;
5252 SmallVector<SmallString<10 >, 4 > VecExprTypeRecord;
5353 raw_ostream *Stream;
54-
54+ InlineAsmContext &Context;
5555 bool MigrationStopped = false ;
5656
5757protected:
5858 const InlineAsmInstruction *CurrInst = nullptr ;
5959 const GCCAsmStmt *GAS;
60- InlineAsmContext &Context;
60+
6161 class BlockDelimiterGuard {
6262 SYCLGenBase &CodeGen;
6363
6464 public:
65- InlineAsmContext &getContext () { return CodeGen.Context ; }
6665
6766 BlockDelimiterGuard (SYCLGenBase &CG) : CodeGen(CG) {
6867 CodeGen.OS () << " {" ;
@@ -1925,17 +1924,23 @@ class SYCLGen : public SYCLGenBase {
19251924 if (!Inst)
19261925 return SYCLGenError ();
19271926 if (Inst->hasAttr (InstAttr::eq))
1928- OS () << " , " << " std::equal_to<>()" ;
1927+ OS () << " , "
1928+ << " std::equal_to<>()" ;
19291929 else if (Inst->hasAttr (InstAttr::ne))
1930- OS () << " , " << " std::not_equal_to<>()" ;
1930+ OS () << " , "
1931+ << " std::not_equal_to<>()" ;
19311932 else if (Inst->hasAttr (InstAttr::lt))
1932- OS () << " , " << " std::less<>()" ;
1933+ OS () << " , "
1934+ << " std::less<>()" ;
19331935 else if (Inst->hasAttr (InstAttr::le))
1934- OS () << " , " << " std::less_equal<>()" ;
1936+ OS () << " , "
1937+ << " std::less_equal<>()" ;
19351938 else if (Inst->hasAttr (InstAttr::gt))
1936- OS () << " , " << " std::greater<>()" ;
1939+ OS () << " , "
1940+ << " std::greater<>()" ;
19371941 else if (Inst->hasAttr (InstAttr::ge))
1938- OS () << " , " << " std::greater_equal<>()" ;
1942+ OS () << " , "
1943+ << " std::greater_equal<>()" ;
19391944 else
19401945 return SYCLGenError ();
19411946 return SYCLGenSuccess ();
@@ -2510,10 +2515,11 @@ class SYCLGen : public SYCLGenBase {
25102515 Op = std::move (NewOp);
25112516 }
25122517
2513- bool HasHalfOrBfloat16 = SrcType->getKind () == InlineAsmBuiltinType::f16 ||
2514- DesType->getKind () == InlineAsmBuiltinType::f16 ||
2515- SrcType->getKind () == InlineAsmBuiltinType::bf16 ||
2516- DesType->getKind () == InlineAsmBuiltinType::bf16 ;
2518+ bool HasHalfOrBfloat16 =
2519+ SrcType->getKind () == InlineAsmBuiltinType::f16 ||
2520+ DesType->getKind () == InlineAsmBuiltinType::f16 ||
2521+ SrcType->getKind () == InlineAsmBuiltinType::bf16 ||
2522+ DesType->getKind () == InlineAsmBuiltinType::bf16 ;
25172523 if (DpctGlobalInfo::useIntelDeviceMath () && HasHalfOrBfloat16) {
25182524 insertHeader (HeaderType::HT_SYCL_Math);
25192525 if (SrcNeedBitCast)
@@ -2653,7 +2659,8 @@ class SYCLGen : public SYCLGenBase {
26532659 OS () << ' )' ;
26542660 if (Inst->getOutputOperand ()->getType () != T) {
26552661 OS () << " .template as<" << MapNames::getClNamespace () << " vec<"
2656- << OpTyStr[3 ] << " , 1>" << " >().x()" ;
2662+ << OpTyStr[3 ] << " , 1>"
2663+ << " >().x()" ;
26572664 }
26582665 } else
26592666 // fma.bf16 is not supported now.
0 commit comments