X86 dag isel is now (soon) the default.
[oota-llvm.git] / test / CodeGen / X86 / bswap.ll
1 ; bswap should be constant folded when it is passed a constant argument
2
3 ; RUN: llvm-as < %s | llc -march=x86 | grep bswapl | wc -l | grep 3 &&
4 ; RUN: llvm-as < %s | llc -march=x86 | grep rolw | wc -l | grep 1
5
6 declare ushort %llvm.bswap.i16(ushort)
7 declare uint %llvm.bswap.i32(uint)
8 declare ulong %llvm.bswap.i64(ulong)
9
10 ushort %W(ushort %A) {
11         %Z = call ushort %llvm.bswap.i16(ushort %A)
12         ret ushort %Z
13 }
14
15 uint %X(uint %A) {
16         %Z = call uint %llvm.bswap.i32(uint %A)
17         ret uint %Z
18 }
19
20 ulong %Y(ulong %A) {
21         %Z = call ulong %llvm.bswap.i64(ulong %A)
22         ret ulong %Z
23 }