I am having fun with SIMD, and have been writing a bridge between Reason SIMD and xmmintrin/emmintrin/pmmintrin
I will make it publicly available when done.
My current struggle is with comparisons (the functions that return the masks)
at first I tried:
Code: Select all
inline static __m128 _mm_cmpgt_ps(__m128 a, __m128 b) {
return a > b;
}
This produced trash, and then I tried this as non SIMD based on the definition for the function
Code: Select all
TJBox_Float32 x0 = (TJBox_Float32)(a[0] > b[0] ? 0xffffffff : 0x0);
TJBox_Float32 x1 = (TJBox_Float32)(a[1] > b[1] ? 0xffffffff : 0x0);
TJBox_Float32 x2 = (TJBox_Float32)(a[2] > b[2] ? 0xffffffff : 0x0);
TJBox_Float32 x3 = (TJBox_Float32)(a[3] > b[3] ? 0xffffffff : 0x0);
return (__m128) {x0,x1,x2,x3};
Still trash.
If anyone has pulled this off please let me know, as I said it will be made publicly available, but I dont expect anyway to divulge what they consider hard-earned private IP
by the way I have just defined the types per the Reason doco, and this has been working great for most intrinsics functions so far
Code: Select all
typedef TJBox_Float32 __m128 __attribute__((__vector_size__(16)));
typedef TJBox_Int32 __m128i __attribute__((__vector_size__(16)));
Murf.