Skip to content

Commit 82d93ad

Browse files
imkivaKaiYG
authored andcommitted
[RISCV] Fix rlist grammar for cm.push, cm.popret, cm.popretz and cm.pop in RISCV zcmp Extension
The register list in the arg string is declared as `{$rlist}`. This patch removes the wrapping curly brackets because of the following: - Curly brackets are the syntax for variant selection, e.g. given `X = {v0 | v1}`, the result after `CodeGenInstruction::FlattenAsmStringVariants` should be `X[AsmVariantNo]`. - ARM also supports the register list, and they do not use the bracket wrapper. - Parse of curly brackets are handled by `RISCVAsmParser::parseReglist`, the brackets in the td file do not correspond to asm syntax. Thus no testcase is affected. So the curly brackets here are redundant and will become dangerous if RISCV needs more asm parser variants (took me several hours to figure out some wired assertion failures in a downstream fork) Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D157472
1 parent 98ae6e5 commit 82d93ad

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Target/RISCV/RISCVInstrInfoZc.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ class RVZcArith_r<bits<5> funct5, string OpcodeStr> :
131131

132132
class RVInstZcCPPP<bits<5> funct5, string opcodestr>
133133
: RVInst16<(outs), (ins rlist:$rlist, spimm:$spimm),
134-
opcodestr, "{$rlist}, $spimm", [], InstFormatOther> {
134+
opcodestr, "$rlist, $spimm", [], InstFormatOther> {
135135
bits<4> rlist;
136136
bits<16> spimm;
137137

0 commit comments

Comments
 (0)