diff options
author | Jan Beulich <jbeulich@suse.com> | 2024-01-19 10:16:00 +0100 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2024-01-19 10:16:00 +0100 |
commit | 5190fa38286a5a6a664e21c04fde361b395d9f72 (patch) | |
tree | fef495b8114f985499a6518fa38e146287d7776b /opcodes | |
parent | 519d634396592c5698add4a327468e6e6920576e (diff) | |
download | binutils-5190fa38286a5a6a664e21c04fde361b395d9f72.zip binutils-5190fa38286a5a6a664e21c04fde361b395d9f72.tar.gz binutils-5190fa38286a5a6a664e21c04fde361b395d9f72.tar.bz2 |
x86: support APX forms of U{RD,WR}MSR
This was missed in 6177c84d5edc ("Support APX GPR32 with extend evex
prefix").
Diffstat (limited to 'opcodes')
-rw-r--r-- | opcodes/i386-dis-evex-mod.h | 11 | ||||
-rw-r--r-- | opcodes/i386-dis-evex-prefix.h | 4 | ||||
-rw-r--r-- | opcodes/i386-dis.c | 14 | ||||
-rw-r--r-- | opcodes/i386-opc.tbl | 6 | ||||
-rw-r--r-- | opcodes/i386-tbl.h | 32 |
5 files changed, 55 insertions, 12 deletions
diff --git a/opcodes/i386-dis-evex-mod.h b/opcodes/i386-dis-evex-mod.h index f9f912c..e793b24 100644 --- a/opcodes/i386-dis-evex-mod.h +++ b/opcodes/i386-dis-evex-mod.h @@ -1 +1,10 @@ -/* Nothing at present. */ + /* MOD_EVEX_MAP4_F8_P1 */ + { + { "enqcmds", { Gva, M }, 0 }, + { "uwrmsr", { Gq, Eq }, 0 }, + }, + /* MOD_EVEX_MAP4_F8_P3 */ + { + { "enqcmd", { Gva, M }, 0 }, + { "urdmsr", { Eq, Gq }, 0 }, + }, diff --git a/opcodes/i386-dis-evex-prefix.h b/opcodes/i386-dis-evex-prefix.h index 54ed48c..37e6460 100644 --- a/opcodes/i386-dis-evex-prefix.h +++ b/opcodes/i386-dis-evex-prefix.h @@ -392,9 +392,9 @@ /* PREFIX_EVEX_MAP4_F8 */ { { Bad_Opcode }, - { "enqcmds", { Gva, M }, 0 }, + { MOD_TABLE (MOD_EVEX_MAP4_F8_P_1) }, { "movdir64b", { Gva, M }, 0 }, - { "enqcmd", { Gva, M }, 0 }, + { MOD_TABLE (MOD_EVEX_MAP4_F8_P_3) }, }, /* PREFIX_EVEX_MAP5_10 */ { diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c index 7edae20..f2c7959 100644 --- a/opcodes/i386-dis.c +++ b/opcodes/i386-dis.c @@ -950,6 +950,9 @@ enum MOD_0F38F8, MOD_VEX_0F3849_X86_64_L_0_W_0, + + MOD_EVEX_MAP4_F8_P_1, + MOD_EVEX_MAP4_F8_P_3, }; enum @@ -1356,6 +1359,7 @@ enum EVEX_MAP4, EVEX_MAP5, EVEX_MAP6, + EVEX_MAP7, }; enum @@ -9090,6 +9094,9 @@ get_valid_dis386 (const struct dis386 *dp, instr_info *ins) case 0x6: vex_table_index = EVEX_MAP6; break; + case 0x7: + vex_table_index = EVEX_MAP7; + break; } /* The second byte after 0x62. */ @@ -9159,7 +9166,12 @@ get_valid_dis386 (const struct dis386 *dp, instr_info *ins) ins->codep++; vindex = *ins->codep++; - dp = &evex_table[vex_table_index][vindex]; + if (vex_table_index != EVEX_MAP7) + dp = &evex_table[vex_table_index][vindex]; + else if (vindex == 0xf8) + dp = &map7_f8_opcode; + else + dp = &bad_opcode; ins->end_codep = ins->codep; if (!fetch_modrm (ins)) return &err_opcode; diff --git a/opcodes/i386-opc.tbl b/opcodes/i386-opc.tbl index c3f6443..f2efc7c 100644 --- a/opcodes/i386-opc.tbl +++ b/opcodes/i386-opc.tbl @@ -3482,11 +3482,13 @@ eretu, 0xf30f01ca, FRED, NoSuf, {} // USER_MSR instructions. urdmsr, 0xf20f38f8, USER_MSR, RegMem|NoSuf|NoRex64, { Reg64, Reg64 } -urdmsr, 0xf2f8/0, USER_MSR, Modrm|Vex128|VexMap7|VexW0|NoSuf, { Imm32, Reg64 } +urdmsr, 0xf2f8, USER_MSR&APX_F, RegMem|EVexMap4|VexW0|NoSuf, { Reg64, Reg64 } +urdmsr, 0xf2f8/0, APX_F(USER_MSR), Modrm|Vex128|VexMap7|EVex128|VexW0|NoSuf, { Imm32, Reg64 } uwrmsr, 0xf30f38f8, USER_MSR, Modrm|NoSuf|NoRex64, { Reg64, Reg64 } +uwrmsr, 0xf3f8, USER_MSR&APX_F, Modrm||EVexMap4|VexW0|NoSuf, { Reg64, Reg64 } // Immediates want to be first; md_assemble() takes care of swapping operands // accordingly. -uwrmsr, 0xf3f8/0, USER_MSR, Modrm|Vex128|VexMap7|VexW0|NoSuf, { Imm32, Reg64 } +uwrmsr, 0xf3f8/0, APX_F(USER_MSR), Modrm|Vex128|VexMap7|EVex128|VexW0|NoSuf, { Imm32, Reg64 } // USER_MSR instructions end. diff --git a/opcodes/i386-tbl.h b/opcodes/i386-tbl.h index ac4a01c..c0aab67 100644 --- a/opcodes/i386-tbl.h +++ b/opcodes/i386-tbl.h @@ -41152,12 +41152,22 @@ static const insn_template i386_optab[] = 0, 0, 0, 0, 0, 0 } }, { { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 } } } }, + { MN_urdmsr, 0xf8, 2, SPACE_EVEXMAP4, None, + { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, + 0, 0, 0, 0, 0, 1, 3, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0 }, + { { 98, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0 } }, + { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { { { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0 } }, + { { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0 } } } }, { MN_urdmsr, 0xf8, 2, SPACE_VEXMAP7, 0, { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, + 0, 0, 0, 1, 0, 1, 3, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { { 98, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 } }, - { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { { 98, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 } }, { { { 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, { { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, @@ -41172,12 +41182,22 @@ static const insn_template i386_optab[] = 0, 0, 0, 0, 0, 0 } }, { { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 } } } }, + { MN_uwrmsr, 0xf8, 2, SPACE_EVEXMAP4, None, + { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1, 2, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0 }, + { { 98, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0 } }, + { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { { { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0 } }, + { { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0 } } } }, { MN_uwrmsr, 0xf8, 2, SPACE_VEXMAP7, 0, { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, + 0, 0, 0, 1, 0, 1, 2, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { { 98, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 } }, - { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { { 98, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 } }, { { { 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, { { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, @@ -41521,8 +41541,8 @@ static const i386_op_off_t i386_op_sets[] = 3842, 3843, 3844, 3845, 3846, 3847, 3848, 3849, 3850, 3851, 3852, 3853, 3854, 3855, 3856, 3857, 3858, 3859, 3860, 3861, 3862, 3863, 3864, 3865, - 3867, 3869, 3871, 3873, 3875, 3876, 3877, 3879, - 3881, 3882, 3883, 3884, 3885 + 3867, 3869, 3871, 3873, 3875, 3876, 3877, 3880, + 3883, 3884, 3885, 3886, 3887 }; /* i386 mnemonics table. */ |