shader/shift: Implement SHR wrapped and clamped variants

Nvidia defaults to wrapped shifts, but this is undefined behaviour on
OpenGL's spec. Explicitly mask/clamp according to what the guest shader
requires.
This commit is contained in:
ReinUsesLisp 2019-08-31 17:06:00 -03:00
parent 922c7f4e51
commit 77ef4fa907
2 changed files with 17 additions and 6 deletions

View file

@ -674,6 +674,10 @@ union Instruction {
BitField<48, 1, u64> is_signed;
} shift;
union {
BitField<39, 1, u64> wrap;
} shr;
union {
BitField<39, 5, u64> shift_amount;
BitField<48, 1, u64> negate_b;