|
51 | 51 | (if-let $true (has_zba))
|
52 | 52 | (alu_rrr (AluOPRRR.Adduw) x y))
|
53 | 53 |
|
54 |
| -;; Add with shift. We have a few of these instructions with `Zba`. |
55 |
| -(decl select_shnadd (Imm64) AluOPRRR) |
56 |
| -(rule (select_shnadd (u64_from_imm64 1)) (AluOPRRR.Sh1add)) |
57 |
| -(rule (select_shnadd (u64_from_imm64 2)) (AluOPRRR.Sh2add)) |
58 |
| -(rule (select_shnadd (u64_from_imm64 3)) (AluOPRRR.Sh3add)) |
| 54 | +;; Add with const shift. We have a few of these instructions with `Zba`. |
| 55 | +(decl pure partial match_shnadd (Imm64) AluOPRRR) |
| 56 | +(rule (match_shnadd (uimm8 1)) (AluOPRRR.Sh1add)) |
| 57 | +(rule (match_shnadd (uimm8 2)) (AluOPRRR.Sh2add)) |
| 58 | +(rule (match_shnadd (uimm8 3)) (AluOPRRR.Sh3add)) |
59 | 59 |
|
60 | 60 | (rule 4 (lower (has_type (fits_in_64 ty) (iadd x (ishl y (maybe_uextend (iconst n))))))
|
61 | 61 | (if-let $true (has_zba))
|
62 |
| - (alu_rrr (select_shnadd n) y x)) |
| 62 | + (if-let shnadd (match_shnadd n)) |
| 63 | + (alu_rrr shnadd y x)) |
63 | 64 |
|
64 | 65 | (rule 5 (lower (has_type (fits_in_64 ty) (iadd (ishl x (maybe_uextend (iconst n))) y)))
|
65 | 66 | (if-let $true (has_zba))
|
66 |
| - (alu_rrr (select_shnadd n) x y)) |
| 67 | + (if-let shnadd (match_shnadd n)) |
| 68 | + (alu_rrr shnadd x y)) |
67 | 69 |
|
68 | 70 |
|
69 |
| -;; Add with uextended shift. We have a few of these instructions with `Zba`. |
70 |
| -(decl select_shnadd_uw (Imm64) AluOPRRR) |
71 |
| -(rule (select_shnadd_uw (u64_from_imm64 1)) (AluOPRRR.Sh1adduw)) |
72 |
| -(rule (select_shnadd_uw (u64_from_imm64 2)) (AluOPRRR.Sh2adduw)) |
73 |
| -(rule (select_shnadd_uw (u64_from_imm64 3)) (AluOPRRR.Sh3adduw)) |
| 71 | +;; Add with uextended const shift. We have a few of these instructions with `Zba`. |
| 72 | +(decl pure partial match_shnadd_uw (Imm64) AluOPRRR) |
| 73 | +(rule (match_shnadd_uw (uimm8 1)) (AluOPRRR.Sh1adduw)) |
| 74 | +(rule (match_shnadd_uw (uimm8 2)) (AluOPRRR.Sh2adduw)) |
| 75 | +(rule (match_shnadd_uw (uimm8 3)) (AluOPRRR.Sh3adduw)) |
74 | 76 |
|
75 | 77 | (rule 6 (lower (has_type (fits_in_64 ty) (iadd x (ishl (uextend y) (maybe_uextend (iconst n))))))
|
76 | 78 | (if-let $true (has_zba))
|
77 |
| - (alu_rrr (select_shnadd_uw n) y x)) |
| 79 | + (if-let shnadd_uw (match_shnadd_uw n)) |
| 80 | + (alu_rrr shnadd_uw y x)) |
78 | 81 |
|
79 | 82 | (rule 7 (lower (has_type (fits_in_64 ty) (iadd (ishl (uextend x) (maybe_uextend (iconst n))) y)))
|
80 | 83 | (if-let $true (has_zba))
|
81 |
| - (alu_rrr (select_shnadd_uw n) x y)) |
| 84 | + (if-let shnadd_uw (match_shnadd_uw n)) |
| 85 | + (alu_rrr shnadd_uw x y)) |
82 | 86 |
|
83 | 87 | ;; I128 cases
|
84 | 88 | (rule 8 (lower (has_type $I128 (iadd x y)))
|
|
0 commit comments