@@ -344,10 +344,9 @@ multiclass FU10_LU10_np<string OpcStr> {
344
344
345
345
// Two operand short
346
346
347
- class F2R_np<string OpcStr> : _F2R<
348
- (outs GRRegs:$dst), (ins GRRegs:$b),
349
- !strconcat(OpcStr, " $dst, $b"),
350
- []>;
347
+ class F2R_np<bits<6> opc, string OpcStr> :
348
+ _F2R<opc, (outs GRRegs:$dst), (ins GRRegs:$b),
349
+ !strconcat(OpcStr, " $dst, $b"), []>;
351
350
352
351
// Two operand long
353
352
@@ -753,13 +752,11 @@ def BL_lu10 : _FLU10<
753
752
754
753
// Two operand short
755
754
// TODO eet, eef, tsetmr
756
- def NOT : _F2R<(outs GRRegs:$dst), (ins GRRegs:$b),
757
- "not $dst, $b",
758
- [(set GRRegs:$dst, (not GRRegs:$b))]>;
755
+ def NOT : _F2R<0b100010, (outs GRRegs:$dst), (ins GRRegs:$b),
756
+ "not $dst, $b", [(set GRRegs:$dst, (not GRRegs:$b))]>;
759
757
760
- def NEG : _F2R<(outs GRRegs:$dst), (ins GRRegs:$b),
761
- "neg $dst, $b",
762
- [(set GRRegs:$dst, (ineg GRRegs:$b))]>;
758
+ def NEG : _F2R<0b100100, (outs GRRegs:$dst), (ins GRRegs:$b),
759
+ "neg $dst, $b", [(set GRRegs:$dst, (ineg GRRegs:$b))]>;
763
760
764
761
let Constraints = "$src1 = $dst" in {
765
762
def SEXT_rus : _FRUS<(outs GRRegs:$dst), (ins GRRegs:$src1, i32imm:$src2),
@@ -777,114 +774,119 @@ def ZEXT_rus : _FRUS<(outs GRRegs:$dst), (ins GRRegs:$src1, i32imm:$src2),
777
774
[(set GRRegs:$dst, (int_xcore_zext GRRegs:$src1,
778
775
immBitp:$src2))]>;
779
776
780
- def ZEXT_2r : _FRUS<(outs GRRegs:$dst), (ins GRRegs:$src1 , GRRegs:$src2 ),
777
+ def ZEXT_2r : _FRUS<(outs GRRegs:$dst), (ins GRRegs:$src2 , GRRegs:$src1 ),
781
778
"zext $dst, $src2",
782
779
[(set GRRegs:$dst, (int_xcore_zext GRRegs:$src1,
783
780
GRRegs:$src2))]>;
784
781
785
- def ANDNOT_2r : _F2R<(outs GRRegs:$dst), (ins GRRegs:$src1, GRRegs:$src2),
786
- "andnot $dst, $src2",
787
- [(set GRRegs:$dst, (and GRRegs:$src1, (not GRRegs:$src2)))]>;
782
+ def ANDNOT_2r :
783
+ _F2RSrcDst<0b001010, (outs GRRegs:$dst), (ins GRRegs:$src1, GRRegs:$src2),
784
+ "andnot $dst, $src2",
785
+ [(set GRRegs:$dst, (and GRRegs:$src1, (not GRRegs:$src2)))]>;
788
786
}
789
787
790
788
let isReMaterializable = 1, neverHasSideEffects = 1 in
791
789
def MKMSK_rus : _FRUS<(outs GRRegs:$dst), (ins i32imm:$size),
792
790
"mkmsk $dst, $size",
793
791
[]>;
794
792
795
- def MKMSK_2r : _FRUS< (outs GRRegs:$dst), (ins GRRegs:$size),
796
- "mkmsk $dst, $size",
797
- [(set GRRegs:$dst, (add (shl 1, GRRegs:$size), -1))]>;
793
+ def MKMSK_2r : _F2R<0b101000, (outs GRRegs:$dst), (ins GRRegs:$size),
794
+ "mkmsk $dst, $size",
795
+ [(set GRRegs:$dst, (add (shl 1, GRRegs:$size), -1))]>;
798
796
799
797
def GETR_rus : _FRUS<(outs GRRegs:$dst), (ins i32imm:$type),
800
798
"getr $dst, $type",
801
799
[(set GRRegs:$dst, (int_xcore_getr immUs:$type))]>;
802
800
803
- def GETTS_2r : _F2R<(outs GRRegs:$dst), (ins GRRegs:$r),
804
- "getts $dst, res[$r]",
805
- [(set GRRegs:$dst, (int_xcore_getts GRRegs:$r))]>;
801
+ def GETTS_2r : _F2R<0b001110, (outs GRRegs:$dst), (ins GRRegs:$r),
802
+ "getts $dst, res[$r]",
803
+ [(set GRRegs:$dst, (int_xcore_getts GRRegs:$r))]>;
806
804
807
- def SETPT_2r : _F2R< (outs), (ins GRRegs:$r, GRRegs:$val),
808
- "setpt res[$r], $val",
809
- [(int_xcore_setpt GRRegs:$r, GRRegs:$val)]>;
805
+ def SETPT_2r : _FR2R<0b001111, (outs), (ins GRRegs:$r, GRRegs:$val),
806
+ "setpt res[$r], $val",
807
+ [(int_xcore_setpt GRRegs:$r, GRRegs:$val)]>;
810
808
811
- def OUTCT_2r : _F2R<(outs), (ins GRRegs:$r, GRRegs:$val),
812
- "outct res[$r], $val",
813
- [(int_xcore_outct GRRegs:$r, GRRegs:$val)]>;
809
+ def OUTCT_2r : _F2R<0b010010, (outs), (ins GRRegs:$r, GRRegs:$val),
810
+ "outct res[$r], $val",
811
+ [(int_xcore_outct GRRegs:$r, GRRegs:$val)]>;
814
812
815
- def OUTCT_rus : _F2R <(outs), (ins GRRegs:$r, i32imm:$val),
816
- "outct res[$r], $val",
817
- [(int_xcore_outct GRRegs:$r, immUs:$val)]>;
813
+ def OUTCT_rus : _F2RUS <(outs), (ins GRRegs:$r, i32imm:$val),
814
+ "outct res[$r], $val",
815
+ [(int_xcore_outct GRRegs:$r, immUs:$val)]>;
818
816
819
- def OUTT_2r : _F2R< (outs), (ins GRRegs:$r, GRRegs:$val),
820
- "outt res[$r], $val",
821
- [(int_xcore_outt GRRegs:$r, GRRegs:$val)]>;
817
+ def OUTT_2r : _FR2R<0b000011, (outs), (ins GRRegs:$r, GRRegs:$val),
818
+ "outt res[$r], $val",
819
+ [(int_xcore_outt GRRegs:$r, GRRegs:$val)]>;
822
820
823
- def OUT_2r : _F2R< (outs), (ins GRRegs:$r, GRRegs:$val),
824
- "out res[$r], $val",
825
- [(int_xcore_out GRRegs:$r, GRRegs:$val)]>;
821
+ def OUT_2r : _FR2R<0b101010, (outs), (ins GRRegs:$r, GRRegs:$val),
822
+ "out res[$r], $val",
823
+ [(int_xcore_out GRRegs:$r, GRRegs:$val)]>;
826
824
827
825
let Constraints = "$src = $dst" in
828
- def OUTSHR_2r : _F2R<(outs GRRegs:$dst), (ins GRRegs:$r, GRRegs:$src),
829
- "outshr res[$r], $src" ,
830
- [(set GRRegs:$dst, (int_xcore_outshr GRRegs:$r ,
831
- GRRegs:$src))]>;
826
+ def OUTSHR_2r :
827
+ _F2RSrcDst<0b101011, (outs GRRegs:$dst), (ins GRRegs:$src, GRRegs:$r) ,
828
+ "outshr res[$r], $src" ,
829
+ [(set GRRegs:$dst, (int_xcore_outshr GRRegs:$r, GRRegs:$src))]>;
832
830
833
- def INCT_2r : _F2R<(outs GRRegs:$dst), (ins GRRegs:$r),
834
- "inct $dst, res[$r]",
835
- [(set GRRegs:$dst, (int_xcore_inct GRRegs:$r))]>;
831
+ def INCT_2r : _F2R<0b100001, (outs GRRegs:$dst), (ins GRRegs:$r),
832
+ "inct $dst, res[$r]",
833
+ [(set GRRegs:$dst, (int_xcore_inct GRRegs:$r))]>;
836
834
837
- def INT_2r : _F2R<(outs GRRegs:$dst), (ins GRRegs:$r),
838
- "int $dst, res[$r]",
839
- [(set GRRegs:$dst, (int_xcore_int GRRegs:$r))]>;
835
+ def INT_2r : _F2R<0b100011, (outs GRRegs:$dst), (ins GRRegs:$r),
836
+ "int $dst, res[$r]",
837
+ [(set GRRegs:$dst, (int_xcore_int GRRegs:$r))]>;
840
838
841
- def IN_2r : _F2R<(outs GRRegs:$dst), (ins GRRegs:$r),
839
+ def IN_2r : _F2R<0b101100, (outs GRRegs:$dst), (ins GRRegs:$r),
842
840
"in $dst, res[$r]",
843
841
[(set GRRegs:$dst, (int_xcore_in GRRegs:$r))]>;
844
842
845
843
let Constraints = "$src = $dst" in
846
- def INSHR_2r : _F2R<(outs GRRegs:$dst), (ins GRRegs:$r, GRRegs:$src),
847
- "inshr $dst, res[$r]" ,
848
- [(set GRRegs: $dst, (int_xcore_inshr GRRegs:$r ,
849
- GRRegs:$src))]>;
844
+ def INSHR_2r :
845
+ _F2RSrcDst<0b101101, (outs GRRegs:$dst), (ins GRRegs:$src, GRRegs:$r) ,
846
+ "inshr $dst, res[$r]" ,
847
+ [(set GRRegs:$dst, (int_xcore_inshr GRRegs:$r, GRRegs:$src))]>;
850
848
851
- def CHKCT_2r : _F2R<(outs), (ins GRRegs:$r, GRRegs:$val),
852
- "chkct res[$r], $val",
853
- [(int_xcore_chkct GRRegs:$r, GRRegs:$val)]>;
849
+ def CHKCT_2r : _F2R<0b110010, (outs), (ins GRRegs:$r, GRRegs:$val),
850
+ "chkct res[$r], $val",
851
+ [(int_xcore_chkct GRRegs:$r, GRRegs:$val)]>;
854
852
855
- def CHKCT_rus : _F2R <(outs), (ins GRRegs:$r, i32imm:$val),
853
+ def CHKCT_rus : _F2RUS <(outs), (ins GRRegs:$r, i32imm:$val),
856
854
"chkct res[$r], $val",
857
855
[(int_xcore_chkct GRRegs:$r, immUs:$val)]>;
858
856
859
- def TESTCT_2r : _F2R<(outs GRRegs:$dst), (ins GRRegs:$src),
857
+ def TESTCT_2r : _F2R<0b101111, (outs GRRegs:$dst), (ins GRRegs:$src),
860
858
"testct $dst, res[$src]",
861
859
[(set GRRegs:$dst, (int_xcore_testct GRRegs:$src))]>;
862
860
863
- def TESTWCT_2r : _F2R<(outs GRRegs:$dst), (ins GRRegs:$src),
861
+ def TESTWCT_2r : _F2R<0b110001, (outs GRRegs:$dst), (ins GRRegs:$src),
864
862
"testwct $dst, res[$src]",
865
863
[(set GRRegs:$dst, (int_xcore_testwct GRRegs:$src))]>;
866
864
867
- def SETD_2r : _F2R< (outs), (ins GRRegs:$r, GRRegs:$val),
868
- "setd res[$r], $val",
869
- [(int_xcore_setd GRRegs:$r, GRRegs:$val)]>;
865
+ def SETD_2r : _FR2R<0b000101, (outs), (ins GRRegs:$r, GRRegs:$val),
866
+ "setd res[$r], $val",
867
+ [(int_xcore_setd GRRegs:$r, GRRegs:$val)]>;
870
868
871
- def GETST_2r : _F2R<(outs GRRegs:$dst), (ins GRRegs:$r),
869
+ def SETPSC_l2r : _FR2R<0b110000, (outs), (ins GRRegs:$src1, GRRegs:$src2),
870
+ "setpsc res[$src1], $src2",
871
+ [(int_xcore_setpsc GRRegs:$src1, GRRegs:$src2)]>;
872
+
873
+ def GETST_2r : _F2R<0b000001, (outs GRRegs:$dst), (ins GRRegs:$r),
872
874
"getst $dst, res[$r]",
873
875
[(set GRRegs:$dst, (int_xcore_getst GRRegs:$r))]>;
874
876
875
- def INITSP_2r : _F2R<(outs), (ins GRRegs:$t , GRRegs:$src ),
877
+ def INITSP_2r : _F2R<0b000100, (outs), (ins GRRegs:$src , GRRegs:$t ),
876
878
"init t[$t]:sp, $src",
877
879
[(int_xcore_initsp GRRegs:$t, GRRegs:$src)]>;
878
880
879
- def INITPC_2r : _F2R<(outs), (ins GRRegs:$t , GRRegs:$src ),
881
+ def INITPC_2r : _F2R<0b000000, (outs), (ins GRRegs:$src , GRRegs:$t ),
880
882
"init t[$t]:pc, $src",
881
883
[(int_xcore_initpc GRRegs:$t, GRRegs:$src)]>;
882
884
883
- def INITCP_2r : _F2R<(outs), (ins GRRegs:$t , GRRegs:$src ),
885
+ def INITCP_2r : _F2R<0b000110, (outs), (ins GRRegs:$src , GRRegs:$t ),
884
886
"init t[$t]:cp, $src",
885
887
[(int_xcore_initcp GRRegs:$t, GRRegs:$src)]>;
886
888
887
- def INITDP_2r : _F2R<(outs), (ins GRRegs:$t , GRRegs:$src ),
889
+ def INITDP_2r : _F2R<0b000010, (outs), (ins GRRegs:$src , GRRegs:$t ),
888
890
"init t[$t]:dp, $src",
889
891
[(int_xcore_initdp GRRegs:$t, GRRegs:$src)]>;
890
892
@@ -930,10 +932,6 @@ def SETRDY_l2r : _FL2R<(outs), (ins GRRegs:$src1, GRRegs:$src2),
930
932
"setrdy res[$src1], $src2",
931
933
[(int_xcore_setrdy GRRegs:$src1, GRRegs:$src2)]>;
932
934
933
- def SETPSC_l2r : _FL2R<(outs), (ins GRRegs:$src1, GRRegs:$src2),
934
- "setpsc res[$src1], $src2",
935
- [(int_xcore_setpsc GRRegs:$src1, GRRegs:$src2)]>;
936
-
937
935
def PEEK_l2r : _FL2R<(outs GRRegs:$dst), (ins GRRegs:$src),
938
936
"peek $dst, res[$src]",
939
937
[(set GRRegs:$dst, (int_xcore_peek GRRegs:$src))]>;
0 commit comments