mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-11-23 10:09:54 +00:00
[Bug]: 汇编解释器中进行乘法运算时返回的结果导致后续除法无法区分±Infinity
修复了浮点数0取相反数的结果仍然为0的问题。 Issue: #I7M4ZW Signed-off-by: lichenshuai <lichenshuai@huawei.com> Change-Id: If698fc0162bca664a3187c42910f823e36f203f3
This commit is contained in:
parent
b70208ed53
commit
8c5ac2e445
@ -779,7 +779,7 @@ GateRef NumberSpeculativeLowering::MonocularDouble(GateRef value)
|
||||
res = builder_.DoubleSub(value, builder_.Double(1));
|
||||
break;
|
||||
case TypedUnOp::TYPED_NEG:
|
||||
res = builder_.DoubleSub(builder_.Double(0), value);
|
||||
res = builder_.DoubleMul(builder_.Double(-1), value);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -1345,7 +1345,7 @@ GateRef OperationsStubBuilder::Neg(GateRef glue, GateRef value, ProfileOperation
|
||||
{
|
||||
callback.ProfileOpType(Int32(PGOSampleType::DoubleType()));
|
||||
GateRef valueDouble = GetDoubleOfTDouble(value);
|
||||
result = DoubleToTaggedDoublePtr(DoubleSub(Double(0), valueDouble));
|
||||
result = DoubleToTaggedDoublePtr(DoubleMul(Double(-1), valueDouble));
|
||||
Jump(&exit);
|
||||
}
|
||||
Bind(&valueNotDouble);
|
||||
|
@ -13,3 +13,5 @@
|
||||
|
||||
-2147483648
|
||||
2147483648
|
||||
Infinity
|
||||
-Infinity
|
||||
|
@ -18,4 +18,8 @@ let negone = -1;
|
||||
let intmin = negone - intmax;
|
||||
let negintmin = -intmin;
|
||||
print(intmin);
|
||||
print(negintmin);
|
||||
print(negintmin);
|
||||
|
||||
let doublezero = 0 * 0.1;
|
||||
print(1 / doublezero);
|
||||
print(1 / -doublezero);
|
||||
|
Loading…
Reference in New Issue
Block a user