History

x86-64 asm: Remove useless jmp opcode

Also remove the hacky mod/rm byte emission during disp/imm writing.

Michael Matz committed 10 years ago

Commit 613962e1 parent bd93dc63 files · +1 −8Browse files

Unified · Split

3 files
  1. i386-asm.c +0 −7
  2. tests/asmtest.S +1 −0
  3. x86_64-asm.h +0 −1
i386-asm.c+0−7
@@ -1041,13 +1041,6 @@ ST_FUNC void asm_opcode(TCCState *s1, int opcode) · 1040 unmodified lines
1041 /* jmp $r */1041 /* jmp $r */
1042 g(0xE0 + ops[i].reg);1042 g(0xE0 + ops[i].reg);
1043 }1043 }
1044#endif
1045#ifdef TCC_TARGET_X86_64
1046 } else if (v & (OP_REG32 | OP_REG64)) {
1047 if (pa->instr_type & (OPC_JMP | OPC_SHORTJMP)) {
1048 /* jmp $r */
1049 g(0xE0 + ops[i].reg);
1050 }
1051#endif1044#endif
1052 }1045 }
1053 }1046 }
tests/asmtest.S+1−0
@@ -236,6 +236,7 @@ lcall *(%rax) · 235 unmodified lines
236#endif236#endif
237 237
238jmp 0x1000238jmp 0x1000
239jmp *(%edi)
239#ifdef __i386__240#ifdef __i386__
240jmp *%eax241jmp *%eax
241#else242#else
x86_64-asm.h+0−1
@@ -200,7 +200,6 @@ ALT(DEF_ASM_OP2(shrdw, 0x0fad, 0, OPC_MODRM | OPC_WLQ, OPT_REGW, OPT_EA | OPT_RE · 199 unmodified lines
200ALT(DEF_ASM_OP1(call, 0xff, 2, OPC_MODRM, OPT_INDIR))200ALT(DEF_ASM_OP1(call, 0xff, 2, OPC_MODRM, OPT_INDIR))
201ALT(DEF_ASM_OP1(call, 0xe8, 0, OPC_JMP, OPT_ADDR))201ALT(DEF_ASM_OP1(call, 0xe8, 0, OPC_JMP, OPT_ADDR))
202ALT(DEF_ASM_OP1(jmp, 0xff, 4, OPC_MODRM, OPT_INDIR))202ALT(DEF_ASM_OP1(jmp, 0xff, 4, OPC_MODRM, OPT_INDIR))
203ALT(DEF_ASM_OP1(jmp, 0xff, 0, OPC_JMP | OPC_WL, OPT_REGW))
204ALT(DEF_ASM_OP1(jmp, 0xeb, 0, OPC_SHORTJMP | OPC_JMP, OPT_ADDR))203ALT(DEF_ASM_OP1(jmp, 0xeb, 0, OPC_SHORTJMP | OPC_JMP, OPT_ADDR))
205 204
206ALT(DEF_ASM_OP1(lcall, 0xff, 3, OPC_MODRM, OPT_EA))205ALT(DEF_ASM_OP1(lcall, 0xff, 3, OPC_MODRM, OPT_EA))

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t