altivec_common.h 680 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * altivec_typeconversion.h
  3. * DevIL
  4. *
  5. * Created by Meloni Dario on 17/04/05.
  6. *
  7. */
  8. #include "il_internal.h"
  9. #ifdef ALTIVEC_GCC
  10. #ifndef ALTIVEC_COMMON
  11. #define ALTIVEC_COMMON
  12. typedef union {
  13. vector unsigned int vuint;
  14. unsigned int suint[4];
  15. vector unsigned char vuchar;
  16. unsigned char suchar[4];
  17. vector float vf;
  18. float sf[4];
  19. } vector_t;
  20. // Loads 16 byte from the specified address, aligned or not
  21. //vector unsigned char load_unaligned( unsigned char *buffer );
  22. // Fills a vector with the specified value
  23. vector float fill_vector_f( float value );
  24. #define eround(v,x) (((int)((v/x)*10)%10) > 0 ? (v/x) : (v/x)+1)
  25. #define eround16(v) eround(v,16)
  26. #endif
  27. #endif