Tizen 2.1 base
[platform/upstream/libbullet.git] / Extras / vectormathlibrary / include / vectormath / ppu / c / vec_aos_v.h
1 /*
2    Copyright (C) 2006, 2007 Sony Computer Entertainment Inc.
3    All rights reserved.
4
5    Redistribution and use in source and binary forms,
6    with or without modification, are permitted provided that the
7    following conditions are met:
8     * Redistributions of source code must retain the above copyright
9       notice, this list of conditions and the following disclaimer.
10     * Redistributions in binary form must reproduce the above copyright
11       notice, this list of conditions and the following disclaimer in the
12       documentation and/or other materials provided with the distribution.
13     * Neither the name of the Sony Computer Entertainment Inc nor the names
14       of its contributors may be used to endorse or promote products derived
15       from this software without specific prior written permission.
16
17    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20    ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21    LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22    CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24    INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25    CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26    ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27    POSSIBILITY OF SUCH DAMAGE.
28 */
29
30 #ifndef _VECTORMATH_VEC_AOS_V_C_H
31 #define _VECTORMATH_VEC_AOS_V_C_H
32 #ifdef __cplusplus
33 extern "C" {
34 #endif /* __cplusplus */
35
36 /*-----------------------------------------------------------------------------
37  * Constants
38  * for permutes words are labeled [x,y,z,w] [a,b,c,d]
39  */
40 #define _VECTORMATH_PERM_X 0x00010203
41 #define _VECTORMATH_PERM_Y 0x04050607
42 #define _VECTORMATH_PERM_Z 0x08090a0b
43 #define _VECTORMATH_PERM_W 0x0c0d0e0f
44 #define _VECTORMATH_PERM_A 0x10111213
45 #define _VECTORMATH_PERM_B 0x14151617
46 #define _VECTORMATH_PERM_C 0x18191a1b
47 #define _VECTORMATH_PERM_D 0x1c1d1e1f
48 #define _VECTORMATH_PERM_XYZA (vec_uchar16)(vec_uint4){ _VECTORMATH_PERM_X, _VECTORMATH_PERM_Y, _VECTORMATH_PERM_Z, _VECTORMATH_PERM_A }
49 #define _VECTORMATH_PERM_ZXYW (vec_uchar16)(vec_uint4){ _VECTORMATH_PERM_Z, _VECTORMATH_PERM_X, _VECTORMATH_PERM_Y, _VECTORMATH_PERM_W }
50 #define _VECTORMATH_PERM_YZXW (vec_uchar16)(vec_uint4){ _VECTORMATH_PERM_Y, _VECTORMATH_PERM_Z, _VECTORMATH_PERM_X, _VECTORMATH_PERM_W }
51 #define _VECTORMATH_PERM_YZAB (vec_uchar16)(vec_uint4){ _VECTORMATH_PERM_Y, _VECTORMATH_PERM_Z, _VECTORMATH_PERM_A, _VECTORMATH_PERM_B }
52 #define _VECTORMATH_PERM_ZABC (vec_uchar16)(vec_uint4){ _VECTORMATH_PERM_Z, _VECTORMATH_PERM_A, _VECTORMATH_PERM_B, _VECTORMATH_PERM_C }
53 #define _VECTORMATH_PERM_XYAW (vec_uchar16)(vec_uint4){ _VECTORMATH_PERM_X, _VECTORMATH_PERM_Y, _VECTORMATH_PERM_A, _VECTORMATH_PERM_W }
54 #define _VECTORMATH_PERM_XAZW (vec_uchar16)(vec_uint4){ _VECTORMATH_PERM_X, _VECTORMATH_PERM_A, _VECTORMATH_PERM_Z, _VECTORMATH_PERM_W }
55 #define _VECTORMATH_MASK_0xF000 (vec_uint4){ 0xffffffff, 0, 0, 0 }
56 #define _VECTORMATH_MASK_0x0F00 (vec_uint4){ 0, 0xffffffff, 0, 0 }
57 #define _VECTORMATH_MASK_0x00F0 (vec_uint4){ 0, 0, 0xffffffff, 0 }
58 #define _VECTORMATH_MASK_0x000F (vec_uint4){ 0, 0, 0, 0xffffffff }
59 #define _VECTORMATH_UNIT_1000 (vec_float4){ 1.0f, 0.0f, 0.0f, 0.0f }
60 #define _VECTORMATH_UNIT_0100 (vec_float4){ 0.0f, 1.0f, 0.0f, 0.0f }
61 #define _VECTORMATH_UNIT_0010 (vec_float4){ 0.0f, 0.0f, 1.0f, 0.0f }
62 #define _VECTORMATH_UNIT_0001 (vec_float4){ 0.0f, 0.0f, 0.0f, 1.0f }
63 #define _VECTORMATH_SLERP_TOL 0.999f
64
65 /*-----------------------------------------------------------------------------
66  * Definitions
67  */
68 #ifndef _VECTORMATH_INTERNAL_FUNCTIONS
69 #define _VECTORMATH_INTERNAL_FUNCTIONS
70
71 #endif
72
73 static inline VmathVector3 vmathV3MakeFromElems_V( float _x, float _y, float _z )
74 {
75     VmathVector3 result;
76     vmathV3MakeFromElems(&result, _x, _y, _z);
77     return result;
78 }
79
80 static inline VmathVector3 vmathV3MakeFromP3_V( VmathPoint3 pnt )
81 {
82     VmathVector3 result;
83     vmathV3MakeFromP3(&result, &pnt);
84     return result;
85 }
86
87 static inline VmathVector3 vmathV3MakeFromScalar_V( float scalar )
88 {
89     VmathVector3 result;
90     vmathV3MakeFromScalar(&result, scalar);
91     return result;
92 }
93
94 static inline VmathVector3 vmathV3MakeFrom128_V( vec_float4 vf4 )
95 {
96     VmathVector3 result;
97     vmathV3MakeFrom128(&result, vf4);
98     return result;
99 }
100
101 static inline VmathVector3 vmathV3MakeXAxis_V( )
102 {
103     VmathVector3 result;
104     vmathV3MakeXAxis(&result);
105     return result;
106 }
107
108 static inline VmathVector3 vmathV3MakeYAxis_V( )
109 {
110     VmathVector3 result;
111     vmathV3MakeYAxis(&result);
112     return result;
113 }
114
115 static inline VmathVector3 vmathV3MakeZAxis_V( )
116 {
117     VmathVector3 result;
118     vmathV3MakeZAxis(&result);
119     return result;
120 }
121
122 static inline VmathVector3 vmathV3Lerp_V( float t, VmathVector3 vec0, VmathVector3 vec1 )
123 {
124     VmathVector3 result;
125     vmathV3Lerp(&result, t, &vec0, &vec1);
126     return result;
127 }
128
129 static inline VmathVector3 vmathV3Slerp_V( float t, VmathVector3 unitVec0, VmathVector3 unitVec1 )
130 {
131     VmathVector3 result;
132     vmathV3Slerp(&result, t, &unitVec0, &unitVec1);
133     return result;
134 }
135
136 static inline vec_float4 vmathV3Get128_V( VmathVector3 vec )
137 {
138     return vmathV3Get128(&vec);
139 }
140
141 static inline void vmathV3StoreXYZ_V( VmathVector3 vec, vec_float4 *quad )
142 {
143     vmathV3StoreXYZ(&vec, quad);
144 }
145
146 static inline void vmathV3LoadXYZArray_V( VmathVector3 *vec0, VmathVector3 *vec1, VmathVector3 *vec2, VmathVector3 *vec3, const vec_float4 *threeQuads )
147 {
148     vmathV3LoadXYZArray(vec0, vec1, vec2, vec3, threeQuads);
149 }
150
151 static inline void vmathV3StoreXYZArray_V( VmathVector3 vec0, VmathVector3 vec1, VmathVector3 vec2, VmathVector3 vec3, vec_float4 *threeQuads )
152 {
153     vmathV3StoreXYZArray(&vec0, &vec1, &vec2, &vec3, threeQuads);
154 }
155
156 static inline void vmathV3StoreHalfFloats_V( VmathVector3 vec0, VmathVector3 vec1, VmathVector3 vec2, VmathVector3 vec3, VmathVector3 vec4, VmathVector3 vec5, VmathVector3 vec6, VmathVector3 vec7, vec_ushort8 *threeQuads )
157 {
158     vmathV3StoreHalfFloats(&vec0, &vec1, &vec2, &vec3, &vec4, &vec5, &vec6, &vec7, threeQuads);
159 }
160
161 static inline void vmathV3SetX_V( VmathVector3 *result, float _x )
162 {
163     vmathV3SetX(result, _x);
164 }
165
166 static inline float vmathV3GetX_V( VmathVector3 vec )
167 {
168     return vmathV3GetX(&vec);
169 }
170
171 static inline void vmathV3SetY_V( VmathVector3 *result, float _y )
172 {
173     vmathV3SetY(result, _y);
174 }
175
176 static inline float vmathV3GetY_V( VmathVector3 vec )
177 {
178     return vmathV3GetY(&vec);
179 }
180
181 static inline void vmathV3SetZ_V( VmathVector3 *result, float _z )
182 {
183     vmathV3SetZ(result, _z);
184 }
185
186 static inline float vmathV3GetZ_V( VmathVector3 vec )
187 {
188     return vmathV3GetZ(&vec);
189 }
190
191 static inline void vmathV3SetElem_V( VmathVector3 *result, int idx, float value )
192 {
193     vmathV3SetElem(result, idx, value);
194 }
195
196 static inline float vmathV3GetElem_V( VmathVector3 vec, int idx )
197 {
198     return vmathV3GetElem(&vec, idx);
199 }
200
201 static inline VmathVector3 vmathV3Add_V( VmathVector3 vec0, VmathVector3 vec1 )
202 {
203     VmathVector3 result;
204     vmathV3Add(&result, &vec0, &vec1);
205     return result;
206 }
207
208 static inline VmathVector3 vmathV3Sub_V( VmathVector3 vec0, VmathVector3 vec1 )
209 {
210     VmathVector3 result;
211     vmathV3Sub(&result, &vec0, &vec1);
212     return result;
213 }
214
215 static inline VmathPoint3 vmathV3AddP3_V( VmathVector3 vec, VmathPoint3 pnt1 )
216 {
217     VmathPoint3 result;
218     vmathV3AddP3(&result, &vec, &pnt1);
219     return result;
220 }
221
222 static inline VmathVector3 vmathV3ScalarMul_V( VmathVector3 vec, float scalar )
223 {
224     VmathVector3 result;
225     vmathV3ScalarMul(&result, &vec, scalar);
226     return result;
227 }
228
229 static inline VmathVector3 vmathV3ScalarDiv_V( VmathVector3 vec, float scalar )
230 {
231     VmathVector3 result;
232     vmathV3ScalarDiv(&result, &vec, scalar);
233     return result;
234 }
235
236 static inline VmathVector3 vmathV3Neg_V( VmathVector3 vec )
237 {
238     VmathVector3 result;
239     vmathV3Neg(&result, &vec);
240     return result;
241 }
242
243 static inline VmathVector3 vmathV3MulPerElem_V( VmathVector3 vec0, VmathVector3 vec1 )
244 {
245     VmathVector3 result;
246     vmathV3MulPerElem(&result, &vec0, &vec1);
247     return result;
248 }
249
250 static inline VmathVector3 vmathV3DivPerElem_V( VmathVector3 vec0, VmathVector3 vec1 )
251 {
252     VmathVector3 result;
253     vmathV3DivPerElem(&result, &vec0, &vec1);
254     return result;
255 }
256
257 static inline VmathVector3 vmathV3RecipPerElem_V( VmathVector3 vec )
258 {
259     VmathVector3 result;
260     vmathV3RecipPerElem(&result, &vec);
261     return result;
262 }
263
264 static inline VmathVector3 vmathV3SqrtPerElem_V( VmathVector3 vec )
265 {
266     VmathVector3 result;
267     vmathV3SqrtPerElem(&result, &vec);
268     return result;
269 }
270
271 static inline VmathVector3 vmathV3RsqrtPerElem_V( VmathVector3 vec )
272 {
273     VmathVector3 result;
274     vmathV3RsqrtPerElem(&result, &vec);
275     return result;
276 }
277
278 static inline VmathVector3 vmathV3AbsPerElem_V( VmathVector3 vec )
279 {
280     VmathVector3 result;
281     vmathV3AbsPerElem(&result, &vec);
282     return result;
283 }
284
285 static inline VmathVector3 vmathV3CopySignPerElem_V( VmathVector3 vec0, VmathVector3 vec1 )
286 {
287     VmathVector3 result;
288     vmathV3CopySignPerElem(&result, &vec0, &vec1);
289     return result;
290 }
291
292 static inline VmathVector3 vmathV3MaxPerElem_V( VmathVector3 vec0, VmathVector3 vec1 )
293 {
294     VmathVector3 result;
295     vmathV3MaxPerElem(&result, &vec0, &vec1);
296     return result;
297 }
298
299 static inline float vmathV3MaxElem_V( VmathVector3 vec )
300 {
301     return vmathV3MaxElem(&vec);
302 }
303
304 static inline VmathVector3 vmathV3MinPerElem_V( VmathVector3 vec0, VmathVector3 vec1 )
305 {
306     VmathVector3 result;
307     vmathV3MinPerElem(&result, &vec0, &vec1);
308     return result;
309 }
310
311 static inline float vmathV3MinElem_V( VmathVector3 vec )
312 {
313     return vmathV3MinElem(&vec);
314 }
315
316 static inline float vmathV3Sum_V( VmathVector3 vec )
317 {
318     return vmathV3Sum(&vec);
319 }
320
321 static inline float vmathV3Dot_V( VmathVector3 vec0, VmathVector3 vec1 )
322 {
323     return vmathV3Dot(&vec0, &vec1);
324 }
325
326 static inline float vmathV3LengthSqr_V( VmathVector3 vec )
327 {
328     return vmathV3LengthSqr(&vec);
329 }
330
331 static inline float vmathV3Length_V( VmathVector3 vec )
332 {
333     return vmathV3Length(&vec);
334 }
335
336 static inline VmathVector3 vmathV3Normalize_V( VmathVector3 vec )
337 {
338     VmathVector3 result;
339     vmathV3Normalize(&result, &vec);
340     return result;
341 }
342
343 static inline VmathVector3 vmathV3Cross_V( VmathVector3 vec0, VmathVector3 vec1 )
344 {
345     VmathVector3 result;
346     vmathV3Cross(&result, &vec0, &vec1);
347     return result;
348 }
349
350 static inline VmathVector3 vmathV3Select_V( VmathVector3 vec0, VmathVector3 vec1, unsigned int select1 )
351 {
352     VmathVector3 result;
353     vmathV3Select(&result, &vec0, &vec1, select1);
354     return result;
355 }
356
357 #ifdef _VECTORMATH_DEBUG
358
359 static inline void vmathV3Print_V( VmathVector3 vec )
360 {
361     vmathV3Print(&vec);
362 }
363
364 static inline void vmathV3Prints_V( VmathVector3 vec, const char *name )
365 {
366     vmathV3Prints(&vec, name);
367 }
368
369 #endif
370
371 static inline VmathVector4 vmathV4MakeFromElems_V( float _x, float _y, float _z, float _w )
372 {
373     VmathVector4 result;
374     vmathV4MakeFromElems(&result, _x, _y, _z, _w);
375     return result;
376 }
377
378 static inline VmathVector4 vmathV4MakeFromV3Scalar_V( VmathVector3 xyz, float _w )
379 {
380     VmathVector4 result;
381     vmathV4MakeFromV3Scalar(&result, &xyz, _w);
382     return result;
383 }
384
385 static inline VmathVector4 vmathV4MakeFromV3_V( VmathVector3 vec )
386 {
387     VmathVector4 result;
388     vmathV4MakeFromV3(&result, &vec);
389     return result;
390 }
391
392 static inline VmathVector4 vmathV4MakeFromP3_V( VmathPoint3 pnt )
393 {
394     VmathVector4 result;
395     vmathV4MakeFromP3(&result, &pnt);
396     return result;
397 }
398
399 static inline VmathVector4 vmathV4MakeFromQ_V( VmathQuat quat )
400 {
401     VmathVector4 result;
402     vmathV4MakeFromQ(&result, &quat);
403     return result;
404 }
405
406 static inline VmathVector4 vmathV4MakeFromScalar_V( float scalar )
407 {
408     VmathVector4 result;
409     vmathV4MakeFromScalar(&result, scalar);
410     return result;
411 }
412
413 static inline VmathVector4 vmathV4MakeFrom128_V( vec_float4 vf4 )
414 {
415     VmathVector4 result;
416     vmathV4MakeFrom128(&result, vf4);
417     return result;
418 }
419
420 static inline VmathVector4 vmathV4MakeXAxis_V( )
421 {
422     VmathVector4 result;
423     vmathV4MakeXAxis(&result);
424     return result;
425 }
426
427 static inline VmathVector4 vmathV4MakeYAxis_V( )
428 {
429     VmathVector4 result;
430     vmathV4MakeYAxis(&result);
431     return result;
432 }
433
434 static inline VmathVector4 vmathV4MakeZAxis_V( )
435 {
436     VmathVector4 result;
437     vmathV4MakeZAxis(&result);
438     return result;
439 }
440
441 static inline VmathVector4 vmathV4MakeWAxis_V( )
442 {
443     VmathVector4 result;
444     vmathV4MakeWAxis(&result);
445     return result;
446 }
447
448 static inline VmathVector4 vmathV4Lerp_V( float t, VmathVector4 vec0, VmathVector4 vec1 )
449 {
450     VmathVector4 result;
451     vmathV4Lerp(&result, t, &vec0, &vec1);
452     return result;
453 }
454
455 static inline VmathVector4 vmathV4Slerp_V( float t, VmathVector4 unitVec0, VmathVector4 unitVec1 )
456 {
457     VmathVector4 result;
458     vmathV4Slerp(&result, t, &unitVec0, &unitVec1);
459     return result;
460 }
461
462 static inline vec_float4 vmathV4Get128_V( VmathVector4 vec )
463 {
464     return vmathV4Get128(&vec);
465 }
466
467 static inline void vmathV4StoreHalfFloats_V( VmathVector4 vec0, VmathVector4 vec1, VmathVector4 vec2, VmathVector4 vec3, vec_ushort8 *twoQuads )
468 {
469     vmathV4StoreHalfFloats(&vec0, &vec1, &vec2, &vec3, twoQuads);
470 }
471
472 static inline void vmathV4SetXYZ_V( VmathVector4 *result, VmathVector3 vec )
473 {
474     vmathV4SetXYZ(result, &vec);
475 }
476
477 static inline VmathVector3 vmathV4GetXYZ_V( VmathVector4 vec )
478 {
479     VmathVector3 result;
480     vmathV4GetXYZ(&result, &vec);
481     return result;
482 }
483
484 static inline void vmathV4SetX_V( VmathVector4 *result, float _x )
485 {
486     vmathV4SetX(result, _x);
487 }
488
489 static inline float vmathV4GetX_V( VmathVector4 vec )
490 {
491     return vmathV4GetX(&vec);
492 }
493
494 static inline void vmathV4SetY_V( VmathVector4 *result, float _y )
495 {
496     vmathV4SetY(result, _y);
497 }
498
499 static inline float vmathV4GetY_V( VmathVector4 vec )
500 {
501     return vmathV4GetY(&vec);
502 }
503
504 static inline void vmathV4SetZ_V( VmathVector4 *result, float _z )
505 {
506     vmathV4SetZ(result, _z);
507 }
508
509 static inline float vmathV4GetZ_V( VmathVector4 vec )
510 {
511     return vmathV4GetZ(&vec);
512 }
513
514 static inline void vmathV4SetW_V( VmathVector4 *result, float _w )
515 {
516     vmathV4SetW(result, _w);
517 }
518
519 static inline float vmathV4GetW_V( VmathVector4 vec )
520 {
521     return vmathV4GetW(&vec);
522 }
523
524 static inline void vmathV4SetElem_V( VmathVector4 *result, int idx, float value )
525 {
526     vmathV4SetElem(result, idx, value);
527 }
528
529 static inline float vmathV4GetElem_V( VmathVector4 vec, int idx )
530 {
531     return vmathV4GetElem(&vec, idx);
532 }
533
534 static inline VmathVector4 vmathV4Add_V( VmathVector4 vec0, VmathVector4 vec1 )
535 {
536     VmathVector4 result;
537     vmathV4Add(&result, &vec0, &vec1);
538     return result;
539 }
540
541 static inline VmathVector4 vmathV4Sub_V( VmathVector4 vec0, VmathVector4 vec1 )
542 {
543     VmathVector4 result;
544     vmathV4Sub(&result, &vec0, &vec1);
545     return result;
546 }
547
548 static inline VmathVector4 vmathV4ScalarMul_V( VmathVector4 vec, float scalar )
549 {
550     VmathVector4 result;
551     vmathV4ScalarMul(&result, &vec, scalar);
552     return result;
553 }
554
555 static inline VmathVector4 vmathV4ScalarDiv_V( VmathVector4 vec, float scalar )
556 {
557     VmathVector4 result;
558     vmathV4ScalarDiv(&result, &vec, scalar);
559     return result;
560 }
561
562 static inline VmathVector4 vmathV4Neg_V( VmathVector4 vec )
563 {
564     VmathVector4 result;
565     vmathV4Neg(&result, &vec);
566     return result;
567 }
568
569 static inline VmathVector4 vmathV4MulPerElem_V( VmathVector4 vec0, VmathVector4 vec1 )
570 {
571     VmathVector4 result;
572     vmathV4MulPerElem(&result, &vec0, &vec1);
573     return result;
574 }
575
576 static inline VmathVector4 vmathV4DivPerElem_V( VmathVector4 vec0, VmathVector4 vec1 )
577 {
578     VmathVector4 result;
579     vmathV4DivPerElem(&result, &vec0, &vec1);
580     return result;
581 }
582
583 static inline VmathVector4 vmathV4RecipPerElem_V( VmathVector4 vec )
584 {
585     VmathVector4 result;
586     vmathV4RecipPerElem(&result, &vec);
587     return result;
588 }
589
590 static inline VmathVector4 vmathV4SqrtPerElem_V( VmathVector4 vec )
591 {
592     VmathVector4 result;
593     vmathV4SqrtPerElem(&result, &vec);
594     return result;
595 }
596
597 static inline VmathVector4 vmathV4RsqrtPerElem_V( VmathVector4 vec )
598 {
599     VmathVector4 result;
600     vmathV4RsqrtPerElem(&result, &vec);
601     return result;
602 }
603
604 static inline VmathVector4 vmathV4AbsPerElem_V( VmathVector4 vec )
605 {
606     VmathVector4 result;
607     vmathV4AbsPerElem(&result, &vec);
608     return result;
609 }
610
611 static inline VmathVector4 vmathV4CopySignPerElem_V( VmathVector4 vec0, VmathVector4 vec1 )
612 {
613     VmathVector4 result;
614     vmathV4CopySignPerElem(&result, &vec0, &vec1);
615     return result;
616 }
617
618 static inline VmathVector4 vmathV4MaxPerElem_V( VmathVector4 vec0, VmathVector4 vec1 )
619 {
620     VmathVector4 result;
621     vmathV4MaxPerElem(&result, &vec0, &vec1);
622     return result;
623 }
624
625 static inline float vmathV4MaxElem_V( VmathVector4 vec )
626 {
627     return vmathV4MaxElem(&vec);
628 }
629
630 static inline VmathVector4 vmathV4MinPerElem_V( VmathVector4 vec0, VmathVector4 vec1 )
631 {
632     VmathVector4 result;
633     vmathV4MinPerElem(&result, &vec0, &vec1);
634     return result;
635 }
636
637 static inline float vmathV4MinElem_V( VmathVector4 vec )
638 {
639     return vmathV4MinElem(&vec);
640 }
641
642 static inline float vmathV4Sum_V( VmathVector4 vec )
643 {
644     return vmathV4Sum(&vec);
645 }
646
647 static inline float vmathV4Dot_V( VmathVector4 vec0, VmathVector4 vec1 )
648 {
649     return vmathV4Dot(&vec0, &vec1);
650 }
651
652 static inline float vmathV4LengthSqr_V( VmathVector4 vec )
653 {
654     return vmathV4LengthSqr(&vec);
655 }
656
657 static inline float vmathV4Length_V( VmathVector4 vec )
658 {
659     return vmathV4Length(&vec);
660 }
661
662 static inline VmathVector4 vmathV4Normalize_V( VmathVector4 vec )
663 {
664     VmathVector4 result;
665     vmathV4Normalize(&result, &vec);
666     return result;
667 }
668
669 static inline VmathVector4 vmathV4Select_V( VmathVector4 vec0, VmathVector4 vec1, unsigned int select1 )
670 {
671     VmathVector4 result;
672     vmathV4Select(&result, &vec0, &vec1, select1);
673     return result;
674 }
675
676 #ifdef _VECTORMATH_DEBUG
677
678 static inline void vmathV4Print_V( VmathVector4 vec )
679 {
680     vmathV4Print(&vec);
681 }
682
683 static inline void vmathV4Prints_V( VmathVector4 vec, const char *name )
684 {
685     vmathV4Prints(&vec, name);
686 }
687
688 #endif
689
690 static inline VmathPoint3 vmathP3MakeFromElems_V( float _x, float _y, float _z )
691 {
692     VmathPoint3 result;
693     vmathP3MakeFromElems(&result, _x, _y, _z);
694     return result;
695 }
696
697 static inline VmathPoint3 vmathP3MakeFromV3_V( VmathVector3 vec )
698 {
699     VmathPoint3 result;
700     vmathP3MakeFromV3(&result, &vec);
701     return result;
702 }
703
704 static inline VmathPoint3 vmathP3MakeFromScalar_V( float scalar )
705 {
706     VmathPoint3 result;
707     vmathP3MakeFromScalar(&result, scalar);
708     return result;
709 }
710
711 static inline VmathPoint3 vmathP3MakeFrom128_V( vec_float4 vf4 )
712 {
713     VmathPoint3 result;
714     vmathP3MakeFrom128(&result, vf4);
715     return result;
716 }
717
718 static inline VmathPoint3 vmathP3Lerp_V( float t, VmathPoint3 pnt0, VmathPoint3 pnt1 )
719 {
720     VmathPoint3 result;
721     vmathP3Lerp(&result, t, &pnt0, &pnt1);
722     return result;
723 }
724
725 static inline vec_float4 vmathP3Get128_V( VmathPoint3 pnt )
726 {
727     return vmathP3Get128(&pnt);
728 }
729
730 static inline void vmathP3StoreXYZ_V( VmathPoint3 pnt, vec_float4 *quad )
731 {
732     vmathP3StoreXYZ(&pnt, quad);
733 }
734
735 static inline void vmathP3LoadXYZArray_V( VmathPoint3 *pnt0, VmathPoint3 *pnt1, VmathPoint3 *pnt2, VmathPoint3 *pnt3, const vec_float4 *threeQuads )
736 {
737     vmathP3LoadXYZArray(pnt0, pnt1, pnt2, pnt3, threeQuads);
738 }
739
740 static inline void vmathP3StoreXYZArray_V( VmathPoint3 pnt0, VmathPoint3 pnt1, VmathPoint3 pnt2, VmathPoint3 pnt3, vec_float4 *threeQuads )
741 {
742     vmathP3StoreXYZArray(&pnt0, &pnt1, &pnt2, &pnt3, threeQuads);
743 }
744
745 static inline void vmathP3StoreHalfFloats_V( VmathPoint3 pnt0, VmathPoint3 pnt1, VmathPoint3 pnt2, VmathPoint3 pnt3, VmathPoint3 pnt4, VmathPoint3 pnt5, VmathPoint3 pnt6, VmathPoint3 pnt7, vec_ushort8 *threeQuads )
746 {
747     vmathP3StoreHalfFloats(&pnt0, &pnt1, &pnt2, &pnt3, &pnt4, &pnt5, &pnt6, &pnt7, threeQuads);
748 }
749
750 static inline void vmathP3SetX_V( VmathPoint3 *result, float _x )
751 {
752     vmathP3SetX(result, _x);
753 }
754
755 static inline float vmathP3GetX_V( VmathPoint3 pnt )
756 {
757     return vmathP3GetX(&pnt);
758 }
759
760 static inline void vmathP3SetY_V( VmathPoint3 *result, float _y )
761 {
762     vmathP3SetY(result, _y);
763 }
764
765 static inline float vmathP3GetY_V( VmathPoint3 pnt )
766 {
767     return vmathP3GetY(&pnt);
768 }
769
770 static inline void vmathP3SetZ_V( VmathPoint3 *result, float _z )
771 {
772     vmathP3SetZ(result, _z);
773 }
774
775 static inline float vmathP3GetZ_V( VmathPoint3 pnt )
776 {
777     return vmathP3GetZ(&pnt);
778 }
779
780 static inline void vmathP3SetElem_V( VmathPoint3 *result, int idx, float value )
781 {
782     vmathP3SetElem(result, idx, value);
783 }
784
785 static inline float vmathP3GetElem_V( VmathPoint3 pnt, int idx )
786 {
787     return vmathP3GetElem(&pnt, idx);
788 }
789
790 static inline VmathVector3 vmathP3Sub_V( VmathPoint3 pnt0, VmathPoint3 pnt1 )
791 {
792     VmathVector3 result;
793     vmathP3Sub(&result, &pnt0, &pnt1);
794     return result;
795 }
796
797 static inline VmathPoint3 vmathP3AddV3_V( VmathPoint3 pnt, VmathVector3 vec1 )
798 {
799     VmathPoint3 result;
800     vmathP3AddV3(&result, &pnt, &vec1);
801     return result;
802 }
803
804 static inline VmathPoint3 vmathP3SubV3_V( VmathPoint3 pnt, VmathVector3 vec1 )
805 {
806     VmathPoint3 result;
807     vmathP3SubV3(&result, &pnt, &vec1);
808     return result;
809 }
810
811 static inline VmathPoint3 vmathP3MulPerElem_V( VmathPoint3 pnt0, VmathPoint3 pnt1 )
812 {
813     VmathPoint3 result;
814     vmathP3MulPerElem(&result, &pnt0, &pnt1);
815     return result;
816 }
817
818 static inline VmathPoint3 vmathP3DivPerElem_V( VmathPoint3 pnt0, VmathPoint3 pnt1 )
819 {
820     VmathPoint3 result;
821     vmathP3DivPerElem(&result, &pnt0, &pnt1);
822     return result;
823 }
824
825 static inline VmathPoint3 vmathP3RecipPerElem_V( VmathPoint3 pnt )
826 {
827     VmathPoint3 result;
828     vmathP3RecipPerElem(&result, &pnt);
829     return result;
830 }
831
832 static inline VmathPoint3 vmathP3SqrtPerElem_V( VmathPoint3 pnt )
833 {
834     VmathPoint3 result;
835     vmathP3SqrtPerElem(&result, &pnt);
836     return result;
837 }
838
839 static inline VmathPoint3 vmathP3RsqrtPerElem_V( VmathPoint3 pnt )
840 {
841     VmathPoint3 result;
842     vmathP3RsqrtPerElem(&result, &pnt);
843     return result;
844 }
845
846 static inline VmathPoint3 vmathP3AbsPerElem_V( VmathPoint3 pnt )
847 {
848     VmathPoint3 result;
849     vmathP3AbsPerElem(&result, &pnt);
850     return result;
851 }
852
853 static inline VmathPoint3 vmathP3CopySignPerElem_V( VmathPoint3 pnt0, VmathPoint3 pnt1 )
854 {
855     VmathPoint3 result;
856     vmathP3CopySignPerElem(&result, &pnt0, &pnt1);
857     return result;
858 }
859
860 static inline VmathPoint3 vmathP3MaxPerElem_V( VmathPoint3 pnt0, VmathPoint3 pnt1 )
861 {
862     VmathPoint3 result;
863     vmathP3MaxPerElem(&result, &pnt0, &pnt1);
864     return result;
865 }
866
867 static inline float vmathP3MaxElem_V( VmathPoint3 pnt )
868 {
869     return vmathP3MaxElem(&pnt);
870 }
871
872 static inline VmathPoint3 vmathP3MinPerElem_V( VmathPoint3 pnt0, VmathPoint3 pnt1 )
873 {
874     VmathPoint3 result;
875     vmathP3MinPerElem(&result, &pnt0, &pnt1);
876     return result;
877 }
878
879 static inline float vmathP3MinElem_V( VmathPoint3 pnt )
880 {
881     return vmathP3MinElem(&pnt);
882 }
883
884 static inline float vmathP3Sum_V( VmathPoint3 pnt )
885 {
886     return vmathP3Sum(&pnt);
887 }
888
889 static inline VmathPoint3 vmathP3Scale_V( VmathPoint3 pnt, float scaleVal )
890 {
891     VmathPoint3 result;
892     vmathP3Scale(&result, &pnt, scaleVal);
893     return result;
894 }
895
896 static inline VmathPoint3 vmathP3NonUniformScale_V( VmathPoint3 pnt, VmathVector3 scaleVec )
897 {
898     VmathPoint3 result;
899     vmathP3NonUniformScale(&result, &pnt, &scaleVec);
900     return result;
901 }
902
903 static inline float vmathP3Projection_V( VmathPoint3 pnt, VmathVector3 unitVec )
904 {
905     return vmathP3Projection(&pnt, &unitVec);
906 }
907
908 static inline float vmathP3DistSqrFromOrigin_V( VmathPoint3 pnt )
909 {
910     return vmathP3DistSqrFromOrigin(&pnt);
911 }
912
913 static inline float vmathP3DistFromOrigin_V( VmathPoint3 pnt )
914 {
915     return vmathP3DistFromOrigin(&pnt);
916 }
917
918 static inline float vmathP3DistSqr_V( VmathPoint3 pnt0, VmathPoint3 pnt1 )
919 {
920     return vmathP3DistSqr(&pnt0, &pnt1);
921 }
922
923 static inline float vmathP3Dist_V( VmathPoint3 pnt0, VmathPoint3 pnt1 )
924 {
925     return vmathP3Dist(&pnt0, &pnt1);
926 }
927
928 static inline VmathPoint3 vmathP3Select_V( VmathPoint3 pnt0, VmathPoint3 pnt1, unsigned int select1 )
929 {
930     VmathPoint3 result;
931     vmathP3Select(&result, &pnt0, &pnt1, select1);
932     return result;
933 }
934
935 #ifdef _VECTORMATH_DEBUG
936
937 static inline void vmathP3Print_V( VmathPoint3 pnt )
938 {
939     vmathP3Print(&pnt);
940 }
941
942 static inline void vmathP3Prints_V( VmathPoint3 pnt, const char *name )
943 {
944     vmathP3Prints(&pnt, name);
945 }
946
947 #endif
948
949 #ifdef __cplusplus
950 }
951 #endif /* __cplusplus */
952
953 #endif