Thanks for all that infos
volatile didnt worked as it stored the var in the stack so using the result too early
other options didnt seems to exists in my old gcc for 68k
but I just right here successfully compile it ok by specifying the registers for each variable and using separate registers for fu2 fv2
The result is here 100% perfect:
(I am very pleased when my C is exactly like ASM
)
// register struct point3D *P1 __asm("a1");
LBB125:
// register struct point3D *P2 __asm("a2");
// register union FixPoint3D *E __asm("a3");
//
// register LONG x;
// register LONG l;
// register LONG z;
// register LONG dx;
// register LONG dl;
// register LONG dz;
// register LONG dy;
//
// register float fu __asm("fp0");
// register float fv __asm("fp1");
// register float fw __asm("fp2");
// register float fdu __asm("fp3");
// register float fdv __asm("fp4");
// register float fdw __asm("fp5");
// register float fu2 ;
// register float fv2;
[...]
L566:
// while(dy)
// {
// fu2=fu;
// fu2=fu2/fw;
fsmovex fp0,fp7
fsdivx fp2,fp7
// fv2=fv;
// fv2=fv2/fw;
fsmovex fp1,fp6
fsdivx fp2,fp6
//
// E->L.x=x;
movel d2,a3@
// x= x + dx;
addl a5@(-16),d2
// E->L.z=z;
movel d4,a3@(8)
// z= z + dz;
addl a4,d4
// E->L.l=l;
movel a5@(-12),a3@(40)
// l= l + dl;
movel a0,d5
addl d5,a5@(-12)
// E->L.fw=fw;
fmoves fp2,a3@(60)
// fw= fw + fdw;
fsaddx fp5,fp2
// E++;
addw #128,a3
//
// fu= fu + fdu;
fsaddx fp3,fp0
// E[-1].L.fu=fu2;
fmoves fp7,a3@(-76)
// fv= fv + fdv;
fsaddx fp4,fp1
// E[-1].L.fv=fv2;
fmoves fp6,a3@(-72)
//
// dy--;
subql #1,d3
// }
jne L566