1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep 'stwbrx\|lwbrx\|sthbrx\|lhbrx' | wc -l | grep 4 &&
2 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep rlwinm &&
3 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep rlwimi &&
4 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc64 | grep 'stwbrx\|lwbrx\|sthbrx\|lhbrx' | wc -l | grep 4 &&
5 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc64 | not grep rlwinm &&
6 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc64 | not grep rlwimi
8 void %STWBRX(uint %i, sbyte* %ptr, int %off) {
9 %tmp1 = getelementptr sbyte* %ptr, int %off
10 %tmp1 = cast sbyte* %tmp1 to uint*
11 %tmp13 = tail call uint %llvm.bswap.i32(uint %i)
12 store uint %tmp13, uint* %tmp1
16 uint %LWBRX(sbyte* %ptr, int %off) {
17 %tmp1 = getelementptr sbyte* %ptr, int %off
18 %tmp1 = cast sbyte* %tmp1 to uint*
19 %tmp = load uint* %tmp1
20 %tmp14 = tail call uint %llvm.bswap.i32( uint %tmp )
24 void %STHBRX(ushort %s, sbyte* %ptr, int %off) {
25 %tmp1 = getelementptr sbyte* %ptr, int %off
26 %tmp1 = cast sbyte* %tmp1 to ushort*
27 %tmp5 = call ushort %llvm.bswap.i16( ushort %s )
28 store ushort %tmp5, ushort* %tmp1
32 ushort %LHBRX(sbyte* %ptr, int %off) {
33 %tmp1 = getelementptr sbyte* %ptr, int %off
34 %tmp1 = cast sbyte* %tmp1 to ushort*
35 %tmp = load ushort* %tmp1
36 %tmp6 = call ushort %llvm.bswap.i16(ushort %tmp)
40 declare uint %llvm.bswap.i32(uint)
42 declare ushort %llvm.bswap.i16(ushort)