Select i64 values with %icc conditions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182224 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jakob Stoklund Olesen 2013-05-19 20:38:21 +00:00
parent 2ed2ad00f9
commit 60abcb786e
2 changed files with 16 additions and 0 deletions

View File

@ -340,6 +340,11 @@ def : Pat<(SPselectxcc i64:$t, i64:$f, imm:$cond),
def : Pat<(SPselectxcc (i64 simm11:$t), i64:$f, imm:$cond),
(MOVXCCri (as_i32imm $t), $f, imm:$cond)>;
def : Pat<(SPselecticc i64:$t, i64:$f, imm:$cond),
(MOVICCrr $t, $f, imm:$cond)>;
def : Pat<(SPselecticc (i64 simm11:$t), i64:$f, imm:$cond),
(MOVICCri (as_i32imm $t), $f, imm:$cond)>;
def : Pat<(SPselectfcc i64:$t, i64:$f, imm:$cond),
(MOVFCCrr $t, $f, imm:$cond)>;
def : Pat<(SPselectfcc (i64 simm11:$t), i64:$f, imm:$cond),

View File

@ -55,6 +55,17 @@ entry:
ret i64 %rv
}
; CHECK: selecti64_icc
; CHECK: subcc %i0, %i1
; CHECK: movg %icc, %i2, %i3
; CHECK: or %g0, %i3, %i0
define i64 @selecti64_icc(i32 %x, i32 %y, i64 %a, i64 %b) {
entry:
%tobool = icmp sgt i32 %x, %y
%rv = select i1 %tobool, i64 %a, i64 %b
ret i64 %rv
}
; CHECK: selecti64_fcc
; CHECK: fcmps %f1, %f3
; CHECK: movul %fcc0, %i2, %i3