From bb5c9b4b68404065d708f6140658703446dad6db Mon Sep 17 00:00:00 2001 From: Dale Johannesen Date: Sat, 8 Nov 2008 00:01:16 +0000 Subject: [PATCH] Make testb optimization work on big-endian targets. llvm-svn: 58874 --- llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp index 0a8538ac7f14..cf26166875b9 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; offsetisLittleEndian()) + bestOffset = (origWidth/width - offset - 1) * (width/8); + else + bestOffset = (uint64_t)offset * (width/8); bestWidth = width; break; }