[HWArith] Does it make sense to add an arithmetic negation unary op?
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 2.2k
- Forks
- 524
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 46
Description
I've been reading https://circt.llvm.org/docs/Dialects/HWArith/RationaleHWArith/ and start to wonder if an arithmetic negation op also fits here?
Proposal for the type inference rules:
| Operand type | Result type | |
|---|---|---|
| (U) | ui<a> |
si<r>, r = a + 1 |
| (S) | si<a> |
si<r>, r = a + 1 |
This is essentially the existing subtraction rules with a == 0. But since it's said that 0-width values are not supported yet. Maybe it's useful to add arithmetic negation on its own?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the HWArith Rationale document and its existing subtraction rules, then review the proposed unsigned and signed type-inference cases. The issue names no implementation file or test; done would require a settled decision on whether unary arithmetic negation belongs in HWArith and an agreed implementation and verification plan.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100