summaryrefslogtreecommitdiff
path: root/test/Transforms/ConstProp/half.ll
blob: b9d2aeb71698607bf536df78d24b70af12b0ca83 (plain)
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
; RUN: opt -constprop -S < %s | FileCheck %s
; XFAIL: win32, freebsd

; CHECK: fabs_call
define half @fabs_call() {
; CHECK: ret half 0xH5140
  %x = call half @llvm.fabs.f16(half -42.0)
  ret half %x
}
declare half @llvm.fabs.f16(half %x)

; CHECK: exp_call
define half @exp_call() {
; CHECK: ret half 0xH4170
  %x = call half @llvm.exp.f16(half 1.0)
  ret half %x
}
declare half @llvm.exp.f16(half %x)

; CHECK: sqrt_call
define half @sqrt_call() {
; CHECK: ret half 0xH4000
  %x = call half @llvm.sqrt.f16(half 4.0)
  ret half %x
}
declare half @llvm.sqrt.f16(half %x)

; CHECK: floor_call
define half @floor_call() {
; CHECK: ret half 0xH4000
  %x = call half @llvm.floor.f16(half 2.5)
  ret half %x
}
declare half @llvm.floor.f16(half %x)

; CHECK: pow_call
define half @pow_call() {
; CHECK: ret half 0xH4400
  %x = call half @llvm.pow.f16(half 2.0, half 2.0)
  ret half %x
}
declare half @llvm.pow.f16(half %x, half %y)