fatal error: fvec.h: No such file or directory

  32bit-64bit, c++, dll

When trying to compile my code in windows I get the following error:

psiSSE.h:43:18: fatal error: fvec.h: No such file or directory
#include <fvec.h>

The file in question is this one

/* 
*  Copyright 1999, 2001, Bruce Walter and George Drettakis
*   email: [email protected] and [email protected]
*   Original version is property of INRIA and GRAVIR-IMAG/UJF/CNRS/INPG 1999
*   Extended version developed at the Cornell Program of Computer Graphics 2001
*
*  This file is part of the RenderCache and is being released as free software under the
*   terms of the GNU General Public License as published by the Free Software Foundation; 
*   either version 2 of the License, or (at your option) any later version.
*
*  If you would like to use the RenderCache under a different license, please contact the authors.
*
*  RenderCache is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 
*   without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
*   See the GNU General Public License for more details.
*
*  You should have received a copy of the GNU General Public License along with 
*  RenderCache; if not, write to the Free Software Foundation, Inc., 51 Franklin St, 
*  Fifth Floor, Boston, MA  02110-1301  USA 
*/

#ifndef _H_PSISSE
#define _H_PSISSE

//crippled version for kb's laptop
#define PIII_CRIPPLED


#define _USE_SSE

inline char *EnsureAlign16(char *in) { 
  int val = (int)in;
  int inc = (-val)&0x0F;
  return in + inc;
//  if (val&0xF) { in = (in+0x10-(val&0xF)); } return in; 
} 
inline char *EnsureAlign4K(char *in) {
  int val = (int)in;
  int inc = (-val)&0x0FFF;
  return in + inc;
}
//use SSE and MMX instructions
#include <fvec.h>
#include <ivec.h>
#include <dvec.h>

/* fast float or double to int conversion (scalar) */
inline int fast_ftoi(float f) {
  return _mm_cvtt_ss2si(_mm_load_ss(&f));
}
inline int fast_dtoi(double d) {
#ifdef PIII_CRIPPLED
  return (int)d;
#else
  return _mm_cvttsd_si32(_mm_load_sd(&d));
#endif
}

/* convert first two floats to integers */
inline Is32vec2 LowToIntMMX(const F32vec4 &v)
{ return Is32vec2(_mm_cvtt_ps2pi(v)); }

/* convert second and third floats to integers */
inline Is32vec2 HighToIntMMX(const F32vec4 &v)
{ return Is32vec2(_mm_cvtt_ps2pi(_mm_shuffle_ps(v,v,_MM_SHUFFLE(3,2,3,2)))); }

/* convert four ints packed in two mmx registers into one packed float 4 vector */
inline F32vec4 IntMMX4ToFloat(const Is32vec2 &a, const Is32vec2 &b) {
  return _mm_cvtpi32x2_ps(a,b);
}

inline Is32vec4 FloatToInt(const F32vec4 &v)
{ return Is32vec4(_mm_cvttps_epi32(v)); }

inline F32vec4 IntToFloat(const Is32vec4 &v)
{ return _mm_cvtepi32_ps(v); }

/* Convert the lower 2 SP FP values of a to DP FP values  */
inline F64vec2 F32vec4LowToF64vec2(const F32vec4 &a)
{ 
    return _mm_cvtps_pd(a);
}  
/* Convert the upper 2 SP FP values of a to DP FP values  */
inline F64vec2 F32vec4HighToF64vec2(const F32vec4 &a)
{ 
    return _mm_cvtps_pd(_mm_movehl_ps(a,a));
}  

inline int ExtractInt3(const F32vec4 &v)
{ return _mm_cvttss_si32(_mm_shuffle_ps(v,v,_MM_SHUFFLE(0,0,0,3))); }
inline int ExtractInt2(const F32vec4 &v)
{ return _mm_cvttss_si32(_mm_shuffle_ps(v,v,_MM_SHUFFLE(0,0,0,2))); }
inline int ExtractInt1(const F32vec4 &v)
{ return _mm_cvttss_si32(_mm_shuffle_ps(v,v,_MM_SHUFFLE(0,0,0,1))); }
inline int ExtractInt0(const F32vec4 &v)
{ return _mm_cvttss_si32(v); }

/* inserts a word into MMX vector */
inline Iu16vec4 InsertWord(const Iu16vec4 &a, int what, int where)
{ return _mm_insert_pi16(a,what,where); }
inline Iu16vec4 InsertWord2(const Iu16vec4 &a, int what)
{ return _mm_insert_pi16(a,what,2); }
inline Iu16vec4 InsertWord3(const Iu16vec4 &a, int what)
{ return _mm_insert_pi16(a,what,3); }
/* extracts a word (16bits) from an MMX vector */
inline int ExtractWord(const Iu16vec4 &a, int where)
{ return _mm_extract_pi16(a,where); }
inline int ExtractWord3(const Iu16vec4 &a)
{ return _mm_extract_pi16(a,3); }
inline int ExtractWord0(const Iu16vec4 &a)
{ return _mm_extract_pi16(a,0); }
inline int ExtractWord0(const Is16vec4 &a)
{ return _mm_extract_pi16(a,0); }
inline int ExtractWord1(const Is16vec4 &a)
{ return _mm_extract_pi16(a,1); }
inline int ExtractWord2(const Is16vec4 &a)
{ return _mm_extract_pi16(a,2); }
inline int ExtractWord3(const Is16vec4 &a)
{ return _mm_extract_pi16(a,3); }
/* extacts dword (32bits) from an MMX vector */
inline int ExtractLowDWord(const Is32vec2 &a)
{ return _m_to_int(a); }
inline __m64 LoadLowInt(int i)
{ return _m_from_int(i); }


/* copies one word from MMX vector to all words */
inline I16vec4 BroadcastLowWord(const I16vec4 &a)
{ return _mm_shuffle_pi16(a,_MM_SHUFFLE(0,0,0,0)); }
inline I16vec4 BroadcastWord1(const I16vec4 &a)
{ return _mm_shuffle_pi16(a,_MM_SHUFFLE(1,1,1,1)); }
inline I16vec4 BroadcastWord2(const I16vec4 &a)
{ return _mm_shuffle_pi16(a,_MM_SHUFFLE(2,2,2,2)); }
inline I16vec4 BroadcastWord3(const I16vec4 &a)
{ return _mm_shuffle_pi16(a,_MM_SHUFFLE(3,3,3,3)); }

/* rotates words in MMX vector */
inline Is16vec4 WordRotateLeft1(const Is16vec4 &a)
{ return _mm_shuffle_pi16(a,_MM_SHUFFLE(2,1,0,3)); }
inline Is16vec4 WordRotateLeft2(const Is16vec4 &a)
{ return _mm_shuffle_pi16(a,_MM_SHUFFLE(1,0,3,2)); }
inline Is16vec4 WordRotateLeft3(const Is16vec4 &a)
{ return _mm_shuffle_pi16(a,_MM_SHUFFLE(0,3,2,1)); }

/* returns a where mask is 1 and b where mask is zero */
inline F32vec4 Select(const F32vec4 &a, const F32vec4 &b, const F32vec4 &mask)
{ return( (mask & a) | F32vec4(_mm_andnot_ps(mask,b))); }
inline Is32vec2 Select(const Iu32vec2 &a, const Iu32vec2 &b, const Iu32vec2 &mask)
{ return( (mask & a) | Is32vec2(_mm_andnot_si64(mask,b))); }

inline F32vec4 simd_andnot(const F32vec4 &a, const F32vec4 &b)
{ return _mm_andnot_ps(b,a); }

/* aligned store to array of 2 doubles */
inline void Store_F64vec2(double *p, const F64vec2 &v) { _mm_store_pd(p,v); }
/* aligned load from array of 4 floats */
inline F32vec4 Load_F32vec4(float *p) { return _mm_load_ps(p); }
inline F32vec4 Load_F32vec4_Unaligned(float *p) { return _mm_loadu_ps(p); }
/* aligned store to array of 4 floats */
inline void Store_F32vec4(float *p, const F32vec4 &v) { _mm_store_ps(p,v); }
inline void Store_F32vec4_Unaligned(float *p, const F32vec4 &v) { _mm_storeu_ps(p,v); }
/* aligned store of low 2 floats out of vector of 4 */
inline void Store_F32vec4_Low(float *p, const F32vec4 &v) { _mm_storel_pi((__m64 *)p,v); }
/* store just first float in vector of 4 */
inline void Store_F32vec4_FirstOnly(float *p, const F32vec4 &v) { _mm_store_ss(p,v); }
inline Iu32vec4 Load_Iu32vec4(void *p) { return *(Iu32vec4 *)p; }
inline Is32vec4 Load_Is32vec4(void *p) { return *(Is32vec4 *)p; }
inline Iu8vec16 Load_Iu8vec16(void *p) { return *(Iu8vec16 *)p; }
inline void Store_Is32vec4(void *p, const Is32vec4 &v) { _mm_store_si128((__m128i *)p,v); }
inline void Store_Iu8vec16(void *p, const Iu8vec16 &v) { _mm_store_si128((__m128i *)p,v); }

inline Is32vec2 Load_Is32vec2(void *p) { return *(Is32vec2 *)p; }
inline Iu32vec2 Load_Iu32vec2(void *p) { return *(Iu32vec2 *)p; }
inline Is16vec4 Load_Is16vec4(void *p) { return *(Is16vec4 *)p; }
inline Iu16vec4 Load_Iu16vec4(void *p) { return *(Iu16vec4 *)p; }
inline Iu8vec8  Load_Iu8vec8(void *p) { return *(Iu8vec8 *)p; }

inline void Store_Iu32vec2(void *p, const Iu32vec2 &a) { *(Iu32vec2 *)p = a; }
inline void Store_Is32vec2(void *p, const Is32vec2 &a) { *(Is32vec2 *)p = a; }
inline void Store_Is16vec4(short *p, const Is16vec4 &a) { *(Is16vec4 *)p = a; }
inline void Store_Iu8vec8(void *p, const Iu8vec8 &a) { *(Iu8vec8 *)p = a; }

/* prefetch to L1 & L2 */
inline void prefetch(const void *p) { _mm_prefetch((char *)p,_MM_HINT_T1); }
inline void prefetch_nontemporal(const void *p) { _mm_prefetch((char *)p,_MM_HINT_NTA); }

/* 16 byte alignment for SSE */
#define ALIGN16 _MM_ALIGN16
/* 8 byte alignment for MMX */
#define ALIGN8  __declspec(align(8))
/* 32 byte alignment for cachelines */
#define ALIGN32 __declspec(align(32))


#endif

The same error happens with <ivec.h> and <dvec.h>

I’m trying to compile this project in 64bits to create a DLL, but since it was originally written for the DLL to be 32bits it’s given me a lot of problems

Does anyone know of a possible solution for this?

Source: Windows Questions C++

LEAVE A COMMENT