From f0ddc75299076fdfeace6984b93cdf95dc504e69 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Niels=20M=C3=B6ller?= <nisse@lysator.liu.se>
Date: Wed, 15 May 2002 22:39:08 +0200
Subject: [PATCH] * sparc/aes.asm (_aes_crypt): Unrolled final loop, preparing
 for optimizations. (_aes_crypt): Eliminated i from forst copy of the loop.
 Some cleanup. (_aes_crypt): And from second copy. (_aes_crypt): And from
 third. (_aes_crypt): And fourth.

Rev: src/nettle/sparc/aes.asm:1.90
---
 sparc/aes.asm | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/sparc/aes.asm b/sparc/aes.asm
index 006cd962..2a72eaa9 100644
--- a/sparc/aes.asm
+++ b/sparc/aes.asm
@@ -419,20 +419,18 @@ define(i, round)
 	stb	t0, [dst]
 	add	dst, 4, dst
 	
-	ld	[IDX1+i], t1 	! 1
-
 	C i = 3
-	ld	[IDX1+i], t1 	! 1
+	ld	[IDX1+12], t1 	! 1
 
-	! IDX2(j) = j XOR 2
 	xor	i, 8, t2
 	add	wtxt, t1, t1	! 1
 	ldub	[t1+2], t1	! 1
 
 	ld	[wtxt+i], t0	! 0
-	lduh	[wtxt+t2], t2	! 2
+	! IDX2(j) = j XOR 2
+	lduh	[wtxt+4], t2	! 2
 	and	t0, 255, t0	! 0
-	ld	[IDX3 + i], t3	! 3
+	ld	[IDX3 + 12], t3	! 3
 	
 	and	t2, 255, t2	! 2
 	ldub	[T+t1], t1	! 1
@@ -446,7 +444,7 @@ define(i, round)
 	
 	sll	t2, 16, t2	! 2
 	or	t0, t2, t0	! 0, 1, 2
-	ld	[key + i], t2
+	ld	[key + 12], t2
 	sll	t3, 24, t3	! 3
 	
 	or	t0, t3, t0	! 0, 1, 2, 3
@@ -463,7 +461,7 @@ define(i, round)
 	stb	t0, [dst]
 	add	dst, 4, dst
 	
-	ld	[IDX1+i], t1 	! 1
+	C ld	[IDX1+i], t1 	! 1
 			
 	C Unrolled final loop ends
 	
-- 
GitLab