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

Add vector_insert_dynamic #411

Merged
merged 5 commits into from
Feb 11, 2021
Merged

Add vector_insert_dynamic #411

merged 5 commits into from
Feb 11, 2021

Conversation

XAMPPRocky
Copy link
Member

Adds two new simple instructions to the arch module that map to OpVectorInsertDynamic and OpCopyObject instructions.

crates/spirv-std/src/arch.rs Outdated Show resolved Hide resolved
@XAMPPRocky XAMPPRocky changed the title Add vector_insert_dynamic and copy_object Add vector_insert_dynamic Feb 10, 2021
@XAMPPRocky XAMPPRocky force-pushed the composite-arch branch 2 times, most recently from 6aa874c to 5ab9aee Compare February 11, 2021 13:46
Comment on lines 374 to 376
// FIXME(eddyb) missing equality constraint between input and output vectors.
(Vector(T), T, _) -> Vector(T)
// (Vector(T), T, _) -> Vector(T)
(T, _, _) -> T
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, mind changing the comment to something like this? just so it's super clear what's going on:

            // FIXME(eddyb) was `(Vector(T), T, _) -> Vector(T)` but that was
            // missing an equality constraint between input and output vectors;
            // we should use `(Vector(T, N), T, _) -> Vector(T, N)`, or constrain
            // input and output vectors to have the same type some other way.
            (T, _, _) -> T

asm! {
"%vector = OpLoad _ {vector}",
"%element = OpLoad _ {element}",
"%new_vector = OpVectorInsertDynamic _ %vector %element {index}",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @msiglreith this works now 🎉

@mergify mergify bot merged commit c10a6c0 into main Feb 11, 2021
@mergify mergify bot deleted the composite-arch branch February 11, 2021 15:18
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 this pull request may close these issues.

3 participants