@@ -36,7 +36,7 @@ class GenXFloatControl : public FGPassImplInterface, IDMixin<GenXFloatControl> {
36
36
37
37
bool getFloatControl (Function *F, uint32_t *Val);
38
38
39
- Value *buildCr0Update (Value* V, Instruction *InsertBefore);
39
+ Value *buildCr0Update (Value * V, Instruction *InsertBefore);
40
40
41
41
public:
42
42
void releaseMemory () {}
@@ -72,14 +72,21 @@ ModulePass *llvm::createGenXFloatControlWrapperPass() {
72
72
}
73
73
74
74
bool GenXFloatControl::runOnFunctionGroup (FunctionGroup &FG) {
75
+ // By default retain all denormals, rounding mode - RTNE (both FPU and float
76
+ // to integer conversion)
77
+ DefaultFloatControl = Bits::DoublePrecisionDenorm |
78
+ Bits::SinglePrecisionDenorm |
79
+ Bits::HalfPrecisionDenorm | Bits::FPToIntRoundingMode;
80
+
75
81
// By default allow to specify with the attribute only rounding and denorm
76
82
// modes
77
83
Mask = Bits::RoundingMode | Bits::DoublePrecisionDenorm |
78
- Bits::SinglePrecisionDenorm | Bits::HalfPrecisionDenorm;
84
+ Bits::SinglePrecisionDenorm | Bits::HalfPrecisionDenorm;
79
85
const auto *Subtarget = &getAnalysis<TargetPassConfig>()
80
86
.getTM <GenXTargetMachine>()
81
87
.getGenXSubtarget ();
82
88
if (Subtarget->hasSystolicDenormControl ()) {
89
+ DefaultFloatControl |= Bits::SystolicDenorm;
83
90
Mask |= Bits::SystolicDenorm;
84
91
}
85
92
@@ -134,9 +141,9 @@ Value *GenXFloatControl::buildCr0Update(Value *V, Instruction *InsertBefore) {
134
141
auto *Or = B.CreateOr (AndOld, AndNew);
135
142
auto *WrR = R.createWrRegion (Cr0, Or, " cr0.0.updated" , InsertBefore, DL);
136
143
137
- B.CreateCall (
138
- vc::getAnyDeclaration (M, GenXIntrinsic::genx_write_predef_reg, {VTy, VTy}),
139
- {Id, WrR});
144
+ B.CreateCall (vc::getAnyDeclaration (M, GenXIntrinsic::genx_write_predef_reg,
145
+ {VTy, VTy}),
146
+ {Id, WrR});
140
147
141
148
return RdR;
142
149
}
0 commit comments