AMD has obsoleted the SSE5 spec in favor of these instructions. These
instructions use an AVX-like new opcode structure called XOP instead of
the SSE5 DREX byte.
The AMD FMA4 instructions are a copy of the *old* Intel FMA instructions.
Intel has since updated their spec, and AMD may follow, but for now we've
implemented what AMD's spec contains.
svn path=/trunk/yasm/; revision=2199
- comments stripped before tokenization caused strings containing ';'
to generate warnings (unterminated string) and incorrect output.
- assume directive parsing did not properly handle ';' as end of line
Also add tests for the above.
Reported by: Rugxulo <rugxulo@gmail.com>
svn path=/trunk/yasm/; revision=2197
We were crashing because we didn't generate this error until the preproc
module was getting cleaned up, which doesn't happen until after linemap
is cleaned up. Instead detect and output this error when we reach the end
of preprocessed tokens during the parsing stage.
svn path=/trunk/yasm/; revision=2185
Also match GAS behavior by using different NOP sequences for AMD and Intel.
Different "Long" NOP opcode sequences are used based on the below criteria.
Defaults in 32-bit mode:
- CPU directive not used: backwards compatible (no long NOP opcodes)
- CPU directive with Intel CPU >= 686: Intel guidelines, using long NOPs
- CPU directive with AMD CPU >= K6: AMD guidelines, using long NOPs
Defaults in 64-bit mode:
- CPU directive not used: Intel guidelines, using long NOPs
- CPU directive with Intel CPU >= 686: Intel guidelines, using long NOPs
- CPU directive with AMD CPU >= K6: AMD guidelines, using long NOPs
The above defaults may be overridden with these options to the CPU directive:
- CPU basicnop: backwards compatible (no long NOP opcodes)
- CPU intelnop: Intel guidelines, using long NOPs
- CPU amdnop: AMD guidelines, using long NOPs
Suggested by: Brian Gladman <brg@gladman.plus.com>
svn path=/trunk/yasm/; revision=2181
To stay consist with handling of other VEX instructions, also add yasm
extensions to support combining the first two operands for direct translation
from non-VEX to VEX-encoded by simply adding a "v" prefix to the opcode.
Contributed by: Mark Charney, Intel Corporation <Mark.Charney@intel.com>
Yasm extensions by: Peter Johnson
svn path=/trunk/yasm/; revision=2173
In ELF, @ is used to indicate special relocations.
Fixes#164.
Reported by: Gregory McGarry on yasm-devel@
Testcase by: Gregory McGarry
We don't allow identifiers to start with @; doing so conflicts with use of
e.g. "@function" in some directives. Need to look into what GAS does.
svn path=/trunk/yasm/; revision=2166
Use the single token of lookahead to detect the label case.
This is significantly cleaner as it removes the special-casing of labels
in the tokenizer (so there is just a single identifier rule) and removes
the INSTDIR parser state (as this was only used to prevent instruction
lookup within other locations).
Also, ID and LABEL now provide the string length to the parser. We needed
to do this for ID due to parse_check_insnprefix() needing the length, so
both were folded in for consistency.
svn path=/trunk/yasm/; revision=2164
These were incorrectly identified as invalid. The code would see the
ebx*2 term and identify ebx as the index register. After the ebx was
subtracted, the ebx remained in the index register slot, so eax*2 had
nowhere to go. The code now recognizes this case and frees the slot
when the -ebx is processed, leaving the index register selection up
to the main part of the code.
svn path=/trunk/yasm/; revision=2162
This can happen if somehow this file is retrieved without expanded keywords
(e.g. directly from the webpage, or via something like git-svn).
Reported by: Patrick Walton <pcwalton@cs.ucla.edu>
svn path=/trunk/yasm/; revision=2160
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
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
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
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
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
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
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