Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Musl
提交
58bba42d
T
Third Party Musl
项目概览
OpenHarmony
/
Third Party Musl
大约 1 年 前同步成功
通知
37
Star
125
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Musl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
58bba42d
编写于
12月 16, 2012
作者:
S
Szabolcs Nagy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
math: x86_64 version of expl, fixed some comments in the i386 version
上级
525ad96e
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
112 addition
and
4 deletion
+112
-4
src/math/i386/expl.s
src/math/i386/expl.s
+2
-2
src/math/i386/expm1f.s
src/math/i386/expm1f.s
+1
-1
src/math/i386/expm1l.s
src/math/i386/expm1l.s
+1
-1
src/math/x86_64/expl.s
src/math/x86_64/expl.s
+108
-0
未找到文件。
src/math/i386/expl.s
浏览文件 @
58bba42d
#
exp
(
x
)
=
2
^
hi
+
2
^
hi
(
2
^
lo
-
1
)
#
where
hi
+
lo
=
log2e
*
x
with
128
bit
precision
#
exact
log2e
*
x
calculation
depends
on
nearest
rounding
mode
#
using
the
exact
multiplication
method
of
Dekker
and
Veltkamp
.
global
expl
.
type
expl
,@
function
...
...
@@ -35,7 +36,6 @@ expl:
#
should
be
0x1
.71547652
b82fe178p0
==
0x3fff
b8aa3b29
5
c17f0bc
#
it
will
be
wrong
on
non
-
nearest
rounding
mode
3
:
fldl2e
#
subl
$
32
,
%
esp
subl
$
44
,
%
esp
#
hi
=
log2e_hi
*
x
#
2
^
hi
=
exp2l
(
hi
)
...
...
@@ -54,7 +54,7 @@ expl:
fldt
16
(%
esp
)
#
fpu
stack
:
2
^
hi
x
hi
#
exact
mult
:
x
*
log2e
fld
%
st
(
1
)
#
x
fld
%
st
(
1
)
#
c
=
0x1p32
+
1
pushl
$
0x41f00000
pushl
$
0x00100000
...
...
src/math/i386/expm1f.s
浏览文件 @
58bba42d
#
see
exp
m1
.
s
#
see
exp
.
s
src/math/i386/expm1l.s
浏览文件 @
58bba42d
#
see
exp
m1
.
s
#
see
exp
.
s
src/math/x86_64/expl.s
浏览文件 @
58bba42d
#
exp
(
x
)
=
2
^
hi
+
2
^
hi
(
2
^
lo
-
1
)
#
where
hi
+
lo
=
log2e
*
x
with
128
bit
precision
#
exact
log2e
*
x
calculation
depends
on
nearest
rounding
mode
#
using
the
exact
multiplication
method
of
Dekker
and
Veltkamp
.
global
expl
.
type
expl
,@
function
expl
:
fldt
8
(%
rsp
)
#
special
cases
:
2
*
x
is
+-
inf
,
nan
or
|x|
<
0x1p-32
#
check
(
exponent
|
0x8000
)+
2
<
0xbfff
+
2
-
32
movw
16
(%
rsp
),
%
ax
movw
%
ax
,
%
dx
orw
$
0x8000
,
%
dx
addw
$
2
,
%
dx
cmpw
$
0xbfff
-
30
,
%
dx
jnb
3
f
cmpw
$
1
,
%
dx
jbe
1
f
# if |x|<0x1p-32 return 1+x
fld1
jmp
2
f
1
:
testw
%
ax
,
%
ax
jns
1
f
# if 2*x == -inf,-nan return -0/x
fldz
fchs
fdivp
ret
# if 2*x == inf,nan return 2*x
1
:
fld
%
st
(
0
)
2
:
faddp
ret
#
should
be
0x1
.71547652
b82fe178p0
==
0x3fff
b8aa3b29
5
c17f0bc
#
it
will
be
wrong
on
non
-
nearest
rounding
mode
3
:
fldl2e
subq
$
48
,
%
rsp
#
hi
=
log2e_hi
*
x
#
2
^
hi
=
exp2l
(
hi
)
fmul
%
st
(
1
),%
st
fld
%
st
(
0
)
fstpt
(%
rsp
)
fstpt
16
(%
rsp
)
fstpt
32
(%
rsp
)
call
exp2l
# if 2^hi == inf return 2^hi
fld
%
st
(
0
)
fstpt
(%
rsp
)
cmpw
$
0x7fff
,
8
(%
rsp
)
je
1
f
fldt
32
(%
rsp
)
fldt
16
(%
rsp
)
#
fpu
stack
:
2
^
hi
x
hi
#
exact
mult
:
x
*
log2e
fld
%
st
(
1
)
#
c
=
0x1p32
+
1
movq
$
0x41f0000000100000
,%
rax
pushq
%
rax
fldl
(%
rsp
)
#
xh
=
x
-
c
*
x
+
c
*
x
#
xl
=
x
-
xh
fmulp
fld
%
st
(
2
)
fsub
%
st
(
1
),
%
st
faddp
fld
%
st
(
2
)
fsub
%
st
(
1
),
%
st
#
yh
=
log2e_hi
-
c
*
log2e_hi
+
c
*
log2e_hi
movq
$
0x3ff7154765200000
,%
rax
pushq
%
rax
fldl
(%
rsp
)
#
fpu
stack
:
2
^
hi
x
hi
xh
xl
yh
#
lo
=
hi
-
xh
*
yh
+
xl
*
yh
fld
%
st
(
2
)
fmul
%
st
(
1
),
%
st
fsubp
%
st
,
%
st
(
4
)
fmul
%
st
(
1
),
%
st
faddp
%
st
,
%
st
(
3
)
#
yl
=
log2e_hi
-
yh
movq
$
0x3de705fc2f000000
,%
rax
pushq
%
rax
fldl
(%
rsp
)
#
fpu
stack
:
2
^
hi
x
lo
xh
xl
yl
#
lo
+=
xh
*
yl
+
xl
*
yl
fmul
%
st
,
%
st
(
2
)
fmulp
%
st
,
%
st
(
1
)
fxch
%
st
(
2
)
faddp
faddp
#
log2e_lo
movq
$
0xbfbe
,%
rax
pushq
%
rax
movq
$
0x82f0025f2dc582ee
,%
rax
pushq
%
rax
fldt
(%
rsp
)
addq
$
40
,%
rsp
#
fpu
stack
:
2
^
hi
x
lo
log2e_lo
#
lo
+=
log2e_lo
*
x
#
return
2
^
hi
+
2
^
hi
(
2
^
lo
-
1
)
fmulp
%
st
,
%
st
(
2
)
faddp
f2xm1
fmul
%
st
(
1
),
%
st
faddp
1
:
addq
$
48
,
%
rsp
ret
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录