Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tarantool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
tarantool
Commits
379dee3d
Commit
379dee3d
authored
12 years ago
by
Roman Tsisyk
Browse files
Options
Downloads
Patches
Plain Diff
Fix Bug#1130846 "cpu_feature.m and crc32.c do not compile if a target arch is..."
parent
f7e8d056
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/cpu_feature.h
+2
-2
2 additions, 2 deletions
include/cpu_feature.h
src/cpu_feature.m
+13
-8
13 additions, 8 deletions
src/cpu_feature.m
src/crc32.c
+4
-1
4 additions, 1 deletion
src/crc32.c
with
19 additions
and
11 deletions
include/cpu_feature.h
+
2
−
2
View file @
379dee3d
...
...
@@ -39,7 +39,7 @@
*/
bool
sse42_enabled_cpu
();
#if defined (__x86_64__) || defined (__i386__)
/* Hardware-calculate CRC32 for the given data buffer.
*
* @param crc initial CRC
...
...
@@ -50,7 +50,7 @@ bool sse42_enabled_cpu();
* @return CRC32 value
*/
u_int32_t
crc32c_hw
(
u_int32_t
crc
,
const
unsigned
char
*
buf
,
unsigned
int
len
);
#endif
#endif
/* TARANTOOL_CPU_FEATURES_H */
This diff is collapsed.
Click to expand it.
src/cpu_feature.m
+
13
−
8
View file @
379dee3d
...
...
@@ -30,17 +30,17 @@
#include
<
sys
/
types
.
h
>
#include
<
errno
.
h
>
#include
<
stdlib
.
h
>
#include
<
stdbool
.
h
>
#i
f
!
defined
(
__
x86
_
64
__
)
&&
!
defined
(
__
i386
__
)
#error
"Only x86 and x86_64 architectures supported"
#
endif
#i
nclude
"cpu_feature.h"
#
if
defined
(
__
x86
_
64
__
)
||
defined
(
__
i386
__
)
#ifdef
HAVE
_
CPUID
_
H
#include
<
cpuid
.
h
>
#else
#include
<
third
_
party
/
compat
/
sys
/
cpuid
.
h
>
#endif
#include
"cpu_feature.h"
#define
SCALE
_
F
sizeof
(
unsigned
long
)
...
...
@@ -48,8 +48,6 @@
#define
REX
_
PRE
"0x48, "
#elif
defined
(
__
i386
__
)
#define
REX
_
PRE
#else
#error
"Only x86 and x86_64 architectures supported"
#endif
...
...
@@ -87,13 +85,12 @@ crc32c_hw(u_int32_t crc, const unsigned char *buf, unsigned int len)
if (iremainder) {
crc = crc32c_hw_byte(crc, (unsigned char const*)
ptmp
,
iremainder
)
;
iremainder
)
;
}
return
crc
;
}
bool
sse42
_
enabled
_
cpu
()
{
...
...
@@ -105,4 +102,12 @@ sse42_enabled_cpu()
return
(
cx
&
(
1
<<
20
))
!=
0
;
}
#else
/*
!
(
defined
(
__
x86
_
64
__
)
||
defined
(
__
i386
__
))
*/
bool
sse42
_
enabled
_
cpu
()
{
return
false
;
}
#endif
This diff is collapsed.
Click to expand it.
src/crc32.c
+
4
−
1
View file @
379dee3d
...
...
@@ -38,6 +38,9 @@ crc32_func crc32_calc = NULL;
void
crc32_init
()
{
#if defined (__x86_64__) || defined (__i386__)
crc32_calc
=
sse42_enabled_cpu
()
?
&
crc32c_hw
:
&
crc32c
;
#else
crc32_calc
=
&
crc32c
;
#endif
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment