Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libcrypto/arch/i386 avoid bswapl, which is post-i486 (in...
details: https://anonhg.NetBSD.org/src/rev/704c3eff8cae
branches: trunk
changeset: 555299:704c3eff8cae
user: itojun <itojun%NetBSD.org@localhost>
date: Thu Nov 13 19:36:31 2003 +0000
description:
avoid bswapl, which is post-i486 (including i486) insn. markus@openbsd
diffstat:
lib/libcrypto/arch/i386/sha1_586.S | 98 +++++++++++++++++++++++++------------
1 files changed, 65 insertions(+), 33 deletions(-)
diffs (140 lines):
diff -r c53976fe8a6b -r 704c3eff8cae lib/libcrypto/arch/i386/sha1_586.S
--- a/lib/libcrypto/arch/i386/sha1_586.S Thu Nov 13 15:53:31 2003 +0000
+++ b/lib/libcrypto/arch/i386/sha1_586.S Thu Nov 13 19:36:31 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sha1_586.S,v 1.1 2003/11/13 02:10:00 itojun Exp $ */
+/* $NetBSD: sha1_586.S,v 1.2 2003/11/13 19:36:31 itojun Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay%cryptsoft.com@localhost)
* All rights reserved.
@@ -85,66 +85,98 @@
/* First, load the words onto the stack in network byte order */
movl (%esi), %eax
movl 4(%esi), %ecx
-.byte 15
-.byte 200 /* bswapl %eax */
-.byte 15
-.byte 201 /* bswapl %ecx */
+ /* bswapl eax */
+ xchg %al, %ah
+ rorl $16, %eax
+ xchg %al, %ah
+ /* bswapl ecx */
+ xchg %cl, %ch
+ rorl $16, %ecx
+ xchg %cl, %ch
movl %eax, (%esp)
movl %ecx, 4(%esp)
movl 8(%esi), %eax
movl 12(%esi), %ecx
-.byte 15
-.byte 200 /* bswapl %eax */
-.byte 15
-.byte 201 /* bswapl %ecx */
+ /* bswapl eax */
+ xchg %al, %ah
+ rorl $16, %eax
+ xchg %al, %ah
+ /* bswapl ecx */
+ xchg %cl, %ch
+ rorl $16, %ecx
+ xchg %cl, %ch
movl %eax, 8(%esp)
movl %ecx, 12(%esp)
movl 16(%esi), %eax
movl 20(%esi), %ecx
-.byte 15
-.byte 200 /* bswapl %eax */
-.byte 15
-.byte 201 /* bswapl %ecx */
+ /* bswapl eax */
+ xchg %al, %ah
+ rorl $16, %eax
+ xchg %al, %ah
+ /* bswapl ecx */
+ xchg %cl, %ch
+ rorl $16, %ecx
+ xchg %cl, %ch
movl %eax, 16(%esp)
movl %ecx, 20(%esp)
movl 24(%esi), %eax
movl 28(%esi), %ecx
-.byte 15
-.byte 200 /* bswapl %eax */
-.byte 15
-.byte 201 /* bswapl %ecx */
+ /* bswapl eax */
+ xchg %al, %ah
+ rorl $16, %eax
+ xchg %al, %ah
+ /* bswapl ecx */
+ xchg %cl, %ch
+ rorl $16, %ecx
+ xchg %cl, %ch
movl %eax, 24(%esp)
movl %ecx, 28(%esp)
movl 32(%esi), %eax
movl 36(%esi), %ecx
-.byte 15
-.byte 200 /* bswapl %eax */
-.byte 15
-.byte 201 /* bswapl %ecx */
+ /* bswapl eax */
+ xchg %al, %ah
+ rorl $16, %eax
+ xchg %al, %ah
+ /* bswapl ecx */
+ xchg %cl, %ch
+ rorl $16, %ecx
+ xchg %cl, %ch
movl %eax, 32(%esp)
movl %ecx, 36(%esp)
movl 40(%esi), %eax
movl 44(%esi), %ecx
-.byte 15
-.byte 200 /* bswapl %eax */
-.byte 15
-.byte 201 /* bswapl %ecx */
+ /* bswapl eax */
+ xchg %al, %ah
+ rorl $16, %eax
+ xchg %al, %ah
+ /* bswapl ecx */
+ xchg %cl, %ch
+ rorl $16, %ecx
+ xchg %cl, %ch
movl %eax, 40(%esp)
movl %ecx, 44(%esp)
movl 48(%esi), %eax
movl 52(%esi), %ecx
-.byte 15
-.byte 200 /* bswapl %eax */
-.byte 15
-.byte 201 /* bswapl %ecx */
+ /* bswapl eax */
+ xchg %al, %ah
+ rorl $16, %eax
+ xchg %al, %ah
+ /* bswapl ecx */
+ xchg %cl, %ch
+ rorl $16, %ecx
+ xchg %cl, %ch
movl %eax, 48(%esp)
movl %ecx, 52(%esp)
movl 56(%esi), %eax
movl 60(%esi), %ecx
-.byte 15
-.byte 200 /* bswapl %eax */
-.byte 15
-.byte 201 /* bswapl %ecx */
+ /* bswapl eax */
+ xchg %al, %ah
+ rorl $16, %eax
+ xchg %al, %ah
+ /* bswapl ecx */
+ xchg %cl, %ch
+ rorl $16, %ecx
+ xchg %cl, %ch
movl %eax, 56(%esp)
movl %ecx, 60(%esp)
/* We now have the X array on the stack */
Home |
Main Index |
Thread Index |
Old Index