@@ -2134,29 +2134,6 @@ class sve_fp_2op_p_zds<bits<2> sz, bits<4> opc, string asm,
21342134 let mayRaiseFPException = 1;
21352135}
21362136
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-
21602137multiclass sve_fp_2op_p_zds<bits<4> opc, string asm, string Ps,
21612138 SDPatternOperator op, DestructiveInstTypeEnum flags,
21622139 string revname="", bit isReverseInstr=0> {
@@ -2185,6 +2162,18 @@ multiclass sve_fp_2op_p_zds_fscale<bits<4> opc, string asm,
21852162 def : SVE_3_Op_Pat<nxv2f64, op, nxv2i1, nxv2f64, nxv2i64, !cast<Instruction>(NAME # _D)>;
21862163}
21872164
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+
21882177multiclass sve_fp_2op_p_zds_zeroing_hsd<SDPatternOperator op> {
21892178 def _H_ZERO : PredTwoOpPseudo<NAME # _H, ZPR16, FalseLanesZero>;
21902179 def _S_ZERO : PredTwoOpPseudo<NAME # _S, ZPR32, FalseLanesZero>;
@@ -2195,6 +2184,12 @@ multiclass sve_fp_2op_p_zds_zeroing_hsd<SDPatternOperator op> {
21952184 def : SVE_3_Op_Pat_SelZero<nxv2f64, op, nxv2i1, nxv2f64, nxv2f64, !cast<Pseudo>(NAME # _D_ZERO)>;
21962185}
21972186
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+
21982193class sve_fp_ftmad<bits<2> sz, string asm, ZPRRegOp zprty>
21992194: I<(outs zprty:$Zdn), (ins zprty:$_Zdn, zprty:$Zm, timm32_0_7:$imm3),
22002195 asm, "\t$Zdn, $_Zdn, $Zm, $imm3",
@@ -2300,7 +2295,7 @@ multiclass sve_fp_3op_u_zd<bits<3> opc, string asm, SDPatternOperator op> {
23002295 def : SVE_2_Op_Pat<nxv2f64, op, nxv2f64, nxv2f64, !cast<Instruction>(NAME # _D)>;
23012296}
23022297
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> {
23042299 def NAME : sve_fp_3op_u_zd<0b00, opc, asm, ZPR16>;
23052300
23062301 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,
23642359 def : SVE_4_Op_Pat<nxv2f64, op, nxv2i1, nxv2f64, nxv2f64, nxv2f64, !cast<Instruction>(NAME # _D)>;
23652360}
23662361
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> {
23692364 def NAME : sve_fp_3op_p_zds_a<0b00, opc, asm, ZPR16>,
23702365 SVEPseudo2Instr<Ps, 1>, SVEInstr2Rev<NAME, "", 0>;
23712366
@@ -2439,19 +2434,6 @@ class sve_fp_fma_by_indexed_elem<bits<2> sz, bits<2> opc, string asm,
24392434 let mayRaiseFPException = 1;
24402435}
24412436
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-
24552437multiclass sve_fp_fma_by_indexed_elem<bits<2> opc, string asm,
24562438 SDPatternOperator op> {
24572439 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,
24822464 (!cast<Instruction>(NAME # _D) $Op1, $Op2, $Op3, VectorIndexD32b_timm:$idx)>;
24832465}
24842466
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+ }
24852480
24862481//===----------------------------------------------------------------------===//
24872482// 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
25062501 let mayRaiseFPException = 1;
25072502}
25082503
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-
25212504multiclass sve_fp_fmul_by_indexed_elem<string asm, SDPatternOperator op> {
25222505 def _H : sve_fp_fmul_by_indexed_elem<{0, ?}, 0b0, asm, ZPR16, ZPR3b16, VectorIndexH32b> {
25232506 bits<3> Zm;
@@ -2547,6 +2530,19 @@ multiclass sve_fp_fmul_by_indexed_elem<string asm, SDPatternOperator op> {
25472530 (!cast<Instruction>(NAME # _D) $Op1, $Op2, VectorIndexD32b_timm:$idx)>;
25482531}
25492532
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+
25502546//===----------------------------------------------------------------------===//
25512547// SVE Floating Point Complex Multiply-Add Group
25522548//===----------------------------------------------------------------------===//
@@ -9073,6 +9069,13 @@ multiclass sve_fp_bin_pred_hfd<SDPatternOperator op> {
90739069 def : SVE_3_Op_Pat<nxv2f64, op, nxv2i1, nxv2f64, nxv2f64, !cast<Pseudo>(NAME # _D_UNDEF)>;
90749070}
90759071
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+
90769079// Predicated pseudo floating point three operand instructions.
90779080multiclass sve_fp_3op_pred_hfd<SDPatternOperator op> {
90789081 def _H_UNDEF : PredThreeOpPseudo<NAME # _H, ZPR16, FalseLanesUndef>;
@@ -9087,7 +9090,8 @@ multiclass sve_fp_3op_pred_hfd<SDPatternOperator op> {
90879090 def : SVE_4_Op_Pat<nxv2f64, op, nxv2i1, nxv2f64, nxv2f64, nxv2f64, !cast<Instruction>(NAME # _D_UNDEF)>;
90889091}
90899092
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> {
90919095 def _UNDEF : PredThreeOpPseudo<NAME, ZPR16, FalseLanesUndef>;
90929096
90939097 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> {
91479151// SME2 or SVE2.1 Instructions
91489152//===----------------------------------------------------------------------===//
91499153
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>
91519155 : I<(outs zpr_ty:$Zd), (ins zpr_ty:$_Zd, zpr_ty:$Zn, zpr_ty:$Zm),
91529156 asm, "\t$Zd, $Zn, $Zm", "", []>,
91539157 Sched<[]> {
@@ -9168,18 +9172,19 @@ class sve2p1_fclamp<string asm, bits<2> sz, ZPRRegOp zpr_ty>
91689172 let hasSideEffects = 0;
91699173}
91709174
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>;
91759179
91769180 def : SVE_3_Op_Pat<nxv8f16, op, nxv8f16, nxv8f16, nxv8f16, !cast<Instruction>(NAME # _H)>;
91779181 def : SVE_3_Op_Pat<nxv4f32, op, nxv4f32, nxv4f32, nxv4f32, !cast<Instruction>(NAME # _S)>;
91789182 def : SVE_3_Op_Pat<nxv2f64, op, nxv2f64, nxv2f64, nxv2f64, !cast<Instruction>(NAME # _D)>;
91799183}
91809184
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+
91839188 def : SVE_3_Op_Pat<nxv8bf16, op, nxv8bf16, nxv8bf16, nxv8bf16, !cast<Instruction>(NAME)>;
91849189}
91859190
0 commit comments