Skip to content

Commit 82921ce

Browse files
committed
rename RVPUnaryImm9 to RVPUnaryImm10 and fix simm10 encoding, fix REV_RV64 encoding, remove unnecessary addd test change,
1 parent 43d5b23 commit 82921ce

File tree

5 files changed

+17
-23
lines changed

5 files changed

+17
-23
lines changed

llvm/lib/Target/RISCV/RISCVInstrInfo.td

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2254,13 +2254,6 @@ include "RISCVInstrInfoZvqdotq.td"
22542254
// Packed SIMD
22552255
include "RISCVInstrInfoP.td"
22562256

2257-
// Integer
2258-
include "RISCVInstrInfoZimop.td"
2259-
include "RISCVInstrInfoZicbo.td"
2260-
include "RISCVInstrInfoZicond.td"
2261-
include "RISCVInstrInfoZicfiss.td"
2262-
include "RISCVInstrInfoZilsd.td"
2263-
22642257
// Compressed
22652258
include "RISCVInstrInfoC.td"
22662259
include "RISCVInstrInfoZc.td"

llvm/lib/Target/RISCV/RISCVInstrInfoP.td

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,14 @@ def simm10 : RISCVSImmLeafOp<10>;
2525
//===----------------------------------------------------------------------===//
2626

2727
let hasSideEffects = 0, mayLoad = 0, mayStore = 0 in
28-
class RVPUnaryImm9<bits<7> funct7, string opcodestr>
28+
class RVPUnaryImm10<bits<7> funct7, string opcodestr>
2929
: RVInstIBase<0b010, OPC_OP_IMM_32, (outs GPR:$rd), (ins simm10:$simm10),
3030
opcodestr, "$rd, $simm10"> {
3131
bits<10> simm10;
3232

3333
let Inst{31-25} = funct7;
34-
let Inst{24-15} = simm10;
34+
let Inst{24-16} = simm10{8-0};
35+
let Inst{15} = simm10{9};
3536
}
3637

3738
let hasSideEffects = 0, mayLoad = 0, mayStore = 0 in
@@ -103,7 +104,7 @@ def REV_RV32 : Unary_r<0b011010011111, 0b101, "rev">;
103104

104105
let Predicates = [HasStdExtP, IsRV64] in {
105106
def REV16 : Unary_r<0b011010110000, 0b101, "rev16">;
106-
def REV_RV64 : Unary_r<0b011110111111, 0b101, "rev">;
107+
def REV_RV64 : Unary_r<0b011010111111, 0b101, "rev">;
107108

108109
def CLSW : UnaryW_r<0b011000000011, 0b001, "clsw">;
109110
def ABSW : UnaryW_r<0b011000000111, 0b001, "absw">;
@@ -123,9 +124,9 @@ def PSSLAI_W : RVPUnaryImm5<0b101, "psslai.w">;
123124
} // Predicates = [HasStdExtP, IsRV64]
124125

125126
let Predicates = [HasStdExtP] in
126-
def PLI_H : RVPUnaryImm9<0b1011000, "pli.h">;
127+
def PLI_H : RVPUnaryImm10<0b1011000, "pli.h">;
127128
let Predicates = [HasStdExtP, IsRV64] in
128-
def PLI_W : RVPUnaryImm9<0b1011001, "pli.w">;
129+
def PLI_W : RVPUnaryImm10<0b1011001, "pli.w">;
129130
let Predicates = [HasStdExtP] in
130131
def PLI_B : RVPUnaryImm8<0b10110100, "pli.b">;
131132

@@ -140,6 +141,6 @@ def PSEXT_W_H : RVPUnaryWUF<0b01, 0b00101, "psext.w.h">;
140141
} // Predicates = [HasStdExtP, IsRV64]
141142

142143
let Predicates = [HasStdExtP] in
143-
def PLUI_H : RVPUnaryImm9<0b1111000, "plui.h">;
144+
def PLUI_H : RVPUnaryImm10<0b1111000, "plui.h">;
144145
let Predicates = [HasStdExtP, IsRV64] in
145-
def PLUI_W : RVPUnaryImm9<0b1111001, "plui.w">;
146+
def PLUI_W : RVPUnaryImm10<0b1111001, "plui.w">;

llvm/test/MC/RISCV/invalid-instruction-spellcheck.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ fl ft0, 0(sp)
2222
# CHECK-RV64IF: did you mean: flw, la, lb, ld, lh, li, lw
2323
# CHECK-NEXT: fl ft0, 0(sp)
2424

25-
addc x1, x1, x1
25+
addd x1, x1, x1
2626
# CHECK-RV32: did you mean: add, addi
2727
# CHECK-RV64: did you mean: add, addi, addw
28-
# CHECK-NEXT: addc x1, x1, x1
28+
# CHECK-NEXT: addd x1, x1, x1
2929

3030
vm x0, x0
3131
# CHECK: did you mean: mv

llvm/test/MC/RISCV/rv32p-valid.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ psslai.h t0, t1, 2
5656
# CHECK-ASM: encoding: [0x1b,0xa7,0x37,0xd2]
5757
sslai a4, a5, 3
5858
# CHECK-ASM-AND-OBJ: pli.h a5, 16
59-
# CHECK-ASM: encoding: [0x9b,0x27,0x08,0xb0]
59+
# CHECK-ASM: encoding: [0x9b,0x27,0x10,0xb0]
6060
pli.h a5, 16
6161
# CHECK-ASM-AND-OBJ: pli.b a6, 16
6262
# CHECK-ASM: encoding: [0x1b,0x28,0x10,0xb4]
@@ -71,5 +71,5 @@ psabs.h a1, a2
7171
# CHECK-ASM: encoding: [0x9b,0x22,0x73,0xe4]
7272
psabs.b t0, t1
7373
# CHECK-ASM-AND-OBJ: plui.h gp, 32
74-
# CHECK-ASM: encoding: [0x9b,0x21,0x10,0xf0]
74+
# CHECK-ASM: encoding: [0x9b,0x21,0x20,0xf0]
7575
plui.h gp, 32

llvm/test/MC/RISCV/rv64p-valid.s

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ rev16 s0, s1
2626
# CHECK-ASM: encoding: [0x13,0xd4,0x84,0x6b]
2727
rev8 s0, s1
2828
# CHECK-ASM-AND-OBJ: rev s2, s3
29-
# CHECK-ASM: encoding: [0x13,0xd9,0xf9,0x7b]
29+
# CHECK-ASM: encoding: [0x13,0xd9,0xf9,0x6b]
3030
rev s2, s3
3131
# CHECK-ASM-AND-OBJ: clzw s0, s1
3232
# CHECK-ASM: encoding: [0x1b,0x94,0x04,0x60]
@@ -71,10 +71,10 @@ psslai.h t0, t1, 3
7171
# CHECK-ASM: encoding: [0x1b,0xa7,0x47,0xd2]
7272
psslai.w a4, a5, 4
7373
# CHECK-ASM-AND-OBJ: pli.h a5, 5
74-
# CHECK-ASM: encoding: [0x9b,0xa7,0x02,0xb0]
74+
# CHECK-ASM: encoding: [0x9b,0x27,0x05,0xb0]
7575
pli.h a5, 5
7676
# CHECK-ASM-AND-OBJ: pli.w a5, 5
77-
# CHECK-ASM: encoding: [0x9b,0xa7,0x02,0xb2]
77+
# CHECK-ASM: encoding: [0x9b,0x27,0x05,0xb2]
7878
pli.w a5, 5
7979
# CHECK-ASM-AND-OBJ: pli.b a6, 6
8080
# CHECK-ASM: encoding: [0x1b,0x28,0x06,0xb4]
@@ -95,8 +95,8 @@ psabs.h t1, t5
9595
# CHECK-ASM: encoding: [0x1b,0x25,0x79,0xe4]
9696
psabs.b a0, s2
9797
# CHECK-ASM-AND-OBJ: plui.h s2, 4
98-
# CHECK-ASM: encoding: [0x1b,0x29,0x02,0xf0]
98+
# CHECK-ASM: encoding: [0x1b,0x29,0x04,0xf0]
9999
plui.h s2, 4
100100
# CHECK-ASM-AND-OBJ: plui.w a2, 1
101-
# CHECK-ASM: encoding: [0x1b,0xa6,0x00,0xf2]
101+
# CHECK-ASM: encoding: [0x1b,0x26,0x01,0xf2]
102102
plui.w a2, 1

0 commit comments

Comments
 (0)