From b1b5a7584340428bda6bfe49bc881c3865cd10c9 Mon Sep 17 00:00:00 2001 From: jsg <> Date: Mon, 3 May 2010 07:22:07 +0000 Subject: When running in pic mode we don't have enough general registers for all the xcrypt inputs, hence the dance which is done to make this work. The constraint for the key however was "mr" which is both from memory and from a general register, it seems gcc3 went with the former and gcc4 went with the later in the pic case, so change the constraint for the key to just "m" which gives us more efficient code that both gcc3 and gcc4 are happy with. ok kettenis@ --- src/lib/libcrypto/engine/hw_cryptodev.c | 2 +- src/lib/libssl/src/crypto/engine/hw_cryptodev.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/libcrypto/engine/hw_cryptodev.c b/src/lib/libcrypto/engine/hw_cryptodev.c index 4af40cdfc3..de2ee1efea 100644 --- a/src/lib/libcrypto/engine/hw_cryptodev.c +++ b/src/lib/libcrypto/engine/hw_cryptodev.c @@ -623,7 +623,7 @@ viac3_xcrypt_cbc(int *cw, const void *src, void *dst, void *key, int rep, * -pic mode uses that register; so instead we must dance a little. */ __asm __volatile("pushl %%ebx; movl %0, %%ebx; rep xcrypt-cbc; popl %%ebx" : - : "mr" (key), "a" (iv), "c" (rep), "d" (cw), "S" (src), "D" (dst) + : "m" (key), "a" (iv), "c" (rep), "d" (cw), "S" (src), "D" (dst) : "memory", "cc"); } diff --git a/src/lib/libssl/src/crypto/engine/hw_cryptodev.c b/src/lib/libssl/src/crypto/engine/hw_cryptodev.c index 4af40cdfc3..de2ee1efea 100644 --- a/src/lib/libssl/src/crypto/engine/hw_cryptodev.c +++ b/src/lib/libssl/src/crypto/engine/hw_cryptodev.c @@ -623,7 +623,7 @@ viac3_xcrypt_cbc(int *cw, const void *src, void *dst, void *key, int rep, * -pic mode uses that register; so instead we must dance a little. */ __asm __volatile("pushl %%ebx; movl %0, %%ebx; rep xcrypt-cbc; popl %%ebx" : - : "mr" (key), "a" (iv), "c" (rep), "d" (cw), "S" (src), "D" (dst) + : "m" (key), "a" (iv), "c" (rep), "d" (cw), "S" (src), "D" (dst) : "memory", "cc"); } -- cgit v1.2.3-55-g6feb