• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s
2
3define float @fneg_strict_fadd_to_strict_fsub(float %x, float %y) {
4  ; CHECK: subss %{{.*}}, %{{.*}}
5  ; CHECK-NEXT: retq
6  %neg = fneg float %y
7  %add = call float @llvm.experimental.constrained.fadd.f32(float %x, float %neg, metadata!"round.dynamic", metadata!"fpexcept.strict")
8  ret float %add
9}
10
11define float @fneg_strict_fadd_to_strict_fsub_2(float %x, float %y) {
12  ; CHECK: subss %{{.*}}, %{{.*}}
13  ; CHECK-NEXT: retq
14  %neg = fneg float %y
15  %add = call float @llvm.experimental.constrained.fadd.f32(float %neg, float %x, metadata!"round.dynamic", metadata!"fpexcept.strict")
16  ret float %add
17}
18
19define double @fneg_strict_fadd_to_strict_fsub_d(double %x, double %y) {
20  ; CHECK: subsd %{{.*}}, %{{.*}}
21  ; CHECK-NEXT: retq
22  %neg = fneg double %y
23  %add = call double @llvm.experimental.constrained.fadd.f64(double %x, double %neg, metadata!"round.dynamic", metadata!"fpexcept.strict")
24  ret double %add
25}
26
27define double @fneg_strict_fadd_to_strict_fsub_2d(double %x, double %y) {
28  ; CHECK: subsd %{{.*}}, %{{.*}}
29  ; CHECK-NEXT: retq
30  %neg = fneg double %y
31  %add = call double @llvm.experimental.constrained.fadd.f64(double %neg, double %x, metadata!"round.dynamic", metadata!"fpexcept.strict")
32  ret double %add
33}
34
35
36declare float @llvm.experimental.constrained.fadd.f32(float, float, metadata, metadata)
37declare double @llvm.experimental.constrained.fadd.f64(double, double, metadata, metadata)
38