aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/MSP430
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2010-02-21 12:28:58 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2010-02-21 12:28:58 +0000
commit455080ff100c9383bc2619ae8ad86a02f61c3b00 (patch)
treeee9462c937a5e81e919200bedc17332025600c92 /lib/Target/MSP430
parent863cc971e85950c3d2408306d03c9d70186356a2 (diff)
downloadexternal_llvm-455080ff100c9383bc2619ae8ad86a02f61c3b00.zip
external_llvm-455080ff100c9383bc2619ae8ad86a02f61c3b00.tar.gz
external_llvm-455080ff100c9383bc2619ae8ad86a02f61c3b00.tar.bz2
IT turns out that during jumpless setcc lowering eq and ne were swapped.
This fixes PR6348 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96734 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/MSP430')
-rw-r--r--lib/Target/MSP430/MSP430ISelLowering.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/Target/MSP430/MSP430ISelLowering.cpp b/lib/Target/MSP430/MSP430ISelLowering.cpp
index 7281b37..e6c7e1e 100644
--- a/lib/Target/MSP430/MSP430ISelLowering.cpp
+++ b/lib/Target/MSP430/MSP430ISelLowering.cpp
@@ -795,18 +795,15 @@ SDValue MSP430TargetLowering::LowerSETCC(SDValue Op, SelectionDAG &DAG) {
if (andCC) {
// C = ~Z, thus Res = SRW & 1, no processing is required
} else {
- // Res = (SRW >> 1) & 1
+ // Res = ~((SRW >> 1) & 1)
Shift = true;
+ Invert = true;
}
break;
case MSP430CC::COND_E:
- if (andCC) {
- // C = ~Z, thus Res = ~(SRW & 1)
- } else {
- // Res = ~((SRW >> 1) & 1)
- Shift = true;
- }
- Invert = true;
+ Shift = true;
+ // C = ~Z for AND instruction, thus we can put Res = ~(SRW & 1), however,
+ // Res = (SRW >> 1) & 1 is 1 word shorter.
break;
}
EVT VT = Op.getValueType();