• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -mtriple x86_64-windows < %s | FileCheck %s
2
3declare double @llvm.powi.f64(double, i32)
4declare float @llvm.powi.f32(float, i32)
5
6define double @d(double %d, i32 %i) {
7entry:
8  %0 = tail call double @llvm.powi.f64(double %d, i32 %i)
9  ret double %0
10}
11
12; CHECK-LABEL: d:
13; CHECK: cvtsi2sd %edx, %xmm1
14; CHECK-NEXT: jmp pow
15
16define float @f(float %f, i32 %i) {
17entry:
18  %0 = tail call float @llvm.powi.f32(float %f, i32 %i)
19  ret float %0
20}
21
22; CHECK-LABEL: f:
23; CHECK: cvtsi2ss %edx, %xmm1
24; CHECK-NEXT: jmp powf
25
26define float @g(double %d, i32 %i) {
27entry:
28  %0 = tail call double @llvm.powi.f64(double %d, i32 %i)
29  %conv = fptrunc double %0 to float
30  ret float %conv
31}
32
33; CHECK-LABEL: g:
34; CHECK: cvtsi2sd %edx, %xmm1
35; CHECK-NEXT: callq pow
36
37define double @h(float %f, i32 %i) {
38entry:
39  %0 = tail call float @llvm.powi.f32(float %f, i32 %i)
40  %conv = fpext float %0 to double
41  ret double %conv
42}
43
44; CHECK-LABEL: h:
45; CHECK: cvtsi2ss %edx, %xmm1
46; CHECK-NEXT: callq powf
47