Max 5 API Reference
00001 #ifdef __ALTIVEC__ 00002 #pragma altivec_model on 00003 00004 #ifdef __cplusplus 00005 #include <stdlib.h> // for vec_malloc 00006 #endif 00007 00008 #define SIXTEENIZE(p) ((((unsigned long)(p)) + 16) & 0xFFFFFFF0L); 00009 00010 typedef union 00011 { 00012 float flt[4]; 00013 vector float vFlt; 00014 } floatToVector; 00015 00016 static floatToVector __vsf_temp; 00017 00018 // this is what was needed to convince the compiler to copy a float to 00019 // the four float locations in a vector 00020 00021 #define vec_splat_float(v,f) { \ 00022 __vsf_temp.flt[0] = f; \ 00023 v = vec_splat( vec_lde( 0, __vsf_temp.flt ), 0 ); } 00024 00025 #define VRSAVE asm { li r0,-1 ; mtspr vrsave,r0 } 00026 00027 #pragma altivec_model off 00028 #endif
Copyright © 2008, Cycling '74