Skip to content

[RISCV] Renaming muladdi to muliadd as per v0.5 spec. #124237

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clang/test/Driver/print-supported-extensions-riscv.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
// CHECK-NEXT: ssctr 1.0 'Ssctr' (Control Transfer Records Supervisor Level)
// CHECK-NEXT: svukte 0.3 'Svukte' (Address-Independent Latency of User-Mode Faults to Supervisor Addresses)
// CHECK-NEXT: xqcia 0.2 'Xqcia' (Qualcomm uC Arithmetic Extension)
// CHECK-NEXT: xqciac 0.2 'Xqciac' (Qualcomm uC Load-Store Address Calculation Extension)
// CHECK-NEXT: xqciac 0.3 'Xqciac' (Qualcomm uC Load-Store Address Calculation Extension)
// CHECK-NEXT: xqcicli 0.2 'Xqcicli' (Qualcomm uC Conditional Load Immediate Extension)
// CHECK-NEXT: xqcicm 0.2 'Xqcicm' (Qualcomm uC Conditional Move Extension)
// CHECK-NEXT: xqcics 0.2 'Xqcics' (Qualcomm uC Conditional Select Extension)
Expand Down
2 changes: 1 addition & 1 deletion llvm/docs/RISCVUsage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ The current vendor extensions supported are:
LLVM implements `version 0.2 of the Qualcomm uC Arithmetic extension specification <https://github.com/quic/riscv-unified-db/releases/latest>`__ by Qualcomm. All instructions are prefixed with `qc.` as described in the specification. These instructions are only available for riscv32.

``experimental-Xqciac``
LLVM implements `version 0.2 of the Qualcomm uC Load-Store Address Calculation extension specification <https://github.com/quic/riscv-unified-db/releases/latest>`__ by Qualcomm. All instructions are prefixed with `qc.` as described in the specification. These instructions are only available for riscv32.
LLVM implements `version 0.3 of the Qualcomm uC Load-Store Address Calculation extension specification <https://github.com/quic/riscv-unified-db/releases/latest>`__ by Qualcomm. All instructions are prefixed with `qc.` as described in the specification. These instructions are only available for riscv32.

``experimental-Xqcicli``
LLVM implements `version 0.2 of the Qualcomm uC Conditional Load Immediate extension specification <https://github.com/quic/riscv-unified-db/releases/latest>`__ by Qualcomm. All instructions are prefixed with `qc.` as described in the specification. These instructions are only available for riscv32.
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/RISCV/RISCVFeatures.td
Original file line number Diff line number Diff line change
Expand Up @@ -1279,7 +1279,7 @@ def HasVendorXqcilsm
"'Xqcilsm' (Qualcomm uC Load Store Multiple Extension)">;

def FeatureVendorXqciac
: RISCVExperimentalExtension<0, 2, "Qualcomm uC Load-Store Address Calculation Extension",
: RISCVExperimentalExtension<0, 3, "Qualcomm uC Load-Store Address Calculation Extension",
[FeatureStdExtZca]>;
def HasVendorXqciac
: Predicate<"Subtarget->hasVendorXqciac()">,
Expand Down
8 changes: 4 additions & 4 deletions llvm/lib/Target/RISCV/RISCVInstrInfoXqci.td
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,9 @@ let hasSideEffects = 0, mayLoad = 0, mayStore = 0 in {

let Predicates = [HasVendorXqciac, IsRV32], DecoderNamespace = "Xqciac" in {
let hasSideEffects = 0, mayLoad = 0, mayStore = 0 in {
def QC_C_MULADDI : RVInst16CL<0b001, 0b10, (outs GPRC:$rd_wb),
def QC_C_MULIADD : RVInst16CL<0b001, 0b10, (outs GPRC:$rd_wb),
(ins GPRC:$rd, GPRC:$rs1, uimm5:$uimm),
"qc.c.muladdi", "$rd, $rs1, $uimm"> {
"qc.c.muliadd", "$rd, $rs1, $uimm"> {
let Constraints = "$rd = $rd_wb";
bits<5> uimm;

Expand All @@ -310,9 +310,9 @@ let hasSideEffects = 0, mayLoad = 0, mayStore = 0 in {
let Inst{5} = uimm{4};
}

def QC_MULADDI : RVInstI<0b110, OPC_CUSTOM_0, (outs GPRNoX0:$rd_wb),
def QC_MULIADD : RVInstI<0b110, OPC_CUSTOM_0, (outs GPRNoX0:$rd_wb),
(ins GPRNoX0:$rd, GPRNoX0:$rs1, simm12:$imm12),
"qc.muladdi", "$rd, $rs1, $imm12"> {
"qc.muliadd", "$rd, $rs1, $imm12"> {
let Constraints = "$rd = $rd_wb";
}

Expand Down
2 changes: 1 addition & 1 deletion llvm/test/CodeGen/RISCV/attributes.ll
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@
; RV32XTHEADSYNC: .attribute 5, "rv32i2p1_xtheadsync1p0"
; RV32XWCHC: .attribute 5, "rv32i2p1_xwchc2p2"
; RV32XQCIA: .attribute 5, "rv32i2p1_xqcia0p2"
; RV32XQCIAC: .attribute 5, "rv32i2p1_zca1p0_xqciac0p2"
; RV32XQCIAC: .attribute 5, "rv32i2p1_zca1p0_xqciac0p3"
; RV32XQCICLI: .attribute 5, "rv32i2p1_xqcicli0p2"
; RV32XQCICM: .attribute 5, "rv32i2p1_zca1p0_xqcicm0p2"
; RV32XQCICS: .attribute 5, "rv32i2p1_xqcics0p2"
Expand Down
16 changes: 8 additions & 8 deletions llvm/test/MC/RISCV/xqciac-invalid.s
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,29 @@
# RUN: | FileCheck -check-prefixes=CHECK,CHECK-EXT %s

# CHECK: :[[@LINE+1]]:14: error: invalid operand for instruction
qc.c.muladdi x5, x10, 4
qc.c.muliadd x5, x10, 4

# CHECK: :[[@LINE+1]]:1: error: too few operands for instruction
qc.c.muladdi x15
qc.c.muliadd x15

# CHECK-IMM: :[[@LINE+1]]:24: error: immediate must be an integer in the range [0, 31]
qc.c.muladdi x10, x15, 32
qc.c.muliadd x10, x15, 32

# CHECK-EXT: :[[@LINE+1]]:1: error: instruction requires the following: 'Xqciac' (Qualcomm uC Load-Store Address Calculation Extension)
qc.c.muladdi x10, x15, 20
qc.c.muliadd x10, x15, 20


# CHECK: :[[@LINE+1]]:12: error: invalid operand for instruction
qc.muladdi x0, x10, 1048577
qc.muliadd x0, x10, 1048577

# CHECK: :[[@LINE+1]]:1: error: too few operands for instruction
qc.muladdi x10
qc.muliadd x10

# CHECK-IMM: :[[@LINE+1]]:22: error: operand must be a symbol with %lo/%pcrel_lo/%tprel_lo modifier or an integer in the range [-2048, 2047]
qc.muladdi x10, x15, 8589934592
qc.muliadd x10, x15, 8589934592

# CHECK-EXT: :[[@LINE+1]]:1: error: instruction requires the following: 'Xqciac' (Qualcomm uC Load-Store Address Calculation Extension)
qc.muladdi x10, x15, 577
qc.muliadd x10, x15, 577


# CHECK: :[[@LINE+1]]:11: error: invalid operand for instruction
Expand Down
24 changes: 12 additions & 12 deletions llvm/test/MC/RISCV/xqciac-valid.s
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,30 @@
# RUN: | llvm-objdump --mattr=+experimental-xqciac --no-print-imm-hex -d - \
# RUN: | FileCheck -check-prefix=CHECK-INST %s

# CHECK-INST: qc.c.muladdi a0, a1, 0
# CHECK-INST: qc.c.muliadd a0, a1, 0
# CHECK-ENC: encoding: [0x8a,0x21]
qc.c.muladdi x10, x11, 0
qc.c.muliadd x10, x11, 0

# CHECK-INST: qc.c.muladdi a0, a1, 31
# CHECK-INST: qc.c.muliadd a0, a1, 31
# CHECK-ENC: encoding: [0xea,0x3d]
qc.c.muladdi x10, x11, 31
qc.c.muliadd x10, x11, 31

# CHECK-INST: qc.c.muladdi a0, a1, 16
# CHECK-INST: qc.c.muliadd a0, a1, 16
# CHECK-ENC: encoding: [0xaa,0x21]
qc.c.muladdi x10, x11, 16
qc.c.muliadd x10, x11, 16


# CHECK-INST: qc.muladdi tp, t0, 1234
# CHECK-INST: qc.muliadd tp, t0, 1234
# CHECK-ENC: encoding: [0x0b,0xe2,0x22,0x4d]
qc.muladdi x4, x5, 1234
qc.muliadd x4, x5, 1234

# CHECK-INST: qc.muladdi a0, a1, -2048
# CHECK-INST: qc.muliadd a0, a1, -2048
# CHECK-ENC: encoding: [0x0b,0xe5,0x05,0x80]
qc.muladdi x10, x11, -2048
qc.muliadd x10, x11, -2048

# CHECK-INST: qc.muladdi a0, a1, 2047
# CHECK-INST: qc.muliadd a0, a1, 2047
# CHECK-ENC: encoding: [0x0b,0xe5,0xf5,0x7f]
qc.muladdi x10, x11, 2047
qc.muliadd x10, x11, 2047


# CHECK-INST: qc.shladd tp, t0, t1, 12
Expand Down
4 changes: 2 additions & 2 deletions llvm/unittests/TargetParser/RISCVISAInfoTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ TEST(ParseArchString, RejectsConflictingExtensions) {
}

for (StringRef Input :
{"rv64i_xqcisls0p2", "rv64i_xqcia0p2", "rv64i_xqciac0p2",
{"rv64i_xqcisls0p2", "rv64i_xqcia0p2", "rv64i_xqciac0p3",
"rv64i_xqcicsr0p2", "rv64i_xqcilsm0p2", "rv64i_xqcicm0p2",
"rv64i_xqcics0p2", "rv64i_xqcicli0p2", "rv64i_xqciint0p2",
"rv64i_xqcilo0p2"}) {
Expand Down Expand Up @@ -1117,7 +1117,7 @@ Experimental extensions
ssctr 1.0
svukte 0.3
xqcia 0.2
xqciac 0.2
xqciac 0.3
xqcicli 0.2
xqcicm 0.2
xqcics 0.2
Expand Down
Loading