121 Commits

Author SHA1 Message Date
Alexis Engelke
e2480e9f85 instrs: Fix VMOVD_G2X with W1 in 32-bit mode 2023-04-24 22:21:00 +02:00
Alexis Engelke
955f139025 instrs: Add AVX512-FP16 instructions 2023-01-15 13:47:11 +01:00
Alexis Engelke
a3c8848005 instrs: Remove unused WIG specifier
If REX.W/VEX.W/EVEX.W is not used as opcode extension or as operand
size, it is ignored automatically. No need to encode this.
2023-01-15 13:47:11 +01:00
Alexis Engelke
e04aff73dc decode: Add AVX-512 support 2023-01-15 13:47:11 +01:00
Alexis Engelke
9f0ddeb44a encode: Fix [LMS]FENCE encoding 2023-01-13 14:25:55 +01:00
Alexis Engelke
cbbfd9da0e instrs: Fix minor (currently ignored) annotations 2022-12-28 12:28:22 +01:00
Alexis Engelke
771d968165 instrs: Fix wrong operand sizes caused by byte imm 2022-12-27 19:46:58 +01:00
Alexis Engelke
1aec30cd0f instrs: Various small fixes 2022-12-26 22:01:11 +01:00
Alexis Engelke
94fc7a3671 instrs: Fix CLRSSBSY operand size 2022-12-26 19:30:14 +01:00
Alexis Engelke
6a0db935f5 instrs: Remove non-existent VEX-encoded VPSRAVQ 2022-12-26 18:42:15 +01:00
Alexis Engelke
4efe60ffa8 instrs: Fix VMWRITE operand order 2022-12-26 18:42:15 +01:00
Alexis Engelke
e70118a0d7 instrs: Fix VPSRA/VPSRL/VPSLL r/m operand size 2022-12-03 15:06:54 +01:00
Alexis Engelke
003a11ff12 instrs: Fix VMASKMOVDQU encoding 2022-12-03 14:58:06 +01:00
Alexis Engelke
0da009862c instrs: Correct PMOV[SZ]X operand size
Now that we can encode half/fourth/eighth vector size, use it.
2022-11-30 09:41:12 +01:00
Alexis Engelke
4abad24610 decode: Support half vector size
This is realized by two changes: first, GP and vector operand size are
completely separated using one extra bit. If the operand size of an
instruction is derived from VEX.L (or EVEX.L'L), then the "opsize" bits
indicate how to derive a smaller vector size (half/quarter/eighth).
2022-11-30 09:32:02 +01:00
Alexis Engelke
f565f09f9d instrs: Clearly separate vector and GP opsize
Now, an instruction cannot refer to the GP operand size and the vector
operand size at the same time. This isn't necessary, all necessary
distinguishing could also be achieved manually using W0/W1/66 selectors.
2022-11-27 18:07:44 +01:00
Alexis Engelke
64f0ae245e instrs: Add AVX-IFMI (VPMADD52[LH]UQ) 2022-11-27 13:39:37 +01:00
Alexis Engelke
e411e1327b instrs: Add AVX-NE-CONVERT instructions 2022-11-27 13:39:37 +01:00
Alexis Engelke
7db75f64d0 instrs: Add VNNI-INT8 and VNNI tests 2022-11-27 13:39:37 +01:00
Alexis Engelke
fe6fe0ffc1 instrs: Add CMPCCXADD 2022-11-27 13:39:37 +01:00
Alexis Engelke
1e0a58a421 instrs: Add RAO-INT (AADD/AAND/AXOR/AOR) 2022-11-27 13:39:37 +01:00
Alexis Engelke
29a62bd1c9 instrs: Add WRMSRNS 2022-11-27 13:39:37 +01:00
Alexis Engelke
769218bbc9 instrs: Add RDMSRLIST/WRMSRLIST 2022-11-27 13:39:37 +01:00
Alexis Engelke
99bea8a81e instrs: Fix VPERMQ and VPERMPD encoding 2022-11-27 13:39:37 +01:00
Alexis Engelke
d150ccf1a5 instrs: Fix VMI encoding operands and add tests 2022-11-27 13:39:37 +01:00
Alexis Engelke
180cc059ed instrs: Fix INVEPT/INVVPID memory operand size 2022-11-25 14:34:57 +01:00
Alexis Engelke
19b9d82630 instrs: Add VAES instructions 2022-11-07 08:58:11 +01:00
Alexis Engelke
87fe6314b8 instrs: Disambiguate instr type by mnemonic 2022-02-20 15:38:12 +01:00
Alexis Engelke
e78a89b610 instrs: Annotate 67h and segment override usage
Some instructions honor an address-size override or a segment override,
even in the absence of a directly encoded memory operand.

These annotations are not yet used, but may be used in future to
optimize the size of encoded instructions.
2022-01-06 10:31:09 +01:00
Alexis Engelke
5e546f5458 instrs: Fix INTO flags 2022-01-06 10:29:02 +01:00
Alexis Engelke
71c0daf581 instrs: Change operand format
This changes the instruction description format:

- Use Intel/AMD terminology for describing operands (where applicable)
- Group instructions by ISA extension
- Indicate read/written status flags
2021-09-13 17:26:43 +02:00
Alexis Engelke
e164803037 instrs: Support FRED instructions 2021-06-13 16:01:03 +02:00
Alexis Engelke
50f052488d decode: More precise register types 2021-04-02 17:20:23 +02:00
Alexis Engelke
c99e860a5e tests: Add few more encode/decode cases 2021-04-02 11:28:13 +02:00
Alexis Engelke
0521ff7d42 decode: Fix VBLENDVP[SD] opcodes 2021-03-23 12:52:37 +01:00
Alexis Engelke
4f2366afd1 instrs: Add VIA PadLock and AMD RDPRU 2021-01-23 16:47:30 +01:00
Alexis Engelke
f7567c89bd instrs: Fix VMOVSS/VMOVSD with memory operand 2021-01-23 16:44:16 +01:00
Alexis Engelke
e8f440c713 instrs: Minor fix with mandatory prefixes 2021-01-23 16:43:52 +01:00
Alexis Engelke
d7b9c97681 instrs: Remove MPX instructions
These instructions have plenty of corner cases and some instructions
have a different usage of the memory operand. Given that MPX is already
deprecated by Intel, it seems that the better option is to decode these
(rarely occuring) instructions as NOPs.
2021-01-23 16:18:12 +01:00
Alexis Engelke
0efd44cc28 instrs: Add some missing opcodes and FPU aliases 2021-01-23 16:17:42 +01:00
Alexis Engelke
103fc536b0 instrs: Fix operands of VRCPPS/VSQRTP[SD]/VRSQRTPS 2021-01-23 14:39:48 +01:00
Alexis Engelke
ab63a3c921 instrs: Fix mandatory prefixes of CMPXCHG8B/16B 2021-01-23 14:30:45 +01:00
Alexis Engelke
85fdaa3a9b instrs: Remove incorrect NFx specifiers
The new trie implementation is more flexible and allows omitting
prefixes even with a ModRM specifier in the opcode. Use this flexibility
to simplify instruction descriptions.
2021-01-23 13:25:23 +01:00
Alexis Engelke
62018556a1 parseinstrs: Simplify operand kind parsing 2021-01-23 13:25:23 +01:00
Alexis Engelke
bd611902b0 parseinstrs: Add separate ModRM indicator to desc
Some instructions have no ModRM operand and no extended opcode but still
consume a ModRM byte.
2021-01-23 13:25:23 +01:00
Alexis Engelke
cb90c2c54d instr: Add weak NOP for PREFETCH register encoding 2021-01-10 18:54:18 +01:00
Alexis Engelke
80df5ff47c instrs: Add reserved NOP/PREFETCH as weak opcodes 2021-01-10 16:53:27 +01:00
Alexis Engelke
f1e18c208c instrs: Add AMD-only MOVTNSS/MOVNTSD 2021-01-10 16:49:53 +01:00
Alexis Engelke
9245a97248 instrs: Add several AMD-only instructions
- 3DNow! instructions have a trailing immediate byte which indicates the
  opcode. Decoding this with the existing table structure requires more
  effort (in particular, a new lookup table after decoding ModRM would
  be required). Given that AMD even removed 3DNow! over 10 years ago, it
  appears unlikely that this will ever be fully supported. Adding the
  RMI-encoded pseudo-instruction "3DNOW" just to support that opcode.
- FEMMS is a legacy 3DNow! instruction.
- EXTRQ/INSERTQ are instructions with an "unusual" encoding and
  operation mode. This is another instance of 16-bit immediates.
- SVM (AMD's variant of VMX) and SNP instructions are AMD-only.
2021-01-10 15:18:44 +01:00
Alexis Engelke
c050b34ff9 instrs: Add support for undocumented instructions
Undocumented instruction are not decoded by default.

- SALC: undocumented in any recent manual and unsupported by newer
  Intel CPUs. Including as listed by [1,2].
- Undocumented FPU instructions: see [2].

[1]: http://www.rcollins.org/secrets/opcodes/SALC.html
[2]: https://github.com/xoreaxeaxeax/sandsifter/issues/33
2021-01-10 15:04:37 +01:00