From e84b663a933eff8834d66233ac0d6882ed918b82 Mon Sep 17 00:00:00 2001 From: Andy Polyakov Date: Tue, 12 Jul 2005 22:11:22 +0000 Subject: [PATCH] complementary x86_64-xlate.pl update. --- crypto/perlasm/x86_64-xlate.pl | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/crypto/perlasm/x86_64-xlate.pl b/crypto/perlasm/x86_64-xlate.pl index ef1a4ce656..166dcec6ac 100755 --- a/crypto/perlasm/x86_64-xlate.pl +++ b/crypto/perlasm/x86_64-xlate.pl @@ -133,6 +133,10 @@ my $current_function; my $self = shift; if (!$masm) { + # Solaris /usr/ccs/bin/as can't handle multiplications + # in $self->{value} + $self->{value} =~ s/(?{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; @@ -163,14 +167,14 @@ my $current_function; my $self = shift; my $sz = shift; + # silently convert all EAs to 64-bit, required for elder GNU + # assembler and results in more compact code + $self->{index} =~ s/^[er](.?[0-9xp])[d]?$/r\1/; + $self->{base} =~ s/^[er](.?[0-9xp])[d]?$/r\1/; if (!$masm) { - # elder GNU assembler insists on 64-bit EAs:-( - # on pros side, this results in more compact code:-) - $self->{index} =~ s/^[er](.?[0-9xp])[d]?$/r\1/; - $self->{base} =~ s/^[er](.?[0-9xp])[d]?$/r\1/; # Solaris /usr/ccs/bin/as can't handle multiplications # in $self->{label} - $self->{label} =~ s/(?{label} =~ s/(?{label} =~ s/([0-9]+\s*[\*\/\%]\s*[0-9]+)/eval($1)/eg; if (defined($self->{index})) { -- 2.25.1