From 9a95e940362d2d28e7bb9da7a9e5ec5de13dda93 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Niels=20M=C3=B6ller?= <nisse@lysator.liu.se>
Date: Thu, 16 May 2002 01:31:18 +0200
Subject: [PATCH] Work in progress, source loop unrolling.

Rev: src/nettle/sparc/aes.asm:1.114
---
 sparc/aes.asm | 48 +++++++++++++++++++++++++-----------------------
 1 file changed, 25 insertions(+), 23 deletions(-)

diff --git a/sparc/aes.asm b/sparc/aes.asm
index f7f87dfa..cb63816e 100644
--- a/sparc/aes.asm
+++ b/sparc/aes.asm
@@ -66,14 +66,14 @@ define(t3, %o3)
 C AES_LOAD(i)
 C Get one word of input, XOR with first subkey, store in wtxt
 define(<AES_LOAD>, <
-	ldub	[src+$1+3], t3
-	ldub	[src+$1+2], t2
+	ldub	[src+3], t3
+	ldub	[src+2], t2
 	sll	t3, 24, t3
-	ldub	[src+$1+1], t1
+	ldub	[src+1], t1
 	
 	sll	t2, 16, t2
 	or	t3, t2, t3
-	ldub	[src+$1], t0
+	ldub	[src+0], t0
 	sll	t1, 8, t1
 	
 	! Get subkey
@@ -254,26 +254,28 @@ C .Lsource_loop:
 	C add	src, 4, src
 
 	C i = 1
-	ldub	[src+3], t3
-	ldub	[src+2], t2
-	sll	t3, 24, t3
-	ldub	[src+1], t1
-	
-	sll	t2, 16, t2
-	or	t3, t2, t3
-	ldub	[src], t0
-	sll	t1, 8, t1
-	
-	! Get subkey
-	ld	[ctx + 4], t2
-	or	t3, t1, t3
-	or	t3, t0, t3
-	xor	t3, t2, t3
+	AES_LOAD(4)
+	C ldub	[src+3], t3
+	C ldub	[src+2], t2
+	C sll	t3, 24, t3
+	C ldub	[src+1], t1
+	C 
+	C sll	t2, 16, t2
+	C or	t3, t2, t3
+	C ldub	[src], t0
+	C sll	t1, 8, t1
+	C 
+	C ! Get subkey
+	C ld	[ctx + 4], t2
+	C or	t3, t1, t3
+	C or	t3, t0, t3
+	C xor	t3, t2, t3
+	C 
+	C C cmp	src, %g1
+	C st	t3, [wtxt + 4]
+	C C bleu	.Lsource_loop
+	C add	src, 4, src
 	
-	C cmp	src, %g1
-	st	t3, [wtxt + 4]
-	C bleu	.Lsource_loop
-	add	src, 4, src
 	C i = 2
 	ldub	[src+3], t3
 	ldub	[src+2], t2
-- 
GitLab