1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-unknown -mattr=-sse2,+sse | FileCheck %s --check-prefix=ALL --check-prefix=X86
3 ; RUN: llc < %s -mtriple=x86_64-unknown -mattr=-sse2,+sse | FileCheck %s --check-prefix=ALL --check-prefix=X64
5 define float @f32_pos(float %a, float %b) nounwind {
9 ; X86-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
10 ; X86-NEXT: andps {{\.LCPI.*}}, %xmm0
11 ; X86-NEXT: movss %xmm0, (%esp)
12 ; X86-NEXT: flds (%esp)
18 ; X64-NEXT: andps {{.*}}(%rip), %xmm0
20 %tmp = tail call float @llvm.copysign.f32(float %a, float 1.0)
24 define float @f32_neg(float %a, float %b) nounwind {
27 ; X86-NEXT: pushl %eax
28 ; X86-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
29 ; X86-NEXT: orps {{\.LCPI.*}}, %xmm0
30 ; X86-NEXT: movss %xmm0, (%esp)
31 ; X86-NEXT: flds (%esp)
37 ; X64-NEXT: orps {{.*}}(%rip), %xmm0
39 %tmp = tail call float @llvm.copysign.f32(float %a, float -1.0)
43 define <4 x float> @v4f32_pos(<4 x float> %a, <4 x float> %b) nounwind {
44 ; X86-LABEL: v4f32_pos:
46 ; X86-NEXT: andps {{\.LCPI.*}}, %xmm0
49 ; X64-LABEL: v4f32_pos:
51 ; X64-NEXT: andps {{.*}}(%rip), %xmm0
53 %tmp = tail call <4 x float> @llvm.copysign.v4f32(<4 x float> %a, <4 x float> <float 1.0, float 1.0, float 1.0, float 1.0>)
57 define <4 x float> @v4f32_neg(<4 x float> %a, <4 x float> %b) nounwind {
58 ; X86-LABEL: v4f32_neg:
60 ; X86-NEXT: orps {{\.LCPI.*}}, %xmm0
63 ; X64-LABEL: v4f32_neg:
65 ; X64-NEXT: orps {{.*}}(%rip), %xmm0
67 %tmp = tail call <4 x float> @llvm.copysign.v4f32(<4 x float> %a, <4 x float> <float -1.0, float -1.0, float -1.0, float -1.0>)
71 define <4 x float> @v4f32_const_mag(<4 x float> %a, <4 x float> %b) nounwind {
72 ; X86-LABEL: v4f32_const_mag:
74 ; X86-NEXT: movaps %xmm1, %xmm0
75 ; X86-NEXT: andps {{\.LCPI.*}}, %xmm0
76 ; X86-NEXT: orps {{\.LCPI.*}}, %xmm0
79 ; X64-LABEL: v4f32_const_mag:
81 ; X64-NEXT: movaps %xmm1, %xmm0
82 ; X64-NEXT: andps {{.*}}(%rip), %xmm0
83 ; X64-NEXT: orps {{.*}}(%rip), %xmm0
85 %tmp = tail call <4 x float> @llvm.copysign.v4f32(<4 x float> <float 1.0, float 1.0, float 1.0, float 1.0>, <4 x float> %b )
89 declare float @llvm.copysign.f32(float, float)
90 declare <4 x float> @llvm.copysign.v4f32(<4 x float>, <4 x float>)