cpu_detect.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. ////////////////////////////////////////////////////////////////////////////////
  2. ///
  3. /// A header file for detecting the Intel MMX instructions set extension.
  4. ///
  5. /// Please see 'mmx_win.cpp', 'mmx_cpp.cpp' and 'mmx_non_x86.cpp' for the
  6. /// routine implementations for x86 Windows, x86 gnu version and non-x86
  7. /// platforms, respectively.
  8. ///
  9. /// Author : Copyright (c) Olli Parviainen
  10. /// Author e-mail : oparviai 'at' iki.fi
  11. /// SoundTouch WWW: http://www.surina.net/soundtouch
  12. ///
  13. ////////////////////////////////////////////////////////////////////////////////
  14. //
  15. // License :
  16. //
  17. // SoundTouch audio processing library
  18. // Copyright (c) Olli Parviainen
  19. //
  20. // This library is free software; you can redistribute it and/or
  21. // modify it under the terms of the GNU Lesser General Public
  22. // License as published by the Free Software Foundation; either
  23. // version 2.1 of the License, or (at your option) any later version.
  24. //
  25. // This library is distributed in the hope that it will be useful,
  26. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  27. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  28. // Lesser General Public License for more details.
  29. //
  30. // You should have received a copy of the GNU Lesser General Public
  31. // License along with this library; if not, write to the Free Software
  32. // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  33. //
  34. ////////////////////////////////////////////////////////////////////////////////
  35. #ifndef _CPU_DETECT_H_
  36. #define _CPU_DETECT_H_
  37. #include "STTypes.h"
  38. #define SUPPORT_MMX 0x0001
  39. #define SUPPORT_3DNOW 0x0002
  40. #define SUPPORT_ALTIVEC 0x0004
  41. #define SUPPORT_SSE 0x0008
  42. #define SUPPORT_SSE2 0x0010
  43. /// Checks which instruction set extensions are supported by the CPU.
  44. ///
  45. /// \return A bitmask of supported extensions, see SUPPORT_... defines.
  46. uint detectCPUextensions(void);
  47. /// Disables given set of instruction extensions. See SUPPORT_... defines.
  48. void disableExtensions(uint wDisableMask);
  49. #endif // _CPU_DETECT_H_