Misc: Support building without -fno-operator-names

Better to have standard compliance, and MSVC in conformance mode needs
it.
This commit is contained in:
Stenzek 2023-05-13 17:23:37 +10:00 committed by refractionpcsx2
parent 16db92526c
commit 0850a3fab7
3 changed files with 15 additions and 24 deletions

View File

@ -139,9 +139,6 @@ if(MSVC AND NOT USE_CLANG_CL)
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:/Zc:externConstexpr>")
elseif(NOT MSVC)
add_compile_options(-pipe -fvisibility=hidden -pthread -fno-builtin-strcmp -fno-builtin-memcmp -mfpmath=sse)
# -fno-operator-names should only be for C++ files, not C files.
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-fno-operator-names>)
endif()
set(CONFIG_REL_NO_DEB $<OR:$<CONFIG:Release>,$<CONFIG:MinSizeRel>>)

View File

@ -603,7 +603,7 @@ void GSDrawScanlineCodeGenerator2::Init()
// int skip = left & 3;
mov(ebx, a1.cvt32());
and(a1.cvt32(), vecints - 1);
and_(a1.cvt32(), vecints - 1);
// left -= skip;
@ -617,7 +617,7 @@ void GSDrawScanlineCodeGenerator2::Init()
mov(eax, a0.cvt32());
sar(eax, 31); // GH: 31 to extract the sign of the register
and(eax, a0.cvt32());
and_(eax, a0.cvt32());
if (isXmm)
shl(eax, 4); // * sizeof(m_test[0])
cdqe();
@ -641,7 +641,7 @@ void GSDrawScanlineCodeGenerator2::Init()
else
{
mov(ebx, a1.cvt32()); // left
xor(a1.cvt32(), a1.cvt32()); // skip
xor_(a1.cvt32(), a1.cvt32()); // skip
lea(a0.cvt32(), ptr[a0 - vecints]); // steps
}
@ -1006,7 +1006,7 @@ void GSDrawScanlineCodeGenerator2::Step()
mov(eax, a0.cvt32());
sar(eax, 31); // GH: 31 to extract the sign of the register
and(eax, a0.cvt32());
and_(eax, a0.cvt32());
if (isXmm)
shl(eax, 4);
cdqe();
@ -1035,7 +1035,7 @@ void GSDrawScanlineCodeGenerator2::TestZ(const XYm& temp1, const XYm& temp2)
mov(t2.cvt32(), dword[t1 + 4]);
add(t2.cvt32(), dword[t0 + 4]);
and(t2.cvt32(), HALF_VM_SIZE - 1);
and_(t2.cvt32(), HALF_VM_SIZE - 1);
// GSVector4i zs = zi;
@ -2411,7 +2411,7 @@ void GSDrawScanlineCodeGenerator2::ReadFrame()
mov(ebx, dword[t1]);
add(ebx, dword[t0]);
and(ebx, HALF_VM_SIZE - 1);
and_(ebx, HALF_VM_SIZE - 1);
if (!m_sel.rfb)
{
@ -2513,7 +2513,7 @@ void GSDrawScanlineCodeGenerator2::WriteMask()
pmovmskb(edx, xym1);
not(edx);
not_(edx);
}
/// Inputs: t2=za, edx=fzm, _zm
@ -2840,7 +2840,7 @@ void GSDrawScanlineCodeGenerator2::WriteFrame()
// y = (top & 3) << 5
mov(eax, ptr[rsp + _top]);
and(eax, 3);
and_(eax, 3);
shl(eax, 5);
// rb = rb.add16(m_global.dimx[0 + y]);
@ -3089,9 +3089,9 @@ void GSDrawScanlineCodeGenerator2::WritePixel(const Xmm& src, const AddressReg&
movd(eax, src);
else
pextrd(eax, src, j);
xor(eax, dst);
and(eax, 0xffffff);
xor(dst, eax);
xor_(eax, dst);
and_(eax, 0xffffff);
xor_(dst, eax);
break;
case 2:
if (j == 0)

View File

@ -15,13 +15,7 @@
#pragma once
#if defined(_MSC_VER) && defined(__clang__)
#define and and_
#define or or_
#define xor xor_
#define not not_
#define XBYAK_NO_OP_NAMES
#endif
#include "xbyak/xbyak.h"
#include "xbyak/xbyak_util.h"
@ -259,16 +253,16 @@ public:
void vzeroall() { requireAVX(); actual.vzeroall(); }
FORWARD_OO_OI(add)
FORWARD_OO_OI(and)
FORWARD_OO_OI(and_)
FORWARD_OO_OI(cmp)
FORWARD_OO_OI(or)
FORWARD_OO_OI(or_)
FORWARD_OO_OI(sub)
FORWARD_OO_OI(xor)
FORWARD_OO_OI(xor_)
FORWARD(2, BASE, lea, const Reg&, const Address&)
FORWARD(2, BASE, mov, const Operand&, size_t)
FORWARD(2, BASE, mov, ARGS_OO)
FORWARD(2, BASE, movzx, const Reg&, const Operand&)
FORWARD(1, BASE, not, const Operand&)
FORWARD(1, BASE, not_, const Operand&)
FORWARD(1, BASE, pop, const Operand&)
FORWARD(1, BASE, push, const Operand&)
FORWARD(2, BASE, sar, const Operand&, const Reg8&)