File: powi.ll

package info (click to toggle)
llvm-toolchain-21 1%3A21.1.6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 2,245,044 kB
  • sloc: cpp: 7,619,726; ansic: 1,434,018; asm: 1,058,748; python: 252,740; f90: 94,671; objc: 70,685; lisp: 42,813; pascal: 18,401; sh: 8,601; ml: 5,111; perl: 4,720; makefile: 3,666; awk: 3,523; javascript: 2,409; xml: 892; fortran: 770
file content (65 lines) | stat: -rw-r--r-- 1,872 bytes parent folder | download | duplicates (3)
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
58
59
60
61
62
63
64
65
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
; RUN: llc < %s -mtriple=aarch64-- | FileCheck %s
; RUN: llc -mtriple=aarch64-windows-pc-msvc < %s | FileCheck -check-prefix=WINDOWS %s

declare double @llvm.powi.f64.i32(double, i32)
declare float  @llvm.powi.f32.i32(float,  i32)
declare float  @pow(double noundef, double noundef)

define float @powi_f32_4(float %x) nounwind {
; CHECK-LABEL: powi_f32_4:
; CHECK:       // %bb.0:
; CHECK-NEXT:    fmul s0, s0, s0
; CHECK-NEXT:    fmul s0, s0, s0
; CHECK-NEXT:    ret
;
; WINDOWS-LABEL: powi_f32_4:
; WINDOWS:       // %bb.0:
; WINDOWS-NEXT:    fmul s0, s0, s0
; WINDOWS-NEXT:    fmul s0, s0, s0
; WINDOWS-NEXT:    ret
  %1 = tail call float @llvm.powi.f32.i32(float %x, i32 4)
  ret float %1
}

define double @powi_f64_3(double %x) nounwind {
; CHECK-LABEL: powi_f64_3:
; CHECK:       // %bb.0:
; CHECK-NEXT:    fmul d1, d0, d0
; CHECK-NEXT:    fmul d0, d0, d1
; CHECK-NEXT:    ret
;
; WINDOWS-LABEL: powi_f64_3:
; WINDOWS:       // %bb.0:
; WINDOWS-NEXT:    fmul d1, d0, d0
; WINDOWS-NEXT:    fmul d0, d0, d1
; WINDOWS-NEXT:    ret
  %1 = tail call double @llvm.powi.f64.i32(double %x, i32 3)
  ret double %1
}

define float @powi_f32(float %x, i32 %n) nounwind {
; CHECK-LABEL: powi_f32:
; CHECK:       // %bb.0:
; CHECK-NEXT:    b __powisf2
;
; WINDOWS-LABEL: powi_f32:
; WINDOWS:       // %bb.0:
; WINDOWS-NEXT:    scvtf s1, w0
; WINDOWS-NEXT:    b powf
  %ret = tail call float @llvm.powi.f32.i32(float %x, i32 %n)
  ret float %ret
}

define double @powi_f64(double %x, i32 %n) nounwind {
; CHECK-LABEL: powi_f64:
; CHECK:       // %bb.0:
; CHECK-NEXT:    b __powidf2
;
; WINDOWS-LABEL: powi_f64:
; WINDOWS:       // %bb.0:
; WINDOWS-NEXT:    scvtf d1, w0
; WINDOWS-NEXT:    b pow
  %ret = tail call double @llvm.powi.f64.i32(double %x, i32 %n)
  ret double %ret
}