Search
lxdream.org :: lxdream/src/sh4/sh4x86.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/sh4x86.c
changeset 401:f79327f39818
prev397:640324505325
next408:af496b734734
author nkeynes
date Thu Sep 20 08:37:19 2007 +0000 (16 years ago)
permissions -rw-r--r--
last change Move support routines to sh4.c
file annotate diff log raw
1.1 --- a/src/sh4/sh4x86.c Wed Sep 19 11:30:30 2007 +0000
1.2 +++ b/src/sh4/sh4x86.c Thu Sep 20 08:37:19 2007 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: sh4x86.c,v 1.13 2007-09-19 11:30:30 nkeynes Exp $
1.6 + * $Id: sh4x86.c,v 1.14 2007-09-20 08:37:19 nkeynes Exp $
1.7 *
1.8 * SH4 => x86 translation. This version does no real optimization, it just
1.9 * outputs straight-line x86 code - it mainly exists to provide a baseline
1.10 @@ -63,48 +63,6 @@
1.11 static uint32_t min_int = 0x80000000;
1.12 static uint32_t save_fcw; /* save value for fpu control word */
1.13 static uint32_t trunc_fcw = 0x0F7F; /* fcw value for truncation mode */
1.14 -void signsat48( void )
1.15 -{
1.16 - if( ((int64_t)sh4r.mac) < (int64_t)0xFFFF800000000000LL )
1.17 - sh4r.mac = 0xFFFF800000000000LL;
1.18 - else if( ((int64_t)sh4r.mac) > (int64_t)0x00007FFFFFFFFFFFLL )
1.19 - sh4r.mac = 0x00007FFFFFFFFFFFLL;
1.20 -}
1.21 -
1.22 -void sh4_fsca( uint32_t anglei, float *fr )
1.23 -{
1.24 - float angle = (((float)(anglei&0xFFFF))/65536.0) * 2 * M_PI;
1.25 - *fr++ = cosf(angle);
1.26 - *fr = sinf(angle);
1.27 -}
1.28 -
1.29 -void sh4_sleep()
1.30 -{
1.31 - if( MMIO_READ( CPG, STBCR ) & 0x80 ) {
1.32 - sh4r.sh4_state = SH4_STATE_STANDBY;
1.33 - } else {
1.34 - sh4r.sh4_state = SH4_STATE_SLEEP;
1.35 - }
1.36 -}
1.37 -
1.38 -/**
1.39 - * Compute the matrix tranform of fv given the matrix xf.
1.40 - * Both fv and xf are word-swapped as per the sh4r.fr banks
1.41 - */
1.42 -void sh4_ftrv( float *target, float *xf )
1.43 -{
1.44 - float fv[4] = { target[1], target[0], target[3], target[2] };
1.45 - target[1] = xf[1] * fv[0] + xf[5]*fv[1] +
1.46 - xf[9]*fv[2] + xf[13]*fv[3];
1.47 - target[0] = xf[0] * fv[0] + xf[4]*fv[1] +
1.48 - xf[8]*fv[2] + xf[12]*fv[3];
1.49 - target[3] = xf[3] * fv[0] + xf[7]*fv[1] +
1.50 - xf[11]*fv[2] + xf[15]*fv[3];
1.51 - target[2] = xf[2] * fv[0] + xf[6]*fv[1] +
1.52 - xf[10]*fv[2] + xf[14]*fv[3];
1.53 -}
1.54 -
1.55 -
1.56
1.57 void sh4_x86_init()
1.58 {
.