Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
zeus
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
AxioDL
zeus
Compare Revisions
bf416af1edc715f73d3d363d0d9f40c33b657dc3...c70243ff3277bca77aad6ef8f445c998b2225d1d
Source
c70243ff3277bca77aad6ef8f445c998b2225d1d
Select Git revision
...
Target
bf416af1edc715f73d3d363d0d9f40c33b657dc3
Select Git revision
Compare
Commits (2)
Add SSE4a CPUID check
· c3671245
encounter
authored
Dec 10, 2019
c3671245
Merge pull request #21 from encounter/sse4a
· c70243ff
Phillip Stephens
authored
Dec 10, 2019
Add SSE4a CPUID check
c70243ff
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
src/Math.cpp
src/Math.cpp
+7
-1
No files found.
src/Math.cpp
View file @
c70243ff
...
...
@@ -54,7 +54,8 @@ void detectCPU() {
*
reinterpret_cast
<
int
*>
((
char
*
)
g_cpuFeatures
.
cpuVendor
+
4
)
=
regs
[
3
];
*
reinterpret_cast
<
int
*>
((
char
*
)
g_cpuFeatures
.
cpuVendor
+
8
)
=
regs
[
2
];
getCpuInfo
(
0x80000000
,
regs
);
if
(
regs
[
0
]
>=
0x80000004
)
{
int
maxExtended
=
regs
[
0
];
if
(
maxExtended
>=
0x80000004
)
{
for
(
unsigned
int
i
=
0x80000002
;
i
<=
0x80000004
;
i
++
)
{
getCpuInfo
(
i
,
regs
);
// Interpret CPU brand string and cache information.
...
...
@@ -84,6 +85,11 @@ void detectCPU() {
memset
((
bool
*
)
&
g_cpuFeatures
.
AVX2
,
((
regs
[
1
]
&
0x00000020
)
!=
0
),
1
);
}
if
(
maxExtended
>=
0x80000001
)
{
getCpuInfo
(
0x80000001
,
regs
);
memset
((
bool
*
)
&
g_cpuFeatures
.
SSE4a
,
((
regs
[
2
]
&
(
1
<<
6
))
!=
0
),
1
);
}
isCPUInit
=
true
;
#endif
}
...
...