Support 4-wide vector type definitions via Frontend setting#2573
Open
green-real wants to merge 1 commit into
Open
Support 4-wide vector type definitions via Frontend setting#2573green-real wants to merge 1 commit into
green-real wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
The embedded builtin type definitions describe
vectoras 3-wide unconditionally, so under a VM built withLUA_VECTOR_SIZE == 4the analyzer is wrong: it misses thewcomponent and rejects the fourthcreateargument. This PR makes the vector width a runtime choice on theFrontendso a single Analysis build can serve either 3 or 4 wide vectors.Changes
A
VectorSizeenum (Three/Four, so only valid widths are representable) becomes a setting on theFrontend, mirroringSolverMode:getVectorSize()/setVectorSize()over an atomic member, defaults toThreeto preserve existing behavior. Both the 3-wide and 4-wide vector definitions are compiled in and chosen at runtime when builtins are registered; the shared method list is a single definition. The width is supplied by the embedder, so the Analysis library does not depend on the VM's configuration header.The bundled CLIs set
VectorSizefrom the LUA_VECTOR_SIZE they were built with; other embedders (e.g. an LSP) may set it from their own config.The default (
VectorSize::Three) definition source is byte-for-byte identical to before, so existing behavior is unchanged.The
VectorSize::Foursource adds exactly theread w: numbercomponent and thew: number?argument tocreate.