[llvm] [RISCV] Renaming muladdi to muliadd as per v0.5 spec. NFC (PR #124237)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 23 23:15:16 PST 2025
https://github.com/hchandel created https://github.com/llvm/llvm-project/pull/124237
muliadd is more relevant to the operation performed, i.e. multiply by immediate.
The latest spec can be found at:
https://github.com/quic/riscv-unified-db/releases/latest
>From e83637504f6ddf5b21ca5e7351c7b83236f360b5 Mon Sep 17 00:00:00 2001
From: Harsh Chandel <hchandel at qti.qualcomm.com>
Date: Fri, 24 Jan 2025 12:38:13 +0530
Subject: [PATCH] [RISCV] Renaming muladdi to muliadd as per v0.5 spec. NFC
muliadd is more relevant to the operation performed,
i.e. multiply by immediate.
The latest spec can be found at:
https://github.com/quic/riscv-unified-db/releases/latest
Change-Id: I0cb141c72da003f56ce54fe3235684a7e92b403f
---
llvm/lib/Target/RISCV/RISCVInstrInfoXqci.td | 8 +++----
llvm/test/MC/RISCV/xqciac-invalid.s | 16 +++++++-------
llvm/test/MC/RISCV/xqciac-valid.s | 24 ++++++++++-----------
3 files changed, 24 insertions(+), 24 deletions(-)
diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoXqci.td b/llvm/lib/Target/RISCV/RISCVInstrInfoXqci.td
index f746cce8c9a0f1..1f042b0f47e968 100644
--- a/llvm/lib/Target/RISCV/RISCVInstrInfoXqci.td
+++ b/llvm/lib/Target/RISCV/RISCVInstrInfoXqci.td
@@ -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;
@@ -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";
}
diff --git a/llvm/test/MC/RISCV/xqciac-invalid.s b/llvm/test/MC/RISCV/xqciac-invalid.s
index 4e0182aff9cc2c..c595888ddee3e8 100644
--- a/llvm/test/MC/RISCV/xqciac-invalid.s
+++ b/llvm/test/MC/RISCV/xqciac-invalid.s
@@ -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
diff --git a/llvm/test/MC/RISCV/xqciac-valid.s b/llvm/test/MC/RISCV/xqciac-valid.s
index 6e97d8cc447e14..c786d7c4ea51db 100644
--- a/llvm/test/MC/RISCV/xqciac-valid.s
+++ b/llvm/test/MC/RISCV/xqciac-valid.s
@@ -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
More information about the llvm-commits
mailing list