From: Dale Johannesen Date: Sat, 8 Nov 2008 00:01:16 +0000 (+0000) Subject: Make testb optimization work on big-endian targets. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=b514ac9e3cddb3663c74afcf7bfa359a867e2780;p=oota-llvm.git 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 --- diff --git a/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/lib/CodeGen/SelectionDAG/TargetLowering.cpp index 0a8538ac7f1..cf26166875b 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; offsetisLittleEndian()) + bestOffset = (origWidth/width - offset - 1) * (width/8); + else + bestOffset = (uint64_t)offset * (width/8); bestWidth = width; break; }