mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-06 04:31:08 +00:00
Add some tests for shr-and folding
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16507 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5fbb1f8fcc
commit
71dd801055
@ -119,3 +119,20 @@ bool %test18(int %A) {
|
||||
ret bool %C
|
||||
}
|
||||
|
||||
int %test19(int %A) {
|
||||
%B = shl int %A, ubyte 3
|
||||
%C = and int %B, -2 ;; Clearing a zero bit
|
||||
ret int %C
|
||||
}
|
||||
|
||||
ubyte %test20(ubyte %A) {
|
||||
%C = shr ubyte %A, ubyte 7
|
||||
%D = and ubyte %C, 1 ;; Unneeded
|
||||
ret ubyte %D
|
||||
}
|
||||
|
||||
sbyte %test21(sbyte %A) {
|
||||
%C = shr sbyte %A, ubyte 7 ;; sign extend
|
||||
%D = and sbyte %C, 1 ;; chop off sign
|
||||
ret sbyte %D
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user