summaryrefslogtreecommitdiff
path: root/standard.mac
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-10-16 14:40:27 -0700
committerH. Peter Anvin <hpa@zytor.com>2007-10-16 14:40:27 -0700
commitf6c9e65d4f906d0847ef747595de6495c92b9778 (patch)
tree2f37e73e9150c1e8699da19baa9b7deaad669216 /standard.mac
parentfab3a6c9de9c56f1db7770c7c5e0271e33455ea2 (diff)
downloadnasm-f6c9e65d4f906d0847ef747595de6495c92b9778.tar.gz
nasm-f6c9e65d4f906d0847ef747595de6495c92b9778.tar.bz2
nasm-f6c9e65d4f906d0847ef747595de6495c92b9778.zip
Implement floating-point option control directive
New directive [FLOAT] with associated standard macros; allows the setting to be saved and restored.
Diffstat (limited to 'standard.mac')
-rw-r--r--standard.mac27
1 files changed, 27 insertions, 0 deletions
diff --git a/standard.mac b/standard.mac
index bfc2af0..e056352 100644
--- a/standard.mac
+++ b/standard.mac
@@ -111,6 +111,33 @@ __SECT__
[cpu %1]
%endmacro
+%define __FLOAT_DAZ__ nodaz
+%define __FLOAT_ROUND__ near
+; __FLOAT__ contains the whole floating-point configuration so it can
+; be saved and restored
+%define __FLOAT__ __FLOAT_DAZ__ __FLOAT_ROUND__
+%imacro float 1-*.nolist
+%rep %0
+[float %1]
+%ifidni %1,daz
+%define __FLOAT_DAZ__ daz
+%elifidni %1,nodaz
+%define __FLOAT_DAZ__ nodaz
+%elifidni %1,near
+%define __FLOAT_ROUND__ near
+%elifidni %1,up
+%define __FLOAT_ROUND__ up
+%elifidni %1,down
+%define __FLOAT_ROUND__ down
+%elifidni %1,zero
+%define __FLOAT_ROUND__ zero
+%elifidni %1,default
+%define __FLOAT_DAZ__ nodaz
+%define __FLOAT_ROUND__ near
+%endif
+%endrep
+%endmacro
+
%imacro default 1+.nolist
[default %1]
%endmacro