fract.ll
6 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -instsimplify -S | FileCheck %s
declare half @llvm.amdgcn.fract.f16(half)
declare float @llvm.amdgcn.fract.f32(float)
declare double @llvm.amdgcn.fract.f64(double)
define void @test_f16(half* %p) {
; CHECK-LABEL: @test_f16(
; CHECK-NEXT: store volatile half 0xH0000, half* [[P:%.*]]
; CHECK-NEXT: store volatile half 0xH0000, half* [[P]]
; CHECK-NEXT: store volatile half 0xH0000, half* [[P]]
; CHECK-NEXT: store volatile half 0xH0000, half* [[P]]
; CHECK-NEXT: store volatile half 0xH3400, half* [[P]]
; CHECK-NEXT: store volatile half 0xH3B00, half* [[P]]
; CHECK-NEXT: store volatile half 0xH0400, half* [[P]]
; CHECK-NEXT: store volatile half 0xH3BFF, half* [[P]]
; CHECK-NEXT: store volatile half 0xH7E00, half* [[P]]
; CHECK-NEXT: store volatile half 0xH7E00, half* [[P]]
; CHECK-NEXT: store volatile half 0xH7E00, half* [[P]]
; CHECK-NEXT: ret void
;
%p0 = call half @llvm.amdgcn.fract.f16(half +0.0)
store volatile half %p0, half* %p
%n0 = call half @llvm.amdgcn.fract.f16(half -0.0)
store volatile half %n0, half* %p
%p1 = call half @llvm.amdgcn.fract.f16(half +1.0)
store volatile half %p1, half* %p
%n1 = call half @llvm.amdgcn.fract.f16(half -1.0)
store volatile half %n1, half* %p
%p225 = call half @llvm.amdgcn.fract.f16(half +2.25)
store volatile half %p225, half* %p
%n6125 = call half @llvm.amdgcn.fract.f16(half -6.125)
store volatile half %n6125, half* %p
%ptiny = call half @llvm.amdgcn.fract.f16(half 0xH0400) ; +min normal
store volatile half %ptiny, half* %p
%ntiny = call half @llvm.amdgcn.fract.f16(half 0xH8400) ; -min normal
store volatile half %ntiny, half* %p
%pinf = call half @llvm.amdgcn.fract.f16(half 0xH7C00) ; +inf
store volatile half %pinf, half* %p
%ninf = call half @llvm.amdgcn.fract.f16(half 0xHFC00) ; -inf
store volatile half %ninf, half* %p
%nan = call half @llvm.amdgcn.fract.f16(half 0xH7E00) ; nan
store volatile half %nan, half* %p
ret void
}
define void @test_f32(float* %p) {
; CHECK-LABEL: @test_f32(
; CHECK-NEXT: store volatile float 0.000000e+00, float* [[P:%.*]]
; CHECK-NEXT: store volatile float 0.000000e+00, float* [[P]]
; CHECK-NEXT: store volatile float 0.000000e+00, float* [[P]]
; CHECK-NEXT: store volatile float 0.000000e+00, float* [[P]]
; CHECK-NEXT: store volatile float 2.500000e-01, float* [[P]]
; CHECK-NEXT: store volatile float 8.750000e-01, float* [[P]]
; CHECK-NEXT: store volatile float 0x3810000000000000, float* [[P]]
; CHECK-NEXT: store volatile float 0x3FEFFFFFE0000000, float* [[P]]
; CHECK-NEXT: store volatile float 0x7FF8000000000000, float* [[P]]
; CHECK-NEXT: store volatile float 0x7FF8000000000000, float* [[P]]
; CHECK-NEXT: store volatile float 0x7FF8000000000000, float* [[P]]
; CHECK-NEXT: ret void
;
%p0 = call float @llvm.amdgcn.fract.f32(float +0.0)
store volatile float %p0, float* %p
%n0 = call float @llvm.amdgcn.fract.f32(float -0.0)
store volatile float %n0, float* %p
%p1 = call float @llvm.amdgcn.fract.f32(float +1.0)
store volatile float %p1, float* %p
%n1 = call float @llvm.amdgcn.fract.f32(float -1.0)
store volatile float %n1, float* %p
%p225 = call float @llvm.amdgcn.fract.f32(float +2.25)
store volatile float %p225, float* %p
%n6125 = call float @llvm.amdgcn.fract.f32(float -6.125)
store volatile float %n6125, float* %p
%ptiny = call float @llvm.amdgcn.fract.f32(float 0x3810000000000000) ; +min normal
store volatile float %ptiny, float* %p
%ntiny = call float @llvm.amdgcn.fract.f32(float 0xB810000000000000) ; -min normal
store volatile float %ntiny, float* %p
%pinf = call float @llvm.amdgcn.fract.f32(float 0x7FF0000000000000) ; +inf
store volatile float %pinf, float* %p
%ninf = call float @llvm.amdgcn.fract.f32(float 0xFFF0000000000000) ; -inf
store volatile float %ninf, float* %p
%nan = call float @llvm.amdgcn.fract.f32(float 0x7FF8000000000000) ; nan
store volatile float %nan, float* %p
ret void
}
define void @test_f64(double* %p) {
; CHECK-LABEL: @test_f64(
; CHECK-NEXT: store volatile double 0.000000e+00, double* [[P:%.*]]
; CHECK-NEXT: store volatile double 0.000000e+00, double* [[P]]
; CHECK-NEXT: store volatile double 0.000000e+00, double* [[P]]
; CHECK-NEXT: store volatile double 0.000000e+00, double* [[P]]
; CHECK-NEXT: store volatile double 2.500000e-01, double* [[P]]
; CHECK-NEXT: store volatile double 8.750000e-01, double* [[P]]
; CHECK-NEXT: store volatile double 2.000000e-308, double* [[P]]
; CHECK-NEXT: store volatile double 0x3FEFFFFFFFFFFFFF, double* [[P]]
; CHECK-NEXT: store volatile double 0x7FF8000000000000, double* [[P]]
; CHECK-NEXT: store volatile double 0x7FF8000000000000, double* [[P]]
; CHECK-NEXT: store volatile double 0x7FF8000000000000, double* [[P]]
; CHECK-NEXT: ret void
;
%p0 = call double @llvm.amdgcn.fract.f64(double +0.0)
store volatile double %p0, double* %p
%n0 = call double @llvm.amdgcn.fract.f64(double -0.0)
store volatile double %n0, double* %p
%p1 = call double @llvm.amdgcn.fract.f64(double +1.0)
store volatile double %p1, double* %p
%n1 = call double @llvm.amdgcn.fract.f64(double -1.0)
store volatile double %n1, double* %p
%p225 = call double @llvm.amdgcn.fract.f64(double +2.25)
store volatile double %p225, double* %p
%n6125 = call double @llvm.amdgcn.fract.f64(double -6.125)
store volatile double %n6125, double* %p
%ptiny = call double @llvm.amdgcn.fract.f64(double +2.0e-308) ; +min normal
store volatile double %ptiny, double* %p
%ntiny = call double @llvm.amdgcn.fract.f64(double -2.0e-308) ; -min normal
store volatile double %ntiny, double* %p
%pinf = call double @llvm.amdgcn.fract.f64(double 0x7FF0000000000000) ; +inf
store volatile double %pinf, double* %p
%ninf = call double @llvm.amdgcn.fract.f64(double 0xFFF0000000000000) ; -inf
store volatile double %ninf, double* %p
%nan = call double @llvm.amdgcn.fract.f64(double 0x7FF8000000000000) ; nan
store volatile double %nan, double* %p
ret void
}