00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00039 #ifndef G_INTRIN
00040 #define G_INTRIN
00041 #include <emmintrin.h>
00042 #ifdef __SSE3__
00043 #include <pmmintrin.h>
00044 #endif
00045
00046
00047
00048
00049 template<typename Treal, typename Treg>
00050 inline static Treg _mm_load_p (Treal const * ptr);
00051
00052 inline static __m128 _mm_load_p (float const * ptr) {
00053 return _mm_load_ps (ptr);
00054 }
00055
00056 inline static __m128d _mm_load_p (double const * ptr) {
00057 return _mm_load_pd (ptr);
00058 }
00059
00060
00061 template<typename Treal, typename Treg>
00062 inline static Treg _mm_load1_p (Treal const * ptr);
00063
00064 inline static __m128 _mm_load1_p (float const * ptr) {
00065 return _mm_load1_ps (ptr);
00066 }
00067
00068
00069 inline static __m128d _mm_load1_p (double const * ptr) {
00070 return _mm_load1_pd (ptr);
00071 }
00072
00073
00074 template<typename Treal, typename Treg>
00075 inline static Treg _mm_set1_p (Treal const val);
00076
00077 inline static __m128 _mm_set1_p (float const val) {
00078 return _mm_set1_ps (val);
00079 }
00080
00081
00082 inline static __m128d _mm_set1_p (double const val) {
00083 return _mm_set1_pd (val);
00084 }
00085
00086
00087
00088 template<typename Treal, typename Treg>
00089 inline static void _mm_store_p (Treal * ptr, Treg A);
00090
00091 inline static void _mm_store_p (float * ptr, __m128 A) {
00092 _mm_store_ps (ptr, A);
00093 }
00094
00095 inline static void _mm_store_p (double * ptr, __m128d A) {
00096 _mm_store_pd (ptr, A);
00097 }
00098
00099
00100
00101
00102 template<typename Treg>
00103 inline static Treg _mm_add_p (Treg A, Treg B);
00104
00105 inline static __m128 _mm_add_p (__m128 A, __m128 B) {
00106 return _mm_add_ps(A, B);
00107 }
00108
00109 inline static __m128d _mm_add_p (__m128d A, __m128d B) {
00110 return _mm_add_pd(A, B);
00111 }
00112
00113
00114
00115
00116 template<typename Treg>
00117 inline static Treg _mm_mul_p (Treg A, Treg B);
00118
00119 inline static __m128 _mm_mul_p (__m128 A, __m128 B) {
00120 return _mm_mul_ps(A, B);
00121 }
00122
00123 inline static __m128d _mm_mul_p (__m128d A, __m128d B) {
00124 return _mm_mul_pd(A, B);
00125 }
00126
00127
00128
00129 template<typename Treg>
00130 inline static Treg _mm_xor_p (Treg A, Treg B);
00131
00132 inline static __m128 _mm_xor_p (__m128 A, __m128 B) {
00133 return _mm_xor_ps(A, B);
00134 }
00135
00136 inline static __m128d _mm_xor_p (__m128d A, __m128d B) {
00137 return _mm_xor_pd(A, B);
00138 }
00139
00140 #endif