61 lines · plain
1# RUN: llvm-mc -triple riscv64 -mattr=+c -show-encoding < %s \2# RUN: | FileCheck -check-prefixes=CHECK-ALIAS %s3# RUN: llvm-mc -triple riscv64 -mattr=+c -show-encoding \4# RUN: -M no-aliases < %s | FileCheck -check-prefixes=CHECK-INST %s5# RUN: llvm-mc -triple riscv64 -mattr=+c -filetype=obj < %s \6# RUN: | llvm-objdump --triple=riscv64 --mattr=+c --no-print-imm-hex -d - \7# RUN: | FileCheck -check-prefixes=CHECK-BYTES,CHECK-ALIAS %s8# RUN: llvm-mc -triple riscv64 -mattr=+c -filetype=obj < %s \9# RUN: | llvm-objdump --triple=riscv64 --mattr=+c --no-print-imm-hex -d -M no-aliases - \10# RUN: | FileCheck -check-prefixes=CHECK-BYTES,CHECK-INST %s11 12# Tests compressed instructions available in rv64 and not in rv32.13 14# CHECK-BYTES: 7fe015# CHECK-ALIAS: ld s0, 248(a5)16# CHECK-INST: c.ld s0, 248(a5)17# CHECK: # encoding: [0xe0,0x7f]18ld s0, 248(a5)19 20# CHECK-BYTES: e3a021# CHECK-ALIAS: sd s0, 64(a5)22# CHECK-INST: c.sd s0, 64(a5)23# CHECK: # encoding: [0xa0,0xe3]24sd s0, 64(a5)25 26# CHECK-BYTES: 227d27# CHEACK-ALIAS: addiw tp, tp, 3128# CHECK-INST: c.addiw tp, 3129# CHECK: # encoding: [0x7d,0x22]30addiw tp, tp, 3131 32# CHECK-BYTES: 9c1d33# CHEACK-ALIAS: subw s0, s0, a534# CHECK-INST: c.subw s0, a535# CHECK: # encoding: [0x1d,0x9c]36subw s0, s0, a537 38# CHECK-BYTES: 9c3d39# CHECK-ALIAS: addw s0, s0, a540# CHECK-INST: c.addw s0, a541# CHECK: # encoding: [0x3d,0x9c]42addw s0, s0, a543 44# CHECK-BYTES: 9c3d45# CHECK-ALIAS: addw s0, s0, a546# CHECK-INST: c.addw s0, a547# CHECK: # encoding: [0x3d,0x9c]48addw s0, a5, s049 50# CHECK-BYTES: 70ee51# CHECK-ALIAS: ld ra, 248(sp)52# CHECK-INST: c.ldsp ra, 248(sp)53# CHECK: # encoding: [0xee,0x70]54ld ra, 248(sp)55 56# CHECK-BYTES: e0a257# CHECK-ALIAS: sd s0, 64(sp)58# CHECK-INST: c.sdsp s0, 64(sp)59# CHECK: # encoding: [0xa2,0xe0]60sd s0, 64(sp)61