Commit graph

1716 commits

Author SHA1 Message Date
paulbarker
cd66a1f174 Merged changes r1927-r1963 from the trunk into multiarch branch.
svn path=/branches/multiarch/; revision=1964
2007-09-19 19:18:58 +00:00
Peter Johnson
31ef2e7a52 Support NASM's upcoming RIP-relative syntax, with a few differences.
This adds a "default" directive that takes either "rel" or "abs".  This
sets whether the default mode for simple displacements is RIP-relative (rel)
or not (abs).  The default without a directive is "abs".

Also added is corresponding "rel" and "abs" effective address modifiers
to override whatever default is set:
[rel label] is RIP-relative
[abs label] is not.

In default rel mode, [label] defaults to the former, in default abs mode,
the latter.  Also, segment overrides (note difference from NASM below) are
abs regardless of mode, unless explicitly overridden with rel:
[fs:label] is always abs
[rel fs:label] is always rel

However, we have a number of differences from NASM in this handling due to
what I feel to be yasm's more sane handling of [dword ...] and [qword ...].
In yasm, these set the displacement size, rather than the address size; the
latter is set using a a32/a64 prefix.  I feel this is more sane as in 64-bit
mode the two can be different in the MovOffs (A0/A1 mov *ax) case.

Also, yasm disables default-rel mode if any segment register is used, not
just FS or GS as NASM currently does.

See modules/arch/x86/tests/riprel1.asm and
modules/arch/x86/tests/riprel2.asm for examples, as well as my recent
posting to the nasm-devel mailing list on SF.

svn path=/trunk/yasm/; revision=1963
2007-09-19 07:47:10 +00:00
Peter Johnson
6dfe4b13fd Support "oword", "do", and "reso" as aliases for "dqword", "ddq", and
"resdq" respectively, for compatibility with NASM (sigh).

svn path=/trunk/yasm/; revision=1962
2007-09-19 02:52:33 +00:00
paulbarker
5cbc876ef5 * Added code to the cpp module to pass include directories to the cpp program.
* Marked a string for gettext.
* Fixed a comment error.

svn path=/branches/multiarch/; revision=1961
2007-09-18 12:41:57 +00:00
Peter Johnson
933bf531fd Make Python messages a little less threatening.
Suggested by: Brian Gladman

svn path=/trunk/yasm/; revision=1960
2007-09-18 08:34:57 +00:00
Peter Johnson
75677dee86 Remove unused variable.
svn path=/trunk/yasm/; revision=1959
2007-09-18 05:38:06 +00:00
Peter Johnson
0686569535 Fix VC++ build order dependencies.
Patch by: mu@

svn path=/trunk/yasm/; revision=1958
2007-09-18 05:22:07 +00:00
Peter Johnson
75a28312f3 Ensure Python is available before trying to run gen_x86_insn.py.
Use registry key search to avoid version/location dependency.

Noticed by: Brian Gladman  <brg@gladman.plus.com>

svn path=/trunk/yasm/; revision=1957
2007-09-18 02:33:31 +00:00
Peter Johnson
779b7dd67e Include ctype.h into files that now use tolower().
svn path=/trunk/yasm/; revision=1956
2007-09-17 03:42:01 +00:00
Peter Johnson
4af823161d Make CPU feature flags and registers case insensitive again.
This was accidentally removed in [1929].
Add test case for these so it doesn't happen again.

svn path=/trunk/yasm/; revision=1955
2007-09-17 02:58:05 +00:00
Peter Johnson
1f6c405d98 Add support for IEEE-754r "half precision" (16-bit) float format.
This format is used by SSE5.
Update minor tests; more extensive tests will be added soon.

svn path=/trunk/yasm/; revision=1954
2007-09-16 20:41:16 +00:00
Peter Johnson
a1137cdf67 Add SSE5 (new AMD SSE) instructions support.
svn path=/trunk/yasm/; revision=1953
2007-09-16 20:29:59 +00:00
Peter Johnson
39913f32de Fix #114: Incorrect ELF32 ..gotpc address calculation.
Reported by: Loren Merritt
Fix by: mu@

We already had a testcase for this, but it had an incorrect "golden" result.

svn path=/trunk/yasm/; revision=1952
2007-09-15 06:40:27 +00:00
Peter Johnson
e774242fd1 Finish cleanup made in [1948].
svn path=/trunk/yasm/; revision=1951
2007-09-14 05:19:10 +00:00
Peter Johnson
cbb1bd2771 Switch x86 operand storage from manual bitfields to C structure bitfields.
svn path=/trunk/yasm/; revision=1950
2007-09-13 07:26:17 +00:00
Peter Johnson
42b841418b Change modifiers from a prioritized shifted sequence into an ordered array.
Move GAS suffixes to a separate field in x86_insn_info rather than
having them embedded in the modifier field.

svn path=/trunk/yasm/; revision=1949
2007-09-13 06:35:24 +00:00
Peter Johnson
121de99320 Now that part of the build uses just Python, break apart the Python
and Pyrex (only required for bindings) checks.

svn path=/trunk/yasm/; revision=1948
2007-09-13 02:53:30 +00:00
Peter Johnson
e19fd3ce2b Add Id tag.
svn path=/trunk/yasm/; revision=1947
2007-09-12 07:11:42 +00:00
Peter Johnson
f0e2e9a262 Now that we have more cpu feature bits, properly document SSE4a as such.
Also correct name of k8 chip (clawhammer) and add venice, k10 processors.

svn path=/trunk/yasm/; revision=1946
2007-09-12 07:10:26 +00:00
Peter Johnson
f61ca1e379 Restructure x86 CPU handling to allow for more than 30 CPU feature flags.
svn path=/trunk/yasm/; revision=1945
2007-09-12 06:55:51 +00:00
Peter Johnson
4c0289c7c7 Run gen_x86_insn.py from vc and vc8 builds.
Users who build out of SVN will need to install Python, but this is painless even for
Windows users
(go to http://www.python.org/download/ and download and install the appropriate MSI)

Delete generated files from SVN; these are massive and annoying to keep updated
(massive diffs).

svn path=/trunk/yasm/; revision=1944
2007-09-12 04:15:33 +00:00
Peter Johnson
a7f73e3a6c Shrink the size of the x86_insn_info structure, particularly on 64-bit
systems, by combining operand lists into a single array (and trying to find
overlaps where possible).  This saves about 4K even on a 32-bit system.

Also shrink the generated gperf code by outputting the number of info
structures directly rather than using NELEMS().

svn path=/trunk/yasm/; revision=1943
2007-09-11 04:49:53 +00:00
Peter Johnson
cfcad025c5 Now that genperf takes an output filename, change informational outputs
to stdout instead of stderr.

svn path=/trunk/yasm/; revision=1942
2007-09-11 02:11:19 +00:00
paulbarker
11543884ff Added dependency generation to cpp module.
svn path=/branches/multiarch/; revision=1941
2007-09-10 10:46:31 +00:00
paulbarker
ca7439276e Delayed destruction of arguments list until cpp_preproc_destroy() in cpp module.
svn path=/branches/multiarch/; revision=1940
2007-09-10 10:17:19 +00:00
Peter Johnson
d0033b06c5 Change genperf to take input and output filenames rather than outputting to
standard output.  This makes for better error handling behavior with make
(redirecting the standard output could leave empty files behind on error).

svn path=/trunk/yasm/; revision=1939
2007-09-10 07:15:50 +00:00
Peter Johnson
0e349f552d Check in generated files from the Python script added in [1937].
While I prefer not to have generated files in the source repository,
do this for now in the interest of sanity on the Windows side (to allow
building directly from a SVN checkout).

An alternative might be to require Python on Windows when building from
SVN.  If at some point we decide to go that route, it will be easy enough
to remove these files and add the necessary bits to Mkfiles/vc and
Mkfiles/vc8.

svn path=/trunk/yasm/; revision=1938
2007-09-10 07:03:53 +00:00
Peter Johnson
f150e45913 Change x86 instruction tables to be automatically generated.
This combines the C and perfect hash tables into a single source file,
and allows for easier future changes to the source-level structures.

The Python-built files are included in the distribution so that Python
is not added as a dependency.

The generated code has been verified equal against the old tables,
excepting a number of bugfixes.

Most of the bugs fixed are in the CPU field, plus a few GAS suffix fixes.

svn path=/trunk/yasm/; revision=1937
2007-09-10 06:59:47 +00:00
paulbarker
37b2042a79 Fixed missing semicolon in file.h due to mistake when committing r1935.
svn path=/branches/multiarch/; revision=1936
2007-09-09 17:09:38 +00:00
paulbarker
ac75ded379 Changed gas parser to only pass the first cpp line marker onto the debugging module.
svn path=/branches/multiarch/; revision=1935
2007-09-09 11:51:08 +00:00
paulbarker
44a777ca7c Added yasm_get_include_dir() function.
svn path=/branches/multiarch/; revision=1934
2007-09-09 11:49:25 +00:00
Peter Johnson
502f5a1c4d Re-enable lc3b in flat Mkfiles.
svn path=/trunk/yasm/; revision=1933
2007-09-08 02:19:33 +00:00
Peter Johnson
1387e29705 Windows build fixes:
* modules.vcproj: Add x86cpu.c, x86regtmod.c, and lc3b arch files to fix build.
* x85geninsn.c: Clean up a couple of unused variables.
* genperf.c: Use sprintf instead of snprintf; convert filename backslashes to slashes.

svn path=/trunk/yasm/; revision=1932
2007-09-08 02:13:25 +00:00
Peter Johnson
1afb23f689 Fix a couple of Doxygen nits.
svn path=/trunk/yasm/; revision=1931
2007-09-08 01:34:51 +00:00
Peter Johnson
303c2867de Bring Mkfiles up to date with [1929].
svn path=/trunk/yasm/; revision=1930
2007-09-08 00:04:08 +00:00
Peter Johnson
00e958bcf6 Break apart perfect hash lookup generation and x86 arch-specific
instruction handling.

Use the GNU gperf file format, but continue to use our custom minimal
perfect hash generator.

svn path=/trunk/yasm/; revision=1929
2007-09-07 22:05:33 +00:00
Peter Johnson
32921a0d12 Unbreak distcheck in lc3b tests.
svn path=/trunk/yasm/; revision=1928
2007-09-07 22:03:34 +00:00
Peter Johnson
23c19a1d52 Unbreak distcheck when Python is available by pulling in bitvect.h.
svn path=/trunk/yasm/; revision=1927
2007-09-07 21:49:35 +00:00
paulbarker
5e9f538bb3 Added code to gas parser to handle line markers produced by cpp.
svn path=/branches/multiarch/; revision=1926
2007-09-03 20:20:40 +00:00
paulbarker
d628c6a315 * Marked message strings so gettext can find them.
* Updated POTFILES.in

svn path=/branches/multiarch/; revision=1925
2007-09-01 20:11:11 +00:00
paulbarker
2a1230f14e Tiny documentation fix for recent changes in the preprocessor create() inteface.
svn path=/branches/multiarch/; revision=1924
2007-08-30 21:27:10 +00:00
paulbarker
a956b0e1db Removed FILE* argument from preprocessor create() interface. The preprocessor now opens the input file itself.
svn path=/branches/multiarch/; revision=1923
2007-08-30 21:08:33 +00:00
paulbarker
76d60df7b8 Removed FILE* argument from parser interface. The FILE* given was simply stored and never used.
svn path=/branches/multiarch/; revision=1922
2007-08-30 21:00:38 +00:00
paulbarker
c88fd9dd7e Changed cpp module to destroy the argument list and free the memory it uses.
svn path=/branches/multiarch/; revision=1921
2007-08-30 19:36:57 +00:00
paulbarker
1069d0fce3 Modified cpp module to read directly from the preprocessor using a pipe, rather than storing the output in a temporary file.
svn path=/branches/multiarch/; revision=1920
2007-08-30 11:39:15 +00:00
paulbarker
dc23b37308 Simplified cpp module, re-structuring much of the code and improving comments.
svn path=/branches/multiarch/; revision=1919
2007-08-29 15:40:09 +00:00
paulbarker
0157febba0 Fixed yasm frontend to call the correct wrappers (yasm_preproc_create and yasm_arch_create) rather than directly calling members of the preproc and arch modules.
svn path=/branches/multiarch/; revision=1918
2007-08-29 14:08:19 +00:00
paulbarker
09403aea2a Cleaned up cpp_invoke() function and removed call to asprintf().
svn path=/branches/multiarch/; revision=1917
2007-08-29 12:23:39 +00:00
paulbarker
4f95e61961 Initial version of cpp module (on multiarch branch).
svn path=/branches/multiarch/; revision=1916
2007-08-29 11:33:05 +00:00
Peter Johnson
d88cc90196 Merge [1912], [1913], [1914] into multiarch branch.
svn path=/branches/multiarch/; revision=1915
2007-08-20 05:16:33 +00:00