1 /*---------------------------------------------------------------------------*
2   Project: Matrix Vector Library
3   File:    mtx44ext.h
4 
5   Copyright 1998-2011 Nintendo.  All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law.  They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13  *---------------------------------------------------------------------------*/
14 
15 
16 /*---------------------------------------------------------------------------*
17     Matrix-Vector Library : 4x4 matrix extension
18  *---------------------------------------------------------------------------*/
19 
20 #ifndef __MTX44EXT_H__
21 #define __MTX44EXT_H__
22 
23 
24 #include <cafe/mtx.h>
25 
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 /*---------------------------------------------------------------------------*
32     Default function binding configuration
33  *---------------------------------------------------------------------------*/
34 // [Binding Rule]
35 //
36 // "MTX_USE_ASM" -> When this flag is specified, it uses PS* (Paired-Single
37 //                 assembler code) functions for non-prefixed function calls.
38 // "MTX_USE_PS" -> When this flag is specified, it uses PS* (Paired-Single
39 //                 intrinsics code) functions for non-prefixed function calls.
40 // "MTX_USE_C " -> When this flag is specified, it uses C_* (C code) functions
41 //                 for non-prefixed function calls.
42 //
43 // The first binding specified in priority order listed will be used
44 // If nothing is specified, refers ASM* functions
45 
46 #if ( !defined(MTX_USE_ASM) && !defined(MTX_USE_PS) && !defined(MTX_USE_C))
47 #define MTX_USE_ASM
48 #endif
49 
50 /*---------------------------------------------------------------------------*
51     4x4 GENERAL MATRIX SECTION
52  *---------------------------------------------------------------------------*/
53 
54 /// @addtogroup MTX
55 /// @{
56 
57 // C version
58 
59 /// \brief Sets a 4x4 Identity Matrix.
60 ///
61 /// \param m Matrix to set
62 ///
63 /// \par Usage
64 ///  - Add "#define MTX_USE_ASM" prior to including the mtx header to use PPC Assembly based version
65 ///  - Add "#define MTX_USE_PS" prior to including the mtx header to use PPC Paired-Single instruction based version
66 ///  - Add "#define MTX_USE_C" prior to including the mtx header to use C implementation (default). This is useful for debugging.
67 ///
68 /// \donotcall \threadsafe \devonly \enddonotcall
69 ///
70 void C_MTX44Identity         ( Mtx44 m );
71 
72 /// \brief Copy a 4x4 Matrix.
73 ///
74 /// \note This is safe for src == dst.
75 ///
76 /// \param src Source matrix
77 /// \param dst Destination matrix
78 ///
79 /// \par Usage
80 ///  - Add "#define MTX_USE_ASM" prior to including the mtx header to use PPC Assembly based version
81 ///  - Add "#define MTX_USE_PS" prior to including the mtx header to use PPC Paired-Single instruction based version
82 ///  - Add "#define MTX_USE_C" prior to including the mtx header to use C implementation (default). This is useful for debugging.
83 ///
84 /// \donotcall \threadsafe \devonly \enddonotcall
85 ///
86 void C_MTX44Copy             ( MTX_CONST Mtx44 src, Mtx44 dst );
87 
88 /// \brief Concatenate two 4x4 Matrix.
89 /// The order of operations is:
90 ///
91 /// AB = A x B
92 ///
93 /// \note Safe if ab == a == b.
94 /// \note In the C version, an extra MTXCopy operation occurs if ab == a or
95 /// ab == b.
96 ///
97 /// \param a Left matrix
98 /// \param b Right matrix
99 /// \param ab Destination matrix
100 ///
101 /// \par Usage
102 ///  - Add "#define MTX_USE_ASM" prior to including the mtx header to use PPC Assembly based version
103 ///  - Add "#define MTX_USE_PS" prior to including the mtx header to use PPC Paired-Single instruction based version
104 ///  - Add "#define MTX_USE_C" prior to including the mtx header to use C implementation (default). This is useful for debugging.
105 ///
106 /// \donotcall \threadsafe \devonly \enddonotcall
107 ///
108 void C_MTX44Concat           ( MTX_CONST Mtx44 a, MTX_CONST Mtx44 b, Mtx44 ab );
109 
110 /// \brief Compute a 4x4 transpose matrix.
111 ///
112 /// \param src Source matrix
113 /// \param xPose Destination (transposed) matrix
114 ///
115 /// \note It is ok if src == xPose.
116 ///
117 /// \par Usage
118 ///  - Add "#define MTX_USE_ASM" prior to including the mtx header to use PPC Assembly based version
119 ///  - Add "#define MTX_USE_PS" prior to including the mtx header to use PPC Paired-Single instruction based version
120 ///  - Add "#define MTX_USE_C" prior to including the mtx header to use C implementation (default). This is useful for debugging.
121 ///
122 /// \donotcall \threadsafe \devonly \enddonotcall
123 ///
124 void C_MTX44Transpose        ( MTX_CONST Mtx44 src, Mtx44 xPose );
125 
126 /// \brief Computes a fast inverse of a 4x4 Matrix.
127 /// Uses the Gauss-Jordan method (with partial pivoting)
128 ///
129 /// \param src Source matrix
130 /// \param inv Destination (inverse) matrix
131 /// \return 0 if src is not invertible, 1 on success.
132 ///
133 /// \note It is ok if src == inv.
134 ///
135 /// \par Usage
136 ///  - Add "#define MTX_USE_ASM" prior to including the mtx header to use PPC Assembly based version
137 ///  - Add "#define MTX_USE_PS" prior to including the mtx header to use PPC Paired-Single instruction based version
138 ///  - Add "#define MTX_USE_C" prior to including the mtx header to use C implementation (default). This is useful for debugging.
139 ///
140 /// \donotcall \threadsafe \devonly \enddonotcall
141 ///
142 u32  C_MTX44Inverse          ( MTX_CONST Mtx44 src, Mtx44 inv );
143 
144 /// @}
145 
146 // PS intrinsics version
147 void PSMTX44Identity         ( Mtx44 m );
148 void PSMTX44Copy             ( MTX_CONST Mtx44 src, Mtx44 dst );
149 void PSMTX44Concat           ( MTX_CONST Mtx44 a, MTX_CONST Mtx44 b, Mtx44 ab );
150 void PSMTX44Transpose        ( MTX_CONST Mtx44 src, Mtx44 xPose );
151 
152 // PS assembler version
153 void ASM_MTX44Identity       ( Mtx44 m );
154 void ASM_MTX44Copy           ( MTX_CONST Mtx44 src, Mtx44 dst );
155 void ASM_MTX44Concat         ( MTX_CONST Mtx44 a, MTX_CONST Mtx44 b, Mtx44 ab );
156 void ASM_MTX44Transpose      ( MTX_CONST Mtx44 src, Mtx44 xPose );
157 
158 #define MTX44Inverse            C_MTX44Inverse
159 
160 // Bindings
161 #ifdef MTX_USE_ASM
162 #define MTX44Concat             ASM_MTX44Concat
163 #define MTX44Identity           ASM_MTX44Identity
164 #define MTX44Copy               ASM_MTX44Copy
165 #define MTX44Transpose          ASM_MTX44Transpose
166 #else
167 #ifdef MTX_USE_PS
168 #define MTX44Concat             PSMTX44Concat
169 #define MTX44Identity           PSMTX44Identity
170 #define MTX44Copy               PSMTX44Copy
171 #define MTX44Transpose          PSMTX44Transpose
172 #else // MTX_USE_C
173 #define MTX44Concat             C_MTX44Concat
174 #define MTX44Identity           C_MTX44Identity
175 #define MTX44Copy               C_MTX44Copy
176 #define MTX44Transpose          C_MTX44Transpose
177 #endif
178 #endif
179 
180 /*---------------------------------------------------------------------------*
181     MODEL MATRIX SECTION
182  *---------------------------------------------------------------------------*/
183 
184 /// @addtogroup MTX
185 /// @{
186 
187 // C version
188 
189 /// \brief Sets a translation 4x4 matrix
190 ///
191 /// \param m Matrix to be set
192 /// \param xT x component of translation
193 /// \param yT y component of translation
194 /// \param zT z component of translation
195 ///
196 /// \par Usage
197 ///  - Add "#define MTX_USE_ASM" prior to including the mtx header to use PPC Assembly based version
198 ///  - Add "#define MTX_USE_PS" prior to including the mtx header to use PPC Paired-Single instruction based version
199 ///  - Add "#define MTX_USE_C" prior to including the mtx header to use C implementation (default). This is useful for debugging.
200 ///
201 /// \donotcall \threadsafe \devonly \enddonotcall
202 ///
203 void C_MTX44Trans            ( Mtx44 m, f32 xT, f32 yT, f32 zT );
204 
205 /// \brief Apply a translation to a 4x4 matrix.
206 /// This function is equivalent to \ref MTX44Trans + \ref MTX44Concat.
207 ///
208 /// \note This is safe for the case where src == dst.
209 ///
210 /// \param src Matrix to multiply the translation by
211 /// \param dst Resulting matrix from concatenation
212 /// \param xT x component of translation
213 /// \param yT y component of translation
214 /// \param zT z component of translation
215 ///
216 /// \par Usage
217 ///  - Add "#define MTX_USE_ASM" prior to including the mtx header to use PPC Assembly based version
218 ///  - Add "#define MTX_USE_PS" prior to including the mtx header to use PPC Paired-Single instruction based version
219 ///  - Add "#define MTX_USE_C" prior to including the mtx header to use C implementation (default). This is useful for debugging.
220 ///
221 /// \donotcall \threadsafe \devonly \enddonotcall
222 ///
223 void C_MTX44TransApply       ( MTX_CONST Mtx44 src, Mtx44 dst, f32 xT, f32 yT, f32 zT );
224 
225 /// \brief Sets a scale 4x4 matrix
226 ///
227 /// \param m Matrix to be set
228 /// \param xS x component of scale
229 /// \param yS y component of scale
230 /// \param zS z component of scale
231 ///
232 /// \par Usage
233 ///  - Add "#define MTX_USE_ASM" prior to including the mtx header to use PPC Assembly based version
234 ///  - Add "#define MTX_USE_PS" prior to including the mtx header to use PPC Paired-Single instruction based version
235 ///  - Add "#define MTX_USE_C" prior to including the mtx header to use C implementation (default). This is useful for debugging.
236 ///
237 /// \donotcall \threadsafe \devonly \enddonotcall
238 ///
239 void C_MTX44Scale            ( Mtx44 m, f32 xS, f32 yS, f32 zS );
240 
241 /// \brief Apply a scale to a 4x4 matrix.
242 /// This function is equivalent to \ref MTX44Scale + \ref MTX44Concat.
243 ///
244 /// \note This is safe for the case where src == dst.
245 ///
246 /// \param src Matrix to multiply the scale by
247 /// \param dst Resulting matrix from concatenation
248 /// \param xS x component of scale
249 /// \param yS y component of scale
250 /// \param zS z component of scale
251 ///
252 /// \par Usage
253 ///  - Add "#define MTX_USE_ASM" prior to including the mtx header to use PPC Assembly based version
254 ///  - Add "#define MTX_USE_PS" prior to including the mtx header to use PPC Paired-Single instruction based version
255 ///  - Add "#define MTX_USE_C" prior to including the mtx header to use C implementation (default). This is useful for debugging.
256 ///
257 /// \donotcall \threadsafe \devonly \enddonotcall
258 ///
259 void C_MTX44ScaleApply       ( MTX_CONST Mtx44 src, Mtx44 dst, f32 xS, f32 yS, f32 zS );
260 
261 /// \brief Sets a rotation 4x4 matrix about one of the X, Y or Z axes.
262 ///
263 /// \note Counter clockwise rotation is positive.
264 ///
265 /// \param m Matrix to be set
266 /// \param axis Principal axis of rotation. Must be 'X', 'x', 'Y', 'y', 'Z', or 'z'.
267 /// \param rad Rotation angle in radians
268 ///
269 /// \par Usage
270 ///  - Add "#define MTX_USE_ASM" prior to including the mtx header to use PPC Assembly based version
271 ///  - Add "#define MTX_USE_PS" prior to including the mtx header to use PPC Paired-Single instruction based version
272 ///  - Add "#define MTX_USE_C" prior to including the mtx header to use C implementation (default). This is useful for debugging.
273 ///
274 /// \donotcall \threadsafe \devonly \enddonotcall
275 ///
276 void C_MTX44RotRad           ( Mtx44 m, char axis, f32 rad );
277 
278 /// \brief Sets a rotation 4x4 matrix about one of the X, Y, or Z axes from specified trig ratios.
279 ///
280 /// \note Counter clockwise rotation is positive.
281 ///
282 /// \param m Matrix to be set
283 /// \param axis Principal axis of rotation. Must be 'X', 'x', 'Y', 'y', 'Z', or 'z'.
284 /// \param sinA Sine of rotation angle
285 /// \param cosA Cosine of rotation angle
286 ///
287 /// \par Usage
288 ///  - Add "#define MTX_USE_ASM" prior to including the mtx header to use PPC Assembly based version
289 ///  - Add "#define MTX_USE_PS" prior to including the mtx header to use PPC Paired-Single instruction based version
290 ///  - Add "#define MTX_USE_C" prior to including the mtx header to use C implementation (default). This is useful for debugging.
291 ///
292 /// \donotcall \threadsafe \devonly \enddonotcall
293 ///
294 void C_MTX44RotTrig          ( Mtx44 m, char axis, f32 sinA, f32 cosA );
295 
296 /// \brief Sets a rotation 4x4 matrix about an arbitrary axis.
297 ///
298 /// \note Counter clockwise rotation is positive.
299 ///
300 /// \param m Matrix to be set
301 /// \param axis Pointer to a vector containing the (x, y, z) axis components
302 /// \param rad Rotation angle in radians
303 ///
304 /// \par Usage
305 ///  - Add "#define MTX_USE_ASM" prior to including the mtx header to use PPC Assembly based version
306 ///  - Add "#define MTX_USE_PS" prior to including the mtx header to use PPC Paired-Single instruction based version
307 ///  - Add "#define MTX_USE_C" prior to including the mtx header to use C implementation (default). This is useful for debugging.
308 ///
309 /// \donotcall \threadsafe \devonly \enddonotcall
310 ///
311 void C_MTX44RotAxisRad       ( Mtx44 m, const Vec *axis, f32 rad);
312 
313 /// @}
314 
315 // PS intrinsics version
316 void PSMTX44Trans            ( Mtx44 m, f32 xT, f32 yT, f32 zT );
317 void PSMTX44TransApply       ( MTX_CONST Mtx44 src, Mtx44 dst, f32 xT, f32 yT, f32 zT );
318 void PSMTX44Scale            ( Mtx44 m, f32 xS, f32 yS, f32 zS );
319 void PSMTX44ScaleApply       ( MTX_CONST Mtx44 src, Mtx44 dst, f32 xS, f32 yS, f32 zS );
320 
321 void PSMTX44RotRad           ( Mtx44 m, char axis, f32 rad );
322 void PSMTX44RotTrig          ( Mtx44 m, char axis, f32 sinA, f32 cosA );
323 void PSMTX44RotAxisRad       ( Mtx44 m, const Vec *axis, f32 rad);
324 
325 // PS assembler version
326 void ASM_MTX44Scale          ( Mtx44 m, f32 xS, f32 yS, f32 zS );
327 void ASM_MTX44ScaleApply     ( MTX_CONST Mtx44 src, Mtx44 dst, f32 xS, f32 yS, f32 zS );
328 void ASM_MTX44Trans          ( Mtx44 m, f32 xT, f32 yT, f32 zT );
329 void ASM_MTX44TransApply     ( MTX_CONST Mtx44 src, Mtx44 dst, f32 xT, f32 yT, f32 zT );
330 void ASM_MTX44RotTrig        ( Mtx44 m, char axis, f32 sinA, f32 cosA );
331 void ASM_MTX44RotRad         ( Mtx44 m, char axis, f32 rad );
332 void ASM_MTX44RotAxisRad     ( Mtx44 m, const Vec *axis, f32 rad );
333 
334 // Bindings
335 #ifdef MTX_USE_ASM
336 #define MTX44RotRad             ASM_MTX44RotRad
337 #define MTX44RotTrig            ASM_MTX44RotTrig
338 #define MTX44Trans              ASM_MTX44Trans
339 #define MTX44TransApply         ASM_MTX44TransApply
340 #define MTX44Scale              ASM_MTX44Scale
341 #define MTX44ScaleApply         ASM_MTX44ScaleApply
342 #define MTX44RotAxisRad         ASM_MTX44RotAxisRad
343 #else
344 #ifdef MTX_USE_PS
345 #define MTX44RotRad             PSMTX44RotRad
346 #define MTX44RotTrig            PSMTX44RotTrig
347 #define MTX44Trans              PSMTX44Trans
348 #define MTX44TransApply         PSMTX44TransApply
349 #define MTX44Scale              PSMTX44Scale
350 #define MTX44ScaleApply         PSMTX44ScaleApply
351 #define MTX44RotAxisRad         PSMTX44RotAxisRad
352 #else // MTX_USE_C
353 #define MTX44RotRad             C_MTX44RotRad
354 #define MTX44RotTrig            C_MTX44RotTrig
355 #define MTX44Trans              C_MTX44Trans
356 #define MTX44TransApply         C_MTX44TransApply
357 #define MTX44Scale              C_MTX44Scale
358 #define MTX44ScaleApply         C_MTX44ScaleApply
359 #define MTX44RotAxisRad         C_MTX44RotAxisRad
360 #endif
361 #endif
362 
363 /*---------------------------------------------------------------------------*
364     MATRIX-VECTOR SECTION
365  *---------------------------------------------------------------------------*/
366 
367 /// @addtogroup MTX
368 /// @{
369 
370 // C version
371 
372 /// \brief Multiplies a vector by a 4x4 matrix
373 ///
374 /// dst = m x src
375 ///
376 /// \note It is safe for src == dst.
377 ///
378 /// \param m Matrix to multiply by
379 /// \param src Source vector of multiply
380 /// \param dst Resulting vector from multiply
381 ///
382 /// \par Usage
383 ///  - Add "#define MTX_USE_ASM" prior to including the mtx header to use PPC Assembly based version
384 ///  - Add "#define MTX_USE_PS" prior to including the mtx header to use PPC Paired-Single instruction based version
385 ///  - Add "#define MTX_USE_C" prior to including the mtx header to use C implementation (default). This is useful for debugging.
386 ///
387 /// \donotcall \threadsafe \devonly \enddonotcall
388 ///
389 void C_MTX44MultVec          ( MTX_CONST Mtx44 m, const Vec *src, Vec *dst );
390 
391 /// \brief Multiplies an array of vectors by a 4x4 matrix.
392 ///
393 /// \note It is safe for srcBase == dstBase.
394 ///
395 /// \warning This function cannot check for array overflow.
396 ///
397 /// \param m Matrix to multiply by
398 /// \param srcBase Source vector array
399 /// \param dstBase Resulting vector array
400 /// \param count Number of vectors in srcBase and dstBase arrays.
401 ///
402 ///
403 /// \par Usage
404 ///  - Add "#define MTX_USE_ASM" prior to including the mtx header to use PPC Assembly based version
405 ///  - Add "#define MTX_USE_PS" prior to including the mtx header to use PPC Paired-Single instruction based version
406 ///  - Add "#define MTX_USE_C" prior to including the mtx header to use C implementation (default). This is useful for debugging.
407 ///
408 /// \donotcall \threadsafe \devonly \enddonotcall
409 ///
410 void C_MTX44MultVecArray     ( MTX_CONST Mtx44 m, const Vec *srcBase, Vec *dstBase, u32 count );
411 
412 /// \brief Multiply a vector by a 4x4 Scaling and Rotating matrix
413 /// \note It is assumed that the 4th row/column are (0, 0, 0, 1).
414 ///
415 /// This is equivalent to:
416 ///
417 /// dst = m x src
418 ///
419 /// \note It is safe for src == dst.
420 ///
421 /// \param m Matrix to multiply by
422 /// \param src Source vector for multiply
423 /// \param dst Resulting vector from multiply
424 ///
425 /// \par Usage
426 ///  - Add "#define MTX_USE_ASM" prior to including the mtx header to use PPC Assembly based version
427 ///  - Add "#define MTX_USE_PS" prior to including the mtx header to use PPC Paired-Single instruction based version
428 ///  - Add "#define MTX_USE_C" prior to including the mtx header to use C implementation (default). This is useful for debugging.
429 ///
430 /// \donotcall \threadsafe \devonly \enddonotcall
431 ///
432 void C_MTX44MultVecSR        ( MTX_CONST Mtx44 m, const Vec *src, Vec *dst );
433 
434 /// \brief Multiply an array of vector by a 4x4 Scaling and Rotating matrix
435 /// \note It is assumed that the 4th row/column are (0, 0, 0, 1).
436 ///
437 /// This is equivalent to:
438 ///
439 /// dstBase[i] = m x srcBase[i]
440 ///
441 /// \note It is safe for srcBase == dstBase.
442 ///
443 /// \warning This function cannot check for array overflow
444 ///
445 /// \param m Matrix to multiply by
446 /// \param srcBase Source vector array
447 /// \param dstBase Resulting vector array
448 /// \param count Number of vectors in srcBase and dstBase
449 ///
450 ///
451 /// \par Usage
452 ///  - Add "#define MTX_USE_ASM" prior to including the mtx header to use PPC Assembly based version
453 ///  - Add "#define MTX_USE_PS" prior to including the mtx header to use PPC Paired-Single instruction based version
454 ///  - Add "#define MTX_USE_C" prior to including the mtx header to use C implementation (default). This is useful for debugging.
455 ///
456 /// \donotcall \threadsafe \devonly \enddonotcall
457 ///
458 void C_MTX44MultVecArraySR   ( MTX_CONST Mtx44 m, const Vec *srcBase, Vec *dstBase, u32 count );
459 
460 /// @}
461 
462 // PS intrinsics version
463 void PSMTX44MultVec          ( MTX_CONST Mtx44 m, const Vec *src, Vec *dst );
464 void PSMTX44MultVecArray     ( MTX_CONST Mtx44 m, const Vec *srcBase, Vec *dstBase, u32 count );
465 void PSMTX44MultVecSR        ( MTX_CONST Mtx44 m, const Vec *src, Vec *dst );
466 void PSMTX44MultVecArraySR   ( MTX_CONST Mtx44 m, const Vec *srcBase, Vec *dstBase, u32 count );
467 
468 // PS assembler version
469 void ASM_MTX44MultVec        ( MTX_CONST Mtx44 m, const Vec *src, Vec *dst );
470 void ASM_MTX44MultVecArray   ( MTX_CONST Mtx44 m, const Vec *srcBase, Vec *dstBase,  u32 count );
471 void ASM_MTX44MultVecArraySR ( MTX_CONST Mtx44 m, const Vec *srcBase, Vec *dstBase,  u32 count );
472 void ASM_MTX44MultVecSR      ( MTX_CONST Mtx44 m, const Vec *src, Vec *dst );
473 
474 // Bindings
475 #ifdef MTX_USE_ASM
476 #define MTX44MultVec            ASM_MTX44MultVec
477 #define MTX44MultVecArray       ASM_MTX44MultVecArray
478 #define MTX44MultVecSR          ASM_MTX44MultVecSR
479 #define MTX44MultVecArraySR     ASM_MTX44MultVecArraySR
480 #else
481 #ifdef MTX_USE_PS
482 #define MTX44MultVec            PSMTX44MultVec
483 #define MTX44MultVecArray       PSMTX44MultVecArray
484 #define MTX44MultVecSR          PSMTX44MultVecSR
485 #define MTX44MultVecArraySR     PSMTX44MultVecArraySR
486 #else // MTX_USE_C
487 #define MTX44MultVec            C_MTX44MultVec
488 #define MTX44MultVecArray       C_MTX44MultVecArray
489 #define MTX44MultVecSR          C_MTX44MultVecSR
490 #define MTX44MultVecArraySR     C_MTX44MultVecArraySR
491 #endif
492 #endif
493 
494 /*---------------------------------------------------------------------------*
495     MATRIX CONVERSION
496  *---------------------------------------------------------------------------*/
497 
498 /// @addtogroup MTX
499 /// @{
500 
501 
502 /// \brief Convert a 3x4 matrix to a 4x4 matrix.
503 /// The fourth row is set to (0, 0, 0, 1).
504 ///
505 /// \param src Source 3x4 matrix
506 /// \param dst Destination 4x4 matrix
507 ///
508 /// \par Usage
509 ///  - Add "#define MTX_USE_ASM" prior to including the mtx header to use PPC Assembly based version
510 ///  - Add "#define MTX_USE_PS" prior to including the mtx header to use PPC Paired-Single instruction based version
511 ///  - Add "#define MTX_USE_C" prior to including the mtx header to use C implementation (default). This is useful for debugging.
512 ///
513 /// \donotcall \threadsafe \devonly \enddonotcall
514 ///
515 void C_MTX34To44  ( MTX_CONST Mtx src, Mtx44 dst );
516 
517 /// @}
518 
519 void PSMTX34To44  ( MTX_CONST Mtx src, Mtx44 dst );
520 void ASM_MTX34To44( MTX_CONST Mtx src, Mtx44 dst );
521 
522 // Bindings
523 #ifdef MTX_USE_ASM
524 #define MTX34To44            ASM_MTX34To44
525 #else
526 #ifdef MTX_USE_PS
527 #define MTX34To44            PSMTX34To44
528 #else // MTX_USE_C
529 #define MTX34To44            C_MTX34To44
530 #endif
531 #endif
532 
533 #ifdef __cplusplus
534 }
535 #endif
536 
537 #endif // __MTX44EXT_H__
538 
539 /*===========================================================================*/
540