Peter Johnson [Sat, 6 Feb 2010 09:27:32 +0000 (09:27 -0000)]
Add "vsyasm", a batch version of yasm primarily useful for VS2010.
Basically the objfile, listfile, and mapfile options specify output
directories instead of files. Multiple files are accepted and each one
is independently assembled in command line order. All options (such
as include directories and predefined macros) apply to all input files.
Any error terminates the process early.
Summary of changes:
- Correct line numbers will now be reported for warnings and errors
when using the GAS preprocessor
- GAS preprocessor will now replace defined (e.g. via .set) variables
by their values in lines returned to the parser
- GAS preprocessor will now handle multi-line comments correctly
- GAS preprocessor will now handle nested .rept directives correctly
- yasm_linemap_set() now takes virtual_line as a parameter, instead of
always using linemap->current. If 0 is passed for the virtual_line,
then linemap->current is used, as before.
This is because linemap->current was only incremented by the parser
(and never decremented), so the preprocessor was not able to set
mappings during the preprocessing phase (whereas with these changes,
it now does).
Additionally, setting a mapping for a line number will now delete any
existing mappings for line numbers equal or greater to that line
number. This allows the code to correctly handle the case when the
preprocessor first sets mappings from pre-pp lines to post-pp lines,
and later those mappings getting superseded by .line directives in the
original source.
This change also required making a change to yasm_linemap_lookup() to
set *file_line to 0 when line is 0 (i.e. preventing line 0 - which
means "don't display line number in output" - from getting mapped).
Peter Johnson [Wed, 23 Dec 2009 06:45:17 +0000 (06:45 -0000)]
Add initial gas preprocessor, contributed by Alexei Svitkine.
Support for include directive amongst other major key pieces.
Does not currently support macros.
Fixes #79.
Peter Johnson [Mon, 30 Nov 2009 03:43:10 +0000 (03:43 -0000)]
Fix a bunch of GAS x86 instruction issues.
- Fix #193: ljmp/lcall not implemented; add 2-operand far jump to jmp/call.
- Add loop{,z,e} instruction suffixes
- Fix a bunch of jmp/call minor issues.
- Vastly improve suffix handling in general to make more consistent and make
a greater variety of no-suffix instructions work in a way that matches GAS.
Peter Johnson [Sat, 31 Oct 2009 21:52:42 +0000 (21:52 -0000)]
Fix #187: Add new variable CFLAGS_FOR_BUILD for CC_FOR_BUILD compiles.
Due to the need to support cross-building, CC_FOR_BUILD is used instead of
CC for tools that will be run as part of the build process. However, it
is sometimes necessary to add custom CFLAGS for these builds; CFLAGS_FOR_BUILD
supports this cleanly.
Peter Johnson [Thu, 6 Aug 2009 07:13:11 +0000 (07:13 -0000)]
Fix #186: Avoid memory runaway in optimizer TIMES circular reference checking.
Check for duplicates in backtrace used when checking for circular references.
This uses a simple N^2 algorithm (as the number of items in the backtrace is
usually small) but avoids memory runaway due to duplicate item storage.
Peter Johnson [Wed, 3 Jun 2009 05:49:18 +0000 (05:49 -0000)]
Fix #173: Debug full paths were being generated incorrectly.
This was because the path returned by yasm__getcwd() did not have a trailing
slash and thus yasm__combpath() stripped off the last path component.
Peter Johnson [Sun, 10 May 2009 05:24:46 +0000 (05:24 -0000)]
Add support for AMD XOP, FMA4, and CVT16 instructions (replacing SSE5).
AMD has obsoleted the SSE5 spec in favor of these instructions. These
instructions use an AVX-like new opcode structure called XOP instead of
the SSE5 DREX byte.
The AMD FMA4 instructions are a copy of the *old* Intel FMA instructions.
Intel has since updated their spec, and AMD may follow, but for now we've
implemented what AMD's spec contains.
Peter Johnson [Sun, 10 May 2009 05:21:26 +0000 (05:21 -0000)]
Add gencheck.py Python script to make it easier to generate expected results
from long .asm files that generate simple binary output (e.g. for opcode
testing).
Peter Johnson [Fri, 17 Apr 2009 03:25:08 +0000 (03:25 -0000)]
tasm (tweaked nasm) preproc fixes:
- comments stripped before tokenization caused strings containing ';'
to generate warnings (unterminated string) and incorrect output.
- assume directive parsing did not properly handle ';' as end of line
Peter Johnson [Tue, 24 Mar 2009 06:33:32 +0000 (06:33 -0000)]
Fix #155: Don't crash on missing %endmacro.
We were crashing because we didn't generate this error until the preproc
module was getting cleaned up, which doesn't happen until after linemap
is cleaned up. Instead detect and output this error when we reach the end
of preprocessed tokens during the parsing stage.
Peter Johnson [Tue, 24 Mar 2009 05:04:15 +0000 (05:04 -0000)]
Remove vc7 and vc8 build files, as they're no longer being maintained.
There's a Python script (vc98_swap.py) in the Mkfiles/vc9 directory for
those who want to build with vc8.
Peter Johnson [Fri, 20 Mar 2009 07:36:49 +0000 (07:36 -0000)]
Update code generated for alignment padding for more recent processors.
Also match GAS behavior by using different NOP sequences for AMD and Intel.
Different "Long" NOP opcode sequences are used based on the below criteria.
Defaults in 32-bit mode:
- CPU directive not used: backwards compatible (no long NOP opcodes)
- CPU directive with Intel CPU >= 686: Intel guidelines, using long NOPs
- CPU directive with AMD CPU >= K6: AMD guidelines, using long NOPs
Defaults in 64-bit mode:
- CPU directive not used: Intel guidelines, using long NOPs
- CPU directive with Intel CPU >= 686: Intel guidelines, using long NOPs
- CPU directive with AMD CPU >= K6: AMD guidelines, using long NOPs
The above defaults may be overridden with these options to the CPU directive:
- CPU basicnop: backwards compatible (no long NOP opcodes)
- CPU intelnop: Intel guidelines, using long NOPs
- CPU amdnop: AMD guidelines, using long NOPs
Suggested by: Brian Gladman <brg@gladman.plus.com>