When converting to any signed integer type that was longer than the input type during CastOp folding, the operand was always sign extended. This resulted in an incorrect conversion for unsigned and signless operands with a set most significant bit. E.g.
Operands that are casted to a signed integer type are now zero extended instead if the input was not a signed integer type as well. There is a small test to guarantee the correct conversion.
This PR aims to fix #680.
When converting to any signed integer type that was longer than the input type during
CastOp
folding, the operand was always sign extended. This resulted in an incorrect conversion for unsigned and signless operands with a set most significant bit. E.g.Operands that are casted to a signed integer type are now zero extended instead if the input was not a signed integer type as well. There is a small test to guarantee the correct conversion.