Make a branch to make krunner Good Enough For Aaron™.
[kdebase/uwolfer.git] / workspace / ksplash / ksplashx / kcpuinfo.h
blob0048a1430f2db8b02246520103a81e2e6af42984
1 /*
2 * This file is part of the KDE libraries
3 * Copyright (C) 2003 Fredrik Höglund <fredrik@kde.org>
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 #ifndef __KCPUINFO_H
28 #define __KCPUINFO_H
31 /**
32 * This class provides a means for applications to obtain information at
33 * runtime about processor support for certain architecture extensions,
34 * such as MMX, SSE, 3DNow and AltiVec.
36 class KCPUInfo
38 public:
39 /**
40 * This enum contains the list of architecture extensions you
41 * can query.
43 enum Extensions {
44 IntelMMX = 1 << 0, //!< Intel's MMX instructions.
45 IntelSSE = 1 << 1, //!< Intel's SSE instructions.
46 IntelSSE2 = 1 << 2, //!< Intel's SSE2 instructions.
47 AMD3DNOW = 1 << 3, //!< AMD 3DNOW instructions
48 AltiVec = 1 << 4 //!< Motorola AltiVec instructions
51 /**
52 * Returns true if the processor supports @p extension,
53 * and false otherwise.
55 * @param extension the feature to query.
56 * @return If true, the processor supports @p extension.
57 * @see Extensions
59 static bool haveExtension( unsigned int extension )
60 { return s_features & extension; }
62 private:
63 static unsigned int s_features;
66 #endif