summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/perlasm
diff options
context:
space:
mode:
authordjm <>2012-10-13 21:23:57 +0000
committerdjm <>2012-10-13 21:23:57 +0000
commitc93077289f634e6f9f13ab48bc059773ac806130 (patch)
treef9ec86d879ac4a66f08398373cfe233c8d41851a /src/lib/libcrypto/perlasm
parentd56dbc3c72494d4b68c03f5bcc3ae1f9df7b17df (diff)
parent0f4e59be0458751f14ec603610fb285ff9737a1c (diff)
downloadopenbsd-c93077289f634e6f9f13ab48bc059773ac806130.tar.gz
openbsd-c93077289f634e6f9f13ab48bc059773ac806130.tar.bz2
openbsd-c93077289f634e6f9f13ab48bc059773ac806130.zip
This commit was generated by cvs2git to track changes on a CVS vendor
branch.
Diffstat (limited to 'src/lib/libcrypto/perlasm')
-rw-r--r--src/lib/libcrypto/perlasm/x86masm.pl19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/lib/libcrypto/perlasm/x86masm.pl b/src/lib/libcrypto/perlasm/x86masm.pl
index 3d50e4a786..96b1b73e1a 100644
--- a/src/lib/libcrypto/perlasm/x86masm.pl
+++ b/src/lib/libcrypto/perlasm/x86masm.pl
@@ -14,9 +14,11 @@ sub ::generic
14{ my ($opcode,@arg)=@_; 14{ my ($opcode,@arg)=@_;
15 15
16 # fix hexadecimal constants 16 # fix hexadecimal constants
17 for (@arg) { s/0x([0-9a-f]+)/0$1h/oi; } 17 for (@arg) { s/(?<![\w\$\.])0x([0-9a-f]+)/0$1h/oi; }
18 18
19 if ($opcode !~ /movq/) 19 if ($opcode =~ /lea/ && @arg[1] =~ s/.*PTR\s+(\(.*\))$/OFFSET $1/) # no []
20 { $opcode="mov"; }
21 elsif ($opcode !~ /movq/)
20 { # fix xmm references 22 { # fix xmm references
21 $arg[0] =~ s/\b[A-Z]+WORD\s+PTR/XMMWORD PTR/i if ($arg[1]=~/\bxmm[0-7]\b/i); 23 $arg[0] =~ s/\b[A-Z]+WORD\s+PTR/XMMWORD PTR/i if ($arg[1]=~/\bxmm[0-7]\b/i);
22 $arg[1] =~ s/\b[A-Z]+WORD\s+PTR/XMMWORD PTR/i if ($arg[0]=~/\bxmm[0-7]\b/i); 24 $arg[1] =~ s/\b[A-Z]+WORD\s+PTR/XMMWORD PTR/i if ($arg[0]=~/\bxmm[0-7]\b/i);
@@ -65,6 +67,7 @@ sub get_mem
65 $ret; 67 $ret;
66} 68}
67sub ::BP { &get_mem("BYTE",@_); } 69sub ::BP { &get_mem("BYTE",@_); }
70sub ::WP { &get_mem("WORD",@_); }
68sub ::DWP { &get_mem("DWORD",@_); } 71sub ::DWP { &get_mem("DWORD",@_); }
69sub ::QWP { &get_mem("QWORD",@_); } 72sub ::QWP { &get_mem("QWORD",@_); }
70sub ::BC { "@_"; } 73sub ::BC { "@_"; }
@@ -129,7 +132,7 @@ ___
129 if (grep {/\b${nmdecor}OPENSSL_ia32cap_P\b/i} @out) 132 if (grep {/\b${nmdecor}OPENSSL_ia32cap_P\b/i} @out)
130 { my $comm=<<___; 133 { my $comm=<<___;
131.bss SEGMENT 'BSS' 134.bss SEGMENT 'BSS'
132COMM ${nmdecor}OPENSSL_ia32cap_P:DWORD 135COMM ${nmdecor}OPENSSL_ia32cap_P:QWORD
133.bss ENDS 136.bss ENDS
134___ 137___
135 # comment out OPENSSL_ia32cap_P declarations 138 # comment out OPENSSL_ia32cap_P declarations
@@ -156,6 +159,9 @@ sub ::public_label
156sub ::data_byte 159sub ::data_byte
157{ push(@out,("DB\t").join(',',@_)."\n"); } 160{ push(@out,("DB\t").join(',',@_)."\n"); }
158 161
162sub ::data_short
163{ push(@out,("DW\t").join(',',@_)."\n"); }
164
159sub ::data_word 165sub ::data_word
160{ push(@out,("DD\t").join(',',@_)."\n"); } 166{ push(@out,("DD\t").join(',',@_)."\n"); }
161 167
@@ -181,4 +187,11 @@ ___
181sub ::dataseg 187sub ::dataseg
182{ push(@out,"$segment\tENDS\n_DATA\tSEGMENT\n"); $segment="_DATA"; } 188{ push(@out,"$segment\tENDS\n_DATA\tSEGMENT\n"); $segment="_DATA"; }
183 189
190sub ::safeseh
191{ my $nm=shift;
192 push(@out,"IF \@Version GE 710\n");
193 push(@out,".SAFESEH ".&::LABEL($nm,$nmdecor.$nm)."\n");
194 push(@out,"ENDIF\n");
195}
196
1841; 1971;