aboutsummaryrefslogtreecommitdiff
path: root/opcodes/i386-gen.c
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2022-12-16 09:00:23 +0100
committerJan Beulich <jbeulich@suse.com>2022-12-16 09:00:23 +0100
commit689933867ad45487751a6bb411e69cd91ef24990 (patch)
treec98fc884ef010f164576b6b5c267fb1ecdb2d813 /opcodes/i386-gen.c
parentde75275fe54c5536c8238f0f3f88bb7ac2222942 (diff)
downloadgdb-689933867ad45487751a6bb411e69cd91ef24990.zip
gdb-689933867ad45487751a6bb411e69cd91ef24990.tar.gz
gdb-689933867ad45487751a6bb411e69cd91ef24990.tar.bz2
x86: change representation of extension opcode
Having a "None" field in the vast majority of entries is needlessly cluttering the overall table. Instead of this being a separate field, use a representation matching that of Intel SDM and AMD PM for the main use of the field: Append the value after a / as the separator.
Diffstat (limited to 'opcodes/i386-gen.c')
-rw-r--r--opcodes/i386-gen.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/opcodes/i386-gen.c b/opcodes/i386-gen.c
index 5f68f93..101f686 100644
--- a/opcodes/i386-gen.c
+++ b/opcodes/i386-gen.c
@@ -1299,8 +1299,10 @@ output_i386_opcode (FILE *table, const char *name, char *str,
/* Find base_opcode. */
base_opcode = next_field (str, ',', &str, last);
- /* Find extension_opcode. */
- extension_opcode = next_field (str, ',', &str, last);
+ /* Find extension_opcode, if any. */
+ extension_opcode = strchr (base_opcode, '/');
+ if (extension_opcode)
+ *extension_opcode++ = '\0';
/* Find cpu_flags. */
cpu_flags = next_field (str, ',', &str, last);
@@ -1385,7 +1387,8 @@ output_i386_opcode (FILE *table, const char *name, char *str,
filename, lineno, name, 2 * length, opcode);
fprintf (table, " { \"%s\", 0x%0*llx%s, %lu, %s,\n",
- name, 2 * (int)length, opcode, end, i, extension_opcode);
+ name, 2 * (int)length, opcode, end, i,
+ extension_opcode ? extension_opcode : "None");
process_i386_opcode_modifier (table, opcode_modifier, space, prefix,
operand_types, lineno);