vector.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. //
  2. // vector.h
  3. // BulletTest
  4. //
  5. // Copyright (c) 2011 Apple Inc.
  6. //
  7. #ifndef BulletTest_vector_h
  8. #define BulletTest_vector_h
  9. #ifdef __SSE__
  10. typedef float float4 __attribute__ ((__vector_size__(16)));
  11. #include <xmmintrin.h>
  12. #endif
  13. #ifdef __SSE2__
  14. typedef double double2 __attribute__ ((__vector_size__(16)));
  15. typedef char char16 __attribute__ ((__vector_size__(16)));
  16. typedef unsigned char uchar16 __attribute__ ((__vector_size__(16)));
  17. typedef short short8 __attribute__ ((__vector_size__(16)));
  18. typedef unsigned short ushort8 __attribute__ ((__vector_size__(16)));
  19. typedef int int4 __attribute__ ((__vector_size__(16)));
  20. // typedef unsigned int uint4 __attribute__ ((__vector_size__(16)));
  21. #ifdef __LP64__
  22. typedef long long2 __attribute__ ((__vector_size__(16)));
  23. typedef unsigned long ulong2 __attribute__ ((__vector_size__(16)));
  24. #else
  25. typedef long long long2 __attribute__ ((__vector_size__(16)));
  26. typedef unsigned long long ulong2 __attribute__ ((__vector_size__(16)));
  27. #endif
  28. #include <emmintrin.h>
  29. #endif
  30. #ifdef __SSE3__
  31. #include <pmmintrin.h>
  32. #endif
  33. #ifdef __SSSE3__
  34. #include <tmmintrin.h>
  35. #endif
  36. #ifdef __SSE4_1__
  37. #include <smmintrin.h>
  38. #endif
  39. #ifdef __arm__
  40. #include <arm/arch.h>
  41. #ifdef _ARM_ARCH_7
  42. #define ARM_NEON_GCC_COMPATIBILITY 1
  43. #include <arm_neon.h>
  44. typedef float float4 __attribute__ ((__vector_size__(16)));
  45. typedef double double2 __attribute__ ((__vector_size__(16)));
  46. typedef char char16 __attribute__ ((__vector_size__(16)));
  47. typedef unsigned char uchar16 __attribute__ ((__vector_size__(16)));
  48. typedef short short8 __attribute__ ((__vector_size__(16)));
  49. typedef unsigned short ushort8 __attribute__ ((__vector_size__(16)));
  50. typedef int int4 __attribute__ ((__vector_size__(16)));
  51. typedef unsigned int uint4 __attribute__ ((__vector_size__(16)));
  52. #ifdef __LP64__
  53. typedef long long2 __attribute__ ((__vector_size__(16)));
  54. typedef unsigned long ulong2 __attribute__ ((__vector_size__(16)));
  55. #else
  56. typedef long long long2 __attribute__ ((__vector_size__(16)));
  57. typedef unsigned long long ulong2 __attribute__ ((__vector_size__(16)));
  58. #endif
  59. #endif
  60. #endif
  61. #endif