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

Various masked operations #2428

Merged

Conversation

mazimkhan
Copy link
Contributor

Introduces:

  • MaskedOrOrZero(m, a, b): returns a[i] || b[i] or zero if m[i] is false.
  • TwoTablesLookupLanesOr(d, m, a, b, unspecified): returns the result of TwoTablesLookupLanes(V a, V b, unspecified) where m[i] is true, and a[i] where m[i] is false.
  • TwoTablesLookupLanesOrZero(d, m, a, b, unspecified): returns the result of TwoTablesLookupLanes(V a, V b, unspecified) where m[i] is true, and zero where m[i] is false.
  • MaskedReduceSum(d, m, v): returns the sum of all lanes where m[i] is true.
  • MaskedReduceMin(d, m, v): returns the minimum of all lanes where m[i] is true.
  • MaskedReduceMax(d, m, v): returns the maximum of all lanes where m[i] is true.
  • IfNegativeThenNegOrUndefIfZero(mask, v): returns mask[i] < 0 ? (-v[i]) : ((mask[i] > 0) ? v[i] : impl_defined_val), where impl_defined_val is an implementation-defined value that is equal to either 0 or v[i]. SVE included only.

Testing is performed for all new operations.

Copy link

google-cla bot commented Jan 6, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

g3doc/quick_reference.md Outdated Show resolved Hide resolved
g3doc/quick_reference.md Outdated Show resolved Hide resolved
g3doc/quick_reference.md Outdated Show resolved Hide resolved
g3doc/quick_reference.md Show resolved Hide resolved
hwy/ops/arm_sve-inl.h Outdated Show resolved Hide resolved
hwy/ops/arm_sve-inl.h Show resolved Hide resolved
hwy/ops/arm_sve-inl.h Outdated Show resolved Hide resolved
hwy/ops/generic_ops-inl.h Outdated Show resolved Hide resolved
hwy/ops/generic_ops-inl.h Outdated Show resolved Hide resolved
hwy/ops/arm_sve-inl.h Show resolved Hide resolved
hwy/ops/generic_ops-inl.h Outdated Show resolved Hide resolved
jan-wassenberg
jan-wassenberg previously approved these changes Jan 30, 2025
mazimkhan and others added 5 commits February 3, 2025 14:45
Remove OrZero suffix and fix MaskedOr docs
Update naming of masked table lookups to follow convention
Optimise MaskedReduceMin/Max
Add TODOs
Remove the masked table lookups
To be added alongside the platform specialisations
Remove unused macros
Rename HWY_SVE_RETV_ARGMVVZ to follow convention
@jan-wassenberg
Copy link
Member

FYI this is stuck behind a failing internal test which seems to be fixed. Re-starting..

@copybara-service copybara-service bot merged commit 326dba3 into google:master Feb 4, 2025
34 of 40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants