1 ; RUN: llc -verify-machineinstrs < %s -mtriple=ppc32-- -mcpu=ppc32 | FileCheck %s -check-prefix=X32
2 ; RUN: llc -verify-machineinstrs < %s -mtriple=ppc64-- -mcpu=ppc64 | FileCheck %s -check-prefix=X64
3 ; RUN: llc -verify-machineinstrs < %s -mtriple=ppc64-- -mcpu=pwr7 | FileCheck %s -check-prefix=PWR7
4 ; RUN: llc -verify-machineinstrs < %s -mtriple=ppc32-- -mcpu=pwr7 | FileCheck %s -check-prefix=X32
7 define void @STWBRX(i32 %i, i8* %ptr, i32 %off) {
8 %tmp1 = getelementptr i8, i8* %ptr, i32 %off ; <i8*> [#uses=1]
9 %tmp1.upgrd.1 = bitcast i8* %tmp1 to i32* ; <i32*> [#uses=1]
10 %tmp13 = tail call i32 @llvm.bswap.i32( i32 %i ) ; <i32> [#uses=1]
11 store i32 %tmp13, i32* %tmp1.upgrd.1
15 define i32 @LWBRX(i8* %ptr, i32 %off) {
16 %tmp1 = getelementptr i8, i8* %ptr, i32 %off ; <i8*> [#uses=1]
17 %tmp1.upgrd.2 = bitcast i8* %tmp1 to i32* ; <i32*> [#uses=1]
18 %tmp = load i32, i32* %tmp1.upgrd.2 ; <i32> [#uses=1]
19 %tmp14 = tail call i32 @llvm.bswap.i32( i32 %tmp ) ; <i32> [#uses=1]
23 define void @STHBRX(i16 %s, i8* %ptr, i32 %off) {
24 %tmp1 = getelementptr i8, i8* %ptr, i32 %off ; <i8*> [#uses=1]
25 %tmp1.upgrd.3 = bitcast i8* %tmp1 to i16* ; <i16*> [#uses=1]
26 %tmp5 = call i16 @llvm.bswap.i16( i16 %s ) ; <i16> [#uses=1]
27 store i16 %tmp5, i16* %tmp1.upgrd.3
31 define i16 @LHBRX(i8* %ptr, i32 %off) {
32 %tmp1 = getelementptr i8, i8* %ptr, i32 %off ; <i8*> [#uses=1]
33 %tmp1.upgrd.4 = bitcast i8* %tmp1 to i16* ; <i16*> [#uses=1]
34 %tmp = load i16, i16* %tmp1.upgrd.4 ; <i16> [#uses=1]
35 %tmp6 = call i16 @llvm.bswap.i16( i16 %tmp ) ; <i16> [#uses=1]
39 define void @STDBRX(i64 %i, i8* %ptr, i64 %off) {
40 %tmp1 = getelementptr i8, i8* %ptr, i64 %off ; <i8*> [#uses=1]
41 %tmp1.upgrd.1 = bitcast i8* %tmp1 to i64* ; <i64*> [#uses=1]
42 %tmp13 = tail call i64 @llvm.bswap.i64( i64 %i ) ; <i64> [#uses=1]
43 store i64 %tmp13, i64* %tmp1.upgrd.1
47 define i64 @LDBRX(i8* %ptr, i64 %off) {
48 %tmp1 = getelementptr i8, i8* %ptr, i64 %off ; <i8*> [#uses=1]
49 %tmp1.upgrd.2 = bitcast i8* %tmp1 to i64* ; <i64*> [#uses=1]
50 %tmp = load i64, i64* %tmp1.upgrd.2 ; <i64> [#uses=1]
51 %tmp14 = tail call i64 @llvm.bswap.i64( i64 %tmp ) ; <i64> [#uses=1]
55 declare i32 @llvm.bswap.i32(i32)
57 declare i16 @llvm.bswap.i16(i16)
59 declare i64 @llvm.bswap.i64(i64)