Skip to content

Commit 2bd1ff1

Browse files
committed
fixup! Address comments and failures
Change-Id: I9d9e9aa1c18b995c10b835accb49ef6466fc72eb
1 parent 9860e14 commit 2bd1ff1

File tree

3 files changed

+34
-4
lines changed

3 files changed

+34
-4
lines changed

llvm/lib/Target/RISCV/RISCVInstrInfoXqci.td

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -753,12 +753,12 @@ def QC_C_MILEAVERET : QCIRVInst16CI_NONE<0b10100, "qc.c.mileaveret">;
753753
let Predicates = [HasVendorXqciio, IsRV32] in {
754754
let hasSideEffects = 1, mayLoad = 0, mayStore = 0 in {
755755
def QC_OUTW : RVInstI<0b100, OPC_CUSTOM_0, (outs),
756-
(ins GPR:$rs3, GPR:$rs1, uimm14lsb00:$imm14),
757-
"qc.outw", "$rs3, ${imm14}(${rs1})"> {
758-
bits<5> rs3;
756+
(ins GPR:$rs2, GPR:$rs1, uimm14lsb00:$imm14),
757+
"qc.outw", "$rs2, ${imm14}(${rs1})"> {
758+
bits<5> rs2;
759759
bits<14> imm14;
760760

761-
let rd = rs3;
761+
let rd = rs2;
762762
let imm12 = imm14{13-2};
763763
}
764764

@@ -889,6 +889,15 @@ let mayLoad = 0, mayStore = 0, hasSideEffects = 1 in {
889889
// Aliases
890890
//===----------------------------------------------------------------------===//
891891

892+
let Predicates = [HasVendorXqciio, IsRV32] in {
893+
let EmitPriority = 0 in {
894+
def : InstAlias<"qc.outw $rs2, (${rs1})",
895+
(QC_OUTW GPR:$rs2, GPR:$rs1, 0)>;
896+
def : InstAlias<"qc.inw $rd, (${rs1})",
897+
(QC_INW GPRNoX0:$rd, GPR:$rs1, 0)>;
898+
} // EmitPriority = 0
899+
} // Predicates = [HasVendorXqciio, IsRV32]
900+
892901
let Predicates = [HasVendorXqcilsm, IsRV32] in {
893902
let EmitPriority = 0 in {
894903
def : InstAlias<"qc.swm $rs3, $rs2, (${rs1})",

llvm/test/CodeGen/RISCV/features-info.ll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
; CHECK-NEXT: experimental-xqcics - 'Xqcics' (Qualcomm uC Conditional Select Extension).
3333
; CHECK-NEXT: experimental-xqcicsr - 'Xqcicsr' (Qualcomm uC CSR Extension).
3434
; CHECK-NEXT: experimental-xqciint - 'Xqciint' (Qualcomm uC Interrupts Extension).
35+
; CHECK-NEXT: experimental-xqciio - 'Xqciio' (Qualcomm uC External Input Output Extension).
3536
; CHECK-NEXT: experimental-xqcilb - 'Xqcilb' (Qualcomm uC Long Branch Extension).
3637
; CHECK-NEXT: experimental-xqcili - 'Xqcili' (Qualcomm uC Load Large Immediate Extension).
3738
; CHECK-NEXT: experimental-xqcilia - 'Xqcilia' (Qualcomm uC Large Immediate Arithmetic Extension).
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Xqciio - Qualcomm uC External Input Output extension
2+
# RUN: llvm-mc %s -triple=riscv32 -mattr=+experimental-xqciio -riscv-no-aliases -show-encoding \
3+
# RUN: | FileCheck -check-prefixes=CHECK-ENC,CHECK-INST %s
4+
# RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+experimental-xqciio < %s \
5+
# RUN: | llvm-objdump --mattr=+experimental-xqciio -M no-aliases --no-print-imm-hex -d - \
6+
# RUN: | FileCheck -check-prefix=CHECK-INST %s
7+
# RUN: llvm-mc %s -triple=riscv32 -mattr=+experimental-xqciio -show-encoding \
8+
# RUN: | FileCheck -check-prefixes=CHECK-ENC,CHECK-INST %s
9+
# RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+experimental-xqciio < %s \
10+
# RUN: | llvm-objdump --mattr=+experimental-xqciio --no-print-imm-hex -d - \
11+
# RUN: | FileCheck -check-prefix=CHECK-INST %s
12+
13+
# CHECK-INST: qc.outw t0, 0(a0)
14+
# CHECK-ENC: encoding: [0x8b,0x42,0x05,0x00]
15+
qc.outw x5, (x10)
16+
17+
18+
# CHECK-INST: qc.inw t0, 0(a0)
19+
# CHECK-ENC: encoding: [0x8b,0x52,0x05,0x00]
20+
qc.inw x5, (x10)

0 commit comments

Comments
 (0)