[PATCH] D57529: Add .dword direcrive support for aarch64 mc
Khem Raj via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 31 11:05:32 PST 2019
raj.khem created this revision.
raj.khem added a reviewer: rengolin.
Herald added subscribers: llvm-commits, hiraditya, kristof.beyls, javed.absar.
.dword is used in many packages in linux world. The last I run into is klibc.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D57529
Files:
llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
llvm/test/MC/AArch64/data-directives-invalid.s
Index: llvm/test/MC/AArch64/data-directives-invalid.s
===================================================================
--- /dev/null
+++ llvm/test/MC/AArch64/data-directives-invalid.s
@@ -0,0 +1,16 @@
+# RUN: not llvm-mc -triple aarch64 < %s 2>&1 | FileCheck %s
+
+# CHECK: [[@LINE+1]]:8: error: out of range literal value in '.hword' directive
+.hword 0xffffa
+# CHECK: [[@LINE+1]]:8: error: out of range literal value in '.2byte' directive
+.2byte 0xffffa
+# CHECK: [[@LINE+1]]:7: error: out of range literal value in '.word' directive
+.word 0xffffffffa
+# CHECK: [[@LINE+1]]:8: error: out of range literal value in '.4byte' directive
+.4byte 0xffffffffa
+# CHECK: [[@LINE+1]]:8: error: literal value out of range for directive in '.dword' directive
+.dword 0xffffffffffffffffa
+# CHECK: [[@LINE+1]]:8: error: literal value out of range for directive in '.xword' directive
+.xword 0xffffffffffffffffa
+# CHECK: [[@LINE+1]]:8: error: literal value out of range for directive in '.8byte' directive
+.8byte 0xffffffffffffffffa
Index: llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
===================================================================
--- llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
+++ llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
@@ -244,10 +244,11 @@
// Alias .hword/.word/xword to the target-independent .2byte/.4byte/.8byte
// directives as they have the same form and semantics:
- /// ::= (.hword | .word | .xword ) [ expression (, expression)* ]
+ /// ::= (.hword | .word | .xword | .dword ) [ expression (, expression)* ]
Parser.addAliasForDirective(".hword", ".2byte");
Parser.addAliasForDirective(".word", ".4byte");
Parser.addAliasForDirective(".xword", ".8byte");
+ Parser.addAliasForDirective(".dword", ".8byte");
// Initialize the set of available features.
setAvailableFeatures(ComputeAvailableFeatures(getSTI().getFeatureBits()));
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57529.184550.patch
Type: text/x-patch
Size: 1943 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190131/7cd75347/attachment.bin>
More information about the llvm-commits
mailing list