2023-12-22 11:57:49 +00:00
|
|
|
// SPDX-FileCopyrightText: 2002-2023 PCSX2 Dev Team
|
|
|
|
// SPDX-License-Identifier: LGPL-3.0+
|
2009-04-17 18:47:04 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2009-04-24 11:25:10 +00:00
|
|
|
// Implementations found here: TEST + BTS/BT/BTC/BTR + BSF/BSR! (for lack of better location)
|
|
|
|
|
2016-11-12 15:28:37 +00:00
|
|
|
namespace x86Emitter
|
|
|
|
{
|
2009-11-06 21:45:30 +00:00
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
// --------------------------------------------------------------------------------------
|
|
|
|
// xImpl_Test
|
|
|
|
// --------------------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
struct xImpl_Test
|
|
|
|
{
|
|
|
|
void operator()(const xRegisterInt& to, const xRegisterInt& from) const;
|
|
|
|
void operator()(const xIndirect64orLess& dest, int imm) const;
|
|
|
|
void operator()(const xRegisterInt& to, int imm) const;
|
|
|
|
};
|
2009-04-24 11:25:10 +00:00
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
enum G8Type
|
|
|
|
{
|
|
|
|
G8Type_BT = 4,
|
|
|
|
G8Type_BTS,
|
|
|
|
G8Type_BTR,
|
|
|
|
G8Type_BTC,
|
|
|
|
};
|
2009-04-17 18:47:04 +00:00
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
// --------------------------------------------------------------------------------------
|
|
|
|
// BSF / BSR
|
|
|
|
// --------------------------------------------------------------------------------------
|
|
|
|
// 16/32 operands are available. No 8 bit ones, not that any of you cared, I bet.
|
|
|
|
//
|
|
|
|
struct xImpl_BitScan
|
|
|
|
{
|
|
|
|
// 0xbc [fwd] / 0xbd [rev]
|
|
|
|
u16 Opcode;
|
2009-04-17 18:47:04 +00:00
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
void operator()(const xRegister16or32or64& to, const xRegister16or32or64& from) const;
|
|
|
|
void operator()(const xRegister16or32or64& to, const xIndirectVoid& sibsrc) const;
|
|
|
|
};
|
2009-04-17 18:47:04 +00:00
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
// --------------------------------------------------------------------------------------
|
|
|
|
// xImpl_Group8
|
|
|
|
// --------------------------------------------------------------------------------------
|
|
|
|
// Bit Test Instructions - Valid on 16/32 bit instructions only.
|
|
|
|
//
|
|
|
|
struct xImpl_Group8
|
|
|
|
{
|
|
|
|
G8Type InstType;
|
2009-04-24 11:25:10 +00:00
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
void operator()(const xRegister16or32or64& bitbase, const xRegister16or32or64& bitoffset) const;
|
|
|
|
void operator()(const xRegister16or32or64& bitbase, u8 bitoffset) const;
|
2009-04-24 11:25:10 +00:00
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
void operator()(const xIndirectVoid& bitbase, const xRegister16or32or64& bitoffset) const;
|
2016-01-16 22:17:04 +00:00
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
void operator()(const xIndirect64& bitbase, u8 bitoffset) const;
|
|
|
|
void operator()(const xIndirect32& bitbase, u8 bitoffset) const;
|
|
|
|
void operator()(const xIndirect16& bitbase, u8 bitoffset) const;
|
|
|
|
};
|
2009-11-06 21:45:30 +00:00
|
|
|
|
2016-11-12 15:28:37 +00:00
|
|
|
} // End namespace x86Emitter
|