Skip to content

Commit

Permalink
Remove incorrect lowering rule
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrichton committed Jan 7, 2025
1 parent 862f09c commit ef6fb75
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 17 deletions.
13 changes: 0 additions & 13 deletions cranelift/codegen/src/isa/pulley_shared/lower.isle
Original file line number Diff line number Diff line change
Expand Up @@ -128,25 +128,12 @@
code))
(side_effect (pulley_xbc32_bound32_trap a b 0 code)))

;; a >= b == a > b - 1, so handle that here too.
(rule 1 (lower (trapnz (icmp (IntCC.UnsignedGreaterThanOrEqual)
a
b @ (value_type $I32))
code))
(side_effect (pulley_xbc32_bound32_trap a b 1 code)))

(rule 1 (lower (trapnz (icmp (IntCC.UnsignedGreaterThan)
(uextend a @ (value_type $I32))
b @ (value_type $I64))
code))
(side_effect (pulley_xbc32_bound64_trap a b 0 code)))

(rule 1 (lower (trapnz (icmp (IntCC.UnsignedGreaterThanOrEqual)
(uextend a @ (value_type $I32))
b @ (value_type $I64))
code))
(side_effect (pulley_xbc32_bound64_trap a b 1 code)))

(rule 2 (lower (trapnz (icmp (IntCC.UnsignedGreaterThan)
a
(isub b @ (value_type $I32) (u8_from_iconst c)))
Expand Down
5 changes: 3 additions & 2 deletions tests/disas/pulley/pulley32_memory32.wat
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,13 @@
;; wasm[0]::function[0]::load8:
;; push_frame
;; xload32le_offset8 x6, x0, 52
;; xbc32_bound32_trap x2, x6, 1
;; xload32le_offset8 x7, x0, 48
;; br_if_xulteq32 x6, x2, 0x14 // target = 0x19
;; c: xload32le_offset8 x7, x0, 48
;; xadd32 x7, x7, x2
;; xload8_u32_offset8 x0, x7, 0
;; pop_frame
;; ret
;; 19: trap
;;
;; wasm[0]::function[1]::load16:
;; push_frame
Expand Down
5 changes: 3 additions & 2 deletions tests/disas/pulley/pulley64_memory32.wat
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@
;; push_frame
;; xload64le_offset8 x8, x0, 104
;; zext32 x7, x2
;; xbc32_bound64_trap x2, x8, 1
;; xload64le_offset8 x8, x0, 96
;; br_if_xulteq64 x8, x7, 0x14 // target = 0x1c
;; f: xload64le_offset8 x8, x0, 96
;; xadd64 x8, x8, x7
;; xload8_u32_offset8 x0, x8, 0
;; pop_frame
;; ret
;; 1c: trap
;;
;; wasm[0]::function[1]::load16:
;; push_frame
Expand Down

0 comments on commit ef6fb75

Please sign in to comment.