aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/TargetLowering.cpp
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2008-11-08 00:01:16 +0000
committerDale Johannesen <dalej@apple.com>2008-11-08 00:01:16 +0000
commitb514ac9e3cddb3663c74afcf7bfa359a867e2780 (patch)
tree744603c0e09b6488464fcdb6d17b978af3b8f4f4 /lib/CodeGen/SelectionDAG/TargetLowering.cpp
parent413a89f3187581ee94d01cafe167f1deff16493d (diff)
Make testb optimization work on big-endian targets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58874 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/TargetLowering.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/TargetLowering.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index 0a8538ac7f..cf26166875 100644
--- a/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/lib/CodeGen/SelectionDAG/TargetLowering.cpp
@@ -1370,7 +1370,10 @@ TargetLowering::SimplifySetCC(MVT VT, SDValue N0, SDValue N1,
uint64_t newMask = (1ULL << width) - 1;
for (unsigned offset=0; offset<origWidth/width; offset++) {
if ((newMask & Mask)==Mask) {
- bestOffset = (uint64_t)offset * (width/8);
+ if (!TD->isLittleEndian())
+ bestOffset = (origWidth/width - offset - 1) * (width/8);
+ else
+ bestOffset = (uint64_t)offset * (width/8);
bestWidth = width;
break;
}