@@ -555,8 +555,8 @@ class CVLoad_rr<bits<7> funct7, bits<3> funct3, string opcodestr>
555
555
let DecoderNamespace = "XCV";
556
556
}
557
557
558
- let Predicates = [HasVendorXCVmem, IsRV32], hasSideEffects = 0,
559
- mayLoad = 1, mayStore = 0, Constraints = "$rs1_wb = $rs1" in {
558
+ let Predicates = [HasVendorXCVmem, IsRV32], hasSideEffects = 0, mayLoad = 1,
559
+ mayStore = 0 in {
560
560
// Register-Immediate load with post-increment
561
561
def CV_LB_ri_inc : CVLoad_ri_inc<0b000, "cv.lb">;
562
562
def CV_LBU_ri_inc : CVLoad_ri_inc<0b100, "cv.lbu">;
@@ -570,10 +570,7 @@ let Predicates = [HasVendorXCVmem, IsRV32], hasSideEffects = 0,
570
570
def CV_LH_rr_inc : CVLoad_rr_inc<0b0000001, 0b011, "cv.lh">;
571
571
def CV_LHU_rr_inc : CVLoad_rr_inc<0b0001001, 0b011, "cv.lhu">;
572
572
def CV_LW_rr_inc : CVLoad_rr_inc<0b0000010, 0b011, "cv.lw">;
573
- }
574
573
575
- let Predicates = [HasVendorXCVmem, IsRV32], hasSideEffects = 0,
576
- mayLoad = 1, mayStore = 0 in {
577
574
// Register-Register load
578
575
def CV_LB_rr : CVLoad_rr<0b0000100, 0b011, "cv.lb">;
579
576
def CV_LBU_rr : CVLoad_rr<0b0001100, 0b011, "cv.lbu">;
@@ -583,16 +580,16 @@ let Predicates = [HasVendorXCVmem, IsRV32], hasSideEffects = 0,
583
580
}
584
581
585
582
class CVStore_ri_inc<bits<3> funct3, string opcodestr>
586
- : RVInstS<funct3, OPC_CUSTOM_1, (outs GPR:$rs1_wb),
583
+ : RVInstS<funct3, OPC_CUSTOM_1, (outs GPR:$rs1_wb),
587
584
(ins GPR:$rs2, GPR:$rs1, simm12:$imm12),
588
585
opcodestr, "$rs2, (${rs1}), ${imm12}"> {
589
586
let Constraints = "$rs1_wb = $rs1";
590
587
let DecoderNamespace = "XCV";
591
588
}
592
589
593
- class CVStore_rr_inc<bits<3> funct3, bits<7> funct7, dag outs, dag ins,
594
- string opcodestr, string argstr>
595
- : RVInst<outs, ins, opcodestr, argstr , [], InstFormatOther> {
590
+ class CVStore_rr_inc<bits<3> funct3, bits<7> funct7, string opcodestr>
591
+ : RVInst<(outs GPR:$rs1_wb), (ins GPR:$rs2, GPR:$rs1, GPR:$rs3), opcodestr,
592
+ "$rs2, (${rs1}), ${rs3}" , [], InstFormatOther> {
596
593
bits<5> rs3;
597
594
bits<5> rs2;
598
595
bits<5> rs1;
@@ -603,13 +600,14 @@ class CVStore_rr_inc<bits<3> funct3, bits<7> funct7, dag outs, dag ins,
603
600
let Inst{14-12} = funct3;
604
601
let Inst{11-7} = rs3;
605
602
let Inst{6-0} = OPC_CUSTOM_1.Value;
603
+ let Constraints = "$rs1_wb = $rs1";
606
604
let DecoderNamespace = "XCV";
607
605
}
608
606
609
607
610
- class CVStore_rr<bits<3> funct3, bits<7> funct7, dag outs, dag ins,
611
- string opcodestr, string argstr>
612
- : RVInst<outs, ins, opcodestr, argstr, [], InstFormatOther> {
608
+ class CVStore_rr<bits<3> funct3, bits<7> funct7, string opcodestr>
609
+ : RVInst<(outs), (ins GPR:$rs2, CVrr:$cvrr), opcodestr, "$rs2, $cvrr", [],
610
+ InstFormatOther> {
613
611
bits<5> rs2;
614
612
bits<10> cvrr;
615
613
@@ -622,39 +620,23 @@ class CVStore_rr<bits<3> funct3, bits<7> funct7, dag outs, dag ins,
622
620
let DecoderNamespace = "XCV";
623
621
}
624
622
625
- let Predicates = [HasVendorXCVmem, IsRV32], hasSideEffects = 0,
626
- mayLoad = 0, mayStore = 1, Constraints = "$rs1_wb = $rs1" in {
623
+ let Predicates = [HasVendorXCVmem, IsRV32], hasSideEffects = 0, mayLoad = 0,
624
+ mayStore = 1 in {
627
625
// Register-Immediate store with post-increment
628
626
def CV_SB_ri_inc : CVStore_ri_inc<0b000, "cv.sb">;
629
627
def CV_SH_ri_inc : CVStore_ri_inc<0b001, "cv.sh">;
630
628
def CV_SW_ri_inc : CVStore_ri_inc<0b010, "cv.sw">;
631
629
632
630
// Register-Register store with post-increment
633
- def CV_SB_rr_inc : CVStore_rr_inc<0b011, 0b0010000,
634
- (outs GPR:$rs1_wb), (ins GPR:$rs2, GPR:$rs1, GPR:$rs3),
635
- "cv.sb", "$rs2, (${rs1}), ${rs3}">;
636
- def CV_SH_rr_inc : CVStore_rr_inc<0b011, 0b0010001,
637
- (outs GPR:$rs1_wb), (ins GPR:$rs2, GPR:$rs1, GPR:$rs3),
638
- "cv.sh", "$rs2, (${rs1}), ${rs3}">;
639
- def CV_SW_rr_inc : CVStore_rr_inc<0b011, 0b0010010,
640
- (outs GPR:$rs1_wb), (ins GPR:$rs2, GPR:$rs1, GPR:$rs3),
641
- "cv.sw", "$rs2, (${rs1}), ${rs3}">;
642
- }
631
+ def CV_SB_rr_inc : CVStore_rr_inc<0b011, 0b0010000, "cv.sb">;
632
+ def CV_SH_rr_inc : CVStore_rr_inc<0b011, 0b0010001, "cv.sh">;
633
+ def CV_SW_rr_inc : CVStore_rr_inc<0b011, 0b0010010, "cv.sw">;
643
634
644
-
645
- let Predicates = [HasVendorXCVmem, IsRV32], hasSideEffects = 0,
646
- mayLoad = 0, mayStore = 1 in {
647
635
// Register-Register store
648
- def CV_SB_rr : CVStore_rr<0b011, 0b0010100,
649
- (outs), (ins GPR:$rs2, CVrr:$cvrr),
650
- "cv.sb", "$rs2, $cvrr">;
651
- def CV_SH_rr : CVStore_rr<0b011, 0b0010101,
652
- (outs), (ins GPR:$rs2, CVrr:$cvrr),
653
- "cv.sh", "$rs2, $cvrr">;
654
- def CV_SW_rr : CVStore_rr<0b011, 0b0010110,
655
- (outs), (ins GPR:$rs2, CVrr:$cvrr),
656
- "cv.sw", "$rs2, $cvrr">;
657
- }
636
+ def CV_SB_rr : CVStore_rr<0b011, 0b0010100, "cv.sb">;
637
+ def CV_SH_rr : CVStore_rr<0b011, 0b0010101, "cv.sh">;
638
+ def CV_SW_rr : CVStore_rr<0b011, 0b0010110, "cv.sw">;
639
+ }
658
640
659
641
let DecoderNamespace = "XCV" in
660
642
class CVLoad_ri<bits<3> funct3, string opcodestr>
0 commit comments