|
1956 | 1956 | (decl imm12_from_value (Imm12) Value) |
1957 | 1957 | (extractor |
1958 | 1958 | (imm12_from_value n) |
1959 | | - (iconst (u64_from_imm64 (imm12_from_u64 n)))) |
| 1959 | + (iconst _ (u64_from_imm64 (imm12_from_u64 n)))) |
1960 | 1960 | ;; Conceptually the same as `imm12_from_value`, but tries negating the constant |
1961 | 1961 | ;; value (first sign-extending to handle narrow widths). |
1962 | 1962 | (spec (imm12_from_negated_value arg) |
|
1980 | 1980 | ) |
1981 | 1981 | (decl pure partial imm12_from_negated_value (Value) Imm12) |
1982 | 1982 | (rule imm12_from_negated_value |
1983 | | - (imm12_from_negated_value (has_type ty (iconst n))) |
| 1983 | + (imm12_from_negated_value (has_type ty (iconst _ n))) |
1984 | 1984 | (if-let (imm12_from_u64 imm) (i64_cast_unsigned (i64_checked_neg (i64_sextend_imm64 ty n)))) |
1985 | 1985 | imm) |
1986 | 1986 |
|
|
3755 | 3755 | (MInst.TrapIf (cond_br_cond (Cond.Hs)) tc)))) |
3756 | 3756 |
|
3757 | 3757 | (decl sink_atomic_load (Inst) Reg) |
3758 | | -(rule (sink_atomic_load x @ (atomic_load _ addr)) |
| 3758 | +(rule (sink_atomic_load x @ (atomic_load _ _ addr)) |
3759 | 3759 | (let ((_ Unit (sink_inst x))) |
3760 | 3760 | (put_in_reg addr))) |
3761 | 3761 |
|
|
3777 | 3777 | (alu_rrr op ty x y)) |
3778 | 3778 |
|
3779 | 3779 | ;; Special cases for when one operand is a constant. |
3780 | | -(rule (alu_rs_imm_logic_commutative op ty x (iconst k)) |
| 3780 | +(rule (alu_rs_imm_logic_commutative op ty x (iconst _ k)) |
3781 | 3781 | (if-let imm (imm_logic_from_imm64 ty k)) |
3782 | 3782 | (alu_rr_imm_logic op ty x imm)) |
3783 | | -(rule 1 (alu_rs_imm_logic_commutative op ty (iconst k) x) |
| 3783 | +(rule 1 (alu_rs_imm_logic_commutative op ty (iconst _ k) x) |
3784 | 3784 | (if-let imm (imm_logic_from_imm64 ty k)) |
3785 | 3785 | (alu_rr_imm_logic op ty x imm)) |
3786 | 3786 |
|
3787 | 3787 | ;; Special cases for when one operand is shifted left by a constant. |
3788 | | -(rule (alu_rs_imm_logic_commutative op ty x (ishl y (iconst k))) |
| 3788 | +(rule (alu_rs_imm_logic_commutative op ty x (ishl _ y (iconst _ k))) |
3789 | 3789 | (if-let amt (lshl_from_imm64 ty k)) |
3790 | 3790 | (alu_rrr_shift op ty x y amt)) |
3791 | | -(rule 1 (alu_rs_imm_logic_commutative op ty (ishl x (iconst k)) y) |
| 3791 | +(rule 1 (alu_rs_imm_logic_commutative op ty (ishl _ x (iconst _ k)) y) |
3792 | 3792 | (if-let amt (lshl_from_imm64 ty k)) |
3793 | 3793 | (alu_rrr_shift op ty y x amt)) |
3794 | 3794 |
|
|
3805 | 3805 | (decl alu_rs_imm_logic (ALUOp Type Value Value) Reg) |
3806 | 3806 | (rule -1 (alu_rs_imm_logic op ty x y) |
3807 | 3807 | (alu_rrr op ty x y)) |
3808 | | -(rule (alu_rs_imm_logic op ty x (iconst k)) |
| 3808 | +(rule (alu_rs_imm_logic op ty x (iconst _ k)) |
3809 | 3809 | (if-let imm (imm_logic_from_imm64 ty k)) |
3810 | 3810 | (alu_rr_imm_logic op ty x imm)) |
3811 | | -(rule (alu_rs_imm_logic op ty x (ishl y (iconst k))) |
| 3811 | +(rule (alu_rs_imm_logic op ty x (ishl _ y (iconst _ k))) |
3812 | 3812 | (if-let amt (lshl_from_imm64 ty k)) |
3813 | 3813 | (alu_rrr_shift op ty x y amt)) |
3814 | 3814 |
|
|
3905 | 3905 |
|
3906 | 3906 | (rule 0 (amode ty val offset) |
3907 | 3907 | (amode_no_more_iconst ty val offset)) |
3908 | | -(rule 1 (amode ty (iadd x (i32_from_iconst y)) offset) |
| 3908 | +(rule 1 (amode ty (iadd _ x (i32_from_iconst y)) offset) |
3909 | 3909 | (if-let new_offset (i32_checked_add y offset)) |
3910 | 3910 | (amode_no_more_iconst ty x new_offset)) |
3911 | | -(rule 2 (amode ty (iadd (i32_from_iconst x) y) offset) |
| 3911 | +(rule 2 (amode ty (iadd _ (i32_from_iconst x) y) offset) |
3912 | 3912 | (if-let new_offset (i32_checked_add x offset)) |
3913 | 3913 | (amode_no_more_iconst ty y new_offset)) |
3914 | 3914 |
|
3915 | 3915 | (rule 3 |
3916 | | - (amode ty (stack_addr slot offset1) offset2) |
| 3916 | + (amode ty (stack_addr _ slot offset1) offset2) |
3917 | 3917 | (AMode.SlotOffset |
3918 | 3918 | (abi_stackslot_offset_into_slot_region slot offset1 offset2))) |
3919 | 3919 |
|
|
3939 | 3939 | ;; instructions. Constants on the other hand added to the amode represent only |
3940 | 3940 | ;; a single instruction folded in, so fewer instructions should be generated |
3941 | 3941 | ;; with these higher priority than the rules above. |
3942 | | -(rule 3 (amode_no_more_iconst ty (iadd x y) offset) |
| 3942 | +(rule 3 (amode_no_more_iconst ty (iadd _ x y) offset) |
3943 | 3943 | (AMode.RegReg (amode_add x offset) y)) |
3944 | | -(rule 4 (amode_no_more_iconst ty (iadd x (uextend y @ (value_type $I32))) offset) |
| 3944 | +(rule 4 (amode_no_more_iconst ty (iadd _ x (uextend _ y @ (value_type $I32))) offset) |
3945 | 3945 | (AMode.RegExtended (amode_add x offset) y (ExtendOp.UXTW))) |
3946 | | -(rule 4 (amode_no_more_iconst ty (iadd x (sextend y @ (value_type $I32))) offset) |
| 3946 | +(rule 4 (amode_no_more_iconst ty (iadd _ x (sextend _ y @ (value_type $I32))) offset) |
3947 | 3947 | (AMode.RegExtended (amode_add x offset) y (ExtendOp.SXTW))) |
3948 | | -(rule 5 (amode_no_more_iconst ty (iadd (uextend x @ (value_type $I32)) y) offset) |
| 3948 | +(rule 5 (amode_no_more_iconst ty (iadd _ (uextend _ x @ (value_type $I32)) y) offset) |
3949 | 3949 | (AMode.RegExtended (amode_add y offset) x (ExtendOp.UXTW))) |
3950 | | -(rule 5 (amode_no_more_iconst ty (iadd (sextend x @ (value_type $I32)) y) offset) |
| 3950 | +(rule 5 (amode_no_more_iconst ty (iadd _ (sextend _ x @ (value_type $I32)) y) offset) |
3951 | 3951 | (AMode.RegExtended (amode_add y offset) x (ExtendOp.SXTW))) |
3952 | 3952 |
|
3953 | 3953 | ;; `RegScaled*` rules where this matches an addition of an "index register" to a |
|
3957 | 3957 | ;; Note that this can additionally bundle an extending operation but the |
3958 | 3958 | ;; extension must happen before the shift. This will pattern-match the shift |
3959 | 3959 | ;; first and then if that succeeds afterwards try to find an extend. |
3960 | | -(rule 6 (amode_no_more_iconst ty (iadd x (ishl y (iconst (u64_from_imm64 n)))) offset) |
| 3960 | +(rule 6 (amode_no_more_iconst ty (iadd _ x (ishl _ y (iconst _ (u64_from_imm64 n)))) offset) |
3961 | 3961 | (if-let true (u64_eq (ty_bytes ty) (u64_wrapping_shl 1 (shift_masked_imm ty n)))) |
3962 | 3962 | (amode_reg_scaled (amode_add x offset) y)) |
3963 | | -(rule 7 (amode_no_more_iconst ty (iadd (ishl y (iconst (u64_from_imm64 n))) x) offset) |
| 3963 | +(rule 7 (amode_no_more_iconst ty (iadd _ (ishl _ y (iconst _ (u64_from_imm64 n))) x) offset) |
3964 | 3964 | (if-let true (u64_eq (ty_bytes ty) (u64_wrapping_shl 1 (shift_masked_imm ty n)))) |
3965 | 3965 | (amode_reg_scaled (amode_add x offset) y)) |
3966 | 3966 |
|
3967 | 3967 | (decl amode_reg_scaled (Reg Value) AMode) |
3968 | 3968 | (rule 0 (amode_reg_scaled base index) |
3969 | 3969 | (AMode.RegScaled base index)) |
3970 | | -(rule 1 (amode_reg_scaled base (uextend index @ (value_type $I32))) |
| 3970 | +(rule 1 (amode_reg_scaled base (uextend _ index @ (value_type $I32))) |
3971 | 3971 | (AMode.RegScaledExtended base index (ExtendOp.UXTW))) |
3972 | | -(rule 1 (amode_reg_scaled base (sextend index @ (value_type $I32))) |
| 3972 | +(rule 1 (amode_reg_scaled base (sextend _ index @ (value_type $I32))) |
3973 | 3973 | (AMode.RegScaledExtended base index (ExtendOp.SXTW))) |
3974 | 3974 |
|
3975 | 3975 | ;; Helper to add a 32-bit signed immediate to the register provided. This will |
|
4007 | 4007 |
|
4008 | 4008 |
|
4009 | 4009 | (decl sink_load_into_addr (Type Inst) Reg) |
4010 | | -(rule (sink_load_into_addr ty x @ (load _ addr (offset32 offset))) |
| 4010 | +(rule (sink_load_into_addr ty x @ (load _ _ addr (offset32 offset))) |
4011 | 4011 | (let ((_ Unit (sink_inst x))) |
4012 | 4012 | (add_imm_to_addr addr (i64_cast_unsigned offset)))) |
4013 | 4013 |
|
|
0 commit comments