blob: 74a8725eb12e30a4e3ee2c3ad544b2d6e189bb1f [file] [log] [blame]
Chris Lattnerffb99032005-09-02 18:32:22 +00001; fsqrt should be generated when the fsqrt feature is enabled, but not
2; otherwise.
3
Dan Gohmana0801592009-09-11 18:36:27 +00004; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin8 -mattr=+fsqrt | \
Reid Spencer297657d2007-04-15 21:17:45 +00005; RUN: grep {fsqrt f1, f1}
Dan Gohmana0801592009-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 | \
Reid Spencer297657d2007-04-15 21:17:45 +00009; RUN: not grep {fsqrt f1, f1}
Dan Gohmana0801592009-09-11 18:36:27 +000010; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin8 -mcpu=g4 | \
Reid Spencer297657d2007-04-15 21:17:45 +000011; RUN: not grep {fsqrt f1, f1}
Chris Lattnerffb99032005-09-02 18:32:22 +000012
Tanya Lattnera99d8b52008-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
Chris Lattnerffb99032005-09-02 18:32:22 +000018}
Tanya Lattnera99d8b52008-02-19 08:07:33 +000019