rc4-x86_64 portability fix.
authorAndy Polyakov <appro@openssl.org>
Sat, 12 Jan 2008 11:29:45 +0000 (11:29 +0000)
committerAndy Polyakov <appro@openssl.org>
Sat, 12 Jan 2008 11:29:45 +0000 (11:29 +0000)
crypto/perlasm/x86_64-xlate.pl
crypto/rc4/asm/rc4-x86_64.pl

index 19d3725..14b6e35 100755 (executable)
@@ -82,12 +82,12 @@ my $current_function;
            $line = substr($line,@+[0]); $line =~ s/^\s+//;
 
            undef $self->{sz};
-           if ($self->{op} =~ /(movz)b.*/) {   # movz is pain...
+           if ($self->{op} =~ /^(movz)b.*/) {  # movz is pain...
                $self->{op} = $1;
                $self->{sz} = "b";
            } elsif ($self->{op} =~ /call/) {
                $self->{sz} = ""
-           } elsif ($self->{op} =~ /([a-z]{3,})([qlwb])/) {
+           } elsif ($self->{op} =~ /([a-z]{3,})([qlwb])$/) {
                $self->{op} = $1;
                $self->{sz} = $2;
            }
@@ -113,7 +113,7 @@ my $current_function;
                "$self->{op}$self->{sz}";
            }
        } else {
-           $self->{op} =~ s/movz/movzx/;
+           $self->{op} =~ s/^movz/movzx/;
            if ($self->{op} eq "ret") {
                $self->{op} = "";
                if ($current_function->{abi} eq "svr4") {
index 2d47320..c2af310 100755 (executable)
@@ -167,7 +167,7 @@ $code.=<<___;
        movzb   ($dat,$XX[0]),$TX[0]#d
        test    \$-8,$len
        jz      .Lcloop1
-       cmp     \$0,260($dat)
+       cmpl    \$0,260($dat)
        jnz     .Lcloop1
        push    %rbx
        jmp     .Lcloop8