141 lines · plain
1# RUN: llvm-mc %s -triple=riscv32 -mattr=+m,+zbb,+zba,+zcb -M no-aliases -show-encoding \2# RUN: | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s3# RUN: llvm-mc -filetype=obj -triple=riscv32 -mattr=+m,+zbb,+zba,+zcb < %s \4# RUN: | llvm-objdump --mattr=+m,+zbb,+zba,+zcb --no-print-imm-hex -M no-aliases -d -r - \5# RUN: | FileCheck --check-prefixes=CHECK-ASM-AND-OBJ %s6# RUN: llvm-mc %s -triple=riscv64 -mattr=+m,+zbb,+zba,+zcb -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=+m,+zbb,+zba,+zcb < %s \9# RUN: | llvm-objdump --mattr=+m,+zbb,+zba,zcb --no-print-imm-hex -M no-aliases -d -r - \10# RUN: | FileCheck --check-prefixes=CHECK-ASM-AND-OBJ %s11#12# RUN: not llvm-mc -triple riscv32 \13# RUN: -M no-aliases -show-encoding < %s 2>&1 \14# RUN: | FileCheck -check-prefixes=CHECK-NO-EXT %s15# RUN: not llvm-mc -triple riscv64 \16# RUN: -M no-aliases -show-encoding < %s 2>&1 \17# RUN: | FileCheck -check-prefixes=CHECK-NO-EXT %s18 19# CHECK-ASM-AND-OBJ: c.zext.b s020# CHECK-ASM: encoding: [0x61,0x9c]21# CHECK-NO-EXT: error: instruction requires the following: 'Zcb' (Compressed basic bit manipulation instructions){{$}}22c.zext.b s023 24# CHECK-ASM-AND-OBJ: c.sext.b s025# CHECK-ASM: encoding: [0x65,0x9c]26# CHECK-NO-EXT: error: instruction requires the following: 'Zbb' (Basic Bit-Manipulation), 'Zcb' (Compressed basic bit manipulation instructions){{$}}27c.sext.b s028 29# CHECK-ASM-AND-OBJ: c.zext.h s030# CHECK-ASM: encoding: [0x69,0x9c]31# CHECK-NO-EXT: error: instruction requires the following: 'Zbb' (Basic Bit-Manipulation), 'Zcb' (Compressed basic bit manipulation instructions){{$}}32c.zext.h s033 34# CHECK-ASM-AND-OBJ: c.sext.h s035# CHECK-ASM: encoding: [0x6d,0x9c]36# CHECK-NO-EXT: error: instruction requires the following: 'Zbb' (Basic Bit-Manipulation), 'Zcb' (Compressed basic bit manipulation instructions){{$}}37c.sext.h s038 39# CHECK-ASM-AND-OBJ: c.not s040# CHECK-ASM: encoding: [0x75,0x9c]41# CHECK-NO-EXT: error: instruction requires the following: 'Zcb' (Compressed basic bit manipulation instructions){{$}}42c.not s043 44# CHECK-ASM-AND-OBJ: c.mul s0, s145# CHECK-ASM: encoding: [0x45,0x9c]46# CHECK-NO-EXT: error: instruction requires the following: 'Zcb' (Compressed basic bit manipulation instructions), 'Zmmul' (Integer Multiplication)47c.mul s0, s148 49# CHECK-ASM-AND-OBJ: c.lbu a5, 2(a4)50# CHECK-ASM: encoding: [0x3c,0x83]51# CHECK-NO-EXT: error: instruction requires the following: 'Zcb' (Compressed basic bit manipulation instructions){{$}}52c.lbu a5, 2(a4)53 54# CHECK-ASM-AND-OBJ: c.lhu a5, 2(a4)55# CHECK-ASM: encoding: [0x3c,0x87]56# CHECK-NO-EXT: error: instruction requires the following: 'Zcb' (Compressed basic bit manipulation instructions){{$}}57c.lhu a5, 2(a4)58 59# CHECK-ASM-AND-OBJ: c.lh a5, 2(a4)60# CHECK-ASM: encoding: [0x7c,0x87]61# CHECK-NO-EXT: error: instruction requires the following: 'Zcb' (Compressed basic bit manipulation instructions){{$}}62c.lh a5, 2(a4)63 64# CHECK-ASM-AND-OBJ: c.sb a5, 2(a4)65# CHECK-ASM: encoding: [0x3c,0x8b]66# CHECK-NO-EXT: error: instruction requires the following: 'Zcb' (Compressed basic bit manipulation instructions){{$}}67c.sb a5, 2(a4)68 69# CHECK-ASM-AND-OBJ: c.sh a5, 2(a4)70# CHECK-ASM: encoding: [0x3c,0x8f]71# CHECK-NO-EXT: error: instruction requires the following: 'Zcb' (Compressed basic bit manipulation instructions){{$}}72c.sh a5, 2(a4)73 74# CHECK-ASM-AND-OBJ: c.mul s0, s175# CHECK-ASM: encoding: [0x45,0x9c]76mul s0, s1, s077 78# CHECK-ASM-AND-OBJ: c.mul s0, s179# CHECK-ASM: encoding: [0x45,0x9c]80mul s0, s0, s181 82# CHECK-ASM-AND-OBJ: c.sext.b s083# CHECK-ASM: encoding: [0x65,0x9c]84sext.b s0, s085 86# CHECK-ASM-AND-OBJ: c.sext.h s087# CHECK-ASM: encoding: [0x6d,0x9c]88sext.h s0, s089 90# CHECK-ASM-AND-OBJ: c.zext.h s091# CHECK-ASM: encoding: [0x69,0x9c]92zext.h s0, s093 94# CHECK-ASM-AND-OBJ: c.zext.b s095# CHECK-ASM: encoding: [0x61,0x9c]96andi s0, s0, 25597 98# CHECK-ASM-AND-OBJ: c.not s099# CHECK-ASM: encoding: [0x75,0x9c]100xori s0, s0, -1101 102# CHECK-ASM-AND-OBJ: c.lh a5, 2(a4)103# CHECK-ASM: encoding: [0x7c,0x87]104lh a5, 2(a4)105 106# CHECK-ASM-AND-OBJ: c.lbu a5, 2(a4)107# CHECK-ASM: encoding: [0x3c,0x83]108lbu a5, 2(a4)109 110# CHECK-ASM-AND-OBJ: c.lhu a5, 2(a4)111# CHECK-ASM: encoding: [0x3c,0x87]112lhu a5, 2(a4)113 114# CHECK-ASM-AND-OBJ: c.sb a5, 2(a4)115# CHECK-ASM: encoding: [0x3c,0x8b]116sb a5, 2(a4)117 118# CHECK-ASM-AND-OBJ: c.sh a5, 2(a4)119# CHECK-ASM: encoding: [0x3c,0x8f]120sh a5, 2(a4)121 122# CHECK-ASM-AND-OBJ: c.lbu s0, 0(s1)123# CHECK-ASM: encoding: [0x80,0x80]124c.lbu s0, (s1)125 126# CHECK-ASM-AND-OBJ: c.lhu s0, 0(s1)127# CHECK-ASM: encoding: [0x80,0x84]128c.lhu s0, (s1)129 130# CHECK-ASM-AND-OBJ: c.lh s0, 0(s1)131# CHECK-ASM: encoding: [0xc0,0x84]132c.lh s0, (s1)133 134# CHECK-ASM-AND-OBJ: c.sb s0, 0(s1)135# CHECK-ASM: encoding: [0x80,0x88]136c.sb s0, (s1)137 138# CHECK-ASM-AND-OBJ: c.sh s0, 0(s1)139# CHECK-ASM: encoding: [0x80,0x8c]140c.sh s0, (s1)141