1 ; Test memcpy using MVC. 2 ; 3 ; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s 4 5 declare void @llvm.memcpy.p0i8.p0i8.i32(i8 *nocapture, i8 *nocapture, i32, i32, i1) nounwind 6 declare void @llvm.memcpy.p0i8.p0i8.i64(i8 *nocapture, i8 *nocapture, i64, i32, i1) nounwind 7 8 define void @f1(i8 *%dest, i8 *%src) { 9 ; CHECK-LABEL: f1: 10 ; CHECK-NOT: %r2 11 ; CHECK-NOT: %r3 12 ; CHECK: br %r14 13 call void @llvm.memcpy.p0i8.p0i8.i32(i8 *%dest, i8 *%src, i32 0, i32 1, 14 i1 false) 15 ret void 16 } 17 18 define void @f2(i8 *%dest, i8 *%src) { 19 ; CHECK-LABEL: f2: 20 ; CHECK-NOT: %r2 21 ; CHECK-NOT: %r3 22 ; CHECK: br %r14 23 call void @llvm.memcpy.p0i8.p0i8.i64(i8 *%dest, i8 *%src, i64 0, i32 1, 24 i1 false) 25 ret void 26 } 27 28 define void @f3(i8 *%dest, i8 *%src) { 29 ; CHECK-LABEL: f3: 30 ; CHECK: mvc 0(1,%r2), 0(%r3) 31 ; CHECK: br %r14 32 call void @llvm.memcpy.p0i8.p0i8.i32(i8 *%dest, i8 *%src, i32 1, i32 1, 33 i1 false) 34 ret void 35 } 36 37 define void @f4(i8 *%dest, i8 *%src) { 38 ; CHECK-LABEL: f4: 39 ; CHECK: mvc 0(1,%r2), 0(%r3) 40 ; CHECK: br %r14 41 call void @llvm.memcpy.p0i8.p0i8.i64(i8 *%dest, i8 *%src, i64 1, i32 1, 42 i1 false) 43 ret void 44 } 45 46 define void @f5(i8 *%dest, i8 *%src) { 47 ; CHECK-LABEL: f5: 48 ; CHECK: mvc 0(256,%r2), 0(%r3) 49 ; CHECK: br %r14 50 call void @llvm.memcpy.p0i8.p0i8.i32(i8 *%dest, i8 *%src, i32 256, i32 1, 51 i1 false) 52 ret void 53 } 54 55 define void @f6(i8 *%dest, i8 *%src) { 56 ; CHECK-LABEL: f6: 57 ; CHECK: mvc 0(256,%r2), 0(%r3) 58 ; CHECK: br %r14 59 call void @llvm.memcpy.p0i8.p0i8.i64(i8 *%dest, i8 *%src, i64 256, i32 1, 60 i1 false) 61 ret void 62 } 63 64 ; 257 bytes is too big for a single MVC. For now expect none, so that 65 ; the test fails and gets updated when large copies are implemented. 66 define void @f7(i8 *%dest, i8 *%src) { 67 ; CHECK-LABEL: f7: 68 ; CHECK-NOT: mvc 69 ; CHECK: br %r14 70 call void @llvm.memcpy.p0i8.p0i8.i32(i8 *%dest, i8 *%src, i32 257, i32 1, 71 i1 false) 72 ret void 73 } 74 75 define void @f8(i8 *%dest, i8 *%src) { 76 ; CHECK-LABEL: f8: 77 ; CHECK-NOT: mvc 78 ; CHECK: br %r14 79 call void @llvm.memcpy.p0i8.p0i8.i64(i8 *%dest, i8 *%src, i64 257, i32 1, 80 i1 false) 81 ret void 82 } 83