From 2b411f4c8b6a2975ee95c5ace53d6f7856338d66 Mon Sep 17 00:00:00 2001 From: Triang3l Date: Fri, 19 Jul 2019 08:22:30 +0300 Subject: [PATCH] [CPU] Saturating VectorSub: fix typo in last commit --- src/xenia/cpu/hir/value.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/xenia/cpu/hir/value.cc b/src/xenia/cpu/hir/value.cc index 23fd12403..07d48ad12 100644 --- a/src/xenia/cpu/hir/value.cc +++ b/src/xenia/cpu/hir/value.cc @@ -1351,7 +1351,7 @@ void Value::VectorSub(Value* other, TypeName type, bool is_unsigned, result &= -int8_t(result <= src1); } else { uint8_t overflowed = (src1 >> 7) + INT8_MAX; - if (int8_t((overflowed ^ src2) & (overflowed ^ result)) >= 0) { + if (int8_t((overflowed ^ src2) & (overflowed ^ result)) < 0) { result = overflowed; } } @@ -1379,7 +1379,7 @@ void Value::VectorSub(Value* other, TypeName type, bool is_unsigned, result &= -int16_t(result <= src1); } else { uint16_t overflowed = (src1 >> 15) + INT16_MAX; - if (int16_t((overflowed ^ src2) & (overflowed ^ result)) >= 0) { + if (int16_t((overflowed ^ src2) & (overflowed ^ result)) < 0) { result = overflowed; } } @@ -1407,7 +1407,7 @@ void Value::VectorSub(Value* other, TypeName type, bool is_unsigned, result &= -int32_t(result <= src1); } else { uint32_t overflowed = (src1 >> 31) + INT32_MAX; - if (int32_t((overflowed ^ src2) & (overflowed ^ result)) >= 0) { + if (int32_t((overflowed ^ src2) & (overflowed ^ result)) < 0) { result = overflowed; } } @@ -1435,7 +1435,7 @@ void Value::VectorSub(Value* other, TypeName type, bool is_unsigned, result &= -int64_t(result <= src1); } else { uint64_t overflowed = (src1 >> 63) + INT64_MAX; - if (int64_t((overflowed ^ src2) & (overflowed ^ result)) >= 0) { + if (int64_t((overflowed ^ src2) & (overflowed ^ result)) < 0) { result = overflowed; } }