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
Dmitry Baryshkov
nettle
Commits
5ce02c32
Commit
5ce02c32
authored
Oct 23, 2014
by
Niels Möller
Browse files
Two-way unrolling of aligned memxor3.
parent
b6a47ff5
Changes
2
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
5ce02c32
...
...
@@ -2,6 +2,7 @@
* memxor.c (memxor_common_alignment, memxor_different_alignment)
(memxor): Change loop order, iterate from the end.
(memxor3_common_alignment): Unroll twice.
* examples/nettle-benchmark.c (time_memxor): Allocate buffers as
arrays of unsigned long, for more reliable alignment.
...
...
memxor.c
View file @
5ce02c32
...
...
@@ -166,8 +166,17 @@ memxor3_common_alignment (word_t *dst,
const
word_t
*
a
,
const
word_t
*
b
,
size_t
n
)
{
/* FIXME: Require n > 0? */
while
(
n
--
>
0
)
dst
[
n
]
=
a
[
n
]
^
b
[
n
];
if
(
n
&
1
)
{
n
--
;
dst
[
n
]
=
a
[
n
]
^
b
[
n
];
}
while
(
n
>
0
)
{
n
-=
2
;
dst
[
n
+
1
]
=
a
[
n
+
1
]
^
b
[
n
+
1
];
dst
[
n
]
=
a
[
n
]
^
b
[
n
];
}
}
static
void
...
...
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