Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
10e7d6d5
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
大约 1 年 前同步成功
通知
9
Star
18
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Openssl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
10e7d6d5
编写于
5月 06, 2004
作者:
A
Andy Polyakov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Support for IA-32 SSE2 instruction set.
上级
8d472bdd
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
160 addition
and
6 deletion
+160
-6
crypto/perlasm/x86ms.pl
crypto/perlasm/x86ms.pl
+37
-1
crypto/perlasm/x86nasm.pl
crypto/perlasm/x86nasm.pl
+30
-1
crypto/perlasm/x86unix.pl
crypto/perlasm/x86unix.pl
+93
-4
未找到文件。
crypto/perlasm/x86ms.pl
浏览文件 @
10e7d6d5
...
...
@@ -51,6 +51,11 @@ sub main'DWP
&get_mem
("
DWORD
",
@
_
);
}
sub
main
'
QWP
{
&get_mem
("
QWORD
",
@
_
);
}
sub
main
'
BC
{
return
@_
;
...
...
@@ -160,6 +165,25 @@ sub main'not { &out1("not",@_); }
sub
main
'call {
&out1
("
call
",(
$_
[
0
]
=~
/^\$L/
?'':'
_
')
.
$_
[
0
]);
}
sub
main
'ret {
&out0
("
ret
");
}
sub
main
'nop {
&out0
("
nop
");
}
sub
main
'test {
&out2
("
test
",
@
_
);
}
sub
main
'bt {
&out2
("
bt
",
@
_
);
}
sub
main
'leave {
&out0
("
leave
");
}
# SSE2
sub
main
'emms {
&out0
("
emms
");
}
sub
main
'movd {
&out2
("
movd
",
@
_
);
}
sub
main
'movq {
&out2
("
movq
",
@
_
);
}
sub
main
'movdqu {
&out2
("
movdqu
",
@
_
);
}
sub
main
'movdqa {
&out2
("
movdqa
",
@
_
);
}
sub
main
'movdq2q{
&out2
("
movdq2q
",
@
_
);
}
sub
main
'movq2dq{
&out2
("
movq2dq
",
@
_
);
}
sub
main
'paddq {
&out2
("
paddq
",
@
_
);
}
sub
main
'pmuludq{
&out2
("
pmuludq
",
@
_
);
}
sub
main
'psrlq {
&out2
("
psrlq
",
@
_
);
}
sub
main
'psllq {
&out2
("
psllq
",
@
_
);
}
sub
main
'pxor {
&out2
("
pxor
",
@
_
);
}
sub
main
'por {
&out2
("
por
",
@
_
);
}
sub
main
'pand {
&out2
("
pand
",
@
_
);
}
sub
out2
{
...
...
@@ -299,6 +323,13 @@ EOF
sub
main
'
file_end
{
# try to detect if SSE2 or MMX extensions were used...
if
(
grep
{
/xmm[0-7]\s*,/i
}
@out
)
{
grep
{
s/\.[3-7]86/\.786\n\t\.XMM/
}
@out
;
}
elsif
(
grep
{
/mm[0-7]\s*,/i
}
@out
)
{
grep
{
s/\.[3-7]86/\.686\n\t\.MMX/
}
@out
;
}
push
(
@out
,"
END
\n
");
}
...
...
@@ -359,7 +390,12 @@ sub main'set_label
sub
main
'
data_word
{
push
(
@out
,"
\t
DD
\t
$_
[0]
\n
");
push
(
@out
,"
\t
DD
\t
"
.
join
('
,
',
@
_
)
.
"
\n
");
}
sub
main
'
align
{
push
(
@out
,"
\t
ALIGN
\t
$_
[0]
\n
");
}
sub
out1p
...
...
crypto/perlasm/x86nasm.pl
浏览文件 @
10e7d6d5
...
...
@@ -58,6 +58,11 @@ sub main'DWP
&get_mem
("
DWORD
",
@
_
);
}
sub
main
'
QWP
{
&get_mem
("
QWORD
",
@
_
);
}
sub
main
'
BC
{
return
"
BYTE
@_
";
...
...
@@ -169,6 +174,25 @@ sub main'not { &out1("not",@_); }
sub
main
'call {
&out1
("
call
",(
$_
[
0
]
=~
/^\$L/
?'':'
_
')
.
$_
[
0
]);
}
sub
main
'ret {
&out0
("
ret
");
}
sub
main
'nop {
&out0
("
nop
");
}
sub
main
'test {
&out2
("
test
",
@
_
);
}
sub
main
'bt {
&out2
("
bt
",
@
_
);
}
sub
main
'leave {
&out0
("
leave
");
}
# SSE2
sub
main
'emms {
&out0
("
emms
");
}
sub
main
'movd {
&out2
("
movd
",
@
_
);
}
sub
main
'movq {
&out2
("
movq
",
@
_
);
}
sub
main
'movdqu {
&out2
("
movdqu
",
@
_
);
}
sub
main
'movdqa {
&out2
("
movdqa
",
@
_
);
}
sub
main
'movdq2q{
&out2
("
movdq2q
",
@
_
);
}
sub
main
'movq2dq{
&out2
("
movq2dq
",
@
_
);
}
sub
main
'paddq {
&out2
("
paddq
",
@
_
);
}
sub
main
'pmuludq{
&out2
("
pmuludq
",
@
_
);
}
sub
main
'psrlq {
&out2
("
psrlq
",
@
_
);
}
sub
main
'psllq {
&out2
("
psllq
",
@
_
);
}
sub
main
'pxor {
&out2
("
pxor
",
@
_
);
}
sub
main
'por {
&out2
("
por
",
@
_
);
}
sub
main
'pand {
&out2
("
pand
",
@
_
);
}
sub
out2
{
...
...
@@ -336,7 +360,12 @@ sub main'set_label
sub
main
'
data_word
{
push
(
@out
,"
\t
DD
\t
$_
[0]
\n
");
push
(
@out
,"
\t
DD
\t
"
.
join
('
,
',
@
_
)
.
"
\n
");
}
sub
main
'
align
{
push
(
@out
,"
\t
ALIGN
\t
$_
[0]
\n
");
}
sub
out1p
...
...
crypto/perlasm/x86unix.pl
浏览文件 @
10e7d6d5
...
...
@@ -51,6 +51,24 @@ if ($main'cpp)
'
edi
'
,
'
%edi
'
,
'
ebp
'
,
'
%ebp
'
,
'
esp
'
,
'
%esp
'
,
'
mm0
'
,
'
%mm0
'
,
'
mm1
'
,
'
%mm1
'
,
'
mm2
'
,
'
%mm2
'
,
'
mm3
'
,
'
%mm3
'
,
'
mm4
'
,
'
%mm4
'
,
'
mm5
'
,
'
%mm5
'
,
'
mm6
'
,
'
%mm6
'
,
'
mm7
'
,
'
%mm7
'
,
'
xmm0
'
,
'
%xmm0
'
,
'
xmm1
'
,
'
%xmm1
'
,
'
xmm2
'
,
'
%xmm2
'
,
'
xmm3
'
,
'
%xmm3
'
,
'
xmm4
'
,
'
%xmm4
'
,
'
xmm5
'
,
'
%xmm5
'
,
'
xmm6
'
,
'
%xmm6
'
,
'
xmm7
'
,
'
%xmm7
'
,
);
%reg_val=(
...
...
@@ -97,6 +115,11 @@ sub main'DWP
return
(
$ret
);
}
sub
main
'
QWP
{
return
(
&main
'
DWP(@_));
}
sub main
'
BP
{
return
(
&main
'
DWP(@_));
...
...
@@ -173,6 +196,25 @@ sub main'not { &out1("notl",@_); }
sub
main
'call {
&out1
("
call
",(
$_
[
0
]
=~
/^\.L/
?'':
$under
)
.
$_
[
0
]);
}
sub
main
'ret {
&out0
("
ret
");
}
sub
main
'nop {
&out0
("
nop
");
}
sub
main
'test {
&out2
("
testl
",
@
_
);
}
sub
main
'bt {
&out2
("
btl
",
@
_
);
}
sub
main
'leave {
&out0
("
leave
");
}
# SSE2
sub
main
'emms {
&out0
("
emms
");
}
sub
main
'movd {
&out2
("
movd
",
@
_
);
}
sub
main
'movq {
&out2
("
movq
",
@
_
);
}
sub
main
'movdqu {
&out2
("
movdqu
",
@
_
);
}
sub
main
'movdqa {
&out2
("
movdqa
",
@
_
);
}
sub
main
'movdq2q{
&out2
("
movdq2q
",
@
_
);
}
sub
main
'movq2dq{
&out2
("
movq2dq
",
@
_
);
}
sub
main
'paddq {
&out2
("
paddq
",
@
_
);
}
sub
main
'pmuludq{
&out2
("
pmuludq
",
@
_
);
}
sub
main
'psrlq {
&out2
("
psrlq
",
@
_
);
}
sub
main
'psllq {
&out2
("
psllq
",
@
_
);
}
sub
main
'pxor {
&out2
("
pxor
",
@
_
);
}
sub
main
'por {
&out2
("
por
",
@
_
);
}
sub
main
'pand {
&out2
("
pand
",
@
_
);
}
# The bswapl instruction is new for the 486. Emulate if i386.
sub
main
'
bswap
...
...
@@ -388,7 +430,7 @@ sub main'function_end_B
elsif ($main
'
gaswin
)
{
push
(
@out
,"
\t
.align 4
\n
");
}
else
{
push
(
@out
,"
\t
.size
\t
$func
,.L_
${func}
_end-
$func
\n
");
}
push
(
@out
,"
.ident
\"
desasm.pl
\"\n
");
push
(
@out
,"
.ident
\"
$func
\"\n
");
$stack
=
0
;
%label
=
();
}
...
...
@@ -466,6 +508,48 @@ sub main'set_label
sub
main
'
file_end
{
# try to detect if SSE2 or MMX extensions were used on ELF platform...
if
(
$main
'
elf && grep {/%[x]*mm[0-7]/i} @out) {
local($tmp);
push (@out,"\n.comm\t".$under."OPENSSL_ia32cap,8,4\n");
push (@out,".section\t.init\n");
# One can argue that it
'
s wasteful to craft every
# SSE/MMX module with this snippet... Well, it's 72
# bytes long and for the moment w
e
have
two
modules
.
# Let's argue when we have 7 modules or so...
&main
'
picmeup("edx","OPENSSL_ia32cap");
$tmp=<<___;
cmpl \$0,(%edx)
jne 1f
movl \$1,(%edx)
pushf
popl %eax
movl %eax,%ecx
xorl \$1<<21,%eax
pushl %eax
popf
pushf
popl %eax
xorl %ecx,%eax
bt \$21,%eax
jnc 1f
pushl %edi
pushl %ebx
movl %edx,%edi
movl \$1,%eax
cpuid
orl \$1,%edx
movl %edx,0(%edi)
movl %ecx,4(%edi)
popl %ebx
popl %edi
1:
___
push (@out,$tmp);
}
if ($const ne "")
{
push(@out,".section .rodata\n");
...
...
@@ -476,7 +560,12 @@ sub main'file_end
sub main
'
data_word
{
push
(
@out
,"
\t
.long
$_
[0]
\n
");
push
(
@out
,"
\t
.long
\t
"
.
join
('
,
',
@
_
)
.
"
\n
");
}
sub
main
'
align
{
push
(
@out
,"
.align
$_
[0]
\n
");
}
# debug output functions: puts, putx, printf
...
...
@@ -558,7 +647,7 @@ sub main'picmeup
{
local($tmp)=<<___;
#if (defined(ELF) || defined(SOL)) && defined(PIC)
.align
8
.align
4
call 1f
1: popl $regs{$dst}
addl \$_GLOBAL_OFFSET_TABLE_+[.-1b],$regs{$dst}
...
...
@@ -571,7 +660,7 @@ ___
}
elsif ($main
'
pic
&&
(
$main
'
elf || $main
'
aout
))
{
push
(
@out
,"
\t
.align
\t
8
\n
");
push
(
@out
,"
\t
.align
\t
4
\n
");
&main
'
call(&main
'
label
("
PIC_me_up
"));
&main
'
set_label("PIC_me_up");
&main
'
blindpop
(
$dst
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录