]> granicus.if.org Git - openssl/commitdiff
rc4/asm/rc4-586.pl: allow for 386-only build.
authorAndy Polyakov <appro@openssl.org>
Thu, 27 Feb 2014 13:19:19 +0000 (14:19 +0100)
committerAndy Polyakov <appro@openssl.org>
Thu, 27 Feb 2014 13:28:54 +0000 (14:28 +0100)
(cherry picked from commit f861b1d4335d4017953938160c7e4e0df9af5a7b)

crypto/rc4/Makefile
crypto/rc4/asm/rc4-586.pl

index 086e60a449a48a3bdfc965cd31b8b40ae120f74e..76860aeb4bf3692777382845a53cebd0dd2b156f 100644 (file)
@@ -42,7 +42,7 @@ lib:  $(LIBOBJ)
        @touch lib
 
 rc4-586.s:     asm/rc4-586.pl ../perlasm/x86asm.pl
-       $(PERL) asm/rc4-586.pl $(PERLASM_SCHEME) $(CFLAGS) > $@
+       $(PERL) asm/rc4-586.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
 
 rc4-x86_64.s: asm/rc4-x86_64.pl
        $(PERL) asm/rc4-x86_64.pl $(PERLASM_SCHEME) > $@
index 5c9ac6ad286e21dd3e53436165dac21ea49a1c92..1d55d551e9bb0ea3aaf769a68d807809da8f22e8 100644 (file)
@@ -60,7 +60,7 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
 push(@INC,"${dir}","${dir}../../perlasm");
 require "x86asm.pl";
 
-&asm_init($ARGV[0],"rc4-586.pl");
+&asm_init($ARGV[0],"rc4-586.pl",$x86only = $ARGV[$#ARGV] eq "386");
 
 $xx="eax";
 $yy="ebx";
@@ -184,8 +184,11 @@ if ($alt=0) {
        &and    ($ty,-4);               # how many 4-byte chunks?
        &jz     (&label("loop1"));
 
-       &test   ($ty,-8);
        &mov    (&wparam(3),$out);      # $out as accumulator in these loops
+                                       if ($x86only) {
+       &jmp    (&label("go4loop4"));
+                                       } else {
+       &test   ($ty,-8);
        &jz     (&label("go4loop4"));
 
        &picmeup($out,"OPENSSL_ia32cap_P");
@@ -228,6 +231,7 @@ if ($alt=0) {
        &cmp    ($inp,&wparam(1));      # compare to input+len
        &je     (&label("done"));
        &jmp    (&label("loop1"));
+                                       }
 
 &set_label("go4loop4",16);
        &lea    ($ty,&DWP(-4,$inp,$ty));