1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+sse2 | FileCheck %s --check-prefixes=X86
3 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse2 | FileCheck %s --check-prefixes=X64
5 define float @fneg_strict_fadd_to_strict_fsub(float %x, float %y) nounwind strictfp {
6 ; X86-LABEL: fneg_strict_fadd_to_strict_fsub:
9 ; X86-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
10 ; X86-NEXT: subss {{[0-9]+}}(%esp), %xmm0
11 ; X86-NEXT: movss %xmm0, (%esp)
12 ; X86-NEXT: flds (%esp)
17 ; X64-LABEL: fneg_strict_fadd_to_strict_fsub:
19 ; X64-NEXT: subss %xmm1, %xmm0
22 %add = call float @llvm.experimental.constrained.fadd.f32(float %x, float %neg, metadata!"round.dynamic", metadata!"fpexcept.strict")
26 define float @fneg_strict_fadd_to_strict_fsub_2(float %x, float %y) nounwind strictfp {
27 ; X86-LABEL: fneg_strict_fadd_to_strict_fsub_2:
29 ; X86-NEXT: pushl %eax
30 ; X86-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
31 ; X86-NEXT: subss {{[0-9]+}}(%esp), %xmm0
32 ; X86-NEXT: movss %xmm0, (%esp)
33 ; X86-NEXT: flds (%esp)
38 ; X64-LABEL: fneg_strict_fadd_to_strict_fsub_2:
40 ; X64-NEXT: subss %xmm1, %xmm0
43 %add = call float @llvm.experimental.constrained.fadd.f32(float %neg, float %x, metadata!"round.dynamic", metadata!"fpexcept.strict")
47 define double @fneg_strict_fadd_to_strict_fsub_d(double %x, double %y) nounwind strictfp {
48 ; X86-LABEL: fneg_strict_fadd_to_strict_fsub_d:
50 ; X86-NEXT: pushl %ebp
51 ; X86-NEXT: movl %esp, %ebp
52 ; X86-NEXT: andl $-8, %esp
53 ; X86-NEXT: subl $8, %esp
54 ; X86-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
55 ; X86-NEXT: subsd 16(%ebp), %xmm0
56 ; X86-NEXT: movsd %xmm0, (%esp)
57 ; X86-NEXT: fldl (%esp)
59 ; X86-NEXT: movl %ebp, %esp
63 ; X64-LABEL: fneg_strict_fadd_to_strict_fsub_d:
65 ; X64-NEXT: subsd %xmm1, %xmm0
68 %add = call double @llvm.experimental.constrained.fadd.f64(double %x, double %neg, metadata!"round.dynamic", metadata!"fpexcept.strict")
72 define double @fneg_strict_fadd_to_strict_fsub_2d(double %x, double %y) nounwind strictfp {
73 ; X86-LABEL: fneg_strict_fadd_to_strict_fsub_2d:
75 ; X86-NEXT: pushl %ebp
76 ; X86-NEXT: movl %esp, %ebp
77 ; X86-NEXT: andl $-8, %esp
78 ; X86-NEXT: subl $8, %esp
79 ; X86-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
80 ; X86-NEXT: subsd 16(%ebp), %xmm0
81 ; X86-NEXT: movsd %xmm0, (%esp)
82 ; X86-NEXT: fldl (%esp)
84 ; X86-NEXT: movl %ebp, %esp
88 ; X64-LABEL: fneg_strict_fadd_to_strict_fsub_2d:
90 ; X64-NEXT: subsd %xmm1, %xmm0
93 %add = call double @llvm.experimental.constrained.fadd.f64(double %neg, double %x, metadata!"round.dynamic", metadata!"fpexcept.strict")
98 declare float @llvm.experimental.constrained.fadd.f32(float, float, metadata, metadata)
99 declare double @llvm.experimental.constrained.fadd.f64(double, double, metadata, metadata)