[PATCH] D45616: [X86] Lower _mm[256|512]_cmp[.]_mask intrinsics to native llvm IR

Craig Topper via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 12 16:22:43 PDT 2018


craig.topper added inline comments.


================
Comment at: lib/CodeGen/CGBuiltin.cpp:10071
+      // is _MM_FROUND_CUR_DIRECTION
+      if (cast<llvm::ConstantInt>(Ops[4])->getZExtValue() != 4)
+        UsesNonDefaultRounding = true;
----------------
GBuella wrote:
> efriedma wrote:
> > Given we're ignoring floating-point exceptions, we should also ignore the "rounding mode" operand (__MM_FROUND_NO_EXC only affects exceptions, and the other values are irrelevant because there isn't any actual rounding involved).
> Oh, alltight. @craig.topper , Do you also agree on ignoring all of these, and just lowering all the comparisions to fcmp?
> That is the easiest path of course.
I think I'm fine with ignoring it, but definitely leave a comment because we will probably have to revisit this code in the future as we continue towards supporting FENV_ACCESS.


================
Comment at: lib/CodeGen/CGBuiltin.cpp:10143
+
+      Value *Cmp = Builder.CreateFCmp(Pred, Ops[0], Ops[1]);
+
----------------
Move this into the "ReturnsMask" path, and use getVectorFCmpIR for the other path.


https://reviews.llvm.org/D45616





More information about the cfe-commits mailing list