[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.
This commit is contained in:
Sandy Carter 2019-03-10 16:15:24 -04:00
parent ee7f68a85f
commit 85f407f317
1 changed files with 8 additions and 2 deletions

View File

@ -16,6 +16,12 @@
#include "xenia/base/byte_order.h" #include "xenia/base/byte_order.h"
#include "xenia/base/math.h" #include "xenia/base/math.h"
#if XE_PLATFORM_LINUX
#define OPTNONE __attribute__((optnone))
#else
#define OPTNONE
#endif // XE_PLATFORM_LINUX
namespace xe { namespace xe {
namespace cpu { namespace cpu {
namespace hir { namespace hir {
@ -757,8 +763,8 @@ void Value::Xor(Value* other) {
break; break;
} }
} }
// Set optnone to prevent clang 6 from optimizing and causing issues
void Value::Not() { void Value::Not() OPTNONE {
switch (type) { switch (type) {
case INT8_TYPE: case INT8_TYPE:
constant.i8 = ~constant.i8; constant.i8 = ~constant.i8;