]> granicus.if.org Git - yasm/log
yasm
18 years agoClean up a few minor nits (warnings).
Peter Johnson [Sun, 19 Nov 2006 01:04:29 +0000 (01:04 -0000)]
Clean up a few minor nits (warnings).

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

18 years agogas-parser.h: Fix nit (NASM_PARSER_H define instead of GAS_PARSER_H).
Peter Johnson [Sat, 18 Nov 2006 09:34:42 +0000 (09:34 -0000)]
gas-parser.h: Fix nit (NASM_PARSER_H define instead of GAS_PARSER_H).

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

18 years agoFix #91 and a few other minor nits. Reorganize to make for clearer flow.
Peter Johnson [Sat, 18 Nov 2006 06:20:06 +0000 (06:20 -0000)]
Fix #91 and a few other minor nits.  Reorganize to make for clearer flow.

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

18 years agoyapp_test.sh: Unbreak.
Peter Johnson [Thu, 16 Nov 2006 07:49:37 +0000 (07:49 -0000)]
yapp_test.sh: Unbreak.

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

18 years agoFix quoting error.
Peter Johnson [Thu, 16 Nov 2006 07:19:23 +0000 (07:19 -0000)]
Fix quoting error.

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

18 years agoyapp-preproc.c: Build fix.
Peter Johnson [Thu, 16 Nov 2006 04:49:34 +0000 (04:49 -0000)]
yapp-preproc.c: Build fix.

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

18 years agoGenerate better errors than "invalid combination of opcode and operands"
Peter Johnson [Tue, 14 Nov 2006 06:51:50 +0000 (06:51 -0000)]
Generate better errors than "invalid combination of opcode and operands"
for a number of common cases (size mismatch, too low of CPU).

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

18 years agoUse is_exp2() in a couple more places.
Peter Johnson [Sat, 11 Nov 2006 06:00:22 +0000 (06:00 -0000)]
Use is_exp2() in a couple more places.

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

18 years agoMake life a little easier by adding an is_exp2() macro.
Peter Johnson [Sat, 11 Nov 2006 05:47:09 +0000 (05:47 -0000)]
Make life a little easier by adding an is_exp2() macro.

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

18 years agoAllow overriding of strict-ness requirement with command line option
Peter Johnson [Tue, 7 Nov 2006 06:40:05 +0000 (06:40 -0000)]
Allow overriding of strict-ness requirement with command line option
"--force-strict", which switches Yasm back to the old behavior of treating
any sized operand as "strict" (forcing the actual size).

Requested by: Michael Urman <mu@tortall.net>

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

18 years agoSupport strict for immediate values, and optimize non-strict (thus some
Peter Johnson [Mon, 6 Nov 2006 08:59:35 +0000 (08:59 -0000)]
Support strict for immediate values, and optimize non-strict (thus some
other testcase changes).

While I'm here, fix handling of arith [], dword X in 64-bit mode by making
this an error; it's impossible to tell if add dword [], X or add qword [], X
is meant as the immediate part is always a dword.  This is only important for
arith rather than other memory instructions due to dword also being needed
for optimization.

Next step: support strict for jump sizing and optimize non-strict sized
jumps.

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

18 years agoSupport "strict" in NASM parser. Still need to implement its desired
Peter Johnson [Mon, 6 Nov 2006 02:33:11 +0000 (02:33 -0000)]
Support "strict" in NASM parser.  Still need to implement its desired
behavior in the x86 architecture.

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

18 years agoRemove some unused yasm_scanner variables, and properly document the
Peter Johnson [Thu, 2 Nov 2006 07:44:09 +0000 (07:44 -0000)]
Remove some unused yasm_scanner variables, and properly document the
remaining ones.

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

18 years agoyasm_intnum_create_charconst_nasm(): Ensure converted values from char
Peter Johnson [Tue, 31 Oct 2006 03:58:26 +0000 (03:58 -0000)]
yasm_intnum_create_charconst_nasm(): Ensure converted values from char
fit into 8 bits.

Reported by: Samuel Thibault <samuel.thibault@ens-lyon.org>

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

18 years agoout_test.sh: Fix reporting of non-error.
Peter Johnson [Tue, 31 Oct 2006 03:56:53 +0000 (03:56 -0000)]
out_test.sh: Fix reporting of non-error.

Patch submitted by: Samuel Thibault <samuel.thibault@ens-lyon.org>

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

18 years agoFix #88: Allow only GNU Bison (not Bison++ or plain old yacc) for YACC, and clear...
Peter Johnson [Mon, 30 Oct 2006 05:08:48 +0000 (05:08 -0000)]
Fix #88: Allow only GNU Bison (not Bison++ or plain old yacc) for YACC, and clear YACC
if too low (<1.25) version found.

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

18 years agoHave incbin search include paths (long-missing feature).
Peter Johnson [Sat, 28 Oct 2006 22:06:01 +0000 (22:06 -0000)]
Have incbin search include paths (long-missing feature).

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

18 years agoAdd trailing slashes on include paths again (functionality deleted in
Peter Johnson [Sat, 28 Oct 2006 22:04:18 +0000 (22:04 -0000)]
Add trailing slashes on include paths again (functionality deleted in
[1669]).

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

18 years agoUnbreak raw preproc (broken in [1669]).
Peter Johnson [Sat, 28 Oct 2006 21:54:27 +0000 (21:54 -0000)]
Unbreak raw preproc (broken in [1669]).

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

18 years agoyasm_fopen_include: Allow oname to be NULL. Also set oname to NULL if NULL
Peter Johnson [Sat, 28 Oct 2006 21:39:14 +0000 (21:39 -0000)]
yasm_fopen_include: Allow oname to be NULL.  Also set oname to NULL if NULL
is returned.

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

18 years agoRefactor include file handling into libyasm from preprocessors.
Peter Johnson [Sat, 28 Oct 2006 21:31:38 +0000 (21:31 -0000)]
Refactor include file handling into libyasm from preprocessors.

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

18 years agoMake common scanner fill function, as we're using it in two places already.
Peter Johnson [Sat, 28 Oct 2006 20:34:03 +0000 (20:34 -0000)]
Make common scanner fill function, as we're using it in two places already.
Actually, GAS parser doesn't use this yet, as it still contains the rept
functionality that will move to GAS preproc at some point.  When GAS
preproc implements rept, we can switch to the common implementation.

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

18 years agoFix handling of svdc, rsdc, wrshr, and rdshr Cyrix opcodes.
Peter Johnson [Sat, 28 Oct 2006 18:44:21 +0000 (18:44 -0000)]
Fix handling of svdc, rsdc, wrshr, and rdshr Cyrix opcodes.

Reported by: Danny Reeves <danny_reeves@hotmail.com>

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

18 years agoFix prefix order for "3-byte" instructions like the SIMD instructions.
Peter Johnson [Sat, 28 Oct 2006 18:19:39 +0000 (18:19 -0000)]
Fix prefix order for "3-byte" instructions like the SIMD instructions.
While the F2/F3/66 prefix used by these instructions should precede the
REX prefix in 64-bit mode, they should probably not precede the segment
override.  The processor specifications seem to be unclear on this point,
so play it safe.

This change has a minor side-effect of reversing the segreg/size override
ordering on things like "fs cmpsd" in 16-bit mode; this is okay as those
prefixes can be in any order.  This is due to the way Yasm implements
segreg overrides for instructions with no EA.

Reported by: Danny Reeves <danny_reeves@hotmail.com>

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

18 years agoexpr.c (expr_expand_equ): Work around what I believe to be a GCC aliasing
Peter Johnson [Fri, 27 Oct 2006 07:29:28 +0000 (07:29 -0000)]
expr.c (expr_expand_equ): Work around what I believe to be a GCC aliasing
bug (probably http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28778) by not
accepting NULL for eh, and giving it the static eh at the sole caller of
this function (yasm_expr__level_tree).  While I'm here, clean up the logic
a bit to avoid relying on ee.e NULL value.  This fix prevents crashes in
GCC 4.1.1 with -fstrict-aliasing (enabled by -O2).

Noticed by: Danny Reeves <danny_reeves@hotmail.com>

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

18 years agogenmodule.c: Fix edge cases in string handling.
Peter Johnson [Mon, 23 Oct 2006 03:32:06 +0000 (03:32 -0000)]
genmodule.c: Fix edge cases in string handling.

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

18 years agoAdd yasm_parsers(7), yasm_objfmts(7), and yasm_dbgfmts(7) man pages,
Peter Johnson [Sat, 21 Oct 2006 18:52:29 +0000 (18:52 -0000)]
Add yasm_parsers(7), yasm_objfmts(7), and yasm_dbgfmts(7) man pages,
mostly copied from the yasm manual.

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

18 years agoRevamp and update man pages. Still need to add in some missing ones.
Peter Johnson [Sat, 21 Oct 2006 08:07:09 +0000 (08:07 -0000)]
Revamp and update man pages.  Still need to add in some missing ones.

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

18 years agoFix #86 by requiring '-' (e.g. "yasm -") to read from stdin, and reporting
Peter Johnson [Sat, 21 Oct 2006 04:49:19 +0000 (04:49 -0000)]
Fix #86 by requiring '-' (e.g. "yasm -") to read from stdin, and reporting
an error if no files are specified (instead of defaulting to stdin).
While the old behavior mimiced GNU AS, the new behavior is far more common
amongst typical compilers (e.g. GCC), including NASM.

While I'm here, add support for '--' (e.g. "yasm -- -f").

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

18 years agoFix #85: Multiple may be 0. In this case, force size to zero instead of
Peter Johnson [Thu, 19 Oct 2006 19:42:08 +0000 (19:42 -0000)]
Fix #85: Multiple may be 0.  In this case, force size to zero instead of
dividing (and thus crashing).

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

18 years agoFix #84: I broke the idiom of concating a decimal number to a register
Peter Johnson [Thu, 19 Oct 2006 03:21:18 +0000 (03:21 -0000)]
Fix #84: I broke the idiom of concating a decimal number to a register
in the preproc (e.g mm%$x -> mm0) when I implemented a minor optimization
(outputing values in hex to avoid the 2x decimal conversion overhead) in
[1488].  Revert that optimization.

I believe the right way to do this is to add the GAS (and MASM) syntax
sugar of mm(0) etc. to NASM syntax, then any number (not just decimal)
can be used as the new idiom for doing this.  But that wouldn't unbreak
programs that already exist, so we're left with this state of affairs.
Sigh.

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

18 years agoexpr.h: Fix comment to match [1655].
Peter Johnson [Thu, 19 Oct 2006 03:08:44 +0000 (03:08 -0000)]
expr.h: Fix comment to match [1655].

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

18 years agoDon't mix EQU expansion with other expr leveling; we could get confused
Peter Johnson [Wed, 18 Oct 2006 05:36:51 +0000 (05:36 -0000)]
Don't mix EQU expansion with other expr leveling; we could get confused
with certain combinations.
(2nd half of #83)

This also hides some internals of yasm_expr_level_tree.

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

18 years agoFix handling of CPU flags; the old code would simply take the last CPU
Peter Johnson [Wed, 18 Oct 2006 04:21:21 +0000 (04:21 -0000)]
Fix handling of CPU flags; the old code would simply take the last CPU
setting in the file and use it against the entire file (oops).
(first half of #83)

Also make the error message a lot nicer, at least for ones we detect early
(shl ax, 2 in 8086 mode still gives the old message).

While I'm here, upgrade movsd to CPU_386.

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

18 years agordf: Enable Id keywords on various files.
Peter Johnson [Tue, 17 Oct 2006 06:58:41 +0000 (06:58 -0000)]
rdf: Enable Id keywords on various files.

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

18 years agordf-objfmt.c: Clean up unused variables.
Peter Johnson [Tue, 17 Oct 2006 06:57:47 +0000 (06:57 -0000)]
rdf-objfmt.c: Clean up unused variables.

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

18 years agoFix up Mkfiles for RDOFF2 support.
Peter Johnson [Tue, 17 Oct 2006 05:53:40 +0000 (05:53 -0000)]
Fix up Mkfiles for RDOFF2 support.

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

18 years agoAdd support for RDOFF2 object format (#73).
Peter Johnson [Tue, 17 Oct 2006 05:48:42 +0000 (05:48 -0000)]
Add support for RDOFF2 object format (#73).

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

18 years agonasm-token.re: Be even more pedantic and pass through $-prefixed ids as-is.
Peter Johnson [Tue, 17 Oct 2006 05:14:27 +0000 (05:14 -0000)]
nasm-token.re: Be even more pedantic and pass through $-prefixed ids as-is.

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

18 years agonasm-token.re: Fix handling of inside of directive to allow even keywords
Peter Johnson [Tue, 17 Oct 2006 04:42:12 +0000 (04:42 -0000)]
nasm-token.re: Fix handling of inside of directive to allow even keywords
to be used.

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

18 years agoxdf-objfmt.c: Remove unused reloc list (this is taken care of in libyasm
Peter Johnson [Tue, 17 Oct 2006 04:35:44 +0000 (04:35 -0000)]
xdf-objfmt.c: Remove unused reloc list (this is taken care of in libyasm
now).

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

18 years agoFix crash case in data bytecode handling (raw followed by non-raw value).
Peter Johnson [Thu, 12 Oct 2006 03:10:14 +0000 (03:10 -0000)]
Fix crash case in data bytecode handling (raw followed by non-raw value).

Reported by: Danny Reeves <danny_reeves@hotmail.com>

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

18 years agoutil.h: Use same workarounds for mingw32 as for the GNU C library.
Peter Johnson [Sun, 8 Oct 2006 00:53:10 +0000 (00:53 -0000)]
util.h: Use same workarounds for mingw32 as for the GNU C library.

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

18 years agoexpr.c: Remove a couple of unused variables.
Peter Johnson [Sun, 8 Oct 2006 00:48:03 +0000 (00:48 -0000)]
expr.c: Remove a couple of unused variables.

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

18 years agoFix error/warnings in the NASM preprocessor to reference the correct line
Peter Johnson [Sat, 7 Oct 2006 17:27:56 +0000 (17:27 -0000)]
Fix error/warnings in the NASM preprocessor to reference the correct line
number, rather than the last parsed line number.  Also improve
"cannot reference symbol" error a bit, to include the symbol name.

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

18 years agoChange genmodule to parse through the Makefile (or Makefile.am) looking for YASM_MODULES,
Peter Johnson [Thu, 5 Oct 2006 06:22:25 +0000 (06:22 -0000)]
Change genmodule to parse through the Makefile (or Makefile.am) looking for YASM_MODULES,
rather than simply taking a list of modules on the command line.  This allows significant
improvement of the behavior when used with Visual Studio, as the "old" way of doing this
with Visual Studio build files was to scan through the .c files; this brought up things
that were actually disabled in the build.

Also incorporate a patch by Charles Bailey to make the VC8 build less noisy, and allow use
of Win32 Bison if it's installed.  Instructions updated as well.

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

18 years agore2c-parser.y: Work around a bug in Bison 2.1; Bison 2.1 generates bad code if both
Peter Johnson [Thu, 5 Oct 2006 06:07:59 +0000 (06:07 -0000)]
re2c-parser.y: Work around a bug in Bison 2.1; Bison 2.1 generates bad code if both
YYPARSE_PARAM and __STDC__ are undefined.

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

18 years agogenversion.c: Include ctype.h to get isdigit() definition.
Peter Johnson [Thu, 5 Oct 2006 05:32:29 +0000 (05:32 -0000)]
genversion.c: Include ctype.h to get isdigit() definition.

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

18 years agoFollow-up to #80 and #81: "xchg ax, ax" can use the short 0x90 form as
Peter Johnson [Wed, 4 Oct 2006 04:38:43 +0000 (04:38 -0000)]
Follow-up to #80 and #81: "xchg ax, ax" can use the short 0x90 form as
16-bit operations don't clear the high bits of the 64-bit register, so
this is effectively a NOP as well.

While I'm still looking at this, make "xchg rax, rax" not output a REX
prefix.

I thought about being extra-clever and have "xchg ax, ax" not output an
operand-size prefix, but thought better of it: if the user says "ax"
they're probably going to expect the prefix to be there.  Left in as
a comment for future readers of the code.

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

18 years agoFix #80: xchg ax, ax or xchg eax, eax in 64-bit mode should not use 90h
Peter Johnson [Tue, 3 Oct 2006 16:24:30 +0000 (16:24 -0000)]
Fix #80: xchg ax, ax or xchg eax, eax in 64-bit mode should not use 90h
opcode.

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

18 years agoImprove error message for illegal use of A/B/C/DH with REX instruction.
Peter Johnson [Tue, 3 Oct 2006 05:33:54 +0000 (05:33 -0000)]
Improve error message for illegal use of A/B/C/DH with REX instruction.

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

18 years agoAccept (but ignore) -O and -Onnn command line options, for compatibility
Peter Johnson [Sat, 30 Sep 2006 08:16:39 +0000 (08:16 -0000)]
Accept (but ignore) -O and -Onnn command line options, for compatibility
with NASM.

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

18 years agoFix #77 by performing symrec-symrec -> subst placeholder transformation
Peter Johnson [Sat, 30 Sep 2006 05:13:41 +0000 (05:13 -0000)]
Fix #77 by performing symrec-symrec -> subst placeholder transformation
recursively in yasm_expr__bc_dist_subst(); before this we would only do
one level, which fails on simple structures like the old NASM align approach
of "($$-$) & value" (as the $$-$ is one level down in the expression).

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

18 years ago- Fix much brokenness in absolute value handling, particularly in regards to
Peter Johnson [Fri, 29 Sep 2006 07:18:45 +0000 (07:18 -0000)]
- Fix much brokenness in absolute value handling, particularly in regards to
  PC-relative relocations (jumps and calls).
- Allow SEG:OFF to be used as just an offset portion (like NASM does).
- Labels in absolute sections that are declared global are given the correct
  absolute value in the symbol table.

One difference from NASM:
  label equ 0040h:001eh
  jmp label
in NASM means the same as:
  jmp 001eh  (a near jump)
but yasm will treat this the same as:
  jmp 0040h:001eh  (a far jump)

I'm still not completely happy with this implementation, but it's workable
and fixes all the bugs I've found so far in absolute handling.

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

18 years agoFix #78: Handle C-style comments (/* */) in GAS parser.
Peter Johnson [Wed, 27 Sep 2006 07:02:27 +0000 (07:02 -0000)]
Fix #78: Handle C-style comments (/* */) in GAS parser.

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

18 years agoFix error message for arch/parser mismatch.
Peter Johnson [Wed, 27 Sep 2006 06:58:50 +0000 (06:58 -0000)]
Fix error message for arch/parser mismatch.

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

18 years agoFix duplicate line at the end of list output.
Peter Johnson [Mon, 25 Sep 2006 05:42:09 +0000 (05:42 -0000)]
Fix duplicate line at the end of list output.

Reported by: Danny Reeves <danny_reeves@hotmail.com>

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

18 years agoFix NASM preprocessor outputting %line for every line.
Peter Johnson [Fri, 22 Sep 2006 05:28:12 +0000 (05:28 -0000)]
Fix NASM preprocessor outputting %line for every line.

Noticed by: Dancie Reeves <danny_reeves@hotmail.com>

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

18 years agoAdd SSE4 (aka SSSE3) instructions.
Peter Johnson [Thu, 21 Sep 2006 05:18:20 +0000 (05:18 -0000)]
Add SSE4 (aka SSSE3) instructions.

Patch contributed by: Mathieu Monnier <manao@melix.net>

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

18 years agoMerge Bit::Vector 6.4 into trunk.
Peter Johnson [Tue, 19 Sep 2006 05:14:50 +0000 (05:14 -0000)]
Merge Bit::Vector 6.4 into trunk.

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

18 years agoRemove ancient doc directory.
Peter Johnson [Tue, 19 Sep 2006 04:02:38 +0000 (04:02 -0000)]
Remove ancient doc directory.

Also remove float (gdtoa and softfloat) directory, as no one is asking for
floating point calculation, we've never integrated any of this code, and
it's just taking up space (note it's still available on a branch).

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

18 years agoFix %INCLUDE in last line of mmac/loop expansion.
Peter Johnson [Mon, 18 Sep 2006 05:40:49 +0000 (05:40 -0000)]
Fix %INCLUDE in last line of mmac/loop expansion.

NASM SF Bug #890790.
Patch by: nasm64developer@yahoo.com

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

18 years agoFix memory leaks in %IF*, %ELIF*, and %UNDEF.
Peter Johnson [Mon, 18 Sep 2006 05:22:11 +0000 (05:22 -0000)]
Fix memory leaks in %IF*, %ELIF*, and %UNDEF.

NASM SF Bug #852464.
Patch by: nasm64developer@yahoo.com

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

18 years agonasm-pp.c: Fix handling of nested %macro and nested %rep.
Peter Johnson [Sun, 17 Sep 2006 17:10:17 +0000 (17:10 -0000)]
nasm-pp.c: Fix handling of nested %macro and nested %rep.

Reported (and test) by: Mathieu Monnier <manao@melix.net>
Fix by: nasm64developer@yahoo.com

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

18 years agoActually use $ECHO_C in test shell scripts.
Peter Johnson [Sat, 16 Sep 2006 05:48:10 +0000 (05:48 -0000)]
Actually use $ECHO_C in test shell scripts.

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

18 years agoMake out_test.sh smart about 0-byte errwarn output and don't require a
Peter Johnson [Sat, 16 Sep 2006 05:43:41 +0000 (05:43 -0000)]
Make out_test.sh smart about 0-byte errwarn output and don't require a
golden errwarn file in this case.  This allows us to remove around 150
0-byte .errwarn test files.

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

18 years ago* yapp: Unbitrot. Note to actually build this you need AM_PROG_LEX in
Peter Johnson [Sat, 16 Sep 2006 04:27:37 +0000 (04:27 -0000)]
* yapp: Unbitrot.  Note to actually build this you need AM_PROG_LEX in
configure.ac (and add this subdirectory to preprocs/Makefile.inc).

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

18 years ago* preproc.h: Fix prototype naming of yasm_preproc_define_builtin (as this
Peter Johnson [Sat, 16 Sep 2006 03:20:24 +0000 (03:20 -0000)]
* preproc.h: Fix prototype naming of yasm_preproc_define_builtin (as this
is a macro, effectively mainly a documentation fix).

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

18 years agoResurrect yapp from revision 998.
Peter Johnson [Sat, 16 Sep 2006 02:22:08 +0000 (02:22 -0000)]
Resurrect yapp from revision 998.

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

18 years ago* section.c (yasm_object_optimize): Set active flag to indicate it's already
Peter Johnson [Sat, 16 Sep 2006 01:36:58 +0000 (01:36 -0000)]
* section.c (yasm_object_optimize): Set active flag to indicate it's already
on QB.  We use this flag other places, but forgot to set it here.  This
could cause an infinite loop in (rare) situations.

Reported by: Brian Gladman <brg@gladman.plus.com>
(also committed the code he sent that hits this bug as a testcase)

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

18 years agoMove CPU_64 and CPU_Not64 to bits 30 and 31 to avoid CPU_EM64T bit conflict
Peter Johnson [Sun, 10 Sep 2006 19:50:48 +0000 (19:50 -0000)]
Move CPU_64 and CPU_Not64 to bits 30 and 31 to avoid CPU_EM64T bit conflict
and allow for a few more bits without constantly moving these two.

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

18 years agoFix invalid memory access on macro with multiple of 16 arguments.
Peter Johnson [Sun, 10 Sep 2006 19:44:18 +0000 (19:44 -0000)]
Fix invalid memory access on macro with multiple of 16 arguments.

Patch by: Mathieu Monnier <mathieu.monnier@polytechnique.org>

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

18 years agoAdd USE64 macro as alias for BITS 64, for parity with USE16 and USE32.
Peter Johnson [Sun, 3 Sep 2006 06:30:54 +0000 (06:30 -0000)]
Add USE64 macro as alias for BITS 64, for parity with USE16 and USE32.

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

18 years agoFix #58 and a more basic form of this bug (all EAs that needed non-zero
Peter Johnson [Sat, 12 Aug 2006 18:27:04 +0000 (18:27 -0000)]
Fix #58 and a more basic form of this bug (all EAs that needed non-zero
displacement length and required optimization would end up with 0
displacement length, causing an internal error).

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

18 years ago * bytecode.h: Fix doxygen comments.
Peter Johnson [Sat, 12 Aug 2006 03:00:33 +0000 (03:00 -0000)]
 * bytecode.h: Fix doxygen comments.

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

18 years agoFix a bunch of unused variable warnings and a warning/bug in
Peter Johnson [Sat, 12 Aug 2006 02:37:05 +0000 (02:37 -0000)]
Fix a bunch of unused variable warnings and a warning/bug in
yasm_object_optimize().

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

18 years agoBring Mkfiles up to date with new optimizer and removal of lc3b.
Peter Johnson [Fri, 11 Aug 2006 03:01:33 +0000 (03:01 -0000)]
Bring Mkfiles up to date with new optimizer and removal of lc3b.

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

18 years ago* POTFILES.in: Unbreak dist by removing a nonexistent file.
Peter Johnson [Thu, 10 Aug 2006 04:50:48 +0000 (04:50 -0000)]
* POTFILES.in: Unbreak dist by removing a nonexistent file.
* Makevars: Set MSGID_BUGS_ADDRESS to eliminate a gettext warning.

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

18 years agoInclude test_bytecode.py and test_expr.py in the distribution, as they're
Peter Johnson [Thu, 10 Aug 2006 04:42:09 +0000 (04:42 -0000)]
Include test_bytecode.py and test_expr.py in the distribution, as they're
called out by the python test framework.

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

18 years agoRemove jmpsize_threshold added in new-optimizer; it's not actually used.
Peter Johnson [Thu, 10 Aug 2006 04:13:05 +0000 (04:13 -0000)]
Remove jmpsize_threshold added in new-optimizer; it's not actually used.

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

18 years agoMerge new-optimizer branch back into trunk (from [1596] of new-optimizer).
Peter Johnson [Thu, 10 Aug 2006 04:02:59 +0000 (04:02 -0000)]
Merge new-optimizer branch back into trunk (from [1596] of new-optimizer).

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

18 years agoMerge [1547]-[1593] (inclusive) from trunk.
Peter Johnson [Thu, 10 Aug 2006 02:31:37 +0000 (02:31 -0000)]
Merge [1547]-[1593] (inclusive) from trunk.

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

18 years agoRewrite offset-setter (ORG and ALIGN) optimization to run in program order;
Peter Johnson [Tue, 8 Aug 2006 07:35:35 +0000 (07:35 -0000)]
Rewrite offset-setter (ORG and ALIGN) optimization to run in program order;
this speeds things up and makes expansion more predictable.

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

18 years agoDon't include unused checker functions if not checking interval tree
Peter Johnson [Tue, 8 Aug 2006 07:30:22 +0000 (07:30 -0000)]
Don't include unused checker functions if not checking interval tree
assumptions (with CHECK_INTERVAL_TREE_ASSUMPTIONS define).

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

18 years agoFix (hopefully finally) fsub and fdiv operand reversal for GAS mode.
Peter Johnson [Tue, 18 Jul 2006 05:16:12 +0000 (05:16 -0000)]
Fix (hopefully finally) fsub and fdiv operand reversal for GAS mode.

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

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 agoFix farith and farithp instructions for GAS mode (e.g. fsubr).
Peter Johnson [Thu, 15 Jun 2006 04:55:47 +0000 (04:55 -0000)]
Fix farith and farithp instructions for GAS mode (e.g. fsubr).

The easiest way to fix these was to adjust the GAP input file to have NASM
and GAS versions of these instructions.

Tests added to check both NASM and GAS (farith.asm and gas-farithr.asm
respectively).

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

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