xref: /aosp_15_r20/external/llvm/test/CodeGen/Mips/optimize-fp-math.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc -march=mipsel < %s | FileCheck %s -check-prefix=32
2*9880d681SAndroid Build Coastguard Worker; RUN: llc -march=mips64el -mcpu=mips4 < %s | FileCheck %s -check-prefix=64
3*9880d681SAndroid Build Coastguard Worker; RUN: llc -march=mips64el -mcpu=mips64 < %s | FileCheck %s -check-prefix=64
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Worker; 32-LABEL: test_sqrtf_float_:
6*9880d681SAndroid Build Coastguard Worker; 32: sqrt.s $f[[R0:[0-9]+]], $f{{[0-9]+}}
7*9880d681SAndroid Build Coastguard Worker; 32: c.un.s $f[[R0]], $f[[R0]]
8*9880d681SAndroid Build Coastguard Worker; 64-LABEL: test_sqrtf_float_:
9*9880d681SAndroid Build Coastguard Worker; 64: sqrt.s $f[[R0:[0-9]+]], $f{{[0-9]+}}
10*9880d681SAndroid Build Coastguard Worker; 64: c.un.s $f[[R0]], $f[[R0]]
11*9880d681SAndroid Build Coastguard Worker
12*9880d681SAndroid Build Coastguard Workerdefine float @test_sqrtf_float_(float %a) {
13*9880d681SAndroid Build Coastguard Workerentry:
14*9880d681SAndroid Build Coastguard Worker  %call = tail call float @sqrtf(float %a)
15*9880d681SAndroid Build Coastguard Worker  ret float %call
16*9880d681SAndroid Build Coastguard Worker}
17*9880d681SAndroid Build Coastguard Worker
18*9880d681SAndroid Build Coastguard Workerdeclare float @sqrtf(float)
19*9880d681SAndroid Build Coastguard Worker
20*9880d681SAndroid Build Coastguard Worker; 32-LABEL: test_sqrt_double_:
21*9880d681SAndroid Build Coastguard Worker; 32: sqrt.d $f[[R0:[0-9]+]], $f{{[0-9]+}}
22*9880d681SAndroid Build Coastguard Worker; 32: c.un.d $f[[R0]], $f[[R0]]
23*9880d681SAndroid Build Coastguard Worker; 64-LABEL: test_sqrt_double_:
24*9880d681SAndroid Build Coastguard Worker; 64: sqrt.d $f[[R0:[0-9]+]], $f{{[0-9]+}}
25*9880d681SAndroid Build Coastguard Worker; 64: c.un.d $f[[R0]], $f[[R0]]
26*9880d681SAndroid Build Coastguard Worker
27*9880d681SAndroid Build Coastguard Workerdefine double @test_sqrt_double_(double %a) {
28*9880d681SAndroid Build Coastguard Workerentry:
29*9880d681SAndroid Build Coastguard Worker  %call = tail call double @sqrt(double %a)
30*9880d681SAndroid Build Coastguard Worker  ret double %call
31*9880d681SAndroid Build Coastguard Worker}
32*9880d681SAndroid Build Coastguard Worker
33*9880d681SAndroid Build Coastguard Workerdeclare double @sqrt(double)
34