From 8e92b1b9ce824262a76fb555bbd5c0425d9c12cf Mon Sep 17 00:00:00 2001 From: Andy Polyakov Date: Tue, 5 May 2009 19:21:12 +0000 Subject: [PATCH] perlasm: update from HEAD. --- crypto/perlasm/x86_64-xlate.pl | 6 ++++-- crypto/perlasm/x86masm.pl | 8 +++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/crypto/perlasm/x86_64-xlate.pl b/crypto/perlasm/x86_64-xlate.pl index 131109d849..c09c3216ad 100755 --- a/crypto/perlasm/x86_64-xlate.pl +++ b/crypto/perlasm/x86_64-xlate.pl @@ -575,8 +575,8 @@ my %globals; 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); + $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; @@ -662,6 +662,7 @@ while($line=<>) { $insn = $opcode->out($#args>=1?$args[$#args]->size():$sz); } else { $insn = $opcode->out(); + $insn .= $sz if (map($_->out() =~ /xmm|mmx/,@args)); @args = reverse(@args); undef $sz if ($nasm && $opcode->mnemonic() eq "lea"); } @@ -831,6 +832,7 @@ close STDOUT; # CONTEXT.R14 232 # CONTEXT.R15 240 # CONTEXT.Rip 248 +# CONTEXT.Xmm6 512 # sizeof(CONTEXT) 1232 # DISPATCHER_CONTEXT.ControlPc 0 # DISPATCHER_CONTEXT.ImageBase 8 diff --git a/crypto/perlasm/x86masm.pl b/crypto/perlasm/x86masm.pl index 4eca7bc367..30774f0a25 100644 --- a/crypto/perlasm/x86masm.pl +++ b/crypto/perlasm/x86masm.pl @@ -16,9 +16,11 @@ sub ::generic # fix hexadecimal constants for (@arg) { s/0x([0-9a-f]+)/0$1h/oi; } - # 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); + if ($opcode !~ /movq/) + { # 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); + } &::emit($opcode,@arg); 1; -- 2.25.1