blob: b8668bb6f025cf561e39abcffa98a0f358d78f07 [file] [log] [blame]
Chris Lattner5895a132006-07-10 20:53:53 +00001; RUN: llvm-as < %s | llc -march=ppc32 | grep 'stwbrx\|lwbrx\|sthbrx\|lhbrx' | wc -l | grep 4 &&
2; RUN: llvm-as < %s | llc -march=ppc32 | not grep rlwinm &&
3; RUN: llvm-as < %s | llc -march=ppc32 | not grep rlwimi &&
4; RUN: llvm-as < %s | llc -march=ppc64 | grep 'stwbrx\|lwbrx\|sthbrx\|lhbrx' | wc -l | grep 4 &&
5; RUN: llvm-as < %s | llc -march=ppc64 | not grep rlwinm &&
6; RUN: llvm-as < %s | llc -march=ppc64 | not grep rlwimi
7
8void %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
13 ret void
14}
15
16uint %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 )
21 ret uint %tmp14
22}
23
24void %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
29 ret void
30}
31
32ushort %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)
37 ret ushort %tmp6
38}
39
40declare uint %llvm.bswap.i32(uint)
41
42declare ushort %llvm.bswap.i16(ushort)