Commit graph

955 commits

Author SHA1 Message Date
Peter Johnson
780736a8a7 Merge [2121], [2122], [2123], [2124], [2125], [2126], and [2127] from trunk.
[2121]: Mark gen_x86_insn.py outputs as generated.
[2122]: Don't read past end of string in parsers (not bug).
[2123]: Fix expression simplification bug.
[2124]: Warn if unused groups are detected in gen_x86_insn.py.
[2125]: VPBLENDVB doesn't have a 256-bit form; remove it.
[2126]: Generate GOTPCREL relocation for [rel foo wrt ..gotpc].
[2127]: Optimize non-strict push with 66 override to byte size if possible.

svn path=/branches/yasm-0.7.x/; revision=2148
2008-10-08 07:42:56 +00:00
Peter Johnson
4947c3edea Merge [2120] from trunk (Fix #153, name the absolute symbol in coff/win32).
svn path=/branches/yasm-0.7.x/; revision=2147
2008-10-08 07:39:18 +00:00
Peter Johnson
d1b8e92eab Merge [2116], [2117], [2118], and [2119] from trunk.
[2116]: Fix absolute path handling.
[2117]: Fix expression leveling bug.
[2118], [2119]: Add support for newly specified AVX/AES instructions.

svn path=/branches/yasm-0.7.x/; revision=2146
2008-10-08 07:37:52 +00:00
Peter Johnson
5afe24a8a0 Merge [2114] and [2115] from trunk (Fix #148, clearing of GAS elf sectflags).
svn path=/branches/yasm-0.7.x/; revision=2145
2008-10-08 07:34:51 +00:00
Peter Johnson
6e13bb01b7 Merge [2110], [2111], [2112], and [2113] from trunk.
[2110]: Fix address printing in bin map file
[2111]: automake build fixes
[2112]: libyasm documentation fix
[2113]: Fix register name lookup for printing

svn path=/branches/yasm-0.7.x/; revision=2144
2008-10-08 07:33:10 +00:00
Peter Johnson
300f38bde3 Merge [2109] from trunk (Fix #132, --prefix and --suffix options).
svn path=/branches/yasm-0.7.x/; revision=2143
2008-10-08 07:29:43 +00:00
Peter Johnson
154d91d85d Merge [2108] from trunk (Fix #141, macho64 PIC support).
svn path=/branches/yasm-0.7.x/; revision=2142
2008-10-08 07:26:32 +00:00
Peter Johnson
ef29b94867 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
2008-10-05 08:31:04 +00:00
Peter Johnson
4d78c310b5 elf64: automatically promote [rel foo wrt ..gotpc] to GOTPCREL relocation.
Formerly, [rel foo wrt ..gotpcrel] was required.

svn path=/trunk/yasm/; revision=2126
2008-10-03 08:13:00 +00:00
Peter Johnson
0b002cd6a3 VPBLENDVB doesn't have a 256-bit form.
Reported by: Mark Charney

svn path=/trunk/yasm/; revision=2125
2008-10-02 07:26:22 +00:00
Peter Johnson
5abca04eff gen_x86_insn.py: Warn if any groups are unused (due to a typo, for example).
svn path=/trunk/yasm/; revision=2124
2008-10-02 02:15:56 +00:00
Peter Johnson
1b1c9ba0ad 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
2008-09-30 02:52:56 +00:00
Peter Johnson
11798b4d6b Mark gen_x86_insn.py outputs as generated, to discourage hand-editing.
Suggested by: Mark Charney

svn path=/trunk/yasm/; revision=2121
2008-09-10 02:42:45 +00:00
Peter Johnson
c80ed373ba 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
2008-09-04 04:45:30 +00:00
Peter Johnson
a1b9924b9a Increase size of buffer now that mnenomics can be 16 characters.
svn path=/trunk/yasm/; revision=2119
2008-08-13 04:05:19 +00:00
Peter Johnson
b174e03f50 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
2008-08-13 03:43:47 +00:00
Peter Johnson
e0d651acdd Fix extraneous warnings and update testcases for [2114] changes.
svn path=/trunk/yasm/; revision=2115
2008-07-08 06:36:44 +00:00
Peter Johnson
dbf6c6ce38 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
2008-07-08 06:28:37 +00:00
Peter Johnson
9cd2ac3378 x86_reg_print(): Add missing commas for correct register name lookup.
svn path=/trunk/yasm/; revision=2113
2008-07-07 06:17:33 +00:00
Peter Johnson
a78a908bab 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
2008-07-06 22:26:49 +00:00
Peter Johnson
bd4a2ffdb8 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
2008-07-03 04:19:12 +00:00
Peter Johnson
53b2d01a77 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
2008-06-08 09:06:05 +00:00
Peter Johnson
3aab66a119 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
2008-06-05 08:48:21 +00:00
Peter Johnson
0a3f7ea1b9 (cmake build) Install DLL files to correct locations on Windows.
svn path=/trunk/yasm/; revision=2102
2008-05-24 18:30:29 +00:00
Peter Johnson
b7f2fbc64f 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
2008-05-22 09:08:03 +00:00
Peter Johnson
81f12a1830 Merge [2088] from trunk (Add westmere CPU).
svn path=/branches/yasm-0.7.x/; revision=2092
2008-05-14 03:46:41 +00:00
Peter Johnson
464cbc852b Merge [2077] from trunk (LAR and LSL should be 286+Prot, not 386).
svn path=/branches/yasm-0.7.x/; revision=2091
2008-05-14 03:44:53 +00:00
Peter Johnson
0fdda0e00e Merge [2074] from trunk.
svn path=/branches/yasm-0.7.x/; revision=2090
2008-05-14 03:43:20 +00:00
Peter Johnson
a72cc83b3c 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
2008-05-14 03:32:20 +00:00
Peter Johnson
77aea19bc4 Fix handling of alloc_stack macro in GAS mode.
Reported by: Brian Gladman <brg@gladman.plus.com>

svn path=/trunk/yasm/; revision=2086
2008-05-13 03:41:27 +00:00
Peter Johnson
a1cd884de8 Fix #138: Incorrect UNW_FLAG_CHAININFO value (currently unused).
svn path=/trunk/yasm/; revision=2083
2008-05-09 06:51:41 +00:00
Peter Johnson
cbf0c7befd 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
2008-05-09 06:46:02 +00:00
Peter Johnson
d8a6f8c376 Allow registers as GAS directive parameters.
This is required for the win64 SEH directives.

svn path=/trunk/yasm/; revision=2081
2008-05-09 06:28:47 +00:00
Peter Johnson
3e6d218d3b Enable GAS versions of the win32/win64 safe exception handling directives.
svn path=/trunk/yasm/; revision=2079
2008-04-29 06:06:20 +00:00
Peter Johnson
5bdb018c95 Fix GAS handling of NASM preproc %line.
Reported by: Brian Gladman

svn path=/trunk/yasm/; revision=2078
2008-04-29 05:11:52 +00:00
Peter Johnson
a4c7d7b85c Fix #137: LAR and LSL should only need 286+Prot CPU flags, not 386.
svn path=/trunk/yasm/; revision=2077
2008-04-29 02:24:02 +00:00
Peter Johnson
7b190b80fb 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
2008-04-25 06:50:36 +00:00
Peter Johnson
ca23bda1cf Defensively look for NULL istk.
svn path=/trunk/yasm/; revision=2075
2008-04-25 05:07:57 +00:00
Peter Johnson
1fd4e2ff76 Fix two instances of VERMIL2PS/PD incorrectly setting VEX.L=1.
Reported by: nasm64developer@users.sf.net

svn path=/trunk/yasm/; revision=2074
2008-04-25 04:58:11 +00:00
Peter Johnson
1ed090be23 Merge [2069], [2070], [2071], and [2072] from trunk to 0.7.x branch.
svn path=/branches/yasm-0.7.x/; revision=2073
2008-04-25 03:25:12 +00:00
Peter Johnson
bf5716cbd7 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
2008-04-22 05:41:11 +00:00
Peter Johnson
3d2fb09a5f 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
2008-04-21 07:59:57 +00:00
Peter Johnson
e563cbb2d9 Fix AVX instruction misnaming of new vptest variants:
- vptestps should be vtestps
 - vptestpd should be vtestpd

svn path=/trunk/yasm/; revision=2069
2008-04-21 07:56:26 +00:00
Peter Johnson
180d18bc11 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
2008-04-12 08:30:22 +00:00
Peter Johnson
ae63705e56 Add YMM register group for GAS mode.
svn path=/trunk/yasm/; revision=2061
2008-04-12 01:33:54 +00:00
Peter Johnson
a38f103515 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
2008-04-11 09:29:58 +00:00
Peter Johnson
9ade4d408d 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
2008-04-11 01:37:46 +00:00
Peter Johnson
120c28e2d3 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
2008-04-04 02:10:24 +00:00
Peter Johnson
33cc7a0255 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
2008-04-03 06:45:49 +00:00
Peter Johnson
698f3fe8ff 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
2008-03-27 05:35:36 +00:00