@@ -1688,9 +1688,59 @@ multiclass sve_int_index_rr<string asm> {
1688
1688
// SVE Bitwise Shift - Predicated Group
1689
1689
//===----------------------------------------------------------------------===//
1690
1690
1691
- class sve_int_bin_pred_shift_1<bits<2> sz8_64, bits<3> opc, string asm,
1692
- ZPRRegOp zprty>
1693
- : I<(outs zprty:$Zdn), (ins PPR3bAny:$Pg, zprty:$_Zdn, zprty:$Zm),
1691
+ class sve_int_bin_pred_shift_imm<bits<4> tsz8_64, bits<3> opc, string asm,
1692
+ ZPRRegOp zprty, Operand immtype>
1693
+ : I<(outs zprty:$Zdn), (ins PPR3bAny:$Pg, zprty:$_Zdn, immtype:$imm),
1694
+ asm, "\t$Zdn, $Pg/m, $_Zdn, $imm",
1695
+ "",
1696
+ []>, Sched<[]> {
1697
+ bits<3> Pg;
1698
+ bits<5> Zdn;
1699
+ bits<6> imm;
1700
+ let Inst{31-24} = 0b00000100;
1701
+ let Inst{23-22} = tsz8_64{3-2};
1702
+ let Inst{21-19} = 0b000;
1703
+ let Inst{18-16} = opc;
1704
+ let Inst{15-13} = 0b100;
1705
+ let Inst{12-10} = Pg;
1706
+ let Inst{9-8} = tsz8_64{1-0};
1707
+ let Inst{7-5} = imm{2-0}; // imm3
1708
+ let Inst{4-0} = Zdn;
1709
+
1710
+ let Constraints = "$Zdn = $_Zdn";
1711
+ }
1712
+
1713
+ multiclass sve_int_bin_pred_shift_imm_left<bits<3> opc, string asm> {
1714
+ def _B : sve_int_bin_pred_shift_imm<{0,0,0,1}, opc, asm, ZPR8, vecshiftL8>;
1715
+ def _H : sve_int_bin_pred_shift_imm<{0,0,1,?}, opc, asm, ZPR16, vecshiftL16> {
1716
+ let Inst{8} = imm{3};
1717
+ }
1718
+ def _S : sve_int_bin_pred_shift_imm<{0,1,?,?}, opc, asm, ZPR32, vecshiftL32> {
1719
+ let Inst{9-8} = imm{4-3};
1720
+ }
1721
+ def _D : sve_int_bin_pred_shift_imm<{1,?,?,?}, opc, asm, ZPR64, vecshiftL64> {
1722
+ let Inst{22} = imm{5};
1723
+ let Inst{9-8} = imm{4-3};
1724
+ }
1725
+ }
1726
+
1727
+ multiclass sve_int_bin_pred_shift_imm_right<bits<3> opc, string asm> {
1728
+ def _B : sve_int_bin_pred_shift_imm<{0,0,0,1}, opc, asm, ZPR8, vecshiftR8>;
1729
+ def _H : sve_int_bin_pred_shift_imm<{0,0,1,?}, opc, asm, ZPR16, vecshiftR16> {
1730
+ let Inst{8} = imm{3};
1731
+ }
1732
+ def _S : sve_int_bin_pred_shift_imm<{0,1,?,?}, opc, asm, ZPR32, vecshiftR32> {
1733
+ let Inst{9-8} = imm{4-3};
1734
+ }
1735
+ def _D : sve_int_bin_pred_shift_imm<{1,?,?,?}, opc, asm, ZPR64, vecshiftR64> {
1736
+ let Inst{22} = imm{5};
1737
+ let Inst{9-8} = imm{4-3};
1738
+ }
1739
+ }
1740
+
1741
+ class sve_int_bin_pred_shift<bits<2> sz8_64, bit wide, bits<3> opc,
1742
+ string asm, ZPRRegOp zprty, ZPRRegOp zprty2>
1743
+ : I<(outs zprty:$Zdn), (ins PPR3bAny:$Pg, zprty:$_Zdn, zprty2:$Zm),
1694
1744
asm, "\t$Zdn, $Pg/m, $_Zdn, $Zm",
1695
1745
"",
1696
1746
[]>, Sched<[]> {
@@ -1699,7 +1749,8 @@ class sve_int_bin_pred_shift_1<bits<2> sz8_64, bits<3> opc, string asm,
1699
1749
bits<5> Zm;
1700
1750
let Inst{31-24} = 0b00000100;
1701
1751
let Inst{23-22} = sz8_64;
1702
- let Inst{21-19} = 0b010;
1752
+ let Inst{21-20} = 0b01;
1753
+ let Inst{19} = wide;
1703
1754
let Inst{18-16} = opc;
1704
1755
let Inst{15-13} = 0b100;
1705
1756
let Inst{12-10} = Pg;
@@ -1709,19 +1760,49 @@ class sve_int_bin_pred_shift_1<bits<2> sz8_64, bits<3> opc, string asm,
1709
1760
let Constraints = "$Zdn = $_Zdn";
1710
1761
}
1711
1762
1712
- multiclass sve_int_bin_pred_shift_1 <bits<3> opc, string asm> {
1713
- def _B : sve_int_bin_pred_shift_1 <0b00, opc, asm, ZPR8>;
1714
- def _H : sve_int_bin_pred_shift_1 <0b01, opc, asm, ZPR16>;
1715
- def _S : sve_int_bin_pred_shift_1 <0b10, opc, asm, ZPR32>;
1716
- def _D : sve_int_bin_pred_shift_1 <0b11, opc, asm, ZPR64>;
1763
+ multiclass sve_int_bin_pred_shift <bits<3> opc, string asm> {
1764
+ def _B : sve_int_bin_pred_shift <0b00, 0b0, opc, asm, ZPR8 , ZPR8>;
1765
+ def _H : sve_int_bin_pred_shift <0b01, 0b0, opc, asm, ZPR16 , ZPR16>;
1766
+ def _S : sve_int_bin_pred_shift <0b10, 0b0, opc, asm, ZPR32 , ZPR32>;
1767
+ def _D : sve_int_bin_pred_shift <0b11, 0b0, opc, asm, ZPR64 , ZPR64>;
1717
1768
}
1718
1769
1770
+ multiclass sve_int_bin_pred_shift_wide<bits<3> opc, string asm> {
1771
+ def _B : sve_int_bin_pred_shift<0b00, 0b1, opc, asm, ZPR8, ZPR64>;
1772
+ def _H : sve_int_bin_pred_shift<0b01, 0b1, opc, asm, ZPR16, ZPR64>;
1773
+ def _S : sve_int_bin_pred_shift<0b10, 0b1, opc, asm, ZPR32, ZPR64>;
1774
+ }
1719
1775
1720
1776
//===----------------------------------------------------------------------===//
1721
- // SVE Shift by Immediate - Unpredicated Group
1777
+ // SVE Shift - Unpredicated Group
1722
1778
//===----------------------------------------------------------------------===//
1723
1779
1724
- class sve_int_bin_cons_shift_b<bits<4> tsz8_64, bits<2> opc, string asm,
1780
+ class sve_int_bin_cons_shift_wide<bits<2> sz8_64, bits<2> opc, string asm,
1781
+ ZPRRegOp zprty>
1782
+ : I<(outs zprty:$Zd), (ins zprty:$Zn, ZPR64:$Zm),
1783
+ asm, "\t$Zd, $Zn, $Zm",
1784
+ "",
1785
+ []>, Sched<[]> {
1786
+ bits<5> Zd;
1787
+ bits<5> Zm;
1788
+ bits<5> Zn;
1789
+ let Inst{31-24} = 0b00000100;
1790
+ let Inst{23-22} = sz8_64;
1791
+ let Inst{21} = 0b1;
1792
+ let Inst{20-16} = Zm;
1793
+ let Inst{15-12} = 0b1000;
1794
+ let Inst{11-10} = opc;
1795
+ let Inst{9-5} = Zn;
1796
+ let Inst{4-0} = Zd;
1797
+ }
1798
+
1799
+ multiclass sve_int_bin_cons_shift_wide<bits<2> opc, string asm> {
1800
+ def _B : sve_int_bin_cons_shift_wide<0b00, opc, asm, ZPR8>;
1801
+ def _H : sve_int_bin_cons_shift_wide<0b01, opc, asm, ZPR16>;
1802
+ def _S : sve_int_bin_cons_shift_wide<0b10, opc, asm, ZPR32>;
1803
+ }
1804
+
1805
+ class sve_int_bin_cons_shift_imm<bits<4> tsz8_64, bits<2> opc, string asm,
1725
1806
ZPRRegOp zprty, Operand immtype>
1726
1807
: I<(outs zprty:$Zd), (ins zprty:$Zn, immtype:$imm),
1727
1808
asm, "\t$Zd, $Zn, $imm",
@@ -1740,29 +1821,29 @@ class sve_int_bin_cons_shift_b<bits<4> tsz8_64, bits<2> opc, string asm,
1740
1821
let Inst{4-0} = Zd;
1741
1822
}
1742
1823
1743
- multiclass sve_int_bin_cons_shift_b_left <bits<2> opc, string asm> {
1744
- def _B : sve_int_bin_cons_shift_b <{0,0,0,1}, opc, asm, ZPR8, vecshiftL8>;
1745
- def _H : sve_int_bin_cons_shift_b <{0,0,1,?}, opc, asm, ZPR16, vecshiftL16> {
1824
+ multiclass sve_int_bin_cons_shift_imm_left <bits<2> opc, string asm> {
1825
+ def _B : sve_int_bin_cons_shift_imm <{0,0,0,1}, opc, asm, ZPR8, vecshiftL8>;
1826
+ def _H : sve_int_bin_cons_shift_imm <{0,0,1,?}, opc, asm, ZPR16, vecshiftL16> {
1746
1827
let Inst{19} = imm{3};
1747
1828
}
1748
- def _S : sve_int_bin_cons_shift_b <{0,1,?,?}, opc, asm, ZPR32, vecshiftL32> {
1829
+ def _S : sve_int_bin_cons_shift_imm <{0,1,?,?}, opc, asm, ZPR32, vecshiftL32> {
1749
1830
let Inst{20-19} = imm{4-3};
1750
1831
}
1751
- def _D : sve_int_bin_cons_shift_b <{1,?,?,?}, opc, asm, ZPR64, vecshiftL64> {
1832
+ def _D : sve_int_bin_cons_shift_imm <{1,?,?,?}, opc, asm, ZPR64, vecshiftL64> {
1752
1833
let Inst{22} = imm{5};
1753
1834
let Inst{20-19} = imm{4-3};
1754
1835
}
1755
1836
}
1756
1837
1757
- multiclass sve_int_bin_cons_shift_b_right <bits<2> opc, string asm> {
1758
- def _B : sve_int_bin_cons_shift_b <{0,0,0,1}, opc, asm, ZPR8, vecshiftR8>;
1759
- def _H : sve_int_bin_cons_shift_b <{0,0,1,?}, opc, asm, ZPR16, vecshiftR16> {
1838
+ multiclass sve_int_bin_cons_shift_imm_right <bits<2> opc, string asm> {
1839
+ def _B : sve_int_bin_cons_shift_imm <{0,0,0,1}, opc, asm, ZPR8, vecshiftR8>;
1840
+ def _H : sve_int_bin_cons_shift_imm <{0,0,1,?}, opc, asm, ZPR16, vecshiftR16> {
1760
1841
let Inst{19} = imm{3};
1761
1842
}
1762
- def _S : sve_int_bin_cons_shift_b <{0,1,?,?}, opc, asm, ZPR32, vecshiftR32> {
1843
+ def _S : sve_int_bin_cons_shift_imm <{0,1,?,?}, opc, asm, ZPR32, vecshiftR32> {
1763
1844
let Inst{20-19} = imm{4-3};
1764
1845
}
1765
- def _D : sve_int_bin_cons_shift_b <{1,?,?,?}, opc, asm, ZPR64, vecshiftR64> {
1846
+ def _D : sve_int_bin_cons_shift_imm <{1,?,?,?}, opc, asm, ZPR64, vecshiftR64> {
1766
1847
let Inst{22} = imm{5};
1767
1848
let Inst{20-19} = imm{4-3};
1768
1849
}
0 commit comments