Skip to content

Add shift left/right by constant amount #378

Closed
@whitequark

Description

@whitequark

This has several benefits:

  • Parity with Add rotate left/right by constant amount #339;
  • Unlike <</>>, shift_left/shift_right can accept a signed argument without it being a Python compatibility hazard;
  • Unlike <</>>, shift_left/shift_right can return a result that has the exact bit width, as opposed to the most conservative overapproximation. I expect that at some point it will be requested that width inference for <</>> be special-cased for constant amounts, and this is a good way to preempt that.

Note that unlike rotate_{left,right}, shift_{left,right} should return a signed result if the LHS is signed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions