Fix build on PPC64LE

Signed-off-by: Timothy Pearson <tpearson@raptorengineering.com>
This commit is contained in:
Timothy Pearson
2016-06-26 20:09:39 -05:00
parent 47b06d3255
commit 203eda1d47
9 changed files with 37 additions and 10 deletions

View File

@ -29,6 +29,7 @@
#include "nvmath/SimdVector.h"
#include "nvmath/Vector.h"
#include "nvcore/Memory.h"
// Use SIMD version if altivec or SSE are available.
#define NVTT_USE_SIMD (NV_USE_ALTIVEC || NV_USE_SSE)

View File

@ -1,6 +1,7 @@
/* -----------------------------------------------------------------------------
Copyright (c) 2006 Simon Brown si@sjbrown.co.uk
Copyright (c) 2016 Raptor Engineering, LLC
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@ -33,7 +34,7 @@
namespace nvsquish {
#define VEC4_CONST( X ) Vec4( ( vector float )( X ) )
#define VEC4_CONST( X ) Vec4( vec_splats( (float)X ) )
class Vec4
{
@ -105,7 +106,7 @@ public:
Vec4& operator*=( Arg v )
{
m_v = vec_madd( m_v, v.m_v, ( vector float )( -0.0f ) );
m_v = vec_madd( m_v, v.m_v, vec_splats( -0.0f ) );
return *this;
}
@ -121,7 +122,7 @@ public:
friend Vec4 operator*( Vec4::Arg left, Vec4::Arg right )
{
return Vec4( vec_madd( left.m_v, right.m_v, ( vector float )( -0.0f ) ) );
return Vec4( vec_madd( left.m_v, right.m_v, vec_splats( -0.0f ) ) );
}
//! Returns a*b + c
@ -142,7 +143,7 @@ public:
vector float estimate = vec_re( v.m_v );
// one round of Newton-Rhaphson refinement
vector float diff = vec_nmsub( estimate, v.m_v, ( vector float )( 1.0f ) );
vector float diff = vec_nmsub( estimate, v.m_v, vec_splats( 1.0f ) );
return Vec4( vec_madd( diff, estimate, estimate ) );
}