-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Floating-point arithmetic on 386/x87 (32-bit) #785
Conversation
Codecov Report
@@ Coverage Diff @@
## master #785 +/- ##
=======================================
Coverage 99.27% 99.27%
=======================================
Files 88 88
Lines 13184 13184
=======================================
Hits 13088 13088
Misses 96 96
Flags with carried forward coverage won't be shown. Click here to find out more. |
e5e6532
to
00f95ee
Compare
@@ -30,6 +30,11 @@ if(TESTFLOAT_GEN) | |||
list(APPEND IGNORE_LIST ui64_to_f64/min) | |||
endif() | |||
|
|||
if(CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64 AND CMAKE_SIZEOF_VOID_P EQUAL 4 AND CMAKE_CXX_COMPILER_ID MATCHES GNU) | |||
# TODO: GCC 32-bit i386 build produces -0 for input 0, https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100119. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Supposedly fixed in gcc 12.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still doesn't work:
138/183 Test #103: fizzy/testfloat/ui32_to_f64/min ......................***Failed 0.01 sec
FAILURE: 8000000000000000 <- 00000000
0000000000000000 (expected)
FAILURE: 8000000000000000 <- 00000000
0000000000000000 (expected)
FAILURE: 8000000000000000 <- 00000000
0000000000000000 (expected)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The bug is indeed fixed in GCC 12.1. Are you sure we are using GCC 12? Maybe there is some other bug lurking here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ran it on the CI, which I believed had 12, but now on a second look it is 11.
Rebased on top of #745 (this included the disable NaN checks commit), and then master. |
880d4af
to
aca5b5f
Compare
a06cb2b
to
49cf8d8
Compare
@chfast are you okay merging this? |
With optimized build in GCC 12 I have these failures:
|
@chfast let's shelve this then for now |
8d8a178
to
2210c5b
Compare
@@ -71,6 +71,12 @@ if(CMAKE_CXX_COMPILER_ID MATCHES Clang) | |||
endif() | |||
endif() | |||
|
|||
if(CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64 AND CMAKE_SIZEOF_VOID_P EQUAL 4) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
x86_64
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it's different on true 386, but I have not way of checking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sure it should be i386
on any non-64-bit x86 (at some point they tried to retrofit ia32
though).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can fixed if someone would use such system (I doubt this will ever happen). At this point I'm not sure what name CMake uses because this is not specified except they mention uname
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some search suggest that it may return the following: x86
, i386
, i686
.
See https://boringssl.googlesource.com/boringssl/+/refs/heads/2272/CMakeLists.txt and http://www.autoscool-clermont.com/blum/wp-content/themes/matrix/inc/kirki/assets/js/vendor/codemirror/mode/cmake/index.html (which has set(X86_ALIASES x86 i386 i686 x86_64 amd64)
).
@@ -71,6 +71,12 @@ if(CMAKE_CXX_COMPILER_ID MATCHES Clang) | |||
endif() | |||
endif() | |||
|
|||
if(CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64 AND CMAKE_SIZEOF_VOID_P EQUAL 4) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about sorting it out with:
if(CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64 AND CMAKE_SIZEOF_VOID_P EQUAL 4) | |
# This is currently is for checking 32-bit mode on x86_64. | |
# TODO: potentially include x86, i386, i686 here | |
if(CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64 AND CMAKE_SIZEOF_VOID_P EQUAL 4) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also just realised that basically this check here enables "32-bit mode support" as opposed to supporting x86. Maybe just documenting that too is good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chfast please add this and then we can merge
Also see #785 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make the required changes yourself.
1bebb1c
to
8c510c9
Compare
Opt-in for floating-point implementation with SSE2.
This test fails in i386 + SSE2 builds by GCC. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100119.
No description provided.