|
182 | 182 | (type ValueOffset (enum (Both (value Value) (offset i32)))) |
183 | 183 | (decl pure amode_base (Value Offset32) ValueOffset) |
184 | 184 | (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)) |
186 | 186 | (if-let new_offset (i32_checked_add b offset)) |
187 | 187 | (ValueOffset.Both addr new_offset)) |
188 | 188 |
|
|
270 | 270 | (type SinkableLoad (enum (Load (inst Inst) (ty Type) (addr Value) (offset u8)))) |
271 | 271 | (decl pure partial sinkable_load (Value) SinkableLoad) |
272 | 272 | (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)) |
274 | 274 | (if-let true (is_native_endianness (endianness flags))) |
275 | 275 | (if-let true (memflags_nontrapping flags)) |
276 | 276 | (if-let offset8 (i32_try_into_u8 offset)) |
|
345 | 345 | ;; used if the oob condition is true. Otherwise the raw address is used for the |
346 | 346 | ;; load/store. |
347 | 347 | (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) |
349 | 349 | ;; This must be a wasm load/store according to `MemFlags`, namely that it's |
350 | 350 | ;; got a "HEAP_OUT_OF_BOUNDS" trap code and it's little-endian. |
351 | 351 | (if-let true (memflags_is_wasm flags)) |
|
381 | 381 | (decl pure host_offset (Value) HostOffset) |
382 | 382 | (type HostOffset (enum (All (a Value) (b i32)))) |
383 | 383 | (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)) |
386 | 386 |
|
387 | 387 | ;; Helper to test whether the first argument `oob` contains a condition for |
388 | 388 | ;; matching whether second argument `addr` is out-of-bounds. Searches for a |
|
392 | 392 |
|
393 | 393 | ;; 32-bit hosts: search either side of the `iadd` for the base address within |
394 | 394 | ;; `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))) |
396 | 396 | (if-let (OobCond.All bound n) (wasm_oob_cond wasm_addr oob)) |
397 | 397 | (if-let (PointerWidth.PointerWidth32) (pointer_width)) |
398 | 398 | (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)) |
400 | 400 | (if-let (OobCond.All bound n) (wasm_oob_cond wasm_addr oob)) |
401 | 401 | (if-let (PointerWidth.PointerWidth32) (pointer_width)) |
402 | 402 | (OobSelect.All base bound wasm_addr n)) |
403 | 403 |
|
404 | 404 | ;; 64-bit hosts: also search either side, but the wasm address must also be |
405 | 405 | ;; 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))) |
407 | 407 | (if-let (OobCond.All bound n) (wasm_oob_cond wasm_addr_ext oob)) |
408 | 408 | (if-let wasm_addr (wasm32_addr_for_host64 wasm_addr_ext)) |
409 | 409 | (if-let (PointerWidth.PointerWidth64) (pointer_width)) |
410 | 410 | (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)) |
412 | 412 | (if-let (OobCond.All bound n) (wasm_oob_cond wasm_addr_ext oob)) |
413 | 413 | (if-let wasm_addr (wasm32_addr_for_host64 wasm_addr_ext)) |
414 | 414 | (if-let (PointerWidth.PointerWidth64) (pointer_width)) |
|
419 | 419 | ;; extended from 32-bits. That means that this only matches `(uextend ...)` or |
420 | 420 | ;; an `iconst` which already fits in 32 bits. |
421 | 421 | (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) |
423 | 423 | (rule (wasm32_addr_for_host64 val @ (u32_from_iconst _)) val) |
424 | 424 |
|
425 | 425 | ;; Helper to search for the first argument, `wasm_addr`, within the oob |
426 | 426 | ;; condition second argument, `oob`. It should appear as an integer comparison |
427 | 427 | ;; of the address against a particular bound. |
428 | 428 | (decl pure partial wasm_oob_cond (Value Value) OobCond) |
429 | 429 | (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)))) |
431 | 431 | (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)) |
433 | 433 | (OobCond.All bound n)) |
434 | 434 |
|
435 | 435 | ;;;; Newtypes for Different Register Classes ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|
0 commit comments