[PATCH] D69870: [builtins] Implement rounding mode support for i386/x86_64

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 11 19:40:18 PST 2019


craig.topper added inline comments.


================
Comment at: compiler-rt/lib/builtins/i386/fp_mode.c:61
+  env.__status_word |= X87_INEXACT;
+  __asm__ __volatile__ ("fnclex");
+  __asm__ __volatile__ ("fldenv %0": : "m" (env));
----------------
Why do we need fnclex here?


================
Comment at: compiler-rt/lib/builtins/i386/fp_mode.c:62
+  __asm__ __volatile__ ("fnclex");
+  __asm__ __volatile__ ("fldenv %0": : "m" (env));
+
----------------
Do we need an fwait after this to trigger the exception interrupt?


Repository:
  rCRT Compiler Runtime

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69870/new/

https://reviews.llvm.org/D69870





More information about the llvm-commits mailing list