diff options
author | Dale Johannesen <dalej@apple.com> | 2008-11-08 00:01:16 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2008-11-08 00:01:16 +0000 |
commit | 3903271ec1ff3226e558541f6bb61247b7316f1c (patch) | |
tree | 744603c0e09b6488464fcdb6d17b978af3b8f4f4 /lib/CodeGen/SelectionDAG/TargetLowering.cpp | |
parent | 8600421afe774e20c147d9505e3ddc0c1fc04a99 (diff) | |
download | external_llvm-3903271ec1ff3226e558541f6bb61247b7316f1c.zip external_llvm-3903271ec1ff3226e558541f6bb61247b7316f1c.tar.gz external_llvm-3903271ec1ff3226e558541f6bb61247b7316f1c.tar.bz2 |
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.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/lib/CodeGen/SelectionDAG/TargetLowering.cpp index 0a8538a..cf26166 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; } |