[llvm] r333372 - [Sparc] Add .uahalf and .uaword directives
Daniel Cederman via llvm-commits
llvm-commits at lists.llvm.org
Mon May 28 05:42:56 PDT 2018
Author: dcederman
Date: Mon May 28 05:42:55 2018
New Revision: 333372
URL: http://llvm.org/viewvc/llvm-project?rev=333372&view=rev
Log:
[Sparc] Add .uahalf and .uaword directives
Summary:
Adding these makes it easier to assemble the output from GCC which
generates a lot of .uahalf and .uaword directives.
GAS treats .uahalf and .half the same unless the --enforce-aligned-data
flag is used. I could not find a similar flag for LLVM so it seems that
.half does not have any alignment requirement and is treated the same as
.uahalf should be. If that would change later on then the tests in
sparc-directives.s would fail due to bad alignment.
Reviewers: jyknight, asb
Reviewed By: jyknight
Subscribers: fedor.sergeev, jrtc27, llvm-commits
Differential Revision: https://reviews.llvm.org/D47319
Modified:
llvm/trunk/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp
llvm/trunk/test/MC/Sparc/sparc-directives.s
Modified: llvm/trunk/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp?rev=333372&r1=333371&r2=333372&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp (original)
+++ llvm/trunk/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp Mon May 28 05:42:55 2018
@@ -109,7 +109,9 @@ public:
const MCTargetOptions &Options)
: MCTargetAsmParser(Options, sti, MII), Parser(parser) {
Parser.addAliasForDirective(".half", ".2byte");
+ Parser.addAliasForDirective(".uahalf", ".2byte");
Parser.addAliasForDirective(".word", ".4byte");
+ Parser.addAliasForDirective(".uaword", ".4byte");
Parser.addAliasForDirective(".nword", is64Bit() ? ".8byte" : ".4byte");
if (is64Bit())
Parser.addAliasForDirective(".xword", ".8byte");
Modified: llvm/trunk/test/MC/Sparc/sparc-directives.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Sparc/sparc-directives.s?rev=333372&r1=333371&r2=333372&view=diff
==============================================================================
--- llvm/trunk/test/MC/Sparc/sparc-directives.s (original)
+++ llvm/trunk/test/MC/Sparc/sparc-directives.s Mon May 28 05:42:55 2018
@@ -11,11 +11,17 @@
! SPARC32: .half 1024
! SPARC64: .half 1024
+ ! SPARC32: .half 1024
+ ! SPARC64: .half 1024
.half 1024
+ .uahalf 1024
! SPARC32: .word 65536
! SPARC64: .word 65536
+ ! SPARC32: .word 65536
+ ! SPARC64: .word 65536
.word 65536
+ .uaword 65536
! SPARC32: .word 65536
! SPARC64: .xword 65536
More information about the llvm-commits
mailing list