Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
33d9c834
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
33d9c834
编写于
8月 03, 2010
作者:
A
Andy Polyakov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
sha1-armv4-large.pl: reschedule instructions for dual-issue pipeline.
上级
dbe3611b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
30 addition
and
48 deletion
+30
-48
crypto/sha/asm/sha1-armv4-large.pl
crypto/sha/asm/sha1-armv4-large.pl
+30
-48
未找到文件。
crypto/sha/asm/sha1-armv4-large.pl
浏览文件 @
33d9c834
...
...
@@ -41,6 +41,13 @@
# issue Cortex A8 core was measured to process input block in
# ~990 cycles.
# August 2010.
#
# Rescheduling for dual-issue pipeline resulted in 13% improvement on
# Cortex A8 core and in absolute terms ~870 cycles per input block
# [or 13.6 cycles per byte].
while
((
$output
=
shift
)
&&
(
$output
!~
/^\w[\w\-]*\.\w+$/
))
{}
open
STDOUT
,"
>
$output
";
...
...
@@ -60,43 +67,22 @@ $t3="r12";
$Xi
=
"
r14
";
@V
=
(
$a
,
$b
,
$c
,
$d
,
$e
);
# One can optimize this for aligned access on big-endian architecture,
# but code's endian neutrality makes it too pretty:-)
sub
Xload
{
my
(
$a
,
$b
,
$c
,
$d
,
$e
)
=
@_
;
$code
.=
<<___;
ldrb $t0,[$inp],#4
ldrb $t1,[$inp,#-3]
ldrb $t2,[$inp,#-2]
ldrb $t3,[$inp,#-1]
add $e,$K,$e,ror#2 @ E+=K_00_19
orr $t0,$t1,$t0,lsl#8
add $e,$e,$a,ror#27 @ E+=ROR(A,27)
orr $t0,$t2,$t0,lsl#8
eor $t1,$c,$d @ F_xx_xx
orr $t0,$t3,$t0,lsl#8
add $e,$e,$t0 @ E+=X[i]
str $t0,[$Xi,#-4]!
___
}
sub
Xupdate
{
my
(
$a
,
$b
,
$c
,
$d
,
$e
,
$
flag
)
=
@_
;
my
(
$a
,
$b
,
$c
,
$d
,
$e
,
$
opt1
,
$opt2
)
=
@_
;
$code
.=
<<___;
ldr $t0,[$Xi,#15*4]
ldr $t1,[$Xi,#13*4]
ldr $t2,[$Xi,#7*4]
ldr $t3,[$Xi,#2*4]
add $e,$K,$e,ror#2 @ E+=K_xx_xx
ldr $t3,[$Xi,#2*4]
eor $t0,$t0,$t1
eor $t2,$t2,$t3
eor $t0,$t0,$t2
add $e,$e,$a,ror#27 @ E+=ROR(A,27)
___
$code
.=<<
___
if
(
!
defined
(
$flag
));
eor
$t1
,
$c
,
$d
@
F_xx_xx
,
but
not
in
40_59
___
$code
.=
<<___;
eor $t1,$c,$d @ F_xx_xx
mov $t0,$t0,ror#31
add $e,$e,$a,ror#27 @ E+=ROR(A,27)
eor $t0,$t0,$t2,ror#31
$opt1 @ F_xx_xx
$opt2 @ F_xx_xx
add $e,$e,$t0 @ E+=X[i]
str $t0,[$Xi,#-4]!
___
...
...
@@ -104,19 +90,29 @@ ___
sub
BODY_00_15
{
my
(
$a
,
$b
,
$c
,
$d
,
$e
)
=
@_
;
&Xload
(
@
_
);
$code
.=
<<___;
ldrb $t0,[$inp],#4
ldrb $t1,[$inp,#-1]
ldrb $t2,[$inp,#-2]
add $e,$K,$e,ror#2 @ E+=K_00_19
ldrb $t3,[$inp,#-3]
add $e,$e,$a,ror#27 @ E+=ROR(A,27)
orr $t0,$t1,$t0,lsl#24
eor $t1,$c,$d @ F_xx_xx
orr $t0,$t0,$t2,lsl#8
orr $t0,$t0,$t3,lsl#16
and $t1,$b,$t1,ror#2
add $e,$e,$t0 @ E+=X[i]
eor $t1,$t1,$d,ror#2 @ F_00_19(B,C,D)
str $t0,[$Xi,#-4]!
add $e,$e,$t1 @ E+=F_00_19(B,C,D)
___
}
sub
BODY_16_19
{
my
(
$a
,
$b
,
$c
,
$d
,
$e
)
=
@_
;
&Xupdate
(
@
_
);
&Xupdate
(
@
_
,"
and
$t1
,
$b
,
$t1
,ror#2
"
);
$code
.=
<<___;
and $t1,$b,$t1,ror#2
eor $t1,$t1,$d,ror#2 @ F_00_19(B,C,D)
add $e,$e,$t1 @ E+=F_00_19(B,C,D)
___
...
...
@@ -124,34 +120,20 @@ ___
sub
BODY_20_39
{
my
(
$a
,
$b
,
$c
,
$d
,
$e
)
=
@_
;
&Xupdate
(
@
_
);
&Xupdate
(
@
_
,"
eor
$t1
,
$b
,
$t1
,ror#2
"
);
$code
.=
<<___;
eor $t1,$b,$t1,ror#2 @ F_20_39(B,C,D)
add $e,$e,$t1 @ E+=F_20_39(B,C,D)
___
}
sub
BODY_40_59
{
my
(
$a
,
$b
,
$c
,
$d
,
$e
)
=
@_
;
if
(
1
)
{
&Xupdate
(
@
_
);
&Xupdate
(
@
_
,"
and
$t1
,
$b
,
$t1
,ror#2
","
and
$t2
,
$c
,
$d
");
$code
.=
<<___;
and $t2,$c,$d
and $t1,$b,$t1,ror#2
add $e,$e,$t2,ror#2
add $e,$e,$t1 @ E+=F_40_59(B,C,D)
___
}
else
{
&Xupdate
(
@
_
,
1
);
$code
.=
<<___;
and $t1,$b,$c,ror#2
orr $t2,$b,$c,ror#2
and $t2,$t2,$d,ror#2
orr $t1,$t1,$t2 @ F_40_59(B,C,D)
add $e,$e,$t1 @ E+=F_40_59(B,C,D)
add $e,$e,$t2,ror#2
___
}
}
$code
=
<<___;
.text
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录