xref: /aosp_15_r20/external/llvm/test/CodeGen/PowerPC/fsqrt.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; fsqrt should be generated when the fsqrt feature is enabled, but not
2*9880d681SAndroid Build Coastguard Worker; otherwise.
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mattr=-vsx -march=ppc32 -mtriple=powerpc-apple-darwin8 -mattr=+fsqrt | \
5*9880d681SAndroid Build Coastguard Worker; RUN:   grep "fsqrt f1, f1"
6*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mattr=-vsx -march=ppc32 -mtriple=powerpc-apple-darwin8 -mcpu=g5 | \
7*9880d681SAndroid Build Coastguard Worker; RUN:   grep "fsqrt f1, f1"
8*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mattr=-vsx -march=ppc32 -mtriple=powerpc-apple-darwin8 -mattr=-fsqrt | \
9*9880d681SAndroid Build Coastguard Worker; RUN:   not grep "fsqrt f1, f1"
10*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mattr=-vsx -march=ppc32 -mtriple=powerpc-apple-darwin8 -mcpu=g4 | \
11*9880d681SAndroid Build Coastguard Worker; RUN:   not grep "fsqrt f1, f1"
12*9880d681SAndroid Build Coastguard Worker
13*9880d681SAndroid Build Coastguard Workerdeclare double @llvm.sqrt.f64(double)
14*9880d681SAndroid Build Coastguard Worker
15*9880d681SAndroid Build Coastguard Workerdefine double @X(double %Y) {
16*9880d681SAndroid Build Coastguard Worker        %Z = call double @llvm.sqrt.f64( double %Y )            ; <double> [#uses=1]
17*9880d681SAndroid Build Coastguard Worker        ret double %Z
18*9880d681SAndroid Build Coastguard Worker}
19*9880d681SAndroid Build Coastguard Worker
20