]> granicus.if.org Git - yasm/log
yasm
16 years agoMerge [2061] from trunk.
Peter Johnson [Sat, 12 Apr 2008 01:34:30 +0000 (01:34 -0000)]
Merge [2061] from trunk.

svn path=/branches/yasm-0.7.x/; revision=2062

16 years agoMerge [2058] and [2059] from trunk.
Peter Johnson [Sat, 12 Apr 2008 01:18:02 +0000 (01:18 -0000)]
Merge [2058] and [2059] from trunk.

svn path=/branches/yasm-0.7.x/; revision=2060

16 years agoBump branch version to 0.7.x, with an internal version of 0.7.0.
Peter Johnson [Sat, 12 Apr 2008 01:10:36 +0000 (01:10 -0000)]
Bump branch version to 0.7.x, with an internal version of 0.7.0.

svn path=/branches/yasm-0.7.x/; revision=2057

16 years agoMerge [2055] from trunk.
Peter Johnson [Sat, 12 Apr 2008 01:09:37 +0000 (01:09 -0000)]
Merge [2055] from trunk.

svn path=/branches/yasm-0.7.x/; revision=2056

16 years agoDisable Python bindings by default; the build process for them is broken
Peter Johnson [Sat, 12 Apr 2008 00:56:30 +0000 (00:56 -0000)]
Disable Python bindings by default; the build process for them is broken
on most non-32-bit systems.

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

16 years agoAdd complete Intel Advanced Vector Extensions (AVX) support.
Peter Johnson [Fri, 11 Apr 2008 09:29:58 +0000 (09:29 -0000)]
Add complete Intel Advanced Vector Extensions (AVX) support.

A full testcase for NASM mode based on the AVX programming reference is
included.  GAS mode should work, but is untested at present.

V-prefix aliases are present for all supported instructions to allow easy
use of the VEX prefix version without significant code modifications.

All comparison and other pseudo-ops are included.

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

16 years agoMove BITS==64 condition out of the CPU field (where it really doesn't belong)
Peter Johnson [Fri, 11 Apr 2008 01:37:46 +0000 (01:37 -0000)]
Move BITS==64 condition out of the CPU field (where it really doesn't belong)
and into a new misc_flags field.  This doesn't take any more space,
simplifies the code, and allows adding additional conditions like this in
the future.

Found and fixed a bug in CPU field generation (not copying a set variable
in gen_x86_insn.py).

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

16 years agoPCOMUcc should have been PCOMccU.
Peter Johnson [Fri, 4 Apr 2008 02:10:24 +0000 (02:10 -0000)]
PCOMUcc should have been PCOMccU.
Fix up condition code naming and add aliases to match SSE5 added to GNU
binutils as follows:
 COMcc:
 - swapped uneq, unlt, and unle with neq, nlt, and nle
 - added unge, ungt, ne, uge, ugt, nge, ngt, une, ge, and gt aliases
 PCOMcc:
 - added ne alias (for neq)

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

16 years agoAdd mnenomic condition codes for SSE5 comparison opcodes.
Peter Johnson [Thu, 3 Apr 2008 06:45:49 +0000 (06:45 -0000)]
Add mnenomic condition codes for SSE5 comparison opcodes.
There are 16 condition codes for COM and 8 condition codes for PCOM/PCOMU.

Noticed by: nasm64developer@users.sf.net

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

16 years agoMinor update of VC9 compile readme.
Peter Johnson [Tue, 1 Apr 2008 04:25:15 +0000 (04:25 -0000)]
Minor update of VC9 compile readme.
Also add conversion script from vc9 (2008) build files to vc8 (2005) build
files.

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

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

16 years agoInclude VC9 build files in the distfile.
Peter Johnson [Fri, 28 Mar 2008 02:42:41 +0000 (02:42 -0000)]
Include VC9 build files in the distfile.
Noticed by: Brian Gladman <brg@gladman.plus.com>

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

16 years agoFix #136: Unbreak ..@ non-local-label mechanism.
Peter Johnson [Thu, 27 Mar 2008 05:35:36 +0000 (05:35 -0000)]
Fix #136: Unbreak ..@ non-local-label mechanism.
Add testcase for this.
Also fix $-prefixed labels to match non-$-prefixed label behavior
(this has been broken for a very long time).

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

16 years agoFix CPU feature bit number for XSAVE.
Peter Johnson [Fri, 22 Feb 2008 04:50:32 +0000 (04:50 -0000)]
Fix CPU feature bit number for XSAVE.

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

16 years agoAdd support for Nehalem XSAVE instructions and CPU feature.
Peter Johnson [Fri, 22 Feb 2008 04:48:56 +0000 (04:48 -0000)]
Add support for Nehalem XSAVE instructions and CPU feature.

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

16 years agoAllow setting of the TLS section flag in the NASM section directive.
Peter Johnson [Thu, 21 Feb 2008 09:00:46 +0000 (09:00 -0000)]
Allow setting of the TLS section flag in the NASM section directive.
Also default the .tdata section to having the TLS flag set.

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

16 years agoSet ELF symbol type to TLS if either:
Peter Johnson [Thu, 21 Feb 2008 08:57:23 +0000 (08:57 -0000)]
Set ELF symbol type to TLS if either:
- symbol is defined in a TLS section
- symbol is used in a TLS relocation

This is required by the GNU linker, and matches GNU as behavior.
The implementation is not as clean as it perhaps should be, but it does
the job.

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

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

16 years agoPass size directly to yasm_value_finalize_expr() rather than setting
Peter Johnson [Fri, 15 Feb 2008 06:06:57 +0000 (06:06 -0000)]
Pass size directly to yasm_value_finalize_expr() rather than setting
afterwards.  This fixes the value full-mask case for immediate operands:
e.g. "mov ax, word (label & 0xffff)".

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

16 years agoFix #134: Allow '@' as the first character of an identifier, like NASM does.
Peter Johnson [Fri, 15 Feb 2008 05:25:47 +0000 (05:25 -0000)]
Fix #134: Allow '@' as the first character of an identifier, like NASM does.

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

16 years agoUpdate ..sym to work within new get_special_sym() framework.
Peter Johnson [Sat, 9 Feb 2008 04:09:47 +0000 (04:09 -0000)]
Update ..sym to work within new get_special_sym() framework.

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

16 years agoAdd support for ELF32 and ELF64 TLS (thread local storage) relocations.
Peter Johnson [Sat, 9 Feb 2008 04:06:47 +0000 (04:06 -0000)]
Add support for ELF32 and ELF64 TLS (thread local storage) relocations.
While here, simplify how special relocations are handled inside ELF.

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

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

16 years agoEnable use of sym@FOO constructs in GAS parser.
Peter Johnson [Sat, 9 Feb 2008 03:35:07 +0000 (03:35 -0000)]
Enable use of sym@FOO constructs in GAS parser.
To do this, restructure how special symbols are handled between the parser
and object format.  Instead of creating special symbols with the right
names, instead have the parser call the object format to see if a match
is found into the special symbols, which are no longer stored in the
symbol table.

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

16 years agoSupport masking of relocatable values with an AND of the full value width to
Peter Johnson [Fri, 8 Feb 2008 18:59:46 +0000 (18:59 -0000)]
Support masking of relocatable values with an AND of the full value width to
avoid warnings.  This is primarily useful in bin object format output.
  db label        ; if label is >255, warns.
  db label & 0xff ; okay, no warning.
Masks other than full-sized 1s are still not supported:
  db label & 0x7f ; too complex error

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

16 years agoEliminate conversion warnings due to int/size_t differences.
Peter Johnson [Fri, 8 Feb 2008 18:49:10 +0000 (18:49 -0000)]
Eliminate conversion warnings due to int/size_t differences.

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

16 years agoFix #130: Add SAFESEH directive for indicating SEH handlers in win32 output.
Peter Johnson [Fri, 8 Feb 2008 18:26:40 +0000 (18:26 -0000)]
Fix #130: Add SAFESEH directive for indicating SEH handlers in win32 output.
Unlike in MASM, no command-line switch is required.
Usage:
  extern handler (or handler: to define locally)
  safeseh handler

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

16 years agoRevert r2029. According to both AMD64 and Intel 64 instruction set
Peter Johnson [Sat, 2 Feb 2008 19:23:17 +0000 (19:23 -0000)]
Revert r2029.  According to both AMD64 and Intel 64 instruction set
references, REX + 90h opcode is not NOP, but a valid XCHG:

"The x86 architecture commonly uses the XCHG EAX, EAX instruction (opcode
90h) as a one-byte NOP. In 64-bit mode, the processor treats opcode 90h as
a true NOP only if it would exchange rAX with itself. Without this special
handling, the instruction would zero-extend the upper 32 bits of RAX, and
thus it would not be a true nooperation.  Opcode 90h can still be used to
exchange rAX and r8 if the appropriate REX prefix is used."

Noticed by: nasm64developer@users.sf.net

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

16 years agoAdd Visual Studio 2008 build files.
Peter Johnson [Thu, 31 Jan 2008 02:25:12 +0000 (02:25 -0000)]
Add Visual Studio 2008 build files.
Contributed by: Brian Gladman <brg@gladman.plus.com>

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

16 years agoDon't generate 0x90 opcode for xchg rax, r8 and varieties thereof.
Peter Johnson [Mon, 28 Jan 2008 05:48:26 +0000 (05:48 -0000)]
Don't generate 0x90 opcode for xchg rax, r8 and varieties thereof.
Without this fix, "xchg eax, r8d" results in 41 90, which is an invalid
opcode.

Reported by: Stefan <SMarF@gmx.de>

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

16 years agoMake jmp with seg:off equ behave the same as NASM.
Peter Johnson [Sat, 19 Jan 2008 08:59:19 +0000 (08:59 -0000)]
Make jmp with seg:off equ behave the same as NASM.
Formerly:
  foo equ 1:2
  jmp foo
would result in a far jump.  Now, an explicit "far" is required:
  jmp far foo
to generate a far jump.

In addition, the direct use of seg:off in immediates and effective
addresses will result in an error; the use of EQU'ed seg:off values
is still legal (and will still result in just the offset).  This
behavior is more sane and also matches NASM behavior.
Thus:
  foo equ 1:2
  mov ax, foo   ; okay, just 2
  mov ax, [foo] ; okay, just 2
  mov ax, 1:2   ; illegal
  mov ax, [1:2] ; illegal

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

16 years agotools/xdf: Make 64-bit safe.
Peter Johnson [Sat, 19 Jan 2008 08:30:21 +0000 (08:30 -0000)]
tools/xdf: Make 64-bit safe.

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

16 years agoFix #129: Support no-operand form of movsd in GAS syntax.
Peter Johnson [Thu, 3 Jan 2008 04:13:18 +0000 (04:13 -0000)]
Fix #129: Support no-operand form of movsd in GAS syntax.
Reported and patch by: mm.beck@gmx.net

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

17 years agore2c: Fix -b generation in certain cases.
Peter Johnson [Sat, 15 Dec 2007 00:00:55 +0000 (00:00 -0000)]
re2c: Fix -b generation in certain cases.
Fix from re2c repo r417 (sourceforge bug 1479044).

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

17 years agoFix NULL dereference for certain cases of REX used with jump instruction.
Peter Johnson [Mon, 10 Dec 2007 05:20:32 +0000 (05:20 -0000)]
Fix NULL dereference for certain cases of REX used with jump instruction.

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

17 years agoCheck for 0-termination character rather than newline.
Peter Johnson [Fri, 7 Dec 2007 06:49:24 +0000 (06:49 -0000)]
Check for 0-termination character rather than newline.

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

17 years agoTurn off -Wconversion. It is far too noisy for it to be useful due to
Peter Johnson [Thu, 6 Dec 2007 05:46:02 +0000 (05:46 -0000)]
Turn off -Wconversion.  It is far too noisy for it to be useful due to
"passing arg X of `' with different width due to prototype" warnings.

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

17 years agoFix #122: Allow standalone prefixes.
Peter Johnson [Tue, 4 Dec 2007 07:08:01 +0000 (07:08 -0000)]
Fix #122: Allow standalone prefixes.
Implementation copied from gas parser.

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

17 years agoFix #125: Improve reporting of operand and expression syntax errors.
Peter Johnson [Tue, 4 Dec 2007 06:55:11 +0000 (06:55 -0000)]
Fix #125: Improve reporting of operand and expression syntax errors.
Now instead of the generic "expression syntax error", more informative
error messages such as the following are reported:
 - unexpected `:' after instruction
 - expected expression after `%'
 - expected operand, got `%'

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

17 years agoFix #123: Be explicit that errors are such by printing "error:" at beginning
Peter Johnson [Tue, 4 Dec 2007 06:19:07 +0000 (06:19 -0000)]
Fix #123: Be explicit that errors are such by printing "error:" at beginning
of error messages.

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

17 years agoFix #124: Fully simplify out sym-sym in values (e.g. a symbol minus itself).
Peter Johnson [Tue, 4 Dec 2007 05:58:54 +0000 (05:58 -0000)]
Fix #124: Fully simplify out sym-sym in values (e.g. a symbol minus itself).
This could particularly cause false errors if sym is external.

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

17 years agoFix #127: Allow use of 0X in addition to 0x for hex constants.
Peter Johnson [Tue, 4 Dec 2007 04:59:07 +0000 (04:59 -0000)]
Fix #127: Allow use of 0X in addition to 0x for hex constants.

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

17 years agoFix internal error for usage of numeric segments in certain memory
Peter Johnson [Wed, 28 Nov 2007 07:25:59 +0000 (07:25 -0000)]
Fix internal error for usage of numeric segments in certain memory
addresses (e.g. "jmp far [0:0]").

Reported by: arkon@ragestorm.net

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

17 years agoFix #119. Quite a few SSE/SSE2 instructions assumed 128-bit memory sizes
Peter Johnson [Wed, 28 Nov 2007 07:21:08 +0000 (07:21 -0000)]
Fix #119.  Quite a few SSE/SSE2 instructions assumed 128-bit memory sizes
instead of the correct 64-bit or 32-bit sizes (e.g. xmm/m64 or similar).
It worked fine when no memory size was specified, but it should also work
with the correct size modifier.

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

17 years agoCorrectly initialize bin object format to default to no map generation.
Peter Johnson [Thu, 15 Nov 2007 08:03:26 +0000 (08:03 -0000)]
Correctly initialize bin object format to default to no map generation.

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

17 years agoCorrectly warn for map file usage if there are *no* object format
Peter Johnson [Thu, 15 Nov 2007 03:57:34 +0000 (03:57 -0000)]
Correctly warn for map file usage if there are *no* object format
directives.

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

17 years agoCheck for fseek() error.
Peter Johnson [Thu, 15 Nov 2007 03:55:41 +0000 (03:55 -0000)]
Check for fseek() error.

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

17 years agoAdd NASM-compatible multi-section binary support to bin object format.
Peter Johnson [Wed, 14 Nov 2007 08:33:32 +0000 (08:33 -0000)]
Add NASM-compatible multi-section binary support to bin object format.
This allows for arbitrary load (LMA) and execution (VMA) addresses.

The following new section attributes are supported:
 - start (LMA start address)
 - follows (follow another section's last LMA)
 - align (LMA alignment)
 - vstart (VMA start address)
 - vfollows (follow another section's last VMA)
 - valign (VMA alignment)
In addition, sections can be designed progbits or nobits.

The following special symbols are generated for program use:
 - section.<sectname>.start (LMA start address)
 - section.<sectname>.vstart (VMA start address)
 - section.<sectname>.length (section length)

The ORG directive adjusts the file offset relative to LMA, so that if
ORG=0x100, a section with LMA=0x100 will be at file offset 0.

VMA addresses are the same as LMA addresses unless otherwise specified.

Full map file support is supported via the [MAP] directive.  The map output
filename can be set either as a parameter to the [MAP] directive or on the
command line with --mapfile=<filename>.  MAP options are BRIEF, SECTIONS,
SEGMENTS, SYMBOLS, and ALL (all of the above).  If no filename is specified
either on the command line or in the source file, the map is output to
standard output.

Full documentation will be added to the Yasm manual in the near future.

This implementation supports several configurations NASM does not, for
instance http://osdir.com/ml/lang.nasm.devel/2004-12/msg00032.html .
It is also fully 64-bit aware.

Fixes: #71, #99.
svn path=/trunk/yasm/; revision=2010

17 years agoUpdate generated yasm_arch(7) man page.
Peter Johnson [Sat, 3 Nov 2007 04:59:28 +0000 (04:59 -0000)]
Update generated yasm_arch(7) man page.

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

17 years agoSupport use of EQU values within NASM preprocessor.
Peter Johnson [Sat, 3 Nov 2007 04:37:44 +0000 (04:37 -0000)]
Support use of EQU values within NASM preprocessor.
Note: label values are still not supported, and probably never will be,
as yasm is single-pass parsing, and only reads the source file once.
Someday we may add specific support for relatively common %if-%error
idioms.

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

17 years agoChange preprocessor interface from block-oriented to line-oriented.
Peter Johnson [Sat, 3 Nov 2007 04:27:35 +0000 (04:27 -0000)]
Change preprocessor interface from block-oriented to line-oriented.
This will make certain types of parser-preprocessor synchronization
easier for upcoming feature enhancements.

Due to additional complexity in GAS (rept), internally GAS converts
lines back into blocks.

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

17 years agoCheck correct variable for badly parsed expression.
Peter Johnson [Fri, 2 Nov 2007 03:14:47 +0000 (03:14 -0000)]
Check correct variable for badly parsed expression.

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

17 years agocpp-preproc.c: Fix typo in description (enternal -> external).
Peter Johnson [Mon, 22 Oct 2007 06:27:02 +0000 (06:27 -0000)]
cpp-preproc.c: Fix typo in description (enternal -> external).

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

17 years agoFix #118: Don't use getcwd(NULL, 0), as it's platform-specific behavior.
Peter Johnson [Tue, 16 Oct 2007 07:40:21 +0000 (07:40 -0000)]
Fix #118: Don't use getcwd(NULL, 0), as it's platform-specific behavior.

Instead write our own yasm__getcwd() which retries getcwd() with
increasing buffer sizes until the path fits (as the initial size is 1024,
in basically all cases it'll succeed on the first try).

Reported by: bird-yasm@anduin.net

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

17 years agox86_find_match(): Fix error reporting for operand 3 mismatches.
Peter Johnson [Thu, 11 Oct 2007 07:29:41 +0000 (07:29 -0000)]
x86_find_match(): Fix error reporting for operand 3 mismatches.

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

17 years agox86_finalize_jmp(): Fix two incorrect usages of info instead of jinfo.
Peter Johnson [Thu, 11 Oct 2007 06:38:29 +0000 (06:38 -0000)]
x86_finalize_jmp(): Fix two incorrect usages of info instead of jinfo.

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

17 years agoFix explicitly-overridden short-only instructions such as "loop short label".
Peter Johnson [Thu, 11 Oct 2007 06:05:41 +0000 (06:05 -0000)]
Fix explicitly-overridden short-only instructions such as "loop short label".
These would incorrectly be treated as errors.

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

17 years agoAdd core2 as alias for conroe codename.
Peter Johnson [Fri, 21 Sep 2007 21:30:00 +0000 (21:30 -0000)]
Add core2 as alias for conroe codename.

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

17 years agoUpdate yasm_arch(7) man page from AMD64 wiki page.
Peter Johnson [Fri, 21 Sep 2007 21:16:33 +0000 (21:16 -0000)]
Update yasm_arch(7) man page from AMD64 wiki page.

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

17 years agoBring flat and DJGPP Mkfiles up to date with [1939].
Peter Johnson [Fri, 21 Sep 2007 19:15:48 +0000 (19:15 -0000)]
Bring flat and DJGPP Mkfiles up to date with [1939].

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

17 years agoAdd some imm64 tests.
Peter Johnson [Fri, 21 Sep 2007 18:06:47 +0000 (18:06 -0000)]
Add some imm64 tests.

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

17 years agoCommit tests missed in [1979] commit.
Peter Johnson [Fri, 21 Sep 2007 18:04:47 +0000 (18:04 -0000)]
Commit tests missed in [1979] commit.

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

17 years agoFix #115: 1<<0 resulted in 0 instead of 1 (broken in [1900]).
Peter Johnson [Fri, 21 Sep 2007 17:48:17 +0000 (17:48 -0000)]
Fix #115: 1<<0 resulted in 0 instead of 1 (broken in [1900]).

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

17 years agoRemove yapp-preproc.c from list of files to scan for gettext.
Peter Johnson [Fri, 21 Sep 2007 06:56:02 +0000 (06:56 -0000)]
Remove yapp-preproc.c from list of files to scan for gettext.

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

17 years agoFollow NASM after all in only turning off default RIP-rel for FS and GS,
Peter Johnson [Thu, 20 Sep 2007 05:15:29 +0000 (05:15 -0000)]
Follow NASM after all in only turning off default RIP-rel for FS and GS,
not all segment registers.  FS and GS are the only ones which can have
a segment base != 0.

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

17 years agoAutoconfize cpp program name and popen. This commit inactivates cpp in the
Peter Johnson [Thu, 20 Sep 2007 04:24:46 +0000 (04:24 -0000)]
Autoconfize cpp program name and popen.  This commit inactivates cpp in the
VC build files, as there's no popen.

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

17 years agoFinish cleanups made in [1967].
Peter Johnson [Thu, 20 Sep 2007 04:23:48 +0000 (04:23 -0000)]
Finish cleanups made in [1967].

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

17 years agoUpdate Mkfiles to add new cpp module.
Peter Johnson [Thu, 20 Sep 2007 03:58:31 +0000 (03:58 -0000)]
Update Mkfiles to add new cpp module.

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

17 years agoFix a couple of warnings (non-prototype functions).
Peter Johnson [Thu, 20 Sep 2007 03:55:17 +0000 (03:55 -0000)]
Fix a couple of warnings (non-prototype functions).

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

17 years agoMerge r1916-r1961 (cpp preproc module) from multiarch into trunk.
Peter Johnson [Thu, 20 Sep 2007 03:54:36 +0000 (03:54 -0000)]
Merge r1916-r1961 (cpp preproc module) from multiarch into trunk.
Contributed by: Paul Barker

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

17 years agoSupport NASM's upcoming RIP-relative syntax, with a few differences.
Peter Johnson [Wed, 19 Sep 2007 07:47:10 +0000 (07:47 -0000)]
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

17 years agoSupport "oword", "do", and "reso" as aliases for "dqword", "ddq", and
Peter Johnson [Wed, 19 Sep 2007 02:52:33 +0000 (02:52 -0000)]
Support "oword", "do", and "reso" as aliases for "dqword", "ddq", and
"resdq" respectively, for compatibility with NASM (sigh).

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

17 years ago* Added code to the cpp module to pass include directories to the cpp program.
paulbarker [Tue, 18 Sep 2007 12:41:57 +0000 (12:41 -0000)]
* 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

17 years agoMake Python messages a little less threatening.
Peter Johnson [Tue, 18 Sep 2007 08:34:57 +0000 (08:34 -0000)]
Make Python messages a little less threatening.

Suggested by: Brian Gladman

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

17 years agoRemove unused variable.
Peter Johnson [Tue, 18 Sep 2007 05:38:06 +0000 (05:38 -0000)]
Remove unused variable.

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

17 years agoFix VC++ build order dependencies.
Peter Johnson [Tue, 18 Sep 2007 05:22:07 +0000 (05:22 -0000)]
Fix VC++ build order dependencies.
Patch by: mu@

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

17 years agoEnsure Python is available before trying to run gen_x86_insn.py.
Peter Johnson [Tue, 18 Sep 2007 02:33:31 +0000 (02:33 -0000)]
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

17 years agoInclude ctype.h into files that now use tolower().
Peter Johnson [Mon, 17 Sep 2007 03:42:01 +0000 (03:42 -0000)]
Include ctype.h into files that now use tolower().

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

17 years agoMake CPU feature flags and registers case insensitive again.
Peter Johnson [Mon, 17 Sep 2007 02:58:05 +0000 (02:58 -0000)]
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

17 years agoAdd support for IEEE-754r "half precision" (16-bit) float format.
Peter Johnson [Sun, 16 Sep 2007 20:41:16 +0000 (20:41 -0000)]
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

17 years agoAdd SSE5 (new AMD SSE) instructions support.
Peter Johnson [Sun, 16 Sep 2007 20:29:59 +0000 (20:29 -0000)]
Add SSE5 (new AMD SSE) instructions support.

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

17 years agoFix #114: Incorrect ELF32 ..gotpc address calculation.
Peter Johnson [Sat, 15 Sep 2007 06:40:27 +0000 (06:40 -0000)]
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

17 years agoFinish cleanup made in [1948].
Peter Johnson [Fri, 14 Sep 2007 05:19:10 +0000 (05:19 -0000)]
Finish cleanup made in [1948].

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

17 years agoSwitch x86 operand storage from manual bitfields to C structure bitfields.
Peter Johnson [Thu, 13 Sep 2007 07:26:17 +0000 (07:26 -0000)]
Switch x86 operand storage from manual bitfields to C structure bitfields.

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

17 years agoChange modifiers from a prioritized shifted sequence into an ordered array.
Peter Johnson [Thu, 13 Sep 2007 06:35:24 +0000 (06:35 -0000)]
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

17 years agoNow that part of the build uses just Python, break apart the Python
Peter Johnson [Thu, 13 Sep 2007 02:53:30 +0000 (02:53 -0000)]
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

17 years agoAdd Id tag.
Peter Johnson [Wed, 12 Sep 2007 07:11:42 +0000 (07:11 -0000)]
Add Id tag.

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

17 years agoNow that we have more cpu feature bits, properly document SSE4a as such.
Peter Johnson [Wed, 12 Sep 2007 07:10:26 +0000 (07:10 -0000)]
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

17 years agoRestructure x86 CPU handling to allow for more than 30 CPU feature flags.
Peter Johnson [Wed, 12 Sep 2007 06:55:51 +0000 (06:55 -0000)]
Restructure x86 CPU handling to allow for more than 30 CPU feature flags.

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

17 years agoRun gen_x86_insn.py from vc and vc8 builds.
Peter Johnson [Wed, 12 Sep 2007 04:15:33 +0000 (04:15 -0000)]
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

17 years agoShrink the size of the x86_insn_info structure, particularly on 64-bit
Peter Johnson [Tue, 11 Sep 2007 04:49:53 +0000 (04:49 -0000)]
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

17 years agoNow that genperf takes an output filename, change informational outputs
Peter Johnson [Tue, 11 Sep 2007 02:11:19 +0000 (02:11 -0000)]
Now that genperf takes an output filename, change informational outputs
to stdout instead of stderr.

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

17 years agoAdded dependency generation to cpp module.
paulbarker [Mon, 10 Sep 2007 10:46:31 +0000 (10:46 -0000)]
Added dependency generation to cpp module.

svn path=/branches/multiarch/; revision=1941

17 years agoDelayed destruction of arguments list until cpp_preproc_destroy() in cpp module.
paulbarker [Mon, 10 Sep 2007 10:17:19 +0000 (10:17 -0000)]
Delayed destruction of arguments list until cpp_preproc_destroy() in cpp module.

svn path=/branches/multiarch/; revision=1940

17 years agoChange genperf to take input and output filenames rather than outputting to
Peter Johnson [Mon, 10 Sep 2007 07:15:50 +0000 (07:15 -0000)]
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

17 years agoCheck in generated files from the Python script added in [1937].
Peter Johnson [Mon, 10 Sep 2007 07:03:53 +0000 (07:03 -0000)]
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

17 years agoChange x86 instruction tables to be automatically generated.
Peter Johnson [Mon, 10 Sep 2007 06:59:47 +0000 (06:59 -0000)]
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

17 years agoFixed missing semicolon in file.h due to mistake when committing r1935.
paulbarker [Sun, 9 Sep 2007 17:09:38 +0000 (17:09 -0000)]
Fixed missing semicolon in file.h due to mistake when committing r1935.

svn path=/branches/multiarch/; revision=1936

17 years agoChanged gas parser to only pass the first cpp line marker onto the debugging module.
paulbarker [Sun, 9 Sep 2007 11:51:08 +0000 (11:51 -0000)]
Changed gas parser to only pass the first cpp line marker onto the debugging module.

svn path=/branches/multiarch/; revision=1935

17 years agoAdded yasm_get_include_dir() function.
paulbarker [Sun, 9 Sep 2007 11:49:25 +0000 (11:49 -0000)]
Added yasm_get_include_dir() function.

svn path=/branches/multiarch/; revision=1934

17 years agoRe-enable lc3b in flat Mkfiles.
Peter Johnson [Sat, 8 Sep 2007 02:19:33 +0000 (02:19 -0000)]
Re-enable lc3b in flat Mkfiles.

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

17 years agoWindows build fixes:
Peter Johnson [Sat, 8 Sep 2007 02:13:25 +0000 (02:13 -0000)]
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

17 years agoFix a couple of Doxygen nits.
Peter Johnson [Sat, 8 Sep 2007 01:34:51 +0000 (01:34 -0000)]
Fix a couple of Doxygen nits.

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