#pragma once
#include "bvh.h"
#include "node_intersector1.h"
#include "../common/stack_item.h"
#define NEW_SORTING_CODE …
namespace embree
{
namespace isa
{
template<int N, int types>
class BVHNNodeTraverser1Hit;
#if defined(__AVX512VL__)
template<int N>
__forceinline void isort_update(vint<N> &dist, const vint<N> &d)
{
const vint<N> dist_shift = align_shift_right<N-1>(dist,dist);
const vboolf<N> m_geq = d >= dist;
const vboolf<N> m_geq_shift = m_geq << 1;
dist = select(m_geq,d,dist);
dist = select(m_geq_shift,dist_shift,dist);
}
template<int N>
__forceinline void isort_quick_update(vint<N> &dist, const vint<N> &d) {
dist = align_shift_right<N-1>(dist,permute(d,vint<N>(zero)));
}
__forceinline size_t permuteExtract(const vint8& index, const vllong4& n0, const vllong4& n1) {
return toScalar(permutex2var((__m256i)index,n0,n1));
}
__forceinline float permuteExtract(const vint8& index, const vfloat8& n) {
return toScalar(permute(n,index));
}
#endif
BVHNNodeTraverser1Hit<4, types>;
BVHNNodeTraverser1Hit<8, types>;
}
}