Skip to content

[mlir][dxsa] Add dadd, ddiv, dmax, dmin, dmul and drcp instructions#190

Open
tagolog wants to merge 2 commits into
dxsa-mlirfrom
vshiryaev/dxsa-mlir-double-arithmetic-instructions
Open

[mlir][dxsa] Add dadd, ddiv, dmax, dmin, dmul and drcp instructions#190
tagolog wants to merge 2 commits into
dxsa-mlirfrom
vshiryaev/dxsa-mlir-double-arithmetic-instructions

Conversation

@tagolog

@tagolog tagolog commented Jun 21, 2026

Copy link
Copy Markdown

Example:
dxsa.dadd r<0>, r<1>, r<2>
dxsa.ddiv r<0>, r<1>, r<2>
dxsa.dmax r<0>, r<1>, r<2>
dxsa.dmin r<0>, r<1>, r<2>
dxsa.dmul r<0>, r<1>, r<2>
dxsa.drcp r<0>, r<1>

@tagolog tagolog requested review from asavonic, asl and hvdijk June 21, 2026 00:15
@tagolog tagolog self-assigned this Jun 21, 2026
// dxsa.dadd_sat
//===----------------------------------------------------------------------===//

def DXSA_DaddSat : DXSA_BinaryOp<"dadd_sat"> {

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.

I'm seeing in the documentation that _sat is an instruction modifier, these aren't actually separate instructions? In that case, would it make sense to find a way to avoid duplicating almost every instruction?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

We decided to support _sat as a separate instruction (s) and a lot of instructions already implemented in this manner.

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.

That seems inconsistent with the logic @asl gave in #194 against structured MLIR: "This is a bytecode dialect." In the bytecode, these aren't separate opcodes, so if we're modelling the MLIR after what the bytecode looks like, they shouldn't be separate instructions.

If it's decided that we're doing things this way then I'm of course not going to hold up this PR over it; I'm just leaving this comment to make it clear to anyone reading that it's intentional.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@asl what do you mean?

Comment thread mlir/lib/Target/DXSA/BinaryParser.cpp Outdated
tagolog added 2 commits June 25, 2026 11:49
Example:
  dxsa.dadd r<0>, r<1>, r<2>
  dxsa.ddiv r<0>, r<1>, r<2>
  dxsa.dmax r<0>, r<1>, r<2>
  dxsa.dmin r<0>, r<1>, r<2>
  dxsa.dmul r<0>, r<1>, r<2>
  dxsa.drcp r<0>, r<1>

Signed-off-by: Vladimir Shiryaev <vshiryaev@accesssoftek.com>
…e with --split-input-file

Signed-off-by: Vladimir Shiryaev <vshiryaev@accesssoftek.com>
@tagolog tagolog force-pushed the vshiryaev/dxsa-mlir-double-arithmetic-instructions branch from c85908c to f393bc7 Compare June 25, 2026 20:02
@tagolog tagolog requested review from asl and hvdijk June 25, 2026 20:05
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