Skip to content

BUG: Multiply or divides using SIMD without a full vector can cause divide-by-zero#24054

Merged
seberg merged 1 commit intonumpy:mainfrom
Developer-Ecosystem-Engineering:Fix_23996_array_scalar_warnings
Jun 27, 2023
Merged

BUG: Multiply or divides using SIMD without a full vector can cause divide-by-zero#24054
seberg merged 1 commit intonumpy:mainfrom
Developer-Ecosystem-Engineering:Fix_23996_array_scalar_warnings

Conversation

@Developer-Ecosystem-Engineering
Copy link
Contributor

Fixes #23996

The case occurs whenever a multiply or divide occurs (array * scalar) using SIMD and not a full vector can be used. The remaining lanes get zeroed, which can cause divide-by-zero or invalid to be raised.

Xcode 14.3 includes an updated clang that supports FP Strict for arm64, which does not have any issues.

Previous versions of Xcode / clang have incorrect codegen for this case.

…ivide-by-zero

The case occurs whenever a multiple or divide occurs (`array * scalar`) using SIMD and not a full vector can be used.  The remaining lanes get zeroed, which can cause divide-by-zero or invalid to be raised.

Xcode 14.3 includes an updated clang that supports FP Strict for arm64, which does not have any issues.

Previous versions of Xcode / clang have incorrect codegen for this case.
@seberg
Copy link
Member

seberg commented Jun 27, 2023

Oh, this is the identical pattern we already had further up, so lets just put it in, thanks LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: SciPy is seeing incorrect warnings on MacOS M1 (M2?) array * scalar

3 participants