Skip to content
This repository was archived by the owner on Nov 1, 2021. It is now read-only.

Commit 1c9524b

Browse files
committed
[Sparc] Correct the floating point conditional code mapping in GetOppositeBranchCondition().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192006 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent c4eb353 commit 1c9524b

File tree

2 files changed

+40
-8
lines changed

2 files changed

+40
-8
lines changed

Diff for: lib/Target/Sparc/SparcInstrInfo.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,14 @@ static SPCC::CondCodes GetOppositeBranchCondition(SPCC::CondCodes CC)
102102

103103
case SPCC::FCC_U: return SPCC::FCC_O;
104104
case SPCC::FCC_O: return SPCC::FCC_U;
105-
case SPCC::FCC_G: return SPCC::FCC_LE;
106-
case SPCC::FCC_LE: return SPCC::FCC_G;
107-
case SPCC::FCC_UG: return SPCC::FCC_ULE;
108-
case SPCC::FCC_ULE: return SPCC::FCC_UG;
109-
case SPCC::FCC_L: return SPCC::FCC_GE;
110-
case SPCC::FCC_GE: return SPCC::FCC_L;
111-
case SPCC::FCC_UL: return SPCC::FCC_UGE;
112-
case SPCC::FCC_UGE: return SPCC::FCC_UL;
105+
case SPCC::FCC_G: return SPCC::FCC_ULE;
106+
case SPCC::FCC_LE: return SPCC::FCC_UG;
107+
case SPCC::FCC_UG: return SPCC::FCC_LE;
108+
case SPCC::FCC_ULE: return SPCC::FCC_G;
109+
case SPCC::FCC_L: return SPCC::FCC_UGE;
110+
case SPCC::FCC_GE: return SPCC::FCC_UL;
111+
case SPCC::FCC_UL: return SPCC::FCC_GE;
112+
case SPCC::FCC_UGE: return SPCC::FCC_L;
113113
case SPCC::FCC_LG: return SPCC::FCC_UE;
114114
case SPCC::FCC_UE: return SPCC::FCC_LG;
115115
case SPCC::FCC_NE: return SPCC::FCC_E;

Diff for: test/CodeGen/SPARC/2011-01-11-CC.ll

+32
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,35 @@ entry:
103103
%1 = select i1 %0, double %f1, double %f2
104104
ret double %1
105105
}
106+
107+
define i32 @test_float_cc(double %a, double %b, i32 %c, i32 %d) {
108+
entry:
109+
; V8-LABEL: test_float_cc
110+
; V8: fcmpd
111+
; V8: {{fbl|fbuge}} .LBB
112+
; V8: fcmpd
113+
; V8: {{fbule|fbg}} .LBB
114+
115+
; V9-LABEL: test_float_cc
116+
; V9: fcmpd
117+
; V9: {{fbl|fbuge}} .LBB
118+
; V9: fcmpd
119+
; V9: {{fbule|fbg}} .LBB
120+
121+
%0 = fcmp uge double %a, 0.000000e+00
122+
br i1 %0, label %loop, label %loop.2
123+
124+
loop:
125+
%1 = icmp eq i32 %c, 10
126+
br i1 %1, label %loop, label %exit.0
127+
128+
loop.2:
129+
%2 = fcmp ogt double %b, 0.000000e+00
130+
br i1 %2, label %exit.1, label %loop
131+
132+
exit.0:
133+
ret i32 0
134+
135+
exit.1:
136+
ret i32 1
137+
}

0 commit comments

Comments
 (0)