ReactOS 0.4.15-dev-7906-g1b85a5f
fma3_available.c
Go to the documentation of this file.
1
2/*******************************************************************************
3MIT License
4-----------
5
6Copyright (c) 2002-2019 Advanced Micro Devices, Inc.
7
8Permission is hereby granted, free of charge, to any person obtaining a copy
9of this Software and associated documentaon files (the "Software"), to deal
10in the Software without restriction, including without limitation the rights
11to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12copies of the Software, and to permit persons to whom the Software is
13furnished to do so, subject to the following conditions:
14
15The above copyright notice and this permission notice shall be included in
16all copies or substantial portions of the Software.
17
18THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24THE SOFTWARE.
25*******************************************************************************/
26
27#ifdef TEST_STANDALONE
28#include <stdio.h>
29#ifdef _MSC_VER
30#pragma section (".CRT$XIC",long,read)
31#define _CRTALLOC(x) __declspec(allocate(x))
32#endif /* _MSC_VER */
33#else
34#include <intrin.h>
35#include <sect_attribs.h>
36#undef _CRTALLOC
37#define _CRTALLOC(x)
38#endif
39
40typedef int (__cdecl *_PIFV)(void); // FIXME: include process.h?
41
44
45
47{
49 return __use_fma3_lib;
50}
51
53
54_CRTALLOC(".CRT$XIC") static _PIFV init_fma3 = __fma3_lib_init;
55
56int __fma3_lib_init(void)
57{
58 int CPUID[4]; // CPUID[2] is ECX;
59
61 __cpuid(CPUID, 1);
62 if (CPUID[2] & (1 << 12)) {
64 }
65
67 return 0;
68}
#define __cdecl
Definition: accygwin.h:79
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
#define _CRTALLOC(x)
int __cdecl _set_FMA3_enable(int flag)
int __fma3_is_available
int(__cdecl * _PIFV)(void)
int __use_fma3_lib
int __fma3_lib_init(void)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean flag
Definition: glfuncs.h:52
PPC_QUAL void __cpuid(int CPUInfo[], const int InfoType)
Definition: intrin_ppc.h:682