From ef6fb75144341b44acfc2cae52a8e18ec5bb995d Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 7 Jan 2025 14:27:56 -0800 Subject: [PATCH] Remove incorrect lowering rule --- cranelift/codegen/src/isa/pulley_shared/lower.isle | 13 ------------- tests/disas/pulley/pulley32_memory32.wat | 5 +++-- tests/disas/pulley/pulley64_memory32.wat | 5 +++-- 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/cranelift/codegen/src/isa/pulley_shared/lower.isle b/cranelift/codegen/src/isa/pulley_shared/lower.isle index ee32194e4994..62bdc33a1648 100644 --- a/cranelift/codegen/src/isa/pulley_shared/lower.isle +++ b/cranelift/codegen/src/isa/pulley_shared/lower.isle @@ -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))) diff --git a/tests/disas/pulley/pulley32_memory32.wat b/tests/disas/pulley/pulley32_memory32.wat index 6fccb99acc75..e28084cda070 100644 --- a/tests/disas/pulley/pulley32_memory32.wat +++ b/tests/disas/pulley/pulley32_memory32.wat @@ -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 diff --git a/tests/disas/pulley/pulley64_memory32.wat b/tests/disas/pulley/pulley64_memory32.wat index e32f59d3731e..a606a1d9348f 100644 --- a/tests/disas/pulley/pulley64_memory32.wat +++ b/tests/disas/pulley/pulley64_memory32.wat @@ -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