[llvm-commits] CVS: llvm/lib/Target/X86/X86ISelLowering.cpp
Evan Cheng
evan.cheng at apple.com
Tue Mar 28 15:41:45 PST 2006
Changes in directory llvm/lib/Target/X86:
X86ISelLowering.cpp updated: 1.140 -> 1.141
---
Log message:
Fixing buggy code.
---
Diffs of the changes: (+6 -6)
X86ISelLowering.cpp | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
Index: llvm/lib/Target/X86/X86ISelLowering.cpp
diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.140 llvm/lib/Target/X86/X86ISelLowering.cpp:1.141
--- llvm/lib/Target/X86/X86ISelLowering.cpp:1.140 Tue Mar 28 04:17:11 2006
+++ llvm/lib/Target/X86/X86ISelLowering.cpp Tue Mar 28 17:41:33 2006
@@ -1571,14 +1571,14 @@
unsigned NumOperands = N->getNumOperands();
unsigned Shift = (NumOperands == 4) ? 2 : 1;
unsigned Mask = 0;
- unsigned i = NumOperands - 1;
- do {
- unsigned Val = cast<ConstantSDNode>(N->getOperand(i))->getValue();
+ for (unsigned i = 0; i < NumOperands; ++i) {
+ unsigned Val
+ = cast<ConstantSDNode>(N->getOperand(NumOperands-i-1))->getValue();
if (Val >= NumOperands) Val -= NumOperands;
Mask |= Val;
- Mask <<= Shift;
- --i;
- } while (i != 0);
+ if (i != NumOperands - 1)
+ Mask <<= Shift;
+ }
return Mask;
}
More information about the llvm-commits
mailing list