Skip to content
This repository was archived by the owner on Oct 31, 2025. It is now read-only.

Comments

Add vector_insert_dynamic#411

Merged
mergify[bot] merged 5 commits intomainfrom
composite-arch
Feb 11, 2021
Merged

Add vector_insert_dynamic#411
mergify[bot] merged 5 commits intomainfrom
composite-arch

Conversation

@XAMPPRocky
Copy link
Member

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

@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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants