mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-18 12:27:55 +00:00
Test folding comparisons into select instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12559 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -30,3 +30,21 @@ double %doubleSel(bool %A, double %B, double %C) {
|
|||||||
ret double %X
|
ret double %X
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sbyte %foldSel(bool %A, sbyte %B, sbyte %C) {
|
||||||
|
%Cond = setlt sbyte %B, %C
|
||||||
|
%X = select bool %Cond, sbyte %B, sbyte %C
|
||||||
|
ret sbyte %X
|
||||||
|
}
|
||||||
|
|
||||||
|
int %foldSel2(bool %A, int %B, int %C) {
|
||||||
|
%Cond = seteq int %B, %C
|
||||||
|
%X = select bool %Cond, int %B, int %C
|
||||||
|
ret int %X
|
||||||
|
}
|
||||||
|
|
||||||
|
int %foldSel2(bool %A, int %B, int %C, double %X, double %Y) {
|
||||||
|
%Cond = setlt double %X, %Y
|
||||||
|
%X = select bool %Cond, int %B, int %C
|
||||||
|
ret int %X
|
||||||
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user