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

SIMD support #4

Closed
djkoloski opened this issue Aug 6, 2021 · 1 comment
Closed

SIMD support #4

djkoloski opened this issue Aug 6, 2021 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@djkoloski
Copy link
Collaborator

While adding rkyv support to glam, the question came up of how to handle SIMD-optimized types. There are a few pieces here:

  • SIMD types should ideally have the same archived and unarchived representations. Otherwise, the same code would be duplicated many more times to support explicitly-endian types like f32_le and i64_be.
  • Some types may have different layouts depending on whether SIMD support is enabled. Many SIMD types have higher alignment, for example.
  • On-demand endianness conversions (for example, reading an i32_be on a little-endian machine) may have negative performance impacts and should be carefully benchmarked.

With those in mind, let's take a look at the following:

  • Can common types like vectors and matrices be parameterized over rend types? For example type Vec2_le = XY<f32_le> and type Vec2_be = XY<f32_be>?
  • Should archived types have their alignments artificially raised to the highest common alignment? This may affect packing performance.
  • Should SIMD types be archived as more basic data types and only be converted to SIMD types on read? This would be sad for performance but good for sanity. Maybe having a wrapper type to allow for either behavior would be best?

With the concrete goals:

  • Determine the best approach for archiving explicitly-endian data with respect to compatibility, ergonomics, code impact, and performance.
  • Get some proofs of the concept working with glam and consider looking at other popular vector math libraries like cgmath and uv.
  • Perform some benchmarking to figure out the performance story.
@djkoloski djkoloski added the enhancement New feature or request label Aug 6, 2021
@djkoloski djkoloski self-assigned this Aug 6, 2021
@djkoloski
Copy link
Collaborator Author

I don't think this is as valuable as it seemed when it was written. Closing this issue.

@djkoloski djkoloski closed this as not planned Won't fix, can't repro, duplicate, stale Aug 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant