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

The meaning of rotate_left/right #180

Closed
nixberg opened this issue Nov 4, 2021 · 1 comment · Fixed by #181
Closed

The meaning of rotate_left/right #180

nixberg opened this issue Nov 4, 2021 · 1 comment · Fixed by #181

Comments

@nixberg
Copy link

nixberg commented Nov 4, 2021

Switching a project from packed_simd_2 to simd_core, I noticed that rotate_left and rotate_right have become horizontal operations, borrowing from std::slice.

I believe this to be inconsistent and surprising

  • since I consider SIMD types arithmetic types first,
  • since rotate_left is (conceptually) just (x << n) | (x >> (BITS - n)) and these constituent operations remain vertical,
  • since rotate_left/right already exist in std as (trivially) vertical operations.

Also, there is precedent for horizontal_ operations but not for explicitly vertical ones.

Therefore, whether or not simd_core ends up providing vertical rotation, I propose renaming the methods in question to something like horizontal_rotate_left.

@calebzulawski
Copy link
Member

Relevant discussion: #14 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants