blob: 74a8725eb12e30a4e3ee2c3ad544b2d6e189bb1f [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; fsqrt should be generated when the fsqrt feature is enabled, but not
2; otherwise.
3
Dan Gohman0cb2f672009-09-11 18:36:27 +00004; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin8 -mattr=+fsqrt | \
Dan Gohmanf17a25c2007-07-18 16:29:46 +00005; RUN: grep {fsqrt f1, f1}
Dan Gohman0cb2f672009-09-11 18:36:27 +00006; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin8 -mcpu=g5 | \
7; RUN: grep {fsqrt f1, f1}
8; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin8 -mattr=-fsqrt | \
Dan Gohmanf17a25c2007-07-18 16:29:46 +00009; RUN: not grep {fsqrt f1, f1}
Dan Gohman0cb2f672009-09-11 18:36:27 +000010; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin8 -mcpu=g4 | \
Dan Gohmanf17a25c2007-07-18 16:29:46 +000011; RUN: not grep {fsqrt f1, f1}
12
Tanya Lattner5ebaf3b2008-02-19 08:07:33 +000013declare double @llvm.sqrt.f64(double)
14
15define double @X(double %Y) {
16 %Z = call double @llvm.sqrt.f64( double %Y ) ; <double> [#uses=1]
17 ret double %Z
Dan Gohmanf17a25c2007-07-18 16:29:46 +000018}
Tanya Lattner5ebaf3b2008-02-19 08:07:33 +000019