build: use SSE math on 32-bit x86 also when the tarball name is given - #63350
Merged
Merged
Conversation
The -mfpmath=sse from #43978 was added inside the block that computes JULIA_BINARYDIST_FILENAME, so it did not apply when that variable is set, as it is in CI (julia-buildkite exports it). Julia's C runtime was therefore built with x87 math on i686 there.
Member
Author
|
Merging early, as this is Windows-only and mingw23-build and -test passed CI. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#43978 added
-mfpmath=ssetoJCFLAGSon 32-bit x86, so that Julia's C runtime doesnot use 80-bit x87 math. It went inside the
ifeq ($(JULIA_BINARYDIST_FILENAME),)block that computes the
binary-disttarball name, so the flag is dropped wheneverthat variable is already set. CI sets it: julia-buildkite's
build_envs.shexportsit. The i686 Linux and Windows CI builds and nightlies have therefore compiled
src/*.cwith x87 math all along (make ARCH=i686 print-JCFLAGSincludes-mfpmath=sse, andJULIA_BINARYDIST_FILENAME=x make ARCH=i686 print-JCFLAGSdoesnot).
The x87 build now fails a test once Windows i686 is built with GCC 15.2 and
BinaryBuilder's MinGW headers (the planned CI toolchain, matching
CompilerSupportLibraries).
Base.fma_floatat runtime, which on Windows uses theemulated
julia_fmainruntime_intrinsics.c, returnsNaNforfma(floatmax(), 2.0, -floatmax())and similar inputs (test/math.jl:1551-1567).Those headers classify floats with an out-of-line
__fpclassify, which sees therounded double, while the rest of the function computes in x87 extended precision.
The mingw-builds GCC 12 used so far inlined an
fxamon the unrounded valueinstead, which matched. With
-mfpmath=ssethe results are correct either way;without it, a standalone copy of the function gives
nanwith-D__CRT__NO_INLINE.This moves the flag out of that block, so it always applies on 32-bit x86.
Assisted by: Opus 5.5