1 # RUN: llvm-mc %s -triple=riscv32 -mattr=+c,+f -M no-aliases -show-encoding \
2 # RUN: | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s
3 # RUN: llvm-mc -filetype=obj -triple=riscv32 -mattr=+c,+f < %s \
4 # RUN: | llvm-objdump --mattr=+c,+f --no-print-imm-hex -M no-aliases -d -r - \
5 # RUN: | FileCheck --check-prefix=CHECK-ASM-AND-OBJ %s
6 # RUN: llvm-mc %s -triple=riscv32 -mattr=+zcf,+f -M no-aliases -show-encoding \
7 # RUN: | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s
8 # RUN: llvm-mc -filetype=obj -triple=riscv32 -mattr=+zcf,+f < %s \
9 # RUN: | llvm-objdump --mattr=+zcf,+f --no-print-imm-hex -M no-aliases -d -r - \
10 # RUN: | FileCheck --check-prefix=CHECK-ASM-AND-OBJ %s
12 # RUN: not llvm-mc -triple riscv32 -mattr=+c \
13 # RUN: -M no-aliases -show-encoding < %s 2>&1 \
14 # RUN: | FileCheck -check-prefixes=CHECK-NO-EXT-F %s
15 # RUN: not llvm-mc -triple riscv32 \
16 # RUN: -M no-aliases -show-encoding < %s 2>&1 \
17 # RUN: | FileCheck -check-prefixes=CHECK-NO-EXT-FC %s
18 # RUN: not llvm-mc -triple riscv64 -mattr=+c,+f \
19 # RUN: -M no-aliases -show-encoding < %s 2>&1 \
20 # RUN: | FileCheck -check-prefixes=CHECK-NO-RV32 %s
22 # FIXME: error messages for rv64fc are misleading
24 # CHECK-ASM-AND-OBJ: c.flwsp fs0, 252(sp)
25 # CHECK-ASM: encoding: [0x7e,0x74]
26 # CHECK-NO-EXT-F: error: instruction requires the following: 'F' (Single-Precision Floating-Point){{$}}
27 # CHECK-NO-EXT-FC: error: instruction requires the following: 'C' (Compressed Instructions) or 'Zcf' (Compressed Single-Precision Floating-Point Instructions), 'F' (Single-Precision Floating-Point){{$}}
28 # CHECK-NO-RV32: error: instruction requires the following: RV32I Base Instruction Set{{$}}
30 # CHECK-ASM-AND-OBJ: c.fswsp fa7, 252(sp)
31 # CHECK-ASM: encoding: [0xc6,0xff]
32 # CHECK-NO-EXT-F: error: instruction requires the following: 'F' (Single-Precision Floating-Point){{$}}
33 # CHECK-NO-EXT-FC: error: instruction requires the following: 'C' (Compressed Instructions) or 'Zcf' (Compressed Single-Precision Floating-Point Instructions), 'F' (Single-Precision Floating-Point){{$}}
34 # CHECK-NO-RV32: error: instruction requires the following: RV32I Base Instruction Set{{$}}
37 # CHECK-ASM-AND-OBJ: c.flw fa3, 124(a5)
38 # CHECK-ASM: encoding: [0xf4,0x7f]
39 # CHECK-NO-EXT-F: error: instruction requires the following: 'F' (Single-Precision Floating-Point){{$}}
40 # CHECK-NO-EXT-FC: error: instruction requires the following: 'C' (Compressed Instructions) or 'Zcf' (Compressed Single-Precision Floating-Point Instructions), 'F' (Single-Precision Floating-Point){{$}}
41 # CHECK-NO-RV32: error: instruction requires the following: RV32I Base Instruction Set{{$}}
43 # CHECK-ASM-AND-OBJ: c.fsw fa2, 124(a1)
44 # CHECK-ASM: encoding: [0xf0,0xfd]
45 # CHECK-NO-EXT-F: error: instruction requires the following: 'F' (Single-Precision Floating-Point){{$}}
46 # CHECK-NO-EXT-FC: error: instruction requires the following: 'C' (Compressed Instructions) or 'Zcf' (Compressed Single-Precision Floating-Point Instructions), 'F' (Single-Precision Floating-Point){{$}}
47 # CHECK-NO-RV32: error: instruction requires the following: RV32I Base Instruction Set{{$}}