powi.ll
1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
; RUN: llc -mtriple thumbv7--windows-itanium -filetype asm -o - %s | FileCheck %s
declare double @llvm.powi.f64(double, i32)
declare float @llvm.powi.f32(float, i32)
define arm_aapcs_vfpcc double @d(double %d, i32 %i) {
entry:
%0 = tail call double @llvm.powi.f64(double %d, i32 %i)
ret double %0
}
; CHECK-LABEL: d:
; CHECK: vmov s[[REGISTER:[0-9]+]], r0
; CHECK-NEXT: vcvt.f64.s32 d1, s[[REGISTER]]
; CHECK-NEXT: b pow
; CHECK-NOT: __powisf2
define arm_aapcs_vfpcc float @f(float %f, i32 %i) {
entry:
%0 = tail call float @llvm.powi.f32(float %f, i32 %i)
ret float %0
}
; CHECK-LABEL: f:
; CHECK: vmov s[[REGISTER:[0-9]+]], r0
; CHECK-NEXT: vcvt.f32.s32 s1, s[[REGISTER]]
; CHECK-NEXT: b pow
; CHECK-NOT: __powisf2
define arm_aapcs_vfpcc float @g(double %d, i32 %i) {
entry:
%0 = tail call double @llvm.powi.f64(double %d, i32 %i)
%conv = fptrunc double %0 to float
ret float %conv
}
; CHECK-LABEL: g:
; CHECK: vmov s[[REGISTER:[0-9]+]], r0
; CHECK-NEXT: vcvt.f64.s32 d1, s[[REGISTER]]
; CHECK-NEXT: bl pow
; CHECK-NOT: bl __powidf2
; CHECK-NEXT: vcvt.f32.f64 s0, d0
define arm_aapcs_vfpcc double @h(float %f, i32 %i) {
entry:
%0 = tail call float @llvm.powi.f32(float %f, i32 %i)
%conv = fpext float %0 to double
ret double %conv
}
; CHECK-LABEL: h:
; CHECK: vmov s[[REGISTER:[0-9]+]], r0
; CHECK-NEXT: vcvt.f32.s32 s1, s[[REGISTER]]
; CHECK-NEXT: bl powf
; CHECK-NOT: bl __powisf2
; CHECK-NEXT: vcvt.f64.f32 d0, s0