================
@@ -840,6 +897,76 @@ Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned 
BuiltinID,
                                       Ops[0]);
     return Builder.CreateExtractValue(Call, 0);
   }
+  case X86::BI__builtin_ia32_roundps:
+  case X86::BI__builtin_ia32_roundpd:
+  case X86::BI__builtin_ia32_roundps256:
+  case X86::BI__builtin_ia32_roundpd256: {
+    unsigned M = cast<ConstantInt>(Ops[1])->getZExtValue();
+    unsigned MXCSRMask = 0b100;
+    unsigned FRoundNoExcMask = 0b1000;
+    unsigned UseMXCSR = MXCSRMask & M;
+    unsigned FRoundNoExc = FRoundNoExcMask & M;
+
+    if (UseMXCSR || FRoundNoExc) {
----------------
RKSimon wrote:

We need this to fire if exceptions haven't been masked:
```suggestion
    if (UseMXCSR || !FRoundNoExc) {
```

https://github.com/llvm/llvm-project/pull/171227
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to