1 ; RUN: llc < %s | FileCheck %s
4 target datalayout = "E-p:64:64:64-i8:8:16-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f128:128:128-a0:16:16"
5 target triple = "s390x-linux"
8 define i16 @foo(i16 zeroext %a) zeroext {
9 %res = tail call i16 @llvm.bswap.i16(i16 %a)
13 define i32 @foo2(i32 zeroext %a) zeroext {
15 ; CHECK: lrvr %r1, %r2
16 %res = tail call i32 @llvm.bswap.i32(i32 %a)
20 define i64 @foo3(i64 %a) zeroext {
22 ; CHECK: lrvgr %r2, %r2
23 %res = tail call i64 @llvm.bswap.i64(i64 %a)
27 define i16 @foo4(i16* %b) zeroext {
29 %res = tail call i16 @llvm.bswap.i16(i16 %a)
33 define i32 @foo5(i32* %b) zeroext {
35 ; CHECK: lrv %r1, 0(%r2)
37 %res = tail call i32 @llvm.bswap.i32(i32 %a)
41 define i64 @foo6(i64* %b) {
43 ; CHECK: lrvg %r2, 0(%r2)
45 %res = tail call i64 @llvm.bswap.i64(i64 %a)
49 define void @foo7(i16 %a, i16* %b) {
50 %res = tail call i16 @llvm.bswap.i16(i16 %a)
51 store i16 %res, i16* %b
55 define void @foo8(i32 %a, i32* %b) {
57 ; CHECK: strv %r2, 0(%r3)
58 %res = tail call i32 @llvm.bswap.i32(i32 %a)
59 store i32 %res, i32* %b
63 define void @foo9(i64 %a, i64* %b) {
65 ; CHECK: strvg %r2, 0(%r3)
66 %res = tail call i64 @llvm.bswap.i64(i64 %a)
67 store i64 %res, i64* %b
71 declare i16 @llvm.bswap.i16(i16) nounwind readnone
72 declare i32 @llvm.bswap.i32(i32) nounwind readnone
73 declare i64 @llvm.bswap.i64(i64) nounwind readnone