1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=x86_64-apple-macosx10.10.0 < %s | FileCheck %s
4 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
6 ; The assertions are *enhanced* from update_test_checks.ll to include
7 ; the constant load values because those are important.
9 ; CHECK: [[SIGNMASK1:L.+]]:
10 ; CHECK-NEXT: .quad 0x8000000000000000 ## double -0
11 ; CHECK-NEXT: .quad 0x8000000000000000 ## double -0
13 define double @mag_pos0_double(double %x) nounwind {
14 ; CHECK-LABEL: mag_pos0_double:
16 ; CHECK-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
18 %y = call double @copysign(double 0.0, double %x)
22 ; CHECK: [[SIGNMASK2:L.+]]:
23 ; CHECK-NEXT: .quad 0x8000000000000000 ## double -0
25 define double @mag_neg0_double(double %x) nounwind {
26 ; CHECK-LABEL: mag_neg0_double:
28 ; CHECK-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
30 %y = call double @copysign(double -0.0, double %x)
34 ; CHECK: [[SIGNMASK3:L.+]]:
35 ; CHECK-NEXT: .quad 0x8000000000000000 ## double -0
36 ; CHECK-NEXT: .quad 0x8000000000000000 ## double -0
37 ; CHECK: [[ONE3:L.+]]:
38 ; CHECK-NEXT: .quad 0x3ff0000000000000 ## double 1
40 define double @mag_pos1_double(double %x) nounwind {
41 ; CHECK-LABEL: mag_pos1_double:
43 ; CHECK-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
44 ; CHECK-NEXT: orps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
46 %y = call double @copysign(double 1.0, double %x)
50 ; CHECK: [[SIGNMASK4:L.+]]:
51 ; CHECK-NEXT: .quad 0x8000000000000000 ## double -0
52 ; CHECK-NEXT: .quad 0x8000000000000000 ## double -0
53 ; CHECK: [[ONE4:L.+]]:
54 ; CHECK-NEXT: .quad 0x3ff0000000000000 ## double 1
55 ; CHECK-NEXT: .quad 0x3ff0000000000000 ## double 1
57 define double @mag_neg1_double(double %x) nounwind {
58 ; CHECK-LABEL: mag_neg1_double:
60 ; CHECK-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
61 ; CHECK-NEXT: orps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
63 %y = call double @copysign(double -1.0, double %x)
67 ; CHECK: [[SIGNMASK5:L.+]]:
68 ; CHECK-NEXT: .long 0x80000000 ## float -0
69 ; CHECK-NEXT: .long 0x80000000 ## float -0
70 ; CHECK-NEXT: .long 0x80000000 ## float -0
71 ; CHECK-NEXT: .long 0x80000000 ## float -0
73 define float @mag_pos0_float(float %x) nounwind {
74 ; CHECK-LABEL: mag_pos0_float:
76 ; CHECK-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
78 %y = call float @copysignf(float 0.0, float %x)
82 ; CHECK: [[SIGNMASK6:L.+]]:
83 ; CHECK-NEXT: .long 0x80000000 ## float -0
85 define float @mag_neg0_float(float %x) nounwind {
86 ; CHECK-LABEL: mag_neg0_float:
88 ; CHECK-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
90 %y = call float @copysignf(float -0.0, float %x)
94 ; CHECK: [[SIGNMASK7:L.+]]:
95 ; CHECK-NEXT: .long 0x80000000 ## float -0
96 ; CHECK-NEXT: .long 0x80000000 ## float -0
97 ; CHECK-NEXT: .long 0x80000000 ## float -0
98 ; CHECK-NEXT: .long 0x80000000 ## float -0
99 ; CHECK: [[ONE7:L.+]]:
100 ; CHECK-NEXT: .long 0x3f800000 ## float 1
102 define float @mag_pos1_float(float %x) nounwind {
103 ; CHECK-LABEL: mag_pos1_float:
105 ; CHECK-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
106 ; CHECK-NEXT: orps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
108 %y = call float @copysignf(float 1.0, float %x)
112 ; CHECK: [[SIGNMASK8:L.+]]:
113 ; CHECK-NEXT: .long 0x80000000 ## float -0
114 ; CHECK-NEXT: .long 0x80000000 ## float -0
115 ; CHECK-NEXT: .long 0x80000000 ## float -0
116 ; CHECK-NEXT: .long 0x80000000 ## float -0
117 ; CHECK: [[ONE8:L.+]]:
118 ; CHECK-NEXT: .long 0x3f800000 ## float 1
119 ; CHECK-NEXT: .long 0x3f800000 ## float 1
120 ; CHECK-NEXT: .long 0x3f800000 ## float 1
121 ; CHECK-NEXT: .long 0x3f800000 ## float 1
123 define float @mag_neg1_float(float %x) nounwind {
124 ; CHECK-LABEL: mag_neg1_float:
126 ; CHECK-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
127 ; CHECK-NEXT: orps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
129 %y = call float @copysignf(float -1.0, float %x)
133 declare double @copysign(double, double) nounwind readnone
134 declare float @copysignf(float, float) nounwind readnone