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.
All singleton registers need to be displayable from register flags
alone!
When using the new 0360..0363 codes, make sure we appropriate avoid
displaying the legacy use of the prefixes.
Fix buffer overflow in preproc.c due to an incorrect test. In the
code:
for (r = p, s = ourcopy; *r; r++) {
if (r >= p+MAX_KEYWORD)
return tokval->t_type = TOKEN_ID; /* Not a keyword */
*s++ = tolower(*r);
}
*s = '\0';
... the test really needs to be >= since for the pass where there are
equal:
a) a nonzero byte means we have > MAX_KEYWORD characters, and
b) s = ourcopy+MAX_KEYWORD; but if the test doesn't trigger,
we can write one more character *plus* the null byte, overflowing
ourcopy.
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.
Make our way through the AVX instructions: conversions.
This is all I have time for now... hopefully this can service as a
generous source of examples.
Accept the gas mnemonics "ud2a" and "ud2b" for the instructions we
call ud2 and ud1 respectively, and Intel call ud2 and undocumented :)
Also, 0F FF is ud0 regardless of prefixes, at least as far as we know.
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.
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.
Use compiler-generated bytecodes for the AVX instruction demos. This
should make it a lot easier for other people (HINT, HINT) to add the
instruction table.
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.
"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.
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.