Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 1 | ; fsqrt should be generated when the fsqrt feature is enabled, but not |
| 2 | ; otherwise. |
| 3 | |
Dan Gohman | 0cb2f67 | 2009-09-11 18:36:27 +0000 | [diff] [blame] | 4 | ; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin8 -mattr=+fsqrt | \ |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 5 | ; RUN: grep {fsqrt f1, f1} |
Dan Gohman | 0cb2f67 | 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 | \ |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 9 | ; RUN: not grep {fsqrt f1, f1} |
Dan Gohman | 0cb2f67 | 2009-09-11 18:36:27 +0000 | [diff] [blame] | 10 | ; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin8 -mcpu=g4 | \ |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 11 | ; RUN: not grep {fsqrt f1, f1} |
| 12 | |
Tanya Lattner | 5ebaf3b | 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 |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 18 | } |
Tanya Lattner | 5ebaf3b | 2008-02-19 08:07:33 +0000 | [diff] [blame] | 19 | |