1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
11 #include <tools/cpuid.hxx>
23 void getCpuId(uint32_t array
[4])
25 __cpuid(reinterpret_cast<int*>(array
), 1);
28 #if (defined(__i386__) || defined(__x86_64__))
30 void getCpuId(uint32_t array
[4])
32 __get_cpuid(1, array
+ 0, array
+ 1, array
+ 2, array
+ 3);
35 void getCpuId(uint32_t array
[4])
37 array
[0] = array
[1] = array
[2] = array
[3] = 0;
43 #if defined(LO_SSE2_AVAILABLE)
47 uint32_t cpuInfoArray
[] = {0, 0, 0, 0};
48 getCpuId(cpuInfoArray
);
49 return (cpuInfoArray
[3] & (1 << 26)) != 0;
54 bool hasSSE2() { return false; }
58 bool hasHyperThreading()
60 uint32_t cpuInfoArray
[] = {0, 0, 0, 0};
61 getCpuId(cpuInfoArray
);
62 return (cpuInfoArray
[3] & (1 << 28)) != 0;
69 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */