mirror of
https://github.com/TinyCC/tinycc.git
synced 2025-11-16 12:34:45 +00:00
Add endbr32 for i386
This commit is contained in:
@@ -1002,21 +1002,24 @@ again:
|
||||
modrm_index = -1;
|
||||
modreg_index = -1;
|
||||
if (pa->instr_type & OPC_MODRM) {
|
||||
#ifdef TCC_TARGET_X86_64
|
||||
if (!nb_ops) {
|
||||
/* A modrm opcode without operands is a special case (e.g. mfence).
|
||||
It has a group and acts as if there's an register operand 0 */
|
||||
i = 0;
|
||||
ops[i].type = OP_REG;
|
||||
#ifdef TCC_TARGET_X86_64
|
||||
if (pa->sym == TOK_ASM_endbr64)
|
||||
ops[i].reg = 2; // dx
|
||||
else if (pa->sym >= TOK_ASM_lfence && pa->sym <= TOK_ASM_sfence)
|
||||
ops[i].reg = 0; // ax
|
||||
#else
|
||||
if (pa->sym == TOK_ASM_endbr32)
|
||||
ops[i].reg = 3; // bx
|
||||
#endif
|
||||
else
|
||||
tcc_error("bad MODR/M opcode without operands");
|
||||
goto modrm_found;
|
||||
}
|
||||
#endif
|
||||
/* first look for an ea operand */
|
||||
for(i = 0;i < nb_ops; i++) {
|
||||
if (op_type[i] & OP_EA)
|
||||
|
||||
@@ -37,6 +37,9 @@
|
||||
DEF_ASM_OP0(pause, 0xf390)
|
||||
DEF_ASM_OP0(xlat, 0xd7)
|
||||
|
||||
/* Control-Flow Enforcement */
|
||||
DEF_ASM_OP0L(endbr32, 0xf30f1e, 7, OPC_MODRM)
|
||||
|
||||
/* strings */
|
||||
ALT(DEF_ASM_OP0L(cmpsb, 0xa6, 0, OPC_BWLX))
|
||||
ALT(DEF_ASM_OP0L(scmpb, 0xa6, 0, OPC_BWLX))
|
||||
|
||||
Reference in New Issue
Block a user