ivec.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /**
  2. * This file has no copyright assigned and is placed in the Public Domain.
  3. * This file is part of the mingw-w64 runtime package.
  4. * No warranty is given; refer to the file DISCLAIMER.PD within this package.
  5. */
  6. #ifndef _IVEC_H_INCLUDED
  7. #define _IVEC_H_INCLUDED
  8. #ifndef RC_INVOKED
  9. #if !defined __cplusplus
  10. #error This file is only supported in C++ compilations!
  11. #endif
  12. #include <intrin.h>
  13. #include <assert.h>
  14. #include <crtdefs.h>
  15. #pragma pack(push,_CRT_PACKING)
  16. #if defined(_ENABLE_VEC_DEBUG)
  17. #include <iostream>
  18. #endif
  19. #pragma pack(pop)
  20. #ifdef __SSE__
  21. #define _MM_QW (*((__int64*)&vec))
  22. #pragma pack(push,16)
  23. class M64
  24. {
  25. protected:
  26. __m64 vec;
  27. public:
  28. M64() {}
  29. M64(__m64 mm) { vec = mm; }
  30. M64(__int64 mm) { _MM_QW = mm; }
  31. M64(int i) { vec = _m_from_int(i); }
  32. operator __m64() const { return vec; }
  33. M64& operator&=(const M64 &a) { return *this = (M64) _m_pand(vec,a); }
  34. M64& operator|=(const M64 &a) { return *this = (M64) _m_por(vec,a); }
  35. M64& operator^=(const M64 &a) { return *this = (M64) _m_pxor(vec,a); }
  36. };
  37. #pragma pack(pop)
  38. #endif /* ifdef __SSE__ */
  39. #include <dvec.h>
  40. #endif
  41. #endif