]> granicus.if.org Git - yasm/log
yasm
18 years agoCheck for more complex circular references.
Peter Johnson [Sat, 24 Jun 2006 06:56:49 +0000 (06:56 -0000)]
Check for more complex circular references.

svn path=/branches/new-optimizer/; revision=1590

18 years agoSupport optimization of multiple.
Peter Johnson [Wed, 21 Jun 2006 06:25:52 +0000 (06:25 -0000)]
Support optimization of multiple.

svn path=/branches/new-optimizer/; revision=1589

18 years agoUnbreak compat-queue.h on non-BSD systems.
Peter Johnson [Wed, 21 Jun 2006 06:19:07 +0000 (06:19 -0000)]
Unbreak compat-queue.h on non-BSD systems.

svn path=/branches/new-optimizer/; revision=1588

18 years agoUpdate POTFILES for new optimizer; disable lc3b as it's not active yet.
Peter Johnson [Wed, 21 Jun 2006 04:40:09 +0000 (04:40 -0000)]
Update POTFILES for new optimizer; disable lc3b as it's not active yet.

svn path=/branches/new-optimizer/; revision=1587

18 years agoIn preparation for further work on optimizing multiple, break multiple apart
Peter Johnson [Tue, 20 Jun 2006 06:23:07 +0000 (06:23 -0000)]
In preparation for further work on optimizing multiple, break multiple apart
from bytecode.len into bytecode.mult_int.  Add new function
yasm_bc_next_offset() to handle the most common use case of bytecode.len,
figuring out the following bytecode's offset.

svn path=/branches/new-optimizer/; revision=1586

18 years agoStart implementing support for multiples.
Peter Johnson [Mon, 19 Jun 2006 06:18:11 +0000 (06:18 -0000)]
Start implementing support for multiples.

svn path=/branches/new-optimizer/; revision=1585

18 years agoMake imm8 expansion work.
Peter Johnson [Mon, 19 Jun 2006 03:54:20 +0000 (03:54 -0000)]
Make imm8 expansion work.
This was broken because I had precbc and precbc2 purposes swapped in the
optimizer.

svn path=/branches/new-optimizer/; revision=1584

18 years agoSupport align. Made a few other minor cleanups while doing so.
Peter Johnson [Sun, 18 Jun 2006 21:29:26 +0000 (21:29 -0000)]
Support align.  Made a few other minor cleanups while doing so.

svn path=/branches/new-optimizer/; revision=1583

18 years agoThanks to [1581], x86id seems to be correct now, so commit updated golden
Peter Johnson [Thu, 15 Jun 2006 06:47:24 +0000 (06:47 -0000)]
Thanks to [1581], x86id seems to be correct now, so commit updated golden
files.

svn path=/branches/new-optimizer/; revision=1582

18 years agoFix some bugs in step 2. Actually pass len_diff to expand_term and don't
Peter Johnson [Thu, 15 Jun 2006 06:38:30 +0000 (06:38 -0000)]
Fix some bugs in step 2.  Actually pass len_diff to expand_term and don't
expand inactive spans (per the algorithm documentation).

In the interval tree addition, sanity check inputs so high is always higher
than low.

Add a sanity check to x86_bc_jmp_expand() to detect trying to expand an
already-expanded jump.

svn path=/branches/new-optimizer/; revision=1581

18 years agoImplement first cut at optimizer step 2. Limitations:
Peter Johnson [Wed, 14 Jun 2006 07:23:49 +0000 (07:23 -0000)]
Implement first cut at optimizer step 2.  Limitations:
- Does not detect cycles, so will infinite loop.
- Does not yet handle secondary expansion of bc offset bytecodes.
However, dwarf64_leb128 now generates essentially identical code to GAS
(except GAS generates relocs for in-file function refs, whereas yasm does not)
x86id tests also now work, but have not been checked yet (so no checkin of
new golden results yet).

svn path=/branches/new-optimizer/; revision=1578

18 years agoBuild up interval tree. Change how SPECIAL_BC_OFFSET is handled for better
Peter Johnson [Tue, 13 Jun 2006 06:37:37 +0000 (06:37 -0000)]
Build up interval tree.  Change how SPECIAL_BC_OFFSET is handled for better
code commonality.  Change optd.spans to a doubly-linked list and delete
directly from it rather than deactivating.

svn path=/branches/new-optimizer/; revision=1577

18 years ago* compat-queue.h: Update; adds FOREACH_*_SAFE, removes circular queues.
Peter Johnson [Tue, 13 Jun 2006 05:09:09 +0000 (05:09 -0000)]
* compat-queue.h: Update; adds FOREACH_*_SAFE, removes circular queues.

svn path=/branches/new-optimizer/; revision=1576

18 years agoMove towards building interval tree by splitting dependent value into
Peter Johnson [Mon, 12 Jun 2006 07:53:49 +0000 (07:53 -0000)]
Move towards building interval tree by splitting dependent value into
sym-sym terms.  Starting to get some code duplication that should get
refactored somehow, but the first priority is getting it working.

svn path=/branches/new-optimizer/; revision=1575

18 years agoyasm_intnum_set_int(): Oops; compile before committing next time.
Peter Johnson [Mon, 12 Jun 2006 05:30:22 +0000 (05:30 -0000)]
yasm_intnum_set_int(): Oops; compile before committing next time.

svn path=/branches/new-optimizer/; revision=1574

18 years agoAdd yasm_intnum_set_int().
Peter Johnson [Mon, 12 Jun 2006 05:29:22 +0000 (05:29 -0000)]
Add yasm_intnum_set_int().

svn path=/branches/new-optimizer/; revision=1573

18 years agoSet svn:keywords on inttree.c and inttree.h.
Peter Johnson [Sun, 11 Jun 2006 22:04:34 +0000 (22:04 -0000)]
Set svn:keywords on inttree.c and inttree.h.

svn path=/branches/new-optimizer/; revision=1572

18 years agoActually bring interval tree implementation into repo.
Peter Johnson [Sun, 11 Jun 2006 22:03:50 +0000 (22:03 -0000)]
Actually bring interval tree implementation into repo.

svn path=/branches/new-optimizer/; revision=1571

18 years agox86_bc_insn_expand(): Don't require ea/imm to be abs to expand, and check
Peter Johnson [Sun, 11 Jun 2006 20:30:46 +0000 (20:30 -0000)]
x86_bc_insn_expand(): Don't require ea/imm to be abs to expand, and check
span ID.
dwarf32_testhd.hex: New optimizer downsizes .text by 4 bytes, update.

svn path=/branches/new-optimizer/; revision=1570

18 years agoRevert value.c/h changes made in [1567].
Peter Johnson [Sun, 11 Jun 2006 20:12:51 +0000 (20:12 -0000)]
Revert value.c/h changes made in [1567].

svn path=/branches/new-optimizer/; revision=1569

18 years agoMove closer to implementing Q.
Peter Johnson [Sun, 11 Jun 2006 08:51:19 +0000 (08:51 -0000)]
Move closer to implementing Q.

svn path=/branches/new-optimizer/; revision=1568

18 years agoImplement first phase of align and org.
Peter Johnson [Sun, 11 Jun 2006 06:57:03 +0000 (06:57 -0000)]
Implement first phase of align and org.

svn path=/branches/new-optimizer/; revision=1567

18 years agoReimplement optimizer pass 1b and fix x86 so that jumps handle one pass of
Peter Johnson [Sat, 10 Jun 2006 20:34:32 +0000 (20:34 -0000)]
Reimplement optimizer pass 1b and fix x86 so that jumps handle one pass of
expansion.

svn path=/branches/new-optimizer/; revision=1566

18 years agox86_bc_insn_tobytes(): Fix the case where we get here with imm8 post-op
Peter Johnson [Sat, 10 Jun 2006 18:35:36 +0000 (18:35 -0000)]
x86_bc_insn_tobytes(): Fix the case where we get here with imm8 post-op
still enabled; we need to fix up the immlen to 8 (as it's maintained with
the wordsize version up to this point).

svn path=/branches/new-optimizer/; revision=1565

18 years agoReintegrate stabs dbgfmt.
Peter Johnson [Sat, 10 Jun 2006 17:24:13 +0000 (17:24 -0000)]
Reintegrate stabs dbgfmt.

svn path=/branches/new-optimizer/; revision=1564

18 years agox86_bc_jmp_calc_len(): Make sure we always set jmp->op_sel.
Peter Johnson [Sat, 10 Jun 2006 17:00:19 +0000 (17:00 -0000)]
x86_bc_jmp_calc_len(): Make sure we always set jmp->op_sel.

svn path=/branches/new-optimizer/; revision=1563

18 years agoyasm_object_optimize(): Fix error/warning handling by using the new method.
Peter Johnson [Sat, 10 Jun 2006 16:54:45 +0000 (16:54 -0000)]
yasm_object_optimize(): Fix error/warning handling by using the new method.
effaddr.asm: Disable now-unsupported construct of [reg*(label2-label)].
x86_bc_insn_calc_len(): Don't destroy NULL intnum.

svn path=/branches/new-optimizer/; revision=1562

18 years agoFix all tests with miscomparing object files. Dramatically clean up some
Peter Johnson [Sat, 10 Jun 2006 08:00:14 +0000 (08:00 -0000)]
Fix all tests with miscomparing object files.  Dramatically clean up some
x86 code (mainly x86_checkea_calc_displen(), and parts of
x86_bc_insn_calc_len()) to use new yasm_value_get_intnum().
Allow NULL to be passed as bc to yasm_value_get_intnum() to prevent
calculation of PC-relative values (returning NULL instead).

svn path=/branches/new-optimizer/; revision=1561

18 years agoGet rid of origin_prevbc; it's no longer needed due to yasm_value handling
Peter Johnson [Sat, 10 Jun 2006 04:01:12 +0000 (04:01 -0000)]
Get rid of origin_prevbc; it's no longer needed due to yasm_value handling
of PC-relative values.

Add new yasm_value_get_intnum(); this is a simplified variant of
yasm_value_output_basic().

svn path=/branches/new-optimizer/; revision=1560

18 years agoGet rid of calc_bc_dist_func, the only times this was used was when
Peter Johnson [Wed, 7 Jun 2006 04:01:33 +0000 (04:01 -0000)]
Get rid of calc_bc_dist_func, the only times this was used was when
yasm_common_calc_bc_dist was used.  Rename yasm_common_calc_bc_dist to
yasm_calc_bc_dist, call it directly from the expr functions, and change
higher-level callers to boolean flags of whether to calculate bc distance
or not.

svn path=/branches/new-optimizer/; revision=1550

18 years agoChange yasm_value macros into functions. Fix up the prototype of
Peter Johnson [Wed, 31 May 2006 06:25:28 +0000 (06:25 -0000)]
Change yasm_value macros into functions.  Fix up the prototype of
yasm_value_init_sym (which was out of date).

svn path=/branches/new-optimizer/; revision=1546

18 years agoMerge [1333]-[1543] (inclusive) into new-optimizer branch. This results in
Peter Johnson [Wed, 31 May 2006 06:13:01 +0000 (06:13 -0000)]
Merge [1333]-[1543] (inclusive) into new-optimizer branch.  This results in
a temporary regression of functionality but will yield some benefits later
on (chief among them is easier eventual merging back to the mainline!).

svn path=/branches/new-optimizer/; revision=1545

18 years agoChange calc_len to call back to add_span function so that multiple spans can
Peter Johnson [Sun, 28 May 2006 04:54:44 +0000 (04:54 -0000)]
Change calc_len to call back to add_span function so that multiple spans can
be added by a single calc_len.

svn path=/branches/new-optimizer/; revision=1544

18 years ago* x86parse.gap: Update pushf generation to match popf for legalization and
Peter Johnson [Mon, 22 May 2006 06:19:04 +0000 (06:19 -0000)]
* x86parse.gap: Update pushf generation to match popf for legalization and
prefix regarding pushfq vs 64-bit mode.
* pushf.asm, pushf-err.asm: New tests for pushf and popf in all modes.

Reported by: Vivek Mohan <vivek.mt@gmail.com>

svn path=/trunk/yasm/; revision=1542

18 years ago* x86id.c: Add support for 64-bit far jmp/call. These are not listed in the
Peter Johnson [Fri, 12 May 2006 02:12:19 +0000 (02:12 -0000)]
* x86id.c: Add support for 64-bit far jmp/call.  These are not listed in the
AMD64 ISA reference but are in the Intel EM64T reference.
* x86arch.h: Add CPU_EM64T flag.
* x86parse.gap: Add CPU_EM64T as feature and enable it as part of "prescott".
* far64.asm: Test for 64-bit far jmp/call.

svn path=/trunk/yasm/; revision=1540

18 years ago* value.c (yasm_value_output_basic): The destsize parameter accidentally got
Peter Johnson [Fri, 12 May 2006 02:00:04 +0000 (02:00 -0000)]
* value.c (yasm_value_output_basic): The destsize parameter accidentally got
out of sync with the header file (should be size_t).

svn path=/trunk/yasm/; revision=1539

18 years agoFix major bug related to multiple handling. Unfortunately this slows down
Peter Johnson [Thu, 11 May 2006 07:00:33 +0000 (07:00 -0000)]
Fix major bug related to multiple handling.  Unfortunately this slows down
bytecode multiple output significantly, but this way handles generating
relocations correctly (otherwise extern foo; times 5 dd foo doesn't work!).

* bytecode.h (yasm_bc_tobytes): Remove multiple output parameter.
(yasm_bc_get_multiple): New.
* bytecode.c (yasm_bc_tobytes): Update to iterate through multiple here.
(yasm_bc_get_multiple): New.
* xdf-objfmt.c, elf-objfmt.c, bin-objfmt.c, coff-objfmt.c: Don't iterate
through multiple here.
* nasm-listfmt.c: Use yasm_bc_get_multiple() to get multiple instead of
yasm_bc_tobytes().

* bytecode.pxi: Update.

* tests/win32-relocovfl.asm: Tests both this and [1534] but generates too
huge of a file (3MB) to be put into the automated tests.

svn path=/trunk/yasm/; revision=1536

18 years ago* coff-objfmt.c: Support >=64K relocs on Win32/64 objects.
Peter Johnson [Thu, 11 May 2006 05:43:22 +0000 (05:43 -0000)]
* coff-objfmt.c: Support >=64K relocs on Win32/64 objects.

svn path=/trunk/yasm/; revision=1535

18 years ago* coretype.h (yasm_value): Add size field (specified in bits).
Peter Johnson [Wed, 10 May 2006 08:54:52 +0000 (08:54 -0000)]
* coretype.h (yasm_value): Add size field (specified in bits).
(yasm_value_output_func): Remove valsize and shift parameters.
* bytecode.h (yasm_effaddr): Remove disp_len, replacing with
need_nonzero_len.
(yasm_immval): Remove len.
* value.h (yasm_value_initialize): Add size parameter.
(yasm_value_finalize_expr): Likewise.
(yasm_value_output_basic): Remove valsize and shift parameters.

Update all implementations and users for the above.

* intnum.c (yasm_intnum_calc): Fix bug in shift right (was doing a logical
instead of arithmetic shift).

* lc3b-basic.asm, lc3b-basic.errwarn, lc3b-basic.hex: Update based on
fixed warnings.

svn path=/trunk/yasm/; revision=1534

18 years ago* Mkfiles: Update to match [1532].
Peter Johnson [Wed, 10 May 2006 04:18:45 +0000 (04:18 -0000)]
* Mkfiles: Update to match [1532].

svn path=/trunk/yasm/; revision=1533

18 years ago* bc-int.h (yasm_bytecode_callback): Add reserve flag to indicate if the
Peter Johnson [Wed, 10 May 2006 04:18:23 +0000 (04:18 -0000)]
* bc-int.h (yasm_bytecode_callback): Add reserve flag to indicate if the
bytecode outputs just space and not data.
* bytecode.pxi: Update to match.
* bytecode.c (yasm_bc_tobytes): Use reserve flag instead of checking
against bytecode_reserve as special case.
* dwarf2-info.c, dwarf2-line.c, dwarf2-dbgfmt.c, cv-symline.c, cv-type.c,
* stabs-dbgfmt.c, lc3bbc.c, x86bc.c: Update to set reserve=0.

* bc-align.c, bc-insn.c, bc-reserve.c, bc-org.c, bc-incbin.c, bc-data.c,
* bytecode.c: Split out bytecodes into separate files.  While we're here,
merge LEB128 into general data bytecode.

svn path=/trunk/yasm/; revision=1532

18 years ago* expr.c (expr_get_item): Refactor itempool code.
Peter Johnson [Tue, 9 May 2006 05:17:44 +0000 (05:17 -0000)]
* expr.c (expr_get_item): Refactor itempool code.

svn path=/trunk/yasm/; revision=1531

18 years agoTry to combine as much data as possible into single raw (used to be string)
Peter Johnson [Mon, 8 May 2006 08:08:15 +0000 (08:08 -0000)]
Try to combine as much data as possible into single raw (used to be string)
dataval data bytecode blocks.  This drastically cuts down on dataval
overhead for large sets of constant data (savings of 30% or more on peak
memory usage in some cases).  We may try to improve this even more down the
road by doing things like combining across multiple data bytecodes and
converting constant instructions into raw bytes.

* bytecode.c (yasm_bc_create_data): Add (optional) yasm_arch operand so that
bytes can be generated from constant values of >1 byte size.  Do as much
simplification to constant raw bytes here as possible.
(bytecode_data): No longer a need to remember append_zero.
(bc_data_resolve, bc_data_output): Update to not handle append_zero.
(yasm_dataval): Rename string to raw.
(yasm_dv_create_string): Rename to:
(yasm_dv_create_raw): Here.

* bytecode.h (yasm_dv_create_string): Change into macro that casts parameters
into yasm_dv_create_raw().
(yasm_dv_create_raw): New.

modules: Update for new yasm_bc_create_data() parameter.

svn path=/trunk/yasm/; revision=1530

18 years ago* expr.c: Don't hit the allocator so hard with tiny temporary requests when
Peter Johnson [Mon, 8 May 2006 07:51:23 +0000 (07:51 -0000)]
* expr.c: Don't hit the allocator so hard with tiny temporary requests when
creating expressions; instead, keep a pool of 31 yasm_expr__items and pull
from those instead of malloc/free'ing.

svn path=/trunk/yasm/; revision=1529

18 years agoAdd/Use helpers to pass void* as manually type-checked PyCObjects.
Michael Urman [Sun, 7 May 2006 18:23:33 +0000 (18:23 -0000)]
Add/Use helpers to pass void* as manually type-checked PyCObjects.

svn path=/trunk/yasm/; revision=1528

18 years agoRework yasm.Expression to accept strings like '+' to indicate operation.
Michael Urman [Sun, 7 May 2006 16:41:16 +0000 (16:41 -0000)]
Rework yasm.Expression to accept strings like '+' to indicate operation.
Add tests for yasm.Expression and new yasm.ImmVal.

svn path=/trunk/yasm/; revision=1527

18 years agoRaise SymbolTable redefinition errors in Python.
Michael Urman [Sun, 7 May 2006 03:22:03 +0000 (03:22 -0000)]
Raise SymbolTable redefinition errors in Python.
Fix a double-free problem encountered during this testing.
Redefine symtab.define_special() vis parameter to match symrec.visibility.

svn path=/trunk/yasm/; revision=1526

18 years ago* errwarn.c (yasm_error_matches): Make real function, fix a bug with checking
Peter Johnson [Sun, 7 May 2006 02:35:50 +0000 (02:35 -0000)]
* errwarn.c (yasm_error_matches): Make real function, fix a bug with checking
against YASM_ERROR_GENERAL errors.
* errwarn.h (yasm_error_matches): Remove #defined function.

svn path=/trunk/yasm/; revision=1525

18 years agoRaise IntNum division by zero errors in Python.
Michael Urman [Sat, 6 May 2006 19:12:05 +0000 (19:12 -0000)]
Raise IntNum division by zero errors in Python.

svn path=/trunk/yasm/; revision=1524

18 years ago* lc3barch.c (lc3b_get_fill): Fix type-punning warning on GCC 4.1.
Peter Johnson [Sat, 6 May 2006 16:11:56 +0000 (16:11 -0000)]
* lc3barch.c (lc3b_get_fill): Fix type-punning warning on GCC 4.1.
* x86arch.c (x86_get_fill): Likewise.
* yasm.c: Fix long-standing warning.

svn path=/trunk/yasm/; revision=1523

18 years ago* errwarn.h (yasm_warn_set, yasm_warn_set_va): Fix doxygen arg list comments.
Peter Johnson [Fri, 5 May 2006 03:02:42 +0000 (03:02 -0000)]
* errwarn.h (yasm_warn_set, yasm_warn_set_va): Fix doxygen arg list comments.

svn path=/trunk/yasm/; revision=1522

18 years agoRevamp error/warning handling, using a model similar to Python's internal
Peter Johnson [Thu, 4 May 2006 07:55:32 +0000 (07:55 -0000)]
Revamp error/warning handling, using a model similar to Python's internal
exception handling.  There are now two layers an error or warning goes
through before it hits the user: first an error is logged via
yasm_error_set() (or yasm_warn_set() for a warning).  Only one error may
be set, whereas multiple warnings can be set (yasm_warn_set maintains a
linked list).  Then, calling yasm_errwarn_propagate() propagates any error
and/or warning(s) to an errwarns structure and associates the
errors/warnings with a line number at that time; this call also clears the
pending errors/warnings and allows new ones to be set.  The propagate
function can safely be called when there are no pending error/warnings.

In addition, there are some helper errwarn functions that allow clearing of
an error/warning without propagating, getting it separately, etc.

Still yet to be done: changing most/all uses of yasm_internal_error() into
yasm_error_set(YASM_ERROR_ASSERTION).

The main advantage this change has is making libyasm functions feel much
more library like, and separating the user code line numbers from the inner
function error handling (e.g. intnum create functions only needed the line
number to trigger errors; this is no longer required).

The set/propagate/etc functions use global data structures to avoid passing
around a pointer to every function.  This would need to be made thread-local
data in a threaded app.  Errwarns containers (that keep associated line
numbers) are no longer global, so multiple source streams can be processed
separately with no conflict (at least if there's only a single thread of
execution).

svn path=/trunk/yasm/; revision=1521

18 years ago* ax_create_stdint_h.m4: Fix a couple bugs.
Peter Johnson [Thu, 4 May 2006 03:59:39 +0000 (03:59 -0000)]
* ax_create_stdint_h.m4: Fix a couple bugs.
The m4_ifvaln() call doesn't seem to serve a purpose and generated bad shell
script code (trying to actually run a header file).
_STDINT_HEADER_INTPTR ifdef shouldn't wrap INTMAX_T check.

svn path=/trunk/yasm/; revision=1519

18 years ago* configure.ac: Don't error-out configure if Python not found; Python is
Peter Johnson [Wed, 3 May 2006 02:47:01 +0000 (02:47 -0000)]
* configure.ac: Don't error-out configure if Python not found; Python is
completely optional.

Noticed by: Stephen Polkowski <stephen@centtech.com>

svn path=/trunk/yasm/; revision=1518

18 years ago* elf.c (elf_strtab_enty_set_str): Update following strtab indices since
Peter Johnson [Sun, 30 Apr 2006 05:50:43 +0000 (05:50 -0000)]
* elf.c (elf_strtab_enty_set_str): Update following strtab indices since
string length can change.  This was breaking symbol name lookups when the
filename was changed (e.g. for dwarf2).
* dwarf32_testhd.hex, dwarf64_leb128.hex: Fix testcases so they're correct.

svn path=/trunk/yasm/; revision=1516

18 years ago* nasm-bison.y (nasm_parser_directive): The objfmt directive must be the last
Peter Johnson [Thu, 27 Apr 2006 03:48:57 +0000 (03:48 -0000)]
* nasm-bison.y (nasm_parser_directive): The objfmt directive must be the last
directive called; thus reorder dbgfmt_directive and objfmt_directive calls.

svn path=/trunk/yasm/; revision=1514

18 years ago* x86id.c (yasm_x86__finalize_insn): Don't check for explicit 64-bit
Peter Johnson [Wed, 26 Apr 2006 06:35:46 +0000 (06:35 -0000)]
* x86id.c (yasm_x86__finalize_insn): Don't check for explicit 64-bit
effective address size in GAS mode.  Doing this breaks movabs.
* gas-movabs.asm: Test this.

svn path=/trunk/yasm/; revision=1512

18 years ago* hamt.c (HAMT_insert): Avoid hash collisions by checking full string on hash
Peter Johnson [Wed, 26 Apr 2006 04:55:01 +0000 (04:55 -0000)]
* hamt.c (HAMT_insert): Avoid hash collisions by checking full string on hash
match.

svn path=/trunk/yasm/; revision=1511

18 years ago* nasm-bison.y: Enable dbgfmt directives from NASM parser. This allows e.g.
Peter Johnson [Tue, 25 Apr 2006 03:42:45 +0000 (03:42 -0000)]
* nasm-bison.y: Enable dbgfmt directives from NASM parser.  This allows e.g.
loc and file DWARF2 directives to be accessed using [loc ...] and [file ...]
just like .loc and .file work from the GAS parser.

svn path=/trunk/yasm/; revision=1509

18 years ago* nasm-token.re: Actually handle $-prefixed names correctly, stripping the $ prefix...
Peter Johnson [Mon, 24 Apr 2006 05:53:26 +0000 (05:53 -0000)]
* nasm-token.re: Actually handle $-prefixed names correctly, stripping the $ prefix and allowing
any combination of characters following.
* win64-dataref.asm: Update to match (has a $-prefixed symbol).

Reported by: Nils Weller <nils@gnulinux.nl>

svn path=/trunk/yasm/; revision=1508

18 years ago* nasm-preproc.c (nasm_preproc_input): Don't generate %line except at the
Peter Johnson [Sat, 22 Apr 2006 04:08:00 +0000 (04:08 -0000)]
* nasm-preproc.c (nasm_preproc_input): Don't generate %line except at the
beginning of a line.  The old way could insert a %line in the middle of very
long lines (e.g. >8192 chars).
* longline.asm: Test with an ~8500 character line.

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

svn path=/trunk/yasm/; revision=1506

18 years ago* gas-bison.y: Handle segment register operands, fixing #74.
Peter Johnson [Tue, 18 Apr 2006 05:52:03 +0000 (05:52 -0000)]
* gas-bison.y: Handle segment register operands, fixing #74.
* gas-push.asm: Test this.

svn path=/trunk/yasm/; revision=1504

18 years ago* symrec.pxi: Change various things to properties rather than functions.
Peter Johnson [Mon, 17 Apr 2006 05:36:47 +0000 (05:36 -0000)]
* symrec.pxi: Change various things to properties rather than functions.
Visibility is handled via set of strings.
* test_symrec.py: Test.

svn path=/trunk/yasm/; revision=1503

18 years ago* python_test.sh: Set srcdir and PYTHON to reasonable defaults if not already
Peter Johnson [Mon, 17 Apr 2006 03:53:04 +0000 (03:53 -0000)]
* python_test.sh: Set srcdir and PYTHON to reasonable defaults if not already
set, this allows easy manual execution of this script outside of make check.

svn path=/trunk/yasm/; revision=1502

18 years ago* python_test.sh: Use PYTHON variable to find python executable.
Peter Johnson [Mon, 17 Apr 2006 03:21:41 +0000 (03:21 -0000)]
* python_test.sh: Use PYTHON variable to find python executable.
* python-yasm/tests/Makefile.inc: Pass PYTHON setting down through
TESTS_ENVIRONMENT.
* Makefile.am: Initialize TESTS_ENVIRONMENT to empty.

svn path=/trunk/yasm/; revision=1501

18 years ago* intnum.c (yasm_intnum_calc): Use BitVector_Compare, not Lexicompare;
Peter Johnson [Mon, 17 Apr 2006 03:06:44 +0000 (03:06 -0000)]
* intnum.c (yasm_intnum_calc): Use BitVector_Compare, not Lexicompare;
intnums are signed, and Compare is the signed comparison function.

svn path=/trunk/yasm/; revision=1500

18 years agoAdd intnum tests; test_cmp is failing right now and needs a source fix.
Michael Urman [Mon, 17 Apr 2006 02:16:50 +0000 (02:16 -0000)]
Add intnum tests; test_cmp is failing right now and needs a source fix.

svn path=/trunk/yasm/; revision=1499

18 years ago* test_symrec.py: Actually add test, and fix it to work.
Peter Johnson [Mon, 17 Apr 2006 02:13:52 +0000 (02:13 -0000)]
* test_symrec.py: Actually add test, and fix it to work.

svn path=/trunk/yasm/; revision=1498

18 years ago* python-yasm: Add test framework; large portions copied from Quod Libet
Peter Johnson [Mon, 17 Apr 2006 02:04:00 +0000 (02:04 -0000)]
* python-yasm: Add test framework; large portions copied from Quod Libet
framework.

svn path=/trunk/yasm/; revision=1497

18 years ago* symrec.pxi: Remove duplicate l.appends() in values() and items().
Peter Johnson [Mon, 17 Apr 2006 01:00:43 +0000 (01:00 -0000)]
* symrec.pxi: Remove duplicate l.appends() in values() and items().

svn path=/trunk/yasm/; revision=1496

18 years ago* symrec.pxi: Implement iterators.
Peter Johnson [Sun, 16 Apr 2006 22:46:22 +0000 (22:46 -0000)]
* symrec.pxi: Implement iterators.
* symrec.h (yasm_symtab_first, yasm_symtab_next, yasm_symtab_iter_value):
Supporting functions.
* symrec.c (yasm_symtab_first, yasm_symtab_next, yasm_symtab_iter_value):
Implement by passing through to...
* hamt.h (HAMT_first, HAMT_next, HAMTEntry_get_data): New.
* hamt.c (HAMT_first, HAMT_next, HAMTEntry_get_data): Implement.

svn path=/trunk/yasm/; revision=1495

18 years agosymrec.pxi: Implement __contains__ so that "'foo' in SymbolTable" works.
Peter Johnson [Sun, 16 Apr 2006 20:28:07 +0000 (20:28 -0000)]
symrec.pxi: Implement __contains__ so that "'foo' in SymbolTable" works.

svn path=/trunk/yasm/; revision=1494

18 years ago* nasm-eval.c (expr5, expr6): Remove unused variables.
Peter Johnson [Sun, 16 Apr 2006 19:18:33 +0000 (19:18 -0000)]
* nasm-eval.c (expr5, expr6): Remove unused variables.

svn path=/trunk/yasm/; revision=1493

18 years ago* floatnum.pxi: yasm_floatnum doesn't support any ops other than NEG,
Peter Johnson [Sun, 16 Apr 2006 08:48:28 +0000 (08:48 -0000)]
* floatnum.pxi: yasm_floatnum doesn't support any ops other than NEG,
other cleanups along the lines of intnum.

svn path=/trunk/yasm/; revision=1492

18 years ago* symrec.pxi: Revamp to more correctly generate Symbol objects, support
Peter Johnson [Sun, 16 Apr 2006 08:41:41 +0000 (08:41 -0000)]
* symrec.pxi: Revamp to more correctly generate Symbol objects, support
most dictionary functions (but not yet iterator protocol).
* yasm.pyx: Add Py_INCREF, Py_DECREF, malloc, free externals.
* coretype.pxi: Rename c_print to print_, add some missing yasm_expr_op
enum values.

svn path=/trunk/yasm/; revision=1491

18 years ago* intnum.pxi: Use correct name for NotImplementedError.
Peter Johnson [Sun, 16 Apr 2006 02:56:54 +0000 (02:56 -0000)]
* intnum.pxi: Use correct name for NotImplementedError.

svn path=/trunk/yasm/; revision=1490

18 years ago* intnum.pxi: Implement full set of integer and comparison functions.
Peter Johnson [Sun, 16 Apr 2006 02:27:01 +0000 (02:27 -0000)]
* intnum.pxi: Implement full set of integer and comparison functions.

svn path=/trunk/yasm/; revision=1489

18 years ago* intnum.c (yasm_intnum_create_sized): New, reverse function of
Peter Johnson [Sat, 15 Apr 2006 09:59:17 +0000 (09:59 -0000)]
* intnum.c (yasm_intnum_create_sized): New, reverse function of
yasm_intnum_get_sized().
* intnum.h (yasm_intnum_create_sized): Prototype.

* yasm.pyx: Bring in _PyLong_From/AsByteArray functions.
* intnum.pyx: Use yasm_intnum_create_sized(), etc to implement full 128-bit
number handling.

* intnum.c (yasm_intnum_get_str): Return strings in hex rather than in
decimal.

svn path=/trunk/yasm/; revision=1488

18 years ago* python-yasm/Makefile.inc: .python_build needs to depend on
Peter Johnson [Sat, 15 Apr 2006 08:43:54 +0000 (08:43 -0000)]
* python-yasm/Makefile.inc: .python_build needs to depend on
libyasm_a_SOURCES otherwise the Python bindings don't get updated when
libyasm changes.

svn path=/trunk/yasm/; revision=1487

18 years ago* python-yasm/Makefile.inc: Since we aren't using buildtools to call Pyrex,
Peter Johnson [Sat, 15 Apr 2006 08:03:42 +0000 (08:03 -0000)]
* python-yasm/Makefile.inc: Since we aren't using buildtools to call Pyrex,
we shouldn't need to remove the build directory.  Not removing it speeds up
the build considerably (we don't have to rebuild all of the Python bindings
just because the Makefile changed, for example).

svn path=/trunk/yasm/; revision=1486

18 years agoChange the NASM preprocessor to use yasm_intnum and yasm_expr. This
Peter Johnson [Sat, 15 Apr 2006 04:06:44 +0000 (04:06 -0000)]
Change the NASM preprocessor to use yasm_intnum and yasm_expr.  This
decreases bloat and more importantly makes it possible to use >32-bit values
in the preprocessor.

This has NOT been heavily tested, so there may easily be bugs.  I've not yet
decided whether to merge this to 0.5.0 final for this reason.

Inspired by: Jason Chen <jchen@centtech.com> patches to use "long long"
rather than "long" in the preprocessor to enable >32-bit values.

* coretype.h (yasm_op): Add XNOR, LXOR, LXNOR, LNOR.
* intnum.c (yasm_intnum_calc): Calculate the above.
* expr.c (expr_is_constant, expr_can_destroy_int_left)
(expr_can_destroy_int_right, ...): Actually handle logical operations,
including the new ones.

* intnum.c (yasm_intnum_get_str): New; gets a signed decimal string
representation of an intnum.
* intnum.h (yasm_intnum_get_str): Prototype.

* nasmlib.c (nasm_strcat): Change parameters to const.
* nasmlib.h (nasm_strcat): Update prototype.

* nasm-preproc.c (nasm_preproc_input): Close a memory leak.

* nasm.h: Clean out a lot of cruft we don't use.
(tokenval): Change t_integer and t_inttwo to yasm_intnums.
(evalfunc): Remove fwref and hints parameters (cleanup), change return value
to yasm_expr.
* nasm-eval.c: Massively rewrite to just call appropriate yasm_expr creation
functions rather than calculating the value here.  Overall recursive descent
parsing structure is unchanged.
* nasmlib.c: Remove a lot of now-unused functions.
(nasm_readnum): Use yasm_intnum functions and return that.
(nasm_readstrnum): Likewise.
* nasmlib.h: Update prototypes.
* nasm-pp.c: Change to use intnum/expr as necessary.
* nasm-preproc.c (nasm_preproc_destroy): Don't call nasm_eval_cleanup,
it's been deleted.

* nasmpp-bigint.asm: New test for >32-bit preproc values.
* ifcritical-err.errwarn: The new code doesn't generate a duplicate warning.

svn path=/trunk/yasm/; revision=1485

18 years agoCorrectly handle input characters >127 by using unsigned char in the re2c
Peter Johnson [Wed, 12 Apr 2006 04:06:44 +0000 (04:06 -0000)]
Correctly handle input characters >127 by using unsigned char in the re2c
tokenizers.  Signed chars >127 are negative, and thus aren't caught by the
[\000-\377] range.
* gas-parser.h (YYCTYPE): Change to unsigned char.
* gas-bison.y, gas-token.re: Cast as necessary to char.
* nasm-parser.h, nasm-bison.y, nasm-token.re: Likewise.
* lc3bid.re: Likewise.

svn path=/trunk/yasm/; revision=1481

18 years ago* ax_create_stdint_h.m4: Don't bother using head -1 to get the first line of
Peter Johnson [Sun, 9 Apr 2006 06:05:37 +0000 (06:05 -0000)]
* ax_create_stdint_h.m4: Don't bother using head -1 to get the first line of
gcc --version; this is just extra information.  POSIX needs -n 1 instead of
-1; instead of dealing with this, just disable this function.

Noticed by: Vikas Kumar <walburn@gmail.com>

svn path=/trunk/yasm/; revision=1480

18 years agoIn dwarf2, don't create symbols that are not in the table but will show up in
Peter Johnson [Sat, 8 Apr 2006 18:32:57 +0000 (18:32 -0000)]
In dwarf2, don't create symbols that are not in the table but will show up in
a relocation.  This can break some object formats (e.g. Win64).

svn path=/trunk/yasm/; revision=1478

18 years agoBump trunk internal version to 0.5.99.0.
Peter Johnson [Fri, 7 Apr 2006 05:13:24 +0000 (05:13 -0000)]
Bump trunk internal version to 0.5.99.0.

svn path=/trunk/yasm/; revision=1476

18 years ago* xstrdup.c: Remove compatibility shims that, due to this file's inclusion in gap...
Peter Johnson [Fri, 7 Apr 2006 01:47:30 +0000 (01:47 -0000)]
* xstrdup.c: Remove compatibility shims that, due to this file's inclusion in gap, broke DJGPP
build.

svn path=/trunk/yasm/; revision=1469

18 years agoTake #2 on reversioning: decouple version and build from autoconf version
Peter Johnson [Thu, 6 Apr 2006 05:55:41 +0000 (05:55 -0000)]
Take #2 on reversioning: decouple version and build from autoconf version
(which is used for the tar.gz name).  Also clean up Mkfiles/config.h

* configure.ac: Change autoconf version back to HEAD, add new PACKAGE_INTVER
and PACKAGE_BUILD config.h defines.
* cv-symline.c, yasm.c: Use PACKAGE_INTVER and PACKAGE_BUILD instead of
PACKAGE_STRING.
* genversion.c: Likewise.

* Mkfiles: Clean up and add PACKAGE_INTVER and PACKAGE_BUILD.

svn path=/trunk/yasm/; revision=1468

18 years ago* Mkfiles: Fix genversion include paths.
Peter Johnson [Thu, 6 Apr 2006 01:54:07 +0000 (01:54 -0000)]
* Mkfiles: Fix genversion include paths.

Thanks to: Brian Gladman for vcproj fixes.

svn path=/trunk/yasm/; revision=1467

18 years ago* Mkfiles: Bring up to date with main tree changes (genstring, genversion).
Peter Johnson [Wed, 5 Apr 2006 07:53:55 +0000 (07:53 -0000)]
* Mkfiles: Bring up to date with main tree changes (genstring, genversion).

svn path=/trunk/yasm/; revision=1466

18 years ago* vc8/config.h, vc/config.h, dj/config.h: Update version information.
Peter Johnson [Wed, 5 Apr 2006 07:16:20 +0000 (07:16 -0000)]
* vc8/config.h, vc/config.h, dj/config.h: Update version information.

svn path=/trunk/yasm/; revision=1465

18 years agoImplement better versioning. From now on, trunk's version will be the
Peter Johnson [Wed, 5 Apr 2006 07:14:41 +0000 (07:14 -0000)]
Implement better versioning.  From now on, trunk's version will be the
current major and minor version but with subminor version = 99.  All releases
and snapshots will have a build version of the current svn version.  Version
information is put into predefined macros in the NASM preproc:
__YASM_MAJOR__, __YASM_MINOR__, __YASM_SUBMINOR__, __YASM_BUILD__,
__YASM_VERSION_ID__, __YASM_VER__.
__YASM_VER__ does not have the build version as part of the string, and
__YASM_VERSION_ID__ does not incorporate the build version.
If the build version is "HEAD" (or other non-numeric), __YASM_BUILD__ is
set to 0.

* configure.ac: Set version to 0.4.99.HEAD for trunk.
* genversion.c: Generate version.mac for the NASM preproc version macros.
* Makefile.inc: Hook into build.

svn path=/trunk/yasm/; revision=1464

18 years ago* COPYING: Update verbiage, add list of contributors and copyright notice.
Peter Johnson [Wed, 5 Apr 2006 05:39:23 +0000 (05:39 -0000)]
* COPYING: Update verbiage, add list of contributors and copyright notice.

* genstring.c: Generate string array from source file.
* Makefile.am: Build genstring.
* Makefile.inc: Use genstring to create license.c from COPYING.
* yasm.c: Include license.c and use it for new --license option.  Shorten
--version option to just displaying version, compile date, and very short
copyright message.

svn path=/trunk/yasm/; revision=1463

18 years ago* setup.py: strip() opts["srcdir"] to unbreak distcheck.
Peter Johnson [Wed, 5 Apr 2006 05:36:06 +0000 (05:36 -0000)]
* setup.py: strip() opts["srcdir"] to unbreak distcheck.

svn path=/trunk/yasm/; revision=1462

18 years ago* setup.py: Incorporate cleanups suggested by Michael Urman.
Peter Johnson [Wed, 5 Apr 2006 03:37:46 +0000 (03:37 -0000)]
* setup.py: Incorporate cleanups suggested by Michael Urman.

svn path=/trunk/yasm/; revision=1461

18 years agoQuiet warnings in Pyrex code by adding "-w" if GCC detected.
Peter Johnson [Wed, 5 Apr 2006 02:26:19 +0000 (02:26 -0000)]
Quiet warnings in Pyrex code by adding "-w" if GCC detected.
* configure.ac: Pass GCC value to Makefile
* Makefile.inc: Pass GCC value to python-setup.txt
* setup.py: Check GCC value and append -w if necessary.

svn path=/trunk/yasm/; revision=1460

18 years ago* Makefile.am: Unbreak build for when Python bindings aren't being built;
Peter Johnson [Wed, 5 Apr 2006 02:05:19 +0000 (02:05 -0000)]
* Makefile.am: Unbreak build for when Python bindings aren't being built;
also more cleanly hook into all target.

svn path=/trunk/yasm/; revision=1459

18 years ago* pyrex.m4: Add a little documentation.
Peter Johnson [Tue, 4 Apr 2006 08:06:39 +0000 (08:06 -0000)]
* pyrex.m4: Add a little documentation.
* setup.py, yasm.pyx, *.pxi: Add copyright/license.

svn path=/trunk/yasm/; revision=1458

18 years agoBe much smarter at checking for and running Pyrex. Pyrex is a Python module
Peter Johnson [Tue, 4 Apr 2006 07:51:42 +0000 (07:51 -0000)]
Be much smarter at checking for and running Pyrex.  Pyrex is a Python module
and the "pyrexc" command is just a wrapper, so instead of looking for
"pyrexc" look for the module instead.

* pyrex.m4: New macro to check Pyrex version.
* m4/Makefile.inc: Add to dist.
* configure.ac: Use macro to check for Pyrex >= 0.9.3.
* python-yasm/Makefile.inc: Run Python directly instead of pyrexc wrapper.

svn path=/trunk/yasm/; revision=1457

18 years agoHook Python module into the build (even though it's pretty incomplete),
Peter Johnson [Tue, 4 Apr 2006 06:07:32 +0000 (06:07 -0000)]
Hook Python module into the build (even though it's pretty incomplete),
enabled with --enable-python (defaults to auto-detect).

Thanks to some magic in python-yasm/Makefile.inc and setup.py, this actually
plays nicely with automake distcheck.

* m4/pythonhead.m4: Script to find Python.h.
* m4/Makefile.inc: Include it in distfiles.
* configure.ac: Add --enable-python option and Python and Pyrex detection.
* tools/Makefile.inc: Pull tools/python-yasm/Makefile.inc into build.
* python-yasm/Makefile.inc: Add automake build magic for extension.
* setup.py: Likewise.

svn path=/trunk/yasm/; revision=1456

18 years ago* bytecode.pxi: Fix definition of yasm_dv_create_string().
Peter Johnson [Tue, 4 Apr 2006 06:02:18 +0000 (06:02 -0000)]
* bytecode.pxi: Fix definition of yasm_dv_create_string().

svn path=/trunk/yasm/; revision=1455