summaryrefslogtreecommitdiff
path: root/float.c
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 /float.c
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 'float.c')
-rw-r--r--float.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/float.c b/float.c
index 18156ef..ec37775 100644
--- a/float.c
+++ b/float.c
@@ -776,3 +776,34 @@ int float_const(const char *number, int32_t sign, uint8_t * result,
return 0;
}
}
+
+/* Set floating-point options */
+int float_option(const char *option)
+{
+ if (!nasm_stricmp(option, "daz")) {
+ daz = true;
+ return 0;
+ } else if (!nasm_stricmp(option, "nodaz")) {
+ daz = false;
+ return 0;
+ } else if (!nasm_stricmp(option, "near")) {
+ rc = FLOAT_RC_NEAR;
+ return 0;
+ } else if (!nasm_stricmp(option, "down")) {
+ rc = FLOAT_RC_DOWN;
+ return 0;
+ } else if (!nasm_stricmp(option, "up")) {
+ rc = FLOAT_RC_UP;
+ return 0;
+ } else if (!nasm_stricmp(option, "zero")) {
+ rc = FLOAT_RC_ZERO;
+ return 0;
+ } else if (!nasm_stricmp(option, "default")) {
+ rc = FLOAT_RC_NEAR;
+ daz = false;
+ return 0;
+ } else {
+ return -1; /* Unknown option */
+ }
+}
+