-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
riscv64: Consolidate conditional moves into one instruction (#7145)
* riscv64: Add codegen tests for min/max * riscv64: Remove unused `Type` payload from `Select` * riscv64: Add codegen test for brif * riscv64: Consolidate conditional moves into one instruction This commit removes the `IntSelect` and `SelectReg` pseudo-instructions from the riscv64 backend and consolidates them into the `Select` instruction. Additionally the `Select` instruction is updated to subsume the functionality of these two previous instructions. Namely `Select` now operates with `ValueRegs` to handle i128 and additionally takes an `IntegerCompare` as the condition for the conditional branch to use. This commit touches a fair bit of the backend since conditional selection of registers was used in quite a few places. The previous `gen_select_*` functions are replaced with new typed equivalents of `gen_select_{xreg,vreg,freg,regs}`. Furthermore new `cmp_*` helpers were added to create `IntegerCompare` instructions which sort-of match conditional branch instructions, or at least the pnemonics they use. Finally since this affected the `select` CLIF instruction itself I went ahead and did some refactoring there too. The `select` instruction creates an `IntegerCompare` from its argument to use to generate the appropriate register selection instruction. This is basically the same thing that `brif` does and now both go through a new helper, `lower_int_compare`, which takes a `Value` and produces an `IntegerCompare` representing if that value is either true or false. This enables folding an `icmp` or an `fcmp`, for example, directly into a branching instruction. * Fix a test * Favor sign-extension in equality comparisons
- Loading branch information
1 parent
993e26e
commit d4e4f61
Showing
75 changed files
with
2,988 additions
and
2,322 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.