Search
lxdream.org :: lxdream/src/sh4/sh4core.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/sh4core.c
changeset 669:ab344e42bca9
prev641:afb9a42c61c6
next671:a530ea88eebd
author nkeynes
date Mon May 12 10:00:13 2008 +0000 (13 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.c Mon Feb 25 23:40:10 2008 +0000
1.2 +++ b/src/sh4/sh4core.c Mon May 12 10:00:13 2008 +0000
1.3 @@ -482,7 +482,7 @@
1.4 { /* STS FPUL, Rn */
1.5 uint32_t Rn = ((ir>>8)&0xF);
1.6 CHECKFPUEN();
1.7 - sh4r.r[Rn] = sh4r.fpul;
1.8 + sh4r.r[Rn] = FPULi;
1.9 }
1.10 break;
1.11 case 0x6:
1.12 @@ -916,7 +916,7 @@
1.13 uint32_t Rn = ((ir>>8)&0xF);
1.14 CHECKFPUEN();
1.15 CHECKWALIGN32( sh4r.r[Rn] );
1.16 - MEM_WRITE_LONG( sh4r.r[Rn]-4, sh4r.fpul );
1.17 + MEM_WRITE_LONG( sh4r.r[Rn]-4, FPULi );
1.18 sh4r.r[Rn] -= 4;
1.19 }
1.20 break;
1.21 @@ -1105,7 +1105,7 @@
1.22 uint32_t Rm = ((ir>>8)&0xF);
1.23 CHECKFPUEN();
1.24 CHECKRALIGN32( sh4r.r[Rm] );
1.25 - MEM_READ_LONG(sh4r.r[Rm], sh4r.fpul);
1.26 + MEM_READ_LONG(sh4r.r[Rm], FPULi);
1.27 sh4r.r[Rm] +=4;
1.28 }
1.29 break;
1.30 @@ -1114,9 +1114,9 @@
1.31 uint32_t Rm = ((ir>>8)&0xF);
1.32 CHECKFPUEN();
1.33 CHECKRALIGN32( sh4r.r[Rm] );
1.34 - MEM_READ_LONG(sh4r.r[Rm], sh4r.fpscr);
1.35 + MEM_READ_LONG(sh4r.r[Rm], tmp);
1.36 sh4r.r[Rm] +=4;
1.37 - sh4r.fr_bank = &sh4r.fr[(sh4r.fpscr&FPSCR_FR)>>21][0];
1.38 + sh4_write_fpscr( tmp );
1.39 }
1.40 break;
1.41 case 0xF:
1.42 @@ -1282,15 +1282,14 @@
1.43 { /* LDS Rm, FPUL */
1.44 uint32_t Rm = ((ir>>8)&0xF);
1.45 CHECKFPUEN();
1.46 - sh4r.fpul = sh4r.r[Rm];
1.47 + FPULi = sh4r.r[Rm];
1.48 }
1.49 break;
1.50 case 0x6:
1.51 { /* LDS Rm, FPSCR */
1.52 uint32_t Rm = ((ir>>8)&0xF);
1.53 CHECKFPUEN();
1.54 - sh4r.fpscr = sh4r.r[Rm];
1.55 - sh4r.fr_bank = &sh4r.fr[(sh4r.fpscr&FPSCR_FR)>>21][0];
1.56 + sh4_write_fpscr( sh4r.r[Rm] );
1.57 }
1.58 break;
1.59 case 0xF:
1.60 @@ -2111,20 +2110,7 @@
1.61 uint32_t FVn = ((ir>>10)&0x3);
1.62 CHECKFPUEN();
1.63 if( !IS_FPU_DOUBLEPREC() ) {
1.64 - sh4_ftrv(&(DRF(FVn<<1)), &sh4r.fr[((~sh4r.fpscr)&FPSCR_FR)>>21][0]);
1.65 - /*
1.66 - tmp = FVn<<2;
1.67 - float *xf = &sh4r.fr[((~sh4r.fpscr)&FPSCR_FR)>>21][0];
1.68 - float fv[4] = { FR(tmp), FR(tmp+1), FR(tmp+2), FR(tmp+3) };
1.69 - FR(tmp) = xf[1] * fv[0] + xf[5]*fv[1] +
1.70 - xf[9]*fv[2] + xf[13]*fv[3];
1.71 - FR(tmp+1) = xf[0] * fv[0] + xf[4]*fv[1] +
1.72 - xf[8]*fv[2] + xf[12]*fv[3];
1.73 - FR(tmp+2) = xf[3] * fv[0] + xf[7]*fv[1] +
1.74 - xf[11]*fv[2] + xf[15]*fv[3];
1.75 - FR(tmp+3) = xf[2] * fv[0] + xf[6]*fv[1] +
1.76 - xf[10]*fv[2] + xf[14]*fv[3];
1.77 - */
1.78 + sh4_ftrv(&(DRF(FVn<<1)) );
1.79 }
1.80 }
1.81 break;
1.82 @@ -2139,7 +2125,7 @@
1.83 { /* FRCHG */
1.84 CHECKFPUEN();
1.85 sh4r.fpscr ^= FPSCR_FR;
1.86 - sh4r.fr_bank = &sh4r.fr[(sh4r.fpscr&FPSCR_FR)>>21][0];
1.87 + sh4_switch_fr_banks();
1.88 }
1.89 break;
1.90 case 0x3:
.