Skip to content

Commit

Permalink
perlasm/x86masm.pl: make it work.
Browse files Browse the repository at this point in the history
Though this doesn't mean that masm becomes supported, the script is
still provided on don't-ask-in-case-of-doubt-use-nasm basis.
See RT#3650 for background.

Reviewed-by: Matt Caswell <matt@openssl.org>
  • Loading branch information
Andy Polyakov committed Feb 22, 2015
1 parent 3372c4f commit 2f8d82d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions crypto/perlasm/x86masm.pl
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ sub ::generic

if ($opcode =~ /lea/ && @arg[1] =~ s/.*PTR\s+(\(.*\))$/OFFSET $1/) # no []
{ $opcode="mov"; }
elsif ($opcode !~ /movq/)
elsif ($opcode !~ /mov[dq]$/)
{ # fix xmm references
$arg[0] =~ s/\b[A-Z]+WORD\s+PTR/XMMWORD PTR/i if ($arg[1]=~/\bxmm[0-7]\b/i);
$arg[1] =~ s/\b[A-Z]+WORD\s+PTR/XMMWORD PTR/i if ($arg[0]=~/\bxmm[0-7]\b/i);
$arg[0] =~ s/\b[A-Z]+WORD\s+PTR/XMMWORD PTR/i if ($arg[-1]=~/\bxmm[0-7]\b/i);
$arg[-1] =~ s/\b[A-Z]+WORD\s+PTR/XMMWORD PTR/i if ($arg[0]=~/\bxmm[0-7]\b/i);
}

&::emit($opcode,@arg);
Expand Down Expand Up @@ -160,13 +160,13 @@ sub ::public_label
{ push(@out,"PUBLIC\t".&::LABEL($_[0],$nmdecor.$_[0])."\n"); }
sub ::data_byte
{ push(@out,("DB\t").join(',',@_)."\n"); }
{ push(@out,("DB\t").join(',',splice(@_,0,16))."\n") while(@_); }
sub ::data_short
{ push(@out,("DW\t").join(',',@_)."\n"); }
{ push(@out,("DW\t").join(',',splice(@_,0,8))."\n") while(@_); }
sub ::data_word
{ push(@out,("DD\t").join(',',@_)."\n"); }
{ push(@out,("DD\t").join(',',splice(@_,0,4))."\n") while(@_); }
sub ::align
{ push(@out,"ALIGN\t$_[0]\n"); }
Expand Down

0 comments on commit 2f8d82d

Please sign in to comment.