Skip to content
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

Fix ImmLogic.invert(), and with it, fcopysign and float_misc test. #1582

Merged
merged 1 commit into from
Apr 23, 2020

Conversation

cfallin
Copy link
Member

@cfallin cfallin commented Apr 23, 2020

Previously, fcopysign was mysteriously failing to pass the
float_misc spec test. This was tracked down to bad logical-immediate
masks used to separate the sign and not-sign bits. In particular, the
masks for the and-not operations were wrong. The invert() function on
an ImmLogic immediate, it turns out, assumed every immediate would be
used by a 64-bit instruction; ImmLogic immediates are subtly different
for 32-bit instructions. This change tracks the instruction size (32 or
64 bits) intended for use with each such immediate, and passes it back
into maybe_from_u64 when computing the inverted immediate.

Addresses one of the failures (float_misc) for #1521 (test failures)
and presumably helps #1519 (SpiderMonkey integration).

@cfallin cfallin added the cranelift:area:aarch64 Issues related to AArch64 backend. label Apr 23, 2020
@github-actions github-actions bot added the cranelift Issues related to the Cranelift code generator label Apr 23, 2020
@github-actions
Copy link

Subscribe to Label Action

cc @bnjbvr

This issue or pull request has been labeled: "cranelift", "cranelift:area:aarch64"

Thus the following users have been cc'd because of the following labels:

  • bnjbvr: cranelift

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

build.rs Outdated Show resolved Hide resolved
Copy link
Member

@bnjbvr bnjbvr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, with Joey's suggestions (thanks!) and an additional rustfmt. Thanks!

Previously, `fcopysign` was mysteriously failing to pass the
`float_misc` spec test. This was tracked down to bad logical-immediate
masks used to separate the sign and not-sign bits. In particular, the
masks for the and-not operations were wrong. The `invert()` function on
an `ImmLogic` immediate, it turns out, assumed every immediate would be
used by a 64-bit instruction; `ImmLogic` immediates are subtly different
for 32-bit instructions. This change tracks the instruction size (32 or
64 bits) intended for use with each such immediate, and passes it back
into `maybe_from_u64` when computing the inverted immediate.

Addresses several of the failures (`float_misc`, `f32_bitwise`) for
 bytecodealliance#1521 (test failures) and presumably helps bytecodealliance#1519 (SpiderMonkey
integration).
@cfallin
Copy link
Member Author

cfallin commented Apr 23, 2020

Updated with both of @jgouly's suggestions -- will merge once green. Thanks!

@cfallin cfallin merged commit cb896e0 into bytecodealliance:master Apr 23, 2020
@cfallin cfallin deleted the aarch64-fcopysign branch May 6, 2020 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cranelift:area:aarch64 Issues related to AArch64 backend. cranelift Issues related to the Cranelift code generator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants