sse.cpp 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // ======================================================================== //
  2. // Copyright 2009-2017 Intel Corporation //
  3. // //
  4. // Licensed under the Apache License, Version 2.0 (the "License"); //
  5. // you may not use this file except in compliance with the License. //
  6. // You may obtain a copy of the License at //
  7. // //
  8. // http://www.apache.org/licenses/LICENSE-2.0 //
  9. // //
  10. // Unless required by applicable law or agreed to in writing, software //
  11. // distributed under the License is distributed on an "AS IS" BASIS, //
  12. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //
  13. // See the License for the specific language governing permissions and //
  14. // limitations under the License. //
  15. // ======================================================================== //
  16. #include "sse.h"
  17. namespace embree
  18. {
  19. const __m128 _mm_lookupmask_ps[16] = {
  20. _mm_castsi128_ps(_mm_set_epi32( 0, 0, 0, 0)),
  21. _mm_castsi128_ps(_mm_set_epi32( 0, 0, 0,-1)),
  22. _mm_castsi128_ps(_mm_set_epi32( 0, 0,-1, 0)),
  23. _mm_castsi128_ps(_mm_set_epi32( 0, 0,-1,-1)),
  24. _mm_castsi128_ps(_mm_set_epi32( 0,-1, 0, 0)),
  25. _mm_castsi128_ps(_mm_set_epi32( 0,-1, 0,-1)),
  26. _mm_castsi128_ps(_mm_set_epi32( 0,-1,-1, 0)),
  27. _mm_castsi128_ps(_mm_set_epi32( 0,-1,-1,-1)),
  28. _mm_castsi128_ps(_mm_set_epi32(-1, 0, 0, 0)),
  29. _mm_castsi128_ps(_mm_set_epi32(-1, 0, 0,-1)),
  30. _mm_castsi128_ps(_mm_set_epi32(-1, 0,-1, 0)),
  31. _mm_castsi128_ps(_mm_set_epi32(-1, 0,-1,-1)),
  32. _mm_castsi128_ps(_mm_set_epi32(-1,-1, 0, 0)),
  33. _mm_castsi128_ps(_mm_set_epi32(-1,-1, 0,-1)),
  34. _mm_castsi128_ps(_mm_set_epi32(-1,-1,-1, 0)),
  35. _mm_castsi128_ps(_mm_set_epi32(-1,-1,-1,-1))
  36. };
  37. const __m128d _mm_lookupmask_pd[4] = {
  38. _mm_castsi128_pd(_mm_set_epi32( 0, 0, 0, 0)),
  39. _mm_castsi128_pd(_mm_set_epi32( 0, 0,-1,-1)),
  40. _mm_castsi128_pd(_mm_set_epi32(-1,-1, 0, 0)),
  41. _mm_castsi128_pd(_mm_set_epi32(-1,-1,-1,-1))
  42. };
  43. }