Chris Lattner | 446a4ea | 2005-09-02 18:32:22 +0000 | [diff] [blame] | 1 | ; fsqrt should be generated when the fsqrt feature is enabled, but not |
| 2 | ; otherwise. |
| 3 | |
Dan Gohman | b7c0b24 | 2009-09-11 18:36:27 +0000 | [diff] [blame^] | 4 | ; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin8 -mattr=+fsqrt | \ |
Reid Spencer | c58ef01 | 2007-04-15 21:17:45 +0000 | [diff] [blame] | 5 | ; RUN: grep {fsqrt f1, f1} |
Dan Gohman | b7c0b24 | 2009-09-11 18:36:27 +0000 | [diff] [blame^] | 6 | ; 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 Spencer | c58ef01 | 2007-04-15 21:17:45 +0000 | [diff] [blame] | 9 | ; RUN: not grep {fsqrt f1, f1} |
Dan Gohman | b7c0b24 | 2009-09-11 18:36:27 +0000 | [diff] [blame^] | 10 | ; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin8 -mcpu=g4 | \ |
Reid Spencer | c58ef01 | 2007-04-15 21:17:45 +0000 | [diff] [blame] | 11 | ; RUN: not grep {fsqrt f1, f1} |
Chris Lattner | 446a4ea | 2005-09-02 18:32:22 +0000 | [diff] [blame] | 12 | |
Tanya Lattner | cfab3da | 2008-02-19 08:07:33 +0000 | [diff] [blame] | 13 | declare double @llvm.sqrt.f64(double) |
| 14 | |
| 15 | define double @X(double %Y) { |
| 16 | %Z = call double @llvm.sqrt.f64( double %Y ) ; <double> [#uses=1] |
| 17 | ret double %Z |
Chris Lattner | 446a4ea | 2005-09-02 18:32:22 +0000 | [diff] [blame] | 18 | } |
Tanya Lattner | cfab3da | 2008-02-19 08:07:33 +0000 | [diff] [blame] | 19 | |