mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-26 21:32:10 +00:00
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:
parent
2ed2ad00f9
commit
60abcb786e
@ -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),
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user