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

Cranelift(x64): Fix lowering for store(bitop(x, load(addr)), addr) for bitops on floats #9003

Merged
merged 2 commits into from
Jul 25, 2024

Conversation

fitzgen
Copy link
Member

@fitzgen fitzgen commented Jul 24, 2024

x86-64 allows us to do these kinds of read-modify-write operations in one instruction in general, however we also need to ensure that the non-memory operand is in a GPR. Because Cranelift allows b{and,or,xor}s on floating point types, that means we might need to insert a move from an XMM to a GPR.

Found in #8941 but is actually unrelated to safepoints and stack maps, they just made this pattern more likely to occur. AFAICT, Wasm can't ever trigger this bug, and would only be something of concern for other CLIF producers.

…for bitops on floats

x86-64 allows us to do these kinds of read-modify-write operations in one
instruction in general, however we also need to ensure that the non-memory
operand is in a GPR. Because Cranelift allows `b{and,or,xor}`s on floating point
types, that means we might need to insert a move from an XMM to a GPR.

Co-Authored-By: Jamey Sharp <jsharp@fastly.com>
@fitzgen fitzgen requested a review from a team as a code owner July 24, 2024 17:57
@fitzgen fitzgen requested review from cfallin and removed request for a team July 24, 2024 17:57
@github-actions github-actions bot added cranelift Issues related to the Cranelift code generator cranelift:area:x64 Issues related to x64 codegen labels Jul 24, 2024
@fitzgen fitzgen enabled auto-merge July 24, 2024 23:12
@fitzgen fitzgen added this pull request to the merge queue Jul 24, 2024
Merged via the queue into bytecodealliance:main with commit 6f41aed Jul 25, 2024
49 checks passed
@fitzgen fitzgen deleted the fix-rmw-and-floats-on-x64 branch July 25, 2024 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cranelift:area:x64 Issues related to x64 codegen cranelift Issues related to the Cranelift code generator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants