blob: 019dfa4e67b6432a2ceecde5136abbfd9edf1477 [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
Bill Schmidt32e9c642014-10-17 01:41:22 +00004; RUN: llc < %s -mattr=-vsx -march=ppc32 -mtriple=powerpc-apple-darwin8 -mattr=+fsqrt | \
Chandler Carrutha5a29f92012-07-02 12:47:22 +00005; RUN: grep "fsqrt f1, f1"
Bill Schmidt32e9c642014-10-17 01:41:22 +00006; RUN: llc < %s -mattr=-vsx -march=ppc32 -mtriple=powerpc-apple-darwin8 -mcpu=g5 | \
Chandler Carrutha5a29f92012-07-02 12:47:22 +00007; RUN: grep "fsqrt f1, f1"
Bill Schmidt32e9c642014-10-17 01:41:22 +00008; RUN: llc < %s -mattr=-vsx -march=ppc32 -mtriple=powerpc-apple-darwin8 -mattr=-fsqrt | \
Chandler Carrutha5a29f92012-07-02 12:47:22 +00009; RUN: not grep "fsqrt f1, f1"
Bill Schmidt32e9c642014-10-17 01:41:22 +000010; RUN: llc < %s -mattr=-vsx -march=ppc32 -mtriple=powerpc-apple-darwin8 -mcpu=g4 | \
Chandler Carrutha5a29f92012-07-02 12:47:22 +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