Commit Graph

2519 Commits

Author SHA1 Message Date
Cyrill Gorcunov
b496c68f91 insns.dat: Add nohle for MOV in case of moffset destination
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-02-26 00:07:27 +04:00
Cyrill Gorcunov
922f5e2dac insns.dat: Add hlexr flag for MOV instruction
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-02-25 23:53:09 +04:00
Cyrill Gorcunov
ab6057926b insns.dat: Add hlenl flag for XCHG instruction
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-02-25 23:53:09 +04:00
Cyrill Gorcunov
93e170f585 insns.dat: Add hle flag for XADD instruction
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-02-25 23:53:09 +04:00
Cyrill Gorcunov
5c4d23a039 insns.dat: Add hle flag for XOR instruction
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-02-25 23:53:09 +04:00
Cyrill Gorcunov
3403477b96 insns.dat: Add hle flag for SUB instruction
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-02-25 23:53:09 +04:00
Cyrill Gorcunov
b556a03847 insns.dat: Add hle flag for SBB instruction
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-02-25 23:53:09 +04:00
Cyrill Gorcunov
0626db9eb9 insns.dat: Add hle flag for OR instruction
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-02-25 23:53:09 +04:00
Cyrill Gorcunov
7d072f0ca9 insns.dat: Add hle flag for NOT instruction
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-02-25 23:53:09 +04:00
Cyrill Gorcunov
7aec2435f6 insns.dat: Add hle flag for NEG instruction
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-02-25 23:53:08 +04:00
Cyrill Gorcunov
94a7645ec9 insns.dat: Add hle flag for INC instruction
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-02-25 23:51:45 +04:00
Cyrill Gorcunov
47fe219004 insns.dat: Add hle flag for DEC instruction
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-02-25 23:51:44 +04:00
Cyrill Gorcunov
e520db7f49 insns.dat: Add hle flag for CMPXCHG16B instruction
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-02-25 23:51:44 +04:00
Cyrill Gorcunov
aea6453c8b insns.dat: Add hle flag for CMPXCHG8B instruction
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-02-25 23:51:44 +04:00
Cyrill Gorcunov
08a291d0da insns.dat: Add hle flag for CMPXCHG instruction
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-02-25 23:51:44 +04:00
Cyrill Gorcunov
6763e28b68 insns.dat: Add hle flag for BTS instruction
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-02-25 23:51:44 +04:00
Cyrill Gorcunov
e7a9ec3676 insns.dat: Add hle flag for BTR instruction
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-02-25 23:51:44 +04:00
Cyrill Gorcunov
75150e2df4 insns.dat: Add hle flag for BTC instruction
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-02-25 23:51:44 +04:00
Cyrill Gorcunov
e844844321 insns.dat: Add hle flag for AND instruction
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-02-25 23:51:44 +04:00
Cyrill Gorcunov
e30aef38da insns.dat: Add hle flag for ADC instruction
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-02-25 23:51:44 +04:00
Cyrill Gorcunov
dec6037fa7 insns.dat: Add hle flag for ADD instruction
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-02-25 23:51:44 +04:00
H. Peter Anvin
9898c80cb1 disasm: ignore opcodes 370 and 371 2012-02-25 11:46:56 -08:00
H. Peter Anvin
755f5214b7 Remove all remaining explicit bytecodes from insns.dat
Get rid of the last vestiges of the explicit byte codes in insns.dat.
The only files that now depend on actual byte code numbers are
insns.pl, assemble.c and disasm.c.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-02-25 11:41:34 -08:00
H. Peter Anvin
8cc8a1d836 Add support for warning on invalid LOCK prefixes
Add an LOCK flag to the instruction template, and make the presence of
a LOCK prefix trigger a warning if it is not set.  Simplify the LOCK
and HLE logic by hard-coding the knowledge that operand 0 has to be
memory.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-02-25 11:11:42 -08:00
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