mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2025-12-24 08:14:55 +01:00
backend/x64/emit_x64_vector: Prevent undefined behavior within VectorSignedSaturatedShiftLeft
Avoids undefined behavior by potentially left-shifting a signed negative value.
This commit is contained in:
parent
46eae8cf2f
commit
b37279f65c
1 changed files with 1 additions and 1 deletions
|
|
@ -3838,7 +3838,7 @@ static bool VectorSignedSaturatedShiftLeft(VectorArray<T>& dst, const VectorArra
|
|||
dst[i] = saturate(element);
|
||||
qc_flag = true;
|
||||
} else {
|
||||
const T shifted = element << shift;
|
||||
const T shifted = T(U(element) << shift);
|
||||
|
||||
if ((shifted >> shift) != element) {
|
||||
dst[i] = saturate(element);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue