Allow 32-bit perl to generate x86_64 assembler [from -stable].
authorAndy Polyakov <appro@openssl.org>
Wed, 13 Feb 2008 20:03:01 +0000 (20:03 +0000)
committerAndy Polyakov <appro@openssl.org>
Wed, 13 Feb 2008 20:03:01 +0000 (20:03 +0000)
crypto/perlasm/x86_64-xlate.pl

index fd0295185a4ae4e9a1f9ba323f4cfe97ef325d11..a4af769b4a64d9cd9eb708c7a478239afba8db86 100755 (executable)
@@ -390,11 +390,15 @@ my $current_function;
                            && do { my @arr = split(',',$line);
                                    my $sz  = substr($1,0,1);
                                    my $last = pop(@arr);
+                                   my $conv = sub  {   my $var=shift;
+                                                       if ($var=~s/0x([0-9a-f]+)/0$1h/i) { $var; }
+                                                       else { sprintf"0%Xh",$var; }
+                                                   };  
 
                                    $sz =~ tr/bvlq/BWDQ/;
                                    $self->{value} = "\tD$sz\t";
-                                   for (@arr) { $self->{value} .= sprintf"0%Xh,",oct; }
-                                   $self->{value} .= sprintf"0%Xh",oct($last);
+                                   for (@arr) { $self->{value} .= &$conv($_).","; }
+                                   $self->{value} .= &$conv($last);
                                    last;
                                  };
                /\.picmeup/ && do { $self->{value} = sprintf"\tDD\t 0%Xh,090000000h",$opcode{$line};