Search
lxdream.org :: lxdream/src/sh4/sh4core.in :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/sh4core.in
changeset 669:ab344e42bca9
prev641:afb9a42c61c6
next671:a530ea88eebd
author nkeynes
date Mon May 12 10:00:13 2008 +0000 (12 years ago)
permissions -rw-r--r--
last change Cleanup most of the -Wall warnings (getting a bit sloppy...)
Convert FP code to use fixed banks rather than indirect pointer
(3-4% faster this way now)
file annotate diff log raw
1.1 --- a/src/sh4/sh4core.in Mon Feb 25 23:40:10 2008 +0000
1.2 +++ b/src/sh4/sh4core.in Mon May 12 10:00:13 2008 +0000
1.3 @@ -853,23 +853,23 @@
1.4 :}
1.5 STS FPUL, Rn {:
1.6 CHECKFPUEN();
1.7 - sh4r.r[Rn] = sh4r.fpul;
1.8 + sh4r.r[Rn] = FPULi;
1.9 :}
1.10 STS.L FPUL, @-Rn {:
1.11 CHECKFPUEN();
1.12 CHECKWALIGN32( sh4r.r[Rn] );
1.13 - MEM_WRITE_LONG( sh4r.r[Rn]-4, sh4r.fpul );
1.14 + MEM_WRITE_LONG( sh4r.r[Rn]-4, FPULi );
1.15 sh4r.r[Rn] -= 4;
1.16 :}
1.17 LDS.L @Rm+, FPUL {:
1.18 CHECKFPUEN();
1.19 CHECKRALIGN32( sh4r.r[Rm] );
1.20 - MEM_READ_LONG(sh4r.r[Rm], sh4r.fpul);
1.21 + MEM_READ_LONG(sh4r.r[Rm], FPULi);
1.22 sh4r.r[Rm] +=4;
1.23 :}
1.24 LDS Rm, FPUL {:
1.25 CHECKFPUEN();
1.26 - sh4r.fpul = sh4r.r[Rm];
1.27 + FPULi = sh4r.r[Rm];
1.28 :}
1.29 STS FPSCR, Rn {:
1.30 CHECKFPUEN();
1.31 @@ -884,14 +884,13 @@
1.32 LDS.L @Rm+, FPSCR {:
1.33 CHECKFPUEN();
1.34 CHECKRALIGN32( sh4r.r[Rm] );
1.35 - MEM_READ_LONG(sh4r.r[Rm], sh4r.fpscr);
1.36 + MEM_READ_LONG(sh4r.r[Rm], tmp);
1.37 sh4r.r[Rm] +=4;
1.38 - sh4r.fr_bank = &sh4r.fr[(sh4r.fpscr&FPSCR_FR)>>21][0];
1.39 + sh4_write_fpscr( tmp );
1.40 :}
1.41 LDS Rm, FPSCR {:
1.42 CHECKFPUEN();
1.43 - sh4r.fpscr = sh4r.r[Rm];
1.44 - sh4r.fr_bank = &sh4r.fr[(sh4r.fpscr&FPSCR_FR)>>21][0];
1.45 + sh4_write_fpscr( sh4r.r[Rm] );
1.46 :}
1.47 STC DBR, Rn {: CHECKPRIV(); sh4r.r[Rn] = sh4r.dbr; :}
1.48 STC.L DBR, @-Rn {:
1.49 @@ -1106,7 +1105,7 @@
1.50 FRCHG {:
1.51 CHECKFPUEN();
1.52 sh4r.fpscr ^= FPSCR_FR;
1.53 - sh4r.fr_bank = &sh4r.fr[(sh4r.fpscr&FPSCR_FR)>>21][0];
1.54 + sh4_switch_fr_banks();
1.55 :}
1.56 FSCHG {: CHECKFPUEN(); sh4r.fpscr ^= FPSCR_SZ; :}
1.57 FCNVSD FPUL, FRn {:
1.58 @@ -1153,20 +1152,7 @@
1.59 FTRV XMTRX, FVn {:
1.60 CHECKFPUEN();
1.61 if( !IS_FPU_DOUBLEPREC() ) {
1.62 - sh4_ftrv(&(DRF(FVn<<1)), &sh4r.fr[((~sh4r.fpscr)&FPSCR_FR)>>21][0]);
1.63 - /*
1.64 - tmp = FVn<<2;
1.65 - float *xf = &sh4r.fr[((~sh4r.fpscr)&FPSCR_FR)>>21][0];
1.66 - float fv[4] = { FR(tmp), FR(tmp+1), FR(tmp+2), FR(tmp+3) };
1.67 - FR(tmp) = xf[1] * fv[0] + xf[5]*fv[1] +
1.68 - xf[9]*fv[2] + xf[13]*fv[3];
1.69 - FR(tmp+1) = xf[0] * fv[0] + xf[4]*fv[1] +
1.70 - xf[8]*fv[2] + xf[12]*fv[3];
1.71 - FR(tmp+2) = xf[3] * fv[0] + xf[7]*fv[1] +
1.72 - xf[11]*fv[2] + xf[15]*fv[3];
1.73 - FR(tmp+3) = xf[2] * fv[0] + xf[6]*fv[1] +
1.74 - xf[10]*fv[2] + xf[14]*fv[3];
1.75 - */
1.76 + sh4_ftrv(&(DRF(FVn<<1)) );
1.77 }
1.78 :}
1.79 UNDEF {:
.