[Rpcemu] Code not working correctly on RPCEmu

Matthew Howkins rpcemu-list at howkins.me.uk
Sun Feb 26 12:04:31 PST 2012


> I have included an archive for testing.
>
> The BASIC code Filter conrains some assembler code
> which takes the file IN and produces a file OUT
> so it is better set te CSD before running it.
>
> The non-recompiling version of RPCEmu produces a file identical
> to OUR_REF (te output on my RPC). The recompling version
> does not. Since most of the time the filter seems to work fine
> in the player that uses it (the sound seems OK), I am wondering
> if the small amplitude of the signed 16-bit input samples
> combined to the 24-25 bits in size filter parameters
> puts them right on the 32-bit boundary and I am wondering
> if it is not the 64bit addition part of the SMLAL which
> is not emulated correctly (i.e. is the carry transmitted
> correctly from the addition of the lower 32-bit registers
> To the upper 32-bits?).

Thanks for the test program - this enabled me to quickly narrow down
the problem, and confirm that there were no other faults affecting
this issue.

The problem does indeed lie with SMLAL.

Can you test by changing line 1181 of codegen_x86.c from

   addbyte(0x01); addbyte(0xCA); /*ADDL %ecx,%edx*/

to

   addbyte(0x11); addbyte(0xCA); /*ADCL %ecx,%edx*/

This works for me - can you confirm it works for you?

Thanks

Matthew



More information about the Rpcemu mailing list