Charles Crayne [Sat, 10 Nov 2007 00:25:43 +0000 (16:25 -0800)]
Update documentation for stack relative directives
Charles Crayne [Fri, 9 Nov 2007 06:11:14 +0000 (22:11 -0800)]
Add flat64 to %stacksize choices
H. Peter Anvin [Fri, 9 Nov 2007 04:43:22 +0000 (20:43 -0800)]
Fix building under OpenWatcom
OpenWatcom doesn't like 64-bit switch arguments; the change to 64-bit
type arguments caused that to happen in outmacho.c. Hack around it
for now; however, realistically speaking the whole bit stealing thing
is probably a bad idea, especially since virtually all CPUs handle
short immediates better than long ones.
H. Peter Anvin [Fri, 9 Nov 2007 04:29:37 +0000 (20:29 -0800)]
ps2pdf: remove -dOptimize=true
Remove -dOptimize=true; it actually generates larger output, since the
optimization performed is "network optimization".
H. Peter Anvin [Fri, 9 Nov 2007 04:21:41 +0000 (20:21 -0800)]
No binary files left in the source distro; unbreak release script
There are no more binary files in the source distro; this broke the
build robot. Comment out the binary file zipping.
H. Peter Anvin [Fri, 9 Nov 2007 04:01:11 +0000 (20:01 -0800)]
BR 1828103: Fix %arg and %local
Correct the implementation of %arg and %local.
It's questionable how much they make sense for 64-bit mode; even in
32-bit mode one normally make references off the stack pointer instead
of the base pointer (frame pointer), but that requires keeping track
of the stack pointer offset.
H. Peter Anvin [Fri, 9 Nov 2007 03:34:01 +0000 (19:34 -0800)]
nasmlib.c: prefix_name(): use the elements() macro
Use the elements() macro to count the elements in a static array.
H. Peter Anvin [Fri, 9 Nov 2007 03:30:22 +0000 (19:30 -0800)]
Move elements() to nasmlib.h
Move elements() to nasmlib.h; that is the best place for this kind of
utility macros.
H. Peter Anvin [Fri, 9 Nov 2007 03:15:33 +0000 (19:15 -0800)]
constipate the "str" argument to bsi() and bsii()
The string argument to bsi() and bsii() should be const.
Charles Crayne [Thu, 8 Nov 2007 03:03:46 +0000 (19:03 -0800)]
Upgrade RAA functions to hold 64-bit data.
Charles Crayne [Wed, 7 Nov 2007 05:48:12 +0000 (21:48 -0800)]
Pass 64-bit instruction lengths to back-ends.
Charles Crayne [Wed, 7 Nov 2007 02:27:23 +0000 (18:27 -0800)]
Prepare for 64-bit instruction lengths
Charles Crayne [Tue, 6 Nov 2007 05:49:49 +0000 (21:49 -0800)]
Disambiguate error messages
Charles Crayne [Tue, 6 Nov 2007 01:19:32 +0000 (17:19 -0800)]
Upgrade label functions to 64-bit
H. Peter Anvin [Mon, 5 Nov 2007 05:09:32 +0000 (21:09 -0800)]
Permit opcode names as labels as long as they are followed by a colon
Permit opcode names to be used as labels if and only if they are
succeeded by a colon. Opcode names occurring when parsing expressions
are all treated as labels; a leading colon occurred when parsing an
instruction forces a parser restart with the instruction forcibly
treated as an identifier.
Charles Crayne [Sun, 4 Nov 2007 23:28:30 +0000 (15:28 -0800)]
Make warning limit valid for both i386 and x86_64
Charles Crayne [Sun, 4 Nov 2007 05:06:13 +0000 (22:06 -0700)]
Warn on out of bounds EA displacements
H. Peter Anvin [Thu, 1 Nov 2007 22:08:27 +0000 (15:08 -0700)]
Treat info files as binary when creating xdoc distro file
info files appear to contain embedded binary information and should
therefore be treated as binary when creating zipfiles.
H. Peter Anvin [Thu, 1 Nov 2007 22:07:42 +0000 (15:07 -0700)]
Remove obsolete binary files from the distribution
Remove a JPEG file and a long-unmaintained support file for an
editor. These are the only binary files in the standard distribution.
H. Peter Anvin [Thu, 1 Nov 2007 21:53:32 +0000 (14:53 -0700)]
Move declarations before statements
C99 permits declarations and statements to be intermixed, so gcc don't
warn about them, but MSVC and OpenWatcom get unhappy about them.
H. Peter Anvin [Thu, 1 Nov 2007 06:37:35 +0000 (23:37 -0700)]
NASM 0.99.06
H. Peter Anvin [Thu, 1 Nov 2007 06:37:19 +0000 (23:37 -0700)]
Script to tag the tree for release
Script to tag the tree for release. Once this tag is pushed
(git push; git push --tags) the build robot will pick it up and
produce the builds.
H. Peter Anvin [Wed, 31 Oct 2007 17:59:26 +0000 (10:59 -0700)]
Even more "riprel" tests
Add a64 and a32 combinations.
H. Peter Anvin [Tue, 30 Oct 2007 08:17:57 +0000 (01:17 -0700)]
floatx.asm: add tests for "rounds up to smallest denorm"
Add tests for the case where we round upwards to reach the smallest
possible denorm, i.e. "saved from underflow by rounding."
H. Peter Anvin [Tue, 30 Oct 2007 08:13:27 +0000 (01:13 -0700)]
Run "make alldeps"
H. Peter Anvin [Tue, 30 Oct 2007 08:13:09 +0000 (01:13 -0700)]
float.c: handle round-up-to-denorm correctly.
H. Peter Anvin [Tue, 30 Oct 2007 07:58:13 +0000 (00:58 -0700)]
Exhaustive test for 8-bit floating point values
H. Peter Anvin [Tue, 30 Oct 2007 06:12:47 +0000 (23:12 -0700)]
Clean up the handing of operands in assemble.c
assemble.c was full of code containing ins->oprs[c - 0xxx] where 0xxx
was the base of the particular code block. Verbose and error prone
when code is moved around. Now we precompute opx = &ins->oprs[c & 3]
before dispatching, resulting in less code.
H. Peter Anvin [Tue, 30 Oct 2007 05:56:08 +0000 (22:56 -0700)]
Don't warn for segmented references
Don't warn for overflow in segmented references; those are linker
references and it is up to the backend or the linker to warn if they
overflow their permitted size.
H. Peter Anvin [Tue, 30 Oct 2007 03:20:12 +0000 (20:20 -0700)]
Use a 32-bit floating-point limb size; support 8-bit float
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.)
Charles Crayne [Tue, 30 Oct 2007 01:24:59 +0000 (18:24 -0700)]
Reduce severity of redundant prefixes from error to warning.
H. Peter Anvin [Mon, 29 Oct 2007 06:23:24 +0000 (23:23 -0700)]
Test of some addressing modes in 64-bit mode.
H. Peter Anvin [Mon, 29 Oct 2007 06:21:46 +0000 (23:21 -0700)]
Fix bogus flagging of effective addresses as invalid
Ah, what a difference a single ~ makes... such as flagging invalid EAs
as valid and vice versa.
H. Peter Anvin [Mon, 29 Oct 2007 06:10:34 +0000 (23:10 -0700)]
Actually shut up the warning in rdfload.c
Shut the warning in rdfload.c up properly...
H. Peter Anvin [Mon, 29 Oct 2007 05:04:42 +0000 (22:04 -0700)]
Clean up stealth whitespace
Remove stealth whitespace
H. Peter Anvin [Mon, 29 Oct 2007 05:02:23 +0000 (22:02 -0700)]
Fix warning about cast to pointer in rdfload.c
Fix warning in rdfload.c about cast to pointer of different size when
compiling on 64 bits. Of course, rdfload is probably useless on 64
bits, but it's pretty useless in the first place.
H. Peter Anvin [Mon, 1 Oct 2007 22:41:25 +0000 (15:41 -0700)]
64-bit addressing and prefix handling changes
Revamp the address- and prefix-handling code to make more sense in
64-bit mode. We are now a lot closer to where we want to be, but
we're not quite there yet.
ndisasm may very well have problems, or give counterintuitive output.
However, checking it in so we can make forward progress.
Charles Crayne [Sun, 28 Oct 2007 22:29:54 +0000 (15:29 -0700)]
Adjust stabs symbol index to match symbol table.
Add data length info to symbol table when stabs is active.
H. Peter Anvin [Sat, 27 Oct 2007 04:38:02 +0000 (21:38 -0700)]
readnum(): handle prefix-suffix collision like "0h"
Suffixed versions of zero will look like both a prefix and a suffix.
Reject the prefixed version as being too short to decode.
H. Peter Anvin [Sat, 27 Oct 2007 01:49:29 +0000 (18:49 -0700)]
Better handling of platforms which hide "extended" functionality
Some platforms apparently feel -std=c99, which defines
__STRICT_ANSI__, should also hide a bunch of function prototypes.
This rather sucks. At least try to deal with it.
MinGW and DJGPP both have this problem, in particular.
Charles Crayne [Wed, 24 Oct 2007 22:51:40 +0000 (15:51 -0700)]
Merge branch 'master' of /home/chuck/development/gitnasm/
Charles Crayne [Wed, 24 Oct 2007 22:30:17 +0000 (15:30 -0700)]
Update sections about debug info formats
H. Peter Anvin [Wed, 24 Oct 2007 22:29:28 +0000 (15:29 -0700)]
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.
Charles Crayne [Wed, 24 Oct 2007 02:28:39 +0000 (19:28 -0700)]
Fix bugs item #1817677
H. Peter Anvin [Tue, 23 Oct 2007 07:08:58 +0000 (00:08 -0700)]
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.
H. Peter Anvin [Tue, 23 Oct 2007 02:48:06 +0000 (19:48 -0700)]
Unbreak particularly tricky hex constants
Unbreak hex constants which contain 'b' or 'd' in potentially tricky
places.
H. Peter Anvin [Tue, 23 Oct 2007 02:37:36 +0000 (19:37 -0700)]
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.
H. Peter Anvin [Tue, 23 Oct 2007 00:34:10 +0000 (17:34 -0700)]
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.
H. Peter Anvin [Mon, 22 Oct 2007 23:53:48 +0000 (16:53 -0700)]
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.
H. Peter Anvin [Sun, 21 Oct 2007 22:32:33 +0000 (15:32 -0700)]
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.
Charles Crayne [Sun, 21 Oct 2007 21:21:43 +0000 (14:21 -0700)]
Clean up elf symbol table section
H. Peter Anvin [Sat, 20 Oct 2007 01:33:57 +0000 (18:33 -0700)]
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.
H. Peter Anvin [Fri, 19 Oct 2007 21:43:22 +0000 (14:43 -0700)]
Scripts to remove stealth whitespace
Scripts to remove stealth whitespace from files and patches,
respectively.
H. Peter Anvin [Fri, 19 Oct 2007 21:42:29 +0000 (14:42 -0700)]
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.
H. Peter Anvin [Fri, 19 Oct 2007 21:26:52 +0000 (14:26 -0700)]
test/floatx.asm: fix test case
"dq" should have been "dt"
H. Peter Anvin [Fri, 19 Oct 2007 21:19:52 +0000 (14:19 -0700)]
uscore.asm: Fix test case
"$1e+16" was missing, instead "$1e16" was duplicated
H. Peter Anvin [Fri, 19 Oct 2007 21:17:51 +0000 (14:17 -0700)]
float.c: mark read_exponent() static
read_exponent() is not used outside float.c; mark static
H. Peter Anvin [Fri, 19 Oct 2007 21:10:35 +0000 (14:10 -0700)]
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.)
H. Peter Anvin [Fri, 19 Oct 2007 20:17:24 +0000 (13:17 -0700)]
Anchor filename locations in .gitignore
In particular, "Makefile" matched "test/Makefile" without the anchor.
H. Peter Anvin [Fri, 19 Oct 2007 20:16:51 +0000 (13:16 -0700)]
test/Makefile: Use -Ox instead of -O999
H. Peter Anvin [Fri, 19 Oct 2007 20:14:06 +0000 (13:14 -0700)]
Test of underscored constants
H. Peter Anvin [Fri, 19 Oct 2007 20:10:46 +0000 (13:10 -0700)]
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.
H. Peter Anvin [Fri, 19 Oct 2007 17:44:56 +0000 (10:44 -0700)]
Modernize nasm.spec.in and make it closer to the Fedora version
Charles Crayne [Fri, 19 Oct 2007 06:33:06 +0000 (23:33 -0700)]
Suppress datarootdir warnings from configure
Charles Crayne [Fri, 19 Oct 2007 04:17:20 +0000 (21:17 -0700)]
Suppress signedness warnings in disassembler
H. Peter Anvin [Fri, 19 Oct 2007 02:12:39 +0000 (19:12 -0700)]
Cleaner solution for MinGW handling of __STRICT_ANSI__
If MinGW is detected, undefine __STRICT_ANSI__ in compiler.h instead.
H. Peter Anvin [Fri, 19 Oct 2007 01:15:18 +0000 (18:15 -0700)]
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.
H. Peter Anvin [Fri, 19 Oct 2007 01:14:26 +0000 (18:14 -0700)]
Fix invocation of readnum()
readnum() takes a boolean for error.
Charles Crayne [Fri, 19 Oct 2007 02:02:42 +0000 (19:02 -0700)]
Suppress a few signedness warnings
root [Fri, 19 Oct 2007 00:04:10 +0000 (17:04 -0700)]
Avoid unnecessary warning on redefinition of section (bug 801180)
Charles Crayne [Thu, 18 Oct 2007 00:55:45 +0000 (17:55 -0700)]
Generate stabs entries for any executable section
H. Peter Anvin [Wed, 17 Oct 2007 05:59:09 +0000 (22:59 -0700)]
NASM 0.99.05
H. Peter Anvin [Tue, 16 Oct 2007 22:46:04 +0000 (15:46 -0700)]
Tests of obscenely large exponents
H. Peter Anvin [Tue, 16 Oct 2007 21:42:32 +0000 (14:42 -0700)]
Comma-separate contents of __FLOAT__
H. Peter Anvin [Tue, 16 Oct 2007 21:40:27 +0000 (14:40 -0700)]
Implement floating-point option control directive
New directive [FLOAT] with associated standard macros; allows the
setting to be saved and restored.
H. Peter Anvin [Tue, 16 Oct 2007 18:48:07 +0000 (11:48 -0700)]
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!
H. Peter Anvin [Tue, 16 Oct 2007 18:32:58 +0000 (11:32 -0700)]
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
H. Peter Anvin [Tue, 16 Oct 2007 17:35:02 +0000 (10:35 -0700)]
Additional entries for .gitignore
H. Peter Anvin [Tue, 16 Oct 2007 17:32:57 +0000 (10:32 -0700)]
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.
H. Peter Anvin [Tue, 16 Oct 2007 17:31:16 +0000 (10:31 -0700)]
Add 1.5 as a test case: representative of an exact fraction
1.5 is an exactly representable fraction, useful for test.
H. Peter Anvin [Tue, 16 Oct 2007 03:06:06 +0000 (20:06 -0700)]
Recognize 'd', 't' and 'y' as radix suffixes
'd', 't' and 'y' now recognized as radix suffixes.
H. Peter Anvin [Tue, 16 Oct 2007 02:53:10 +0000 (19:53 -0700)]
Fix FISTTP opcodes (BR 689695)
H. Peter Anvin [Tue, 16 Oct 2007 02:46:32 +0000 (19:46 -0700)]
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.
H. Peter Anvin [Tue, 16 Oct 2007 00:48:43 +0000 (17:48 -0700)]
Add testnos3 from the gdtoa package (floating-point test)
H. Peter Anvin [Sun, 14 Oct 2007 06:19:21 +0000 (23:19 -0700)]
.gitignore file doesn't need to be in the release file
H. Peter Anvin [Sun, 14 Oct 2007 06:17:41 +0000 (23:17 -0700)]
Add .gitignore file so "git status" produces something sane
Add .gitignore file to tell git about files that don't need to be
tracked.
H. Peter Anvin [Sun, 14 Oct 2007 06:12:46 +0000 (23:12 -0700)]
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.
Keith Kanios [Sat, 13 Oct 2007 14:09:22 +0000 (07:09 -0700)]
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.
Charles Crayne [Fri, 12 Oct 2007 03:32:33 +0000 (20:32 -0700)]
Must define types before using them
H. Peter Anvin [Thu, 11 Oct 2007 20:42:09 +0000 (13:42 -0700)]
preproc.c: move smacro define/undef to separate functions
Instead of tons of replicated code, move smacro define/undef into
separate static functions.
H. Peter Anvin [Thu, 11 Oct 2007 20:38:38 +0000 (13:38 -0700)]
preproc.c: PP_DEFINE and PP_XDEFINE are case-sensitive
The statement for case-sensitivity had PP_DEFINE and PP_IXDEFINE,
rather than PP_XDEFINE.
H. Peter Anvin [Thu, 11 Oct 2007 19:52:03 +0000 (12:52 -0700)]
preproc.c: normalize the handling of case sensitivity
Fix a bug relating to case sensitivity, and make remaining code more
similar.
H. Peter Anvin [Thu, 11 Oct 2007 19:50:24 +0000 (12:50 -0700)]
Define macros necessary for <inttypes.h> on C++
NASM currently doesn't compile with a C++ compiler, but the error
messages are sometimes useful. Define macros necessary for
<inttypes.h> to work with a C++ compiler.
H. Peter Anvin [Thu, 11 Oct 2007 17:12:58 +0000 (10:12 -0700)]
More "bool" fixes
A few more variables passed as pointers which are now defined as bool *.
H. Peter Anvin [Thu, 11 Oct 2007 17:11:57 +0000 (10:11 -0700)]
preproc.c: allow 64-bit repeat counts
Allow the count of %rep to exceed 2^31.
H. Peter Anvin [Thu, 11 Oct 2007 17:06:19 +0000 (10:06 -0700)]
preproc.c: For an SMacro, in_progress really is a boolean (no %rep)
H. Peter Anvin [Thu, 11 Oct 2007 07:05:31 +0000 (00:05 -0700)]
Additional uses of bool and enum
Proper use of bool and enum makes code easier to debug. Do more of
it. In particular, we really should stomp out any residual uses of
magic constants that aren't enums or, in some cases, even #defines.
H. Peter Anvin [Thu, 11 Oct 2007 07:03:26 +0000 (00:03 -0700)]
preproc.c: MMacro.in_progress is not a boolean
Per the comment:
* In a MMacro describing a `%rep' block, the `in_progress' field
* isn't merely boolean, but gives the number of repeats left to
* run.
This fixes the "global" directive not getting recognized, since it
repeats over all its arguments.
H. Peter Anvin [Thu, 11 Oct 2007 01:07:51 +0000 (18:07 -0700)]
saa_fread/fwrite: when seeking, must set [rw]ptr as well
[rw]ptr represent the global position and need to be kept in sync with
[rw]pos:[rw]blk at all times. Failed to do that while seeking, with
obviously bad results.
H. Peter Anvin [Wed, 10 Oct 2007 21:58:45 +0000 (14:58 -0700)]
Use the compiler-provided booleans if available, otherwise emulate
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.