Skip to content

Commit

Permalink
windows compile fix
Browse files Browse the repository at this point in the history
  • Loading branch information
svenwoop committed Jan 7, 2015
1 parent c079c1c commit 2d8dbe6
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 11 deletions.
4 changes: 2 additions & 2 deletions common/math/color.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// limitations under the License. //
// ======================================================================== //

#pragma once
#pragma once // FIXME: delete color files

#include "../sys/constants.h"
#include "../simd/sse.h"
Expand Down Expand Up @@ -201,7 +201,7 @@ namespace embree

__forceinline const Color select( bool s, const Color& t, const Color& f ) {
__m128 mask = s ? _mm_castsi128_ps(_mm_cmpeq_epi32(_mm_setzero_si128(), _mm_setzero_si128())) : _mm_setzero_ps();
return _mm_blendv_ps(f, t, mask);
return blendv_ps(f, t, mask);
}

////////////////////////////////////////////////////////////////////////////////
Expand Down
8 changes: 4 additions & 4 deletions common/math/vec3fa.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ namespace embree
return _mm_and_ps(a.m128, mask);
}
__forceinline const Vec3fa sign ( const Vec3fa& a ) {
return _mm_blendv_ps(Vec3fa(one), -Vec3fa(one), _mm_cmplt_ps (a,Vec3fa(zero)));
return blendv_ps(Vec3fa(one), -Vec3fa(one), _mm_cmplt_ps (a,Vec3fa(zero)));
}
__forceinline const Vec3fa rcp ( const Vec3fa& a ) {
const Vec3fa r = _mm_rcp_ps(a.m128);
Expand All @@ -111,7 +111,7 @@ namespace embree
__m128 r = _mm_rsqrt_ps(a.m128);
return _mm_add_ps(_mm_mul_ps(_mm_set1_ps(1.5f),r), _mm_mul_ps(_mm_mul_ps(_mm_mul_ps(a, _mm_set1_ps(-0.5f)), r), _mm_mul_ps(r, r)));
}
__forceinline const Vec3fa zero_fix(const Vec3fa& a) { return _mm_blendv_ps(a, _mm_set1_ps(1E-10f), _mm_cmpeq_ps (a.m128, _mm_setzero_ps())); }
__forceinline const Vec3fa zero_fix(const Vec3fa& a) { return blendv_ps(a, _mm_set1_ps(1E-10f), _mm_cmpeq_ps (a.m128, _mm_setzero_ps())); }
__forceinline const Vec3fa rcp_safe(const Vec3fa& a) { return rcp(zero_fix(a)); }

__forceinline Vec3fa log ( const Vec3fa& a ) {
Expand Down Expand Up @@ -254,11 +254,11 @@ namespace embree

__forceinline const Vec3fa select( bool s, const Vec3fa& t, const Vec3fa& f ) {
__m128 mask = s ? _mm_castsi128_ps(_mm_cmpeq_epi32(_mm_setzero_si128(), _mm_setzero_si128())) : _mm_setzero_ps();
return _mm_blendv_ps(f, t, mask);
return blendv_ps(f, t, mask);
}

__forceinline const Vec3fa select( const Vec3ba& s, const Vec3fa& t, const Vec3fa& f ) {
return _mm_blendv_ps(f, t, s);
return blendv_ps(f, t, s);
}

__forceinline int maxDim ( const Vec3fa& a )
Expand Down
2 changes: 1 addition & 1 deletion common/simd/smmintrin_emu.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// limitations under the License. //
// ======================================================================== //

#pragma once
#pragma once // FIXME: remove this file?

#ifndef __GNUC__
#pragma message (" --- Intel remark: SSE4 intrinsics are emulated with SSE3 ---")
Expand Down
8 changes: 6 additions & 2 deletions common/simd/sse.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@

namespace embree
{
#if !defined(__SSE4_1__)
__forceinline __m128 _mm_blendv_ps( __m128 f, __m128 t, __m128 mask ) {
#if defined(__SSE4_1__)
__forceinline __m128 blendv_ps( __m128 f, __m128 t, __m128 mask ) {
return _mm_blendv_ps(f,t,mask);
}
#else
__forceinline __m128 blendv_ps( __m128 f, __m128 t, __m128 mask ) {
return _mm_or_ps(_mm_and_ps(mask, t), _mm_andnot_ps(mask, f));
}
#endif
Expand Down
2 changes: 1 addition & 1 deletion common/simd/ssef.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ namespace embree
__forceinline const ssef operator +( const ssef& a ) { return a; }
__forceinline const ssef operator -( const ssef& a ) { return _mm_xor_ps(a.m128, _mm_castsi128_ps(_mm_set1_epi32(0x80000000))); }
__forceinline const ssef abs ( const ssef& a ) { return _mm_and_ps(a.m128, _mm_castsi128_ps(_mm_set1_epi32(0x7fffffff))); }
__forceinline const ssef sign ( const ssef& a ) { return _mm_blendv_ps(ssef(one), -ssef(one), _mm_cmplt_ps (a,ssef(zero))); }
__forceinline const ssef sign ( const ssef& a ) { return blendv_ps(ssef(one), -ssef(one), _mm_cmplt_ps (a,ssef(zero))); }
__forceinline const ssef signmsk ( const ssef& a ) { return _mm_and_ps(a.m128,_mm_castsi128_ps(_mm_set1_epi32(0x80000000))); }

__forceinline const ssef rcp ( const ssef& a ) {
Expand Down
2 changes: 1 addition & 1 deletion common/simd/ssei.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ namespace embree
}

#if defined(__SSE4_1__)
#if defined(__clang__) || defined(_MSC_VER) && !defined(__INTEL_COMPILER)
#if defined(__clang__) || defined(_MSC_VER) && !defined(__INTEL_COMPILER) // FIXME: can this get removed?
__forceinline const ssei select(const int mask, const ssei& t, const ssei& f) {
return select(sseb(mask), t, f);
}
Expand Down

0 comments on commit 2d8dbe6

Please sign in to comment.