riscv64: Codemotion cleanups to ISLE files (#5984)

* riscv64: Fix typo in extensions

* riscv64: Move converters to top of file

* riscv64: Group up all imm12 rules

* riscv64: Move zero_reg helpers to Physical Regs section

* riscv64: Move helpers away from `clz` lowerings

These were in the middle of the `clz` rules and are kind of distracting

* riscv64: Move `cls` rules next to `ctz`/`clz`

* cranelift: Move `u8_and` / `u32_add` to Primitive Arithmetic section

* riscv64: Mark some imm12 constructors as pure

* cranelift: Move `s32_add_fallible` next to `u32_add`

* riscv64: Fix Typo
This commit is contained in:
Afonso Bordado
2023-03-13 19:20:15 +00:00
committed by GitHub
parent b50cf9bb57
commit 5c95e6fbaf
4 changed files with 88 additions and 78 deletions

View File

@@ -43,14 +43,6 @@
(decl value_type (Type) Value)
(extern extractor infallible value_type value_type)
(decl pure u32_add (u32 u32) u32)
(extern constructor u32_add u32_add)
;; Pure/fallible constructor that tries to add two `u32`s, interpreted
;; as signed values, and fails to match on overflow.
(decl pure partial s32_add_fallible (u32 u32) u32)
(extern constructor s32_add_fallible s32_add_fallible)
;; Extractor that matches a `u32` only if non-negative.
(decl u32_nonnegative (u32) u32)
(extern extractor u32_nonnegative u32_nonnegative)
@@ -83,9 +75,6 @@
(decl uimm8 (u8) Imm64)
(extern extractor uimm8 uimm8)
(decl pure u8_and (u8 u8) u8)
(extern constructor u8_and u8_and)
;;;; Primitive Type Conversions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(decl pure u8_as_u32 (u8) u32)
@@ -105,6 +94,17 @@
;;;; Primitive Arithmetic ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(decl pure u8_and (u8 u8) u8)
(extern constructor u8_and u8_and)
(decl pure u32_add (u32 u32) u32)
(extern constructor u32_add u32_add)
;; Pure/fallible constructor that tries to add two `u32`s, interpreted
;; as signed values, and fails to match on overflow.
(decl pure partial s32_add_fallible (u32 u32) u32)
(extern constructor s32_add_fallible s32_add_fallible)
(decl pure u64_add (u64 u64) u64)
(extern constructor u64_add u64_add)