[openssl-commits] [openssl] OpenSSL_1_1_0-stable update

Andy Polyakov appro at openssl.org
Fri Nov 11 12:29:00 UTC 2016


The branch OpenSSL_1_1_0-stable has been updated
       via  0f251d20a5c40cb9b6d30dfec005bb4ead3d5b0f (commit)
      from  1cb83aff0e7e27f027fbe4fdf1b6c101ce4cff00 (commit)


- Log -----------------------------------------------------------------
commit 0f251d20a5c40cb9b6d30dfec005bb4ead3d5b0f
Author: Andy Polyakov <appro at openssl.org>
Date:   Tue Nov 8 11:11:58 2016 +0100

    chacha/asm/chacha-x86.pl: improve [backward] portability.
    
    In order to minimize dependency on assembler version a number of
    post-SSE2 instructions are encoded manually. But in order to simplify
    the procedure only register operands are considered. Non-register
    operands are passed down to assembler. Module in question uses pshufb
    with memory operands, and old [GNU] assembler can't handle it.
    Fortunately in this case it's possible skip just the problematic
    segment without skipping SSSE3 support altogether.
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    (cherry picked from commit d89773d659129368a341df746476da445d47ad31)

-----------------------------------------------------------------------

Summary of changes:
 crypto/chacha/asm/chacha-x86.pl | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/crypto/chacha/asm/chacha-x86.pl b/crypto/chacha/asm/chacha-x86.pl
index f00b7d2..61b3286 100755
--- a/crypto/chacha/asm/chacha-x86.pl
+++ b/crypto/chacha/asm/chacha-x86.pl
@@ -50,7 +50,7 @@ for (@ARGV) { $xmm=1 if (/-DOPENSSL_IA32_SSE2/); }
 $ymm=1 if ($xmm &&
 		`$ENV{CC} -Wa,-v -c -o /dev/null -x assembler /dev/null 2>&1`
 			=~ /GNU assembler version ([2-9]\.[0-9]+)/ &&
-		$1>=2.19);	# first version supporting AVX
+		($gasver=$1)>=2.19);	# first version supporting AVX
 
 $ymm=1 if ($xmm && !$ymm && $ARGV[0] eq "win32n" &&
 		`nasm -v 2>&1` =~ /NASM version ([2-9]\.[0-9]+)/ &&
@@ -465,6 +465,12 @@ if ($ymm) {
 				    &label("pic_point"),"eax"));
 	&movdqu		("xmm3",&QWP(0,"ebx"));		# counter and nonce
 
+if (defined($gasver) && $gasver>=2.17) {		# even though we encode
+							# pshufb manually, we
+							# handle only register
+							# operands, while this
+							# segment uses memory
+							# operand...
 	&cmp		($len,64*4);
 	&jb		(&label("1x"));
 
@@ -646,6 +652,7 @@ if ($ymm) {
 	&paddd		("xmm2",&QWP(16*6,"eax"));	# +four
 	&pand		("xmm3",&QWP(16*7,"eax"));
 	&por		("xmm3","xmm2");		# counter value
+}
 {
 my ($a,$b,$c,$d,$t,$t1,$rot16,$rot24)=map("xmm$_",(0..7));
 


More information about the openssl-commits mailing list