util_simd.cpp 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * Copyright 2011-2013 Intel Corporation
  3. * Modifications Copyright 2014, Blender Foundation.
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License");
  6. * you may not use this file except in compliance with the License.
  7. * You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. #if (defined(WITH_KERNEL_SSE2)) || (defined(WITH_KERNEL_NATIVE) && defined(__SSE2__))
  18. # define __KERNEL_SSE2__
  19. # include "util/util_simd.h"
  20. CCL_NAMESPACE_BEGIN
  21. const __m128 _mm_lookupmask_ps[16] = {_mm_castsi128_ps(_mm_set_epi32(0, 0, 0, 0)),
  22. _mm_castsi128_ps(_mm_set_epi32(0, 0, 0, -1)),
  23. _mm_castsi128_ps(_mm_set_epi32(0, 0, -1, 0)),
  24. _mm_castsi128_ps(_mm_set_epi32(0, 0, -1, -1)),
  25. _mm_castsi128_ps(_mm_set_epi32(0, -1, 0, 0)),
  26. _mm_castsi128_ps(_mm_set_epi32(0, -1, 0, -1)),
  27. _mm_castsi128_ps(_mm_set_epi32(0, -1, -1, 0)),
  28. _mm_castsi128_ps(_mm_set_epi32(0, -1, -1, -1)),
  29. _mm_castsi128_ps(_mm_set_epi32(-1, 0, 0, 0)),
  30. _mm_castsi128_ps(_mm_set_epi32(-1, 0, 0, -1)),
  31. _mm_castsi128_ps(_mm_set_epi32(-1, 0, -1, 0)),
  32. _mm_castsi128_ps(_mm_set_epi32(-1, 0, -1, -1)),
  33. _mm_castsi128_ps(_mm_set_epi32(-1, -1, 0, 0)),
  34. _mm_castsi128_ps(_mm_set_epi32(-1, -1, 0, -1)),
  35. _mm_castsi128_ps(_mm_set_epi32(-1, -1, -1, 0)),
  36. _mm_castsi128_ps(_mm_set_epi32(-1, -1, -1, -1))};
  37. CCL_NAMESPACE_END
  38. #endif // WITH_KERNEL_SSE2