sse.h 1.8 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. #pragma once
  17. #include "../sys/platform.h"
  18. #include "../sys/intrinsics.h"
  19. #include "../math/constants.h"
  20. #include "varying.h"
  21. namespace embree
  22. {
  23. #if defined(__SSE4_1__)
  24. __forceinline __m128 blendv_ps( __m128 f, __m128 t, __m128 mask ) {
  25. return _mm_blendv_ps(f,t,mask);
  26. }
  27. #else
  28. __forceinline __m128 blendv_ps( __m128 f, __m128 t, __m128 mask ) {
  29. return _mm_or_ps(_mm_and_ps(mask, t), _mm_andnot_ps(mask, f));
  30. }
  31. #endif
  32. extern const __m128 _mm_lookupmask_ps[16];
  33. extern const __m128d _mm_lookupmask_pd[4];
  34. }
  35. #if defined(__AVX512VL__)
  36. #include "vboolf4_avx512.h"
  37. #else
  38. #include "vboolf4_sse2.h"
  39. #endif
  40. #include "vint4_sse2.h"
  41. #include "vfloat4_sse2.h"