$nmdecor="_"; # external name decoration
$initseg="";
+$segment="";
sub ::generic
{ my ($opcode,@arg)=@_;
# fix hexadecimal constants
- $arg[0] =~ s/0x([0-9a-f]+)/0$1h/oi if (defined($arg[0]));
- $arg[1] =~ s/0x([0-9a-f]+)/0$1h/oi if (defined($arg[1]));
+ 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;
ENDIF
___
push(@out,$tmp);
+ $segment = ".text\$";
}
sub ::function_begin_B
grep {s/\.[3-7]86/$xmmheader/} @out;
}
- push(@out,".text\$ ENDS\n");
+ push(@out,"$segment ENDS\n");
if (grep {/\b${nmdecor}OPENSSL_ia32cap_P\b/i} @out)
{ my $comm=<<___;
-.bss SEGMENT
+.bss SEGMENT 'BSS'
COMM ${nmdecor}OPENSSL_ia32cap_P:DWORD
.bss ENDS
___
___
}
+sub ::dataseg
+{ push(@out,"$segment\tENDS\n_DATA\tSEGMENT\n"); $segment="_DATA"; }
+
1;