[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARM SIMD div by zero returns NaN instead of Infinity #24399

Closed
fsc8000 opened this issue Sep 22, 2015 · 0 comments
Closed

ARM SIMD div by zero returns NaN instead of Infinity #24399

fsc8000 opened this issue Sep 22, 2015 · 0 comments
Labels
area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends.

Comments

@fsc8000
Copy link
Contributor
fsc8000 commented Sep 22, 2015

In optimized code, the division return NaN, where it should return Infinity. @johnmccutchan

Repro from co19/LibTest/typed_data/Float32x4/operator_division_A01_t02 with a loop added to trigger optimization:

import 'dart:typed_data';

test() {
var op1 = new Float32x4(1.0, 0.0, -1.0, 1.0);
var op2 = new Float32x4(0.0, 0.0, 0.0, -0.0);
var res = op1 / op2;
if (!res.x.isInfinite) throw "fail $res.x";
return res.x;
}

main() {
for (var i=0; i<100000; i++) test();
print(test());
}

@fsc8000 fsc8000 added the area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. label Sep 22, 2015
@johnmccutchan johnmccutchan self-assigned this Sep 22, 2015
@johnmccutchan johnmccutchan removed their assignment Apr 11, 2017
dart-bot pushed a commit that referenced this issue Mar 9, 2018
This reverts commit 3da9c34.

Reason for revert: Broke the build on vm-kernel-precomp-linux-release-simarm

Original change's description:
> [vm/simarm] Fix VRECPS/VRSQRTSQS instruction implementation.
> 
> This instruction handles 0.0 and infinity operands
> specially because otherwise it produces NaN where it
> should produce appropriate infinity or zero.
> 
> Fixes #24399
> Fixes #26675
> 
> Change-Id: I0741d0daa8b92b4dcd780b1453c9ec449552b1fd
> Reviewed-on: https://dart-review.googlesource.com/45382
> Reviewed-by: Zach Anderson <zra@google.com>

TBR=whesse@google.com,vegorov@google.com,alexmarkov@google.com,zra@google.com

Change-Id: I413be56fdce8afa0e2faa6ed2b16ef0f68b795b0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/45683
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
dart-bot pushed a commit that referenced this issue Oct 15, 2019
This instruction handles 0.0 and infinity operands
specially because otherwise it produces NaN where it
should produce appropriate infinity or zero.

Fixes #24399
Fixes #26675
Fixes #38844

This relands commit 3da9c34

Change-Id: I116cea3b6c27b5dc16741f9652fbbb9a3ec1194e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121705
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
tekknolagi pushed a commit to tekknolagi/dart-assembler that referenced this issue Nov 3, 2020
This instruction handles 0.0 and infinity operands
specially because otherwise it produces NaN where it
should produce appropriate infinity or zero.

Fixes dart-lang#24399
Fixes dart-lang#26675

Change-Id: I0741d0daa8b92b4dcd780b1453c9ec449552b1fd
Reviewed-on: https://dart-review.googlesource.com/45382
Reviewed-by: Zach Anderson <zra@google.com>
tekknolagi pushed a commit to tekknolagi/dart-assembler that referenced this issue Nov 3, 2020
This reverts commit 3da9c34.

Reason for revert: Broke the build on vm-kernel-precomp-linux-release-simarm

Original change's description:
> [vm/simarm] Fix VRECPS/VRSQRTSQS instruction implementation.
> 
> This instruction handles 0.0 and infinity operands
> specially because otherwise it produces NaN where it
> should produce appropriate infinity or zero.
> 
> Fixes dart-lang#24399
> Fixes dart-lang#26675
> 
> Change-Id: I0741d0daa8b92b4dcd780b1453c9ec449552b1fd
> Reviewed-on: https://dart-review.googlesource.com/45382
> Reviewed-by: Zach Anderson <zra@google.com>

TBR=whesse@google.com,vegorov@google.com,alexmarkov@google.com,zra@google.com

Change-Id: I413be56fdce8afa0e2faa6ed2b16ef0f68b795b0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/45683
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
tekknolagi pushed a commit to tekknolagi/dart-assembler that referenced this issue Nov 3, 2020
This instruction handles 0.0 and infinity operands
specially because otherwise it produces NaN where it
should produce appropriate infinity or zero.

Fixes dart-lang#24399
Fixes dart-lang#26675
Fixes dart-lang#38844

This relands commit 3da9c34

Change-Id: I116cea3b6c27b5dc16741f9652fbbb9a3ec1194e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121705
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends.
Projects
None yet
Development

No branches or pull requests

2 participants