Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions llvm/lib/Target/RISCV/RISCVInstrInfoZb.td
Original file line number Diff line number Diff line change
Expand Up @@ -459,15 +459,15 @@ let Predicates = [HasStdExtZba, IsRV64] in {
def : InstAlias<"zext.w $rd, $rs", (ADD_UW GPR:$rd, GPR:$rs, X0)>;
} // Predicates = [HasStdExtZba, IsRV64]

let Predicates = [HasStdExtZbb] in {
let Predicates = [HasStdExtZbbOrZbkb] in {
def : InstAlias<"ror $rd, $rs1, $shamt",
(RORI GPR:$rd, GPR:$rs1, uimmlog2xlen:$shamt), 0>;
} // Predicates = [HasStdExtZbb]
(RORI GPR:$rd, GPR:$rs1, uimmlog2xlen:$shamt), 0>;
} // Predicates = [HasStdExtZbbOrZbkb]

let Predicates = [HasStdExtZbb, IsRV64] in {
let Predicates = [HasStdExtZbbOrZbkb, IsRV64] in {
def : InstAlias<"rorw $rd, $rs1, $shamt",
(RORIW GPR:$rd, GPR:$rs1, uimm5:$shamt), 0>;
} // Predicates = [HasStdExtZbb, IsRV64]
(RORIW GPR:$rd, GPR:$rs1, uimm5:$shamt), 0>;
} // Predicates = [HasStdExtZbbOrZbkb, IsRV64]

let Predicates = [HasStdExtZbs] in {
def : InstAlias<"bset $rd, $rs1, $shamt",
Expand Down
20 changes: 20 additions & 0 deletions llvm/test/MC/RISCV/rv32zbkb-aliases-valid.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# RUN: llvm-mc %s -triple=riscv32 -mattr=+zbkb -M no-aliases \
# RUN: | FileCheck -check-prefixes=CHECK-S-OBJ-NOALIAS %s
# RUN: llvm-mc %s -triple=riscv32 -mattr=+zbkb \
# RUN: | FileCheck -check-prefixes=CHECK-S-OBJ %s
# RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+zbkb < %s \
# RUN: | llvm-objdump --no-print-imm-hex -d -r -M no-aliases --mattr=+zbkb - \
# RUN: | FileCheck -check-prefixes=CHECK-S-OBJ-NOALIAS %s
# RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+zbkb < %s \
# RUN: | llvm-objdump --no-print-imm-hex -d -r --mattr=+zbkb - \
# RUN: | FileCheck -check-prefixes=CHECK-S-OBJ %s

# The following check prefixes are used in this test:
# CHECK-S-OBJ Match both the .s and objdumped object output with
# aliases enabled
# CHECK-S-OBJ-NOALIAS Match both the .s and objdumped object output with
# aliases disabled

# CHECK-S-OBJ-NOALIAS: rori t0, t1, 8
# CHECK-S-OBJ: rori t0, t1, 8
ror x5, x6, 8
24 changes: 24 additions & 0 deletions llvm/test/MC/RISCV/rv64zbkb-aliases-valid.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# RUN: llvm-mc %s -triple=riscv64 -mattr=+zbkb -M no-aliases \
# RUN: | FileCheck -check-prefixes=CHECK-S-OBJ-NOALIAS %s
# RUN: llvm-mc %s -triple=riscv64 -mattr=+zbkb \
# RUN: | FileCheck -check-prefixes=CHECK-S-OBJ %s
# RUN: llvm-mc -filetype=obj -triple riscv64 -mattr=+zbkb < %s \
# RUN: | llvm-objdump --no-print-imm-hex -d -r -M no-aliases --mattr=+zbkb - \
# RUN: | FileCheck -check-prefixes=CHECK-S-OBJ-NOALIAS %s
# RUN: llvm-mc -filetype=obj -triple riscv64 -mattr=+zbkb < %s \
# RUN: | llvm-objdump --no-print-imm-hex -d -r --mattr=+zbkb - \
# RUN: | FileCheck -check-prefixes=CHECK-S-OBJ %s

# The following check prefixes are used in this test:
# CHECK-S-OBJ Match both the .s and objdumped object output with
# aliases enabled
# CHECK-S-OBJ-NOALIAS Match both the .s and objdumped object output with
# aliases disabled

# CHECK-S-OBJ-NOALIAS: rori t0, t1, 8
# CHECK-S-OBJ: rori t0, t1, 8
ror x5, x6, 8

# CHECK-S-OBJ-NOALIAS: roriw t0, t1, 8
# CHECK-S-OBJ: roriw t0, t1, 8
rorw x5, x6, 8