[Rpcemu] Code review

Timmermans, Andre andre.timmermans at atos.net
Thu Feb 16 12:06:25 PST 2012


Hi,

I have been looking at te sources of version 0.8.9 to see why some of my code
doesn't work properly with the dynamic recompiler.

I have first compared arm.c and the ArmDynarecOps.c/h files. Here I have found only one  difference:

In function SWPWord() of ArmDynarecOps.h line 343 is "addr=armregs[RN]&~3;"
while the corresponding line 925 in arm.c is "addr=armregs[RN];".
I think the dynamic version is the correct one.

I have also looked at the file codegen_x86.c.

The function generateshiftflags() seems to be mishandling the C flag
(at least if the comments match te actual opcodes used).
According to te Acorn Assembler book and what I see in arm.c
the flag C is left untouched if no shift occurs
and flags NZV are always left untouched.

This means that code should look like :
/*MOVB *pcpsr,%cl*/
if (no shift)
   do nothing
else
    /*AND $ZFLAG+NFLAG,%cl*/
    do shift
    /*JNC nocarry*/
   /*OR $CFLAG,%cl*/

In the code it seems that flag C is always set to 0 if no shift occurs
and when a shift occurs it is sometimes set to 1 but never reset to 0.

Cheers,
André


Timmermans André
+32 02-5362244
andre.timmermans at atos.net<mailto:andre.timmermans at atos.net>
Chaussé de Liège 221
5100 Jambes
Belgium
[cid:428272814 at 16022012-0E1A]

Siemens IT Solutions and Services n.v./SA
RPR/RPM Brussels : 0459 540 270
Banks: BNP Paribas Fortis 210-0046976-80; KBC  482-9058191-06
As of July 1st 2011, Siemens IT Solutions and Services is an Atos business

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riscos.info/pipermail/rpcemu/attachments/20120216/0c1e9e8e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: att8fbca.gif
Type: image/gif
Size: 816 bytes
Desc: att8fbca.gif
URL: <http://www.riscos.info/pipermail/rpcemu/attachments/20120216/0c1e9e8e/attachment.gif>


More information about the Rpcemu mailing list