llvm.org GIT mirror llvm / 86189a4
Revert the name changes for llvm.bswap to allow (and test) llvm-upgrade of this intrinsic. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35566 91177308-0d34-0410-b5e6-96231b3b80d8 Reid Spencer 13 years ago
2 changed file(s) with 40 addition(s) and 40 deletion(s). Raw diff Collapse all Expand all
0 ; Make sure this testcase is supported by all code generators
11 ; RUN: llvm-upgrade < %s | llvm-as | llc
22
3 declare uint %llvm.ctpop.i64(ulong)
3 declare ulong %llvm.ctpop.i64(ulong)
44 declare uint %llvm.ctpop.i32(uint)
5 declare uint %llvm.ctpop.i16(ushort)
6 declare uint %llvm.ctpop.i8(ubyte)
5 declare ushort %llvm.ctpop.i16(ushort)
6 declare ubyte %llvm.ctpop.i8(ubyte)
77
88 void %ctpoptest(ubyte %A, ushort %B, uint %C, ulong %D,
9 uint *%AP, uint* %BP, uint* %CP, uint* %DP) {
10 %a = call uint %llvm.ctpop.i8(ubyte %A)
11 %b = call uint %llvm.ctpop.i16(ushort %B)
9 ubyte *%AP, ushort* %BP, uint* %CP, ulong* %DP) {
10 %a = call ubyte %llvm.ctpop.i8(ubyte %A)
11 %b = call ushort %llvm.ctpop.i16(ushort %B)
1212 %c = call uint %llvm.ctpop.i32(uint %C)
13 %d = call uint %llvm.ctpop.i64(ulong %D)
13 %d = call ulong %llvm.ctpop.i64(ulong %D)
1414
15 store uint %a, uint* %AP
16 store uint %b, uint* %BP
17 store uint %c, uint* %CP
18 store uint %d, uint* %DP
15 store ubyte %a, ubyte* %AP
16 store ushort %b, ushort* %BP
17 store uint %c, uint* %CP
18 store ulong %d, ulong* %DP
1919 ret void
2020 }
2121
22 declare uint %llvm.ctlz.i64(ulong)
22 declare ulong %llvm.ctlz.i64(ulong)
2323 declare uint %llvm.ctlz.i32(uint)
24 declare uint %llvm.ctlz.i16(ushort)
25 declare uint %llvm.ctlz.i8(ubyte)
24 declare ushort %llvm.ctlz.i16(ushort)
25 declare ubyte %llvm.ctlz.i8(ubyte)
2626
2727 void %ctlztest(ubyte %A, ushort %B, uint %C, ulong %D,
28 uint *%AP, uint* %BP, uint* %CP, uint* %DP) {
29 %a = call uint %llvm.ctlz.i8(ubyte %A)
30 %b = call uint %llvm.ctlz.i16(ushort %B)
28 ubyte *%AP, ushort* %BP, uint* %CP, ulong* %DP) {
29 %a = call ubyte %llvm.ctlz.i8(ubyte %A)
30 %b = call ushort %llvm.ctlz.i16(ushort %B)
3131 %c = call uint %llvm.ctlz.i32(uint %C)
32 %d = call uint %llvm.ctlz.i64(ulong %D)
32 %d = call ulong %llvm.ctlz.i64(ulong %D)
3333
34 store uint %a, uint* %AP
35 store uint %b, uint* %BP
36 store uint %c, uint* %CP
37 store uint %d, uint* %DP
34 store ubyte %a, ubyte* %AP
35 store ushort %b, ushort* %BP
36 store uint %c, uint* %CP
37 store ulong %d, ulong* %DP
3838 ret void
3939 }
4040
41 declare uint %llvm.cttz.i64(ulong)
41 declare ulong %llvm.cttz.i64(ulong)
4242 declare uint %llvm.cttz.i32(uint)
43 declare uint %llvm.cttz.i16(ushort)
44 declare uint %llvm.cttz.i8(ubyte)
43 declare ushort %llvm.cttz.i16(ushort)
44 declare ubyte %llvm.cttz.i8(ubyte)
4545
4646 void %cttztest(ubyte %A, ushort %B, uint %C, ulong %D,
47 uint *%AP, uint* %BP, uint* %CP, uint* %DP) {
48 %a = call uint %llvm.cttz.i8(ubyte %A)
49 %b = call uint %llvm.cttz.i16(ushort %B)
47 ubyte *%AP, ushort* %BP, uint* %CP, ulong* %DP) {
48 %a = call ubyte %llvm.cttz.i8(ubyte %A)
49 %b = call ushort %llvm.cttz.i16(ushort %B)
5050 %c = call uint %llvm.cttz.i32(uint %C)
51 %d = call uint %llvm.cttz.i64(ulong %D)
51 %d = call ulong %llvm.cttz.i64(ulong %D)
5252
53 store uint %a, uint* %AP
54 store uint %b, uint* %BP
55 store uint %c, uint* %CP
56 store uint %d, uint* %DP
53 store ubyte %a, ubyte* %AP
54 store ushort %b, ushort* %BP
55 store uint %c, uint* %CP
56 store ulong %d, ulong* %DP
5757 ret void
5858 }
11 ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | not grep 'call.*bswap'
22
33 bool %test1(ushort %tmp2) {
4 %tmp10 = call ushort %llvm.bswap.i16.i16( ushort %tmp2 )
4 %tmp10 = call ushort %llvm.bswap.i16( ushort %tmp2 )
55 %tmp = seteq ushort %tmp10, 1
66 ret bool %tmp
77 }
88
99 bool %test2(uint %tmp) {
10 %tmp34 = tail call uint %llvm.bswap.i32.i32( uint %tmp )
10 %tmp34 = tail call uint %llvm.bswap.i32( uint %tmp )
1111 %tmp = seteq uint %tmp34, 1
1212 ret bool %tmp
1313 }
1414
15 declare uint %llvm.bswap.i32(uint)
16
1517 bool %test3(ulong %tmp) {
16 %tmp34 = tail call ulong %llvm.bswap.i64.i64( ulong %tmp )
18 %tmp34 = tail call ulong %llvm.bswap.i64( ulong %tmp )
1719 %tmp = seteq ulong %tmp34, 1
1820 ret bool %tmp
1921 }
2022
21 declare ulong %llvm.bswap.i64.i64(ulong)
23 declare ulong %llvm.bswap.i64(ulong)
2224
23 declare ushort %llvm.bswap.i16.i16(ushort)
24
25 declare uint %llvm.bswap.i32.i32(uint)
25 declare ushort %llvm.bswap.i16(ushort)