From f6c9e65d4f906d0847ef747595de6495c92b9778 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Tue, 16 Oct 2007 14:40:27 -0700 Subject: Implement floating-point option control directive New directive [FLOAT] with associated standard macros; allows the setting to be saved and restored. --- float.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'float.c') 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 */ + } +} + -- cgit v1.2.3