1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
2 ; RUN: llc -verify-machineinstrs -mcpu=pwr7 -mtriple=powerpc64-unknown-linux-gnu -mattr=-vsx < %s | FileCheck %s
3 ; RUN: llc -verify-machineinstrs -mcpu=pwr7 -mtriple=powerpc64-unknown-linux-gnu -mattr=+vsx < %s | FileCheck %s -check-prefix=CHECK-VSX
4 target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f128:128:128-v128:128:128-n32:64"
5 target triple = "powerpc64-unknown-linux-gnu"
7 define double @foo_d_ll(ppc_fp128 %a, ppc_fp128 %b) #0 {
8 ; CHECK-LABEL: foo_d_ll:
9 ; CHECK: # %bb.0: # %entry
10 ; CHECK-NEXT: fcpsgn 1, 3, 1
13 ; CHECK-VSX-LABEL: foo_d_ll:
14 ; CHECK-VSX: # %bb.0: # %entry
15 ; CHECK-VSX-NEXT: xscpsgndp 1, 3, 1
18 %call = tail call ppc_fp128 @copysignl(ppc_fp128 %a, ppc_fp128 %b) #0
19 %conv = fptrunc ppc_fp128 %call to double
23 declare ppc_fp128 @copysignl(ppc_fp128, ppc_fp128) #0
25 define double @foo_dl(double %a, ppc_fp128 %b) #0 {
26 ; CHECK-LABEL: foo_dl:
27 ; CHECK: # %bb.0: # %entry
28 ; CHECK-NEXT: fcpsgn 1, 2, 1
31 ; CHECK-VSX-LABEL: foo_dl:
32 ; CHECK-VSX: # %bb.0: # %entry
33 ; CHECK-VSX-NEXT: xscpsgndp 1, 2, 1
36 %conv = fptrunc ppc_fp128 %b to double
37 %call = tail call double @copysign(double %a, double %conv) #0
41 declare double @copysign(double, double) #0
43 define ppc_fp128 @foo_ll(double %a, ppc_fp128 %b) #0 {
44 ; CHECK-LABEL: foo_ll:
45 ; CHECK: # %bb.0: # %entry
47 ; CHECK-NEXT: stdu 1, -112(1)
48 ; CHECK-NEXT: fmr 3, 2
49 ; CHECK-NEXT: addis 3, 2, .LCPI2_0@toc@ha
50 ; CHECK-NEXT: std 0, 128(1)
51 ; CHECK-NEXT: lfs 2, .LCPI2_0@toc@l(3)
52 ; CHECK-NEXT: bl copysignl
54 ; CHECK-NEXT: addi 1, 1, 112
55 ; CHECK-NEXT: ld 0, 16(1)
59 ; CHECK-VSX-LABEL: foo_ll:
60 ; CHECK-VSX: # %bb.0: # %entry
61 ; CHECK-VSX-NEXT: mflr 0
62 ; CHECK-VSX-NEXT: stdu 1, -112(1)
63 ; CHECK-VSX-NEXT: fmr 3, 2
64 ; CHECK-VSX-NEXT: xxlxor 2, 2, 2
65 ; CHECK-VSX-NEXT: std 0, 128(1)
66 ; CHECK-VSX-NEXT: bl copysignl
68 ; CHECK-VSX-NEXT: addi 1, 1, 112
69 ; CHECK-VSX-NEXT: ld 0, 16(1)
70 ; CHECK-VSX-NEXT: mtlr 0
73 %conv = fpext double %a to ppc_fp128
74 %call = tail call ppc_fp128 @copysignl(ppc_fp128 %conv, ppc_fp128 %b) #0
78 define ppc_fp128 @foo_ld(double %a, double %b) #0 {
79 ; CHECK-LABEL: foo_ld:
80 ; CHECK: # %bb.0: # %entry
82 ; CHECK-NEXT: stdu 1, -112(1)
83 ; CHECK-NEXT: fmr 3, 2
84 ; CHECK-NEXT: addis 3, 2, .LCPI3_0@toc@ha
85 ; CHECK-NEXT: std 0, 128(1)
86 ; CHECK-NEXT: lfs 2, .LCPI3_0@toc@l(3)
87 ; CHECK-NEXT: bl copysignl
89 ; CHECK-NEXT: addi 1, 1, 112
90 ; CHECK-NEXT: ld 0, 16(1)
94 ; CHECK-VSX-LABEL: foo_ld:
95 ; CHECK-VSX: # %bb.0: # %entry
96 ; CHECK-VSX-NEXT: mflr 0
97 ; CHECK-VSX-NEXT: stdu 1, -112(1)
98 ; CHECK-VSX-NEXT: fmr 3, 2
99 ; CHECK-VSX-NEXT: xxlxor 2, 2, 2
100 ; CHECK-VSX-NEXT: std 0, 128(1)
101 ; CHECK-VSX-NEXT: bl copysignl
102 ; CHECK-VSX-NEXT: nop
103 ; CHECK-VSX-NEXT: addi 1, 1, 112
104 ; CHECK-VSX-NEXT: ld 0, 16(1)
105 ; CHECK-VSX-NEXT: mtlr 0
106 ; CHECK-VSX-NEXT: blr
108 %conv = fpext double %a to ppc_fp128
109 %conv1 = fpext double %b to ppc_fp128
110 %call = tail call ppc_fp128 @copysignl(ppc_fp128 %conv, ppc_fp128 %conv1) #0
114 define ppc_fp128 @foo_lf(double %a, float %b) #0 {
115 ; CHECK-LABEL: foo_lf:
116 ; CHECK: # %bb.0: # %entry
118 ; CHECK-NEXT: stdu 1, -112(1)
119 ; CHECK-NEXT: fmr 3, 2
120 ; CHECK-NEXT: addis 3, 2, .LCPI4_0@toc@ha
121 ; CHECK-NEXT: std 0, 128(1)
122 ; CHECK-NEXT: lfs 2, .LCPI4_0@toc@l(3)
123 ; CHECK-NEXT: bl copysignl
125 ; CHECK-NEXT: addi 1, 1, 112
126 ; CHECK-NEXT: ld 0, 16(1)
130 ; CHECK-VSX-LABEL: foo_lf:
131 ; CHECK-VSX: # %bb.0: # %entry
132 ; CHECK-VSX-NEXT: mflr 0
133 ; CHECK-VSX-NEXT: stdu 1, -112(1)
134 ; CHECK-VSX-NEXT: fmr 3, 2
135 ; CHECK-VSX-NEXT: xxlxor 2, 2, 2
136 ; CHECK-VSX-NEXT: std 0, 128(1)
137 ; CHECK-VSX-NEXT: bl copysignl
138 ; CHECK-VSX-NEXT: nop
139 ; CHECK-VSX-NEXT: addi 1, 1, 112
140 ; CHECK-VSX-NEXT: ld 0, 16(1)
141 ; CHECK-VSX-NEXT: mtlr 0
142 ; CHECK-VSX-NEXT: blr
144 %conv = fpext double %a to ppc_fp128
145 %conv1 = fpext float %b to ppc_fp128
146 %call = tail call ppc_fp128 @copysignl(ppc_fp128 %conv, ppc_fp128 %conv1) #0
150 attributes #0 = { nounwind readnone }