[PATCH v2] x86: Support ZHAOXIN GMI instructions
Jan Beulich
jbeulich@suse.com
Tue Oct 15 11:18:14 GMT 2024
On 15.10.2024 08:51, mayshao-oc wrote:
> On 10/15/24 11:02, Jiang, Haochen wrote:
>>> From: mayshao-oc <mayshao-oc@zhaoxin.com>
>>> Sent: Tuesday, October 15, 2024 9:19 AM
>>>
>> @@ -1050,6 +1051,9 @@ enum
>> PREFIX_0F7D,
>> PREFIX_0F7E,
>> PREFIX_0F7F,
>> + PREFIX_0FA6_REG_0_MOD_3,
>> + PREFIX_0FA6_REG_5_MOD_3,
>> + PREFIX_0FA7_REG_6_MOD_3,
>> PREFIX_0FAE_REG_0_MOD_3,
>> PREFIX_0FAE_REG_1_MOD_3,
>> PREFIX_0FAE_REG_2_MOD_3,
>>
>> I suppose the table entries here do not need _MOD_3 suffix since it did not use
>> mod_table[].
> I suppose use mod_table[] is not a prerequisite to define a enum
> constant, I trade readability for simplicity. I define it like this,
> because it has mod value, not since it use mod_table. And there are
> examples to use MOD in it's name, but don't use mod_table,
> PREFIX_0FAE_REG_5_MOD_3.Correct me if I am wrong.
There may be misnamed enumerators, but we shouldn't repeat prior mistakes
(and I've tried to clean up some of that earlier on). The naming here is
strictly by what earlier decode steps were taken, and in what order.
>> + /* PREFIX_0FA6_REG_5_MOD_3 */
>> + {
>> + { Bad_Opcode },
>> + { "sm3", { Skip_MODRM }, 0 },
>> + { Bad_Opcode },
>> + { Bad_Opcode },
>> + },
>> +
>> + /* PREFIX_0FA7_REG_6_MOD_3 */
>> + {
>> + { Bad_Opcode },
>> + { "sm4", { Skip_MODRM }, 0 },
>> + { Bad_Opcode },
>> + { Bad_Opcode },
>> + },
>> +
>>
>> The Bad_Opcode could be omitted if they are at the end of
>> a table.
> As above, I think its a code style issue, and there are some Bad_Opcode
> at the end of a table, like in PREFIX_0F01_REG_1_RM_4,
> PREFIX_0F01_REG_1_RM_5. And I think Bad_Opcode is a placeholder, and
> there is no detrimental effect to define some Bad_Opcode at the end of a
> table. Correct me if I am wrong.
While indeed largely a style issue, the file is too large already anyway,
so we prefer to omit from tables whatever can easily be omitted.
Jan
More information about the Binutils
mailing list