115 int veccnt,
int stride);
145#define mat_trans_single(x, y, z) { \
146 register float __x __asm__("fr0") = (x); \
147 register float __y __asm__("fr1") = (y); \
148 register float __z __asm__("fr2") = (z); \
149 __asm__ __volatile__( \
156 : "=f" (__x), "=f" (__y), "=f" (__z) \
157 : "0" (__x), "1" (__y), "2" (__z) \
159 x = __x; y = __y; z = __z; \
175#define mat_trans_single4(x, y, z, w) { \
176 register float __x __asm__("fr0") = (x); \
177 register float __y __asm__("fr1") = (y); \
178 register float __z __asm__("fr2") = (z); \
179 register float __w __asm__("fr3") = (w); \
180 __asm__ __volatile__( \
188 : "=f" (__x), "=f" (__y), "=f" (__z), "=f" (__w) \
189 : "0" (__x), "1" (__y), "2" (__z), "3" (__w) \
191 x = __x; y = __y; z = __z; w = __w; \
206#define mat_trans_single3(x, y, z) { \
207 register float __x __asm__("fr0") = (x); \
208 register float __y __asm__("fr1") = (y); \
209 register float __z __asm__("fr2") = (z); \
210 __asm__ __volatile__( \
216 : "=f" (__x), "=f" (__y), "=f" (__z) \
217 : "0" (__x), "1" (__y), "2" (__z) \
219 x = __x; y = __y; z = __z; \
235#define mat_trans_nodiv(x, y, z, w) { \
236 register float __x __asm__("fr0") = (x); \
237 register float __y __asm__("fr1") = (y); \
238 register float __z __asm__("fr2") = (z); \
239 register float __w __asm__("fr3") = (w); \
240 __asm__ __volatile__( \
242 : "=f" (__x), "=f" (__y), "=f" (__z), "=f" (__w) \
243 : "0" (__x), "1" (__y), "2" (__z), "3" (__w) ); \
244 x = __x; y = __y; z = __z; w = __w; \
260#define mat_trans_single3_nodiv(x, y, z) { \
261 register float __x __asm__("fr12") = (x); \
262 register float __y __asm__("fr13") = (y); \
263 register float __z __asm__("fr14") = (z); \
264 __asm__ __volatile__( \
266 "ftrv xmtrx, fv12\n" \
267 : "=f" (__x), "=f" (__y), "=f" (__z) \
268 : "0" (__x), "1" (__y), "2" (__z) \
270 x = __x; y = __y; z = __z; \
289#define mat_trans_single3_nomod(x, y, z, x2, y2, z2) { \
290 register float __x __asm__("fr12") = (x); \
291 register float __y __asm__("fr13") = (y); \
292 register float __z __asm__("fr14") = (z); \
293 __asm__ __volatile__( \
295 "ftrv xmtrx, fv12\n" \
297 "fdiv fr15, fr14\n" \
298 "fmul fr14, fr12\n" \
299 "fmul fr14, fr13\n" \
300 : "=f" (__x), "=f" (__y), "=f" (__z) \
301 : "0" (__x), "1" (__y), "2" (__z) \
303 x2 = __x; y2 = __y; z2 = __z; \
322#define mat_trans_single3_nodiv_nomod(x, y, z, x2, y2, z2) { \
323 register float __x __asm__("fr12") = (x); \
324 register float __y __asm__("fr13") = (y); \
325 register float __z __asm__("fr14") = (z); \
326 __asm__ __volatile__( \
328 "ftrv xmtrx, fv12\n" \
329 : "=f" (__x), "=f" (__y), "=f" (__z) \
330 : "0" (__x), "1" (__y), "2" (__z) \
332 x2 = __x; y2 = __y; z2 = __z; \
349#define mat_trans_single3_nodivw(x, y, z, w) { \
350 register float __x __asm__("fr12") = (x); \
351 register float __y __asm__("fr13") = (y); \
352 register float __z __asm__("fr14") = (z); \
353 register float __w __asm__("fr15") = 1.0f; \
354 __asm__ __volatile__( \
355 "ftrv xmtrx, fv12\n" \
356 : "=f" (__x), "=f" (__y), "=f" (__z), "=f" (__w) \
357 : "0" (__x), "1" (__y), "2" (__z), "3" (__w) ); \
358 x = __x; y = __y; z = __z; w = __w; \
383#define mat_trans_single3_nodiv_div(x, y, z, xd, yd, zd) { \
384 register float __x __asm__("fr0") = (x); \
385 register float __y __asm__("fr1") = (y); \
386 register float __z __asm__("fr2") = (z); \
387 register float __xd __asm__("fr4"); \
388 register float __yd __asm__("fr5"); \
389 register float __zd __asm__("fr6"); \
390 __asm__ __volatile__( \
392 "ftrv xmtrx, fv0\n" \
400 : "=f" (__x), "=f" (__y), "=f" (__z), \
401 "=f" (__xd), "=f" (__yd), "=f" (__zd) \
402 : "0" (__x), "1" (__y), "2" (__z) \
404 x = __x; y = __y; z = __z; xd = __xd; yd = __yd; zd = __zd; \
419#define mat_trans_normal3(x, y, z) { \
420 register float __x __asm__("fr8") = (x); \
421 register float __y __asm__("fr9") = (y); \
422 register float __z __asm__("fr10") = (z); \
423 __asm__ __volatile__( \
425 "ftrv xmtrx, fv8\n" \
426 : "=f" (__x), "=f" (__y), "=f" (__z) \
427 : "0" (__x), "1" (__y), "2" (__z) \
429 x = __x; y = __y; z = __z; \
447#define mat_trans_normal3_nomod(x, y, z, x2, y2, z2) { \
448 register float __x __asm__("fr8") = (x); \
449 register float __y __asm__("fr9") = (y); \
450 register float __z __asm__("fr10") = (z); \
451 __asm__ __volatile__( \
453 "ftrv xmtrx, fv8\n" \
454 : "=f" (__x), "=f" (__y), "=f" (__z) \
455 : "0" (__x), "1" (__y), "2" (__z) \
457 x2 = __x; y2 = __y; z2 = __z; \
void mat_transform_sq(void *input, void *output, int veccnt)
Transform vectors by the internal matrix into the store queues.
void mat_identity(void)
Clear the internal matrix to identity.
void mat_apply(const matrix_t *src)
Apply a matrix.
void mat_multiply(matrix_t *dst, const matrix_t *src)
Multiply a matrix.
void mat_load(const matrix_t *src)
Copy a memory matrix into the internal one.
void mat_transform(const vector_t *invecs, vector_t *outvecs, int veccnt, int stride)
Transform vectors by the internal matrix.
float matrix_t[4][4]
Basic 4x4 matrix type.
Definition vector.h:37
void mat_store(matrix_t *out)
Copy the internal matrix to a memory one.
Primitive matrix, vector, and point types.
4-part vector type.
Definition vector.h:42