platform/upstream/nasm.git
16 years agoDocument NASM behaviour for 64-bit immediates and displacements
H. Peter Anvin [Tue, 25 Sep 2007 23:01:07 +0000 (16:01 -0700)]
Document NASM behaviour for 64-bit immediates and displacements

Document (intended) NASM behaviour for 64-bit immediates and
displacements.

16 years agotest/movimm.asm: add optimizable forms
H. Peter Anvin [Tue, 25 Sep 2007 22:44:40 +0000 (15:44 -0700)]
test/movimm.asm: add optimizable forms

Add optimizable forms that probably should be shrunk by the optimizer.

16 years agoassemble.c: clean up whitespace
H. Peter Anvin [Tue, 25 Sep 2007 22:41:19 +0000 (15:41 -0700)]
assemble.c: clean up whitespace

Remove stray whitespace

16 years agoCorrect the handling of "MOV" with immediate in 64-bit mode
H. Peter Anvin [Tue, 25 Sep 2007 22:40:36 +0000 (15:40 -0700)]
Correct the handling of "MOV" with immediate in 64-bit mode

Correct the handling of "MOV" with immediate in 64-bit mode.  With
these changes, movimm.asm produces the desired results.

16 years agoTest of immediate handling on 64-bit mode
H. Peter Anvin [Tue, 25 Sep 2007 22:39:42 +0000 (15:39 -0700)]
Test of immediate handling on 64-bit mode

16 years agoAdd nasm_zalloc() to nasmlib.c
H. Peter Anvin [Tue, 25 Sep 2007 21:27:34 +0000 (14:27 -0700)]
Add nasm_zalloc() to nasmlib.c

Add nasm_zalloc(), a wrapper around calloc(), to allocate
zero-initialized memory.  For large allocations, this is often far
more efficient than allocating and zeroing, since the operating system
tends to keep a pool of zero pages around.

16 years agoFix BR 1490407: size of the second operand of LAR/LSL
H. Peter Anvin [Tue, 25 Sep 2007 21:11:29 +0000 (14:11 -0700)]
Fix BR 1490407: size of the second operand of LAR/LSL

The second operand of LAR/LSL is always 16 bits.

16 years agoMakefile.in: make "make install" create directories
H. Peter Anvin [Tue, 25 Sep 2007 20:34:55 +0000 (13:34 -0700)]
Makefile.in: make "make install" create directories

Make "make install" create directories if they don't already exist.

16 years agoFix BR 1445441: uninitialized use of "error_file"
H. Peter Anvin [Tue, 25 Sep 2007 15:47:47 +0000 (08:47 -0700)]
Fix BR 1445441: uninitialized use of "error_file"

16 years agopreproc.c: fix the loop in %undef
H. Peter Anvin [Tue, 25 Sep 2007 04:33:17 +0000 (21:33 -0700)]
preproc.c: fix the loop in %undef

The parent-pointer-based freeing loop in %undef should not advance the
parent pointer when a node is freed, since that will result accessing
freed memory.

16 years agofloat.c: clear off uninitialized warning
H. Peter Anvin [Tue, 25 Sep 2007 03:53:48 +0000 (20:53 -0700)]
float.c: clear off uninitialized warning

Remove uninitialized warning (harmless, but annoying.)

16 years agooutcoff: set the "virtual size field" to zero (BR 1351586)
H. Peter Anvin [Tue, 25 Sep 2007 00:02:07 +0000 (17:02 -0700)]
outcoff: set the "virtual size field" to zero (BR 1351586)

Per SF bug report 1351586:

The COFF spec suggests that the "Virtual Size" field (which
immediately follows the name field inside a section header) be set to
0 for an object file.

By contrast (as documented in comment #4 at the beginning of its
outcoff.c file) NASM sets it to a particular non-0 value.

MASM 6.15 matches NASM for both 16- and 32-bit object files,
i.e. emits non-0 values.

MASM 8 (from VS 2005 Beta) matches the COFF spec for 64-bit object
files, i.e. emits 0.

GAS matches the COFF spec for 32-bit object files (MinGW or Cygwin),
i.e. also emits 0.

Older versions of GNU ld seem to honor said "Virtual Size" field
whereas newer versions do not.  As a result those older versions
generate "bloated" image files.

Since the COFF spec and the real world seem to disagree for this case,
it might make sense to add a method for selecting between the two to
NASM.

Date: 2005-11-28 15:39
Sender: nasm64developer
Logged In: YES
user_id=804543

MASM 8 (from VS 2005 Beta) also matches the COFF spec for 16- and
32-bit object files, i.e. emits 0.

That said, NASM should always emit 0 too. Therefore I am turning this
from a support request into a bug.

16 years agoinsns.dat: SMINT - mark ND, DMINT - fix opcode
H. Peter Anvin [Mon, 24 Sep 2007 22:56:02 +0000 (15:56 -0700)]
insns.dat: SMINT - mark ND, DMINT - fix opcode

Fix the opcode for DMINT (0F 39); mark SMINT (0F 38) as ND since 0F 38
is used as a prefix by newer processors.

16 years ago0F0F is a 3Dnow! prefix; remove from prefix list
H. Peter Anvin [Mon, 24 Sep 2007 22:55:20 +0000 (15:55 -0700)]
0F0F is a 3Dnow! prefix; remove from prefix list

3Dnow! prefixes cannot be disambiguated via pointer chasing, since
the third byte of the opcode field follows the EA.

16 years agoAdditional compaction missed by script
H. Peter Anvin [Mon, 24 Sep 2007 22:48:09 +0000 (15:48 -0700)]
Additional compaction missed by script

Additional mmxreg/mem -> mmxrm and xmmreg/mem -> xmmrm compactions
which the script missed.

16 years agoinsns.dat: machine-generated compaction mmx/xmmreg,mem -> mmx/xmmrm
H. Peter Anvin [Mon, 24 Sep 2007 22:42:53 +0000 (15:42 -0700)]
insns.dat: machine-generated compaction mmx/xmmreg,mem -> mmx/xmmrm

Reduce the total instruction count by compacting mmxreg:mem pairs to
mmxrm and d:o for xmmreg:mem -> xmmrm.

16 years agonasmdoc: grammar fix
H. Peter Anvin [Mon, 24 Sep 2007 20:54:00 +0000 (13:54 -0700)]
nasmdoc: grammar fix

half -> halves

16 years agonasmdoc: remove stray periods
H. Peter Anvin [Mon, 24 Sep 2007 20:44:02 +0000 (13:44 -0700)]
nasmdoc: remove stray periods

A title line doesn't end in a period.

16 years agotest/Makefile: make a bit more useful
H. Peter Anvin [Mon, 24 Sep 2007 20:42:09 +0000 (13:42 -0700)]
test/Makefile: make a bit more useful

16 years agoImplement the -MG option (SF RFE 1564264)
H. Peter Anvin [Mon, 24 Sep 2007 20:41:58 +0000 (13:41 -0700)]
Implement the -MG option (SF RFE 1564264)

Implement the -MG option, to generate dependencies in the presence of
generated files.  In the end, we probably need to support the full
gamut of GCC-like dependency-generation options.

16 years agonasmdoc: clarify __float*__ example
H. Peter Anvin [Mon, 24 Sep 2007 19:52:09 +0000 (12:52 -0700)]
nasmdoc: clarify __float*__ example

16 years agonasmdoc: document the __float*__ operators
H. Peter Anvin [Mon, 24 Sep 2007 19:44:38 +0000 (12:44 -0700)]
nasmdoc: document the __float*__ operators

16 years agoSupport __float*__ for floating-point numbers in expressions
H. Peter Anvin [Mon, 24 Sep 2007 19:30:54 +0000 (12:30 -0700)]
Support __float*__ for floating-point numbers in expressions

Add special operators to allow the use of floating-point constants in
contexts other than DW/DD/DQ/DT/DO.

As part of this checkin, make MAX_KEYWORD generated by tokhash.pl,
since it knows what all the keywords are so it can tell which one is
the longest.

16 years agoeval.c: replace sequence of ifs with switch
H. Peter Anvin [Mon, 24 Sep 2007 17:51:07 +0000 (10:51 -0700)]
eval.c: replace sequence of ifs with switch

Replace a sequence of "if" statements with a switch.

16 years agotokhash: allow a bit smarter pattern matching
H. Peter Anvin [Mon, 24 Sep 2007 17:50:23 +0000 (10:50 -0700)]
tokhash: allow a bit smarter pattern matching

Allow constants to match only part of the token string.

16 years agoImplement INVLPGA according to the documentation
H. Peter Anvin [Sun, 23 Sep 2007 05:33:56 +0000 (22:33 -0700)]
Implement INVLPGA according to the documentation

INVLPGA is defined as taking rax,ecx but "the portion of rax used to
form the address is determined by the effective address size", so it
is really ax/eax/rax.

16 years agoReformat insns.dat to uniform column width
H. Peter Anvin [Sun, 23 Sep 2007 05:02:34 +0000 (22:02 -0700)]
Reformat insns.dat to uniform column width

Add a script to reformat insns.dat to uniform width, and use it.

16 years agoSimple test for 0x67 prefixes
H. Peter Anvin [Sun, 23 Sep 2007 04:50:03 +0000 (21:50 -0700)]
Simple test for 0x67 prefixes

16 years agoAuto-generate 0x67 prefixes without the need for \30x codes
H. Peter Anvin [Sun, 23 Sep 2007 04:49:51 +0000 (21:49 -0700)]
Auto-generate 0x67 prefixes without the need for \30x codes

Auto-generate 0x67 prefixes without the need for \30x codes; the
prefix is automatically added when there is a memory operand with
address size differing from the current address size (and impossible
combinations checked for.)

16 years agoMake test/Makefile a bit more useful
H. Peter Anvin [Sun, 23 Sep 2007 04:47:13 +0000 (21:47 -0700)]
Make test/Makefile a bit more useful

Make all the tests depend on the nasm binary...

16 years agoAdd TY_OWORD for "DO" output
H. Peter Anvin [Sun, 23 Sep 2007 04:29:41 +0000 (21:29 -0700)]
Add TY_OWORD for "DO" output

16 years agoLDDQU needs \301 (BR 1103549)
H. Peter Anvin [Sun, 23 Sep 2007 02:52:11 +0000 (19:52 -0700)]
LDDQU needs \301 (BR 1103549)

16 years agoRDTSCP and INVLPGA aren't 64-bit specific
H. Peter Anvin [Sun, 23 Sep 2007 02:51:13 +0000 (19:51 -0700)]
RDTSCP and INVLPGA aren't 64-bit specific

X64 means X86_64,LM -- long mode only.

16 years agoCyrix GX1 instructions: BBx_RESET, CPU_READ, CPU_WRITE
H. Peter Anvin [Sun, 23 Sep 2007 02:40:37 +0000 (19:40 -0700)]
Cyrix GX1 instructions: BBx_RESET, CPU_READ, CPU_WRITE

16 years agoCentaur XSHA1, XSHA256, MONTMUL
H. Peter Anvin [Sun, 23 Sep 2007 02:28:14 +0000 (19:28 -0700)]
Centaur XSHA1, XSHA256, MONTMUL

16 years agoImplement Centaur's XCRYPT instructions
H. Peter Anvin [Sun, 23 Sep 2007 02:20:56 +0000 (19:20 -0700)]
Implement Centaur's XCRYPT instructions

Implement Centaur's XCRYPT instruction (RFE 825529)

16 years agoAdd Geode LX (AMD's Cyrix-derived core) instructions
H. Peter Anvin [Sun, 23 Sep 2007 02:13:05 +0000 (19:13 -0700)]
Add Geode LX (AMD's Cyrix-derived core) instructions

Add Geode's instructions: DMINT, RDM, PFRCP, PFRSQRT

16 years agoAdd the GETSEC instruction for Intel SMX
H. Peter Anvin [Sun, 23 Sep 2007 02:05:11 +0000 (19:05 -0700)]
Add the GETSEC instruction for Intel SMX

16 years agoAdd the AMD SSE4a and LZCNT instructions
H. Peter Anvin [Sun, 23 Sep 2007 01:59:18 +0000 (18:59 -0700)]
Add the AMD SSE4a and LZCNT instructions

Add AMD SSE4a and LZCNT

16 years agoTag UMOV as ND (no disassembly) to avoid collision
H. Peter Anvin [Sun, 23 Sep 2007 01:23:20 +0000 (18:23 -0700)]
Tag UMOV as ND (no disassembly) to avoid collision

The UMOV opcodes have been recycled; tag UMOV as ND until we have a
better way to specify to the disassembler exactly how it wants
instructions interpreted.

16 years agoDisallow optimizing by less than 5 passes.
H. Peter Anvin [Sun, 23 Sep 2007 01:16:52 +0000 (18:16 -0700)]
Disallow optimizing by less than 5 passes.

Disallow optimizing by less than 5 passes.  If the user requests 2-4
passes, run 5 passes anyway.

16 years agoBR 1783117: Document that %+ needs a space after it, and fix crash
H. Peter Anvin [Sun, 23 Sep 2007 00:45:45 +0000 (17:45 -0700)]
BR 1783117: Document that %+ needs a space after it, and fix crash

Document that %+ needs a space after it due to collision with %+1
syntax for multiline macro arguments; make it issue an error message
rather than crashing.

16 years agonasm.spec.in: minor fixes
H. Peter Anvin [Sat, 22 Sep 2007 23:44:56 +0000 (16:44 -0700)]
nasm.spec.in: minor fixes

%setup needs -n to deal with the case when nasm_version != _version
There is no standard %make macro, just use "make".

16 years agorelease script: handle stricter CLI parsing for "git tag"
H. Peter Anvin [Sat, 22 Sep 2007 23:38:25 +0000 (16:38 -0700)]
release script: handle stricter CLI parsing for "git tag"

The current version of "git tag" seems to demand that the options
precede arguments; the name is an argument, but the -m option and its
parameter is an option.

16 years agoUpdate nasm.spec.in and make it handle rc releases
H. Peter Anvin [Sat, 22 Sep 2007 23:35:11 +0000 (16:35 -0700)]
Update nasm.spec.in and make it handle rc releases

Update nasm.spec.in to match modern conventions, and make it handle rc
releases by using the "mangled" version of the name (1.99.99.91
instead of 2.0rc1).

16 years agoversion.pl: support version numbers of the form X.Y[.Z]rcW
H. Peter Anvin [Sat, 22 Sep 2007 23:19:19 +0000 (16:19 -0700)]
version.pl: support version numbers of the form X.Y[.Z]rcW

Support version numbers of the form X.Y[.Z]rcW where X, Y, Z and W are
numbers.  For the numeric macros, drop them down to a lower level, so
2.0rc1 is treated as version 1.99.99.91.

16 years agoMerge branch 'master' of git+ssh://ccrayne@repo.or.cz/srv/git/nasm
Charles Crayne [Fri, 21 Sep 2007 04:33:43 +0000 (21:33 -0700)]
Merge branch 'master' of git+ssh://ccrayne@repo.or.cz/srv/git/nasm

16 years ago modified: misc/release to fix bug in removing .git
Charles Crayne [Fri, 21 Sep 2007 04:12:33 +0000 (21:12 -0700)]
modified:   misc/release to fix bug in removing .git

16 years agoMerge branch 'master' of git+ssh://repo.or.cz/srv/git/nasm
H. Peter Anvin [Thu, 20 Sep 2007 04:41:43 +0000 (21:41 -0700)]
Merge branch 'master' of git+ssh://repo.or.cz/srv/git/nasm

16 years agoUpdate manual pages
H. Peter Anvin [Thu, 20 Sep 2007 04:41:27 +0000 (21:41 -0700)]
Update manual pages

Update manual pages to include 64-bit support, and remove section
about sync point limits in ndisasm.

16 years agoRemove limit on number of sync points
H. Peter Anvin [Thu, 20 Sep 2007 04:41:02 +0000 (21:41 -0700)]
Remove limit on number of sync points

Make it possible for ndisasm to allocate more memory for sync points
as needed.

16 years agoMake nasm_malloc() et al available from inside ndisasm
H. Peter Anvin [Thu, 20 Sep 2007 04:40:37 +0000 (21:40 -0700)]
Make nasm_malloc() et al available from inside ndisasm

Clean up nasmlib to remove functions irrelevant for ndisasm; make
nasm_malloc() etc usable inside ndisasm.

16 years agoVersion 0.99.03
Frank Kotler [Thu, 20 Sep 2007 01:07:32 +0000 (21:07 -0400)]
Version 0.99.03

16 years agoMerge branch 'master' of git+ssh://fbkotler@repo.or.cz/srv/git/nasm
Frank Kotler [Thu, 20 Sep 2007 01:06:59 +0000 (21:06 -0400)]
Merge branch 'master' of git+ssh://fbkotler@repo.or.cz/srv/git/nasm

16 years agoMerge commit 'origin/sse5'
H. Peter Anvin [Wed, 19 Sep 2007 23:22:03 +0000 (16:22 -0700)]
Merge commit 'origin/sse5'

16 years agotest/Makefile: make a bit more useful
H. Peter Anvin [Wed, 19 Sep 2007 23:15:22 +0000 (16:15 -0700)]
test/Makefile: make a bit more useful

16 years agoSlightly optimize the interface to nasm_token_hash()
H. Peter Anvin [Wed, 19 Sep 2007 05:54:40 +0000 (22:54 -0700)]
Slightly optimize the interface to nasm_token_hash()

Instead of returning -1 from nasm_token_hash, set tv->t_type to
TOKEN_ID and return TOKEN_ID, since that's what stdscan.c wants to do
with it anyway.  This allows us to simply tailcall nasm_token_hash().

16 years agoMerge branch 'master' of git+ssh://fbkotler@repo.or.cz/srv/git/nasm
Frank Kotler [Wed, 19 Sep 2007 05:34:55 +0000 (01:34 -0400)]
Merge branch 'master' of git+ssh://fbkotler@repo.or.cz/srv/git/nasm

16 years agoMerge commit 'origin/master' into sse5
H. Peter Anvin [Wed, 19 Sep 2007 05:23:42 +0000 (22:23 -0700)]
Merge commit 'origin/master' into sse5

16 years agoelf64: fix 32-bit truncations
H. Peter Anvin [Wed, 19 Sep 2007 05:22:49 +0000 (22:22 -0700)]
elf64: fix 32-bit truncations

Fix 32-bit truncations, as evidenced by the following test program:

    mov rax, 8080808080808080h

16 years agoDocument Infinity and NaN
H. Peter Anvin [Wed, 19 Sep 2007 05:08:04 +0000 (22:08 -0700)]
Document Infinity and NaN

Add __Infinity__, __QNaN__, and __SNaN__ to the documentation.

16 years agoSupport generating NaNs and infinities
H. Peter Anvin [Wed, 19 Sep 2007 04:55:56 +0000 (21:55 -0700)]
Support generating NaNs and infinities

Support generating NaNs and infinities as part of floating-point
constants.

16 years agoUpdate documentation
H. Peter Anvin [Wed, 19 Sep 2007 02:12:26 +0000 (19:12 -0700)]
Update documentation

Document new floating-point capabilities, and clean up the discussion
about BITS 64 and REX prefixes.

16 years agoSimple test for hexadecimal floating-point numbers
H. Peter Anvin [Wed, 19 Sep 2007 01:37:36 +0000 (18:37 -0700)]
Simple test for hexadecimal floating-point numbers

Very trivial test for hexadecimal floating-point numbers

16 years agoFix error-reporting in hexadecimal floating-point numbers
H. Peter Anvin [Wed, 19 Sep 2007 01:33:17 +0000 (18:33 -0700)]
Fix error-reporting in hexadecimal floating-point numbers

16 years agoSupport C99-style hexadecimal floating point.
H. Peter Anvin [Wed, 19 Sep 2007 01:31:26 +0000 (18:31 -0700)]
Support C99-style hexadecimal floating point.

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.

16 years agoUnify all standard IEEE floating-point formats; add 128-bit
H. Peter Anvin [Wed, 19 Sep 2007 00:50:34 +0000 (17:50 -0700)]
Unify all standard IEEE floating-point formats; add 128-bit

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.

16 years agoFix handling of DO; support unary + for floating-point numbers
H. Peter Anvin [Wed, 19 Sep 2007 00:49:09 +0000 (17:49 -0700)]
Fix handling of DO; support unary + for floating-point numbers

Floating-point users generally expect to be able to use a unary plus.
Fix support for the DO instruction in several places.

16 years agoSupport 16-bit IEEE floating point; used in SSE5
H. Peter Anvin [Tue, 18 Sep 2007 23:39:03 +0000 (16:39 -0700)]
Support 16-bit IEEE floating point; used in SSE5

SSE5 supports standard IEEE 16-bit floating point, so we should
support that too.

16 years agoMerge commit 'origin/master' into sse5
H. Peter Anvin [Tue, 18 Sep 2007 22:43:40 +0000 (15:43 -0700)]
Merge commit 'origin/master' into sse5

16 years agoAdd NOP with argument to the instruction list
H. Peter Anvin [Tue, 18 Sep 2007 22:43:08 +0000 (15:43 -0700)]
Add NOP with argument to the instruction list

0F 1F /0 is documented as an EA-taking NOP since the P6.
0F 18..1F + EA are all "hinting nops" (instructions which, when
unimplemented, have no effect rather than #UD) but 0F 1F /0
specifically has no operation whatsoever.

16 years agoRemove 0FC2 from list of instruction prefixes
H. Peter Anvin [Tue, 18 Sep 2007 22:24:38 +0000 (15:24 -0700)]
Remove 0FC2 from list of instruction prefixes

0FC2 is not really an instruction prefix; it's the opcode for
CMPPS/CMPSS, which takes a control immediate which Intel chose to have
opcode aliases for.  However, we can't dispatch on a tail byte, so
it's useless.

16 years agoSpeed up the disassembler by allowing prefixed instruction tables
H. Peter Anvin [Tue, 18 Sep 2007 22:08:20 +0000 (15:08 -0700)]
Speed up the disassembler by allowing prefixed instruction tables

Modify the disassembler so that we can have separate instruction
tables for prefixed instructions.  As it was, all instructions which
started with 0F were linearly searched, and that is by now more than
half the instruction set.

16 years agoDocument oword, do and reso
H. Peter Anvin [Tue, 18 Sep 2007 20:45:12 +0000 (13:45 -0700)]
Document oword, do and reso

Document oword and the associated do and reso pseudoinstructions.

16 years agoImplement "oword" (128 bits) as a first-class size
H. Peter Anvin [Tue, 18 Sep 2007 20:01:32 +0000 (13:01 -0700)]
Implement "oword" (128 bits) as a first-class size

Implement oword, reso, do, as well as the SO flag to instructions.  No
instructions are actually flagged with SO yet, but this allows us to
specify 128-bit sizes in instruction patterns.

16 years agoChange the token prehash function for better convergence
H. Peter Anvin [Tue, 18 Sep 2007 19:38:07 +0000 (12:38 -0700)]
Change the token prehash function for better convergence

Combining arithmetric (add) and bitwise (xor) mixing seems to give
better result than either.

With the new prehash function, we find a valid hash much quicker.

16 years agoSSE5 instruction table
H. Peter Anvin [Tue, 18 Sep 2007 19:23:21 +0000 (12:23 -0700)]
SSE5 instruction table

Implement the full SSE5 instruction table.

16 years agoadd "const" to output/outdbg.c
Frank Kotler [Tue, 18 Sep 2007 06:06:09 +0000 (02:06 -0400)]
add "const" to output/outdbg.c

apparently we missed that when updating "const" in other files

16 years agoDisassembler support for SSE5 instructions
H. Peter Anvin [Tue, 18 Sep 2007 01:45:44 +0000 (18:45 -0700)]
Disassembler support for SSE5 instructions

Support for the SSE5 instruction format in the disassembler.

Also adds some comments to insnsd.c for easier debugging.

16 years agoinsns.dat: All SSE5 instructions are AMD
H. Peter Anvin [Tue, 18 Sep 2007 00:27:46 +0000 (17:27 -0700)]
insns.dat: All SSE5 instructions are AMD

SSE5 is an AMD-defined instruction set, so tag those AMD.

16 years agoActually generate SSE5 instructions
H. Peter Anvin [Tue, 18 Sep 2007 00:25:27 +0000 (17:25 -0700)]
Actually generate SSE5 instructions

This checkin completes what is required to actually generate SSE5
instructions.  No support in the disassembler yet.

This checkin covers:

- Support for actually generating DREX prefixes.
- Support for matching operand "operand X must match Y"

16 years agoInitial support for generating DREX suffixes
H. Peter Anvin [Mon, 17 Sep 2007 23:55:04 +0000 (16:55 -0700)]
Initial support for generating DREX suffixes

Initial support for generating DREX suffixes.  Not used yet.  No
disassembler support yet, and no support for "operand X must match
operand Y."

16 years agoFix a few instances of missing renumbers
H. Peter Anvin [Mon, 17 Sep 2007 23:31:33 +0000 (16:31 -0700)]
Fix a few instances of missing renumbers

parser.c: change hard-coded argument count 3 to MAX_ARGUMENTS
assemble.c: change a few missed code renumbers

16 years agoEnable IF_AR3
H. Peter Anvin [Mon, 17 Sep 2007 23:20:45 +0000 (16:20 -0700)]
Enable IF_AR3

Enable IF_AR3, which was incorrectly disabled in a previous checkin.

16 years agoMerge commit 'origin/master' into sse5
H. Peter Anvin [Mon, 17 Sep 2007 22:49:53 +0000 (15:49 -0700)]
Merge commit 'origin/master' into sse5

16 years agoInitial support for four arguments per instruction
H. Peter Anvin [Mon, 17 Sep 2007 22:49:30 +0000 (15:49 -0700)]
Initial support for four arguments per instruction

For SSE5, we will need to support four arguments per instruction.

16 years agoCLFLUSH: Neither an x64 instruction nor AMD
H. Peter Anvin [Mon, 17 Sep 2007 22:48:32 +0000 (15:48 -0700)]
CLFLUSH: Neither an x64 instruction nor AMD

CLFLUSH was introduced at least in Katmai, if not sooner.  It's
available in all modes.

16 years agoSort dependency lists
H. Peter Anvin [Mon, 17 Sep 2007 20:56:26 +0000 (13:56 -0700)]
Sort dependency lists

Sort the dependency lists generated by "mkdep.pl", to make sure that
re-running "make alldeps" doesn't change anything unless there has
been real dependency changes.  The previous version could produce
different output between runs and across platforms.

16 years agoCleaner way to handle MSVC's _snprintf() underscore damage
H. Peter Anvin [Mon, 17 Sep 2007 20:53:14 +0000 (13:53 -0700)]
Cleaner way to handle MSVC's _snprintf() underscore damage

Some versions of MSVC have snprintf() and vsnprintf() only with a
leading underscore.  Handle that a bit more cleanly.

16 years agotest/r13.asm: test special-casing of rbp and r13 in 64-bit mode
H. Peter Anvin [Mon, 17 Sep 2007 20:19:25 +0000 (13:19 -0700)]
test/r13.asm: test special-casing of rbp and r13 in 64-bit mode

Test that we correctly special-case the modr/m generation for r13 in
64-bit mode.

16 years agoAdditional documentation for 64-bit programming
H. Peter Anvin [Mon, 17 Sep 2007 20:03:33 +0000 (13:03 -0700)]
Additional documentation for 64-bit programming

Flesh out the documentation for 64-bit programming a little bit; in
particular, include links to the ABI documentation for various
platforms.

16 years agoINSTALL: MSVC++ compilation instructions
H. Peter Anvin [Mon, 17 Sep 2007 05:27:07 +0000 (22:27 -0700)]
INSTALL: MSVC++ compilation instructions

Update compilation instructions for MSVC++, and point out that it's
not just Unix systems which can use the GNU instructions -- it also
applies to MacOS X and Windows with either Cygwin or MinGW.

16 years agomake alldeps: change Mkfiles/Makefile.* to Mkfiles/*.mak
H. Peter Anvin [Mon, 17 Sep 2007 05:17:29 +0000 (22:17 -0700)]
make alldeps: change Mkfiles/Makefile.* to Mkfiles/*.mak

The previous checkin switched to the naming scheme *.mak to be able to
be more descriptive.  Thus, change "make alldeps" accordingly.

16 years agoFix Makefile for MSVC++ 2005, delete obsolete Makefiles
H. Peter Anvin [Mon, 17 Sep 2007 05:16:24 +0000 (22:16 -0700)]
Fix Makefile for MSVC++ 2005, delete obsolete Makefiles

New Makefile for MSVC++ 2005, delete old unmaintained Makefiles.

16 years agoMinor fixes needed to compile with MSVC++ 2005
H. Peter Anvin [Mon, 17 Sep 2007 05:14:50 +0000 (22:14 -0700)]
Minor fixes needed to compile with MSVC++ 2005

Minor fixes to make it possible to compile with MS Visual C++ 2005.
Unfortunately, MSVC++ is not fully C99 compliant; in particular, it
doesn't handle interspersed declarations and other code.  Furthermore,
it chokes on some expressions in outelf64.c, which fortunately can be
easily substituted with simpler expressions.

16 years agoRun "make alldeps"
H. Peter Anvin [Mon, 17 Sep 2007 01:35:02 +0000 (18:35 -0700)]
Run "make alldeps"

16 years agoSwitch the preprocessor over to using the hash table library
H. Peter Anvin [Mon, 17 Sep 2007 00:57:25 +0000 (17:57 -0700)]
Switch the preprocessor over to using the hash table library

Switch the preprocessor over to using the hash table library.  On my
system, this improves the runtime of the output of test/pref/macro.pl
from over 600 seconds to 7 seconds.

Macros have an odd mix of case-sensitive and case-insensitive
behaviour, plus there are matching parameters for arguments, etc.  As
a result, we use case-insensitive hash tables and use a linked list to
store all the possible isomorphs.

16 years agoFix the handling of local labels
H. Peter Anvin [Mon, 17 Sep 2007 00:53:17 +0000 (17:53 -0700)]
Fix the handling of local labels

In converting the label system over to the new hash table library,
accidentally broke local labels by prepending the prefix twice.  Fix.

16 years agopreproc.c: remove unnecessary int64_t
H. Peter Anvin [Sat, 15 Sep 2007 01:36:01 +0000 (18:36 -0700)]
preproc.c: remove unnecessary int64_t

We hardly need to support more than 2^31 arguments to a macro.

16 years agoUse the new hash table function library to store labels
H. Peter Anvin [Sat, 15 Sep 2007 01:03:29 +0000 (18:03 -0700)]
Use the new hash table function library to store labels

Use the new hash table function library to store labels.  When
compiling on my 64-bit system, it reduces the assembly time for the
output of test/perf/label.pl from 73 to 7 seconds.