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