diff options
author | Daniel Cederman <cederman@gaisler.com> | 2018-05-28 12:42:55 +0000 |
---|---|---|
committer | Daniel Cederman <cederman@gaisler.com> | 2018-05-28 12:42:55 +0000 |
commit | 2e7fe0edaf63db3f16f403bf48d1e2ef9eb636f8 (patch) | |
tree | e889e8ca2ccbe0311b60264439408516132c9f48 | |
parent | da0256f2c8d1d8a0399bb0021fecfdee30dbd7bd (diff) | |
download | bcm5719-llvm-2e7fe0edaf63db3f16f403bf48d1e2ef9eb636f8.tar.gz bcm5719-llvm-2e7fe0edaf63db3f16f403bf48d1e2ef9eb636f8.zip |
[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
llvm-svn: 333372
-rw-r--r-- | llvm/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp | 2 | ||||
-rw-r--r-- | llvm/test/MC/Sparc/sparc-directives.s | 6 |
2 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp b/llvm/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp index 9e23d2498bf..35d92a96abe 100644 --- a/llvm/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp +++ b/llvm/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp @@ -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"); diff --git a/llvm/test/MC/Sparc/sparc-directives.s b/llvm/test/MC/Sparc/sparc-directives.s index d804c1afe9b..5c8cd004d57 100644 --- a/llvm/test/MC/Sparc/sparc-directives.s +++ b/llvm/test/MC/Sparc/sparc-directives.s @@ -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 |