From 85f407f317d8b33961db7a91b94abb722351f6b6 Mon Sep 17 00:00:00 2001 From: Sandy Carter Date: Sun, 10 Mar 2019 16:15:24 -0400 Subject: [PATCH] [Linux] Fix Value::Not on release Disable optimization on set zero to prevent clang from vectorizing the assigment to zero which would use different registers than expected. --- src/xenia/cpu/hir/value.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/xenia/cpu/hir/value.cc b/src/xenia/cpu/hir/value.cc index ed7bfc440..69a8f783a 100644 --- a/src/xenia/cpu/hir/value.cc +++ b/src/xenia/cpu/hir/value.cc @@ -16,6 +16,12 @@ #include "xenia/base/byte_order.h" #include "xenia/base/math.h" +#if XE_PLATFORM_LINUX +#define OPTNONE __attribute__((optnone)) +#else +#define OPTNONE +#endif // XE_PLATFORM_LINUX + namespace xe { namespace cpu { namespace hir { @@ -757,8 +763,8 @@ void Value::Xor(Value* other) { break; } } - -void Value::Not() { +// Set optnone to prevent clang 6 from optimizing and causing issues +void Value::Not() OPTNONE { switch (type) { case INT8_TYPE: constant.i8 = ~constant.i8;