Fix instruction overflow/underflow problem

There are undefined behaviors of integer type overflow/underflow in
arithmetic/logic operations.

Cast the inputs to the proper data type before the operation to avoid
undefined behaviors.

Modify the test input vectors to ensure the min/max of the input type is covered.

PiperOrigin-RevId: 551429757
3 files changed
tree: 1732c94bcd90dced0123b2ee67cbce83a4d378bf
  1. sim/
  2. .bazelrc
  3. .gitignore
  4. BUILD