2018-09-06 21:41:04 +08:00
|
|
|
# RUN: llvm-mc %s -triple=riscv64 -mattr=+c -riscv-no-aliases -show-encoding \
|
|
|
|
# RUN: | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=riscv64 -mattr=+c < %s \
|
[RISCV] Support llvm-objdump -M no-aliases and -M numeric
Summary:
Now that llvm-objdump allows target-specific options, we match the
`no-aliases` and `numeric` options for RISC-V, as supported by GNU objdump.
This is done by overriding the variables used for the command-line options, so
that the command-line options are still supported.
This patch updates all tests using `llvm-objdump -riscv-no-aliases` to use
`llvm-objdump -M no-aliases`.
Reviewers: luismarques, asb
Reviewed By: luismarques, asb
Subscribers: pzheng, hiraditya, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, kito-cheng, shiva0217, jrtc27, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, psnobl, benna, Jim, s.egerton, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D66139
llvm-svn: 371534
2019-09-11 00:24:03 +08:00
|
|
|
# RUN: | llvm-objdump -mattr=+c -M no-aliases -d -r - \
|
2018-09-06 21:41:04 +08:00
|
|
|
# RUN: | FileCheck -check-prefixes=CHECK-OBJ,CHECK-ASM-AND-OBJ %s
|
|
|
|
#
|
|
|
|
#
|
[RISCV] Fixed setting predicates for compressed instructions.
Summary:
Fixed setting predicates for compressed instructions.
Some instructions were being generated with C extension
enabled only, without proper checks for the other
required extensions like F, D and 32 and 64-bit target checks.
Affected instructions:
C_FLD, C_FLW, C_LD, C_FSD, C_FSW, C_SD,
C_JAL, C_ADDIW, C_SUBW, C_ADDW,
C_FLDSP, C_FLWSP, C_LDSP, C_FSDSP, C_FSWSP, C_SDSP
Reviewers: asb, shiva0217
Reviewed By: asb
Subscribers: rbar, johnrusso, simoncook, jordy.potman.lists, sabuasal, niosHD, llvm-commits
Differential Revision: https://reviews.llvm.org/D42132
llvm-svn: 322876
2018-01-19 02:54:05 +08:00
|
|
|
# RUN: not llvm-mc -triple riscv64 \
|
|
|
|
# RUN: -riscv-no-aliases -show-encoding < %s 2>&1 \
|
|
|
|
# RUN: | FileCheck -check-prefixes=CHECK-NO-EXT %s
|
2018-09-06 21:41:04 +08:00
|
|
|
# RUN: not llvm-mc -triple riscv32 -mattr=+c \
|
[RISCV] Fixed setting predicates for compressed instructions.
Summary:
Fixed setting predicates for compressed instructions.
Some instructions were being generated with C extension
enabled only, without proper checks for the other
required extensions like F, D and 32 and 64-bit target checks.
Affected instructions:
C_FLD, C_FLW, C_LD, C_FSD, C_FSW, C_SD,
C_JAL, C_ADDIW, C_SUBW, C_ADDW,
C_FLDSP, C_FLWSP, C_LDSP, C_FSDSP, C_FSWSP, C_SDSP
Reviewers: asb, shiva0217
Reviewed By: asb
Subscribers: rbar, johnrusso, simoncook, jordy.potman.lists, sabuasal, niosHD, llvm-commits
Differential Revision: https://reviews.llvm.org/D42132
llvm-svn: 322876
2018-01-19 02:54:05 +08:00
|
|
|
# RUN: -riscv-no-aliases -show-encoding < %s 2>&1 \
|
2019-12-11 00:44:48 +08:00
|
|
|
# RUN: | FileCheck -check-prefixes=CHECK-NO-RV64 %s
|
2018-09-06 21:41:04 +08:00
|
|
|
|
2017-12-07 20:50:32 +08:00
|
|
|
# TODO: more exhaustive testing of immediate encoding.
|
|
|
|
|
2018-09-06 21:41:04 +08:00
|
|
|
# CHECK-ASM-AND-OBJ: c.ldsp ra, 0(sp)
|
|
|
|
# CHECK-ASM: encoding: [0x82,0x60]
|
2019-12-11 00:44:48 +08:00
|
|
|
# CHECK-NO-EXT: error: instruction requires the following: 'C' (Compressed Instructions)
|
|
|
|
# CHECK-NO-RV64: error: instruction requires the following: RV64I Base Instruction Set
|
2018-09-06 21:41:04 +08:00
|
|
|
c.ldsp ra, 0(sp)
|
|
|
|
# CHECK-ASM-AND-OBJ: c.sdsp ra, 504(sp)
|
|
|
|
# CHECK-ASM: encoding: [0x86,0xff]
|
2019-12-11 00:44:48 +08:00
|
|
|
# CHECK-NO-EXT: error: instruction requires the following: 'C' (Compressed Instructions)
|
|
|
|
# CHECK-NO-RV64: error: instruction requires the following: RV64I Base Instruction Set
|
2018-09-06 21:41:04 +08:00
|
|
|
c.sdsp ra, 504(sp)
|
|
|
|
# CHECK-ASM-AND-OBJ: c.ld a4, 0(a3)
|
|
|
|
# CHECK-ASM: encoding: [0x98,0x62]
|
2019-12-11 00:44:48 +08:00
|
|
|
# CHECK-NO-EXT: error: instruction requires the following: 'C' (Compressed Instructions)
|
|
|
|
# CHECK-NO-RV64: error: instruction requires the following: RV64I Base Instruction Set
|
2018-09-06 21:41:04 +08:00
|
|
|
c.ld a4, 0(a3)
|
|
|
|
# CHECK-ASM-AND-OBJ: c.sd a5, 248(a3)
|
|
|
|
# CHECK-ASM: encoding: [0xfc,0xfe]
|
2019-12-11 00:44:48 +08:00
|
|
|
# CHECK-NO-EXT: error: instruction requires the following: 'C' (Compressed Instructions)
|
|
|
|
# CHECK-NO-RV64: error: instruction requires the following: RV64I Base Instruction Set
|
2018-09-06 21:41:04 +08:00
|
|
|
c.sd a5, 248(a3)
|
2017-12-13 17:32:55 +08:00
|
|
|
|
2018-09-06 21:41:04 +08:00
|
|
|
# CHECK-ASM-AND-OBJ: c.subw a3, a4
|
|
|
|
# CHECK-ASM: encoding: [0x99,0x9e]
|
|
|
|
c.subw a3, a4
|
|
|
|
# CHECK-ASM-AND-OBJ: c.addw a0, a2
|
|
|
|
# CHECK-ASM: encoding: [0x31,0x9d]
|
2019-12-11 00:44:48 +08:00
|
|
|
# CHECK-NO-EXT: error: instruction requires the following: 'C' (Compressed Instructions)
|
|
|
|
# CHECK-NO-RV64: error: instruction requires the following: RV64I Base Instruction Set
|
2018-09-06 21:41:04 +08:00
|
|
|
c.addw a0, a2
|
2017-12-13 17:32:55 +08:00
|
|
|
|
2018-09-06 21:41:04 +08:00
|
|
|
# CHECK-ASM-AND-OBJ: c.addiw a3, -32
|
|
|
|
# CHECK-ASM: encoding: [0x81,0x36]
|
2019-12-11 00:44:48 +08:00
|
|
|
# CHECK-NO-EXT: error: instruction requires the following: 'C' (Compressed Instructions)
|
|
|
|
# CHECK-NO-RV64: error: instruction requires the following: RV64I Base Instruction Set
|
2018-09-06 21:41:04 +08:00
|
|
|
c.addiw a3, -32
|
|
|
|
# CHECK-ASM-AND-OBJ: c.addiw a3, 31
|
|
|
|
# CHECK-ASM: encoding: [0xfd,0x26]
|
2019-12-11 00:44:48 +08:00
|
|
|
# CHECK-NO-EXT: error: instruction requires the following: 'C' (Compressed Instructions)
|
|
|
|
# CHECK-NO-RV64: error: instruction requires the following: RV64I Base Instruction Set
|
2018-09-06 21:41:04 +08:00
|
|
|
c.addiw a3, 31
|
2017-12-15 18:20:51 +08:00
|
|
|
|
2018-09-06 21:41:04 +08:00
|
|
|
# CHECK-ASM-AND-OBJ: c.slli s0, 1
|
|
|
|
# CHECK-ASM: encoding: [0x06,0x04]
|
2019-12-11 00:44:48 +08:00
|
|
|
# CHECK-NO-EXT: error: instruction requires the following: 'C' (Compressed Instructions)
|
|
|
|
# CHECK-NO-RV64: error: instruction requires the following: RV64I Base Instruction Set
|
2018-09-06 21:41:04 +08:00
|
|
|
c.slli s0, 1
|
|
|
|
# CHECK-ASM-AND-OBJ: c.srli a3, 63
|
|
|
|
# CHECK-ASM: encoding: [0xfd,0x92]
|
|
|
|
c.srli a3, 63
|
|
|
|
# CHECK-ASM-AND-OBJ: c.srai a2, 63
|
|
|
|
# CHECK-ASM: encoding: [0x7d,0x96]
|
|
|
|
c.srai a2, 63
|