brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.4 KiB · 9f53c6a Raw
75 lines · plain
1# RUN: llvm-mc %s -triple=riscv64 -mattr=+c -M no-aliases -show-encoding \2# RUN:     | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s3# RUN: llvm-mc -filetype=obj -triple=riscv64 -mattr=+c < %s \4# RUN:     | llvm-objdump --mattr=+c --no-print-imm-hex -M no-aliases -d -r - \5# RUN:     | FileCheck --check-prefix=CHECK-ASM-AND-OBJ %s6# RUN: llvm-mc %s -triple=riscv64 -mattr=+zca -M no-aliases -show-encoding \7# RUN:     | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s8# RUN: llvm-mc -filetype=obj -triple=riscv64 -mattr=+c < %s \9# RUN:     | llvm-objdump --mattr=+c --no-print-imm-hex -M no-aliases -d -r - \10# RUN:     | FileCheck --check-prefix=CHECK-ASM-AND-OBJ %s11#12#13# RUN: not llvm-mc -triple riscv64 \14# RUN:     -M no-aliases -show-encoding < %s 2>&1 \15# RUN:     | FileCheck -check-prefixes=CHECK-NO-EXT %s16# RUN: not llvm-mc -triple riscv32 -mattr=+c \17# RUN:     -M no-aliases -show-encoding < %s 2>&1 \18# RUN:     | FileCheck -check-prefixes=CHECK-NO-RV64 %s19 20# TODO: more exhaustive testing of immediate encoding.21 22# CHECK-ASM-AND-OBJ: c.ldsp s0, 0(sp)23# CHECK-ASM: encoding: [0x02,0x64]24# CHECK-NO-EXT:  error: instruction requires the following: 'C' (Compressed Instructions) or 'Zca' (part of the C extension, excluding compressed floating point loads/stores){{$}}25# CHECK-NO-RV64:  error: instruction requires the following: 'Zclsd' (Compressed Load/Store pair instructions){{$}}26c.ldsp s0, 0(sp)27# CHECK-ASM-AND-OBJ: c.sdsp s2, 504(sp)28# CHECK-ASM: encoding: [0xca,0xff]29# CHECK-NO-EXT:  error: instruction requires the following: 'C' (Compressed Instructions) or 'Zca' (part of the C extension, excluding compressed floating point loads/stores){{$}}30# CHECK-NO-RV64:  error: instruction requires the following: 'Zclsd' (Compressed Load/Store pair instructions){{$}}31c.sdsp s2, 504(sp)32# CHECK-ASM-AND-OBJ: c.ld a4, 0(a3)33# CHECK-ASM: encoding: [0x98,0x62]34# CHECK-NO-EXT:  error: instruction requires the following: 'C' (Compressed Instructions) or 'Zca' (part of the C extension, excluding compressed floating point loads/stores){{$}}35# CHECK-NO-RV64:  error: instruction requires the following: 'Zclsd' (Compressed Load/Store pair instructions){{$}}36c.ld a4, 0(a3)37# CHECK-ASM-AND-OBJ: c.sd a2, 248(a3)38# CHECK-ASM: encoding: [0xf0,0xfe]39# CHECK-NO-EXT:  error: instruction requires the following: 'C' (Compressed Instructions) or 'Zca' (part of the C extension, excluding compressed floating point loads/stores){{$}}40# CHECK-NO-RV64:  error: instruction requires the following: 'Zclsd' (Compressed Load/Store pair instructions){{$}}41c.sd a2, 248(a3)42 43# CHECK-ASM-AND-OBJ: c.subw a3, a444# CHECK-ASM: encoding: [0x99,0x9e]45c.subw a3, a446# CHECK-ASM-AND-OBJ: c.addw a0, a247# CHECK-ASM: encoding: [0x31,0x9d]48# CHECK-NO-EXT:  error: instruction requires the following: 'C' (Compressed Instructions) or 'Zca' (part of the C extension, excluding compressed floating point loads/stores){{$}}49# CHECK-NO-RV64:  error: instruction requires the following: RV64I Base Instruction Set{{$}}50c.addw a0, a251 52# CHECK-ASM-AND-OBJ: c.addiw a3, -3253# CHECK-ASM: encoding: [0x81,0x36]54# CHECK-NO-EXT:  error: instruction requires the following: 'C' (Compressed Instructions) or 'Zca' (part of the C extension, excluding compressed floating point loads/stores){{$}}55# CHECK-NO-RV64:  error: instruction requires the following: RV64I Base Instruction Set{{$}}56c.addiw a3, -3257# CHECK-ASM-AND-OBJ: c.addiw a3, 3158# CHECK-ASM: encoding: [0xfd,0x26]59# CHECK-NO-EXT:  error: instruction requires the following: 'C' (Compressed Instructions) or 'Zca' (part of the C extension, excluding compressed floating point loads/stores){{$}}60# CHECK-NO-RV64:  error: instruction requires the following: RV64I Base Instruction Set{{$}}61c.addiw a3, 3162 63# CHECK-ASM-AND-OBJ: c.slli s0, 6364# CHECK-ASM: encoding: [0x7e,0x14]65# CHECK-NO-EXT:  error: instruction requires the following: 'C' (Compressed Instructions) or 'Zca' (part of the C extension, excluding compressed floating point loads/stores){{$}}66c.slli s0, 6367# CHECK-ASM-AND-OBJ: c.srli a3, 6368# CHECK-ASM: encoding: [0xfd,0x92]69# CHECK-NO-EXT:  error: instruction requires the following: 'C' (Compressed Instructions) or 'Zca' (part of the C extension, excluding compressed floating point loads/stores){{$}}70c.srli a3, 6371# CHECK-ASM-AND-OBJ: c.srai a2, 6372# CHECK-ASM: encoding: [0x7d,0x96]73# CHECK-NO-EXT:  error: instruction requires the following: 'C' (Compressed Instructions) or 'Zca' (part of the C extension, excluding compressed floating point loads/stores){{$}}74c.srai a2, 6375