NASM 0.99.05
[nasm/avx512.git] / test / floatexp.asm
blob7e6a01c3b3e11dcf4155febbb991d416e4319365
1 bits 64
3 ; Test of floating-point formats
6 ; 16-bit
7 mov ax,__float16__(1.0)
8 mov ax,__float16__(+1.0)
9 mov ax,__float16__(-1.0)
10 mov ax,__float16__(0.0)
11 mov ax,__float16__(+0.0)
12 mov ax,__float16__(-0.0)
13 mov ax,__float16__(1.83203125)
14 mov ax,__float16__(+1.83203125)
15 mov ax,__float16__(-1.83203125)
16 mov ax,__float16__(1.83203125e3)
17 mov ax,__float16__(+1.83203125e3)
18 mov ax,__float16__(-1.83203125e3)
19 mov ax,__float16__(1.83203125e-3)
20 mov ax,__float16__(+1.83203125e-3)
21 mov ax,__float16__(-1.83203125e-3)
22 mov ax,__float16__(1.83203125e-6) ; Denormal!
23 mov ax,__float16__(+1.83203125e-6) ; Denormal!
24 mov ax,__float16__(-1.83203125e-6) ; Denormal!
25 mov ax,__float16__(__Infinity__)
26 mov ax,__float16__(+__Infinity__)
27 mov ax,__float16__(-__Infinity__)
28 mov ax,__float16__(__NaN__)
29 mov ax,__float16__(__QNaN__)
30 mov ax,__float16__(__SNaN__)
32 ; 32-bit
33 mov eax,__float32__(1.0)
34 mov eax,__float32__(+1.0)
35 mov eax,__float32__(-1.0)
36 mov eax,__float32__(0.0)
37 mov eax,__float32__(+0.0)
38 mov eax,__float32__(-0.0)
39 mov eax,__float32__(1.83203125)
40 mov eax,__float32__(+1.83203125)
41 mov eax,__float32__(-1.83203125)
42 mov eax,__float32__(1.83203125e15)
43 mov eax,__float32__(+1.83203125e15)
44 mov eax,__float32__(-1.83203125e15)
45 mov eax,__float32__(1.83203125e-15)
46 mov eax,__float32__(+1.83203125e-15)
47 mov eax,__float32__(-1.83203125e-15)
48 mov eax,__float32__(1.83203125e-40) ; Denormal!
49 mov eax,__float32__(+1.83203125e-40) ; Denormal!
50 mov eax,__float32__(-1.83203125e-40) ; Denormal!
51 mov eax,__float32__(__Infinity__)
52 mov eax,__float32__(+__Infinity__)
53 mov eax,__float32__(-__Infinity__)
54 mov eax,__float32__(__NaN__)
55 mov eax,__float32__(__QNaN__)
56 mov eax,__float32__(__SNaN__)
58 ; 64-bit
59 mov rax,__float64__(1.0)
60 mov rax,__float64__(+1.0)
61 mov rax,__float64__(-1.0)
62 mov rax,__float64__(0.0)
63 mov rax,__float64__(+0.0)
64 mov rax,__float64__(-0.0)
65 mov rax,__float64__(1.83203125)
66 mov rax,__float64__(+1.83203125)
67 mov rax,__float64__(-1.83203125)
68 mov rax,__float64__(1.83203125e300)
69 mov rax,__float64__(+1.83203125e300)
70 mov rax,__float64__(-1.83203125e300)
71 mov rax,__float64__(1.83203125e-300)
72 mov rax,__float64__(+1.83203125e-300)
73 mov rax,__float64__(-1.83203125e-300)
74 mov rax,__float64__(1.83203125e-320) ; Denormal!
75 mov rax,__float64__(+1.83203125e-320) ; Denormal!
76 mov rax,__float64__(-1.83203125e-320) ; Denormal!
77 mov rax,__float64__(__Infinity__)
78 mov rax,__float64__(+__Infinity__)
79 mov rax,__float64__(-__Infinity__)
80 mov rax,__float64__(__NaN__)
81 mov rax,__float64__(__QNaN__)
82 mov rax,__float64__(__SNaN__)
84 ; 80-bit
85 mov rax,__float80m__(1.0)
86 mov ax,__float80e__(1.0)
87 mov rax,__float80m__(+1.0)
88 mov ax,__float80e__(+1.0)
89 mov rax,__float80m__(-1.0)
90 mov ax,__float80e__(-1.0)
91 mov rax,__float80m__(0.0)
92 mov ax,__float80e__(0.0)
93 mov rax,__float80m__(+0.0)
94 mov ax,__float80e__(+0.0)
95 mov rax,__float80m__(-0.0)
96 mov ax,__float80e__(-0.0)
97 mov rax,__float80m__(1.83203125)
98 mov ax,__float80e__(1.83203125)
99 mov rax,__float80m__(+1.83203125)
100 mov ax,__float80e__(+1.83203125)
101 mov rax,__float80m__(-1.83203125)
102 mov ax,__float80e__(-1.83203125)
103 mov rax,__float80m__(1.83203125e+4000)
104 mov ax,__float80e__(1.83203125e+4000)
105 mov rax,__float80m__(+1.83203125e+4000)
106 mov ax,__float80e__(+1.83203125e+4000)
107 mov rax,__float80m__(-1.83203125e+4000)
108 mov ax,__float80e__(-1.83203125e+4000)
109 mov rax,__float80m__(1.83203125e-4000)
110 mov ax,__float80e__(1.83203125e-4000)
111 mov rax,__float80m__(+1.83203125e-4000)
112 mov ax,__float80e__(+1.83203125e-4000)
113 mov rax,__float80m__(-1.83203125e-4000)
114 mov ax,__float80e__(-1.83203125e-4000)
115 mov rax,__float80m__(1.83203125e-4940) ; Denormal!
116 mov ax,__float80e__(1.83203125e-4940) ; Denormal!
117 mov rax,__float80m__(+1.83203125e-4940) ; Denormal!
118 mov ax,__float80e__(+1.83203125e-4940) ; Denormal!
119 mov rax,__float80m__(-1.83203125e-4940) ; Denormal!
120 mov ax,__float80e__(-1.83203125e-4940) ; Denormal!
121 mov rax,__float80m__(__Infinity__)
122 mov ax,__float80e__(__Infinity__)
123 mov rax,__float80m__(+__Infinity__)
124 mov ax,__float80e__(+__Infinity__)
125 mov rax,__float80m__(-__Infinity__)
126 mov ax,__float80e__(-__Infinity__)
127 mov rax,__float80m__(__NaN__)
128 mov ax,__float80e__(__NaN__)
129 mov rax,__float80m__(__QNaN__)
130 mov ax,__float80e__(__QNaN__)
131 mov rax,__float80m__(__SNaN__)
132 mov ax,__float80e__(__SNaN__)
134 ; 128-bit
135 mov rax,__float128l__(1.0)
136 mov rax,__float128h__(1.0)
137 mov rax,__float128l__(+1.0)
138 mov rax,__float128h__(+1.0)
139 mov rax,__float128l__(-1.0)
140 mov rax,__float128h__(-1.0)
141 mov rax,__float128l__(0.0)
142 mov rax,__float128h__(0.0)
143 mov rax,__float128l__(+0.0)
144 mov rax,__float128h__(+0.0)
145 mov rax,__float128l__(-0.0)
146 mov rax,__float128h__(-0.0)
147 mov rax,__float128l__(1.83203125)
148 mov rax,__float128h__(1.83203125)
149 mov rax,__float128l__(+1.83203125)
150 mov rax,__float128h__(+1.83203125)
151 mov rax,__float128l__(-1.83203125)
152 mov rax,__float128h__(-1.83203125)
153 mov rax,__float128l__(1.83203125e+4000)
154 mov rax,__float128h__(1.83203125e+4000)
155 mov rax,__float128l__(+1.83203125e+4000)
156 mov rax,__float128h__(+1.83203125e+4000)
157 mov rax,__float128l__(-1.83203125e+4000)
158 mov rax,__float128h__(-1.83203125e+4000)
159 mov rax,__float128l__(1.83203125e-4000)
160 mov rax,__float128h__(1.83203125e-4000)
161 mov rax,__float128l__(+1.83203125e-4000)
162 mov rax,__float128h__(+1.83203125e-4000)
163 mov rax,__float128l__(-1.83203125e-4000)
164 mov rax,__float128h__(-1.83203125e-4000)
165 mov rax,__float128l__(1.83203125e-4940) ; Denormal!
166 mov rax,__float128h__(1.83203125e-4940) ; Denormal!
167 mov rax,__float128l__(+1.83203125e-4940) ; Denormal!
168 mov rax,__float128h__(+1.83203125e-4940) ; Denormal!
169 mov rax,__float128l__(-1.83203125e-4940) ; Denormal!
170 mov rax,__float128h__(-1.83203125e-4940) ; Denormal!
171 mov rax,__float128l__(__Infinity__)
172 mov rax,__float128h__(__Infinity__)
173 mov rax,__float128l__(+__Infinity__)
174 mov rax,__float128h__(+__Infinity__)
175 mov rax,__float128l__(-__Infinity__)
176 mov rax,__float128h__(-__Infinity__)
177 mov rax,__float128l__(__NaN__)
178 mov rax,__float128h__(__NaN__)
179 mov rax,__float128l__(__QNaN__)
180 mov rax,__float128h__(__QNaN__)
181 mov rax,__float128l__(__SNaN__)
182 mov rax,__float128h__(__SNaN__)
185 ; Test hexadecimal floating-point numbers
188 ; 16-bit
189 mov ax,__float16__(1.0)
190 mov ax,__float16__(0x1.0)
191 mov ax,__float16__(2.0)
192 mov ax,__float16__(0x2.0)
193 mov ax,__float16__(0x1.0p+1)
194 mov ax,__float16__(0x1.0p-1)
195 mov ax,__float16__(0x0.0)
196 mov ax,__float16__(0x1.23456789)
197 mov ax,__float16__(0x0.123456789)
198 mov ax,__float16__(0x0.0000123456789)
199 mov ax,__float16__(0x1.23456789p10)
200 mov ax,__float16__(0x1.23456789p+10)
201 mov ax,__float16__(0x1.23456789p-10)
202 mov ax,__float16__(0x0.123456789p10)
203 mov ax,__float16__(0x0.123456789p+10)
204 mov ax,__float16__(0x0.123456789abcdef0123456789abcdef012345p-10)
205 mov ax,__float16__(0x0.0000123456789)
206 mov ax,__float16__(0x0.0000123456789p+10)
207 mov ax,__float16__(0x0.0000123456789p-10)
209 ; 32-bit
210 mov eax,__float32__(1.0)
211 mov eax,__float32__(0x1.0)
212 mov eax,__float32__(2.0)
213 mov eax,__float32__(0x2.0)
214 mov eax,__float32__(0x1.0p+1)
215 mov eax,__float32__(0x1.0p-1)
216 mov eax,__float32__(0x0.0)
217 mov eax,__float32__(0x1.23456789)
218 mov eax,__float32__(0x0.123456789)
219 mov eax,__float32__(0x0.0000123456789)
220 mov eax,__float32__(0x1.23456789p10)
221 mov eax,__float32__(0x1.23456789p+10)
222 mov eax,__float32__(0x1.23456789p-10)
223 mov eax,__float32__(0x0.123456789p10)
224 mov eax,__float32__(0x0.123456789p+10)
225 mov eax,__float32__(0x0.123456789abcdef0123456789abcdef012345p-10)
226 mov eax,__float32__(0x0.0000123456789)
227 mov eax,__float32__(0x0.0000123456789p+10)
228 mov eax,__float32__(0x0.0000123456789p-10)
229 mov eax,__float32__(0x123456789.0)
230 mov eax,__float32__(0x0000123456789.0)
231 mov eax,__float32__(0x123456789.0p+0)
232 mov eax,__float32__(0x123456789.0p+64)
234 ; 64-bit
235 mov rax,__float64__(1.0)
236 mov rax,__float64__(0x1.0)
237 mov rax,__float64__(2.0)
238 mov rax,__float64__(0x2.0)
239 mov rax,__float64__(0x1.0p+1)
240 mov rax,__float64__(0x1.0p-1)
241 mov rax,__float64__(0x0.0)
242 mov rax,__float64__(0x1.23456789)
243 mov rax,__float64__(0x0.123456789)
244 mov rax,__float64__(0x0.0000123456789)
245 mov rax,__float64__(0x1.23456789p10)
246 mov rax,__float64__(0x1.23456789p+10)
247 mov rax,__float64__(0x1.23456789p-10)
248 mov rax,__float64__(0x0.123456789p10)
249 mov rax,__float64__(0x0.123456789p+10)
250 mov rax,__float64__(0x0.123456789abcdef0123456789abcdef012345p-10)
251 mov rax,__float64__(0x0.0000123456789)
252 mov rax,__float64__(0x0.0000123456789p+10)
253 mov rax,__float64__(0x0.0000123456789p-10)
254 mov rax,__float64__(0x123456789.0)
255 mov rax,__float64__(0x0000123456789.0)
256 mov rax,__float64__(0x123456789.0p+0)
257 mov rax,__float64__(0x123456789.0p+300)
259 ; 80-bit
260 mov rax,__float80m__(1.0)
261 mov ax,__float80e__(1.0)
262 mov rax,__float80m__(0x1.0)
263 mov ax,__float80e__(0x1.0)
264 mov rax,__float80m__(2.0)
265 mov ax,__float80e__(2.0)
266 mov rax,__float80m__(0x2.0)
267 mov ax,__float80e__(0x2.0)
268 mov rax,__float80m__(0x1.0p+1)
269 mov ax,__float80e__(0x1.0p+1)
270 mov rax,__float80m__(0x1.0p-1)
271 mov ax,__float80e__(0x1.0p-1)
272 mov rax,__float80m__(0x0.0)
273 mov ax,__float80e__(0x0.0)
274 mov rax,__float80m__(0x1.23456789)
275 mov ax,__float80e__(0x1.23456789)
276 mov rax,__float80m__(0x0.123456789)
277 mov ax,__float80e__(0x0.123456789)
278 mov rax,__float80m__(0x0.0000123456789)
279 mov ax,__float80e__(0x0.0000123456789)
280 mov rax,__float80m__(0x1.23456789p10)
281 mov ax,__float80e__(0x1.23456789p10)
282 mov rax,__float80m__(0x1.23456789p+10)
283 mov ax,__float80e__(0x1.23456789p+10)
284 mov rax,__float80m__(0x1.23456789p-10)
285 mov ax,__float80e__(0x1.23456789p-10)
286 mov rax,__float80m__(0x0.123456789p10)
287 mov ax,__float80e__(0x0.123456789p10)
288 mov rax,__float80m__(0x0.123456789p+10)
289 mov ax,__float80e__(0x0.123456789p+10)
290 mov rax,__float80m__(0x0.123456789abcdef0123456789abcdef012345p-10)
291 mov ax,__float80e__(0x0.123456789abcdef0123456789abcdef012345p-10)
292 mov rax,__float80m__(0x0.0000123456789)
293 mov ax,__float80e__(0x0.0000123456789)
294 mov rax,__float80m__(0x0.0000123456789p+10)
295 mov ax,__float80e__(0x0.0000123456789p+10)
296 mov rax,__float80m__(0x0.0000123456789p-10)
297 mov ax,__float80e__(0x0.0000123456789p-10)
298 mov rax,__float80m__(0x123456789.0)
299 mov ax,__float80e__(0x123456789.0)
300 mov rax,__float80m__(0x0000123456789.0)
301 mov ax,__float80e__(0x0000123456789.0)
302 mov rax,__float80m__(0x123456789.0p+0)
303 mov ax,__float80e__(0x123456789.0p+0)
304 mov rax,__float80m__(0x123456789.0p+1024)
305 mov ax,__float80e__(0x123456789.0p+1024)
307 ; 128-bit
308 mov rax,__float128l__(1.0)
309 mov rax,__float128h__(1.0)
310 mov rax,__float128l__(0x1.0)
311 mov rax,__float128h__(0x1.0)
312 mov rax,__float128l__(2.0)
313 mov rax,__float128h__(2.0)
314 mov rax,__float128l__(0x2.0)
315 mov rax,__float128h__(0x2.0)
316 mov rax,__float128l__(0x1.0p+1)
317 mov rax,__float128h__(0x1.0p+1)
318 mov rax,__float128l__(0x1.0p-1)
319 mov rax,__float128h__(0x1.0p-1)
320 mov rax,__float128l__(0x0.0)
321 mov rax,__float128h__(0x0.0)
322 mov rax,__float128l__(0x1.23456789)
323 mov rax,__float128h__(0x1.23456789)
324 mov rax,__float128l__(0x0.123456789)
325 mov rax,__float128h__(0x0.123456789)
326 mov rax,__float128l__(0x0.0000123456789)
327 mov rax,__float128h__(0x0.0000123456789)
328 mov rax,__float128l__(0x1.23456789p10)
329 mov rax,__float128h__(0x1.23456789p10)
330 mov rax,__float128l__(0x1.23456789p+10)
331 mov rax,__float128h__(0x1.23456789p+10)
332 mov rax,__float128l__(0x1.23456789p-10)
333 mov rax,__float128h__(0x1.23456789p-10)
334 mov rax,__float128l__(0x0.123456789p10)
335 mov rax,__float128h__(0x0.123456789p10)
336 mov rax,__float128l__(0x0.123456789p+10)
337 mov rax,__float128h__(0x0.123456789p+10)
338 mov rax,__float128l__(0x0.123456789abcdef0123456789abcdef012345p-10)
339 mov rax,__float128h__(0x0.123456789abcdef0123456789abcdef012345p-10)
340 mov rax,__float128l__(0x0.0000123456789)
341 mov rax,__float128h__(0x0.0000123456789)
342 mov rax,__float128l__(0x0.0000123456789p+10)
343 mov rax,__float128h__(0x0.0000123456789p+10)
344 mov rax,__float128l__(0x0.0000123456789p-10)
345 mov rax,__float128h__(0x0.0000123456789p-10)
346 mov rax,__float128l__(0x123456789.0)
347 mov rax,__float128h__(0x123456789.0)
348 mov rax,__float128l__(0x0000123456789.0)
349 mov rax,__float128h__(0x0000123456789.0)
350 mov rax,__float128l__(0x123456789.0p+0)
351 mov rax,__float128h__(0x123456789.0p+0)
352 mov rax,__float128l__(0x123456789.0p+1024)
353 mov rax,__float128h__(0x123456789.0p+1024)