diff options
Diffstat (limited to 'src/lib/libcrypto/perlasm/x86unix.pl')
| -rw-r--r-- | src/lib/libcrypto/perlasm/x86unix.pl | 42 |
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 | ||
| 9 | package x86unix; | 3 | package 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 | ||
| 103 | sub main'BC | ||
| 104 | { | ||
| 105 | return @_; | ||
| 106 | } | ||
| 107 | |||
| 108 | sub 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",@_); } | |||
| 153 | sub main'inc { &out1("incl",@_); } | 162 | sub main'inc { &out1("incl",@_); } |
| 154 | sub main'push { &out1("pushl",@_); $stack+=4; } | 163 | sub main'push { &out1("pushl",@_); $stack+=4; } |
| 155 | sub main'pop { &out1("popl",@_); $stack-=4; } | 164 | sub main'pop { &out1("popl",@_); $stack-=4; } |
| 156 | sub main'bswap { &out1("bswapl",@_); } | ||
| 157 | sub main'not { &out1("notl",@_); } | 165 | sub main'not { &out1("notl",@_); } |
| 158 | sub main'call { &out1("call",$under.$_[0]); } | 166 | sub main'call { &out1("call",$under.$_[0]); } |
| 159 | sub main'ret { &out0("ret"); } | 167 | sub main'ret { &out0("ret"); } |
| 160 | sub main'nop { &out0("nop"); } | 168 | sub main'nop { &out0("nop"); } |
| 161 | 169 | ||
| 170 | # The bswapl instruction is new for the 486. Emulate if i386. | ||
| 171 | sub 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 | |||
| 162 | sub out2 | 186 | sub out2 |
| 163 | { | 187 | { |
| 164 | local($name,$p1,$p2)=@_; | 188 | local($name,$p1,$p2)=@_; |
