[llvm-commits] [llvm] r49433 - /llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp

Nate Begeman natebegeman at mac.com
Wed Apr 9 09:24:11 PDT 2008


Author: sampo
Date: Wed Apr  9 11:24:11 2008
New Revision: 49433

URL: http://llvm.org/viewvc/llvm-project?rev=49433&view=rev
Log:
Fix a bug where an incorrect bit mask would be generated if a target's last asm
string began at a power of 2 in the string index.  For example, if "ret" started
at position 16, the ret instruction would be assigned code 16, but the mask would be AsmChars[] + Code & 15, not Code & 31.


Modified:
    llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp

Modified: llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp?rev=49433&r1=49432&r2=49433&view=diff

==============================================================================
--- llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp Wed Apr  9 11:24:11 2008
@@ -536,7 +536,7 @@
   }
   
   // Figure out how many bits we used for the string index.
-  unsigned AsmStrBits = Log2_32_Ceil(MaxStringIdx);
+  unsigned AsmStrBits = Log2_32_Ceil(MaxStringIdx+1);
   
   // To reduce code size, we compactify common instructions into a few bits
   // in the opcode-indexed table.





More information about the llvm-commits mailing list