[llvm-commits] [llvm] r79408 - in /llvm/trunk: lib/MC/MCAsmStreamer.cpp test/MC/AsmParser/directive_align.s
Chris Lattner
sabre at nondot.org
Tue Aug 18 23:35:36 PDT 2009
Author: lattner
Date: Wed Aug 19 01:35:36 2009
New Revision: 79408
URL: http://llvm.org/viewvc/llvm-project?rev=79408&view=rev
Log:
fix asmstreaming of 2/4 byte elements with pow-2 alignments.
Modified:
llvm/trunk/lib/MC/MCAsmStreamer.cpp
llvm/trunk/test/MC/AsmParser/directive_align.s
Modified: llvm/trunk/lib/MC/MCAsmStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmStreamer.cpp?rev=79408&r1=79407&r2=79408&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCAsmStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCAsmStreamer.cpp Wed Aug 19 01:35:36 2009
@@ -229,7 +229,14 @@
// Some assemblers don't support non-power of two alignments, so we always
// emit alignments as a power of two if possible.
if (isPowerOf2_32(ByteAlignment)) {
- OS << TAI.getAlignDirective();
+ switch (ValueSize) {
+ default: llvm_unreachable("Invalid size for machine code value!");
+ case 1: OS << TAI.getAlignDirective(); break;
+ // FIXME: use TAI for this!
+ case 2: OS << ".p2alignw "; break;
+ case 4: OS << ".p2alignl "; break;
+ case 8: llvm_unreachable("Unsupported alignment size!");
+ }
if (TAI.getAlignmentIsInBytes())
OS << ByteAlignment;
Modified: llvm/trunk/test/MC/AsmParser/directive_align.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/directive_align.s?rev=79408&r1=79407&r2=79408&view=diff
==============================================================================
--- llvm/trunk/test/MC/AsmParser/directive_align.s (original)
+++ llvm/trunk/test/MC/AsmParser/directive_align.s Wed Aug 19 01:35:36 2009
@@ -1,7 +1,7 @@
-# RUN: llvm-mc -triple i386-unknown-unknown %s | FileCheck %s
+# RUN: llvm-mc -triple i386-apple-darwin9 %s | FileCheck %s
# CHECK: TEST0:
-# CHECK: .p2align 1, 0
+# CHECK: align 1
TEST0:
.align 1
More information about the llvm-commits
mailing list