Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Wim Lewis
nettle
Commits
dac00f57
Commit
dac00f57
authored
Oct 23, 2014
by
Niels Möller
Browse files
Use unsigned long arrays for memxor benchmark.
parent
94269a22
Changes
2
Hide whitespace changes
Inline
Side-by-side
ChangeLog
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.
...
...
examples/nettle-benchmark.c
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
));
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment