@@ -2134,29 +2134,6 @@ class sve_fp_2op_p_zds<bits<2> sz, bits<4> opc, string asm,
2134
2134
let mayRaiseFPException = 1;
2135
2135
}
2136
2136
2137
- multiclass sve2p1_bf_2op_p_zds<bits<4> opc, string asm, string Ps,
2138
- SDPatternOperator op, DestructiveInstTypeEnum flags,
2139
- string revname="", bit isReverseInstr=0> {
2140
- let DestructiveInstType = flags in {
2141
- def NAME : sve_fp_2op_p_zds<0b00, opc, asm, ZPR16>,
2142
- SVEPseudo2Instr<Ps, 1>, SVEInstr2Rev<NAME , revname , isReverseInstr>;
2143
- }
2144
-
2145
- def : SVE_3_Op_Pat<nxv8bf16, op, nxv8i1, nxv8bf16, nxv8bf16, !cast<Instruction>(NAME)>;
2146
- }
2147
-
2148
- multiclass sve2p1_bf_bin_pred_zds<SDPatternOperator op> {
2149
- def _UNDEF : PredTwoOpPseudo<NAME, ZPR16, FalseLanesUndef>;
2150
-
2151
- def : SVE_3_Op_Pat<nxv8bf16, op, nxv8i1, nxv8bf16, nxv8bf16, !cast<Pseudo>(NAME # _UNDEF)>;
2152
- }
2153
-
2154
- multiclass sve2p1_bf_2op_p_zds_zeroing<SDPatternOperator op> {
2155
- def _ZERO : PredTwoOpPseudo<NAME, ZPR16, FalseLanesZero>;
2156
-
2157
- def : SVE_3_Op_Pat_SelZero<nxv8bf16, op, nxv8i1, nxv8bf16, nxv8bf16, !cast<Pseudo>(NAME # _ZERO)>;
2158
- }
2159
-
2160
2137
multiclass sve_fp_2op_p_zds<bits<4> opc, string asm, string Ps,
2161
2138
SDPatternOperator op, DestructiveInstTypeEnum flags,
2162
2139
string revname="", bit isReverseInstr=0> {
@@ -2185,6 +2162,18 @@ multiclass sve_fp_2op_p_zds_fscale<bits<4> opc, string asm,
2185
2162
def : SVE_3_Op_Pat<nxv2f64, op, nxv2i1, nxv2f64, nxv2i64, !cast<Instruction>(NAME # _D)>;
2186
2163
}
2187
2164
2165
+ multiclass sve_fp_2op_p_zds_bfloat<bits<4> opc, string asm, string Ps,
2166
+ SDPatternOperator op,
2167
+ DestructiveInstTypeEnum flags,
2168
+ string revname="", bit isReverseInstr=0> {
2169
+ let DestructiveInstType = flags in {
2170
+ def NAME : sve_fp_2op_p_zds<0b00, opc, asm, ZPR16>,
2171
+ SVEPseudo2Instr<Ps, 1>, SVEInstr2Rev<NAME , revname , isReverseInstr>;
2172
+ }
2173
+
2174
+ def : SVE_3_Op_Pat<nxv8bf16, op, nxv8i1, nxv8bf16, nxv8bf16, !cast<Instruction>(NAME)>;
2175
+ }
2176
+
2188
2177
multiclass sve_fp_2op_p_zds_zeroing_hsd<SDPatternOperator op> {
2189
2178
def _H_ZERO : PredTwoOpPseudo<NAME # _H, ZPR16, FalseLanesZero>;
2190
2179
def _S_ZERO : PredTwoOpPseudo<NAME # _S, ZPR32, FalseLanesZero>;
@@ -2195,6 +2184,12 @@ multiclass sve_fp_2op_p_zds_zeroing_hsd<SDPatternOperator op> {
2195
2184
def : SVE_3_Op_Pat_SelZero<nxv2f64, op, nxv2i1, nxv2f64, nxv2f64, !cast<Pseudo>(NAME # _D_ZERO)>;
2196
2185
}
2197
2186
2187
+ multiclass sve_fp_2op_p_zds_zeroing_bfloat<SDPatternOperator op> {
2188
+ def _ZERO : PredTwoOpPseudo<NAME, ZPR16, FalseLanesZero>;
2189
+
2190
+ def : SVE_3_Op_Pat_SelZero<nxv8bf16, op, nxv8i1, nxv8bf16, nxv8bf16, !cast<Pseudo>(NAME # _ZERO)>;
2191
+ }
2192
+
2198
2193
class sve_fp_ftmad<bits<2> sz, string asm, ZPRRegOp zprty>
2199
2194
: I<(outs zprty:$Zdn), (ins zprty:$_Zdn, zprty:$Zm, timm32_0_7:$imm3),
2200
2195
asm, "\t$Zdn, $_Zdn, $Zm, $imm3",
@@ -2300,7 +2295,7 @@ multiclass sve_fp_3op_u_zd<bits<3> opc, string asm, SDPatternOperator op> {
2300
2295
def : SVE_2_Op_Pat<nxv2f64, op, nxv2f64, nxv2f64, !cast<Instruction>(NAME # _D)>;
2301
2296
}
2302
2297
2303
- multiclass sve2p1_bf_3op_u_zd <bits<3> opc, string asm, SDPatternOperator op> {
2298
+ multiclass sve_fp_3op_u_zd_bfloat <bits<3> opc, string asm, SDPatternOperator op> {
2304
2299
def NAME : sve_fp_3op_u_zd<0b00, opc, asm, ZPR16>;
2305
2300
2306
2301
def : SVE_2_Op_Pat<nxv8bf16, op, nxv8bf16, nxv8bf16, !cast<Instruction>(NAME)>;
@@ -2364,8 +2359,8 @@ multiclass sve_fp_3op_p_zds_a<bits<2> opc, string asm, string Ps,
2364
2359
def : SVE_4_Op_Pat<nxv2f64, op, nxv2i1, nxv2f64, nxv2f64, nxv2f64, !cast<Instruction>(NAME # _D)>;
2365
2360
}
2366
2361
2367
- multiclass sve_fp_3op_p_zds_a_bf <bits<2> opc, string asm, string Ps,
2368
- SDPatternOperator op> {
2362
+ multiclass sve_fp_3op_p_zds_a_bfloat <bits<2> opc, string asm, string Ps,
2363
+ SDPatternOperator op> {
2369
2364
def NAME : sve_fp_3op_p_zds_a<0b00, opc, asm, ZPR16>,
2370
2365
SVEPseudo2Instr<Ps, 1>, SVEInstr2Rev<NAME, "", 0>;
2371
2366
@@ -2439,19 +2434,6 @@ class sve_fp_fma_by_indexed_elem<bits<2> sz, bits<2> opc, string asm,
2439
2434
let mayRaiseFPException = 1;
2440
2435
}
2441
2436
2442
- multiclass sve2p1_fp_bfma_by_indexed_elem<string asm, bits<2> opc, SDPatternOperator op> {
2443
- def NAME : sve_fp_fma_by_indexed_elem<{0, ?}, opc, asm, ZPR16, ZPR3b16,
2444
- VectorIndexH32b> {
2445
- bits<3> Zm;
2446
- bits<3> iop;
2447
- let Inst{22} = iop{2};
2448
- let Inst{20-19} = iop{1-0};
2449
- let Inst{18-16} = Zm;
2450
- }
2451
- def : Pat<(nxv8bf16 (op nxv8bf16:$op1, nxv8bf16:$op2, nxv8bf16:$op3, (i32 VectorIndexH32b_timm:$idx))),
2452
- (!cast<Instruction>(NAME) $op1, $op2, $op3, VectorIndexH32b_timm:$idx)>;
2453
- }
2454
-
2455
2437
multiclass sve_fp_fma_by_indexed_elem<bits<2> opc, string asm,
2456
2438
SDPatternOperator op> {
2457
2439
def _H : sve_fp_fma_by_indexed_elem<{0, ?}, opc, asm, ZPR16, ZPR3b16, VectorIndexH32b> {
@@ -2482,6 +2464,19 @@ multiclass sve_fp_fma_by_indexed_elem<bits<2> opc, string asm,
2482
2464
(!cast<Instruction>(NAME # _D) $Op1, $Op2, $Op3, VectorIndexD32b_timm:$idx)>;
2483
2465
}
2484
2466
2467
+ multiclass sve_fp_fma_by_indexed_elem_bfloat<string asm, bits<2> opc,
2468
+ SDPatternOperator op> {
2469
+ def NAME : sve_fp_fma_by_indexed_elem<{0, ?}, opc, asm, ZPR16, ZPR3b16, VectorIndexH32b> {
2470
+ bits<3> Zm;
2471
+ bits<3> iop;
2472
+ let Inst{22} = iop{2};
2473
+ let Inst{20-19} = iop{1-0};
2474
+ let Inst{18-16} = Zm;
2475
+ }
2476
+
2477
+ def : Pat<(nxv8bf16 (op nxv8bf16:$op1, nxv8bf16:$op2, nxv8bf16:$op3, (i32 VectorIndexH32b_timm:$idx))),
2478
+ (!cast<Instruction>(NAME) $op1, $op2, $op3, VectorIndexH32b_timm:$idx)>;
2479
+ }
2485
2480
2486
2481
//===----------------------------------------------------------------------===//
2487
2482
// SVE Floating Point Multiply - Indexed Group
@@ -2506,18 +2501,6 @@ class sve_fp_fmul_by_indexed_elem<bits<2> sz, bit o2, string asm, ZPRRegOp zprty
2506
2501
let mayRaiseFPException = 1;
2507
2502
}
2508
2503
2509
- multiclass sve2p1_fp_bfmul_by_indexed_elem<string asm, SDPatternOperator ir_intrinsic> {
2510
- def NAME : sve_fp_fmul_by_indexed_elem<{0, ?}, 0b1, asm, ZPR16, ZPR3b16, VectorIndexH32b> {
2511
- bits<3> Zm;
2512
- bits<3> iop;
2513
- let Inst{22} = iop{2};
2514
- let Inst{20-19} = iop{1-0};
2515
- let Inst{18-16} = Zm;
2516
- }
2517
- def : Pat <(nxv8bf16 (ir_intrinsic nxv8bf16:$Op1, nxv8bf16:$Op2, (i32 VectorIndexH32b_timm:$idx))),
2518
- (!cast<Instruction>(NAME) $Op1, $Op2, VectorIndexH32b_timm:$idx)>;
2519
- }
2520
-
2521
2504
multiclass sve_fp_fmul_by_indexed_elem<string asm, SDPatternOperator op> {
2522
2505
def _H : sve_fp_fmul_by_indexed_elem<{0, ?}, 0b0, asm, ZPR16, ZPR3b16, VectorIndexH32b> {
2523
2506
bits<3> Zm;
@@ -2547,6 +2530,19 @@ multiclass sve_fp_fmul_by_indexed_elem<string asm, SDPatternOperator op> {
2547
2530
(!cast<Instruction>(NAME # _D) $Op1, $Op2, VectorIndexD32b_timm:$idx)>;
2548
2531
}
2549
2532
2533
+ multiclass sve_fp_fmul_by_indexed_elem_bfloat<string asm,
2534
+ SDPatternOperator op> {
2535
+ def NAME : sve_fp_fmul_by_indexed_elem<{0, ?}, 0b1, asm, ZPR16, ZPR3b16, VectorIndexH32b> {
2536
+ bits<3> Zm;
2537
+ bits<3> iop;
2538
+ let Inst{22} = iop{2};
2539
+ let Inst{20-19} = iop{1-0};
2540
+ let Inst{18-16} = Zm;
2541
+ }
2542
+ def : Pat <(nxv8bf16 (op nxv8bf16:$Op1, nxv8bf16:$Op2, (i32 VectorIndexH32b_timm:$idx))),
2543
+ (!cast<Instruction>(NAME) $Op1, $Op2, VectorIndexH32b_timm:$idx)>;
2544
+ }
2545
+
2550
2546
//===----------------------------------------------------------------------===//
2551
2547
// SVE Floating Point Complex Multiply-Add Group
2552
2548
//===----------------------------------------------------------------------===//
@@ -9073,6 +9069,13 @@ multiclass sve_fp_bin_pred_hfd<SDPatternOperator op> {
9073
9069
def : SVE_3_Op_Pat<nxv2f64, op, nxv2i1, nxv2f64, nxv2f64, !cast<Pseudo>(NAME # _D_UNDEF)>;
9074
9070
}
9075
9071
9072
+ // Predicated pseudo floating point (BFloat) two operand instructions.
9073
+ multiclass sve_fp_bin_pred_bfloat<SDPatternOperator op> {
9074
+ def _UNDEF : PredTwoOpPseudo<NAME, ZPR16, FalseLanesUndef>;
9075
+
9076
+ def : SVE_3_Op_Pat<nxv8bf16, op, nxv8i1, nxv8bf16, nxv8bf16, !cast<Pseudo>(NAME # _UNDEF)>;
9077
+ }
9078
+
9076
9079
// Predicated pseudo floating point three operand instructions.
9077
9080
multiclass sve_fp_3op_pred_hfd<SDPatternOperator op> {
9078
9081
def _H_UNDEF : PredThreeOpPseudo<NAME # _H, ZPR16, FalseLanesUndef>;
@@ -9087,7 +9090,8 @@ multiclass sve_fp_3op_pred_hfd<SDPatternOperator op> {
9087
9090
def : SVE_4_Op_Pat<nxv2f64, op, nxv2i1, nxv2f64, nxv2f64, nxv2f64, !cast<Instruction>(NAME # _D_UNDEF)>;
9088
9091
}
9089
9092
9090
- multiclass sve_fp_3op_pred_bf<SDPatternOperator op> {
9093
+ // Predicated pseudo floating point (BFloat) three operand instructions.
9094
+ multiclass sve_fp_3op_pred_bfloat<SDPatternOperator op> {
9091
9095
def _UNDEF : PredThreeOpPseudo<NAME, ZPR16, FalseLanesUndef>;
9092
9096
9093
9097
def : SVE_4_Op_Pat<nxv8bf16, op, nxv8i1, nxv8bf16, nxv8bf16, nxv8bf16, !cast<Instruction>(NAME # _UNDEF)>;
@@ -9147,7 +9151,7 @@ multiclass sve_int_bin_pred_all_active_bhsd<SDPatternOperator op> {
9147
9151
// SME2 or SVE2.1 Instructions
9148
9152
//===----------------------------------------------------------------------===//
9149
9153
9150
- class sve2p1_fclamp <string asm, bits<2> sz, ZPRRegOp zpr_ty>
9154
+ class sve_fp_clamp <string asm, bits<2> sz, ZPRRegOp zpr_ty>
9151
9155
: I<(outs zpr_ty:$Zd), (ins zpr_ty:$_Zd, zpr_ty:$Zn, zpr_ty:$Zm),
9152
9156
asm, "\t$Zd, $Zn, $Zm", "", []>,
9153
9157
Sched<[]> {
@@ -9168,18 +9172,19 @@ class sve2p1_fclamp<string asm, bits<2> sz, ZPRRegOp zpr_ty>
9168
9172
let hasSideEffects = 0;
9169
9173
}
9170
9174
9171
- multiclass sve2p1_fclamp <string asm, SDPatternOperator op> {
9172
- def _H : sve2p1_fclamp <asm, 0b01, ZPR16>;
9173
- def _S : sve2p1_fclamp <asm, 0b10, ZPR32>;
9174
- def _D : sve2p1_fclamp <asm, 0b11, ZPR64>;
9175
+ multiclass sve_fp_clamp <string asm, SDPatternOperator op> {
9176
+ def _H : sve_fp_clamp <asm, 0b01, ZPR16>;
9177
+ def _S : sve_fp_clamp <asm, 0b10, ZPR32>;
9178
+ def _D : sve_fp_clamp <asm, 0b11, ZPR64>;
9175
9179
9176
9180
def : SVE_3_Op_Pat<nxv8f16, op, nxv8f16, nxv8f16, nxv8f16, !cast<Instruction>(NAME # _H)>;
9177
9181
def : SVE_3_Op_Pat<nxv4f32, op, nxv4f32, nxv4f32, nxv4f32, !cast<Instruction>(NAME # _S)>;
9178
9182
def : SVE_3_Op_Pat<nxv2f64, op, nxv2f64, nxv2f64, nxv2f64, !cast<Instruction>(NAME # _D)>;
9179
9183
}
9180
9184
9181
- multiclass sve2p1_bfclamp<string asm, SDPatternOperator op> {
9182
- def NAME : sve2p1_fclamp<asm, 0b00, ZPR16>;
9185
+ multiclass sve_fp_clamp_bfloat<string asm, SDPatternOperator op> {
9186
+ def NAME : sve_fp_clamp<asm, 0b00, ZPR16>;
9187
+
9183
9188
def : SVE_3_Op_Pat<nxv8bf16, op, nxv8bf16, nxv8bf16, nxv8bf16, !cast<Instruction>(NAME)>;
9184
9189
}
9185
9190
0 commit comments