summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorappro <appro>2012-01-25 17:56:08 +0000
committerappro <appro>2012-01-25 17:56:08 +0000
commit6cb83cb33dcb0174abcc37c1f0f8bf757ad52547 (patch)
tree735e28585cc80a8718f6063ec7f96b2e95f79fdc
parent1a210b7b69924dd0a480acd02b309e5a30137a59 (diff)
downloadopenssl-6cb83cb33dcb0174abcc37c1f0f8bf757ad52547.tar.gz
ghash-x86.pl: engage original MMX version in no-sse2 builds.
-rw-r--r--crypto/modes/asm/ghash-x86.pl2
-rw-r--r--crypto/modes/gcm128.c4
2 files changed, 5 insertions, 1 deletions
diff --git a/crypto/modes/asm/ghash-x86.pl b/crypto/modes/asm/ghash-x86.pl
index 1b9adfbc7..6b09669d4 100644
--- a/crypto/modes/asm/ghash-x86.pl
+++ b/crypto/modes/asm/ghash-x86.pl
@@ -331,7 +331,7 @@ if (!$x86only) {{{
&static_label("rem_4bit");
-if (0) {{ # "May" MMX version is kept for reference...
+if (!$sse2) {{ # pure-MMX "May" version...
$S=12; # shift factor for rem_4bit
diff --git a/crypto/modes/gcm128.c b/crypto/modes/gcm128.c
index e638e42be..f77aa972b 100644
--- a/crypto/modes/gcm128.c
+++ b/crypto/modes/gcm128.c
@@ -726,7 +726,11 @@ void CRYPTO_gcm128_init(GCM128_CONTEXT *ctx,void *key,block128_f block)
# endif
gcm_init_4bit(ctx->Htable,ctx->H.u);
# if defined(GHASH_ASM_X86) /* x86 only */
+# if defined(OPENSSL_IA32_SSE2)
+ if (OPENSSL_ia32cap_P[0]&(1<<25)) { /* check SSE bit */
+# else
if (OPENSSL_ia32cap_P[0]&(1<<23)) { /* check MMX bit */
+# endif
ctx->gmult = gcm_gmult_4bit_mmx;
ctx->ghash = gcm_ghash_4bit_mmx;
} else {