[PATCH] D63669: [RISCV] Allow parsing dot '.' in assembly
John LLVM via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 10 13:41:10 PDT 2019
JohnLLVM updated this revision to Diff 209057.
JohnLLVM added a comment.
Feedback from @jrtc27.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D63669/new/
https://reviews.llvm.org/D63669
Files:
llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
llvm/test/MC/RISCV/rv32i-aliases-invalid.s
llvm/test/MC/RISCV/rv32i-valid.s
llvm/test/MC/RISCV/rvi-aliases-valid.s
Index: llvm/test/MC/RISCV/rvi-aliases-valid.s
===================================================================
--- llvm/test/MC/RISCV/rvi-aliases-valid.s
+++ llvm/test/MC/RISCV/rvi-aliases-valid.s
@@ -117,6 +117,13 @@
# CHECK-OBJ: j 0
# CHECK-OBJ: R_RISCV_JAL a0
j a0
+# CHECK-S-NOALIAS: [[LABEL:.L[[:alnum:]_]+]]:
+# CHECK-S-NOALIAS-NEXT: jal zero, [[LABEL]]
+# CHECK-S: [[LABEL:.L[[:alnum:]_]+]]:
+# CHECK-S-NEXT: j [[LABEL]]
+# CHECK-OBJ-NOALIAS: jal zero, 0
+# CHECK-OBJ: j 0
+j .
# CHECK-S-OBJ-NOALIAS: jal ra, 2040
# CHECK-S-OBJ: jal 2040
jal 2040
Index: llvm/test/MC/RISCV/rv32i-valid.s
===================================================================
--- llvm/test/MC/RISCV/rv32i-valid.s
+++ llvm/test/MC/RISCV/rv32i-valid.s
@@ -90,6 +90,9 @@
# CHECK-ASM-AND-OBJ: jal s0, 156
# CHECK-ASM: encoding: [0x6f,0x04,0xc0,0x09]
jal s0, (0xff-99)
+# CHECK-ASM: encoding: [0x6f,0bAAAA0000,A,A]
+# CHECK-OBJ: jal zero, 0
+jal zero, .
# CHECK-ASM-AND-OBJ: jalr a0, a1, -2048
# CHECK-ASM: encoding: [0x67,0x85,0x05,0x80]
Index: llvm/test/MC/RISCV/rv32i-aliases-invalid.s
===================================================================
--- llvm/test/MC/RISCV/rv32i-aliases-invalid.s
+++ llvm/test/MC/RISCV/rv32i-aliases-invalid.s
@@ -19,5 +19,7 @@
srl x2, x3, -2 # CHECK: :[[@LINE]]:13: error: immediate must be an integer in the range [0, 31]
sra x2, x3, -3 # CHECK: :[[@LINE]]:13: error: immediate must be an integer in the range [0, 31]
+addi x1, . # CHECK: :[[@LINE]]:10: error: invalid operand for instruction
+
foo:
.space 4
Index: llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
===================================================================
--- llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
+++ llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
@@ -1119,6 +1119,7 @@
default:
return MatchOperand_NoMatch;
case AsmToken::LParen:
+ case AsmToken::Dot:
case AsmToken::Minus:
case AsmToken::Plus:
case AsmToken::Exclaim:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63669.209057.patch
Type: text/x-patch
Size: 1993 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190710/6d831d90/attachment.bin>
More information about the llvm-commits
mailing list