1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \
2 ; RUN: grep {stwbrx\\|lwbrx\\|sthbrx\\|lhbrx} | wc -l | grep 4
3 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep rlwinm
4 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep rlwimi
5 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc64 | \
6 ; RUN: grep {stwbrx\\|lwbrx\\|sthbrx\\|lhbrx} | wc -l | grep 4
7 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc64 | not grep rlwinm
8 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc64 | not grep rlwimi
10 void %STWBRX(uint %i, sbyte* %ptr, int %off) {
11 %tmp1 = getelementptr sbyte* %ptr, int %off
12 %tmp1 = cast sbyte* %tmp1 to uint*
13 %tmp13 = tail call uint %llvm.bswap.i32(uint %i)
14 store uint %tmp13, uint* %tmp1
18 uint %LWBRX(sbyte* %ptr, int %off) {
19 %tmp1 = getelementptr sbyte* %ptr, int %off
20 %tmp1 = cast sbyte* %tmp1 to uint*
21 %tmp = load uint* %tmp1
22 %tmp14 = tail call uint %llvm.bswap.i32( uint %tmp )
26 void %STHBRX(ushort %s, sbyte* %ptr, int %off) {
27 %tmp1 = getelementptr sbyte* %ptr, int %off
28 %tmp1 = cast sbyte* %tmp1 to ushort*
29 %tmp5 = call ushort %llvm.bswap.i16( ushort %s )
30 store ushort %tmp5, ushort* %tmp1
34 ushort %LHBRX(sbyte* %ptr, int %off) {
35 %tmp1 = getelementptr sbyte* %ptr, int %off
36 %tmp1 = cast sbyte* %tmp1 to ushort*
37 %tmp = load ushort* %tmp1
38 %tmp6 = call ushort %llvm.bswap.i16(ushort %tmp)
42 declare uint %llvm.bswap.i32(uint)
44 declare ushort %llvm.bswap.i16(ushort)