1 ; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64-unknown-linux-gnu -mcpu=a2q -enable-unsafe-fp-math | FileCheck %s
2 ; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64-unknown-linux-gnu -mcpu=a2q | FileCheck -check-prefix=CHECK-SAFE %s
3 target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f128:128:128-v128:128:128-n32:64"
4 target triple = "powerpc64-unknown-linux-gnu"
6 declare <4 x double> @llvm.sqrt.v4f64(<4 x double>)
7 declare <4 x float> @llvm.sqrt.v4f32(<4 x float>)
9 define <4 x double> @foo(<4 x double> %a, <4 x double> %b) nounwind {
11 %x = call <4 x double> @llvm.sqrt.v4f64(<4 x double> %b)
12 %r = fdiv <4 x double> %a, %x
18 ; FIXME: We're currently loading two constants here (1.5 and -1.5), and using
19 ; an qvfmadd instead of a qvfnmsub
29 ; CHECK-SAFE-LABEL: @foo
35 define <4 x double> @foof(<4 x double> %a, <4 x float> %b) nounwind {
37 %x = call <4 x float> @llvm.sqrt.v4f32(<4 x float> %b)
38 %y = fpext <4 x float> %x to <4 x double>
39 %r = fdiv <4 x double> %a, %y
45 ; FIXME: We're currently loading two constants here (1.5 and -1.5), and using
46 ; an qvfmadd instead of a qvfnmsubs
53 ; CHECK-SAFE-LABEL: @foof
59 define <4 x float> @food(<4 x float> %a, <4 x double> %b) nounwind {
61 %x = call <4 x double> @llvm.sqrt.v4f64(<4 x double> %b)
62 %y = fptrunc <4 x double> %x to <4 x float>
63 %r = fdiv <4 x float> %a, %y
69 ; FIXME: We're currently loading two constants here (1.5 and -1.5), and using
70 ; an qvfmadd instead of a qvfnmsub
81 ; CHECK-SAFE-LABEL: @food
87 define <4 x float> @goo(<4 x float> %a, <4 x float> %b) nounwind {
89 %x = call <4 x float> @llvm.sqrt.v4f32(<4 x float> %b)
90 %r = fdiv <4 x float> %a, %x
96 ; FIXME: We're currently loading two constants here (1.5 and -1.5), and using
97 ; an qvfmadd instead of a qvfnmsubs
104 ; CHECK-SAFE-LABEL: @goo
110 define <4 x double> @foo2(<4 x double> %a, <4 x double> %b) nounwind {
112 %r = fdiv <4 x double> %a, %b
124 ; CHECK-SAFE-LABEL: @foo2
129 define <4 x float> @goo2(<4 x float> %a, <4 x float> %b) nounwind {
131 %r = fdiv <4 x float> %a, %b
141 ; CHECK-SAFE-LABEL: @goo2
146 define <4 x double> @foo3(<4 x double> %a) nounwind {
148 %r = call <4 x double> @llvm.sqrt.v4f64(<4 x double> %a)
154 ; FIXME: We're currently loading two constants here (1.5 and -1.5), and using
155 ; an qvfmadd instead of a qvfnmsub
157 ; CHECK-DAG: qvfcmpeq
167 ; CHECK-SAFE-LABEL: @foo3
172 define <4 x float> @goo3(<4 x float> %a) nounwind {
174 %r = call <4 x float> @llvm.sqrt.v4f32(<4 x float> %a)
180 ; FIXME: We're currently loading two constants here (1.5 and -1.5), and using
181 ; an qvfmadds instead of a qvfnmsubs
182 ; CHECK-DAG: qvfmadds
183 ; CHECK-DAG: qvfcmpeq
184 ; CHECK-DAG: qvfmadds
190 ; CHECK-SAFE-LABEL: @goo3