@@ -615,7 +615,8 @@ def spe4rc : RegisterOperand<GPRC> {
615
615
}
616
616
617
617
def PPCU1ImmAsmOperand : AsmOperandClass {
618
- let Name = "U1Imm"; let PredicateMethod = "isU1Imm";
618
+ let Name = "U1Imm";
619
+ let PredicateMethod = "isUImm<1>";
619
620
let RenderMethod = "addImmOperands";
620
621
}
621
622
def u1imm : Operand<i32> {
@@ -626,7 +627,8 @@ def u1imm : Operand<i32> {
626
627
}
627
628
628
629
def PPCU2ImmAsmOperand : AsmOperandClass {
629
- let Name = "U2Imm"; let PredicateMethod = "isU2Imm";
630
+ let Name = "U2Imm";
631
+ let PredicateMethod = "isUImm<2>";
630
632
let RenderMethod = "addImmOperands";
631
633
}
632
634
def u2imm : Operand<i32> {
@@ -647,7 +649,8 @@ def atimm : Operand<i32> {
647
649
}
648
650
649
651
def PPCU3ImmAsmOperand : AsmOperandClass {
650
- let Name = "U3Imm"; let PredicateMethod = "isU3Imm";
652
+ let Name = "U3Imm";
653
+ let PredicateMethod = "isUImm<3>";
651
654
let RenderMethod = "addImmOperands";
652
655
}
653
656
def u3imm : Operand<i32> {
@@ -658,7 +661,8 @@ def u3imm : Operand<i32> {
658
661
}
659
662
660
663
def PPCU4ImmAsmOperand : AsmOperandClass {
661
- let Name = "U4Imm"; let PredicateMethod = "isU4Imm";
664
+ let Name = "U4Imm";
665
+ let PredicateMethod = "isUImm<4>";
662
666
let RenderMethod = "addImmOperands";
663
667
}
664
668
def u4imm : Operand<i32> {
@@ -668,7 +672,8 @@ def u4imm : Operand<i32> {
668
672
let OperandType = "OPERAND_IMMEDIATE";
669
673
}
670
674
def PPCS5ImmAsmOperand : AsmOperandClass {
671
- let Name = "S5Imm"; let PredicateMethod = "isS5Imm";
675
+ let Name = "S5Imm";
676
+ let PredicateMethod = "isSImm<5>";
672
677
let RenderMethod = "addImmOperands";
673
678
}
674
679
def s5imm : Operand<i32> {
@@ -678,7 +683,8 @@ def s5imm : Operand<i32> {
678
683
let OperandType = "OPERAND_IMMEDIATE";
679
684
}
680
685
def PPCU5ImmAsmOperand : AsmOperandClass {
681
- let Name = "U5Imm"; let PredicateMethod = "isU5Imm";
686
+ let Name = "U5Imm";
687
+ let PredicateMethod = "isUImm<5>";
682
688
let RenderMethod = "addImmOperands";
683
689
}
684
690
def u5imm : Operand<i32> {
@@ -688,7 +694,8 @@ def u5imm : Operand<i32> {
688
694
let OperandType = "OPERAND_IMMEDIATE";
689
695
}
690
696
def PPCU6ImmAsmOperand : AsmOperandClass {
691
- let Name = "U6Imm"; let PredicateMethod = "isU6Imm";
697
+ let Name = "U6Imm";
698
+ let PredicateMethod = "isUImm<6>";
692
699
let RenderMethod = "addImmOperands";
693
700
}
694
701
def u6imm : Operand<i32> {
@@ -698,7 +705,8 @@ def u6imm : Operand<i32> {
698
705
let OperandType = "OPERAND_IMMEDIATE";
699
706
}
700
707
def PPCU7ImmAsmOperand : AsmOperandClass {
701
- let Name = "U7Imm"; let PredicateMethod = "isU7Imm";
708
+ let Name = "U7Imm";
709
+ let PredicateMethod = "isUImm<7>";
702
710
let RenderMethod = "addImmOperands";
703
711
}
704
712
def u7imm : Operand<i32> {
@@ -708,7 +716,8 @@ def u7imm : Operand<i32> {
708
716
let OperandType = "OPERAND_IMMEDIATE";
709
717
}
710
718
def PPCU8ImmAsmOperand : AsmOperandClass {
711
- let Name = "U8Imm"; let PredicateMethod = "isU8Imm";
719
+ let Name = "U8Imm";
720
+ let PredicateMethod = "isUImm<8>";
712
721
let RenderMethod = "addImmOperands";
713
722
}
714
723
def u8imm : Operand<i32> {
@@ -718,7 +727,8 @@ def u8imm : Operand<i32> {
718
727
let OperandType = "OPERAND_IMMEDIATE";
719
728
}
720
729
def PPCU10ImmAsmOperand : AsmOperandClass {
721
- let Name = "U10Imm"; let PredicateMethod = "isU10Imm";
730
+ let Name = "U10Imm";
731
+ let PredicateMethod = "isUImm<10>";
722
732
let RenderMethod = "addImmOperands";
723
733
}
724
734
def u10imm : Operand<i32> {
@@ -728,7 +738,8 @@ def u10imm : Operand<i32> {
728
738
let OperandType = "OPERAND_IMMEDIATE";
729
739
}
730
740
def PPCU12ImmAsmOperand : AsmOperandClass {
731
- let Name = "U12Imm"; let PredicateMethod = "isU12Imm";
741
+ let Name = "U12Imm";
742
+ let PredicateMethod = "isUImm<12>";
732
743
let RenderMethod = "addImmOperands";
733
744
}
734
745
def u12imm : Operand<i32> {
@@ -743,7 +754,14 @@ def PPCS16ImmAsmOperand : AsmOperandClass {
743
754
}
744
755
def s16imm : Operand<i32> {
745
756
let PrintMethod = "printS16ImmOperand";
746
- let EncoderMethod = "getImm16Encoding";
757
+ let EncoderMethod = "getImmEncoding<PPC::fixup_ppc_half16>";
758
+ let ParserMatchClass = PPCS16ImmAsmOperand;
759
+ let DecoderMethod = "decodeSImmOperand<16>";
760
+ let OperandType = "OPERAND_IMMEDIATE";
761
+ }
762
+ def s16imm64 : Operand<i64> {
763
+ let PrintMethod = "printS16ImmOperand";
764
+ let EncoderMethod = "getImmEncoding<PPC::fixup_ppc_half16>";
747
765
let ParserMatchClass = PPCS16ImmAsmOperand;
748
766
let DecoderMethod = "decodeSImmOperand<16>";
749
767
let OperandType = "OPERAND_IMMEDIATE";
@@ -754,7 +772,14 @@ def PPCU16ImmAsmOperand : AsmOperandClass {
754
772
}
755
773
def u16imm : Operand<i32> {
756
774
let PrintMethod = "printU16ImmOperand";
757
- let EncoderMethod = "getImm16Encoding";
775
+ let EncoderMethod = "getImmEncoding<PPC::fixup_ppc_half16>";
776
+ let ParserMatchClass = PPCU16ImmAsmOperand;
777
+ let DecoderMethod = "decodeUImmOperand<16>";
778
+ let OperandType = "OPERAND_IMMEDIATE";
779
+ }
780
+ def u16imm64 : Operand<i64> {
781
+ let PrintMethod = "printU16ImmOperand";
782
+ let EncoderMethod = "getImmEncoding<PPC::fixup_ppc_half16>";
758
783
let ParserMatchClass = PPCU16ImmAsmOperand;
759
784
let DecoderMethod = "decodeUImmOperand<16>";
760
785
let OperandType = "OPERAND_IMMEDIATE";
@@ -768,7 +793,17 @@ def s17imm : Operand<i32> {
768
793
// to accept immediates in the range -65536..65535 for compatibility with
769
794
// the GNU assembler. The operand is treated as 16-bit otherwise.
770
795
let PrintMethod = "printS16ImmOperand";
771
- let EncoderMethod = "getImm16Encoding";
796
+ let EncoderMethod = "getImmEncoding<PPC::fixup_ppc_half16>";
797
+ let ParserMatchClass = PPCS17ImmAsmOperand;
798
+ let DecoderMethod = "decodeSImmOperand<16>";
799
+ let OperandType = "OPERAND_IMMEDIATE";
800
+ }
801
+ def s17imm64 : Operand<i64> {
802
+ // This operand type is used for addis/lis to allow the assembler parser
803
+ // to accept immediates in the range -65536..65535 for compatibility with
804
+ // the GNU assembler. The operand is treated as 16-bit otherwise.
805
+ let PrintMethod = "printS16ImmOperand";
806
+ let EncoderMethod = "getImmEncoding<PPC::fixup_ppc_half16>";
772
807
let ParserMatchClass = PPCS17ImmAsmOperand;
773
808
let DecoderMethod = "decodeSImmOperand<16>";
774
809
let OperandType = "OPERAND_IMMEDIATE";
@@ -780,14 +815,14 @@ def PPCS34ImmAsmOperand : AsmOperandClass {
780
815
}
781
816
def s34imm : Operand<i64> {
782
817
let PrintMethod = "printS34ImmOperand";
783
- let EncoderMethod = "getImm34EncodingNoPCRel ";
818
+ let EncoderMethod = "getImmEncoding<PPC::fixup_ppc_imm34> ";
784
819
let ParserMatchClass = PPCS34ImmAsmOperand;
785
820
let DecoderMethod = "decodeSImmOperand<34>";
786
821
let OperandType = "OPERAND_IMMEDIATE";
787
822
}
788
823
def s34imm_pcrel : Operand<i64> {
789
824
let PrintMethod = "printS34ImmOperand";
790
- let EncoderMethod = "getImm34EncodingPCRel ";
825
+ let EncoderMethod = "getImmEncoding<PPC::fixup_ppc_pcrel34> ";
791
826
let ParserMatchClass = PPCS34ImmAsmOperand;
792
827
let DecoderMethod = "decodeSImmOperand<34>";
793
828
let OperandType = "OPERAND_IMMEDIATE";
0 commit comments