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
10411041 /* jmp $r */
10421042 g(0xE0 + ops[i].reg);
10431043 }
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− }
10511044 #endif
10521045 }
10531046 }
tests/asmtest.S+1−0
@@ -236,6 +236,7 @@ lcall *(%rax) · 235 unmodified lines
236236 #endif
237237
238238 jmp 0x1000
239+jmp *(%edi)
239240 #ifdef __i386__
240241 jmp *%eax
241242 #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
200200 ALT(DEF_ASM_OP1(call, 0xff, 2, OPC_MODRM, OPT_INDIR))
201201 ALT(DEF_ASM_OP1(call, 0xe8, 0, OPC_JMP, OPT_ADDR))
202202 ALT(DEF_ASM_OP1(jmp, 0xff, 4, OPC_MODRM, OPT_INDIR))
203−ALT(DEF_ASM_OP1(jmp, 0xff, 0, OPC_JMP | OPC_WL, OPT_REGW))
204203 ALT(DEF_ASM_OP1(jmp, 0xeb, 0, OPC_SHORTJMP | OPC_JMP, OPT_ADDR))
205204
206205 ALT(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