summaryrefslogtreecommitdiff
path: root/insns.pl
AgeCommit message (Collapse)AuthorFilesLines
2009-08-08insns.pl: remove redundant empty line in enum opcodeCyrill Gorcunov1-1/+1
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-26insns.pl: smarter handling of operand flagsH. Peter Anvin1-12/+31
Handle operand flags like "xmmrm128" correctly. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-06NASM: relicense under the 2-clause BSD licenseH. Peter Anvin1-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>
2009-06-28Add copyright verbiage to Perl scripts; update LICENSEH. Peter Anvin1-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>
2009-06-25insns.pl: remove stray whitespaceH. Peter Anvin1-1/+1
Clean up whitespace in insns.pl. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-25insns.pl: add "nohi" code for REX_NHH. Peter Anvin1-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>
2009-06-25insns.pl: fix indentationH. Peter Anvin1-141/+141
Canonicalize indentation of some blocks. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-24insns.pl: allow relaxed forms to be created without duplicationH. Peter Anvin1-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>
2009-05-15insns.pl - add handling of pp VEX/XOP fieldsCyrill Gorcunov1-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>
2009-05-03Use lower case for VEX and XOP in instructions tableH. Peter Anvin1-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>
2009-05-03Infrastructure support for AMD's new XOP prefixH. Peter Anvin1-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>
2009-02-18insns.pl: handle the new VEX.DDS flag per AVX spec version 5H. Peter Anvin1-1/+1
The AVX spec version 5 introduces the new VEX.DDS flag; support it.
2008-10-23Add extension bytecodes to support operands 4+H. Peter Anvin1-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>
2008-10-08Reshuffle and move the bytecodes for segment register push/popH. Peter Anvin1-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>
2008-10-08Collect statistics on bytecode use in insnsb.cH. Peter Anvin1-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>
2008-10-07New opcode for 32->64 bit sign-extended immediate with warningH. Peter Anvin1-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>
2008-10-06New opcodes to deal with 8-bit immediate sign extended to opsizeH. Peter Anvin1-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>
2008-06-15Mark Perl scripts executableH. Peter Anvin1-0/+0
Be consistent about marking Perl scripts executable, even if we always invoke them with $(PERL) in the Makefiles.
2008-06-05insnsd.c: don't generate an inaccessible tableH. Peter Anvin1-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.
2008-05-23insns.pl: better error messages, handle no-operand instructions betterH. Peter Anvin1-25/+23
Better error messages, and allow "void" instructions to omit the operand colon.
2008-05-22Add tokens vex.ww and vex.wx; vex.wx is the defaultH. Peter Anvin1-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.
2008-05-21insns.pl: error if we have a 'v' operand and no vex.nds/nddH. Peter Anvin1-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.
2008-05-21insnsn.c: cleaner to *not* separate out conditional instructionsH. Peter Anvin1-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.
2008-05-21insns.pl: match AMD documentation for DREX syntaxH. Peter Anvin1-12/+9
Adjust the compiler to give a syntax for DREX instructions that matches the AMD documentation.
2008-05-21Use "o64nw" instead of "o64i" for o64 without REX.WH. Peter Anvin1-1/+1
Use the somewhat more mnemonic "o64nw" for 64-bit operand size sans REX.W.
2008-05-21insns.pl: readabilty improvements for isnsnd.cH. Peter Anvin1-6/+6
Make insnsd.c a bit more consistent in style.
2008-05-21Disassembler: select table based on VEX prefixesH. Peter Anvin1-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.
2008-05-21Fix skipping 0270 code when searching for disasm prefixesH. Peter Anvin1-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.
2008-05-20Handle is4 bytes without meaningful information in the bottom bitsH. Peter Anvin1-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.
2008-05-20Officially specify - as the symbol for an implicit operandH. Peter Anvin1-0/+1
Use - to denote that an operand is implicit (not encoded). This *better* be a fixed operand!
2008-05-20ndisasm: simple compare for conditional opcodes, no loopH. Peter Anvin1-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.
2008-05-20Make the syntax for immediates match the docs betterH. Peter Anvin1-13/+13
Use a more manual-like syntax for immediates (we still may have to use extended syntax, but not always.)
2008-05-20Avoid #including .c files; instead compile as separate unitsH. Peter Anvin1-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.
2008-05-20insns.pl: don't require whitespace before / or \H. Peter Anvin1-1/+1
Use Perl's context-sensitive regular expressions to tell split that a slash or backslash begins a new operator.
2008-05-20insns.pl: support operands that serve double dutyH. Peter Anvin1-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.
2008-05-20insns.pl: fix regex subgroup of /is4= codesH. Peter Anvin1-1/+1
The argument is now $1, not $2...
2008-05-20insns.pl: fix splitting of bracketted operationsH. Peter Anvin1-4/+5
2008-05-20Opcode listing notation is /is4, consistentlyH. Peter Anvin1-3/+3
2008-05-20Same some space by introducing shorthand byte codes for SSE prefixesH. Peter Anvin1-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.
2008-05-20Allow explicit immediate syntax for imz2 as well as is4H. Peter Anvin1-4/+5
imz2 is just an alias for is4 as far as we are concerned...
2008-05-19insns.pl: escape literal special character in regexH. Peter Anvin1-1/+1
In Perl code, it is good practice to escape special characters intended to be literal.
2008-05-19Bytecode compiler: add support for is4/imz2 operandsH. Peter Anvin1-0/+13
2008-05-19More work on bytecode compiler (not finished yet...)H. Peter Anvin1-14/+138
More work on the bytecode compiler. Not all useful bytecodes are implemented yet, however.
2008-05-19insns.pl: first steps toward a "smart" bytecode compilerH. Peter Anvin1-11/+115
First steps toward a smart(er) bytecode compiler, using a syntax that can be more directly taken from the manuals.
2008-05-13Make insnsb.c an actual compilation unitH. Peter Anvin1-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.
2008-05-12insnsb.c: use 5 digits for index, not 4H. Peter Anvin1-1/+1
We already have indexes up to 9500, so use 5 digits instead of 4.
2008-05-12Make MAX_OPERANDS a parameter in insns.pl as wellH. Peter Anvin1-1/+4
MAX_OPERANDS is present in insns.pl as well (although proper C compilers shouldn't need this kind of zero padding.) Make sure it's clear to everyone.
2008-05-12Remove special hacks to avoid zero bytecodesH. Peter Anvin1-4/+1
We can now have zero bytecodes with impunity, so remove any special hacks we had to avoid zeroes in the bytecode.
2008-05-12Generate a byte array instead of using strings for the byte codesH. Peter Anvin1-10/+93
Generate a byte array instead of using C compiler strings for the byte codes. This has a few advantages: - No need to special-case zero due to broken C compilers. - Only insns.pl only ever reads the string, so we can invent our own syntax. - Compaction. - We can give it the proper, unsigned type.
2008-05-12Factor out string decoder in insns.plH. Peter Anvin1-16/+29
Factor out the string decoder into its own subroutine. This will be useful shortly ;)