NASM 2.06rc7
[nasm/perl-rewrite.git] / test / floatx.asm
blob7368e5049a12e90a2314bbc1291bfd3d640ccc75
2 ; floatx.asm
4 ; Test hexadecimal floating-point numbers
6 %define Inf __Infinity__
7 %define NaN __QNaN__
9 ; 16-bit
10 dw 1.0
11 dw 0x1.0
12 dw 2.0
13 dw 0x2.0
14 dw 0x1.0p+1
15 dw 0x1.0p-1
16 dw 0x0.0
17 dw 0x1.23456789
18 dw 0x0.123456789
19 dw 0x0.0000123456789
20 dw 0x1.23456789p10
21 dw 0x1.23456789p+10
22 dw 0x1.23456789p-10
23 dw 0x0.123456789p10
24 dw 0x0.123456789p+10
25 dw 0x0.123456789abcdef0123456789abcdef012345p-10
26 dw 0x0.0000123456789
27 dw 0x0.0000123456789p+10
28 dw 0x0.0000123456789p-10
29 dw 0x1.0p-25 ; Underflow
30 dw 0x1.01p-25 ; Rounds to denorm
31 dw 0x1.0p-24 ; Smallest denorm
32 dw 0x1.ffffffffffffffffffffffffffffp-16 ; Rounds to denorm
33 dw 0x1.0p-15 ; Denorm
34 dw 0x1.ffffffffffffffffffffffffffffp-15 ; Rounds to normal
35 dw 0x1.0p-14 ; Smallest non-denorm
36 dw 0x1.0p+15 ; Biggest possible exponent
37 dw 0x1.ffffffffffffffffffffffffffffp+15 ; Rounds to infinity
38 dw Inf ; Infinity
39 dw NaN
41 ; 32-bit
42 dd 1.0
43 dd 0x1.0
44 dd 2.0
45 dd 0x2.0
46 dd 0x1.0p+1
47 dd 0x1.0p-1
48 dd 0x0.0
49 dd 0x1.23456789
50 dd 0x0.123456789
51 dd 0x0.0000123456789
52 dd 0x1.23456789p10
53 dd 0x1.23456789p+10
54 dd 0x1.23456789p-10
55 dd 0x0.123456789p10
56 dd 0x0.123456789p+10
57 dd 0x0.123456789abcdef0123456789abcdef012345p-10
58 dd 0x0.0000123456789
59 dd 0x0.0000123456789p+10
60 dd 0x0.0000123456789p-10
61 dd 0x123456789.0
62 dd 0x0000123456789.0
63 dd 0x123456789.0p+0
64 dd 0x123456789.0p+64
65 dd 0x1.0p-150 ; Underflow
66 dd 0x1.01p-150 ; Rounds to denorm
67 dd 0x1.0p-149 ; Smallest denorm
68 dd 0x1.ffffffffffffffffffffffffffffp-128 ; Rounds to denorm
69 dd 0x1.0p-127 ; Denorm
70 dd 0x1.ffffffffffffffffffffffffffffp-127 ; Rounds to normal
71 dd 0x1.0p-126 ; Smallest non-denorm
72 dd 0x1.0p+127 ; Biggest possible exponent
73 dd 0x1.ffffffffffffffffffffffffffffp+127 ; Rounds to infinity
74 dd Inf ; Infinity
75 dd NaN
77 ; 64-bit
78 dq 1.0
79 dq 0x1.0
80 dq 2.0
81 dq 0x2.0
82 dq 0x1.0p+1
83 dq 0x1.0p-1
84 dq 0x0.0
85 dq 0x1.23456789
86 dq 0x0.123456789
87 dq 0x0.0000123456789
88 dq 0x1.23456789p10
89 dq 0x1.23456789p+10
90 dq 0x1.23456789p-10
91 dq 0x0.123456789p10
92 dq 0x0.123456789p+10
93 dq 0x0.123456789abcdef0123456789abcdef012345p-10
94 dq 0x0.0000123456789
95 dq 0x0.0000123456789p+10
96 dq 0x0.0000123456789p-10
97 dq 0x123456789.0
98 dq 0x0000123456789.0
99 dq 0x123456789.0p+0
100 dq 0x123456789.0p+300
101 dq 0x1.0p-1075 ; Underflow
102 dq 0x1.01p-1075 ; Rounds to denorm
103 dq 0x1.0p-1074 ; Smallest denorm
104 dq 0x1.ffffffffffffffffffffffffffffp-1024 ; Rounds to denorm
105 dq 0x1.0p-1023 ; Denorm
106 dq 0x1.ffffffffffffffffffffffffffffp-1023 ; Rounds to normal
107 dq 0x1.0p-1022 ; Smallest non-denorm
108 dq 0x1.0p+1023 ; Biggest possible exponent
109 dq 0x1.ffffffffffffffffffffffffffffp+1023 ; Rounds to infinity
110 dq Inf ; Infinity
111 dq NaN
113 ; 80-bit
114 dt 1.0
115 dt 0x1.0
116 dt 2.0
117 dt 0x2.0
118 dt 0x1.0p+1
119 dt 0x1.0p-1
120 dt 0x0.0
121 dt 0x1.23456789
122 dt 0x0.123456789
123 dt 0x0.0000123456789
124 dt 0x1.23456789p10
125 dt 0x1.23456789p+10
126 dt 0x1.23456789p-10
127 dt 0x0.123456789p10
128 dt 0x0.123456789p+10
129 dt 0x0.123456789abcdef0123456789abcdef012345p-10
130 dt 0x0.0000123456789
131 dt 0x0.0000123456789p+10
132 dt 0x0.0000123456789p-10
133 dt 0x123456789.0
134 dt 0x0000123456789.0
135 dt 0x123456789.0p+0
136 dt 0x123456789.0p+1024
137 dt 0x1.0p-16446 ; Underflow
138 dt 0x1.01p-16446 ; Rounds to denorm
139 dt 0x1.0p-16445 ; Smallest denorm
140 dt 0x1.ffffffffffffffffffffffffffffp-16384 ; Rounds to denorm
141 dt 0x1.0p-16383 ; Denorm
142 dt 0x1.ffffffffffffffffffffffffffffp-16383 ; Rounds to normal
143 dt 0x1.0p-16382 ; Smallest non-denorm
144 dt 0x1.0p+16383 ; Biggest possible exponent
145 dt 0x1.ffffffffffffffffffffffffffffp+16383 ; Rounds to infinity
146 dt Inf ; Infinity
147 dt NaN
149 ; 128-bit
150 do 1.0
151 do 0x1.0
152 do 2.0
153 do 0x2.0
154 do 0x1.0p+1
155 do 0x1.0p-1
156 do 0x0.0
157 do 0x1.23456789
158 do 0x0.123456789
159 do 0x0.0000123456789
160 do 0x1.23456789p10
161 do 0x1.23456789p+10
162 do 0x1.23456789p-10
163 do 0x0.123456789p10
164 do 0x0.123456789p+10
165 do 0x0.123456789abcdef0123456789abcdef012345p-10
166 do 0x0.0000123456789
167 do 0x0.0000123456789p+10
168 do 0x0.0000123456789p-10
169 do 0x123456789.0
170 do 0x0000123456789.0
171 do 0x123456789.0p+0
172 do 0x123456789.0p+1024
173 do 0x1.0p-16495 ; Underflow
174 do 0x1.01p-16495 ; Rounds to denorm
175 do 0x1.0p-16494 ; Smallest denorm
176 do 0x1.ffffffffffffffffffffffffffffffffp-16384 ; Rounds to denorm
177 do 0x1.0p-16383 ; Denorm
178 do 0x1.ffffffffffffffffffffffffffffffffp-16383 ; Rounds to normal
179 do 0x1.0p-16382 ; Smallest non-denorm
180 do 0x1.0p+16383 ; Biggest possible exponent
181 do 0x1.ffffffffffffffffffffffffffffffffp+16383 ; Rounds to infinity
182 do Inf ; Infinity
183 do NaN
185 ; 16-bit
186 dw 1.0
187 dw 0h1.0
188 dw 2.0
189 dw 0h2.0
190 dw 0h1.0p+1
191 dw 0h1.0p-1
192 dw 0h0.0
193 dw 0h1.23456789
194 dw 0h0.123456789
195 dw 0h0.0000123456789
196 dw 0h1.23456789p10
197 dw 0h1.23456789p+10
198 dw 0h1.23456789p-10
199 dw 0h0.123456789p10
200 dw 0h0.123456789p+10
201 dw 0h0.123456789abcdef0123456789abcdef012345p-10
202 dw 0h0.0000123456789
203 dw 0h0.0000123456789p+10
204 dw 0h0.0000123456789p-10
205 dw 0h1.0p-25 ; Underflow
206 dw 0h1.0p-24 ; Smallest denorm
207 dw 0h1.ffffffffffffffffffffffffffffp-16 ; Rounds to denorm
208 dw 0h1.0p-15 ; Denorm
209 dw 0h1.ffffffffffffffffffffffffffffp-15 ; Rounds to normal
210 dw 0h1.0p-14 ; Smallest non-denorm
211 dw 0h1.0p+15 ; Biggest possible exponent
212 dw 0h1.ffffffffffffffffffffffffffffp+15 ; Rounds to infinity
213 dw Inf ; Infinity
214 dw NaN
216 ; 32-bit
217 dd 1.0
218 dd 0h1.0
219 dd 2.0
220 dd 0h2.0
221 dd 0h1.0p+1
222 dd 0h1.0p-1
223 dd 0h0.0
224 dd 0h1.23456789
225 dd 0h0.123456789
226 dd 0h0.0000123456789
227 dd 0h1.23456789p10
228 dd 0h1.23456789p+10
229 dd 0h1.23456789p-10
230 dd 0h0.123456789p10
231 dd 0h0.123456789p+10
232 dd 0h0.123456789abcdef0123456789abcdef012345p-10
233 dd 0h0.0000123456789
234 dd 0h0.0000123456789p+10
235 dd 0h0.0000123456789p-10
236 dd 0h123456789.0
237 dd 0h0000123456789.0
238 dd 0h123456789.0p+0
239 dd 0h123456789.0p+64
240 dd 0h1.0p-150 ; Underflow
241 dd 0h1.0p-149 ; Smallest denorm
242 dd 0h1.ffffffffffffffffffffffffffffp-128 ; Rounds to denorm
243 dd 0h1.0p-127 ; Denorm
244 dd 0h1.ffffffffffffffffffffffffffffp-127 ; Rounds to normal
245 dd 0h1.0p-126 ; Smallest non-denorm
246 dd 0h1.0p+127 ; Biggest possible exponent
247 dd 0h1.ffffffffffffffffffffffffffffp+127 ; Rounds to infinity
248 dd Inf ; Infinity
249 dd NaN
251 ; 64-bit
252 dq 1.0
253 dq 0h1.0
254 dq 2.0
255 dq 0h2.0
256 dq 0h1.0p+1
257 dq 0h1.0p-1
258 dq 0h0.0
259 dq 0h1.23456789
260 dq 0h0.123456789
261 dq 0h0.0000123456789
262 dq 0h1.23456789p10
263 dq 0h1.23456789p+10
264 dq 0h1.23456789p-10
265 dq 0h0.123456789p10
266 dq 0h0.123456789p+10
267 dq 0h0.123456789abcdef0123456789abcdef012345p-10
268 dq 0h0.0000123456789
269 dq 0h0.0000123456789p+10
270 dq 0h0.0000123456789p-10
271 dq 0h123456789.0
272 dq 0h0000123456789.0
273 dq 0h123456789.0p+0
274 dq 0h123456789.0p+300
275 dq 0h1.0p-1075 ; Underflow
276 dq 0h1.0p-1074 ; Smallest denorm
277 dq 0h1.ffffffffffffffffffffffffffffp-1024 ; Rounds to denorm
278 dq 0h1.0p-1023 ; Denorm
279 dq 0h1.ffffffffffffffffffffffffffffp-1023 ; Rounds to normal
280 dq 0h1.0p-1022 ; Smallest non-denorm
281 dq 0h1.0p+1023 ; Biggest possible exponent
282 dq 0h1.ffffffffffffffffffffffffffffp+1023 ; Rounds to infinity
283 dq Inf ; Infinity
284 dq NaN
286 ; 80-bit
287 dt 1.0
288 dt 0h1.0
289 dt 2.0
290 dt 0h2.0
291 dt 0h1.0p+1
292 dt 0h1.0p-1
293 dt 0h0.0
294 dt 0h1.23456789
295 dt 0h0.123456789
296 dt 0h0.0000123456789
297 dt 0h1.23456789p10
298 dt 0h1.23456789p+10
299 dt 0h1.23456789p-10
300 dt 0h0.123456789p10
301 dt 0h0.123456789p+10
302 dt 0h0.123456789abcdef0123456789abcdef012345p-10
303 dt 0h0.0000123456789
304 dt 0h0.0000123456789p+10
305 dt 0h0.0000123456789p-10
306 dt 0h123456789.0
307 dt 0h0000123456789.0
308 dt 0h123456789.0p+0
309 dt 0h123456789.0p+1024
310 dt 0h1.0p-16446 ; Underflow
311 dt 0h1.0p-16445 ; Smallest denorm
312 dt 0h1.ffffffffffffffffffffffffffffp-16384 ; Rounds to denorm
313 dt 0h1.0p-16383 ; Denorm
314 dt 0h1.ffffffffffffffffffffffffffffp-16383 ; Rounds to normal
315 dt 0h1.0p-16382 ; Smallest non-denorm
316 dt 0h1.0p+16383 ; Biggest possible exponent
317 dt 0h1.ffffffffffffffffffffffffffffp+16383 ; Rounds to infinity
318 dt Inf ; Infinity
319 dt NaN
321 ; 128-bit
322 do 1.0
323 do 0h1.0
324 do 2.0
325 do 0h2.0
326 do 0h1.0p+1
327 do 0h1.0p-1
328 do 0h0.0
329 do 0h1.23456789
330 do 0h0.123456789
331 do 0h0.0000123456789
332 do 0h1.23456789p10
333 do 0h1.23456789p+10
334 do 0h1.23456789p-10
335 do 0h0.123456789p10
336 do 0h0.123456789p+10
337 do 0h0.123456789abcdef0123456789abcdef012345p-10
338 do 0h0.0000123456789
339 do 0h0.0000123456789p+10
340 do 0h0.0000123456789p-10
341 do 0h123456789.0
342 do 0h0000123456789.0
343 do 0h123456789.0p+0
344 do 0h123456789.0p+1024
345 do 0h1.0p-16495 ; Underflow
346 do 0h1.0p-16494 ; Smallest denorm
347 do 0h1.ffffffffffffffffffffffffffffffffp-16384 ; Rounds to denorm
348 do 0h1.0p-16383 ; Denorm
349 do 0h1.ffffffffffffffffffffffffffffffffp-16383 ; Rounds to normal
350 do 0h1.0p-16382 ; Smallest non-denorm
351 do 0h1.0p+16383 ; Biggest possible exponent
352 do 0h1.ffffffffffffffffffffffffffffffffp+16383 ; Rounds to infinity
353 do Inf ; Infinity
354 do NaN
356 ; 16-bit
357 dw 1.0
358 dw $1.0
359 dw 2.0
360 dw $2.0
361 dw $1.0p+1
362 dw $1.0p-1
363 dw $0.0
364 dw $1.23456789
365 dw $0.123456789
366 dw $0.0000123456789
367 dw $1.23456789p10
368 dw $1.23456789p+10
369 dw $1.23456789p-10
370 dw $0.123456789p10
371 dw $0.123456789p+10
372 dw $0.123456789abcdef0123456789abcdef012345p-10
373 dw $0.0000123456789
374 dw $0.0000123456789p+10
375 dw $0.0000123456789p-10
376 dw $1.0p-25 ; Underflow
377 dw $1.0p-24 ; Smallest denorm
378 dw $1.ffffffffffffffffffffffffffffp-16 ; Rounds to denorm
379 dw $1.0p-15 ; Denorm
380 dw $1.ffffffffffffffffffffffffffffp-15 ; Rounds to normal
381 dw $1.0p-14 ; Smallest non-denorm
382 dw $1.0p+15 ; Biggest possible exponent
383 dw $1.ffffffffffffffffffffffffffffp+15 ; Rounds to infinity
384 dw Inf ; Infinity
385 dw NaN
387 ; 32-bit
388 dd 1.0
389 dd $1.0
390 dd 2.0
391 dd $2.0
392 dd $1.0p+1
393 dd $1.0p-1
394 dd $0.0
395 dd $1.23456789
396 dd $0.123456789
397 dd $0.0000123456789
398 dd $1.23456789p10
399 dd $1.23456789p+10
400 dd $1.23456789p-10
401 dd $0.123456789p10
402 dd $0.123456789p+10
403 dd $0.123456789abcdef0123456789abcdef012345p-10
404 dd $0.0000123456789
405 dd $0.0000123456789p+10
406 dd $0.0000123456789p-10
407 dd $123456789.0
408 dd $0000123456789.0
409 dd $123456789.0p+0
410 dd $123456789.0p+64
411 dd $1.0p-150 ; Underflow
412 dd $1.0p-149 ; Smallest denorm
413 dd $1.ffffffffffffffffffffffffffffp-128 ; Rounds to denorm
414 dd $1.0p-127 ; Denorm
415 dd $1.ffffffffffffffffffffffffffffp-127 ; Rounds to normal
416 dd $1.0p-126 ; Smallest non-denorm
417 dd $1.0p+127 ; Biggest possible exponent
418 dd $1.ffffffffffffffffffffffffffffp+127 ; Rounds to infinity
419 dd Inf ; Infinity
420 dd NaN
422 ; 64-bit
423 dq 1.0
424 dq $1.0
425 dq 2.0
426 dq $2.0
427 dq $1.0p+1
428 dq $1.0p-1
429 dq $0.0
430 dq $1.23456789
431 dq $0.123456789
432 dq $0.0000123456789
433 dq $1.23456789p10
434 dq $1.23456789p+10
435 dq $1.23456789p-10
436 dq $0.123456789p10
437 dq $0.123456789p+10
438 dq $0.123456789abcdef0123456789abcdef012345p-10
439 dq $0.0000123456789
440 dq $0.0000123456789p+10
441 dq $0.0000123456789p-10
442 dq $123456789.0
443 dq $0000123456789.0
444 dq $123456789.0p+0
445 dq $123456789.0p+300
446 dq $1.0p-1075 ; Underflow
447 dq $1.0p-1074 ; Smallest denorm
448 dq $1.ffffffffffffffffffffffffffffp-1024 ; Rounds to denorm
449 dq $1.0p-1023 ; Denorm
450 dq $1.ffffffffffffffffffffffffffffp-1023 ; Rounds to normal
451 dq $1.0p-1022 ; Smallest non-denorm
452 dq $1.0p+1023 ; Biggest possible exponent
453 dq $1.ffffffffffffffffffffffffffffp+1023 ; Rounds to infinity
454 dq Inf ; Infinity
455 dq NaN
457 ; 80-bit
458 dt 1.0
459 dt $1.0
460 dt 2.0
461 dt $2.0
462 dt $1.0p+1
463 dt $1.0p-1
464 dt $0.0
465 dt $1.23456789
466 dt $0.123456789
467 dt $0.0000123456789
468 dt $1.23456789p10
469 dt $1.23456789p+10
470 dt $1.23456789p-10
471 dt $0.123456789p10
472 dt $0.123456789p+10
473 dt $0.123456789abcdef0123456789abcdef012345p-10
474 dt $0.0000123456789
475 dt $0.0000123456789p+10
476 dt $0.0000123456789p-10
477 dt $123456789.0
478 dt $0000123456789.0
479 dt $123456789.0p+0
480 dt $123456789.0p+1024
481 dt $1.0p-16446 ; Underflow
482 dt $1.0p-16445 ; Smallest denorm
483 dt $1.ffffffffffffffffffffffffffffp-16384 ; Rounds to denorm
484 dt $1.0p-16383 ; Denorm
485 dt $1.ffffffffffffffffffffffffffffp-16383 ; Rounds to normal
486 dt $1.0p-16382 ; Smallest non-denorm
487 dt $1.0p+16383 ; Biggest possible exponent
488 dt $1.ffffffffffffffffffffffffffffp+16383 ; Rounds to infinity
489 dt Inf ; Infinity
490 dt NaN
492 ; 128-bit
493 do 1.0
494 do $1.0
495 do 2.0
496 do $2.0
497 do $1.0p+1
498 do $1.0p-1
499 do $0.0
500 do $1.23456789
501 do $0.123456789
502 do $0.0000123456789
503 do $1.23456789p10
504 do $1.23456789p+10
505 do $1.23456789p-10
506 do $0.123456789p10
507 do $0.123456789p+10
508 do $0.123456789abcdef0123456789abcdef012345p-10
509 do $0.0000123456789
510 do $0.0000123456789p+10
511 do $0.0000123456789p-10
512 do $123456789.0
513 do $0000123456789.0
514 do $123456789.0p+0
515 do $123456789.0p+1024
516 do $1.0p-16495 ; Underflow
517 do $1.0p-16494 ; Smallest denorm
518 do $1.ffffffffffffffffffffffffffffffffp-16384 ; Rounds to denorm
519 do $1.0p-16383 ; Denorm
520 do $1.ffffffffffffffffffffffffffffffffp-16383 ; Rounds to normal
521 do $1.0p-16382 ; Smallest non-denorm
522 do $1.0p+16383 ; Biggest possible exponent
523 do $1.ffffffffffffffffffffffffffffffffp+16383 ; Rounds to infinity
524 do Inf ; Infinity
525 do NaN