llvm / llvm/circt

[Comb] Shift operands need not be the same width

Open
#3,285 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Comb
Dominant language
C++
Stars
2.2k
Forks
524
Avg merge
3d 2h
Merged PRs (30d)
46

Description

Currently, all shift operations require their operands to all be the same type. This is logically wrong. If anything, the `rhs` should be `clog2(lhs)`. Am I right? Is there a particular reason we do things this way?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test is named. Start by locating the Comb shift operations and their operand type constraints, then determine whether allowing a narrower rhs based on clog2(lhs) is intended and what existing behavior must remain compatible. Done means the expected operand-width rule and its implementation and tests are clearly established.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.