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 {
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)
16 ; X64-LABEL: fneg_strict_fadd_to_strict_fsub:
18 ; X64-NEXT: subss %xmm1, %xmm0
21 %add = call float @llvm.experimental.constrained.fadd.f32(float %x, float %neg, metadata!"round.dynamic", metadata!"fpexcept.strict")
25 define float @fneg_strict_fadd_to_strict_fsub_2(float %x, float %y) nounwind {
26 ; X86-LABEL: fneg_strict_fadd_to_strict_fsub_2:
28 ; X86-NEXT: pushl %eax
29 ; X86-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
30 ; X86-NEXT: subss {{[0-9]+}}(%esp), %xmm0
31 ; X86-NEXT: movss %xmm0, (%esp)
32 ; X86-NEXT: flds (%esp)
36 ; X64-LABEL: fneg_strict_fadd_to_strict_fsub_2:
38 ; X64-NEXT: subss %xmm1, %xmm0
41 %add = call float @llvm.experimental.constrained.fadd.f32(float %neg, float %x, metadata!"round.dynamic", metadata!"fpexcept.strict")
45 define double @fneg_strict_fadd_to_strict_fsub_d(double %x, double %y) nounwind {
46 ; X86-LABEL: fneg_strict_fadd_to_strict_fsub_d:
48 ; X86-NEXT: pushl %ebp
49 ; X86-NEXT: movl %esp, %ebp
50 ; X86-NEXT: andl $-8, %esp
51 ; X86-NEXT: subl $8, %esp
52 ; X86-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
53 ; X86-NEXT: subsd 16(%ebp), %xmm0
54 ; X86-NEXT: movsd %xmm0, (%esp)
55 ; X86-NEXT: fldl (%esp)
56 ; X86-NEXT: movl %ebp, %esp
60 ; X64-LABEL: fneg_strict_fadd_to_strict_fsub_d:
62 ; X64-NEXT: subsd %xmm1, %xmm0
65 %add = call double @llvm.experimental.constrained.fadd.f64(double %x, double %neg, metadata!"round.dynamic", metadata!"fpexcept.strict")
69 define double @fneg_strict_fadd_to_strict_fsub_2d(double %x, double %y) nounwind {
70 ; X86-LABEL: fneg_strict_fadd_to_strict_fsub_2d:
72 ; X86-NEXT: pushl %ebp
73 ; X86-NEXT: movl %esp, %ebp
74 ; X86-NEXT: andl $-8, %esp
75 ; X86-NEXT: subl $8, %esp
76 ; X86-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
77 ; X86-NEXT: subsd 16(%ebp), %xmm0
78 ; X86-NEXT: movsd %xmm0, (%esp)
79 ; X86-NEXT: fldl (%esp)
80 ; X86-NEXT: movl %ebp, %esp
84 ; X64-LABEL: fneg_strict_fadd_to_strict_fsub_2d:
86 ; X64-NEXT: subsd %xmm1, %xmm0
89 %add = call double @llvm.experimental.constrained.fadd.f64(double %neg, double %x, metadata!"round.dynamic", metadata!"fpexcept.strict")
94 declare float @llvm.experimental.constrained.fadd.f32(float, float, metadata, metadata)
95 declare double @llvm.experimental.constrained.fadd.f64(double, double, metadata, metadata)