fix asmstreaming of 2/4 byte elements with pow-2 alignments.

llvm-svn: 79408
diff --git a/llvm/lib/MC/MCAsmStreamer.cpp b/llvm/lib/MC/MCAsmStreamer.cpp
index 8068c66..3dfd8e9 100644
--- a/llvm/lib/MC/MCAsmStreamer.cpp
+++ b/llvm/lib/MC/MCAsmStreamer.cpp
@@ -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;