Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
nettle
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Dmitry Baryshkov
nettle
Commits
dac00f57
Commit
dac00f57
authored
10 years ago
by
Niels Möller
Browse files
Options
Downloads
Patches
Plain Diff
Use unsigned long arrays for memxor benchmark.
parent
94269a22
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
ChangeLog
+5
-0
5 additions, 0 deletions
ChangeLog
examples/nettle-benchmark.c
+10
-10
10 additions, 10 deletions
examples/nettle-benchmark.c
with
15 additions
and
10 deletions
ChangeLog
+
5
−
0
View file @
dac00f57
2014-10-23 Niels Möller <nisse@lysator.liu.se>
* examples/nettle-benchmark.c (time_memxor): Allocate buffers as
arrays of unsigned long, for more reliable alignment.
2014-10-22 Niels Möller <nisse@lysator.liu.se>
* configure.ac: Check for getline function.
...
...
This diff is collapsed.
Click to expand it.
examples/nettle-benchmark.c
+
10
−
10
View file @
dac00f57
...
...
@@ -157,9 +157,9 @@ bench_nothing(void *arg UNUSED)
struct
bench_memxor_info
{
uint8_t
*
dst
;
const
uint8_t
*
src
;
const
uint8_t
*
other
;
void
*
dst
;
const
void
*
src
;
const
void
*
other
;
};
static
void
...
...
@@ -345,16 +345,16 @@ static void
time_memxor
(
void
)
{
struct
bench_memxor_info
info
;
u
int8_t
src
[
BENCH_BLOCK
+
sizeof
(
long
)];
u
int8_t
other
[
BENCH_BLOCK
+
sizeof
(
long
)];
u
int8_t
dst
[
BENCH_BLOCK
];
u
nsigned
long
src
[
BENCH_BLOCK
/
sizeof
(
long
)
+
2
];
u
nsigned
long
other
[
BENCH_BLOCK
/
sizeof
(
long
)
+
2
];
u
nsigned
long
dst
[
BENCH_BLOCK
/
sizeof
(
long
)
+
1
];
info
.
src
=
src
;
info
.
dst
=
dst
;
display
(
"memxor"
,
"aligned"
,
sizeof
(
unsigned
long
),
time_function
(
bench_memxor
,
&
info
));
info
.
src
=
src
+
1
;
info
.
src
=
(
const
char
*
)
src
+
1
;
display
(
"memxor"
,
"unaligned"
,
sizeof
(
unsigned
long
),
time_function
(
bench_memxor
,
&
info
));
...
...
@@ -363,13 +363,13 @@ time_memxor(void)
display
(
"memxor3"
,
"aligned"
,
sizeof
(
unsigned
long
),
time_function
(
bench_memxor3
,
&
info
));
info
.
other
=
other
+
1
;
info
.
other
=
(
const
char
*
)
other
+
1
;
display
(
"memxor3"
,
"unaligned01"
,
sizeof
(
unsigned
long
),
time_function
(
bench_memxor3
,
&
info
));
info
.
src
=
src
+
1
;
info
.
src
=
(
const
char
*
)
src
+
1
;
display
(
"memxor3"
,
"unaligned11"
,
sizeof
(
unsigned
long
),
time_function
(
bench_memxor3
,
&
info
));
info
.
other
=
other
+
2
;
info
.
other
=
(
const
char
*
)
other
+
2
;
display
(
"memxor3"
,
"unaligned12"
,
sizeof
(
unsigned
long
),
time_function
(
bench_memxor3
,
&
info
));
}
...
...
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