mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-11-23 10:09:54 +00:00
Bugfix for Float64 Divided zero. Remove Float64RightIsZeroCheck.
Issue:https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I7M88W?from=project-issue Change-Id: Ia1276d059839a9c5f2559ca42f5b92061030ea1c Signed-off-by: duanfuchen <slow295185031@163.com>
This commit is contained in:
parent
99d04f4610
commit
613bf61d37
@ -326,7 +326,6 @@ void NumberSpeculativeLowering::VisitNumberDiv(GateRef gate)
|
||||
result = builder_.Int32DivWithCheck(left, right);
|
||||
acc_.SetMachineType(gate, MachineType::I32);
|
||||
} else {
|
||||
builder_.Float64CheckRightIsZero(right);
|
||||
result = builder_.BinaryArithmetic(circuit_->Fdiv(), MachineType::F64, left, right);
|
||||
acc_.SetMachineType(gate, MachineType::F64);
|
||||
}
|
||||
|
18
test/aottest/float64divzero/BUILD.gn
Normal file
18
test/aottest/float64divzero/BUILD.gn
Normal file
@ -0,0 +1,18 @@
|
||||
# Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import("//arkcompiler/ets_runtime/test/test_helper.gni")
|
||||
|
||||
host_aot_test_action("float64divzero") {
|
||||
deps = []
|
||||
}
|
17
test/aottest/float64divzero/expect_output.txt
Normal file
17
test/aottest/float64divzero/expect_output.txt
Normal file
@ -0,0 +1,17 @@
|
||||
# Copyright (c) 2023 Huawei Device Co., Ltd.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
Infinity
|
||||
NaN
|
||||
Infinity
|
||||
NaN
|
26
test/aottest/float64divzero/float64divzero.ts
Normal file
26
test/aottest/float64divzero/float64divzero.ts
Normal file
@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
//declare function print(str:string):string;
|
||||
declare function print(str:any):number;
|
||||
|
||||
var num0:number = 99
|
||||
var zero:number = 0.0
|
||||
var inf1:number = num0 / zero
|
||||
print(inf1)
|
||||
var nan1:number = zero / zero
|
||||
print(nan1)
|
||||
print(inf1/zero)
|
||||
print(nan1/zero)
|
Loading…
Reference in New Issue
Block a user