150 lines · plain
1# Xqcibm - Qualcomm uC Bit Manipulation Extension2# Zbs is needed for checking compress instructions patterns for bexti/bseti3# RUN: llvm-mc %s -triple=riscv32 -mattr=+experimental-xqcibm,+zbs -M no-aliases -show-encoding \4# RUN: | FileCheck -check-prefixes=CHECK-ENC,CHECK-INST,CHECK-NOALIAS %s5# RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+experimental-xqcibm,+zbs < %s \6# RUN: | llvm-objdump --mattr=+experimental-xqcibm,+zbs -M no-aliases --no-print-imm-hex -d - \7# RUN: | FileCheck -check-prefix=CHECK-INST %s8# RUN: llvm-mc %s -triple=riscv32 -mattr=+experimental-xqcibm,+zbs -show-encoding \9# RUN: | FileCheck -check-prefixes=CHECK-ENC,CHECK-INST,CHECK-ALIAS %s10# RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+experimental-xqcibm,+zbs < %s \11# RUN: | llvm-objdump --mattr=+experimental-xqcibm,+zbs --no-print-imm-hex -d - \12# RUN: | FileCheck -check-prefix=CHECK-INST %s13 14# CHECK-INST: qc.compress2 t2, t015# CHECK-ENC: encoding: [0x8b,0xb3,0x02,0x00]16qc.compress2 x7, x517 18# CHECK-INST: qc.compress3 a0, s619# CHECK-ENC: encoding: [0x0b,0x35,0x0b,0x02]20qc.compress3 x10, x2221 22# CHECK-INST: qc.expand2 s7, s723# CHECK-ENC: encoding: [0x8b,0xbb,0x0b,0x04]24qc.expand2 x23, x2325 26# CHECK-INST: qc.expand3 sp, t127# CHECK-ENC: encoding: [0x0b,0x31,0x03,0x06]28qc.expand3 x2, x629 30# CHECK-INST: qc.clo s7, s831# CHECK-ENC: encoding: [0x8b,0x3b,0x0c,0x08]32qc.clo x23, x2433 34# CHECK-INST: qc.cto a2, a335# CHECK-ENC: encoding: [0x0b,0xb6,0x06,0x0a]36qc.cto x12, x1337 38# CHECK-INST: qc.brev32 s4, s839# CHECK-ENC: encoding: [0x0b,0x3a,0x0c,0x0c]40qc.brev32 x20, x2441 42# CHECK-INST: qc.insbri a0, s4, -102443# CHECK-ENC: encoding: [0x0b,0x05,0x0a,0xc0]44qc.insbri x10, x20, -102445 46# CHECK-INST: qc.insbi t1, -10, 32, 1547# CHECK-ENC: encoding: [0x0b,0x13,0xfb,0x3e]48qc.insbi x6, -10, 32, 1549 50# CHECK-INST: qc.insb a0, t2, 6, 3151# CHECK-ENC: encoding: [0x0b,0x95,0xf3,0x4b]52qc.insb x10, x7, 6, 3153 54# CHECK-INST: qc.insbh s4, a2, 8, 1255# CHECK-ENC: encoding: [0x0b,0x1a,0xc6,0x8e]56qc.insbh x20, x12, 8, 1257 58# CHECK-INST: qc.extu a5, a2, 20, 2059# CHECK-ENC: encoding: [0x8b,0x27,0x46,0x27]60qc.extu x15, x12, 20, 2061 62# CHECK-INST: qc.ext s11, t1, 31, 163# CHECK-ENC: encoding: [0x8b,0x2d,0x13,0x7c]64qc.ext x27, x6, 31, 165 66# CHECK-INST: qc.extdu ra, s0, 32, 867# CHECK-ENC: encoding: [0x8b,0x20,0x84,0xbe]68qc.extdu x1, x8, 32, 869 70# CHECK-INST: qc.extd a3, s5, 10, 1571# CHECK-ENC: encoding: [0x8b,0xa6,0xfa,0xd2]72qc.extd x13, x21, 10, 1573 74# CHECK-INST: qc.insbr a0, s3, t075# CHECK-ENC: encoding: [0x0b,0xb5,0x59,0x00]76qc.insbr x10, x19, x577 78# CHECK-INST: qc.insbhr a5, tp, t179# CHECK-ENC: encoding: [0x8b,0x37,0x62,0x02]80qc.insbhr x15, x4, x681 82# CHECK-INST: qc.insbpr s5, s0, s183# CHECK-ENC: encoding: [0x8b,0x3a,0x94,0x04]84qc.insbpr x21, x8, x985 86# CHECK-INST: qc.insbprh sp, gp, a187# CHECK-ENC: encoding: [0x0b,0xb1,0xb1,0x06]88qc.insbprh x2, x3, x1189 90# CHECK-INST: qc.extdur s1, s3, t491# CHECK-ENC: encoding: [0x8b,0xb4,0xd9,0x09]92qc.extdur x9, x19, x2993 94# CHECK-INST: qc.extdr a2, t4, t595# CHECK-ENC: encoding: [0x0b,0xb6,0xee,0x0b]96qc.extdr x12, x29, x3097 98# CHECK-INST: qc.extdupr a3, s7, gp99# CHECK-ENC: encoding: [0x8b,0xb6,0x3b,0x0c]100qc.extdupr x13, x23, x3101 102# CHECK-INST: qc.extduprh s2, s0, s1103# CHECK-ENC: encoding: [0x0b,0x39,0x94,0x0e]104qc.extduprh x18, x8, x9105 106# CHECK-INST: qc.extdpr ra, tp, a5107# CHECK-ENC: encoding: [0x8b,0x30,0xf2,0x10]108qc.extdpr x1, x4, x15109 110# CHECK-INST: qc.extdprh t1, s8, s9111# CHECK-ENC: encoding: [0x0b,0x33,0x9c,0x13]112qc.extdprh x6, x24, x25113 114# CHECK-NOALIAS: qc.c.bexti s1, 8115# CHECK-ALIAS: bexti s1, s1, 8116# CHECK-ENC: encoding: [0xa1,0x90]117qc.c.bexti x9, 8118 119# CHECK-NOALIAS: qc.c.bseti a2, 16120# CHECK-ALIAS: bseti a2, a2, 16121# CHECK-ENC: encoding: [0x41,0x96]122qc.c.bseti x12, 16123 124# CHECK-NOALIAS: qc.c.extu a5, 32125# CHECK-ALIAS: qc.extu a5, a5, 32, 0126# CHECK-ENC: encoding: [0xfe,0x17]127qc.c.extu x15, 32128 129# Check that compress patterns work as expected130 131# CHECK-NOALIAS: qc.c.extu a1, 11132# CHECK-ALIAS: qc.extu a1, a1, 11, 0133# CHECK-ENC: encoding: [0xaa,0x15]134qc.extu x11, x11, 11, 0135 136# CHECK-NOALIAS: qc.c.bexti a1, 5137# CHECK-ALIAS: bexti a1, a1, 5138# CHECK-ENC: encoding: [0x95,0x91]139qc.extu x11, x11, 1, 5140 141# CHECK-NOALIAS: qc.c.bexti s1, 8142# CHECK-ALIAS: bexti s1, s1, 8143# CHECK-ENC-ZBS: encoding: [0xa1,0x90]144bexti x9, x9, 8145 146# CHECK-NOALIAS: qc.c.bseti a2, 16147# CHECK-ALIAS: bseti a2, a2, 16148# CHECK-ENC: encoding: [0x41,0x96]149bseti x12, x12, 16150