summaryrefslogtreecommitdiff
path: root/Source/Core/Common/FileUtil.cpp
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2023-02-14 18:39:00 +0100
committerJosJuice <josjuice@gmail.com>2023-02-14 19:16:00 +0100
commit0049a767751807c124f099a7ba7f9a3add7c18f7 (patch)
tree8b9b3e78bd35ca61b474d6d167410ba94c53d5a7 /Source/Core/Common/FileUtil.cpp
parent9d139ea84e426a0829fcb7c8bd1959f341427349 (diff)
JitArm64: Fix special cases of cmp
This fixes a regression from 592ba31. When `a` was a constant 0 and `b` was a non-constant 0x80000000, the 32-bit negation operation would overflow, causing an incorrect result. The sign extension needs to happen before the negation to avoid overflow. Note that I can't merge the SXTW and NEG into one instruction. NEG is an alias for SUB with the first operand being set to ZR, but "SUB (extended register)" treats register 31 as SP instead of ZR. I've also changed the order for the case where `a` is a constant 0xFFFFFFFF. I don't think the order actually affects correctness here, but let's use the same order for all the cases since it makes the code easier to reason about.
Diffstat (limited to 'Source/Core/Common/FileUtil.cpp')
0 files changed, 0 insertions, 0 deletions