2 ; RUN: llvm-as %s -o %t.o
4 ;; Verify that LTO behavior can be tweaked using -mattr.
6 ; RUN: %lld -mcpu haswell -mllvm -mattr=+fma %t.o -o %t.dylib -dylib
7 ; RUN: llvm-objdump --no-print-imm-hex -d --section="__text" --no-leading-addr --no-show-raw-insn %t.dylib | FileCheck %s --check-prefix=FMA
9 ; RUN: %lld -mcpu haswell -mllvm -mattr=-fma %t.o -o %t.dylib -dylib
10 ; RUN: llvm-objdump --no-print-imm-hex -d --section="__text" --no-leading-addr --no-show-raw-insn %t.dylib | FileCheck %s --check-prefix=NO-FMA
13 ; FMA-NEXT: vrcpss %xmm0, %xmm0, %xmm1
14 ; FMA-NEXT: vfmsub213ss [[#]](%rip), %xmm1, %xmm0 ## xmm0 = (xmm1 * xmm0) - mem
16 ; FMA-NEXT: vfnmadd132ss %xmm1, %xmm1, %xmm0
20 ; NO-FMA-NEXT: vrcpss %xmm0, %xmm0, %xmm1
21 ; NO-FMA-NEXT: vmulss %xmm1, %xmm0, %xmm0
22 ; NO-FMA-NEXT: vmovss [[#]](%rip), %xmm2 ## xmm2 =
24 ; NO-FMA-NEXT: vsubss %xmm0, %xmm2, %xmm0
25 ; NO-FMA-NEXT: vmulss %xmm0, %xmm1, %xmm0
26 ; NO-FMA-NEXT: vaddss %xmm0, %xmm1, %xmm0
29 target triple = "x86_64-apple-darwin"
30 target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
32 define float @foo(float %x) #0 {
33 %div = fdiv fast float 1.0, %x
37 attributes #0 = { "unsafe-fp-math"="true" "reciprocal-estimates"="divf,vec-divf" }