99 int veccnt,
int stride);
129#define mat_trans_single(x, y, z) { \
130 register float __x __asm__("fr0") = (x); \
131 register float __y __asm__("fr1") = (y); \
132 register float __z __asm__("fr2") = (z); \
133 __asm__ __volatile__( \
140 : "=f" (__x), "=f" (__y), "=f" (__z) \
141 : "0" (__x), "1" (__y), "2" (__z) \
143 x = __x; y = __y; z = __z; \
159#define mat_trans_single4(x, y, z, w) { \
160 register float __x __asm__("fr0") = (x); \
161 register float __y __asm__("fr1") = (y); \
162 register float __z __asm__("fr2") = (z); \
163 register float __w __asm__("fr3") = (w); \
164 __asm__ __volatile__( \
172 : "=f" (__x), "=f" (__y), "=f" (__z), "=f" (__w) \
173 : "0" (__x), "1" (__y), "2" (__z), "3" (__w) \
175 x = __x; y = __y; z = __z; w = __w; \
190#define mat_trans_single3(x, y, z) { \
191 register float __x __asm__("fr0") = (x); \
192 register float __y __asm__("fr1") = (y); \
193 register float __z __asm__("fr2") = (z); \
194 __asm__ __volatile__( \
200 : "=f" (__x), "=f" (__y), "=f" (__z) \
201 : "0" (__x), "1" (__y), "2" (__z) \
203 x = __x; y = __y; z = __z; \
219#define mat_trans_nodiv(x, y, z, w) { \
220 register float __x __asm__("fr0") = (x); \
221 register float __y __asm__("fr1") = (y); \
222 register float __z __asm__("fr2") = (z); \
223 register float __w __asm__("fr3") = (w); \
224 __asm__ __volatile__( \
226 : "=f" (__x), "=f" (__y), "=f" (__z), "=f" (__w) \
227 : "0" (__x), "1" (__y), "2" (__z), "3" (__w) ); \
228 x = __x; y = __y; z = __z; w = __w; \
244#define mat_trans_single3_nodiv(x, y, z) { \
245 register float __x __asm__("fr12") = (x); \
246 register float __y __asm__("fr13") = (y); \
247 register float __z __asm__("fr14") = (z); \
248 __asm__ __volatile__( \
250 "ftrv xmtrx, fv12\n" \
251 : "=f" (__x), "=f" (__y), "=f" (__z) \
252 : "0" (__x), "1" (__y), "2" (__z) \
254 x = __x; y = __y; z = __z; \
273#define mat_trans_single3_nomod(x, y, z, x2, y2, z2) { \
274 register float __x __asm__("fr12") = (x); \
275 register float __y __asm__("fr13") = (y); \
276 register float __z __asm__("fr14") = (z); \
277 __asm__ __volatile__( \
279 "ftrv xmtrx, fv12\n" \
281 "fdiv fr15, fr14\n" \
282 "fmul fr14, fr12\n" \
283 "fmul fr14, fr13\n" \
284 : "=f" (__x), "=f" (__y), "=f" (__z) \
285 : "0" (__x), "1" (__y), "2" (__z) \
287 x2 = __x; y2 = __y; z2 = __z; \
306#define mat_trans_single3_nodiv_nomod(x, y, z, x2, y2, z2) { \
307 register float __x __asm__("fr12") = (x); \
308 register float __y __asm__("fr13") = (y); \
309 register float __z __asm__("fr14") = (z); \
310 __asm__ __volatile__( \
312 "ftrv xmtrx, fv12\n" \
313 : "=f" (__x), "=f" (__y), "=f" (__z) \
314 : "0" (__x), "1" (__y), "2" (__z) \
316 x2 = __x; y2 = __y; z2 = __z; \
333#define mat_trans_single3_nodivw(x, y, z, w) { \
334 register float __x __asm__("fr12") = (x); \
335 register float __y __asm__("fr13") = (y); \
336 register float __z __asm__("fr14") = (z); \
337 register float __w __asm__("fr15") = 1.0f; \
338 __asm__ __volatile__( \
339 "ftrv xmtrx, fv12\n" \
340 : "=f" (__x), "=f" (__y), "=f" (__z), "=f" (__w) \
341 : "0" (__x), "1" (__y), "2" (__z), "3" (__w) ); \
342 x = __x; y = __y; z = __z; w = __w; \
367#define mat_trans_single3_nodiv_div(x, y, z, xd, yd, zd) { \
368 register float __x __asm__("fr0") = (x); \
369 register float __y __asm__("fr1") = (y); \
370 register float __z __asm__("fr2") = (z); \
371 register float __xd __asm__("fr4"); \
372 register float __yd __asm__("fr5"); \
373 register float __zd __asm__("fr6"); \
374 __asm__ __volatile__( \
376 "ftrv xmtrx, fv0\n" \
384 : "=f" (__x), "=f" (__y), "=f" (__z), \
385 "=f" (__xd), "=f" (__yd), "=f" (__zd) \
386 : "0" (__x), "1" (__y), "2" (__z) \
388 x = __x; y = __y; z = __z; xd = __xd; yd = __yd; zd = __zd; \
403#define mat_trans_normal3(x, y, z) { \
404 register float __x __asm__("fr8") = (x); \
405 register float __y __asm__("fr9") = (y); \
406 register float __z __asm__("fr10") = (z); \
407 __asm__ __volatile__( \
409 "ftrv xmtrx, fv8\n" \
410 : "=f" (__x), "=f" (__y), "=f" (__z) \
411 : "0" (__x), "1" (__y), "2" (__z) \
413 x = __x; y = __y; z = __z; \
431#define mat_trans_normal3_nomod(x, y, z, x2, y2, z2) { \
432 register float __x __asm__("fr8") = (x); \
433 register float __y __asm__("fr9") = (y); \
434 register float __z __asm__("fr10") = (z); \
435 __asm__ __volatile__( \
437 "ftrv xmtrx, fv8\n" \
438 : "=f" (__x), "=f" (__y), "=f" (__z) \
439 : "0" (__x), "1" (__y), "2" (__z) \
441 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_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