Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
a231b887
Y
YTBP
项目概览
YottaChain
/
YTBP
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Y
YTBP
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a231b887
编写于
6月 19, 2017
作者:
A
Andrew Scheidecker
提交者:
Matt Witherspoon
1月 16, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove "infinity" case when parsing float infinity literals: only "inf" is supported now
上级
0f3e5119
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
10 addition
and
10 deletion
+10
-10
libraries/wasm-jit/Source/WAST/ParseNumbers.cpp
libraries/wasm-jit/Source/WAST/ParseNumbers.cpp
+10
-10
未找到文件。
libraries/wasm-jit/Source/WAST/ParseNumbers.cpp
浏览文件 @
a231b887
...
...
@@ -191,7 +191,7 @@ Float parseHexFloat(const char*& nextChar,ParseState& state)
nextChar
+=
2
;
// Parse hexits into a 64-bit fixed point number, keeping track of where the point is in exponent.
U64
fixedPo
I
64
=
0
;
U64
fixedPo
int
64
=
0
;
bool
hasSeenPoint
=
false
;
I64
exponent
=
0
;
while
(
true
)
...
...
@@ -201,10 +201,10 @@ Float parseHexFloat(const char*& nextChar,ParseState& state)
{
// Once there are too many hexits to accumulate in the 64-bit fixed point number, ignore
// the hexits, but continue to update exponent so we get an accurate but imprecise number.
if
(
fixedPo
I
64
<=
(
UINT64_MAX
-
15
)
/
16
)
if
(
fixedPo
int
64
<=
(
UINT64_MAX
-
15
)
/
16
)
{
assert
(
fixedPo
I64
*
16
+
hexit
>=
fixedPoI
64
);
fixedPo
I64
=
fixedPoI
64
*
16
+
hexit
;
assert
(
fixedPo
int64
*
16
+
hexit
>=
fixedPoint
64
);
fixedPo
int64
=
fixedPoint
64
*
16
+
hexit
;
exponent
-=
hasSeenPoint
?
4
:
0
;
}
else
...
...
@@ -230,7 +230,7 @@ Float parseHexFloat(const char*& nextChar,ParseState& state)
exponent
=
isExponentNegative
?
exponent
-
userExponent
:
exponent
+
userExponent
;
}
if
(
!
fixedPo
I
64
)
if
(
!
fixedPo
int
64
)
{
// If both the integer and fractional part are zero, just return zero.
resultComponents
.
bits
.
exponent
=
0
;
...
...
@@ -239,8 +239,8 @@ Float parseHexFloat(const char*& nextChar,ParseState& state)
else
{
// Shift the fixed point number's most significant set bit into the MSB.
const
Uptr
leadingZeroes
=
Platform
::
countLeadingZeroes
(
fixedPo
I
64
);
fixedPo
I
64
<<=
leadingZeroes
;
const
Uptr
leadingZeroes
=
Platform
::
countLeadingZeroes
(
fixedPo
int
64
);
fixedPo
int
64
<<=
leadingZeroes
;
exponent
+=
64
;
exponent
-=
leadingZeroes
;
...
...
@@ -258,9 +258,9 @@ Float parseHexFloat(const char*& nextChar,ParseState& state)
// with the significand shifted down to include the leading 1 that is implicit for
// normal numbers, and with the encoded exponent = 0.
const
Uptr
denormalShift
=
FloatComponents
::
minNormalExponent
-
exponent
;
fixedPo
I64
=
denormalShift
>=
64
?
0
:
(
fixedPoI
64
>>
denormalShift
);
fixedPo
int64
=
denormalShift
>=
64
?
0
:
(
fixedPoint
64
>>
denormalShift
);
resultComponents
.
bits
.
exponent
=
0
;
resultComponents
.
bits
.
significand
=
FloatBits
(
fixedPo
I
64
>>
(
64
-
FloatComponents
::
numSignificandBits
));
resultComponents
.
bits
.
significand
=
FloatBits
(
fixedPo
int
64
>>
(
64
-
FloatComponents
::
numSignificandBits
));
}
else
{
...
...
@@ -268,7 +268,7 @@ Float parseHexFloat(const char*& nextChar,ParseState& state)
assert
(
exponentWithImplicitLeadingOne
>=
FloatComponents
::
minNormalExponent
);
assert
(
exponentWithImplicitLeadingOne
<=
FloatComponents
::
maxNormalExponent
);
resultComponents
.
bits
.
exponent
=
FloatBits
(
exponentWithImplicitLeadingOne
+
FloatComponents
::
exponentBias
);
resultComponents
.
bits
.
significand
=
FloatBits
(
fixedPo
I
64
>>
(
63
-
FloatComponents
::
numSignificandBits
));
resultComponents
.
bits
.
significand
=
FloatBits
(
fixedPo
int
64
>>
(
63
-
FloatComponents
::
numSignificandBits
));
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录