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.
Currently the macOS version miscompiles basically anything involving
double
constants. On 32-bit machines (e.g. Linux builds), for astruct rtx_def *r
that represents a const double the value is split into two parts, accessed asand the value is usually copied out like
which assumes that
CONST_DOUBLE_LOW
andCONST_DOUBLE_HIGH
are 4 bytes apart in memory. On macOS we compile as 64-bit though, meaning thisbcopy
will ignoreCONST_DOUBLE_HIGH
.Currently on macOS
HOST_BITS_PER_LONG
is32
andHOST_WIDE_INT
isint
which is kind of a lie. Technically we could fix const doubles by changingHOST_BITS_PER_LONG
to64
(then the code would put entire double values inCONST_DOUBLE_LOW
instead of splitting it into two parts) but I'm concerned that this would break matching, since other code usesCONST_DOUBLE_LOW
/CONST_DOUBLE_HIGH
directly for hashing and such.Updating all the backends was probably not necessary but it's nice to be consistent I guess.