summaryrefslogtreecommitdiff
path: root/insns.pl
Commit message (Collapse)AuthorAgeFilesLines
* insns.pl: make insnsd.c a bit easier to readH. Peter Anvin2010-08-191-11/+8
| | | | | | | Formatting changes (no object code difference) to insnsd.c for readability. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* ndisasm: handle VEX.LIGH. Peter Anvin2010-08-191-6/+6
| | | | | | | | A lot of instructions ignore the L bit in the VEX prefix, just like a lot of instructions ignore the W bit, so don't use them in the sub-table select. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* assemble: handle vex.ligH. Peter Anvin2010-08-161-2/+4
| | | | | | | AVX version 7 introduces the concept of .lig, meaning VEX.L is ignored. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* vex: change .wx to .wig to match the latest AVX specH. Peter Anvin2010-08-161-1/+1
| | | | | | | | Change the .wx (ignore the W field) to .wig, to match the latest version of the AVX specification. This is not a functional change, but just makes instruction patterns a little easier to write. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* insns.pl: remove redundant empty line in enum opcodeCyrill Gorcunov2009-08-081-1/+1
| | | | | Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* insns.pl: smarter handling of operand flagsH. Peter Anvin2009-07-261-12/+31
| | | | | | Handle operand flags like "xmmrm128" correctly. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* NASM: relicense under the 2-clause BSD licenseH. Peter Anvin2009-07-061-12/+0
| | | | | | | | *To the best of my knowledge*, we now have authorization from everyone who has significantly contributed to NASM in the past. As such, change the license to the 2-clause BSD license. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Add copyright verbiage to Perl scripts; update LICENSEH. Peter Anvin2009-06-281-5/+47
| | | | | | | | This adds copyright verbiage to the Perl scripts. Scripts that are known to be clean w.r.t. the 2-clause BSD license are given that license; unclear ones are given the "LGPL for now". Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* insns.pl: remove stray whitespaceH. Peter Anvin2009-06-251-1/+1
| | | | | | Clean up whitespace in insns.pl. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* insns.pl: add "nohi" code for REX_NHH. Peter Anvin2009-06-251-0/+2
| | | | | | | | | Add a "nohi" code flag for the \325 byte code, which sets the REX_NH flag. That is, REX_P not required to support high registers, high registers are not supported and spl/bpl/sil/dil enabled even in non-64-bit mode. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* insns.pl: fix indentationH. Peter Anvin2009-06-251-141/+141
| | | | | | Canonicalize indentation of some blocks. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* insns.pl: allow relaxed forms to be created without duplicationH. Peter Anvin2009-06-241-32/+77
| | | | | | | | | Allow a * to be put on an operand, indicating that it is optional and should be replaced with the immediately preceding operand if it is omitted. This allows official and relaxed forms of nondestructive instructions to be written on one line. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* insns.pl - add handling of pp VEX/XOP fieldsCyrill Gorcunov2009-05-151-3/+5
| | | | | | | | | We already have such kind of aliases for L field (via l0 and l1). Via p0,p1,p2 it's become easier to follow AMD docs while encoding VEX/XOP commands. Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Use lower case for VEX and XOP in instructions tableH. Peter Anvin2009-05-031-3/+3
| | | | | | | | Use lower case for VEX and XOP ("vex", "xop") to avoid visual confusion (and in the future potential real confusion) with upper-case hexadecimal numbers. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Infrastructure support for AMD's new XOP prefixH. Peter Anvin2009-05-031-23/+38
| | | | | | | Handle AMD's XOP prefixes; they use basically the same encoding as VEX prefixes, so treat them simply as a variant of VEX. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* insns.pl: handle the new VEX.DDS flag per AVX spec version 5H. Peter Anvin2009-02-181-1/+1
| | | | The AVX spec version 5 introduces the new VEX.DDS flag; support it.
* Add extension bytecodes to support operands 4+H. Peter Anvin2008-10-231-29/+55
| | | | | | | | | | The bytecode format assumes max 4 operands pretty strictly, but we already have one instruction with 5 operands, and it's likely to get more. Support them via extension prefixes (similar to REX prefixes). For bytecodes which use argument bytes we encode the number directly, however. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Reshuffle and move the bytecodes for segment register push/popH. Peter Anvin2008-10-081-8/+8
| | | | | | | | | Reshuffle the bytecodes for segment register push/pop to make more sense, and move them from \4 to \344, thus freeing up the single-digit bytecodes \4..\7 for future use. It doesn't really make sense to use single-digit bytecodes for this very oddball use. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Collect statistics on bytecode use in insnsb.cH. Peter Anvin2008-10-081-1/+43
| | | | | | | | | We are starting to have to worry about running short on available bytecodes, especially where we encode the operand number in the byte code. Thus, compile a table of bytecode usage and include as a comment in insnsb.c. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* New opcode for 32->64 bit sign-extended immediate with warningH. Peter Anvin2008-10-071-1/+3
| | | | | | | | | | | | Add a new opcode for 32->64 bit sign-extended immediate, with warning on the number not matching. This unfortunately calls for an audit of all the \4[0123] opcodes, if they should be replaced by \25[4567]. This only replaces one instruction (MOV reg64,imm32); other instructions need to be considered. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* New opcodes to deal with 8-bit immediate sign extended to opsizeH. Peter Anvin2008-10-061-0/+2
| | | | | | | | | New opcodes to deal with 8-bit immediates which are then sign-extended to the operand size. These allow us to warn appropriately. Not sure I'm using these in all the proper places; need audit of all uses of the \14..\17 opcodes. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Mark Perl scripts executableH. Peter Anvin2008-06-151-0/+0
| | | | | Be consistent about marking Perl scripts executable, even if we always invoke them with $(PERL) in the Makefiles.
* insnsd.c: don't generate an inaccessible tableH. Peter Anvin2008-06-051-0/+1
| | | | | | | | | | Some pseudo-instructions (RESB and EQU) seem to make it into the instruction table. This also generates an instruction table for zero-length instructions, which of course can never actually be accessed. Quiet a compiler warning by simply not emitting this useless table. Ideally we shouldn't emit the pseudo-instructions either, but that is a bigger change, and it's hardly a lot of memory involved.
* insns.pl: better error messages, handle no-operand instructions betterH. Peter Anvin2008-05-231-25/+23
| | | | | Better error messages, and allow "void" instructions to omit the operand colon.
* Add tokens vex.ww and vex.wx; vex.wx is the defaultH. Peter Anvin2008-05-221-0/+4
| | | | | | Add vex.ww (for VEX.W follows REX.W) and vex.wx (for VEX.W is a don't care); vex.wx is the default since that seems to match existing usage better.
* insns.pl: error if we have a 'v' operand and no vex.nds/nddH. Peter Anvin2008-05-211-0/+5
| | | | | Although redundant, the presence of a 'v' operand should match the existence of a nds or ndd flag on vex; this should help catch typos.
* insnsn.c: cleaner to *not* separate out conditional instructionsH. Peter Anvin2008-05-211-24/+2
| | | | | | | The disassembler code gets cleaner if we do *not* separate out the conditional instructions; instead, rely on the fact that the conditionals are always at the end and use FIRST_COND_OPCODE as a barrier.
* insns.pl: match AMD documentation for DREX syntaxH. Peter Anvin2008-05-211-12/+9
| | | | | Adjust the compiler to give a syntax for DREX instructions that matches the AMD documentation.
* Use "o64nw" instead of "o64i" for o64 without REX.WH. Peter Anvin2008-05-211-1/+1
| | | | | Use the somewhat more mnemonic "o64nw" for 64-bit operand size sans REX.W.
* insns.pl: readabilty improvements for isnsnd.cH. Peter Anvin2008-05-211-6/+6
| | | | Make insnsd.c a bit more consistent in style.
* Disassembler: select table based on VEX prefixesH. Peter Anvin2008-05-211-4/+42
| | | | | | | | | | We can use the new VEX prefixes to select into a large table of new opcode spaces. Since the table is (currently) sparse, add logic so we don't end up producing tons of empty tables for no good reason. This is also necessary since VEX is likely to reuse opcode bytes that would appear as prefixes at some point, which would cause conflicts with the regular tables.
* Fix skipping 0270 code when searching for disasm prefixesH. Peter Anvin2008-05-211-4/+6
| | | | | | The 0270 code was incorrectly entered as 270 (decimal), which meant that instructions with vex but no .nds got misfiled in the improper opcode tables.
* Handle is4 bytes without meaningful information in the bottom bitsH. Peter Anvin2008-05-201-3/+7
| | | | | | Support is4 bytes without meaningful information in the bottom bits. This is equivalent to /is4=0 for the assembler, but makes the bottom bits don't care for the disassembler.
* Officially specify - as the symbol for an implicit operandH. Peter Anvin2008-05-201-0/+1
| | | | | Use - to denote that an operand is implicit (not encoded). This *better* be a fixed operand!
* ndisasm: simple compare for conditional opcodes, no loopH. Peter Anvin2008-05-201-2/+2
| | | | | | We had a completely unnecessary loop to test for conditional opcodes. Since we always put the conditional opcodes at the end, we might as well just remember where that list starts and compare against it.
* Make the syntax for immediates match the docs betterH. Peter Anvin2008-05-201-13/+13
| | | | | Use a more manual-like syntax for immediates (we still may have to use extended syntax, but not always.)
* Avoid #including .c files; instead compile as separate unitsH. Peter Anvin2008-05-201-5/+5
| | | | | | Don't #include .c files, even if they are auto-generated; instead compile them as separate compilation units and let the linker do its job.
* insns.pl: don't require whitespace before / or \H. Peter Anvin2008-05-201-1/+1
| | | | | Use Perl's context-sensitive regular expressions to tell split that a slash or backslash begins a new operator.
* insns.pl: support operands that serve double dutyH. Peter Anvin2008-05-201-2/+13
| | | | | | | Sometimes assembly syntax wants to permit a single operand to serve multiple functions; allow this. The disassembler could really use to be smarter about those.
* insns.pl: fix regex subgroup of /is4= codesH. Peter Anvin2008-05-201-1/+1
| | | | The argument is now $1, not $2...
* insns.pl: fix splitting of bracketted operationsH. Peter Anvin2008-05-201-4/+5
|
* Opcode listing notation is /is4, consistentlyH. Peter Anvin2008-05-201-3/+3
|
* Same some space by introducing shorthand byte codes for SSE prefixesH. Peter Anvin2008-05-201-4/+6
| | | | | | | Properly done, all SSE instructions which has the 66/F2/F3 opcode multiplex need two prefixes: one to control the use of OSP and one to control the use of REP. However, it's a four-way select: np/66/F2/F3; so introduce shorthand bytecodes for that purpose.
* Allow explicit immediate syntax for imz2 as well as is4H. Peter Anvin2008-05-201-4/+5
| | | | imz2 is just an alias for is4 as far as we are concerned...
* insns.pl: escape literal special character in regexH. Peter Anvin2008-05-191-1/+1
| | | | | In Perl code, it is good practice to escape special characters intended to be literal.
* Bytecode compiler: add support for is4/imz2 operandsH. Peter Anvin2008-05-191-0/+13
|
* More work on bytecode compiler (not finished yet...)H. Peter Anvin2008-05-191-14/+138
| | | | | More work on the bytecode compiler. Not all useful bytecodes are implemented yet, however.
* insns.pl: first steps toward a "smart" bytecode compilerH. Peter Anvin2008-05-191-11/+115
| | | | | First steps toward a smart(er) bytecode compiler, using a syntax that can be more directly taken from the manuals.
* Make insnsb.c an actual compilation unitH. Peter Anvin2008-05-131-3/+5
| | | | | | | "make alldeps" doesn't really like it when included files end in *.c. Instead of renaming insnsb.c to insnsb.h, make it an actual compilation unit, since there really isn't any reason for it not to be.
* insnsb.c: use 5 digits for index, not 4H. Peter Anvin2008-05-121-1/+1
| | | | We already have indexes up to 9500, so use 5 digits instead of 4.