Re: luajit porting to wp8 arm version

  • From: Coda Highland <chighland@xxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Tue, 27 May 2014 05:56:42 -0700

On Tue, May 27, 2014 at 3:37 AM, lingcong <congling@xxxxxxxxxxx> wrote:
> Hi all,
>    I'm porting luajit to wp8.  After disable jit/ffi, use system malloc, the
> x86 version has been successfully ported and our games are running good on
> the device.
>    But for arm code, we met a big problem, because wp8 only support thumb2
> Instruction set, but the opcode  is for ARM Instruction Set. If I  force to
> build the dll by arm instruction set, it'll report 'invalid  instruction'.
>    I'm not very familiar with arm instruction set. Could someone offer me a
> lj_vm.s that using thumb2 instruction set?
>    Thanks  a lot
>
>
> Regard, congling

You've taken on quite a task, and you're asking a lot. It's not to
simple to just say "please rewrite all of the assembly language code
in LuaJIT for me." Targeting Thumb-2 without ever switching back to
ARM mode is essentially a completely new architecture port, not just a
modification of the ARM port.

Context for anyone else reading this thread, on what's going on under
the hood: WP8's interrupt handler switches to Thumb mode for its own
code, and then doesn't restore the CPU when it returns, so the CPU
tries to interpret the next few bytes as Thumb code when it's actually
ARM code and of course it comes up with gibberish.

/s/ Adam

Other related posts: