2018-09-06 15:41:04 +02: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 \
|
|
|
|
# RUN: | llvm-objdump -mattr=+c -riscv-no-aliases -d -r - \
|
|
|
|
# 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-18 19:54:05 +01: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 15:41:04 +02: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-18 19:54:05 +01:00
|
|
|
# RUN: -riscv-no-aliases -show-encoding < %s 2>&1 \
|
|
|
|
# RUN: | FileCheck -check-prefixes=CHECK-NO-EXT %s
|
2017-12-07 13:50:32 +01:00
|
|
|
|
2018-09-06 15:41:04 +02:00
|
|
|
# FIXME: error messages for rv32c are misleading
|
|
|
|
|
2017-12-07 13:50:32 +01:00
|
|
|
# TODO: more exhaustive testing of immediate encoding.
|
|
|
|
|
2018-09-06 15:41:04 +02:00
|
|
|
# CHECK-ASM-AND-OBJ: c.ldsp ra, 0(sp)
|
|
|
|
# CHECK-ASM: encoding: [0x82,0x60]
|
[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-18 19:54:05 +01:00
|
|
|
# CHECK-NO-EXT: error: instruction use requires an option to be enabled
|
2018-09-06 15:41:04 +02:00
|
|
|
c.ldsp ra, 0(sp)
|
|
|
|
# CHECK-ASM-AND-OBJ: c.sdsp ra, 504(sp)
|
|
|
|
# CHECK-ASM: encoding: [0x86,0xff]
|
[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-18 19:54:05 +01:00
|
|
|
# CHECK-NO-EXT: error: instruction use requires an option to be enabled
|
2018-09-06 15:41:04 +02:00
|
|
|
c.sdsp ra, 504(sp)
|
|
|
|
# CHECK-ASM-AND-OBJ: c.ld a4, 0(a3)
|
|
|
|
# CHECK-ASM: encoding: [0x98,0x62]
|
[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-18 19:54:05 +01:00
|
|
|
# CHECK-NO-EXT: error: instruction use requires an option to be enabled
|
2018-09-06 15:41:04 +02:00
|
|
|
c.ld a4, 0(a3)
|
|
|
|
# CHECK-ASM-AND-OBJ: c.sd a5, 248(a3)
|
|
|
|
# CHECK-ASM: encoding: [0xfc,0xfe]
|
[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-18 19:54:05 +01:00
|
|
|
# CHECK-NO-EXT: error: instruction use requires an option to be enabled
|
2018-09-06 15:41:04 +02:00
|
|
|
c.sd a5, 248(a3)
|
2017-12-13 10:32:55 +01:00
|
|
|
|
2018-09-06 15:41:04 +02: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]
|
[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-18 19:54:05 +01:00
|
|
|
# CHECK-NO-EXT: error: instruction use requires an option to be enabled
|
2018-09-06 15:41:04 +02:00
|
|
|
c.addw a0, a2
|
2017-12-13 10:32:55 +01:00
|
|
|
|
2018-09-06 15:41:04 +02:00
|
|
|
# CHECK-ASM-AND-OBJ: c.addiw a3, -32
|
|
|
|
# CHECK-ASM: encoding: [0x81,0x36]
|
[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-18 19:54:05 +01:00
|
|
|
# CHECK-NO-EXT: error: instruction use requires an option to be enabled
|
2018-09-06 15:41:04 +02:00
|
|
|
c.addiw a3, -32
|
|
|
|
# CHECK-ASM-AND-OBJ: c.addiw a3, 31
|
|
|
|
# CHECK-ASM: encoding: [0xfd,0x26]
|
[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-18 19:54:05 +01:00
|
|
|
# CHECK-NO-EXT: error: instruction use requires an option to be enabled
|
2018-09-06 15:41:04 +02:00
|
|
|
c.addiw a3, 31
|
2017-12-15 11:20:51 +01:00
|
|
|
|
2018-09-06 15:41:04 +02:00
|
|
|
# CHECK-ASM-AND-OBJ: c.slli s0, 1
|
|
|
|
# CHECK-ASM: encoding: [0x06,0x04]
|
|
|
|
# CHECK-NO-EXT: error: instruction use requires an option to be enabled
|
|
|
|
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
|