llvm-6502/test/CodeGen/PowerPC/bswap-load-store.ll
Reid Spencer c58ef0185b For PR1319: Upgrade to new test harness.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36087 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-15 21:17:45 +00:00

45 lines
1.5 KiB
LLVM

; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \
; RUN: grep {stwbrx\\|lwbrx\\|sthbrx\\|lhbrx} | wc -l | grep 4
; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep rlwinm
; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep rlwimi
; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc64 | \
; RUN: grep {stwbrx\\|lwbrx\\|sthbrx\\|lhbrx} | wc -l | grep 4
; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc64 | not grep rlwinm
; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc64 | not grep rlwimi
void %STWBRX(uint %i, sbyte* %ptr, int %off) {
%tmp1 = getelementptr sbyte* %ptr, int %off
%tmp1 = cast sbyte* %tmp1 to uint*
%tmp13 = tail call uint %llvm.bswap.i32(uint %i)
store uint %tmp13, uint* %tmp1
ret void
}
uint %LWBRX(sbyte* %ptr, int %off) {
%tmp1 = getelementptr sbyte* %ptr, int %off
%tmp1 = cast sbyte* %tmp1 to uint*
%tmp = load uint* %tmp1
%tmp14 = tail call uint %llvm.bswap.i32( uint %tmp )
ret uint %tmp14
}
void %STHBRX(ushort %s, sbyte* %ptr, int %off) {
%tmp1 = getelementptr sbyte* %ptr, int %off
%tmp1 = cast sbyte* %tmp1 to ushort*
%tmp5 = call ushort %llvm.bswap.i16( ushort %s )
store ushort %tmp5, ushort* %tmp1
ret void
}
ushort %LHBRX(sbyte* %ptr, int %off) {
%tmp1 = getelementptr sbyte* %ptr, int %off
%tmp1 = cast sbyte* %tmp1 to ushort*
%tmp = load ushort* %tmp1
%tmp6 = call ushort %llvm.bswap.i16(ushort %tmp)
ret ushort %tmp6
}
declare uint %llvm.bswap.i32(uint)
declare ushort %llvm.bswap.i16(ushort)