Skip to content
Snippets Groups Projects
Commit 06c72e39 authored by Niels Möller's avatar Niels Möller
Browse files

* sparc/aes.asm (_aes_crypt): Renaming variables, allocating

locals starting from %l0.

Rev: src/nettle/sparc/aes.asm:1.29
parent 88023317
No related branches found
No related tags found
No related merge requests found
! Used registers: %l0,1 ! Used registers: %l0,1,2
! %i0,1,2,3,4,5 (%i6=%fp, %i7 = return) ! %i0,1,2,3,4,5 (%i6=%fp, %i7 = return)
! %o0,1,2,3,4,7 (%o6=%sp) ! %o0,1,2,3,4,7 (%o6=%sp)
! %g1,2,3,4 ! %g1,2,3,4
...@@ -12,14 +12,22 @@ include(`asm.m4') ...@@ -12,14 +12,22 @@ include(`asm.m4')
.type _aes_crypt,#function .type _aes_crypt,#function
.proc 020 .proc 020
! Arguments
define(ctx, %i0) define(ctx, %i0)
define(T, %i1) define(T, %i1)
define(length, %i2) define(length, %i2)
define(dst, %i3) define(dst, %i3)
define(src, %i4) define(src, %i4)
define(wtxt, %l1) ! Loop invariants
define(tmp, %l0) define(wtxt, %l0)
define(tmp, %l1)
define(nround, %l2)
! Loop variables
define(round, %l3) ! Should perhaps be 16 * round
define(i, %l4)
_aes_crypt: _aes_crypt:
! Why -136? ! Why -136?
save %sp, -136, %sp save %sp, -136, %sp
...@@ -30,6 +38,7 @@ _aes_crypt: ...@@ -30,6 +38,7 @@ _aes_crypt:
! wtxt ! wtxt
add %fp, -24, wtxt add %fp, -24, wtxt
add %fp, -40, tmp
.Lblock_loop: .Lblock_loop:
! Read src, and add initial subkey ! Read src, and add initial subkey
...@@ -82,11 +91,10 @@ _aes_crypt: ...@@ -82,11 +91,10 @@ _aes_crypt:
! bleu .Lsource_loop ! bleu .Lsource_loop
! add %o3, 4, %o3 ! add %o3, 4, %o3
ld [ctx + AES_NROUNDS], %g2 ld [ctx + AES_NROUNDS], nround
mov 1, %g1 mov 1, round
add %fp, -40, tmp ! mov %g2, %o7
mov %g2, %o7
! wtxt ! wtxt
mov wtxt, %g4 mov wtxt, %g4
...@@ -149,7 +157,7 @@ _aes_crypt: ...@@ -149,7 +157,7 @@ _aes_crypt:
bleu .Linner_loop bleu .Linner_loop
add %o3, 4, %o3 add %o3, 4, %o3
sll %g1, 4, %g2 sll round, 4, %g2
add %g2, ctx, %o0 add %g2, ctx, %o0
mov 0, %i5 mov 0, %i5
mov wtxt, %o3 mov wtxt, %o3
...@@ -164,12 +172,12 @@ _aes_crypt: ...@@ -164,12 +172,12 @@ _aes_crypt:
st %g3, [%o3+%g2] st %g3, [%o3+%g2]
bleu .Lroundkey_loop bleu .Lroundkey_loop
add %o0, 4, %o0 add %o0, 4, %o0
add %g1, 1, %g1 add round, 1, round
cmp %g1, %o7 cmp round, nround
blu .Lround_loop blu .Lround_loop
mov 0, %o3 mov 0, %o3
sll %g1, 4, %g2 sll round, 4, %g2
! final round ! final round
add %g2, ctx, %o7 add %g2, ctx, %o7
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment