1 # RUN: llvm-mc -triple riscv64 -mattr=+c -show-encoding < %s \
2 # RUN: | FileCheck -check-prefixes=CHECK-ALIAS %s
3 # RUN: llvm-mc -triple riscv64 -mattr=+c -show-encoding \
4 # RUN: -riscv-no-aliases <%s | FileCheck -check-prefixes=CHECK-INST %s
5 # RUN: llvm-mc -triple riscv64 -mattr=+c -filetype=obj < %s \
6 # RUN: | llvm-objdump -triple riscv64 -mattr=+c -d - \
7 # RUN: | FileCheck -check-prefixes=CHECK-BYTES,CHECK-ALIAS %s
8 # RUN: llvm-mc -triple riscv64 -mattr=+c -filetype=obj < %s \
9 # RUN: | llvm-objdump -triple riscv64 -mattr=+c -d -M no-aliases - \
10 # RUN: | FileCheck -check-prefixes=CHECK-BYTES,CHECK-INST %s
12 # Tests compressed instructions available in rv64 and not in rv32.
15 # CHECK-ALIAS: ld s0, 248(a5)
16 # CHECK-INST: c.ld s0, 248(a5)
17 # CHECK: # encoding: [0xe0,0x7f]
21 # CHECK-ALIAS: sd s0, 64(a5)
22 # CHECK-INST: c.sd s0, 64(a5)
23 # CHECK: # encoding: [0xa0,0xe3]
27 # CHEACK-ALIAS: addiw tp, tp, 31
28 # CHECK-INST: c.addiw tp, 31
29 # CHECK: # encoding: [0x7d,0x22]
33 # CHEACK-ALIAS: subw s0, s0, a5
34 # CHECK-INST: c.subw s0, a5
35 # CHECK: # encoding: [0x1d,0x9c]
39 # CHECK-ALIAS: addw s0, s0, a5
40 # CHECK-INST: c.addw s0, a5
41 # CHECK: # encoding: [0x3d,0x9c]
45 # CHECK-ALIAS: addw s0, s0, a5
46 # CHECK-INST: c.addw s0, a5
47 # CHECK: # encoding: [0x3d,0x9c]
51 # CHECK-ALIAS: ld ra, 248(sp)
52 # CHECK-INST: c.ldsp ra, 248(sp)
53 # CHECK: # encoding: [0xee,0x70]
57 # CHECK-ALIAS: sd s0, 64(sp)
58 # CHECK-INST: c.sdsp s0, 64(sp)
59 # CHECK: # encoding: [0xa2,0xe0]