Commit Graph

773 Commits

Author SHA1 Message Date
Charles Crayne
31600d6988 Merge branch 'master' of /home/chuck/development/gitnasm/ 2007-10-24 15:51:40 -07:00
Charles Crayne
650dc9d004 Update sections about debug info formats 2007-10-24 15:30:17 -07:00
H. Peter Anvin
c2df282092 Fix the handling of floating-point tokens in the preprocessor
Correct the handling of floating-point tokens in the preprocessor.
The preprocessor scanner and the main scanner really are painfully
divergent for no good reason.
2007-10-24 15:29:51 -07:00
Charles Crayne
f6816b25bf Fix bugs item #1817677 2007-10-23 19:28:39 -07:00
H. Peter Anvin
30b795fd10 Slightly simplify the radix-detection code
(pradix && pradix > sradix) etc. is unnecessary since pradix and
sradix cannot be negative, so zero is always the smallest value.

Put in a comment explaining why making the default radix == 10 doesn't
need any additional error checking.
2007-10-23 00:08:58 -07:00
H. Peter Anvin
50620f4a3f Unbreak particularly tricky hex constants
Unbreak hex constants which contain 'b' or 'd' in potentially tricky
places.
2007-10-22 19:48:06 -07:00
H. Peter Anvin
f41aef273b Decimal floating point can also start with 0. 0e 0E
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.
2007-10-22 19:37:36 -07:00
H. Peter Anvin
c65a2f634b Support binary and octal floating-point
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.
2007-10-22 17:34:10 -07:00
H. Peter Anvin
bea0bbb62c More consistent handling of radix letters
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.
2007-10-22 16:53:48 -07:00
H. Peter Anvin
3b2ad1bc37 float.c: correct exponent capping
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.
2007-10-21 15:33:01 -07:00
Charles Crayne
b0e1d423dd Clean up elf symbol table section 2007-10-21 14:21:43 -07:00
H. Peter Anvin
449e04b330 Allow $-prefixed hexadecimal FP as an alternative to 0x
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.
2007-10-19 18:33:57 -07:00
H. Peter Anvin
2d25ce4555 Scripts to remove stealth whitespace
Scripts to remove stealth whitespace from files and patches,
respectively.
2007-10-19 14:43:22 -07:00
H. Peter Anvin
7065309739 Formatting: kill off "stealth whitespace"
"Stealth whitespace" makes it harder to read diffs, and just generally
cause unwanted weirdness.  Do a source-wide pass to get rid of it.
2007-10-19 14:42:29 -07:00
H. Peter Anvin
31420e76d1 test/floatx.asm: fix test case
"dq" should have been "dt"
2007-10-19 14:26:52 -07:00
H. Peter Anvin
513e3c1bd2 uscore.asm: Fix test case
"$1e+16" was missing, instead "$1e16" was duplicated
2007-10-19 14:19:52 -07:00
H. Peter Anvin
3514ad0e6c float.c: mark read_exponent() static
read_exponent() is not used outside float.c; mark static
2007-10-19 14:17:51 -07:00
H. Peter Anvin
37d88e4125 Don't confuse suffixed hexadecimal with floating-point
1e30 is a floating-point constant, but 1e30h is not.  The scanner
won't know that until it sees the "h", so make sure we keep enough
state to be able to distinguish "1e30" (a possible hex constant) from
"1.e30", "1e+30" or "1.0" (unabiguously floating-point.)
2007-10-19 14:10:35 -07:00
H. Peter Anvin
f5f3d70d6d Anchor filename locations in .gitignore
In particular, "Makefile" matched "test/Makefile" without the anchor.
2007-10-19 13:17:24 -07:00
H. Peter Anvin
487a087066 test/Makefile: Use -Ox instead of -O999 2007-10-19 13:16:51 -07:00
H. Peter Anvin
361584882e Test of underscored constants 2007-10-19 13:14:06 -07:00
H. Peter Anvin
2ef4aac272 Allow underscores in numbers; better detection of FP
- 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.
2007-10-19 13:10:46 -07:00
H. Peter Anvin
a8eace2b79 Modernize nasm.spec.in and make it closer to the Fedora version 2007-10-19 10:52:31 -07:00
Charles Crayne
f3eea3d539 Suppress datarootdir warnings from configure 2007-10-18 23:33:06 -07:00
Charles Crayne
46b31b0f08 Suppress signedness warnings in disassembler 2007-10-18 21:17:20 -07:00
H. Peter Anvin
26573020d8 Cleaner solution for MinGW handling of __STRICT_ANSI__
If MinGW is detected, undefine __STRICT_ANSI__ in compiler.h instead.
2007-10-18 19:14:08 -07:00
H. Peter Anvin
8088815922 configure: Undefine __STRICT_ANSI__ for mingw's benefit
mingw makes a bunch of prototypes unavailable if __STRICT_ANSI__ is
defined.  However, they are still detected by configure, which causes
us pain.
2007-10-18 19:14:08 -07:00
H. Peter Anvin
684f98b636 Fix invocation of readnum()
readnum() takes a boolean for error.
2007-10-18 19:14:07 -07:00
Charles Crayne
192d5b5e9c Suppress a few signedness warnings 2007-10-18 19:02:42 -07:00
root
2674b04d88 Avoid unnecessary warning on redefinition of section (bug 801180) 2007-10-18 17:04:10 -07:00
Charles Crayne
f23a5b042c Generate stabs entries for any executable section 2007-10-17 17:55:45 -07:00
H. Peter Anvin
e911708790 NASM 0.99.05 2007-10-16 22:59:09 -07:00
H. Peter Anvin
a366cac2a6 Tests of obscenely large exponents 2007-10-16 15:46:04 -07:00
H. Peter Anvin
9563910747 Comma-separate contents of __FLOAT__ 2007-10-16 14:42:32 -07:00
H. Peter Anvin
f6c9e65d4f Implement floating-point option control directive
New directive [FLOAT] with associated standard macros; allows the
setting to be saved and restored.
2007-10-16 14:40:27 -07:00
H. Peter Anvin
fab3a6c9de Floating-point warning fixes; fix round-to-overflow
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!
2007-10-16 11:48:07 -07:00
H. Peter Anvin
125c878e96 Handle rounding of denorms correctly; make fp overflow a warning
- Handle rounding of denorms correctly
- Make fp overflow a warning, not an error (produces Inf)
- Make fp warnings controllable
2007-10-16 11:32:58 -07:00
H. Peter Anvin
630b52013a Additional entries for .gitignore 2007-10-16 10:35:02 -07:00
H. Peter Anvin
4da5b8c2dd Refactor floating-point formatting code; fix 80-bit denorms
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.
2007-10-16 10:32:57 -07:00
H. Peter Anvin
61872221ad Add 1.5 as a test case: representative of an exact fraction
1.5 is an exactly representable fraction, useful for test.
2007-10-16 10:31:16 -07:00
H. Peter Anvin
b2f6fef421 Recognize 'd', 't' and 'y' as radix suffixes
'd', 't' and 'y' now recognized as radix suffixes.
2007-10-15 20:06:06 -07:00
H. Peter Anvin
826ffa9c8e Fix FISTTP opcodes (BR 689695) 2007-10-15 19:53:10 -07:00
H. Peter Anvin
214f549c5c New floating-point conversion routines
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.
2007-10-15 19:46:32 -07:00
H. Peter Anvin
32f21f16fc Add testnos3 from the gdtoa package (floating-point test) 2007-10-15 17:48:43 -07:00
H. Peter Anvin
cc94919aa3 .gitignore file doesn't need to be in the release file 2007-10-13 23:19:21 -07:00
H. Peter Anvin
3abe3c51a6 Add .gitignore file so "git status" produces something sane
Add .gitignore file to tell git about files that don't need to be
tracked.
2007-10-13 23:17:41 -07:00
H. Peter Anvin
70a5d14b89 autoconf: drop AC_USE_SYSTEM_EXTENSIONS to support autoconf 2.59
AC_USE_SYSTEM_EXTENSIONS requires autoconf 2.61, which is still a
little too new, apparently.  Unless we have a specific reason to
include it, don't.
2007-10-13 23:12:46 -07:00
Keith Kanios
a5fc6467ab Fix 32-bit types in preproc.c and eval.c
Fix 32-bit types in preproc.c and eval.c that should have been 64-bit
types.  This allows %assign to work correctly with 64-bit integers.
2007-10-13 07:09:22 -07:00
Charles Crayne
b263b504bc Must define types before using them 2007-10-11 20:32:33 -07:00
H. Peter Anvin
4db5a16128 preproc.c: move smacro define/undef to separate functions
Instead of tons of replicated code, move smacro define/undef into
separate static functions.
2007-10-11 13:42:09 -07:00