@@ -3768,60 +3768,61 @@ emitter::code_t emitter::emitInsCodeSve(instruction ins, insFormat fmt)
3768
3768
}
3769
3769
3770
3770
assert(encoding_found);
3771
+ const unsigned sve_ins_offset = ((unsigned)ins - INS_sve_invalid);
3771
3772
3772
3773
switch (index)
3773
3774
{
3774
3775
case 0:
3775
- assert(ins < ArrLen(insCodes1));
3776
- code = insCodes1[ins ];
3776
+ assert(sve_ins_offset < ArrLen(insCodes1));
3777
+ code = insCodes1[sve_ins_offset ];
3777
3778
break;
3778
3779
case 1:
3779
- assert(ins < ArrLen(insCodes2));
3780
- code = insCodes2[ins ];
3780
+ assert(sve_ins_offset < ArrLen(insCodes2));
3781
+ code = insCodes2[sve_ins_offset ];
3781
3782
break;
3782
3783
case 2:
3783
- assert(ins < ArrLen(insCodes3));
3784
- code = insCodes3[ins ];
3784
+ assert(sve_ins_offset < ArrLen(insCodes3));
3785
+ code = insCodes3[sve_ins_offset ];
3785
3786
break;
3786
3787
case 3:
3787
- assert(ins < ArrLen(insCodes4));
3788
- code = insCodes4[ins ];
3788
+ assert(sve_ins_offset < ArrLen(insCodes4));
3789
+ code = insCodes4[sve_ins_offset ];
3789
3790
break;
3790
3791
case 4:
3791
- assert(ins < ArrLen(insCodes5));
3792
- code = insCodes5[ins ];
3792
+ assert(sve_ins_offset < ArrLen(insCodes5));
3793
+ code = insCodes5[sve_ins_offset ];
3793
3794
break;
3794
3795
case 5:
3795
- assert(ins < ArrLen(insCodes6));
3796
- code = insCodes6[ins ];
3796
+ assert(sve_ins_offset < ArrLen(insCodes6));
3797
+ code = insCodes6[sve_ins_offset ];
3797
3798
break;
3798
3799
case 6:
3799
- assert(ins < ArrLen(insCodes7));
3800
- code = insCodes7[ins ];
3800
+ assert(sve_ins_offset < ArrLen(insCodes7));
3801
+ code = insCodes7[sve_ins_offset ];
3801
3802
break;
3802
3803
case 7:
3803
- assert(ins < ArrLen(insCodes8));
3804
- code = insCodes8[ins ];
3804
+ assert(sve_ins_offset < ArrLen(insCodes8));
3805
+ code = insCodes8[sve_ins_offset ];
3805
3806
break;
3806
3807
case 8:
3807
- assert(ins < ArrLen(insCodes9));
3808
- code = insCodes9[ins ];
3808
+ assert(sve_ins_offset < ArrLen(insCodes9));
3809
+ code = insCodes9[sve_ins_offset ];
3809
3810
break;
3810
3811
case 9:
3811
- assert(ins < ArrLen(insCodes10));
3812
- code = insCodes10[ins ];
3812
+ assert(sve_ins_offset < ArrLen(insCodes10));
3813
+ code = insCodes10[sve_ins_offset ];
3813
3814
break;
3814
3815
case 10:
3815
- assert(ins < ArrLen(insCodes11));
3816
- code = insCodes11[ins ];
3816
+ assert(sve_ins_offset < ArrLen(insCodes11));
3817
+ code = insCodes11[sve_ins_offset ];
3817
3818
break;
3818
3819
case 11:
3819
- assert(ins < ArrLen(insCodes12));
3820
- code = insCodes12[ins ];
3820
+ assert(sve_ins_offset < ArrLen(insCodes12));
3821
+ code = insCodes12[sve_ins_offset ];
3821
3822
break;
3822
3823
case 12:
3823
- assert(ins < ArrLen(insCodes13));
3824
- code = insCodes13[ins ];
3824
+ assert(sve_ins_offset < ArrLen(insCodes13));
3825
+ code = insCodes13[sve_ins_offset ];
3825
3826
break;
3826
3827
}
3827
3828
@@ -10633,41 +10634,236 @@ void emitter::emitIns_Call(EmitCallType callType,
10633
10634
10634
10635
/*****************************************************************************
10635
10636
*
10636
- * Returns an encoding for the specified register used in the 'Pd' position
10637
+ * Return an encoding for the specified 'V' register used in '4' thru '0' position.
10638
+ */
10639
+
10640
+ /*static*/ emitter::code_t emitter::insEncodeReg_V_4_to_0(regNumber reg)
10641
+ {
10642
+ assert(isVectorRegister(reg));
10643
+ emitter::code_t ureg = (emitter::code_t)reg - (emitter::code_t)REG_V0;
10644
+ assert((ureg >= 0) && (ureg <= 32));
10645
+ return ureg << 0;
10646
+ }
10647
+
10648
+ /*****************************************************************************
10649
+ *
10650
+ * Return an encoding for the specified 'V' register used in '9' thru '5' position.
10637
10651
*/
10638
10652
10639
- /*static*/ emitter::code_t emitter::insEncodeReg_Pd (regNumber reg)
10653
+ /*static*/ emitter::code_t emitter::insEncodeReg_V_9_to_5 (regNumber reg)
10640
10654
{
10641
- assert(emitter::isPredicateRegister(reg));
10655
+ assert(isVectorRegister(reg));
10656
+ emitter::code_t ureg = (emitter::code_t)reg - (emitter::code_t)REG_V0;
10657
+ assert((ureg >= 0) && (ureg <= 32));
10658
+ return ureg << 5;
10659
+ }
10660
+
10661
+ /*****************************************************************************
10662
+ *
10663
+ * Return an encoding for the specified 'P' register used in '12' thru '10' position.
10664
+ */
10665
+
10666
+ /*static*/ emitter::code_t emitter::insEncodeReg_P_12_to_10(regNumber reg)
10667
+ {
10668
+ assert(isPredicateRegister(reg));
10642
10669
emitter::code_t ureg = (emitter::code_t)reg - (emitter::code_t)REG_P0;
10643
10670
assert((ureg >= 0) && (ureg <= 15));
10644
- return ureg;
10671
+ return ureg << 10;
10672
+ }
10673
+
10674
+ /*****************************************************************************
10675
+ *
10676
+ * Return an encoding for the specified 'V' register used in '21' thru '17' position.
10677
+ */
10678
+
10679
+ /*static*/ emitter::code_t emitter::insEncodeReg_V_21_to_17(regNumber reg)
10680
+ {
10681
+ assert(isVectorRegister(reg));
10682
+ emitter::code_t ureg = (emitter::code_t)reg - (emitter::code_t)REG_V0;
10683
+ assert((ureg >= 0) && (ureg <= 32));
10684
+ return ureg << 17;
10685
+ }
10686
+
10687
+ /*****************************************************************************
10688
+ *
10689
+ * Return an encoding for the specified 'R' register used in '21' thru '17' position.
10690
+ */
10691
+
10692
+ /*static*/ emitter::code_t emitter::insEncodeReg_R_21_to_17(regNumber reg)
10693
+ {
10694
+ assert(isIntegerRegister(reg));
10695
+ emitter::code_t ureg = (emitter::code_t)reg;
10696
+ assert((ureg >= 0) && (ureg <= 32));
10697
+ return ureg << 17;
10698
+ }
10699
+
10700
+ /*****************************************************************************
10701
+ *
10702
+ * Return an encoding for the specified 'R' register used in '9' thru '5' position.
10703
+ */
10704
+
10705
+ /*static*/ emitter::code_t emitter::insEncodeReg_R_9_to_5(regNumber reg)
10706
+ {
10707
+ assert(isIntegerRegister(reg));
10708
+ emitter::code_t ureg = (emitter::code_t)reg;
10709
+ assert((ureg >= 0) && (ureg <= 32));
10710
+ return ureg << 5;
10711
+ }
10712
+
10713
+ /*****************************************************************************
10714
+ *
10715
+ * Return an encoding for the specified 'R' register used in '4' thru '0' position.
10716
+ */
10717
+
10718
+ /*static*/ emitter::code_t emitter::insEncodeReg_R_4_to_0(regNumber reg)
10719
+ {
10720
+ assert(isIntegerRegister(reg));
10721
+ emitter::code_t ureg = (emitter::code_t)reg;
10722
+ assert((ureg >= 0) && (ureg <= 32));
10723
+ return ureg << 0;
10724
+ }
10725
+
10726
+ /*****************************************************************************
10727
+ *
10728
+ * Return an encoding for the specified 'P' register used in '20' thru '17' position.
10729
+ */
10730
+
10731
+ /*static*/ emitter::code_t emitter::insEncodeReg_P_20_to_17(regNumber reg)
10732
+ {
10733
+ assert(isPredicateRegister(reg));
10734
+ emitter::code_t ureg = (emitter::code_t)reg - (emitter::code_t)REG_P0;
10735
+ assert((ureg >= 0) && (ureg <= 15));
10736
+ return ureg << 17;
10645
10737
}
10646
10738
10647
10739
/*****************************************************************************
10648
10740
*
10649
- * Returns an encoding for the specified register used in the 'Pn ' position
10741
+ * Return an encoding for the specified 'P' register used in '3' thru '0 ' position.
10650
10742
*/
10651
10743
10652
- /*static*/ emitter::code_t emitter::insEncodeReg_Pn (regNumber reg)
10744
+ /*static*/ emitter::code_t emitter::insEncodeReg_P_3_to_0 (regNumber reg)
10653
10745
{
10654
- assert(emitter::isPredicateRegister(reg));
10746
+ assert(isPredicateRegister(reg));
10747
+ emitter::code_t ureg = (emitter::code_t)reg - (emitter::code_t)REG_P0;
10748
+ assert((ureg >= 0) && (ureg <= 15));
10749
+ return ureg << 0;
10750
+ }
10751
+
10752
+ /*****************************************************************************
10753
+ *
10754
+ * Return an encoding for the specified 'P' register used in '8' thru '5' position.
10755
+ */
10756
+
10757
+ /*static*/ emitter::code_t emitter::insEncodeReg_P_8_to_5(regNumber reg)
10758
+ {
10759
+ assert(isPredicateRegister(reg));
10655
10760
emitter::code_t ureg = (emitter::code_t)reg - (emitter::code_t)REG_P0;
10656
10761
assert((ureg >= 0) && (ureg <= 15));
10657
10762
return ureg << 5;
10658
10763
}
10659
10764
10660
10765
/*****************************************************************************
10661
10766
*
10662
- * Returns an encoding for the specified register used in the 'Pm ' position
10767
+ * Return an encoding for the specified 'P' register used in '13' thru '10 ' position.
10663
10768
*/
10664
10769
10665
- /*static*/ emitter::code_t emitter::insEncodeReg_Pm (regNumber reg)
10770
+ /*static*/ emitter::code_t emitter::insEncodeReg_P_13_to_10 (regNumber reg)
10666
10771
{
10667
- assert(emitter:: isPredicateRegister(reg));
10772
+ assert(isPredicateRegister(reg));
10668
10773
emitter::code_t ureg = (emitter::code_t)reg - (emitter::code_t)REG_P0;
10669
10774
assert((ureg >= 0) && (ureg <= 15));
10670
- return ureg << 16;
10775
+ return ureg << 10;
10776
+ }
10777
+
10778
+ /*****************************************************************************
10779
+ *
10780
+ * Return an encoding for the specified 'R' register used in '18' thru '17' position.
10781
+ */
10782
+
10783
+ /*static*/ emitter::code_t emitter::insEncodeReg_R_18_to_17(regNumber reg)
10784
+ {
10785
+ assert(isIntegerRegister(reg));
10786
+ emitter::code_t ureg = (emitter::code_t)reg;
10787
+ assert((ureg >= 0) && (ureg <= 32));
10788
+ return ureg << 17;
10789
+ }
10790
+
10791
+ /*****************************************************************************
10792
+ *
10793
+ * Return an encoding for the specified 'P' register used in '7' thru '5' position.
10794
+ */
10795
+
10796
+ /*static*/ emitter::code_t emitter::insEncodeReg_P_7_to_5(regNumber reg)
10797
+ {
10798
+ assert(isPredicateRegister(reg));
10799
+ emitter::code_t ureg = (emitter::code_t)reg - (emitter::code_t)REG_P0;
10800
+ assert((ureg >= 0) && (ureg <= 15));
10801
+ return ureg << 5;
10802
+ }
10803
+
10804
+ /*****************************************************************************
10805
+ *
10806
+ * Return an encoding for the specified 'P' register used in '3' thru '1' position.
10807
+ */
10808
+
10809
+ /*static*/ emitter::code_t emitter::insEncodeReg_P_3_to_1(regNumber reg)
10810
+ {
10811
+ assert(isPredicateRegister(reg));
10812
+ emitter::code_t ureg = (emitter::code_t)reg - (emitter::code_t)REG_P0;
10813
+ assert((ureg >= 0) && (ureg <= 15));
10814
+ return ureg << 1;
10815
+ }
10816
+
10817
+ /*****************************************************************************
10818
+ *
10819
+ * Return an encoding for the specified 'P' register used in '2' thru '0' position.
10820
+ */
10821
+
10822
+ /*static*/ emitter::code_t emitter::insEncodeReg_P_2_to_0(regNumber reg)
10823
+ {
10824
+ assert(isPredicateRegister(reg));
10825
+ emitter::code_t ureg = (emitter::code_t)reg - (emitter::code_t)REG_P0;
10826
+ assert((ureg >= 0) && (ureg <= 15));
10827
+ return ureg << 0;
10828
+ }
10829
+
10830
+ /*****************************************************************************
10831
+ *
10832
+ * Return an encoding for the specified 'V' register used in '19' thru '17' position.
10833
+ */
10834
+
10835
+ /*static*/ emitter::code_t emitter::insEncodeReg_V_19_to_17(regNumber reg)
10836
+ {
10837
+ assert(isVectorRegister(reg));
10838
+ emitter::code_t ureg = (emitter::code_t)reg - (emitter::code_t)REG_V0;
10839
+ assert((ureg >= 0) && (ureg <= 32));
10840
+ return ureg << 17;
10841
+ }
10842
+
10843
+ /*****************************************************************************
10844
+ *
10845
+ * Return an encoding for the specified 'V' register used in '20' thru '17' position.
10846
+ */
10847
+
10848
+ /*static*/ emitter::code_t emitter::insEncodeReg_V_20_to_17(regNumber reg)
10849
+ {
10850
+ assert(isVectorRegister(reg));
10851
+ emitter::code_t ureg = (emitter::code_t)reg - (emitter::code_t)REG_V0;
10852
+ assert((ureg >= 0) && (ureg <= 32));
10853
+ return ureg << 17;
10854
+ }
10855
+
10856
+ /*****************************************************************************
10857
+ *
10858
+ * Return an encoding for the specified 'V' register used in '9' thru '6' position.
10859
+ */
10860
+
10861
+ /*static*/ emitter::code_t emitter::insEncodeReg_V_9_to_6(regNumber reg)
10862
+ {
10863
+ assert(isVectorRegister(reg));
10864
+ emitter::code_t ureg = (emitter::code_t)reg - (emitter::code_t)REG_V0;
10865
+ assert((ureg >= 0) && (ureg <= 32));
10866
+ return ureg << 6;
10671
10867
}
10672
10868
10673
10869
/*****************************************************************************
0 commit comments