2023-12-22 11:57:49 +00:00
|
|
|
// SPDX-FileCopyrightText: 2002-2023 PCSX2 Dev Team
|
|
|
|
// SPDX-License-Identifier: LGPL-3.0+
|
2009-10-24 19:06:11 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2016-11-12 15:28:37 +00:00
|
|
|
namespace x86Emitter
|
|
|
|
{
|
2009-10-24 19:06:11 +00:00
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
// =====================================================================================================
|
|
|
|
// xImpl_SIMD Types (template free!)
|
|
|
|
// =====================================================================================================
|
2009-10-24 19:06:11 +00:00
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
// ------------------------------------------------------------------------
|
|
|
|
// For implementing SSE-only logic operations that have xmmreg,xmmreg/rm forms only,
|
|
|
|
// like ANDPS/ANDPD
|
|
|
|
//
|
|
|
|
struct xImplSimd_DestRegSSE
|
|
|
|
{
|
|
|
|
u8 Prefix;
|
|
|
|
u16 Opcode;
|
2010-04-25 00:31:27 +00:00
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
void operator()(const xRegisterSSE& to, const xRegisterSSE& from) const;
|
|
|
|
void operator()(const xRegisterSSE& to, const xIndirectVoid& from) const;
|
|
|
|
};
|
2009-10-24 19:06:11 +00:00
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
// ------------------------------------------------------------------------
|
|
|
|
// For implementing SSE-only logic operations that have xmmreg,reg/rm,imm forms only
|
|
|
|
// (PSHUFD / PSHUFHW / etc).
|
|
|
|
//
|
|
|
|
struct xImplSimd_DestRegImmSSE
|
|
|
|
{
|
|
|
|
u8 Prefix;
|
|
|
|
u16 Opcode;
|
2009-10-24 19:06:11 +00:00
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
void operator()(const xRegisterSSE& to, const xRegisterSSE& from, u8 imm) const;
|
|
|
|
void operator()(const xRegisterSSE& to, const xIndirectVoid& from, u8 imm) const;
|
|
|
|
};
|
2009-10-24 19:06:11 +00:00
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
struct xImplSimd_DestSSE_CmpImm
|
|
|
|
{
|
|
|
|
u8 Prefix;
|
|
|
|
u16 Opcode;
|
2009-11-06 21:45:30 +00:00
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
void operator()(const xRegisterSSE& to, const xRegisterSSE& from, SSE2_ComparisonType imm) const;
|
|
|
|
void operator()(const xRegisterSSE& to, const xIndirectVoid& from, SSE2_ComparisonType imm) const;
|
|
|
|
};
|
2009-11-06 21:45:30 +00:00
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
// ------------------------------------------------------------------------
|
|
|
|
// For implementing SSE operations that have reg,reg/rm forms only,
|
|
|
|
// but accept either MM or XMM destinations (most PADD/PSUB and other P arithmetic ops).
|
|
|
|
//
|
|
|
|
struct xImplSimd_DestRegEither
|
|
|
|
{
|
|
|
|
u8 Prefix;
|
|
|
|
u16 Opcode;
|
2009-10-24 19:06:11 +00:00
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
void operator()(const xRegisterSSE& to, const xRegisterSSE& from) const;
|
|
|
|
void operator()(const xRegisterSSE& to, const xIndirectVoid& from) const;
|
|
|
|
};
|
2009-10-24 19:06:11 +00:00
|
|
|
|
2016-11-12 15:28:37 +00:00
|
|
|
} // end namespace x86Emitter
|