]> granicus.if.org Git - openssl/commitdiff
ghash-x86.pl: engage original MMX version in no-sse2 builds.
authorAndy Polyakov <appro@openssl.org>
Wed, 25 Jan 2012 17:56:08 +0000 (17:56 +0000)
committerAndy Polyakov <appro@openssl.org>
Wed, 25 Jan 2012 17:56:08 +0000 (17:56 +0000)
crypto/modes/asm/ghash-x86.pl
crypto/modes/gcm128.c

index 1b9adfbc72e040fbabbce60badf9bf12f0bce69b..6b09669d474abbc55c8643b4460f0b6de770eab6 100644 (file)
@@ -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
 
index e638e42be857fdc8bf82bc1ac34012b65cffad3b..f77aa972bab47601774600edfbb73f9e9d892479 100644 (file)
@@ -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 {