[llvm] r200615 - MC: Fix .octa output for APInts with BitWidth > 128

David Woodhouse dwmw2 at infradead.org
Sat Feb 1 08:52:34 PST 2014


Author: dwmw2
Date: Sat Feb  1 10:52:33 2014
New Revision: 200615

URL: http://llvm.org/viewvc/llvm-project?rev=200615&view=rev
Log:
MC: Fix .octa output for APInts with BitWidth > 128

Modified:
    llvm/trunk/lib/MC/MCParser/AsmParser.cpp
    llvm/trunk/test/MC/AsmParser/directive_values.s

Modified: llvm/trunk/lib/MC/MCParser/AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCParser/AsmParser.cpp?rev=200615&r1=200614&r2=200615&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCParser/AsmParser.cpp (original)
+++ llvm/trunk/lib/MC/MCParser/AsmParser.cpp Sat Feb  1 10:52:33 2014
@@ -2335,7 +2335,8 @@ bool AsmParser::parseDirectiveOctaValue(
         hi = 0;
         lo = IntValue.getZExtValue();
       } else if (IntValue.isIntN(128)) {
-        hi = IntValue.getHiBits(64).getZExtValue();
+        // It might actually have more than 128 bits, but the top ones are zero.
+        hi = IntValue.getHiBits(IntValue.getBitWidth() - 64).getZExtValue();
         lo = IntValue.getLoBits(64).getZExtValue();
       } else
         return Error(ExprLoc, "literal value out of range for directive");

Modified: llvm/trunk/test/MC/AsmParser/directive_values.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/directive_values.s?rev=200615&r1=200614&r2=200615&view=diff
==============================================================================
--- llvm/trunk/test/MC/AsmParser/directive_values.s (original)
+++ llvm/trunk/test/MC/AsmParser/directive_values.s Sat Feb  1 10:52:33 2014
@@ -71,13 +71,13 @@ TEST8:
 # CHECK: .long 2097153
 
 TEST9:
-	.octa 0x1234567812345678abcdef, 12345678901234567890123456789
+	.octa 0x1234567812345678abcdef, 340282366920938463463374607431768211455
 	.octa 0b00111010010110100101101001011010010110100101101001011010010110100101101001011010010110100101101001011010010110100101101001011010
 # CHECK: TEST9
 # CHECK: .quad 8652035380128501231
 # CHECK: .quad 1193046
-# CHECK: .quad 5097733592125636885
-# CHECK: .quad 669260594
+# CHECK: .quad -1
+# CHECK: .quad -1
 # CHECK: .quad 6510615555426900570
 # CHECK: .quad 4204772546213206618
 





More information about the llvm-commits mailing list