blob: 7954d666467aa778f2cc39018f81ace6a37fb889 [file] [log] [blame]
Ulrich Weigand9e3577f2013-05-06 16:17:29 +00001; Test moves between FPRs.
2;
Ulrich Weigand49506d72015-05-05 19:28:34 +00003; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z10 | FileCheck %s
Ulrich Weigand9e3577f2013-05-06 16:17:29 +00004
5; Test f32 moves.
6define float @f1(float %a, float %b) {
Stephen Lind24ab202013-07-14 06:24:09 +00007; CHECK-LABEL: f1:
Ulrich Weigand9e3577f2013-05-06 16:17:29 +00008; CHECK: ler %f0, %f2
Ulrich Weigand49506d72015-05-05 19:28:34 +00009; CHECK: br %r14
Ulrich Weigand9e3577f2013-05-06 16:17:29 +000010 ret float %b
11}
12
13; Test f64 moves.
14define double @f2(double %a, double %b) {
Stephen Lind24ab202013-07-14 06:24:09 +000015; CHECK-LABEL: f2:
Ulrich Weigand9e3577f2013-05-06 16:17:29 +000016; CHECK: ldr %f0, %f2
Ulrich Weigand49506d72015-05-05 19:28:34 +000017; CHECK: br %r14
Ulrich Weigand9e3577f2013-05-06 16:17:29 +000018 ret double %b
19}
20
21; Test f128 moves. Since f128s are passed by reference, we need to force
22; a copy by other means.
23define void @f3(fp128 *%x) {
Stephen Lind24ab202013-07-14 06:24:09 +000024; CHECK-LABEL: f3:
Ulrich Weigand9e3577f2013-05-06 16:17:29 +000025; CHECK: lxr
26; CHECK: axbr
Ulrich Weigand49506d72015-05-05 19:28:34 +000027; CHECK: br %r14
Ulrich Weigand9dd23b82018-07-20 12:12:10 +000028 %val = load volatile fp128, fp128 *%x
Ulrich Weigand9e3577f2013-05-06 16:17:29 +000029 %sum = fadd fp128 %val, %val
30 store volatile fp128 %sum, fp128 *%x
31 store volatile fp128 %val, fp128 *%x
32 ret void
33}