Commit Graph

630 Commits

Author SHA1 Message Date
H. Peter Anvin
19315e012f Enable IF_AR3
Enable IF_AR3, which was incorrectly disabled in a previous checkin.
2007-09-17 16:20:45 -07:00
H. Peter Anvin
18b78815b9 Merge commit 'origin/master' into sse5 2007-09-17 15:49:53 -07:00
H. Peter Anvin
7eb4a38793 Initial support for four arguments per instruction
For SSE5, we will need to support four arguments per instruction.
2007-09-17 15:49:30 -07:00
H. Peter Anvin
2dba5c218d CLFLUSH: Neither an x64 instruction nor AMD
CLFLUSH was introduced at least in Katmai, if not sooner.  It's
available in all modes.
2007-09-17 15:48:32 -07:00
H. Peter Anvin
3a7edd73a3 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.
2007-09-17 13:56:26 -07:00
H. Peter Anvin
b8af9aa522 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.
2007-09-17 13:53:14 -07:00
H. Peter Anvin
2ced2ec370 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.
2007-09-17 13:19:25 -07:00
H. Peter Anvin
2f3c4c056e 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.
2007-09-17 13:03:33 -07:00
H. Peter Anvin
b9957462d6 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.
2007-09-16 22:27:07 -07:00
H. Peter Anvin
39afbce9d4 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.
2007-09-16 22:17:29 -07:00
H. Peter Anvin
e8bfecf275 Fix Makefile for MSVC++ 2005, delete obsolete Makefiles
New Makefile for MSVC++ 2005, delete old unmaintained Makefiles.
2007-09-16 22:16:24 -07:00
H. Peter Anvin
21d6be423f 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.
2007-09-16 22:15:34 -07:00
H. Peter Anvin
9e8e948f86 Run "make alldeps" 2007-09-16 18:35:02 -07:00
H. Peter Anvin
97a234782d 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.
2007-09-16 18:04:57 -07:00
H. Peter Anvin
d2fb7a699e 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.
2007-09-16 17:53:17 -07:00
H. Peter Anvin
8cfdb9d185 preproc.c: remove unnecessary int64_t
We hardly need to support more than 2^31 arguments to a macro.
2007-09-14 18:36:01 -07:00
H. Peter Anvin
6244f4b5b9 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.
2007-09-14 18:03:29 -07:00
H. Peter Anvin
cde08292d6 Define a proper hash table library
Define a proper hash table library, instead of the current ad hoc stuff
used for both labels and macros.  This only implements the actual
library; it is not yet used.

We use a CRC64 as a prehash.  This is almost certainly overkill,
although it is rather efficient (except, arguably, the table lookup)
on 64-bit platforms, and not all that bad on 32-bit platforms.  All we
really need is a function which produces two independent 32-bit
results which are used as the primary and secondary hash
respectively.  Either way, the prehash function is easily replacable
if/when we have a quicker alternative.
2007-09-14 09:24:38 -07:00
H. Peter Anvin
9ab60dabcc Simple performance benchmarks: label, macro and token lookups
Simple scripts to generate performance benchmarks for label,
macro and token lookups.  The label and macro lookups are simple
numerical sequences; it may be desirable to add some more
sophisticated algorithms for producing tokens in case we want to
compare different hash functions against each other.
2007-09-13 18:13:20 -07:00
H. Peter Anvin
942acbf782 release script: fix final cleanup
Make sure we're in the right place for the final cleanup.
2007-09-13 12:25:32 -07:00
H. Peter Anvin
c338779174 Modify release script for a git-centric world
Change the release script to use git rather than CVS.
THE BEHAVIOR OF THE SCRIPT HAS CHANGED -- make sure to look at it
before use.
2007-09-13 12:22:00 -07:00
H. Peter Anvin
1a6e76d682 pptok.c: don't insist on C99 compiler behaviour
Declarations that are not at the head is C99 behaviour, but it's
rather pointless for this little piece of code.  Fix to work with
older compilers.
2007-09-13 11:06:42 -07:00
H. Peter Anvin
388b3ab3a3 Fix literal F2 and F3 prefixes
Correct literal F2 and F3 prefixes and instead use \332 and \333.
Otherwise we get the REX prefixes in the wrong place.
2007-09-12 22:02:06 -07:00
H. Peter Anvin
cb9b690ae6 Add (untested!) SSSE3, SSE4.1, SSE4.2 instructions
Add the SSSE3, SSE4.1 and SSE4.2 instruction sets.  Change \332 to be
a literal 0xF2 prefix, by analog with \333 for 0xF3 prefix (the
previous \332 flag changed to \335).  This is necessary to get the REX
prefix in the right place for instructions that use it.

We are going to have to go in and change existing instruction patterns
which use these, as well.
2007-09-12 21:58:51 -07:00
H. Peter Anvin
daffd79372 Add support for Tejas New Instructions (SSSE3)
Add the SSSE3 instruction set.
2007-09-12 21:06:36 -07:00
H. Peter Anvin
d105682096 Remove $Id$ tags (useless with git)
Remove CVS $Id$ tags, since git doesn't use them.
2007-09-12 21:05:06 -07:00
H. Peter Anvin
c9f8ee92f0 Use rm32 operands for VMREAD/VMWRITE
Use rm32 instead of coding reg32 and mem32 separately.
2007-09-12 21:04:58 -07:00
H. Peter Anvin
2e7dd975eb Macros for SSSE3/SSE4 instruction sets
Add instruction set flags for the SSSE3, SSE4.1 and SSE4.2 instruction
subsets.
2007-09-12 21:04:51 -07:00
H. Peter Anvin
0da6b580eb Support r/m operands for non-integer types
Support r/m operands for non-integer operands types, i.e. mmx or xmm
operands.  This allows mmx and xmm operands to be written more
compactly, speeding up the assembler.
2007-09-12 21:04:39 -07:00
H. Peter Anvin
16b0a33cea Use enumerations where practical to ease debugging
We have a lot of enumerations; by declaring fields as such, we make it
easier when debugging, since the debugger can display the enumerations
in cleartext.  However, make sure exceptional values (like -1) are
included in the enumeration, since the compiler otherwise may not
include it in the valid range of the enumeration.
2007-09-12 20:27:41 -07:00
H. Peter Anvin
7978feebd2 pptok.c: quick-and-dirty downcasing during prehashing
Speed up pptok.c by just doing |= 0x20 instead of calling tolower() for
every character during prehashing.  This is good enough for our needs,
since we don't have any tokens containing the characters @ [ \ ] _ nor
any high-bit characters (in which case we'd have to worry about multibyte
anyway.)
2007-09-12 17:02:55 +00:00
H. Peter Anvin
ff6e9b4699 phash: Tell the user when the graph is OK
Tell the user when the graph is OK, so that we don't get quite so much of
"a list of errors followed by a long pause."
2007-09-12 16:55:57 +00:00
H. Peter Anvin
3100e6cb63 pptok.c: handle holes in the pp_directives array
We need to fail if we land in a hole in the pp_directives array, since
we have a noncontiguous enum preproc_token now.
2007-09-12 05:18:20 +00:00
H. Peter Anvin
95e28828ab preproc.c: adjust whitespace
Be consistent about whitespace.
2007-09-12 04:20:08 +00:00
H. Peter Anvin
da10e7b85e More automation in the preprocessor conditionals handling
Further automate the production of preprocessor conditionals.  Now the
code automatically folds if/elif and the negatives.
2007-09-12 04:18:37 +00:00
H. Peter Anvin
872460fe27 pptok.c: fix spacing 2007-09-12 02:13:39 +00:00
H. Peter Anvin
9bf0aa7c52 Generate automatically correct tests for %if and %elif
Automatically generate macros to test for %if and %elif variants, which
are guaranteed to be correct across future changes.
2007-09-12 02:12:07 +00:00
H. Peter Anvin
9e1c202b69 Run "make alldeps"; add dependencies missing from the previous checkin
It helps to run "make alldeps" when the changes are actually complete...
2007-09-12 01:34:19 +00:00
H. Peter Anvin
4169a47bd9 Use a perfect hash to look up preprocessor directives
Use a perfect hash to look up preprocessor directives, and generate
the preprocessor directive list automatically.
2007-09-12 01:29:43 +00:00
H. Peter Anvin
cdea6f96b6 phash: Be a bit more aggressive about trying to make a small hash
Change the threshold to 0.7 instead of 0.8.
2007-09-12 01:27:53 +00:00
H. Peter Anvin
ce9be34d3d Add RCXZ as a known preprocessor condition 2007-09-12 00:22:29 +00:00
H. Peter Anvin
9c06db6935 doc: add some cross-references 2007-09-11 23:57:23 +00:00
H. Peter Anvin
9b49e24e1f Feeble attempt at updating the documentation; remove Appendix B
Feeble attempt to document 64-bit support.  Also, remove Appendix B since
we have been utterly useless at keeping it up to date, and it's redundant
with the processor manufacturer's documentation anyway.
2007-09-11 23:52:01 +00:00
H. Peter Anvin
62cb606f68 Handle instructions which can have both REX.W and OSP 2007-09-11 22:44:03 +00:00
H. Peter Anvin
b79f0d0cc3 Use enums to make debugging easier
When we're dealing with a field which is guaranteed to have an enum type,
then declare it as such so it shows up in debuggers.
2007-09-11 22:14:18 +00:00
H. Peter Anvin
2ba7ed7122 ndisasm: handle \366 codes, prefer unprefixed instructions
- Implement \366 codes in ndisasm
- Prefer instruction patterns without loose prefixes if possible
- Fix improper initialization of operands in ndisasm
2007-09-11 22:13:17 +00:00
H. Peter Anvin
4f090502fb Simplify tokens.dat slightly 2007-09-11 22:00:34 +00:00
H. Peter Anvin
bfb888c015 Quiet gcc warning about uninitialized variables 2007-09-11 04:26:44 +00:00
H. Peter Anvin
3360d79369 Make the big instruction arrays "const"
Make the big instruction arrays "const", so they end up in readonly
storage.  While we're at it, move their prototypes into insns.h.
2007-09-11 04:16:57 +00:00
H. Peter Anvin
ea6bfb8107 Use an actual enum for the opcode
Use an actual named enum for the opcode, that way it shows up in
cleartext while debugging.
2007-09-10 23:32:05 +00:00