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