Skip to content

x64: Remove handling of cmpps and cmppd in produces_const#4714

Merged
elliottt merged 1 commit into
bytecodealliance:mainfrom
elliottt:trevor/cmpps-produces-const
Aug 15, 2022
Merged

x64: Remove handling of cmpps and cmppd in produces_const#4714
elliottt merged 1 commit into
bytecodealliance:mainfrom
elliottt:trevor/cmpps-produces-const

Conversation

@elliottt
Copy link
Copy Markdown
Member

@elliottt elliottt commented Aug 15, 2022

On main, the cmpps and cmppd instructions will be treated as producing constants if their arguments are the same and their immediate operand is 0, which corresponds to ordered equality. The runtime behavior of this instruction is not constant however, as it will output a lane of 0s if either of the corresponding components are NaN.

This PR removes the special handling of cmpps and cmppd from produces_const, as it's not correctly identifying constants. An alternative approach here would be to say that unordered equality will produce constants, looking instead for the immediate value 8. We don't currently have any way of emitting unordered equality tests, so that would be an optimization that would be worth making if we add that capability in the future.

@elliottt elliottt marked this pull request as ready for review August 15, 2022 21:19
@elliottt elliottt enabled auto-merge (squash) August 15, 2022 22:43
@elliottt elliottt requested a review from cfallin August 15, 2022 22:43
@elliottt elliottt merged commit 498e715 into bytecodealliance:main Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants