Skip to content

[mlir][dxsa] Add mov, dmov, movc and swapc instructions#207

Merged
tagolog merged 3 commits into
dxsa-mlirfrom
vshiryaev/dxsa-mlir-mov-dmov
Jul 1, 2026
Merged

[mlir][dxsa] Add mov, dmov, movc and swapc instructions#207
tagolog merged 3 commits into
dxsa-mlirfrom
vshiryaev/dxsa-mlir-mov-dmov

Conversation

@tagolog

@tagolog tagolog commented Jun 27, 2026

Copy link
Copy Markdown

Example:
dxsa.mov r<0>, r<1>
dxsa.dmov r<0, <x, y>>, -|r<1, <z, w, x, y>>|
dxsa.dmovc r<0>, r<1>, r<2>, r<3>
dxsa.swapc r<0>, r<1>, r<2>, r<3>, r<4>

@tagolog tagolog self-assigned this Jun 27, 2026
@tagolog tagolog changed the title [mlir][dxsa] Add mov and dmov instructions [mlir][dxsa] Add mov, dmov and swapc instructions Jun 28, 2026
@tagolog tagolog changed the title [mlir][dxsa] Add mov, dmov and swapc instructions [mlir][dxsa] Add mov, dmov, movc and swapc instructions Jun 28, 2026
Comment thread mlir/include/mlir/Dialect/DXSA/IR/DXSAMoveOps.td
```

Both destinations are updated atomically with respect to the source
values, so reading and writing the same register is well-defined.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It's well-defined but with different semantics than the above pseudocode and this description suggest. This description suggests $dst0 is updated atomically, and then $dst1 is updated atomically. That's not what happens and not how Microsoft document it (they introduce a temp variable to make the meaning clear).

@asavonic asavonic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. Please address Harald's comment on the doc.
Regarding _sat, it is the same issue as in #190. Let's keep instructions consistent for now, and if we implement sat as an attribute, we can refactor this patch.

tagolog added 3 commits July 1, 2026 13:06
Example:
 dxsa.mov r<0>, r<1>
 dxsa.dmov r<0, <x, y>>, -|r<1, <z, w, x, y>>|

Signed-off-by: Vladimir Shiryaev <vshiryaev@accesssoftek.com>
Example:
  dxsa.swapc r<0>, r<1>, r<2>, r<3>, r<4>

Signed-off-by: Vladimir Shiryaev <vshiryaev@accesssoftek.com>
Example:
  dxsa.dmovc r<0>, r<1>, r<2>, r<3>

Signed-off-by: Vladimir Shiryaev <vshiryaev@accesssoftek.com>
@tagolog tagolog force-pushed the vshiryaev/dxsa-mlir-mov-dmov branch from 5b52e8e to 3000acf Compare July 1, 2026 20:08
@tagolog tagolog merged commit e2595a0 into dxsa-mlir Jul 1, 2026
5 checks passed
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