mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 03:33:20 +01:00
Add some tests for shr-and folding
llvm-svn: 16507
This commit is contained in:
parent
52263072bc
commit
243761aade
@ -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