projects
/
openssl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
fe150ac
)
x86_64-xlate.pl: support for binary constants, such as 0b1010101.
author
Andy Polyakov
<appro@openssl.org>
Sat, 27 Dec 2008 14:00:37 +0000
(14:00 +0000)
committer
Andy Polyakov
<appro@openssl.org>
Sat, 27 Dec 2008 14:00:37 +0000
(14:00 +0000)
crypto/perlasm/x86_64-xlate.pl
patch
|
blob
|
history
diff --git
a/crypto/perlasm/x86_64-xlate.pl
b/crypto/perlasm/x86_64-xlate.pl
index f94bbefb2635545490070a4b74115c2407d5f689..131109d84950ebf74f04de9c46b76e16e62d84e1 100755
(executable)
--- a/
crypto/perlasm/x86_64-xlate.pl
+++ b/
crypto/perlasm/x86_64-xlate.pl
@@
-195,7
+195,8
@@
my %globals;
$self->{value} =~ s/([0-9]+\s*[\*\/\%]\s*[0-9]+)/eval($1)/eg;
sprintf "\$%s",$self->{value};
} else {
$self->{value} =~ s/([0-9]+\s*[\*\/\%]\s*[0-9]+)/eval($1)/eg;
sprintf "\$%s",$self->{value};
} else {
- $self->{value} =~ s/0x([0-9a-f]+)/0$1h/ig;
+ $self->{value} =~ s/(0b[0-1]+)/oct($1)/eig;
+ $self->{value} =~ s/0x([0-9a-f]+)/0$1h/ig if ($masm);
sprintf "%s",$self->{value};
}
}
sprintf "%s",$self->{value};
}
}
@@
-574,6
+575,7
@@
my %globals;
my @arr = split(',',$line);
my $last = pop(@arr);
my $conv = sub { my $var=shift;
my @arr = split(',',$line);
my $last = pop(@arr);
my $conv = sub { my $var=shift;
+ $var=~s/(0b[0-1]+)/oct($1)/eig;
$var=~s/0x([0-9a-f]+)/0$1h/ig if ($masm);
if ($sz eq "D" && ($current_segment=~/.[px]data/ || $dir eq ".rva"))
{ $var=~s/([_a-z\$\@][_a-z0-9\$\@]*)/$nasm?"$1 wrt ..imagebase":"imagerel $1"/egi; }
$var=~s/0x([0-9a-f]+)/0$1h/ig if ($masm);
if ($sz eq "D" && ($current_segment=~/.[px]data/ || $dir eq ".rva"))
{ $var=~s/([_a-z\$\@][_a-z0-9\$\@]*)/$nasm?"$1 wrt ..imagebase":"imagerel $1"/egi; }
@@
-587,6
+589,7
@@
my %globals;
last;
};
/\.byte/ && do { my @str=split(",",$line);
last;
};
/\.byte/ && do { my @str=split(",",$line);
+ map(s/(0b[0-1]+)/oct($1)/eig,@str);
map(s/0x([0-9a-f]+)/0$1h/ig,@str) if ($masm);
while ($#str>15) {
$self->{value}.="DB\t"
map(s/0x([0-9a-f]+)/0$1h/ig,@str) if ($masm);
while ($#str>15) {
$self->{value}.="DB\t"