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

Yi Kong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 6 11:23:29 PST 2019


kongyi marked 3 inline comments as done.
kongyi added inline comments.


================
Comment at: compiler-rt/lib/builtins/i386/fp_mode.c:66
+#ifdef __SSE_MATH__
+  uint32_t mxcsr;
+  __asm__ __volatile__ ("stmxcsr %0": "=m" (mxcsr));
----------------
nickdesaulniers wrote:
> Should you use `env.__mxcsr` here? If so, then the preprocessor guard differs from the above.
No, these are different. One is FPU environment and this one is for the SSE unit.


================
Comment at: compiler-rt/lib/builtins/i386/fp_mode.c:69
+  mxcsr |= X87_INEXACT;
+  __asm__ __volatile__ ("ldmxcsr %0": : "m" (mxcsr));
+#endif
----------------
nickdesaulniers wrote:
> Do *any* of these `asm` statements in this patch require `volatile` qualification?
Yes, otherwise the entire code block may be optimised away.


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