Skip to content

Commit 80e0140

Browse files
committed
pulley changes, cargo fmt
1 parent 8a5b672 commit 80e0140

File tree

3 files changed

+416
-416
lines changed

3 files changed

+416
-416
lines changed

cranelift/codegen/src/isa/pulley_shared/inst.isle

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@
182182
(type ValueOffset (enum (Both (value Value) (offset i32))))
183183
(decl pure amode_base (Value Offset32) ValueOffset)
184184
(rule (amode_base addr (offset32 offset)) (ValueOffset.Both addr offset))
185-
(rule 1 (amode_base (iadd addr (i32_from_iconst b)) (offset32 offset))
185+
(rule 1 (amode_base (iadd _ addr (i32_from_iconst b)) (offset32 offset))
186186
(if-let new_offset (i32_checked_add b offset))
187187
(ValueOffset.Both addr new_offset))
188188

@@ -270,7 +270,7 @@
270270
(type SinkableLoad (enum (Load (inst Inst) (ty Type) (addr Value) (offset u8))))
271271
(decl pure partial sinkable_load (Value) SinkableLoad)
272272
(rule (sinkable_load value @ (value_type ty))
273-
(if-let inst @ (load flags addr (offset32 offset)) (is_sinkable_inst value))
273+
(if-let inst @ (load _ flags addr (offset32 offset)) (is_sinkable_inst value))
274274
(if-let true (is_native_endianness (endianness flags)))
275275
(if-let true (memflags_nontrapping flags))
276276
(if-let offset8 (i32_try_into_u8 offset))
@@ -345,7 +345,7 @@
345345
;; used if the oob condition is true. Otherwise the raw address is used for the
346346
;; load/store.
347347
(decl pure partial wasm_g32 (Value Offset32 MemFlags Type) G32)
348-
(rule (wasm_g32 (select oob (u64_from_iconst 0) raw_addr) (offset32 0) flags ty)
348+
(rule (wasm_g32 (select _ oob (u64_from_iconst 0) raw_addr) (offset32 0) flags ty)
349349
;; This must be a wasm load/store according to `MemFlags`, namely that it's
350350
;; got a "HEAP_OUT_OF_BOUNDS" trap code and it's little-endian.
351351
(if-let true (memflags_is_wasm flags))
@@ -381,8 +381,8 @@
381381
(decl pure host_offset (Value) HostOffset)
382382
(type HostOffset (enum (All (a Value) (b i32))))
383383
(rule 0 (host_offset val) (HostOffset.All val 0))
384-
(rule 1 (host_offset (iadd val @ (iadd _ _) (i32_from_iconst n))) (HostOffset.All val n))
385-
(rule 2 (host_offset (iadd (i32_from_iconst n) val @ (iadd _ _))) (HostOffset.All val n))
384+
(rule 1 (host_offset (iadd _ val @ (iadd _ _ _) (i32_from_iconst n))) (HostOffset.All val n))
385+
(rule 2 (host_offset (iadd _ (i32_from_iconst n) val @ (iadd _ _ _))) (HostOffset.All val n))
386386

387387
;; Helper to test whether the first argument `oob` contains a condition for
388388
;; matching whether second argument `addr` is out-of-bounds. Searches for a
@@ -392,23 +392,23 @@
392392

393393
;; 32-bit hosts: search either side of the `iadd` for the base address within
394394
;; `oob` to see if it's a matching condition.
395-
(rule 0 (wasm_oob_select oob (iadd base wasm_addr @ (value_type $I32)))
395+
(rule 0 (wasm_oob_select oob (iadd _ base wasm_addr @ (value_type $I32)))
396396
(if-let (OobCond.All bound n) (wasm_oob_cond wasm_addr oob))
397397
(if-let (PointerWidth.PointerWidth32) (pointer_width))
398398
(OobSelect.All base bound wasm_addr n))
399-
(rule 1 (wasm_oob_select oob (iadd wasm_addr @ (value_type $I32) base))
399+
(rule 1 (wasm_oob_select oob (iadd _ wasm_addr @ (value_type $I32) base))
400400
(if-let (OobCond.All bound n) (wasm_oob_cond wasm_addr oob))
401401
(if-let (PointerWidth.PointerWidth32) (pointer_width))
402402
(OobSelect.All base bound wasm_addr n))
403403

404404
;; 64-bit hosts: also search either side, but the wasm address must also be
405405
;; a `uextend` from a 32-bit value.
406-
(rule 0 (wasm_oob_select oob (iadd base wasm_addr_ext @ (value_type $I64)))
406+
(rule 0 (wasm_oob_select oob (iadd _ base wasm_addr_ext @ (value_type $I64)))
407407
(if-let (OobCond.All bound n) (wasm_oob_cond wasm_addr_ext oob))
408408
(if-let wasm_addr (wasm32_addr_for_host64 wasm_addr_ext))
409409
(if-let (PointerWidth.PointerWidth64) (pointer_width))
410410
(OobSelect.All base bound wasm_addr n))
411-
(rule 1 (wasm_oob_select oob (iadd wasm_addr_ext @ (value_type $I64) base))
411+
(rule 1 (wasm_oob_select oob (iadd _ wasm_addr_ext @ (value_type $I64) base))
412412
(if-let (OobCond.All bound n) (wasm_oob_cond wasm_addr_ext oob))
413413
(if-let wasm_addr (wasm32_addr_for_host64 wasm_addr_ext))
414414
(if-let (PointerWidth.PointerWidth64) (pointer_width))
@@ -419,17 +419,17 @@
419419
;; extended from 32-bits. That means that this only matches `(uextend ...)` or
420420
;; an `iconst` which already fits in 32 bits.
421421
(decl pure partial wasm32_addr_for_host64 (Value) Value)
422-
(rule (wasm32_addr_for_host64 (uextend addr @ (value_type $I32))) addr)
422+
(rule (wasm32_addr_for_host64 (uextend _ addr @ (value_type $I32))) addr)
423423
(rule (wasm32_addr_for_host64 val @ (u32_from_iconst _)) val)
424424

425425
;; Helper to search for the first argument, `wasm_addr`, within the oob
426426
;; condition second argument, `oob`. It should appear as an integer comparison
427427
;; of the address against a particular bound.
428428
(decl pure partial wasm_oob_cond (Value Value) OobCond)
429429
(type OobCond (enum (All (a Value) (b u64))))
430-
(rule (wasm_oob_cond wasm_addr (ugt wasm_addr (isub bound (u64_from_iconst n))))
430+
(rule (wasm_oob_cond wasm_addr (ugt wasm_addr (isub _ bound (u64_from_iconst n))))
431431
(OobCond.All bound n))
432-
(rule (wasm_oob_cond wasm_addr (ult (isub bound (u64_from_iconst n)) wasm_addr))
432+
(rule (wasm_oob_cond wasm_addr (ult (isub _ bound (u64_from_iconst n)) wasm_addr))
433433
(OobCond.All bound n))
434434

435435
;;;; Newtypes for Different Register Classes ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

0 commit comments

Comments
 (0)