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;
|
modrm_index = -1;
|
||||||
modreg_index = -1;
|
modreg_index = -1;
|
||||||
if (pa->instr_type & OPC_MODRM) {
|
if (pa->instr_type & OPC_MODRM) {
|
||||||
#ifdef TCC_TARGET_X86_64
|
|
||||||
if (!nb_ops) {
|
if (!nb_ops) {
|
||||||
/* A modrm opcode without operands is a special case (e.g. mfence).
|
/* 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 */
|
It has a group and acts as if there's an register operand 0 */
|
||||||
i = 0;
|
i = 0;
|
||||||
ops[i].type = OP_REG;
|
ops[i].type = OP_REG;
|
||||||
|
#ifdef TCC_TARGET_X86_64
|
||||||
if (pa->sym == TOK_ASM_endbr64)
|
if (pa->sym == TOK_ASM_endbr64)
|
||||||
ops[i].reg = 2; // dx
|
ops[i].reg = 2; // dx
|
||||||
else if (pa->sym >= TOK_ASM_lfence && pa->sym <= TOK_ASM_sfence)
|
else if (pa->sym >= TOK_ASM_lfence && pa->sym <= TOK_ASM_sfence)
|
||||||
ops[i].reg = 0; // ax
|
ops[i].reg = 0; // ax
|
||||||
|
#else
|
||||||
|
if (pa->sym == TOK_ASM_endbr32)
|
||||||
|
ops[i].reg = 3; // bx
|
||||||
|
#endif
|
||||||
else
|
else
|
||||||
tcc_error("bad MODR/M opcode without operands");
|
tcc_error("bad MODR/M opcode without operands");
|
||||||
goto modrm_found;
|
goto modrm_found;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
/* first look for an ea operand */
|
/* first look for an ea operand */
|
||||||
for(i = 0;i < nb_ops; i++) {
|
for(i = 0;i < nb_ops; i++) {
|
||||||
if (op_type[i] & OP_EA)
|
if (op_type[i] & OP_EA)
|
||||||
|
|||||||
@@ -37,7 +37,10 @@
|
|||||||
DEF_ASM_OP0(pause, 0xf390)
|
DEF_ASM_OP0(pause, 0xf390)
|
||||||
DEF_ASM_OP0(xlat, 0xd7)
|
DEF_ASM_OP0(xlat, 0xd7)
|
||||||
|
|
||||||
/* strings */
|
/* 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(cmpsb, 0xa6, 0, OPC_BWLX))
|
||||||
ALT(DEF_ASM_OP0L(scmpb, 0xa6, 0, OPC_BWLX))
|
ALT(DEF_ASM_OP0L(scmpb, 0xa6, 0, OPC_BWLX))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user