]> granicus.if.org Git - yasm/log
yasm
16 years agoRemove directory EXTRA_DIST; it seems to be making distcheck on ctn die.
Peter Johnson [Wed, 8 Oct 2008 07:15:45 +0000 (07:15 -0000)]
Remove directory EXTRA_DIST; it seems to be making distcheck on ctn die.

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

16 years agoUse yasm functions yasm__strcasecmp and nasm_strdup instead of relying on
Peter Johnson [Wed, 8 Oct 2008 05:19:47 +0000 (05:19 -0000)]
Use yasm functions yasm__strcasecmp and nasm_strdup instead of relying on
platform to have them.

Also, instead of using snprintf, preallocate and then use sprintf.  This
also avoids the while() reallocation loop.

Reported by: Brian Gladman

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

16 years agotasm.c: Don't include unistd.h.
Peter Johnson [Wed, 8 Oct 2008 04:58:08 +0000 (04:58 -0000)]
tasm.c: Don't include unistd.h.

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

16 years agoAdd Samuel Thibault to list of contributors.
Peter Johnson [Tue, 7 Oct 2008 06:22:58 +0000 (06:22 -0000)]
Add Samuel Thibault to list of contributors.

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

16 years agotasm frontend: Fix handling of options >2 chars long.
Peter Johnson [Tue, 7 Oct 2008 06:21:06 +0000 (06:21 -0000)]
tasm frontend: Fix handling of options >2 chars long.
Use yasm__strncasecmp instead of manually lowercasing up to two characters.

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

16 years agotasm frontend: Fix crash with plain /l option.
Peter Johnson [Tue, 7 Oct 2008 06:16:57 +0000 (06:16 -0000)]
tasm frontend: Fix crash with plain /l option.

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

16 years agoDon't use tasm_compatible_mode in nasm parser (use local var instead).
Peter Johnson [Tue, 7 Oct 2008 06:02:12 +0000 (06:02 -0000)]
Don't use tasm_compatible_mode in nasm parser (use local var instead).
Fix a few warnings while here.

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

16 years agoFix a number of warnings.
Peter Johnson [Tue, 7 Oct 2008 05:59:29 +0000 (05:59 -0000)]
Fix a number of warnings.

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

16 years agoAdd CMakeLists.txt for tasm frontend.
Peter Johnson [Tue, 7 Oct 2008 05:47:08 +0000 (05:47 -0000)]
Add CMakeLists.txt for tasm frontend.

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

16 years agoUpdate Mkfiles (except for VC) for TASM build.
Peter Johnson [Tue, 7 Oct 2008 05:43:29 +0000 (05:43 -0000)]
Update Mkfiles (except for VC) for TASM build.

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

16 years agoAdd core TASM syntax support.
Peter Johnson [Tue, 7 Oct 2008 05:38:11 +0000 (05:38 -0000)]
Add core TASM syntax support.
Contributed by: Samuel Thibault <samuel.thibault@ens-lyon.org>

It is built on top of the NASM parser and preproc, with the following
notable extensions for TASM syntax:
 - case insensitive symbols and filenames,
 - support for segment and size of labels, which permits to avoid giving
   them on each memory dereference,
 - support for data reservation (i.e. e.g. "var dd ?"),
 - support for multiples (i.e. e.g. "var dd 1 dup 10"),
 - little endian string integer constants,
 - additional expression operators: shl, shr, and, or, low, high,
 - additional offset keyword,
 - additional fword and df,
 - support for doubled quotes within quotes,
 - support for array-like and structure-like notations: t[eax] and
   [var].field,
 - support for tasm directives: macro, rept, irp, locals, proc, struc,
   segment, assume.

Notes:

 - Almost all extensions are only effective when tasm_compatible_mode is
   set, so we should have very reduced possible breakage.

 - Because the "and" keyword can be an expression operator and an
   instruction name, the data pseudo-instructions explicitly switch the
   lexer state to INSTRUCTION state to fix the ambiguity.

 - In gen_x86_insn.py, several instructions (namely lds and lea) now take
   relaxed memory sizes.  The reason is that in the case of tasm, the size
   of the actual pointed data is passed up to there, and thus any type of
   data should be accepted.

With all of this, loadlin can be compiled by yasm with quite reduced
modifications.

A new TASM-like frontend is also included.

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

16 years agoDon't require nasm preproc for some testcases.
Peter Johnson [Tue, 7 Oct 2008 04:34:19 +0000 (04:34 -0000)]
Don't require nasm preproc for some testcases.

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

16 years agoOptimize non-strict push with 66 override to byte size if possible in NASM
Peter Johnson [Sun, 5 Oct 2008 08:31:04 +0000 (08:31 -0000)]
Optimize non-strict push with 66 override to byte size if possible in NASM
syntax.

Previously, the forms of push that did this optimization were disabled in
NASM syntax due to conflicting with the size=BITS case.  Fix this via
reordering to allow these forms to be active in NASM syntax.

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

16 years agoelf64: automatically promote [rel foo wrt ..gotpc] to GOTPCREL relocation.
Peter Johnson [Fri, 3 Oct 2008 08:13:00 +0000 (08:13 -0000)]
elf64: automatically promote [rel foo wrt ..gotpc] to GOTPCREL relocation.
Formerly, [rel foo wrt ..gotpcrel] was required.

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

16 years agoVPBLENDVB doesn't have a 256-bit form.
Peter Johnson [Thu, 2 Oct 2008 07:26:22 +0000 (07:26 -0000)]
VPBLENDVB doesn't have a 256-bit form.

Reported by: Mark Charney

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

16 years agogen_x86_insn.py: Warn if any groups are unused (due to a typo, for example).
Peter Johnson [Thu, 2 Oct 2008 02:15:56 +0000 (02:15 -0000)]
gen_x86_insn.py: Warn if any groups are unused (due to a typo, for example).

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

16 years agoFix expr simplification bug.
Peter Johnson [Tue, 30 Sep 2008 03:56:37 +0000 (03:56 -0000)]
Fix expr simplification bug.
If an expression of the form INT+(a+b)+INT was simplified, constant folding
would combine the ints, but then the level stage (to make INT+a+b) would
start reading from the second (deleted due to folding) INT rather than the
new end of the expression.

Reported by: Samuel Thibault (on yasm-devel@)

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

16 years agoNasm lexer: Don't read past end of passed string.
Peter Johnson [Tue, 30 Sep 2008 02:52:56 +0000 (02:52 -0000)]
Nasm lexer: Don't read past end of passed string.
This was because the re2c-generated code always reads the next character
prior to user code being executed.  Instead, check for the \0 marker prior
to entering the re2c code.  Retain the re2c check just for sanity.

Reported by: Samuel Thibault (on yasm-devel@)

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

16 years agoMark gen_x86_insn.py outputs as generated, to discourage hand-editing.
Peter Johnson [Wed, 10 Sep 2008 02:42:45 +0000 (02:42 -0000)]
Mark gen_x86_insn.py outputs as generated, to discourage hand-editing.

Suggested by: Mark Charney

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

16 years agoFix #153: Name the absolute symbol.
Peter Johnson [Thu, 4 Sep 2008 04:45:30 +0000 (04:45 -0000)]
Fix #153: Name the absolute symbol.
While we're here, ensure it's always output regardless of all_syms setting.

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

16 years agoIncrease size of buffer now that mnenomics can be 16 characters.
Peter Johnson [Wed, 13 Aug 2008 04:05:19 +0000 (04:05 -0000)]
Increase size of buffer now that mnenomics can be 16 characters.

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

16 years agoAdd support for newly specified AVX/AES instructions:
Peter Johnson [Wed, 13 Aug 2008 03:43:47 +0000 (03:43 -0000)]
Add support for newly specified AVX/AES instructions:
- vaes*
- 256b vmovnt{ps,pd,dq}

Reported by: Mark.Charney@intel.com

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

16 years agoFix bug in expr_level_op(). Discovered when adding on-the-fly expr leveling.
Peter Johnson [Fri, 18 Jul 2008 05:52:01 +0000 (05:52 -0000)]
Fix bug in expr_level_op().  Discovered when adding on-the-fly expr leveling.

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

16 years agoActually implement yasm__abspath() according to its documentation.
Peter Johnson [Tue, 15 Jul 2008 05:49:29 +0000 (05:49 -0000)]
Actually implement yasm__abspath() according to its documentation.
Formerly, it would not correctly handle absolute paths.  Now it uses
yasm__combpath() to do absolute-path aware path combination.
As a benefit, it no longer needs to be OS-specific.

Reported by: Shmuel Baron <shmulik@gmail.com>

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

16 years agoFix extraneous warnings and update testcases for [2114] changes.
Peter Johnson [Tue, 8 Jul 2008 06:36:44 +0000 (06:36 -0000)]
Fix extraneous warnings and update testcases for [2114] changes.

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

16 years agoFix #148: Don't clear elf section flags in GAS if it's a standard section and
Peter Johnson [Tue, 8 Jul 2008 06:28:37 +0000 (06:28 -0000)]
Fix #148: Don't clear elf section flags in GAS if it's a standard section and
no GAS flags were provided.

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

16 years agox86_reg_print(): Add missing commas for correct register name lookup.
Peter Johnson [Mon, 7 Jul 2008 06:17:33 +0000 (06:17 -0000)]
x86_reg_print(): Add missing commas for correct register name lookup.

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

16 years agoyasm_symrec_get_global_name(): Document object parameter.
Peter Johnson [Sun, 6 Jul 2008 22:30:07 +0000 (22:30 -0000)]
yasm_symrec_get_global_name(): Document object parameter.

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

16 years agoGenerated files listed in SOURCES (rather than included by other files)
Peter Johnson [Sun, 6 Jul 2008 22:26:49 +0000 (22:26 -0000)]
Generated files listed in SOURCES (rather than included by other files)
should not be listed in BUILT_SOURCES but rather have nodist_ prepended.
They still need to be separately listed as CLEANFILES as they're built
at make time.

Reported by: David Harvey <dmharvey@math.harvard.edu>

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

16 years agoBin map file: Fix incorrect address printing for symbols.
Peter Johnson [Thu, 3 Jul 2008 04:19:12 +0000 (04:19 -0000)]
Bin map file: Fix incorrect address printing for symbols.
We were printing the previous bytecode's start rather than the label's
bytecode.  Use yasm_bc_next_offset() to get the correct offset.

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

16 years agoFix #132: Add --prefix and --suffix (aka --postfix) options.
Peter Johnson [Sun, 8 Jun 2008 09:06:05 +0000 (09:06 -0000)]
Fix #132: Add --prefix and --suffix (aka --postfix) options.
These allow arbitrary prefixes and/or suffixes to be added to
externally-visible (GLOBAL, EXTERN, or COMMON) symbol names.

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

16 years agoFix #141: Add macho64 PIC support.
Peter Johnson [Thu, 5 Jun 2008 08:48:21 +0000 (08:48 -0000)]
Fix #141: Add macho64 PIC support.
The way PIC relocations are generated for macho64 requires a bit of a hack
to detect MOV opcodes and generate GOT_LOAD relocs.
GAS contains a similar hack.

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

16 years agoQuiet a warning about casting from a data to function pointer.
Peter Johnson [Sun, 25 May 2008 17:02:24 +0000 (17:02 -0000)]
Quiet a warning about casting from a data to function pointer.
This is required to get a function pointer from dlsym().

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

16 years agoUpdate plugin README files for Windows.
Peter Johnson [Sat, 24 May 2008 19:00:48 +0000 (19:00 -0000)]
Update plugin README files for Windows.

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

16 years agoError out if Python not found.
Peter Johnson [Sat, 24 May 2008 18:50:32 +0000 (18:50 -0000)]
Error out if Python not found.

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

16 years agoFix x86 plugin build on Windows.
Peter Johnson [Sat, 24 May 2008 18:49:59 +0000 (18:49 -0000)]
Fix x86 plugin build on Windows.

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

16 years agoClean up plugins CMakeLists a bit.
Peter Johnson [Sat, 24 May 2008 18:32:39 +0000 (18:32 -0000)]
Clean up plugins CMakeLists a bit.
Be more clever about finding the yasm executable on Windows.

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

16 years ago(cmake build) Install DLL files to correct locations on Windows.
Peter Johnson [Sat, 24 May 2008 18:30:29 +0000 (18:30 -0000)]
(cmake build) Install DLL files to correct locations on Windows.

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

16 years agoEnable DLL/plugin builds with cmake on Windows.
Peter Johnson [Fri, 23 May 2008 06:46:51 +0000 (06:46 -0000)]
Enable DLL/plugin builds with cmake on Windows.
Add proper declspec dllimport/dllexport to all libyasm functions.
Use macros to make these do nothing on non-cmake and Unix builds.

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

16 years agoEnable Id keyword expansion.
Peter Johnson [Fri, 23 May 2008 06:31:52 +0000 (06:31 -0000)]
Enable Id keyword expansion.

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

16 years agoPrepend "lib" on plugin name only on Unix.
Peter Johnson [Fri, 23 May 2008 06:30:38 +0000 (06:30 -0000)]
Prepend "lib" on plugin name only on Unix.

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

16 years agoAdd cmake build infrastructure.
Peter Johnson [Thu, 22 May 2008 09:08:03 +0000 (09:08 -0000)]
Add cmake build infrastructure.
Not default nor even distributed in the .tar.gz, the cmake build allows for
loadable yasm plugins by building libyasm as a shared library.
Example plugins are in the plugins/ directory, and may be loaded into a
cmake-built yasm using the -N command line option (non-cmake builds will
not have this option).

Tested only on Linux so far, but should be relatively painless to port to
Windows thanks to the use of cmake rather than libtool to create shared
libraries.

The only modification to the main source tree is some conditional-compiled
additions to yasm.c.

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

16 years agoMake util.h more robust against use without config.h by moving the
Peter Johnson [Thu, 22 May 2008 08:37:32 +0000 (08:37 -0000)]
Make util.h more robust against use without config.h by moving the
toascii redefinition to the only file that uses it, errwarn.c.

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

16 years agoMake ISO C89 compliant (too long constant string, use of // comment).
Peter Johnson [Thu, 15 May 2008 06:55:57 +0000 (06:55 -0000)]
Make ISO C89 compliant (too long constant string, use of // comment).

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

16 years agoAdd westmere CPU (supports AES and CLMUL), redefine sandybridge to add AVX
Peter Johnson [Wed, 14 May 2008 03:32:20 +0000 (03:32 -0000)]
Add westmere CPU (supports AES and CLMUL), redefine sandybridge to add AVX
(FMA won't appear until the 22nm shrink of sandybridge).

Reported by: nasm64developer@users.sf.net

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

16 years agoBring Mkfiles up-to-date with genmacro/preproc changes.
Peter Johnson [Tue, 13 May 2008 05:28:09 +0000 (05:28 -0000)]
Bring Mkfiles up-to-date with genmacro/preproc changes.

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

16 years agoFix handling of alloc_stack macro in GAS mode.
Peter Johnson [Tue, 13 May 2008 03:41:27 +0000 (03:41 -0000)]
Fix handling of alloc_stack macro in GAS mode.
Reported by: Brian Gladman <brg@gladman.plus.com>

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

16 years agoCommit moved, updated genmacro script missed in [2082] commit.
Peter Johnson [Fri, 9 May 2008 07:08:17 +0000 (07:08 -0000)]
Commit moved, updated genmacro script missed in [2082] commit.

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

16 years agoFix #138: Incorrect UNW_FLAG_CHAININFO value (currently unused).
Peter Johnson [Fri, 9 May 2008 06:51:41 +0000 (06:51 -0000)]
Fix #138: Incorrect UNW_FLAG_CHAININFO value (currently unused).

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

16 years agoSplit NASM preprocessor standard macro set between various modules.
Peter Johnson [Fri, 9 May 2008 06:46:02 +0000 (06:46 -0000)]
Split NASM preprocessor standard macro set between various modules.
Standard macro sets are looked up based on parser and preprocessor keyword
from individual modules.

The "standard" NASM parser macros now reside in the NASM parser, so when
the GAS parser is used with the NASM preprocessor, the NASM-specific macros
are no longer defined.

Object-format specific macros are now individually defined by each object
formatm module.  This allows for the object formats to be independent of the
NASM preprocessor module and yields a small optimization benefit as unused
object format macros don't need to be skipped over.

Also add GAS macro equivalents for the Win64 SEH more complex directives [1].

[1] Requested by Brian Gladman <brg@gladman.plus.com>

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

16 years agoAllow registers as GAS directive parameters.
Peter Johnson [Fri, 9 May 2008 06:28:47 +0000 (06:28 -0000)]
Allow registers as GAS directive parameters.
This is required for the win64 SEH directives.

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

16 years agoAllow registering of new modules at runtime.
Peter Johnson [Wed, 30 Apr 2008 04:40:29 +0000 (04:40 -0000)]
Allow registering of new modules at runtime.

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

16 years agoEnable GAS versions of the win32/win64 safe exception handling directives.
Peter Johnson [Tue, 29 Apr 2008 06:06:20 +0000 (06:06 -0000)]
Enable GAS versions of the win32/win64 safe exception handling directives.

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

16 years agoFix GAS handling of NASM preproc %line.
Peter Johnson [Tue, 29 Apr 2008 05:11:52 +0000 (05:11 -0000)]
Fix GAS handling of NASM preproc %line.

Reported by: Brian Gladman

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

16 years agoFix #137: LAR and LSL should only need 286+Prot CPU flags, not 386.
Peter Johnson [Tue, 29 Apr 2008 02:24:02 +0000 (02:24 -0000)]
Fix #137: LAR and LSL should only need 286+Prot CPU flags, not 386.

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

16 years agoSupport use of NASM preprocessor with GAS parser.
Peter Johnson [Fri, 25 Apr 2008 06:50:36 +0000 (06:50 -0000)]
Support use of NASM preprocessor with GAS parser.
Note: this combination is obviously not supported by any other assembler.

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

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

16 years agoDefensively look for NULL istk.
Peter Johnson [Fri, 25 Apr 2008 05:07:57 +0000 (05:07 -0000)]
Defensively look for NULL istk.

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

16 years agoFix two instances of VERMIL2PS/PD incorrectly setting VEX.L=1.
Peter Johnson [Fri, 25 Apr 2008 04:58:11 +0000 (04:58 -0000)]
Fix two instances of VERMIL2PS/PD incorrectly setting VEX.L=1.

Reported by: nasm64developer@users.sf.net

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

16 years agoFix some re2c memory/initialization issues.
Peter Johnson [Fri, 25 Apr 2008 01:58:59 +0000 (01:58 -0000)]
Fix some re2c memory/initialization issues.
Found by: valgrind

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

16 years agoFix register fields on FMA instructions.
Peter Johnson [Tue, 22 Apr 2008 05:41:11 +0000 (05:41 -0000)]
Fix register fields on FMA instructions.
The FMA instructions swap VEX.vvvv and imm8[7:4] as compared to other AVX
instructions.

Reported by: nasm64developer@users.sf.net

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

16 years agoFix a number of AVX instructions where VEX.vvvv was incorrectly being set
Peter Johnson [Mon, 21 Apr 2008 07:59:57 +0000 (07:59 -0000)]
Fix a number of AVX instructions where VEX.vvvv was incorrectly being set
to a register value instead of 1111b as required by the specification.

Reported by: Mark Charney

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

16 years agoFix AVX instruction misnaming of new vptest variants:
Peter Johnson [Mon, 21 Apr 2008 07:56:26 +0000 (07:56 -0000)]
Fix AVX instruction misnaming of new vptest variants:
 - vptestps should be vtestps
 - vptestpd should be vtestpd

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

16 years agoAllow {extern symbol}-{symbol in same segment} transformation.
Peter Johnson [Mon, 14 Apr 2008 01:48:02 +0000 (01:48 -0000)]
Allow {extern symbol}-{symbol in same segment} transformation.
This was earlier limited to local symbols.

Reported by: Dave Lee <davelee.com@gmail.com>

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

16 years agoAllow underscores in the middle of binary, octal, and hex constants.
Peter Johnson [Sat, 12 Apr 2008 08:30:22 +0000 (08:30 -0000)]
Allow underscores in the middle of binary, octal, and hex constants.
This makes things like 00_11_22_33h okay.
Allow 0X as well as 0x in directives (already allowed for normal case).

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

16 years agoAdd YMM register group for GAS mode.
Peter Johnson [Sat, 12 Apr 2008 01:33:54 +0000 (01:33 -0000)]
Add YMM register group for GAS mode.

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

16 years agoUpdate copyright dates.
Peter Johnson [Sat, 12 Apr 2008 01:17:00 +0000 (01:17 -0000)]
Update copyright dates.

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

16 years agoWe no longer need bison, but we do need Python for building from SVN.
Peter Johnson [Sat, 12 Apr 2008 01:16:04 +0000 (01:16 -0000)]
We no longer need bison, but we do need Python for building from SVN.

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

16 years agoRemove snapshot version number accidentally committed with Mkfiles.
Peter Johnson [Sat, 12 Apr 2008 01:08:19 +0000 (01:08 -0000)]
Remove snapshot version number accidentally committed with Mkfiles.

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

16 years agoBump trunk version after 0.7.x branch.
Peter Johnson [Sat, 12 Apr 2008 01:04:29 +0000 (01:04 -0000)]
Bump trunk version after 0.7.x branch.

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

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