summaryrefslogtreecommitdiff
path: root/armv7
diff options
context:
space:
mode:
authorNiels Möller <nisse@lysator.liu.se>2013-02-06 14:29:08 +0100
committerNiels Möller <nisse@lysator.liu.se>2013-02-06 14:29:08 +0100
commit5b6cf250d8c3efdd3d3b9397aeda7c45042a2d3a (patch)
treeb02a9ecdad55d0d5eddaaed11f539a4eef420c43 /armv7
parent18a78728fe85124856a3bd3c2ad4ccf615254bac (diff)
downloadnettle-5b6cf250d8c3efdd3d3b9397aeda7c45042a2d3a.tar.gz
ARM: Optmized aligned case of memxor3.
Diffstat (limited to 'armv7')
-rw-r--r--armv7/memxor.asm36
1 files changed, 30 insertions, 6 deletions
diff --git a/armv7/memxor.asm b/armv7/memxor.asm
index fe4f9e8a..52d4bf46 100644
--- a/armv7/memxor.asm
+++ b/armv7/memxor.asm
@@ -295,16 +295,40 @@ PROLOGUE(memxor3)
bne .Lmemxor3_au ;
C a, b and dst all have the same alignment.
+ sub AP, #4
+ sub BP, #4
+ sub DST, #4
+ tst N, #4
+ it ne
+ subne N, #4
+ bne .Lmemxor3_aligned_word_loop
-.Lmemxor3_aligned_word_loop:
- ldr r4, [AP, #-4]!
- ldr r5, [BP, #-4]!
+ ldr r4, [AP], #-4
+ ldr r5, [BP], #-4
eor r4, r5
- str r4, [DST, #-4]!
- subs N, #4
+ str r4, [DST], #-4
+ subs N, #8
+ bcc .Lmemxor3_aligned_word_end
+
+.Lmemxor3_aligned_word_loop:
+ ldr r4, [AP, #-4]
+ ldr r5, [AP], #-8
+ ldr r6, [BP, #-4]
+ ldr r7, [BP], #-8
+
+ eor r4, r6
+ eor r5, r7
+ subs N, #8
+ str r4, [DST, #-4]
+ str r5, [DST], #-8
+
bcs .Lmemxor3_aligned_word_loop
- adds N, #4
+.Lmemxor3_aligned_word_end:
+ adds N, #8
beq .Lmemxor3_done
+ add AP, #4
+ add BP, #4
+ add DST, #4
b .Lmemxor3_bytes
.Lmemxor3_uu: