Skip to content

[HWArith] Does it make sense to add an arithmetic negation unary op? #8493

Open
@qobilidop

Description

@qobilidop

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions