Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/openal-0.0.8/src/arch/i386/x86_cpu_caps_prk.h @ 17

Last change on this file since 17 was 17, checked in by landauf, 17 years ago

added openal

File size: 2.7 KB
Line 
1/***************************************************************************
2 *   Copyright (C) 2005 by Prakash Punnoor                                 *
3 *   prakash@punnoor.de                                                    *
4 *                                                                         *
5 *   This program is free software; you can redistribute it and/or modify  *
6 *   it under the terms of the GNU Library General Public License as       *
7 *   published by the Free Software Foundation; either version 2 of the    *
8 *   License, or (at your option) any later version.                       *
9 *                                                                         *
10 *   This program is distributed in the hope that it will be useful,       *
11 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
12 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
13 *   GNU General Public License for more details.                          *
14 *                                                                         *
15 *   You should have received a copy of the GNU Library General Public     *
16 *   License along with this program; if not, write to the                 *
17 *   Free Software Foundation, Inc.,                                       *
18 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
19 ***************************************************************************/
20#ifndef X86_CPU_CAPS_H
21#define X86_CPU_CAPS_H
22
23struct x86cpu_caps_s {
24        int mmx;
25        int sse;
26        int sse2;
27        int sse3;
28        int amd_3dnow;
29        int amd_3dnowext;
30        int amd_sse_mmx;
31        int cyrix_mmxext;
32};
33
34extern struct x86cpu_caps_s x86cpu_caps;
35extern struct x86cpu_caps_s x86cpu_caps_use;
36
37static __inline int _alHaveMMX(void);
38static __inline int _alHaveSSE(void);
39static __inline int _alHaveSSE2(void);
40static __inline int _alHaveSSE3(void);
41static __inline int _alHave3DNOW(void);
42static __inline int _alHave3DNOWEXT(void);
43static __inline int _alHaveSSEMMX(void);
44
45
46static __inline int _alHaveMMX(void)
47{
48        return x86cpu_caps.mmx & x86cpu_caps_use.mmx;
49}
50
51static __inline int _alHaveSSE(void)
52{
53        return x86cpu_caps.sse & x86cpu_caps_use.sse;
54}
55
56static __inline int _alHaveSSE2(void)
57{
58        return x86cpu_caps.sse2 & x86cpu_caps_use.sse2;
59}
60
61static __inline int _alHaveSSE3(void)
62{
63        return x86cpu_caps.sse3 & x86cpu_caps_use.sse3;
64}
65
66static __inline int _alHave3DNOW(void)
67{
68        return x86cpu_caps.amd_3dnow & x86cpu_caps_use.amd_3dnow;
69}
70
71static __inline int _alHave3DNOWEXT(void)
72{
73        return x86cpu_caps.amd_3dnowext & x86cpu_caps_use.amd_3dnowext;
74}
75
76static __inline int _alHaveSSEMMX(void)
77{
78        return x86cpu_caps.amd_sse_mmx & x86cpu_caps_use.amd_sse_mmx;
79}
80
81#endif /* X86_CPU_CAPS_H */
Note: See TracBrowser for help on using the repository browser.