Repository navigation
Fix unsigned 64-bit saturating multiplication overflow - #3950
Conversation
|
Thanks for opening your first pull request, and welcome to ISPC! 🎉 A maintainer will review your changes soon. |
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
aneshlya
left a comment
There was a problem hiding this comment.
Looks good! Thanks for using ChipLab with ispc!
Description
Both uniform and varying
uint64overloads return0xffffffff00000000forsaturating_mul(0x8000000000000000, 2). The documented saturation requiresUINT64_MAX(0xffffffffffffffff).We compute the cross products in 64 bits and saturate before shifting when they exceed
UINT32_MAX. We've added exact integer comparisons covering overflow, nonoverflowing boundaries, both operand orders and mixed varying lanes.The reproducer and regression pass after the fix, and the existing saturation tests still pass.
ISPC 1.33.0dev at
4ab7487c09f226d09060d51a964c2575c6a773f8# from the checkout with the built compiler on PATH: python3 scripts/run_tests.py --target=sse4-i32x4 --opt=O2 -j3 --non-interactive tests/func-tests/pmulus-i64-overflow.ispcRelated Issue
Checklist
— ChipLab