summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/perlasm/x86unix.pl
diff options
context:
space:
mode:
authormarkus <>2003-11-18 12:39:05 +0000
committermarkus <>2003-11-18 12:39:05 +0000
commit3cf6590e9b2b978b44c38897634f84fbf167db4f (patch)
tree7f604b9764cd13753c7602979f5424b7dc97e04b /src/lib/libcrypto/perlasm/x86unix.pl
parent56f777457f24d2899caf9b29a79285b5753e3e9b (diff)
downloadopenbsd-3cf6590e9b2b978b44c38897634f84fbf167db4f.tar.gz
openbsd-3cf6590e9b2b978b44c38897634f84fbf167db4f.tar.bz2
openbsd-3cf6590e9b2b978b44c38897634f84fbf167db4f.zip
use bn_asm_vax.S (from netbsd); test + ok by miod
use asm code for i386, except for the CBC code, because it is not clean PIC code. add <machime/asm.h> support to x86unix.pl tested by: nick (on 30386), henning, djm, tedu, jmc and more; no shlib minor crank necessary, only internal symbols changed.
Diffstat (limited to 'src/lib/libcrypto/perlasm/x86unix.pl')
-rw-r--r--src/lib/libcrypto/perlasm/x86unix.pl35
1 files changed, 33 insertions, 2 deletions
diff --git a/src/lib/libcrypto/perlasm/x86unix.pl b/src/lib/libcrypto/perlasm/x86unix.pl
index 10b669bf04..53ad5f4927 100644
--- a/src/lib/libcrypto/perlasm/x86unix.pl
+++ b/src/lib/libcrypto/perlasm/x86unix.pl
@@ -15,6 +15,12 @@ sub main'asm_get_output { return(@out); }
15sub main'get_labels { return(@labels); } 15sub main'get_labels { return(@labels); }
16sub main'external_label { push(@labels,@_); } 16sub main'external_label { push(@labels,@_); }
17 17
18if ($main'openbsd)
19 {
20 $com_start='/*';
21 $com_end='*/';
22 }
23
18if ($main'cpp) 24if ($main'cpp)
19 { 25 {
20 $align="ALIGN"; 26 $align="ALIGN";
@@ -276,6 +282,9 @@ sub main'file
276 { 282 {
277 local($file)=@_; 283 local($file)=@_;
278 284
285 if ($main'openbsd)
286 { push(@out,"#include <machine/asm.h>\n"); return; }
287
279 local($tmp)=<<"EOF"; 288 local($tmp)=<<"EOF";
280 .file "$file.s" 289 .file "$file.s"
281 .version "01.01" 290 .version "01.01"
@@ -291,6 +300,9 @@ sub main'function_begin
291 &main'external_label($func); 300 &main'external_label($func);
292 $func=$under.$func; 301 $func=$under.$func;
293 302
303 if ($main'openbsd)
304 { push (@out, "\nENTRY($func)\n"); goto skip; }
305
294 local($tmp)=<<"EOF"; 306 local($tmp)=<<"EOF";
295.text 307.text
296 .align $align 308 .align $align
@@ -303,6 +315,7 @@ EOF
303 { $tmp=push(@out,"\t.def\t$func;\t.scl\t2;\t.type\t32;\t.endef\n"); } 315 { $tmp=push(@out,"\t.def\t$func;\t.scl\t2;\t.type\t32;\t.endef\n"); }
304 else { $tmp=push(@out,"\t.type\t$func,\@function\n"); } 316 else { $tmp=push(@out,"\t.type\t$func,\@function\n"); }
305 push(@out,"$func:\n"); 317 push(@out,"$func:\n");
318skip:
306 $tmp=<<"EOF"; 319 $tmp=<<"EOF";
307 pushl %ebp 320 pushl %ebp
308 pushl %ebx 321 pushl %ebx
@@ -321,6 +334,9 @@ sub main'function_begin_B
321 &main'external_label($func); 334 &main'external_label($func);
322 $func=$under.$func; 335 $func=$under.$func;
323 336
337 if ($main'openbsd)
338 { push(@out, "\nENTRY($func)\n"); goto skip; }
339
324 local($tmp)=<<"EOF"; 340 local($tmp)=<<"EOF";
325.text 341.text
326 .align $align 342 .align $align
@@ -333,6 +349,7 @@ EOF
333 { $tmp=push(@out,"\t.def\t$func;\t.scl\t2;\t.type\t32;\t.endef\n"); } 349 { $tmp=push(@out,"\t.def\t$func;\t.scl\t2;\t.type\t32;\t.endef\n"); }
334 else { push(@out,"\t.type $func,\@function\n"); } 350 else { push(@out,"\t.type $func,\@function\n"); }
335 push(@out,"$func:\n"); 351 push(@out,"$func:\n");
352skip:
336 $stack=4; 353 $stack=4;
337 } 354 }
338 355
@@ -429,7 +446,8 @@ sub main'swtmp
429 446
430sub main'comment 447sub main'comment
431 { 448 {
432 if ($main'elf) # GNU and SVR4 as'es use different comment delimiters, 449 if (!$main'openbsd && $main'elf)
450 # GNU and SVR4 as'es use different comment delimiters,
433 { # so we just skip comments... 451 { # so we just skip comments...
434 push(@out,"\n"); 452 push(@out,"\n");
435 return; 453 return;
@@ -460,7 +478,10 @@ sub main'set_label
460 $label{$_[0]}=".${label}${_[0]}"; 478 $label{$_[0]}=".${label}${_[0]}";
461 $label++; 479 $label++;
462 } 480 }
463 push(@out,".align $align\n") if ($_[1] != 0); 481 if ($main'openbsd)
482 { push(@out,"_ALIGN_TEXT\n") if ($_[1] != 0); }
483 else
484 { push(@out,".align $align\n") if ($_[1] != 0); }
464 push(@out,"$label{$_[0]}:\n"); 485 push(@out,"$label{$_[0]}:\n");
465 } 486 }
466 487
@@ -569,6 +590,16 @@ sub main'picmeup
569___ 590___
570 push(@out,$tmp); 591 push(@out,$tmp);
571 } 592 }
593 elsif ($main'openbsd)
594 {
595 push(@out, "#ifdef PIC\n");
596 push(@out, "\tPIC_PROLOGUE\n");
597 &main'mov($dst,"PIC_GOT($sym)");
598 push(@out, "\tPIC_EPILOGUE\n");
599 push(@out, "#else\n");
600 &main'lea($dst,&main'DWP($sym));
601 push(@out, "#endif\n");
602 }
572 elsif ($main'pic && ($main'elf || $main'aout)) 603 elsif ($main'pic && ($main'elf || $main'aout))
573 { 604 {
574 push(@out,"\t.align\t8\n"); 605 push(@out,"\t.align\t8\n");