Fix shift filling by flipping inkwell sign_extend flags

See https://thedan64.github.io/inkwell/inkwell/builder/struct.Builder.html#method.build_right_shift

Before:
```
» Num.shiftRightBy 1 -8

9223372036854775804 : Int *

» Num.shiftRightZfBy 1 -8

-4 : Int *
```

After:
```
» Num.shiftRightBy 1 -8

-4 : Int *

» Num.shiftRightZfBy 1 -8

9223372036854775804 : Int *
```
This commit is contained in:
Jan Van Bruggen 2022-03-19 22:21:51 -06:00
parent 68adeba43c
commit 7d95d2b576

View file

@ -6661,12 +6661,12 @@ fn build_int_binop<'a, 'ctx, 'env>(
} }
NumShiftRightBy => { NumShiftRightBy => {
// NOTE arguments are flipped; // NOTE arguments are flipped;
bd.build_right_shift(rhs, lhs, false, "int_shift_right") bd.build_right_shift(rhs, lhs, true, "int_shift_right")
.into() .into()
} }
NumShiftRightZfBy => { NumShiftRightZfBy => {
// NOTE arguments are flipped; // NOTE arguments are flipped;
bd.build_right_shift(rhs, lhs, true, "int_shift_right_zf") bd.build_right_shift(rhs, lhs, false, "int_shift_right_zf")
.into() .into()
} }