summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/AsmWriterEmitter.cpp
diff options
context:
space:
mode:
authorNate Begeman <natebegeman@mac.com>2008-04-09 16:24:11 +0000
committerNate Begeman <natebegeman@mac.com>2008-04-09 16:24:11 +0000
commita6063118c6473870996118009a8e854fea8ea195 (patch)
tree8b6557e53a660f9f23403165f0ec51806c0241bd /llvm/utils/TableGen/AsmWriterEmitter.cpp
parenta7dfbc03661fc303891370de95e160ab66769eb0 (diff)
downloadbcm5719-llvm-a6063118c6473870996118009a8e854fea8ea195.tar.gz
bcm5719-llvm-a6063118c6473870996118009a8e854fea8ea195.zip
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. llvm-svn: 49433
Diffstat (limited to 'llvm/utils/TableGen/AsmWriterEmitter.cpp')
-rw-r--r--llvm/utils/TableGen/AsmWriterEmitter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/utils/TableGen/AsmWriterEmitter.cpp b/llvm/utils/TableGen/AsmWriterEmitter.cpp
index 4ba22758a60..8fbb2cfbb61 100644
--- a/llvm/utils/TableGen/AsmWriterEmitter.cpp
+++ b/llvm/utils/TableGen/AsmWriterEmitter.cpp
@@ -536,7 +536,7 @@ void AsmWriterEmitter::run(std::ostream &O) {
}
// 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.
OpenPOWER on IntegriCloud