Commit Graph

2845 Commits

Author SHA1 Message Date
H. Peter Anvin
8ea2200415 Move HLE byte codes to \264..\267
Move the HLE byte codes to \264..\267 so as not to break up an unused
group of 8 (\240..\247).

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-02-25 10:24:24 -08:00
H. Peter Anvin
7849dd07b9 Add a "nohle" byte code to skip an instruction pattern
The a2/a3 mem_offs MOV opcodes are invalid with XRELEASE; those
instructions instead have to use a modrm form.  Therefore give a way
to annotate those instruction patters so the pattern matcher will move
on to the next pattern, rather than selecting them and then issue a
warning.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-02-25 10:19:56 -08:00
H. Peter Anvin
b9bc63c757 insns.pl: Bundle all "plain bytecodes" into a hash
Instead of a long string of ifs, put all the plain opcodes which just
turn into single bytecodes with no other effect into a hash.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-02-24 22:06:39 -08:00
H. Peter Anvin
4ecd5d79fc HLE: Implement the basic mechanism for XACQUIRE/XRELEASE
This implements the mechanism for XACQUIRE/XRELEASE.  It does not
include the necessary annotations in insns.dat.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-02-24 21:57:17 -08:00
H. Peter Anvin
442a05a897 nasm.c: Fix is_suppressed_warning()
The logic in is_suppressed_warning() was severely wrong, which would
cause a lot of legitimate warnings to be suppressed while some
warnings would be duplicated.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-02-24 21:50:53 -08:00
H. Peter Anvin
10da41e328 HLE: Split the LOCK and REP prefix slots
With HLE, the sequence REP LOCK actually makes sense, so support it.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-02-24 20:57:04 -08:00
H. Peter Anvin
44454be952 insns: create a symbolic "wait" token for the \341 byte code
Create a symbolic name "wait" for the \341 byte code, so we don't have
to open-code it.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-02-10 11:11:08 -08:00
H. Peter Anvin
b17da041cb insns: fix IMUL patterns to get rid of open-coded \100 bytecodes
There already is a standard encoding for "use this operand in multiple
slots"; no need to open-code it.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-02-10 11:08:09 -08:00
H. Peter Anvin
e2b262beae insns: correct the TSX opcodes
All except XTEST are RTM, not HLE; XBEGIN is like a JMP or CALL.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-02-09 16:24:32 -08:00
Cyrill Gorcunov
d0f773230e insns: Add AVX2 transactional synchronization extensions
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-02-09 16:20:57 -08:00
H. Peter Anvin
9d93f4b396 insns: replace open-coded \322 opcode with odf (operand default)
Create a mnemonic for the open-coded opcode \322.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-02-09 16:20:21 -08:00
H.J. Lu
04633d07b6 backend: add support for x32 ELF
Add an x32 ELF (32-bit code with the CPU in 64-bit mode) backend.
2012-02-03 12:08:59 -08:00
H. Peter Anvin
a56b70436e BR 3463230: Add VMFUNC instruction
Add VMFUNC instruction from the Intel SDM version 041.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2011-12-21 08:26:48 -08:00
Cyrill Gorcunov
4b6f98bdd6 insns: Fix up sizes for MOVSD and VMOVSS instructions
Reported-by: Jasper Neumann <jasper.neumann@scpsoftware.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-12-17 12:09:02 +04:00
Cyrill Gorcunov
b574b074a7 Don't forget to setup warning levels on preprocessor phase
http://bugzilla.nasm.us/show_bug.cgi?id=3143109

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-12-05 01:56:40 +04:00
Cyrill Gorcunov
d64b8098be Drop tab/space mess from parse_cmdline
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-12-05 01:44:43 +04:00
Cyrill Gorcunov
3b8c2974a1 Use proper bracing on setting warnings in comman line parsing
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-12-05 01:39:04 +04:00
Cyrill Gorcunov
0e754dcafe Add WARN_IDX helper and ERR_WARN_TERM named constant
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-12-05 01:01:06 +04:00
Cyrill Gorcunov
ead8772590 Simplify is_suppressed_warning helper
The former is really hard to read.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-12-04 19:24:25 +04:00
Cyrill Gorcunov
d279fbbd80 BR3392199: Revert "insns: Add MOVD as aliases to MOVQ for compatibility with AMD"
This reverts commit 70712c0df6.

Conflicts:

	insns.dat

Our instructions matcher fuzzy logic fails to handle it at moment.

Reported-by: KO Myung-Hun <komh@chollian.net>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-20 17:16:43 +04:00
Cyrill Gorcunov
8a88750cd8 preproc: Proper bracing with list_for_each
It is a potential place for a bug if list_for_each
helper is used with multiple lines of code without
a proper bracing.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-20 10:42:13 +04:00
Cyrill Gorcunov
d96a329a78 insns.dat: Fix VPCMPEQQ template
http://bugzilla.nasm.us/show_bug.cgi?id=3392197

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-15 01:21:48 +04:00
Cyrill Gorcunov
18914e6330 BR3392198: Fix compilation warning on prefixes
insn->prefixes might contain not only values from
'enum prefixes' but from 'enum reg_enum' as well so
make it generic 'int' instead.

This calms down the compiler about enum's mess and
eliminates a wrong assumption that we always have
values by particular type in this field.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-12 11:41:51 +04:00
Cyrill Gorcunov
013da29782 BR3392195: insns: Drop MMX flag from MOVD
Typo in specification.

Reported-by: Jasper Neumann <sirrida@web.de>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-12 09:47:27 +04:00
Cyrill Gorcunov
eb786412f6 insns: Fix typos for vcmpeq aliases
The patch came from herumi@nifty.com

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-11 13:04:20 +04:00
Cyrill Gorcunov
5c607760fe preproc: Drop NULL assignments for static variables
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-09 19:04:14 +04:00
Cyrill Gorcunov
9900c6b081 preproc: A few style fixups
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-09 18:58:46 +04:00
Cyrill Gorcunov
00724242cb BR3376406: Update default optimization level in man
Update default optimization level in man to reflect
the reality.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-06 00:26:36 +04:00
Cyrill Gorcunov
70712c0df6 insns: Add MOVD as aliases to MOVQ for compatibility with AMD
AMD has MOVD for both 32bit and 64bit GPRs so in a sake of
compatibility bring them into insns.dat.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-02 10:53:37 +04:00
Cyrill Gorcunov
6acada6f39 preproc: %ifenv should require environment variable name to exist
Otherwise naked %ifenv/%endif passes without a notice.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-02 09:18:34 +04:00
Cyrill Gorcunov
4c6f82f78f BR3414012: Make %if[n]def to handle tail spaces
In case if there a trailing spaces after expansion
%if[n]def might produce a false alarms on macro id
being expected.

Note it also makes the constructions like bare

	%ifdef
	%endif

invalid, while before they were passed well without
a notice.

Reported-by: KO Myung-Hun
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-02 01:08:02 +04:00
Cyrill Gorcunov
d6851d4d26 assemble: Drop redundant variable
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-09-25 18:01:45 +04:00
Jiri Malak
a2c7855577 BR3411280: Fix incorrect compiler option for OS/2 target in Open Watcom makefile
For OS2 target the -bt option should be set accordingly.

Signed-off-by: Jiri Malak <malak.jiri@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-09-20 21:37:06 +04:00
Cyrill Gorcunov
9022212ba9 insns.dat: Fixup VGATHERx instructions
As being spotted by nasm64developer the memory
operands size is incorrect. Fix it.

Reported-by: nasm64developer
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-08-31 01:34:43 +04:00
Cyrill Gorcunov
2c3f7573b8 Add AVX2 test file
nasm64developer kindly provided a testfile converted
to nasm format.

http://sourceware.org/ml/binutils/2011-06/msg00150.html

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-08-31 01:22:43 +04:00
Cyrill Gorcunov
10734c7e58 A couple of simplifications to assemble.c
- GEN_SIB and GEN_MODRM helpers added
 - a number of tabs vs space fixs
 - more use of is_class() helper

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-08-29 00:07:17 +04:00
Cyrill Gorcunov
1f4ccb9282 parser: No need to split line if it a bit longer than 80 chars
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-08-28 19:53:11 +04:00
Cyrill Gorcunov
5abbe375cf Add IS_SREG and IS_FSGS helpers
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-08-28 18:49:00 +04:00
Cyrill Gorcunov
447e20cf96 A few style fixups in parser.c
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-08-28 18:02:31 +04:00
Cyrill Gorcunov
7add67f949 elf64: Make linelist to look the same as elf32
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-08-28 17:07:26 +04:00
Cyrill Gorcunov
5a8944af59 elf32: Drop holes in linelist structure
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-08-28 17:05:17 +04:00
Cyrill Gorcunov
e07bd499f8 outobj: Reorder Segment members to eliminate holes
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-08-28 17:03:21 +04:00
Cyrill Gorcunov
a30090b7e5 outieee: Reorder ieeeSection members to eliminate holes
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-08-28 17:00:04 +04:00
Cyrill Gorcunov
cdb8cd7b22 Drop empty line and bracket
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-08-28 16:33:39 +04:00
Cyrill Gorcunov
c026df26c3 Style tuneup of nasm.h
- a number of tabs to space conversion
 - redundant spaces removed
 - structure elements alignment

No functional changes.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-08-28 15:00:26 +04:00
H. Peter Anvin
57078f061d disasm.c: ESP/RSP cannot be indicies, but XMM4/YMM4 can be
If we have XMM4/YMM4 as a VSIB, it does not mean no index; that is
only for scalar encoding.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2011-08-22 14:09:04 -07:00
H. Peter Anvin
9f2043eaad assemble.c: remove stray debugging code
My bad for checking this in at all.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2011-08-22 13:52:02 -07:00
Cyrill Gorcunov
db3f71bc67 insns, avx2: A couple of upper-case to lower-case conversion
Just to be solid in style

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-08-23 00:35:32 +04:00
Cyrill Gorcunov
b16bb628ce insns, avx2: A typo in VPERMPD
The second VPERMD should be VPERMPD actually.

Thanks to nasm64developer for gas test file provided
which allowed to reveal this issue.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-08-23 00:30:28 +04:00
Cyrill Gorcunov
c4d328c165 assemble.c: Comment out debug printing
Probably we need some kind of pr_debug or
something like that instead.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-08-23 00:12:50 +04:00