Skip to content

Shift broken for large LogicValues #110

@mkorbel1

Description

@mkorbel1

Describe the bug

Shift operations for large LogicValues (near/at the 64-bit int max or above into BigInt territory) cause a variety of exceptions and incorrect behavior.

To Reproduce

Here's a couple tests that fail:

      expect((LogicValue.filled(64, LogicValue.one) >> 2).toInt(),
          equals(-1 >> 2));
      expect(
          (LogicValue.filled(65, LogicValue.one) >> 10),
          equals([
            LogicValue.filled(10, LogicValue.zero),
            LogicValue.filled(55, LogicValue.one)
          ].swizzle()));

Expected behavior

No exceptions and accurate behavior.

Actual behavior

Exceptions and incorrect behavior.

Additional details

Extensive testing around this area needs to be added.

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions