xref: /llvm-project/llvm/test/CodeGen/SystemZ/int-move-01.ll (revision d24ab20e9b11d2076d8b9d5cd96f41a6b9c399fb)
19e3577ffSUlrich Weigand; Test moves between GPRs.
29e3577ffSUlrich Weigand;
39e3577ffSUlrich Weigand; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
49e3577ffSUlrich Weigand
59e3577ffSUlrich Weigand; Test 8-bit moves, which should get promoted to i32.
69e3577ffSUlrich Weiganddefine i8 @f1(i8 %a, i8 %b) {
7*d24ab20eSStephen Lin; CHECK-LABEL: f1:
89e3577ffSUlrich Weigand; CHECK: lr %r2, %r3
99e3577ffSUlrich Weigand; CHECK: br %r14
109e3577ffSUlrich Weigand  ret i8 %b
119e3577ffSUlrich Weigand}
129e3577ffSUlrich Weigand
139e3577ffSUlrich Weigand; Test 16-bit moves, which again should get promoted to i32.
149e3577ffSUlrich Weiganddefine i16 @f2(i16 %a, i16 %b) {
15*d24ab20eSStephen Lin; CHECK-LABEL: f2:
169e3577ffSUlrich Weigand; CHECK: lr %r2, %r3
179e3577ffSUlrich Weigand; CHECK: br %r14
189e3577ffSUlrich Weigand  ret i16 %b
199e3577ffSUlrich Weigand}
209e3577ffSUlrich Weigand
219e3577ffSUlrich Weigand; Test 32-bit moves.
229e3577ffSUlrich Weiganddefine i32 @f3(i32 %a, i32 %b) {
23*d24ab20eSStephen Lin; CHECK-LABEL: f3:
249e3577ffSUlrich Weigand; CHECK: lr %r2, %r3
259e3577ffSUlrich Weigand; CHECK: br %r14
269e3577ffSUlrich Weigand  ret i32 %b
279e3577ffSUlrich Weigand}
289e3577ffSUlrich Weigand
299e3577ffSUlrich Weigand; Test 64-bit moves.
309e3577ffSUlrich Weiganddefine i64 @f4(i64 %a, i64 %b) {
31*d24ab20eSStephen Lin; CHECK-LABEL: f4:
329e3577ffSUlrich Weigand; CHECK: lgr %r2, %r3
339e3577ffSUlrich Weigand; CHECK: br %r14
349e3577ffSUlrich Weigand  ret i64 %b
359e3577ffSUlrich Weigand}
36