[libc-commits] [PATCH] D127222: [libc] Fix build when __FE_DENORM is defined

Alex Brachet via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Jun 8 09:22:33 PDT 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rG122da690b39a: [libc] Fix build when __FE_DENORM is defined (authored by abrachet).
Herald added a project: libc-project.
Herald added a subscriber: libc-commits.

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127222

Files:
  libc/src/__support/FPUtil/x86_64/FEnvImpl.h


Index: libc/src/__support/FPUtil/x86_64/FEnvImpl.h
===================================================================
--- libc/src/__support/FPUtil/x86_64/FEnvImpl.h
+++ libc/src/__support/FPUtil/x86_64/FEnvImpl.h
@@ -73,7 +73,7 @@
   // bit flags in the control registers.
   return (excepts & FE_INVALID ? ExceptionFlags::INVALID : 0) |
 #ifdef __FE_DENORM
-         (excepts & __FE_DENORM ? ExceptionFlags::Denormal : 0) |
+         (excepts & __FE_DENORM ? ExceptionFlags::DENORMAL : 0) |
 #endif // __FE_DENORM
          (excepts & FE_DIVBYZERO ? ExceptionFlags::DIV_BY_ZERO : 0) |
          (excepts & FE_OVERFLOW ? ExceptionFlags::OVERFLOW : 0) |
@@ -84,7 +84,7 @@
 static inline int exception_status_to_macro(uint16_t status) {
   return (status & ExceptionFlags::INVALID ? FE_INVALID : 0) |
 #ifdef __FE_DENORM
-         (status & ExceptionFlags::Denormal ? __FE_DENORM : 0) |
+         (status & ExceptionFlags::DENORMAL ? __FE_DENORM : 0) |
 #endif // __FE_DENORM
          (status & ExceptionFlags::DIV_BY_ZERO ? FE_DIVBYZERO : 0) |
          (status & ExceptionFlags::OVERFLOW ? FE_OVERFLOW : 0) |
@@ -195,7 +195,7 @@
 }
 
 static inline int get_except() {
-  uint16_t mxcsr = internal::get_mxcsr();
+  uint16_t mxcsr = static_cast<uint16_t>(internal::get_mxcsr());
   uint16_t enabled_excepts = ~(mxcsr >> 7) & 0x3F;
   return internal::exception_status_to_macro(enabled_excepts);
 }
@@ -273,8 +273,8 @@
   if (status_value & internal::ExceptionFlags::INEXACT)
     raise_helper(internal::ExceptionFlags::INEXACT);
 #ifdef __FE_DENORM
-  if (statusValue & internal::ExceptionFlags::Denormal) {
-    raiseHelper(internal::ExceptionFlags::Denormal);
+  if (status_value & internal::ExceptionFlags::DENORMAL) {
+    raise_helper(internal::ExceptionFlags::DENORMAL);
   }
 #endif // __FE_DENORM
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127222.435206.patch
Type: text/x-patch
Size: 1808 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20220608/fbb144f9/attachment.bin>


More information about the libc-commits mailing list