Skip to content

Add Basic Ops from HEIR's mod_arith dialect #219

Merged
AlexanderViand merged 1 commit intomainfrom
alex/modarith
Mar 27, 2026
Merged

Add Basic Ops from HEIR's mod_arith dialect #219
AlexanderViand merged 1 commit intomainfrom
alex/modarith

Conversation

@AlexanderViand
Copy link
Copy Markdown
Contributor

@AlexanderViand AlexanderViand commented Feb 19, 2026

This commit adds basic syntax and parsing for HEIR's ModArith dialect designed to model modular arithmetic.

  • adds the !mod_arith.int<...> type, which takes an Integer Attribute that specifies both the modulus and container type, e.g., !mod_arith.int< 17 : i64> (or !mod_arith.int<17>, with the container type defaulting to i64).

  • Adds add,sub, and mul binary ops and mod_arith.constant that works analogously to arith.constant

tobiasgrosser added a commit that referenced this pull request Feb 22, 2026
This PR only stablished syntax, but no semantics yet.
It is pulled out of PR #219.

We also increase the max recursion limit as the generation of the
opcode inductive requires a deeper limit.

Co-authored-by: Alexander Viand <AlexanderViand@gmail.com>
github-merge-queue Bot pushed a commit that referenced this pull request Feb 23, 2026
This PR only stablished syntax, but no semantics yet. It is pulled out
of PR #219.

We also increase the max recursion limit as the generation of the opcode
inductive requires a deeper limit.

---------

Co-authored-by: Alexander Viand <AlexanderViand@gmail.com>
@tobiasgrosser
Copy link
Copy Markdown
Collaborator

@AlexanderViand, I rebased this on the latest main.

@AlexanderViand
Copy link
Copy Markdown
Contributor Author

Thanks! I'd suggest we keep this as a draft for now and see if @math-fehr and I can't get this to a proper working-(ish) state during HACS/HACS Hack Day!

@tobiasgrosser tobiasgrosser requested a review from math-fehr March 3, 2026 16:05
@AlexanderViand AlexanderViand force-pushed the alex/modarith branch 4 times, most recently from 4f1e020 to 5f5992e Compare March 10, 2026 13:03
@AlexanderViand AlexanderViand changed the title WIP: Basic Support for HEIR's mod_arith dialect Add Basic Ops from HEIR's mod_arith dialect Mar 27, 2026
@AlexanderViand AlexanderViand marked this pull request as ready for review March 27, 2026 11:04
@AlexanderViand AlexanderViand added this pull request to the merge queue Mar 27, 2026
Merged via the queue into main with commit a78c709 Mar 27, 2026
2 checks passed
@AlexanderViand AlexanderViand deleted the alex/modarith branch March 27, 2026 14:13
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