[RISCV] Fix InsnCI register type#100113
Merged
Conversation
Member
|
@llvm/pr-subscribers-backend-risc-v @llvm/pr-subscribers-mc Author: Sudharsan Veeravalli (svs-quic) ChangesAccording to the spec the CI type instructions can take any of the 32 RVI registers. Full diff: https://github.com/llvm/llvm-project/pull/100113.diff 2 Files Affected:
diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoC.td b/llvm/lib/Target/RISCV/RISCVInstrInfoC.td
index 9257ee5a09a8e..3f279b7a58ca6 100644
--- a/llvm/lib/Target/RISCV/RISCVInstrInfoC.td
+++ b/llvm/lib/Target/RISCV/RISCVInstrInfoC.td
@@ -764,9 +764,9 @@ def InsnCR : DirectiveInsnCR<(outs AnyReg:$rd), (ins uimm2_opcode:$opcode,
uimm4:$funct4,
AnyReg:$rs2),
"$opcode, $funct4, $rd, $rs2">;
-def InsnCI : DirectiveInsnCI<(outs AnyRegC:$rd), (ins uimm2_opcode:$opcode,
- uimm3:$funct3,
- simm6:$imm6),
+def InsnCI : DirectiveInsnCI<(outs AnyReg:$rd), (ins uimm2_opcode:$opcode,
+ uimm3:$funct3,
+ simm6:$imm6),
"$opcode, $funct3, $rd, $imm6">;
def InsnCIW : DirectiveInsnCIW<(outs AnyRegC:$rd), (ins uimm2_opcode:$opcode,
uimm3:$funct3,
@@ -818,7 +818,7 @@ def : InstAlias<".insn_cr $opcode, $funct4, $rd, $rs2",
(InsnCR AnyReg:$rd, uimm2_opcode:$opcode, uimm4:$funct4,
AnyReg:$rs2)>;
def : InstAlias<".insn_ci $opcode, $funct3, $rd, $imm6",
- (InsnCI AnyRegC:$rd, uimm2_opcode:$opcode, uimm3:$funct3,
+ (InsnCI AnyReg:$rd, uimm2_opcode:$opcode, uimm3:$funct3,
simm6:$imm6)>;
def : InstAlias<".insn_ciw $opcode, $funct3, $rd, $imm8",
(InsnCIW AnyRegC:$rd, uimm2_opcode:$opcode, uimm3:$funct3,
diff --git a/llvm/test/MC/RISCV/insn_c.s b/llvm/test/MC/RISCV/insn_c.s
index 19169e8b08c94..c63e8ab33aef9 100644
--- a/llvm/test/MC/RISCV/insn_c.s
+++ b/llvm/test/MC/RISCV/insn_c.s
@@ -31,6 +31,16 @@ target:
# CHECK-OBJ: c.addi a0, 0xd
.insn ci C1, 0, a0, 13
+# CHECK-ASM: .insn ci 1, 0, a6, 13
+# CHECK-ASM: encoding: [0x35,0x08]
+# CHECK-OBJ: c.addi a6, 0xd
+.insn ci 1, 0, a6, 13
+
+# CHECK-ASM: .insn ci 1, 0, a6, 13
+# CHECK-ASM: encoding: [0x35,0x08]
+# CHECK-OBJ: c.addi a6, 0xd
+.insn ci C1, 0, a6, 13
+
# CHECK-ASM: .insn ciw 0, 0, a0, 13
# CHECK-ASM: encoding: [0xa8,0x01]
# CHECK-OBJ: c.addi4spn a0, sp, 0xc8
|
lenary
approved these changes
Jul 23, 2024
Contributor
Author
|
Could someone please merge this? Thanks. |
Contributor
Author
|
Does this need to go into the 19.x release branch? |
Contributor
|
/cherry-pick 1ebfc81 |
llvmbot
pushed a commit
to llvmbot/llvm-project
that referenced
this pull request
Jul 24, 2024
According to the spec the CI type instructions can take any of the 32 RVI registers. Fixes llvm#100112 (cherry picked from commit 1ebfc81)
Member
|
/pull-request #100306 |
lenary
pushed a commit
to llvmbot/llvm-project
that referenced
this pull request
Jul 24, 2024
According to the spec the CI type instructions can take any of the 32 RVI registers. Fixes llvm#100112 (cherry picked from commit 1ebfc81)
tru
pushed a commit
to llvmbot/llvm-project
that referenced
this pull request
Jul 24, 2024
According to the spec the CI type instructions can take any of the 32 RVI registers. Fixes llvm#100112 (cherry picked from commit 1ebfc81)
yuxuanchen1997
pushed a commit
that referenced
this pull request
Jul 25, 2024
Summary: According to the spec the CI type instructions can take any of the 32 RVI registers. Fixes #100112 Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: https://phabricator.intern.facebook.com/D60251158
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
According to the spec the CI type instructions can take any of the 32 RVI registers.
Fixes #100112