2009-10-24 19:06:11 +00:00
|
|
|
/* PCSX2 - PS2 Emulator for PCs
|
2010-05-03 14:08:02 +00:00
|
|
|
* Copyright (C) 2002-2010 PCSX2 Dev Team
|
2010-04-25 00:31:27 +00:00
|
|
|
*
|
2009-10-24 19:06:11 +00:00
|
|
|
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
|
|
|
|
* of the GNU Lesser General Public License as published by the Free Software Found-
|
|
|
|
* ation, either version 3 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
|
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE. See the GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along with PCSX2.
|
|
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
namespace x86Emitter {
|
|
|
|
|
|
|
|
// =====================================================================================================
|
|
|
|
// xImpl_SIMD Types (template free!)
|
|
|
|
// =====================================================================================================
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------
|
|
|
|
// 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
|
|
|
|
2009-10-24 19:06:11 +00:00
|
|
|
void operator()( const xRegisterSSE& to, const xRegisterSSE& from ) const;
|
2010-07-05 19:15:19 +00:00
|
|
|
void operator()( const xRegisterSSE& to, const xIndirectVoid& from ) const;
|
2009-10-24 19:06:11 +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;
|
|
|
|
|
|
|
|
void operator()( const xRegisterSSE& to, const xRegisterSSE& from, u8 imm ) const;
|
2010-07-05 19:15:19 +00:00
|
|
|
void operator()( const xRegisterSSE& to, const xIndirectVoid& from, u8 imm ) const;
|
2009-10-24 19:06:11 +00:00
|
|
|
};
|
|
|
|
|
2009-11-06 21:45:30 +00:00
|
|
|
struct xImplSimd_DestSSE_CmpImm
|
|
|
|
{
|
|
|
|
u8 Prefix;
|
|
|
|
u16 Opcode;
|
|
|
|
|
|
|
|
void operator()( const xRegisterSSE& to, const xRegisterSSE& from, SSE2_ComparisonType imm ) const;
|
2010-07-05 19:15:19 +00:00
|
|
|
void operator()( const xRegisterSSE& to, const xIndirectVoid& from, SSE2_ComparisonType imm ) const;
|
2009-11-06 21:45:30 +00:00
|
|
|
};
|
|
|
|
|
2009-10-24 19:06:11 +00:00
|
|
|
struct xImplSimd_DestRegImmMMX
|
|
|
|
{
|
|
|
|
u8 Prefix;
|
|
|
|
u16 Opcode;
|
|
|
|
|
|
|
|
void operator()( const xRegisterMMX& to, const xRegisterMMX& from, u8 imm ) const;
|
2010-07-05 19:15:19 +00:00
|
|
|
void operator()( const xRegisterMMX& to, const xIndirectVoid& from, u8 imm ) const;
|
2009-10-24 19:06:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------
|
|
|
|
// For implementing MMX/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;
|
|
|
|
|
|
|
|
void operator()( const xRegisterSSE& to, const xRegisterSSE& from ) const;
|
2010-07-05 19:15:19 +00:00
|
|
|
void operator()( const xRegisterSSE& to, const xIndirectVoid& from ) const;
|
2009-10-24 19:06:11 +00:00
|
|
|
|
|
|
|
void operator()( const xRegisterMMX& to, const xRegisterMMX& from ) const;
|
2010-07-05 19:15:19 +00:00
|
|
|
void operator()( const xRegisterMMX& to, const xIndirectVoid& from ) const;
|
2009-10-24 19:06:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // end namespace x86Emitter
|
|
|
|
|