From de8f24ea083384bb66b32ec105dc4743c5663cdf Mon Sep 17 00:00:00 2001 From: beck <> Date: Wed, 29 Sep 1999 04:37:45 +0000 Subject: OpenSSL 0.9.4 merge --- src/lib/libcrypto/perlasm/x86unix.pl | 42 ++++++++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 9 deletions(-) (limited to 'src/lib/libcrypto/perlasm/x86unix.pl') diff --git a/src/lib/libcrypto/perlasm/x86unix.pl b/src/lib/libcrypto/perlasm/x86unix.pl index 6ee4dd3245..8c456b14af 100644 --- a/src/lib/libcrypto/perlasm/x86unix.pl +++ b/src/lib/libcrypto/perlasm/x86unix.pl @@ -1,10 +1,4 @@ -#!/usr/bin/perl - -# Because the bswapl instruction is not supported for old assembers -# (it was a new instruction for the 486), I've added .byte xxxx code -# to put it in. -# eric 24-Apr-1998 -# +#!/usr/local/bin/perl package x86unix; @@ -90,7 +84,12 @@ sub main'DWP $reg2="$regs{$reg2}" if defined($regs{$reg2}); $ret.=$addr if ($addr ne "") && ($addr ne 0); if ($reg2 ne "") - { $ret.="($reg1,$reg2,$idx)"; } + { + if($idx ne "") + { $ret.="($reg1,$reg2,$idx)"; } + else + { $ret.="($reg1,$reg2)"; } + } else { $ret.="($reg1)" } return($ret); @@ -101,6 +100,16 @@ sub main'BP return(&main'DWP(@_)); } +sub main'BC + { + return @_; + } + +sub main'DWC + { + return @_; + } + #sub main'BP # { # local($addr,$reg1,$reg2,$idx)=@_; @@ -153,12 +162,27 @@ sub main'dec { &out1("decl",@_); } sub main'inc { &out1("incl",@_); } sub main'push { &out1("pushl",@_); $stack+=4; } sub main'pop { &out1("popl",@_); $stack-=4; } -sub main'bswap { &out1("bswapl",@_); } sub main'not { &out1("notl",@_); } sub main'call { &out1("call",$under.$_[0]); } sub main'ret { &out0("ret"); } sub main'nop { &out0("nop"); } +# The bswapl instruction is new for the 486. Emulate if i386. +sub main'bswap + { + if ($main'i386) + { + &main'comment("bswapl @_"); + &main'exch(main'HB(@_),main'LB(@_)); + &main'rotr(@_,16); + &main'exch(main'HB(@_),main'LB(@_)); + } + else + { + &out1("bswapl",@_); + } + } + sub out2 { local($name,$p1,$p2)=@_; -- cgit v1.2.3-55-g6feb