Further tidy up codegen and somewhat rework the API #149
+2,577
−4,519
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Depends on #148.
This PR intertwines codegen and API changes, unfortunately. Some of the codegen cleanups depend on it.
All the inherent impl methods on individual SIMD types are now gone entirely. Most of them were previously already accessible via the
core::opstraits,SimdBase/SimdInt/SimdFloat/SimdMask, or individual bespoke traits. The exceptions were split/combine. There was no inherentsplitmethod at all, and I've removed the inherentcombinemethod. In its place I've added newSimdCombineandSimdSplittraits, which are implemented for types of the proper vector width.Since all the operations need to be accessed via trait methods, I've added a
preludemodule tofearless_simd, which re-exports just the traits. This lets API consumers import every necessary trait to access all the methods, without being forced to either import every trait individually or just wildcard-import every single item fromfearless_simd.I'm not entirely happy with the current
SimdCvtTruncateandSimdCvtFloattraits--it's unclear which is the source and which is the destination,to_intandto_floatare technically implemented for allSimdFloatandSimdInttypes even though they only work on 32-bit ones, and they require passing in the full vector equivalent (withStype parameter) as a type. Improving that is future work.Aside from all that, this PR is about further centralizing the codegen in preparation for adding documentation generation. I want to make it as operation-centric as possible, moving op-specific special cases out of each module generation method and into the operation metadata itself.