From d8087c1e6a27182970465b434243938556888629 Mon Sep 17 00:00:00 2001 From: Nelson Elhage Date: Mon, 8 Nov 2010 22:28:06 -0500 Subject: [PATCH] Make bt_translate_and_run use regparm(3). --- bt.cpp | 2 +- bt_helper.S | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/bt.cpp b/bt.cpp index 2ecc811..45565df 100644 --- a/bt.cpp +++ b/bt.cpp @@ -44,7 +44,7 @@ extern "C" void bt_continue_chain(void); extern "C" void bt_continue_ic(void); extern "C" void bt_interrupt(void); -extern "C" void bt_translate_and_run(beta_cpu *cpu, uint32_t used, ccbuff chainptr) __attribute__((noreturn, used)); +extern "C" void bt_translate_and_run(beta_cpu *cpu, uint32_t used, ccbuff chainptr) __attribute__((noreturn, used, regparm(3))); static ccbuff bt_translate_frag(compiled_frag *cfrag, decode_frag *frag); /* diff --git a/bt_helper.S b/bt_helper.S index 847e8bf..ce04d1b 100644 --- a/bt_helper.S +++ b/bt_helper.S @@ -17,10 +17,9 @@ _(bt_interrupt): mov _(bt_stack_base), %esp movl %ebp, %eax call _(bt_process_interrupt) - subl $4, %esp - pushl $0 - pushl $0 - pushl %ebp + xorl %edx, %edx + xorl %ecx, %ecx + movl %ebp, %eax call _(bt_translate_and_run) _(bt_continue): @@ -44,14 +43,16 @@ miss: pushl $0 _(bt_continue_chain): mov %eax, 128(%ebp) - pushl $1 - pushl %ebp + popl %ecx + movl $1, %edx + movl %ebp, %eax call _(bt_translate_and_run) _(bt_continue_ic): mov %eax, 128(%ebp) - pushl $0 - pushl %ebp + popl %ecx + xorl %edx, %edx + movl %ebp, %eax call _(bt_translate_and_run) _(bt_enter):