summaryrefslogtreecommitdiff
path: root/test/float.asm
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-09-18 17:50:34 -0700
committerH. Peter Anvin <hpa@zytor.com>2007-09-18 17:50:34 -0700
commite31747e95bba75c7e27d0a76f0e385c6d12351e2 (patch)
treeea6bc9c4c7a3cfc8378a2b91250778e14188d351 /test/float.asm
parentcfbe7c3cc2dbdfe1268e2d0a19fc59b52cbcfcc5 (diff)
downloadnasm-e31747e95bba75c7e27d0a76f0e385c6d12351e2.tar.gz
Unify all standard IEEE floating-point formats; add 128-bit
Unify all the standard IEEE formats into one function, add support for IEEE standard 128-bit floating point numbers. The 80-bit format is still special since it explicitly represents the integer portion.
Diffstat (limited to 'test/float.asm')
-rw-r--r--test/float.asm103
1 files changed, 103 insertions, 0 deletions
diff --git a/test/float.asm b/test/float.asm
new file mode 100644
index 00000000..30d1f062
--- /dev/null
+++ b/test/float.asm
@@ -0,0 +1,103 @@
+;
+; Test of floating-point formats
+;
+
+; 16-bit
+ dw 1.0
+ dw +1.0
+ dw -1.0
+ dw 0.0
+ dw +0.0
+ dw -0.0
+ dw 1.83203125
+ dw +1.83203125
+ dw -1.83203125
+ dw 1.83203125e3
+ dw +1.83203125e3
+ dw -1.83203125e3
+ dw 1.83203125e-3
+ dw +1.83203125e-3
+ dw -1.83203125e-3
+ dw 1.83203125e-6 ; Denormal!
+ dw +1.83203125e-6 ; Denormal!
+ dw -1.83203125e-6 ; Denormal!
+
+; 32-bit
+ dd 1.0
+ dd +1.0
+ dd -1.0
+ dd 0.0
+ dd +0.0
+ dd -0.0
+ dd 1.83203125
+ dd +1.83203125
+ dd -1.83203125
+ dd 1.83203125e15
+ dd +1.83203125e15
+ dd -1.83203125e15
+ dd 1.83203125e-15
+ dd +1.83203125e-15
+ dd -1.83203125e-15
+ dd 1.83203125e-40 ; Denormal!
+ dd +1.83203125e-40 ; Denormal!
+ dd -1.83203125e-40 ; Denormal!
+
+; 64-bit
+ dq 1.0
+ dq +1.0
+ dq -1.0
+ dq 0.0
+ dq +0.0
+ dq -0.0
+ dq 1.83203125
+ dq +1.83203125
+ dq -1.83203125
+ dq 1.83203125e300
+ dq +1.83203125e300
+ dq -1.83203125e300
+ dq 1.83203125e-300
+ dq +1.83203125e-300
+ dq -1.83203125e-300
+ dq 1.83203125e-320 ; Denormal!
+ dq +1.83203125e-320 ; Denormal!
+ dq -1.83203125e-320 ; Denormal!
+
+; 80-bit
+ dt 1.0
+ dt +1.0
+ dt -1.0
+ dt 0.0
+ dt +0.0
+ dt -0.0
+ dt 1.83203125
+ dt +1.83203125
+ dt -1.83203125
+ dt 1.83203125e+4000
+ dt +1.83203125e+4000
+ dt -1.83203125e+4000
+ dt 1.83203125e-4000
+ dt +1.83203125e-4000
+ dt -1.83203125e-4000
+ dt 1.83203125e-4940 ; Denormal!
+ dt +1.83203125e-4940 ; Denormal!
+ dt -1.83203125e-4940 ; Denormal!
+
+; 128-bit
+ do 1.0
+ do +1.0
+ do -1.0
+ do 0.0
+ do +0.0
+ do -0.0
+ do 1.83203125
+ do +1.83203125
+ do -1.83203125
+ do 1.83203125e+4000
+ do +1.83203125e+4000
+ do -1.83203125e+4000
+ do 1.83203125e-4000
+ do +1.83203125e-4000
+ do -1.83203125e-4000
+ do 1.83203125e-4940 ; Denormal!
+ do +1.83203125e-4940 ; Denormal!
+ do -1.83203125e-4940 ; Denormal!