Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
openssl
提交
f26328c2
O
openssl
项目概览
btwise
/
openssl
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
openssl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f26328c2
编写于
9月 04, 2012
作者:
A
Andy Polyakov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
sha512-armv4.pl: optimize for Snapdragon S4.
上级
a58fdc7a
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
33 addition
and
11 deletion
+33
-11
crypto/sha/asm/sha512-armv4.pl
crypto/sha/asm/sha512-armv4.pl
+33
-11
未找到文件。
crypto/sha/asm/sha512-armv4.pl
浏览文件 @
f26328c2
#!/usr/bin/env perl
# ====================================================================
# Written by Andy Polyakov <appro@
fy.chalmers.se
> for the OpenSSL
# Written by Andy Polyakov <appro@
openssl.org
> for the OpenSSL
# project. The module is, however, dual licensed under OpenSSL and
# CRYPTOGAMS licenses depending on where you obtain it. For further
# details see http://www.openssl.org/~appro/cryptogams/.
...
...
@@ -28,6 +28,23 @@
# Add NEON implementation. On Cortex A8 it was measured to process
# one byte in 23.3 cycles or ~60% faster than integer-only code.
# August 2012.
#
# Improve NEON performance by 12% on Snapdragon S4. In absolute
# terms it's 22.6 cycles per byte, which is disappointing result.
# Technical writers asserted that 3-way S4 pipeline can sustain
# multiple NEON instructions per cycle, but dual NEON issue could
# not be observed, and for NEON-only sequences IPC(*) was found to
# be limited by 1:-( 0.33 and 0.66 were measured for sequences with
# ILPs(*) of 1 and 2 respectively. This in turn means that you can
# even find yourself striving, as I did here, for achieving IPC
# adequate to one delivered by Cortex A8 [for reference, it's
# 0.5 for ILP of 1, and 1 for higher ILPs].
#
# (*) ILP, instruction-level parallelism, how many instructions
# *can* execute at the same time. IPC, instructions per cycle,
# indicates how many instructions actually execute.
# Byte order [in]dependence. =========================================
#
# Originally caller was expected to maintain specific *dword* order in
...
...
@@ -457,6 +474,9 @@ $code.=<<___ if ($i<16 || $i&1);
vld1
.64
{
@X
[
$i
%
16
]},[
$inp
]
!
@
handles
unaligned
#endif
vshr
.
u64
$t1
,
$e
,
#@Sigma1[1]
#if $i>0
vadd
.
i64
$a
,
$Maj
@
h
+=
Maj
from
the
past
#endif
vshr
.
u64
$t2
,
$e
,
#@Sigma1[2]
___
$code
.=
<<___;
...
...
@@ -468,26 +488,26 @@ $code.=<<___;
#if $i<16 && defined(__ARMEL__)
vrev64.8 @X[$i],@X[$i]
#endif
vbsl $Ch,$f,$g @ Ch(e,f,g)
veor $t1,$t0
vbsl $Ch,$f,$g @ Ch(e,f,g)
vshr.u64 $t0,$a,#@Sigma0[0]
veor $t2,$t1 @ Sigma1(e)
vadd.i64 $T1,$Ch,$h
vshr.u64 $t1,$a,#@Sigma0[1]
vadd.i64 $T1,$h,$t2
vshr.u64 $t2,$a,#@Sigma0[2]
vadd.i64 $T1,$Ch
vsli.64 $t0,$a,#`64-@Sigma0[0]`
vadd.i64 $T1,@X[$i%16]
vadd.i64 $T1,$t2
vshr.u64 $t2,$a,#@Sigma0[2]
vadd.i64 $K,@X[$i%16]
vsli.64 $t1,$a,#`64-@Sigma0[1]`
v
add.i64 $T1,$K
v
eor $Maj,$a,$b
vsli.64 $t2,$a,#`64-@Sigma0[2]`
veor $h,$t0,$t1
veor $Maj,$a,$b
veor $h,$t2 @ Sigma0(a)
vadd.i64 $T1,$K
vbsl $Maj,$c,$b @ Maj(a,b,c)
v
add.i64 $h,$T1
v
eor $h,$t2 @ Sigma0(a)
vadd.i64 $d,$T1
vadd.i64 $h,$Maj
vadd.i64 $Maj,$T1
@ vadd.i64 $h,$Maj
___
}
...
...
@@ -505,6 +525,7 @@ $i /= 2;
$code
.=
<<___;
vshr.u64 $t0,@X[($i+7)%8],#@sigma1[0]
vshr.u64 $t1,@X[($i+7)%8],#@sigma1[1]
vadd.i64 @_[0],d30 @ h+=Maj from the past
vshr.u64 $s1,@X[($i+7)%8],#@sigma1[2]
vsli.64 $t0,@X[($i+7)%8],#`64-@sigma1[0]`
vext.8 $s0,@X[$i%8],@X[($i+1)%8],#8 @ X[i+1]
...
...
@@ -551,6 +572,7 @@ for(;$i<32;$i++) { &NEON_16_79($i,@V); unshift(@V,pop(@V)); }
$code
.=
<<___;
bne .L16_79_neon
vadd.i64 $A,d30 @ h+=Maj from the past
vldmia $ctx,{d24-d31} @ load context to temp
vadd.i64 q8,q12 @ vectorized accumulate
vadd.i64 q9,q13
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录