pspvfpu.c File Reference

#include <malloc.h>
#include <string.h>
#include "pspthreadman.h"
#include "pspvfpu.h"

Data Structures

struct  pspvfpu_context

Defines

#define NMAT   8
#define SV(N)
#define LV(N)

Functions

void pspvfpu_use_matrices (struct pspvfpu_context *c, vfpumatrixset_t keepset, vfpumatrixset_t tempset)
 Use a set of VFPU matrices.
pspvfpu_contextpspvfpu_initcontext (void)
 Prepare to use the VFPU.
void pspvfpu_deletecontext (struct pspvfpu_context *c)
 Delete a VFPU context.


Define Documentation

#define LV (  ) 

Value:

asm("lv.q       c"#N"00,  0 + %0\n"     \
            "lv.q       c"#N"10, 16 + %0\n"     \
            "lv.q       c"#N"20, 32 + %0\n"     \
            "lv.q       c"#N"30, 48 + %0\n"     \
            : : "m" (c->fpregs[N * 4*4])        \
            : "memory")

#define NMAT   8

#define SV (  ) 

Value:

asm("sv.q       c"#N"00,  0 + %0, wt\n" \
            "sv.q       c"#N"10, 16 + %0, wt\n" \
            "sv.q       c"#N"20, 32 + %0, wt\n" \
            "sv.q       c"#N"30, 48 + %0, wt\n" \
            : "=m" (c->fpregs[N * 4*4])         \
            : : "memory")


Function Documentation

void pspvfpu_deletecontext ( struct pspvfpu_context context  ) 

Delete a VFPU context.

This frees the resources used by the VFPU context.

Parameters:
context The VFPU context to be deleted.

struct pspvfpu_context* pspvfpu_initcontext ( void   )  [read]

Prepare to use the VFPU.

This set's the calling thread's VFPU attribute, and returns a pointer to some VFPU state storage. The initial value all all VFPU matrix registers is undefined.

Returns:
A VFPU context

void pspvfpu_use_matrices ( struct pspvfpu_context context,
vfpumatrixset_t  keepset,
vfpumatrixset_t  tempset 
)

Use a set of VFPU matrices.

This restores the parts of the VFPU state the caller wants restored (if necessary). If the caller was the previous user of the the matrix set, then this call is effectively a no-op. If a matrix has never been used by this context before, then it will initially have an undefined value.

Parameters:
context The VFPU context the caller wants to restore from. It is valid to pass NULL as a context. This means the caller wants to reserve a temporary matrix without affecting other VFPU users, but doesn't want any long-term matrices itself.
keepset The set of matrices the caller wants to use, and keep the values persistently.
tempset A set of matrices the callers wants to use temporarily, but doesn't care about the values in the long-term.


Generated on Tue Jul 24 15:21:25 2007 for PSPSDK-Rev2272 by  doxygen 1.5.2