summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
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
commitbb5c9b4b68404065d708f6140658703446dad6db (patch)
treedc1229946d63f5ccc7131c854939d4e8c2c08dd8 /llvm/lib/CodeGen
parent015085fafaae32f8b33236ee8cf0ef082afde89c (diff)
downloadbcm5719-llvm-bb5c9b4b68404065d708f6140658703446dad6db.tar.gz
bcm5719-llvm-bb5c9b4b68404065d708f6140658703446dad6db.zip
Make testb optimization work on big-endian targets.
llvm-svn: 58874
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index 0a8538ac7f1..cf26166875b 100644
--- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/llvm/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;
}
OpenPOWER on IntegriCloud