@@ -40,24 +40,20 @@ def LaneIdx#SIZE : ImmLeaf<i32, "return 0 <= Imm && Imm < "#SIZE#";">;
40
40
//===----------------------------------------------------------------------===//
41
41
42
42
// Load: v128.load
43
- multiclass SIMDLoad<ValueType vec_t> {
44
- let mayLoad = 1, UseNamedOperandTable = 1 in
45
- defm LOAD_#vec_t :
46
- SIMD_I<(outs V128:$dst), (ins P2Align:$p2align, offset32_op:$off, I32:$addr),
47
- (outs), (ins P2Align:$p2align, offset32_op:$off), [],
48
- "v128.load\t$dst, ${off}(${addr})$p2align",
49
- "v128.load\t$off$p2align", 0>;
50
- }
51
-
52
- foreach vec_t = [v16i8, v8i16, v4i32, v2i64, v4f32, v2f64] in {
53
- defm "" : SIMDLoad<vec_t>;
43
+ let mayLoad = 1, UseNamedOperandTable = 1 in
44
+ defm LOAD_V128 :
45
+ SIMD_I<(outs V128:$dst), (ins P2Align:$p2align, offset32_op:$off, I32:$addr),
46
+ (outs), (ins P2Align:$p2align, offset32_op:$off), [],
47
+ "v128.load\t$dst, ${off}(${addr})$p2align",
48
+ "v128.load\t$off$p2align", 0>;
54
49
55
50
// Def load and store patterns from WebAssemblyInstrMemory.td for vector types
56
- def : LoadPatNoOffset<vec_t, load, !cast<NI>("LOAD_"#vec_t)>;
57
- def : LoadPatImmOff<vec_t, load, regPlusImm, !cast<NI>("LOAD_"#vec_t)>;
58
- def : LoadPatImmOff<vec_t, load, or_is_add, !cast<NI>("LOAD_"#vec_t)>;
59
- def : LoadPatOffsetOnly<vec_t, load, !cast<NI>("LOAD_"#vec_t)>;
60
- def : LoadPatGlobalAddrOffOnly<vec_t, load, !cast<NI>("LOAD_"#vec_t)>;
51
+ foreach vec_t = [v16i8, v8i16, v4i32, v2i64, v4f32, v2f64] in {
52
+ def : LoadPatNoOffset<vec_t, load, LOAD_V128>;
53
+ def : LoadPatImmOff<vec_t, load, regPlusImm, LOAD_V128>;
54
+ def : LoadPatImmOff<vec_t, load, or_is_add, LOAD_V128>;
55
+ def : LoadPatOffsetOnly<vec_t, load, LOAD_V128>;
56
+ def : LoadPatGlobalAddrOffOnly<vec_t, load, LOAD_V128>;
61
57
}
62
58
63
59
// vNxM.load_splat
@@ -109,24 +105,20 @@ def : LoadPatGlobalAddrOffOnly<!cast<ValueType>(args[0]),
109
105
}
110
106
111
107
// Store: v128.store
112
- multiclass SIMDStore<ValueType vec_t> {
113
- let mayStore = 1, UseNamedOperandTable = 1 in
114
- defm STORE_#vec_t :
115
- SIMD_I<(outs), (ins P2Align:$p2align, offset32_op:$off, I32:$addr, V128:$vec),
116
- (outs), (ins P2Align:$p2align, offset32_op:$off), [],
117
- "v128.store\t${off}(${addr})$p2align, $vec",
118
- "v128.store\t$off$p2align", 1>;
119
- }
108
+ let mayStore = 1, UseNamedOperandTable = 1 in
109
+ defm STORE_V128 :
110
+ SIMD_I<(outs), (ins P2Align:$p2align, offset32_op:$off, I32:$addr, V128:$vec),
111
+ (outs), (ins P2Align:$p2align, offset32_op:$off), [],
112
+ "v128.store\t${off}(${addr})$p2align, $vec",
113
+ "v128.store\t$off$p2align", 1>;
120
114
121
115
foreach vec_t = [v16i8, v8i16, v4i32, v2i64, v4f32, v2f64] in {
122
- defm "" : SIMDStore<vec_t>;
123
-
124
116
// Def load and store patterns from WebAssemblyInstrMemory.td for vector types
125
- def : StorePatNoOffset<vec_t, store, !cast<NI>("STORE_"#vec_t) >;
126
- def : StorePatImmOff<vec_t, store, regPlusImm, !cast<NI>("STORE_"#vec_t) >;
127
- def : StorePatImmOff<vec_t, store, or_is_add, !cast<NI>("STORE_"#vec_t) >;
128
- def : StorePatOffsetOnly<vec_t, store, !cast<NI>("STORE_"#vec_t) >;
129
- def : StorePatGlobalAddrOffOnly<vec_t, store, !cast<NI>("STORE_"#vec_t) >;
117
+ def : StorePatNoOffset<vec_t, store, STORE_V128 >;
118
+ def : StorePatImmOff<vec_t, store, regPlusImm, STORE_V128 >;
119
+ def : StorePatImmOff<vec_t, store, or_is_add, STORE_V128 >;
120
+ def : StorePatOffsetOnly<vec_t, store, STORE_V128 >;
121
+ def : StorePatGlobalAddrOffOnly<vec_t, store, STORE_V128 >;
130
122
}
131
123
132
124
//===----------------------------------------------------------------------===//
@@ -136,7 +128,7 @@ def : StorePatGlobalAddrOffOnly<vec_t, store, !cast<NI>("STORE_"#vec_t)>;
136
128
// Constant: v128.const
137
129
multiclass ConstVec<ValueType vec_t, dag ops, dag pat, string args> {
138
130
let isMoveImm = 1, isReMaterializable = 1,
139
- Predicates = [HasSIMD128, HasUnimplementedSIMD128] in
131
+ Predicates = [HasUnimplementedSIMD128] in
140
132
defm CONST_V128_#vec_t : SIMD_I<(outs V128:$dst), ops, (outs), ops,
141
133
[(set V128:$dst, (vec_t pat))],
142
134
"v128.const\t$dst, "#args,
@@ -332,7 +324,7 @@ multiclass ExtractLaneExtended<string sign, bits<32> baseInst> {
332
324
}
333
325
334
326
defm "" : ExtractLaneExtended<"_s", 5>;
335
- let Predicates = [HasSIMD128, HasUnimplementedSIMD128] in
327
+ let Predicates = [HasUnimplementedSIMD128] in
336
328
defm "" : ExtractLaneExtended<"_u", 6>;
337
329
defm "" : ExtractLane<v4i32, "i32x4", LaneIdx4, I32, 13>;
338
330
defm "" : ExtractLane<v2i64, "i64x2", LaneIdx2, I64, 16>;
@@ -701,7 +693,7 @@ defm ABS : SIMDUnaryFP<fabs, "abs", 149>;
701
693
defm NEG : SIMDUnaryFP<fneg, "neg", 150>;
702
694
703
695
// Square root: sqrt
704
- let Predicates = [HasSIMD128, HasUnimplementedSIMD128] in
696
+ let Predicates = [HasUnimplementedSIMD128] in
705
697
defm SQRT : SIMDUnaryFP<fsqrt, "sqrt", 151>;
706
698
707
699
//===----------------------------------------------------------------------===//
@@ -725,7 +717,7 @@ let isCommutable = 1 in
725
717
defm MUL : SIMDBinaryFP<fmul, "mul", 156>;
726
718
727
719
// Division: div
728
- let Predicates = [HasSIMD128, HasUnimplementedSIMD128] in
720
+ let Predicates = [HasUnimplementedSIMD128] in
729
721
defm DIV : SIMDBinaryFP<fdiv, "div", 157>;
730
722
731
723
// NaN-propagating minimum: min
@@ -818,6 +810,7 @@ def : Pat<(t1 (bitconvert (t2 V128:$v))), (t1 V128:$v)>;
818
810
//===----------------------------------------------------------------------===//
819
811
// Quasi-Fused Multiply- Add and Subtract (QFMA/QFMS)
820
812
//===----------------------------------------------------------------------===//
813
+
821
814
multiclass SIMDQFM<ValueType vec_t, string vec, bits<32> baseInst> {
822
815
defm QFMA_#vec_t :
823
816
SIMD_I<(outs V128:$dst), (ins V128:$a, V128:$b, V128:$c),
0 commit comments