Skip to content

Cranelift comparison and select rules - #14268

Merged
cfallin merged 1 commit into
bytecodealliance:mainfrom
yagehu:opt
Sep 3, 2026
Merged

Cranelift comparison and select rules#14268
cfallin merged 1 commit into
bytecodealliance:mainfrom
yagehu:opt

Conversation

@yagehu

@yagehu yagehu commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

This commit adds the following integer comparison involving min/max and select rules that lift bitwise and arithmetic not.

smin(x, y) > smax(x, y) --> false
umin(x, y) > umax(x, y) --> false
smin(x, y) <= smax(x, y) --> true
umin(x, y) <= umax(x, y) --> true
smin(x, y) == smax(x, y) --> x == y
smin(x, y) != smax(x, y) --> x != y
select(c, ~x, ~y) --> ~select(c, x, y)
select(c, -x, -y) --> -select(c, x, y)

This commit adds the following integer comparison involving min/max
and select rules that lift bitwise and arithmetic not.

```
smin(x, y) > smax(x, y) --> false
umin(x, y) > umax(x, y) --> false
smin(x, y) <= smax(x, y) --> true
umin(x, y) <= umax(x, y) --> true
smin(x, y) == smax(x, y) --> x == y
smin(x, y) != smax(x, y) --> x != y
select(c, ~x, ~y) --> ~select(c, x, y)
select(c, -x, -y) --> -select(c, x, y)
```

Co-authored-by: Zijian Yi <zijianyi66@gmail.com>
@yagehu
yagehu requested a review from a team as a code owner September 2, 2026 17:48
@yagehu
yagehu requested review from cfallin and removed request for a team September 2, 2026 17:48
@github-actions github-actions Bot added cranelift Issues related to the Cranelift code generator isle Related to the ISLE domain-specific language labels Sep 2, 2026
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

Subscribe to Label Action

cc @avanhatt, @cfallin, @fitzgen, @mmcloughlin

Details This issue or pull request has been labeled: "cranelift", "isle"

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

  • avanhatt: isle
  • cfallin: isle
  • fitzgen: isle
  • mmcloughlin: isle

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

Learn more.

@cfallin cfallin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These sound right, and more importantly verifier passes them and adds new queries, so LGTM!

@cfallin
cfallin added this pull request to the merge queue Sep 3, 2026
Merged via the queue into bytecodealliance:main with commit 3c767c0 Sep 3, 2026
54 checks passed
@yagehu
yagehu deleted the opt branch September 3, 2026 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cranelift Issues related to the Cranelift code generator isle Related to the ISLE domain-specific language

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants