blob: bf8c4a22c95f87e0c3efc98d2333fdc7069d7dd5 [file] [log] [blame]
Chris Lattner446a4ea2005-09-02 18:32:22 +00001; fsqrt should be generated when the fsqrt feature is enabled, but not
2; otherwise.
3
Dan Gohmanb7c0b242009-09-11 18:36:27 +00004; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin8 -mattr=+fsqrt | \
Chandler Carruth4177e6f2012-07-02 12:47:22 +00005; RUN: grep "fsqrt f1, f1"
Dan Gohmanb7c0b242009-09-11 18:36:27 +00006; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin8 -mcpu=g5 | \
Chandler Carruth4177e6f2012-07-02 12:47:22 +00007; RUN: grep "fsqrt f1, f1"
Dan Gohmanb7c0b242009-09-11 18:36:27 +00008; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin8 -mattr=-fsqrt | \
Chandler Carruth4177e6f2012-07-02 12:47:22 +00009; RUN: not grep "fsqrt f1, f1"
Dan Gohmanb7c0b242009-09-11 18:36:27 +000010; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin8 -mcpu=g4 | \
Chandler Carruth4177e6f2012-07-02 12:47:22 +000011; RUN: not grep "fsqrt f1, f1"
Chris Lattner446a4ea2005-09-02 18:32:22 +000012
Tanya Lattnercfab3da2008-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 Lattner446a4ea2005-09-02 18:32:22 +000018}
Tanya Lattnercfab3da2008-02-19 08:07:33 +000019