summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/perlasm/x86unix.pl
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/perlasm/x86unix.pl')
-rw-r--r--src/lib/libcrypto/perlasm/x86unix.pl42
1 files changed, 33 insertions, 9 deletions
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 @@
1#!/usr/bin/perl 1#!/usr/local/bin/perl
2
3# Because the bswapl instruction is not supported for old assembers
4# (it was a new instruction for the 486), I've added .byte xxxx code
5# to put it in.
6# eric 24-Apr-1998
7#
8 2
9package x86unix; 3package x86unix;
10 4
@@ -90,7 +84,12 @@ sub main'DWP
90 $reg2="$regs{$reg2}" if defined($regs{$reg2}); 84 $reg2="$regs{$reg2}" if defined($regs{$reg2});
91 $ret.=$addr if ($addr ne "") && ($addr ne 0); 85 $ret.=$addr if ($addr ne "") && ($addr ne 0);
92 if ($reg2 ne "") 86 if ($reg2 ne "")
93 { $ret.="($reg1,$reg2,$idx)"; } 87 {
88 if($idx ne "")
89 { $ret.="($reg1,$reg2,$idx)"; }
90 else
91 { $ret.="($reg1,$reg2)"; }
92 }
94 else 93 else
95 { $ret.="($reg1)" } 94 { $ret.="($reg1)" }
96 return($ret); 95 return($ret);
@@ -101,6 +100,16 @@ sub main'BP
101 return(&main'DWP(@_)); 100 return(&main'DWP(@_));
102 } 101 }
103 102
103sub main'BC
104 {
105 return @_;
106 }
107
108sub main'DWC
109 {
110 return @_;
111 }
112
104#sub main'BP 113#sub main'BP
105# { 114# {
106# local($addr,$reg1,$reg2,$idx)=@_; 115# local($addr,$reg1,$reg2,$idx)=@_;
@@ -153,12 +162,27 @@ sub main'dec { &out1("decl",@_); }
153sub main'inc { &out1("incl",@_); } 162sub main'inc { &out1("incl",@_); }
154sub main'push { &out1("pushl",@_); $stack+=4; } 163sub main'push { &out1("pushl",@_); $stack+=4; }
155sub main'pop { &out1("popl",@_); $stack-=4; } 164sub main'pop { &out1("popl",@_); $stack-=4; }
156sub main'bswap { &out1("bswapl",@_); }
157sub main'not { &out1("notl",@_); } 165sub main'not { &out1("notl",@_); }
158sub main'call { &out1("call",$under.$_[0]); } 166sub main'call { &out1("call",$under.$_[0]); }
159sub main'ret { &out0("ret"); } 167sub main'ret { &out0("ret"); }
160sub main'nop { &out0("nop"); } 168sub main'nop { &out0("nop"); }
161 169
170# The bswapl instruction is new for the 486. Emulate if i386.
171sub main'bswap
172 {
173 if ($main'i386)
174 {
175 &main'comment("bswapl @_");
176 &main'exch(main'HB(@_),main'LB(@_));
177 &main'rotr(@_,16);
178 &main'exch(main'HB(@_),main'LB(@_));
179 }
180 else
181 {
182 &out1("bswapl",@_);
183 }
184 }
185
162sub out2 186sub out2
163 { 187 {
164 local($name,$p1,$p2)=@_; 188 local($name,$p1,$p2)=@_;