summaryrefslogtreecommitdiff
path: root/float.c
Commit message (Collapse)AuthorAgeFilesLines
* style cleanupCyrill Gorcunov2009-10-131-271/+271
| | | | | | | | | Convert tabs to spaces. Eliminate empty comments. No change on binary level. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* Add copyright headers to the *.c/*.h files in the main directoryH. Peter Anvin2009-06-281-6/+33
| | | | | | | | | | Add copyright headers to the *.c/*.h files in the main directory. For files where I'm sure enough that we have all the approvals, I have given them the 2-BSD license, the others have been given the "LGPL for now" license header. Most of them can probably be changed after auditing. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* For consistency, allow 0p.. prefix for packed BCDH. Peter Anvin2008-07-031-3/+4
| | | | Allow 0p... to be used as a prefix, for analogy with base conversion.
* float: support packed-BCD constants in 'dt' statementsH. Peter Anvin2008-07-031-7/+70
| | | | | Support packed-BCD constants in 'dt' statements (and elsewhere 80-bit floating point is handled), using MASM syntax (terminal 'p').
* float: fix buffer overrunH. Peter Anvin2008-07-031-2/+2
| | | | | Fix a buffer overrun; generally causing hexadecimal constants to be incorrectly rejected.
* float.c: BR 1879670: fix output byte orderH. Peter Anvin2008-01-251-1/+1
| | | | | The fix for the memory overwrite output the bytes in the wrong order. Fix.
* float.c: fix memory overwrite with 8-, 16- or 80-bit constantsH. Peter Anvin2008-01-211-20/+3
| | | | | We incorrectly clobbered 4 extra bytes when serializing 8-, 16- or 80-bit constants. Be less smart, but actually correct.
* regularized spelling of license to match name of LICENSE fileBeroset2007-12-291-1/+1
|
* Make the definition for float_const() match the prototypeH. Peter Anvin2007-11-171-1/+1
| | | | | The definition for float_const() had int32_t, the prototype had only int. We only care about the sign, so int makes more sense.
* Address data is int64_t; simplify writing an address objectH. Peter Anvin2007-11-131-1/+1
| | | | | | | Address data is always int64_t even if the size itself is smaller; this was broken on bigendian hosts (still need testing!) Create simple "write sized object" macros.
* float.c: all warnings and errors are pass 1 onlyH. Peter Anvin2007-11-121-17/+16
| | | | | None of the floating-point errors or warnings are anything but pass 1 only; use the ERR_PASS1 flag to capture that.
* float.c: handle round-up-to-denorm correctly.H. Peter Anvin2007-10-301-8/+3
|
* Use a 32-bit floating-point limb size; support 8-bit floatH. Peter Anvin2007-10-291-154/+190
| | | | | | | | | | Use a 32-bit limb size ("like a digit, but bigger") for floating-point conversion. This cuts the number of multiplications per constant by a factor of four. This means supporting fractional-limb-sized numbers, so while we're at it, add support for 8-bit floating point numbers (apparently used in graphics and in audio compression applications.)
* Decimal floating point can also start with 0. 0e 0EH. Peter Anvin2007-10-221-9/+2
| | | | | | A floating point number starting with 0. 0e or 0E is still decimal. Make it easier by falling back to the standard decimal conversion routine for anything not recognized as a radix prefix.
* Support binary and octal floating-pointH. Peter Anvin2007-10-221-24/+54
| | | | | | For consistency, support binary and octal floating-point, and accept a "0d" or "0t" prefix for decimal floating-point. However, we do not accept a binary exponent (p) for a decimal mantissa, or vice versa.
* More consistent handling of radix lettersH. Peter Anvin2007-10-221-1/+2
| | | | | | | | | | Allow any radix letter from the set [bydtoqhx] to be used either "Intel-style" (0...x) or "C-style" (0x...). In Intel style, the leading 0 remains optional as long as the first digit is in the range 0-9. As a consequence, allow the prefix "0h" for hexadecimal floating point.
* float.c: correct exponent cappingH. Peter Anvin2007-10-211-4/+3
| | | | | | | | | | | Actually enforce the exponent capping, as opposed to only enforcing it to within a factor of 10. Furthermore, continue to scan the string in order to check for invalid characters. Finally, 16384 is too tight of a bound for a binary exponent: it's a tight bound, but the shift added due to the digit string can move the cap into the active region (±16383). Thus, change it to 20000 to be on the safe side.
* Allow $-prefixed hexadecimal FP as an alternative to 0xH. Peter Anvin2007-10-191-0/+2
| | | | | | Since we allow the prefix $ instead of 0x for integer constants, do the same for floating point. No suffix support at this time; we may want to consider if that would be appropriate.
* Formatting: kill off "stealth whitespace"H. Peter Anvin2007-10-191-6/+5
| | | | | "Stealth whitespace" makes it harder to read diffs, and just generally cause unwanted weirdness. Do a source-wide pass to get rid of it.
* float.c: mark read_exponent() staticH. Peter Anvin2007-10-191-1/+1
| | | | read_exponent() is not used outside float.c; mark static
* Allow underscores in numbers; better detection of FPH. Peter Anvin2007-10-191-42/+61
| | | | | | | | | - Allow underscores as group separators in numbers, for example: 0x1234_5678 is now a legal number. The underscore is just ignored, it adds no meaning. - Recognize dotless floating-point numbers, such as "1e30". This entails distinguishing hexadecimal numbers in the scanner, since e.g. 0x1e30 is a perfectly legitimate hex constant.
* Implement floating-point option control directiveH. Peter Anvin2007-10-161-0/+31
| | | | | New directive [FLOAT] with associated standard macros; allows the setting to be saved and restored.
* Floating-point warning fixes; fix round-to-overflowH. Peter Anvin2007-10-161-10/+37
| | | | | | | | Actually generate the appropriate floating-point warnings, and only one per assembly, pretty please. Correct the round-to-overflow condition; as written all numbers with a positive exponent were considered overflows!
* Handle rounding of denorms correctly; make fp overflow a warningH. Peter Anvin2007-10-161-13/+21
| | | | | | - Handle rounding of denorms correctly - Make fp overflow a warning, not an error (produces Inf) - Make fp warnings controllable
* Refactor floating-point formatting code; fix 80-bit denormsH. Peter Anvin2007-10-161-181/+152
| | | | | | Refactor the floating-point formatting code so that the 80-bit format can be supported with common code. This fixes 80-bit denorms as a side effect; the shift value in 80-bit denorms was completely wrong.
* New floating-point conversion routinesH. Peter Anvin2007-10-151-302/+528
| | | | | | | Substitute in nasm64developer's "acfloat4" routine. This floating-point conversion routine is not perfect (it gets a fair number of LSB errors), but the old NASM code was just plain broken. nasm64developer's code at least gets within ±1 LSB.
* Use the compiler-provided booleans if available, otherwise emulateH. Peter Anvin2007-10-101-9/+6
| | | | | | | Both C and C++ have "bool", "true" and "false" in lower case; C requires <stdbool.h> for this, in C++ it is an inherent type built into the compiler. Use those instead of the old macros; emulate with a simple typedef enum if unavailable.
* float.c: correct the exponentH. Peter Anvin2007-10-041-1/+1
| | | | | We would accidentally produce an exponent which was exactly +1 from the correct one.
* Portability fixesH. Peter Anvin2007-10-021-0/+2
| | | | | | | | | Concentrate compiler dependencies to compiler.h; make sure compiler.h is included first in every .c file (since some prototypes may depend on the presence of feature request macros.) Actually use the conditional inclusion of various functions (totally broken in previous releases.)
* float.c: clear off uninitialized warningH. Peter Anvin2007-09-241-0/+2
| | | | Remove uninitialized warning (harmless, but annoying.)
* Support generating NaNs and infinitiesH. Peter Anvin2007-09-181-60/+122
| | | | | Support generating NaNs and infinities as part of floating-point constants.
* Fix error-reporting in hexadecimal floating-point numbersH. Peter Anvin2007-09-181-1/+1
|
* Support C99-style hexadecimal floating point.H. Peter Anvin2007-09-181-0/+91
| | | | | | Add support for C99-style hexadecimal floating point. The format is 0x <hexadecimal mantissa> p <binary exponent>. 0x1.0e+1 thus is the same as 2.0.
* Unify all standard IEEE floating-point formats; add 128-bitH. Peter Anvin2007-09-181-142/+64
| | | | | | | | 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.
* Support 16-bit IEEE floating point; used in SSE5H. Peter Anvin2007-09-181-4/+67
| | | | | SSE5 supports standard IEEE 16-bit floating point, so we should support that too.
* Fixed distinction between char and int8_t data types.Keith Kanios2007-04-131-7/+7
|
* General push for x86-64 support, dubbed 0.99.00.Keith Kanios2007-04-121-25/+26
|
* Apply Nindent to all .c and .h filesnasm-0.98.39LATESTH. Peter Anvin2005-01-151-253/+256
|
* Add ieee_ prefix to filenames with otherwise highly ambiguous names;H. Peter Anvin2004-12-291-26/+26
| | | | esp round() which is a standard C function.
* NASM 0.98p3nasm-0.98p3H. Peter Anvin2002-04-301-14/+24
|
* NASM 0.95nasm-0.95H. Peter Anvin2002-04-301-6/+10
|
* NASM 0.91nasm-0.91H. Peter Anvin2002-04-301-0/+389