Cog/Frameworks/lazyusf/lazyusf/rsp/vu/vmudm.h

38 lines
1.7 KiB
C
Raw Normal View History

/******************************************************************************\
* Authors: Iconoclast *
* Release: 2013.11.26 *
* License: CC0 Public Domain Dedication *
* *
* To the extent possible under law, the author(s) have dedicated all copyright *
* and related and neighboring rights to this software to the public domain *
* worldwide. This software is distributed without any warranty. *
* *
* You should have received a copy of the CC0 Public Domain Dedication along *
* with this software. *
* If not, see <http://creativecommons.org/publicdomain/zero/1.0/>. *
\******************************************************************************/
#include "vu.h"
INLINE static void do_mudm(usf_state_t * state, short* VD, short* VS, short* VT)
{
register int i;
for (i = 0; i < N; i++)
VACC_L[i] = (VS[i]*(unsigned short)(VT[i]) & 0x00000000FFFF) >> 0;
for (i = 0; i < N; i++)
VACC_M[i] = (VS[i]*(unsigned short)(VT[i]) & 0x0000FFFF0000) >> 16;
for (i = 0; i < N; i++)
VACC_H[i] = -(VACC_M[i] < 0);
vector_copy(VD, VACC_M); /* no possibilities to clamp */
return;
}
static void VMUDM(usf_state_t * state, int vd, int vs, int vt, int e)
{
short ST[N];
SHUFFLE_VECTOR(ST, state->VR[vt], e);
do_mudm(state, state->VR[vd], state->VR[vs], ST);
return;
}