@@ -313,14 +313,14 @@ class RVBTernaryImm5<bits<2> funct2, bits<3> funct3, RISCVOpcode opcode,
313
313
// Instructions
314
314
//===----------------------------------------------------------------------===//
315
315
316
- let Predicates = [HasStdExtZbbOrZbp ] in {
316
+ let Predicates = [HasStdExtZbbOrZbpOrZbkb ] in {
317
317
def ANDN : ALU_rr<0b0100000, 0b111, "andn">,
318
318
Sched<[WriteIALU, ReadIALU, ReadIALU]>;
319
319
def ORN : ALU_rr<0b0100000, 0b110, "orn">,
320
320
Sched<[WriteIALU, ReadIALU, ReadIALU]>;
321
321
def XNOR : ALU_rr<0b0100000, 0b100, "xnor">,
322
322
Sched<[WriteIALU, ReadIALU, ReadIALU]>;
323
- } // Predicates = [HasStdExtZbbOrZbp ]
323
+ } // Predicates = [HasStdExtZbbOrZbpOrZbkb ]
324
324
325
325
let Predicates = [HasStdExtZba] in {
326
326
def SH1ADD : ALU_rr<0b0010000, 0b010, "sh1add">,
@@ -331,12 +331,12 @@ def SH3ADD : ALU_rr<0b0010000, 0b110, "sh3add">,
331
331
Sched<[WriteSHXADD, ReadSHXADD, ReadSHXADD]>;
332
332
} // Predicates = [HasStdExtZba]
333
333
334
- let Predicates = [HasStdExtZbbOrZbp ] in {
334
+ let Predicates = [HasStdExtZbbOrZbpOrZbkb ] in {
335
335
def ROL : ALU_rr<0b0110000, 0b001, "rol">,
336
336
Sched<[WriteRotateReg, ReadRotateReg, ReadRotateReg]>;
337
337
def ROR : ALU_rr<0b0110000, 0b101, "ror">,
338
338
Sched<[WriteRotateReg, ReadRotateReg, ReadRotateReg]>;
339
- } // Predicates = [HasStdExtZbbOrZbp ]
339
+ } // Predicates = [HasStdExtZbbOrZbpOrZbkb ]
340
340
341
341
let Predicates = [HasStdExtZbs] in {
342
342
def BCLR : ALU_rr<0b0100100, 0b001, "bclr">,
@@ -360,7 +360,7 @@ def XPERMB : ALU_rr<0b0010100, 0b100, "xperm.b">, Sched<[]>;
360
360
def XPERMH : ALU_rr<0b0010100, 0b110, "xperm.h">, Sched<[]>;
361
361
} // Predicates = [HasStdExtZbp]
362
362
363
- let Predicates = [HasStdExtZbbOrZbp ] in
363
+ let Predicates = [HasStdExtZbbOrZbpOrZbkb ] in
364
364
def RORI : RVBShift_ri<0b01100, 0b101, OPC_OP_IMM, "rori">,
365
365
Sched<[WriteRotateImm, ReadRotateImm]>;
366
366
@@ -471,11 +471,13 @@ def BDECOMPRESS : ALU_rr<0b0100100, 0b110, "bdecompress">, Sched<[]>;
471
471
def BCOMPRESS : ALU_rr<0b0000100, 0b110, "bcompress">, Sched<[]>;
472
472
} // Predicates = [HasStdExtZbe]
473
473
474
- let Predicates = [HasStdExtZbp ] in {
474
+ let Predicates = [HasStdExtZbpOrZbkb ] in {
475
475
def PACK : ALU_rr<0b0000100, 0b100, "pack">, Sched<[]>;
476
- def PACKU : ALU_rr<0b0100100, 0b100, "packu">, Sched<[]>;
477
476
def PACKH : ALU_rr<0b0000100, 0b111, "packh">, Sched<[]>;
478
- } // Predicates = [HasStdExtZbp]
477
+ } // Predicates = [HasStdExtZbpOrZbkb]
478
+
479
+ let Predicates = [HasStdExtZbp] in
480
+ def PACKU : ALU_rr<0b0100100, 0b100, "packu">, Sched<[]>;
479
481
480
482
let Predicates = [HasStdExtZbm, IsRV64] in {
481
483
def BMATOR : ALU_rr<0b0000100, 0b011, "bmator">, Sched<[]>;
@@ -504,7 +506,7 @@ def SH3ADDUW : ALUW_rr<0b0010000, 0b110, "sh3add.uw">,
504
506
Sched<[WriteSHXADD32, ReadSHXADD32, ReadSHXADD32]>;
505
507
} // Predicates = [HasStdExtZbb, IsRV64]
506
508
507
- let Predicates = [HasStdExtZbbOrZbp , IsRV64] in {
509
+ let Predicates = [HasStdExtZbbOrZbpOrZbkb , IsRV64] in {
508
510
def ROLW : ALUW_rr<0b0110000, 0b001, "rolw">,
509
511
Sched<[WriteRotateReg32, ReadRotateReg32, ReadRotateReg32]>;
510
512
def RORW : ALUW_rr<0b0110000, 0b101, "rorw">,
@@ -520,7 +522,7 @@ let Predicates = [HasStdExtZbp, IsRV64] in {
520
522
def XPERMW : ALU_rr<0b0010100, 0b000, "xperm.w">, Sched<[]>;
521
523
} // Predicates = [HasStdExtZbp, IsRV64]
522
524
523
- let Predicates = [HasStdExtZbbOrZbp , IsRV64] in
525
+ let Predicates = [HasStdExtZbbOrZbpOrZbkb , IsRV64] in
524
526
def RORIW : RVBShiftW_ri<0b0110000, 0b101, OPC_OP_IMM_32, "roriw">,
525
527
Sched<[WriteRotateImm32, ReadRotateImm32]>;
526
528
@@ -559,10 +561,11 @@ def BDECOMPRESSW : ALUW_rr<0b0100100, 0b110, "bdecompressw">, Sched<[]>;
559
561
def BCOMPRESSW : ALUW_rr<0b0000100, 0b110, "bcompressw">, Sched<[]>;
560
562
} // Predicates = [HasStdExtZbe, IsRV64]
561
563
562
- let Predicates = [HasStdExtZbp , IsRV64] in {
564
+ let Predicates = [HasStdExtZbpOrZbkb , IsRV64] in
563
565
def PACKW : ALUW_rr<0b0000100, 0b100, "packw">, Sched<[]>;
566
+
567
+ let Predicates = [HasStdExtZbp, IsRV64] in
564
568
def PACKUW : ALUW_rr<0b0100100, 0b100, "packuw">, Sched<[]>;
565
- } // Predicates = [HasStdExtZbp, IsRV64]
566
569
567
570
let Predicates = [HasStdExtZbf, IsRV64] in
568
571
def BFPW : ALUW_rr<0b0100100, 0b111, "bfpw">,
@@ -593,21 +596,21 @@ def ZEXTH_RV64 : RVInstR<0b0000100, 0b100, OPC_OP_32, (outs GPR:$rd),
593
596
// causes diagnostics to suggest that Zbp rather than Zbb is required for rev8
594
597
// or gorci. Since Zbb is closer to being finalized than Zbp this will be
595
598
// misleading to users.
596
- let Predicates = [HasStdExtZbbOrZbp , IsRV32] in {
599
+ let Predicates = [HasStdExtZbbOrZbpOrZbkb , IsRV32] in {
597
600
let hasSideEffects = 0, mayLoad = 0, mayStore = 0 in
598
601
def REV8_RV32 : RVInstI<0b101, OPC_OP_IMM, (outs GPR:$rd), (ins GPR:$rs1),
599
602
"rev8", "$rd, $rs1">, Sched<[WriteREV8, ReadREV8]> {
600
603
let imm12 = { 0b01101, 0b0011000 };
601
604
}
602
- } // Predicates = [HasStdExtZbbOrZbp , IsRV32]
605
+ } // Predicates = [HasStdExtZbbOrZbpOrZbkb , IsRV32]
603
606
604
- let Predicates = [HasStdExtZbbOrZbp , IsRV64] in {
607
+ let Predicates = [HasStdExtZbbOrZbpOrZbkb , IsRV64] in {
605
608
let hasSideEffects = 0, mayLoad = 0, mayStore = 0 in
606
609
def REV8_RV64 : RVInstI<0b101, OPC_OP_IMM, (outs GPR:$rd), (ins GPR:$rs1),
607
610
"rev8", "$rd, $rs1">, Sched<[WriteREV8, ReadREV8]> {
608
611
let imm12 = { 0b01101, 0b0111000 };
609
612
}
610
- } // Predicates = [HasStdExtZbbOrZbp , IsRV64]
613
+ } // Predicates = [HasStdExtZbbOrZbpOrZbkb , IsRV64]
611
614
612
615
let Predicates = [HasStdExtZbbOrZbp] in {
613
616
let hasSideEffects = 0, mayLoad = 0, mayStore = 0 in
@@ -617,6 +620,15 @@ def ORCB : RVInstI<0b101, OPC_OP_IMM, (outs GPR:$rd), (ins GPR:$rs1),
617
620
}
618
621
} // Predicates = [HasStdExtZbbOrZbp]
619
622
623
+ let Predicates = [HasStdExtZbpOrZbkb] in
624
+ def BREV8 : RVBUnary<0b0110100, 0b00111, 0b101, OPC_OP_IMM, "brev8">;
625
+
626
+ let Predicates = [HasStdExtZbpOrZbkb, IsRV32] in {
627
+ def ZIP_RV32 : RVBUnary<0b0000100, 0b01111, 0b001, OPC_OP_IMM, "zip">;
628
+ def UNZIP_RV32 : RVBUnary<0b0000100, 0b01111, 0b101, OPC_OP_IMM, "unzip">;
629
+ } // Predicates = [HasStdExtZbkb, IsRV32]
630
+
631
+
620
632
//===----------------------------------------------------------------------===//
621
633
// Pseudo Instructions
622
634
//===----------------------------------------------------------------------===//
@@ -631,11 +643,11 @@ def : InstAlias<"rev2.n $rd, $rs", (GREVI GPR:$rd, GPR:$rs, 0b00010)>;
631
643
def : InstAlias<"rev.n $rd, $rs", (GREVI GPR:$rd, GPR:$rs, 0b00011)>;
632
644
def : InstAlias<"rev4.b $rd, $rs", (GREVI GPR:$rd, GPR:$rs, 0b00100)>;
633
645
def : InstAlias<"rev2.b $rd, $rs", (GREVI GPR:$rd, GPR:$rs, 0b00110)>;
634
- def : InstAlias<"rev.b $rd, $rs", (GREVI GPR:$rd, GPR:$rs, 0b00111)>;
635
646
def : InstAlias<"rev8.h $rd, $rs", (GREVI GPR:$rd, GPR:$rs, 0b01000)>;
636
647
def : InstAlias<"rev4.h $rd, $rs", (GREVI GPR:$rd, GPR:$rs, 0b01100)>;
637
648
def : InstAlias<"rev2.h $rd, $rs", (GREVI GPR:$rd, GPR:$rs, 0b01110)>;
638
649
def : InstAlias<"rev.h $rd, $rs", (GREVI GPR:$rd, GPR:$rs, 0b01111)>;
650
+ def : InstAlias<"rev.b $rd, $rs", (BREV8 GPR:$rd, GPR:$rs)>;
639
651
640
652
def : InstAlias<"zip.n $rd, $rs", (SHFLI GPR:$rd, GPR:$rs, 0b0001)>;
641
653
def : InstAlias<"unzip.n $rd, $rs", (UNSHFLI GPR:$rd, GPR:$rs, 0b0001)>;
@@ -675,8 +687,6 @@ def : InstAlias<"zip4 $rd, $rs", (SHFLI GPR:$rd, GPR:$rs, 0b1100)>;
675
687
def : InstAlias<"unzip4 $rd, $rs", (UNSHFLI GPR:$rd, GPR:$rs, 0b1100)>;
676
688
def : InstAlias<"zip2 $rd, $rs", (SHFLI GPR:$rd, GPR:$rs, 0b1110)>;
677
689
def : InstAlias<"unzip2 $rd, $rs", (UNSHFLI GPR:$rd, GPR:$rs, 0b1110)>;
678
- def : InstAlias<"zip $rd, $rs", (SHFLI GPR:$rd, GPR:$rs, 0b1111)>;
679
- def : InstAlias<"unzip $rd, $rs", (UNSHFLI GPR:$rd, GPR:$rs, 0b1111)>;
680
690
681
691
def : InstAlias<"orc16 $rd, $rs", (GORCI GPR:$rd, GPR:$rs, 0b10000)>;
682
692
def : InstAlias<"orc8 $rd, $rs", (GORCI GPR:$rd, GPR:$rs, 0b11000)>;
0 commit comments