summaryrefslogtreecommitdiffstats
path: root/crypto/rc4
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2014-02-27 14:19:19 +0100
committerAndy Polyakov <appro@openssl.org>2014-02-27 14:19:19 +0100
commitf861b1d4335d4017953938160c7e4e0df9af5a7b (patch)
treeb94a4a909fd4a83e552b05b7f365dd2420da73ea /crypto/rc4
parentfd361a67ef5e0ed953abc881aa7061a273bad9fe (diff)
rc4/asm/rc4-586.pl: allow for 386-only build.
Diffstat (limited to 'crypto/rc4')
-rw-r--r--crypto/rc4/Makefile2
-rw-r--r--crypto/rc4/asm/rc4-586.pl8
2 files changed, 7 insertions, 3 deletions
diff --git a/crypto/rc4/Makefile b/crypto/rc4/Makefile
index 3f5aaea226..e2bbaa6617 100644
--- a/crypto/rc4/Makefile
+++ b/crypto/rc4/Makefile
@@ -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) > $@
diff --git a/crypto/rc4/asm/rc4-586.pl b/crypto/rc4/asm/rc4-586.pl
index 6a3a686082..f906e093d7 100644
--- a/crypto/rc4/asm/rc4-586.pl
+++ b/crypto/rc4/asm/rc4-586.pl
@@ -63,7 +63,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";
@@ -187,8 +187,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");
@@ -231,6 +234,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));