Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
154bcd88
Kaydet (Commit)
154bcd88
authored
Kas 13, 2015
tarafından
Tomaž Vajngerl
Kaydeden (comit)
Tomaž Vajngerl
Kas 13, 2015
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
tools: runtime SSE/SSE2 detection
Change-Id: I29330061e2986ec2ae899c2f3a63d0eadd9cc194
üst
d5c28d26
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
92 additions
and
0 deletions
+92
-0
cpuid.hxx
include/tools/cpuid.hxx
+28
-0
Library_tl.mk
tools/Library_tl.mk
+1
-0
cpuid.cxx
tools/source/misc/cpuid.cxx
+63
-0
No files found.
include/tools/cpuid.hxx
0 → 100644
Dosyayı görüntüle @
154bcd88
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*/
#ifndef INCLUDED_TOOLS_CPUID_HXX
#define INCLUDED_TOOLS_CPUID_HXX
#include <sal/config.h>
#include <tools/toolsdllapi.h>
namespace
tools
{
namespace
cpuid
{
TOOLS_DLLPUBLIC
bool
hasSSE
();
TOOLS_DLLPUBLIC
bool
hasSSE2
();
}
}
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
tools/Library_tl.mk
Dosyayı görüntüle @
154bcd88
...
...
@@ -69,6 +69,7 @@ $(eval $(call gb_Library_add_exception_objects,tl,\
tools/source/memtools/multisel \
tools/source/memtools/unqidx \
tools/source/misc/appendunixshellword \
tools/source/misc/cpuid \
tools/source/misc/extendapplicationenvironment \
tools/source/misc/getprocessworkingdir \
tools/source/misc/solarmutex \
...
...
tools/source/misc/cpuid.cxx
0 → 100644
Dosyayı görüntüle @
154bcd88
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*/
#include <tools/cpuid.hxx>
#include <cstdint>
namespace
tools
{
namespace
cpuid
{
// First minimize to MSVC / GCC compat. compiler and x86 / x64 architecture
#if (defined(_MSC_VER) && (defined(_M_X64) || defined(_M_IX86))) || (defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)))
namespace
{
#if defined(_MSC_VER)
#include <intrin.h>
static
void
getCpuId
(
uint32_t
array
[
4
])
{
__cpuid
((
int
*
)
array
,
1
);
}
#else
#include <cpuid.h>
static
void
getCpuId
(
uint32_t
array
[
4
])
{
__get_cpuid
(
1
,
array
+
0
,
array
+
1
,
array
+
2
,
array
+
3
);
}
#endif
}
bool
hasSSE
()
{
uint32_t
cpuInfoArray
[]
=
{
0
,
0
,
0
,
0
};
getCpuId
(
cpuInfoArray
);
return
(
cpuInfoArray
[
3
]
&
(
1
<<
25
))
!=
0
;
}
bool
hasSSE2
()
{
uint32_t
cpuInfoArray
[]
=
{
0
,
0
,
0
,
0
};
getCpuId
(
cpuInfoArray
);
return
(
cpuInfoArray
[
3
]
&
(
1
<<
26
))
!=
0
;
}
#else
bool
hasSSE
()
{
return
false
;
}
bool
hasSSE2
()
{
return
false
;
}
#endif
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment