commit new added files
This commit is contained in:
parent
94864fb9bc
commit
a06fba41ab
222
bochs/cpu/avx512_mask32.cc
Normal file
222
bochs/cpu/avx512_mask32.cc
Normal file
@ -0,0 +1,222 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id$
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (c) 2014 Stanislav Shwartsman
|
||||
// Written by Stanislav Shwartsman [sshwarts at sourceforge net]
|
||||
//
|
||||
// This library 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 Foundation; either
|
||||
// version 2 of the License, or (at your option) any later version.
|
||||
//
|
||||
// This library 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
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA B 02110-1301 USA
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define NEED_CPU_REG_SHORTCUTS 1
|
||||
#include "bochs.h"
|
||||
#include "cpu.h"
|
||||
#define LOG_THIS BX_CPU_THIS_PTR
|
||||
|
||||
#if BX_SUPPORT_AVX
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KADDD_KGdKHdKEdR(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
Bit32u opmask = BX_READ_32BIT_OPMASK(i->src1()) + BX_READ_32BIT_OPMASK(i->src2());
|
||||
BX_WRITE_OPMASK(i->dst(), opmask);
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KANDD_KGdKHdKEdR(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
Bit32u opmask = BX_READ_32BIT_OPMASK(i->src1()) & BX_READ_32BIT_OPMASK(i->src2());
|
||||
BX_WRITE_OPMASK(i->dst(), opmask);
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KANDND_KGdKHdKEdR(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
Bit32u opmask = ~(BX_READ_32BIT_OPMASK(i->src1())) & BX_READ_32BIT_OPMASK(i->src2());
|
||||
BX_WRITE_OPMASK(i->dst(), opmask);
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KMOVD_KGdKEdM(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
bx_address eaddr = BX_CPU_CALL_METHODR(i->ResolveModrm, (i));
|
||||
Bit32u opmask = read_virtual_dword(i->seg(), eaddr);
|
||||
BX_WRITE_OPMASK(i->dst(), opmask);
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KMOVD_KGdKEdR(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
BX_WRITE_OPMASK(i->dst(), BX_READ_32BIT_OPMASK(i->src()));
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KMOVD_KEdKGdM(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
bx_address eaddr = BX_CPU_CALL_METHODR(i->ResolveModrm, (i));
|
||||
write_virtual_dword(i->seg(), eaddr, BX_READ_32BIT_OPMASK(i->src()));
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KMOVD_KGdEdR(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
BX_WRITE_OPMASK(i->dst(), BX_READ_32BIT_REG(i->src()));
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KMOVD_GdKEdR(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
BX_WRITE_32BIT_REGZ(i->dst(), BX_READ_32BIT_OPMASK(i->src()));
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KUNPCKWD_KGdKHwKEwR(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
Bit32u opmask = BX_READ_16BIT_OPMASK(i->src1());
|
||||
opmask = (opmask << 16) | BX_READ_16BIT_OPMASK(i->src2());
|
||||
|
||||
BX_WRITE_OPMASK(i->dst(), opmask);
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KNOTD_KGdKEdR(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
Bit32u opmask = ~BX_READ_32BIT_OPMASK(i->src());
|
||||
BX_WRITE_OPMASK(i->dst(), opmask);
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KORD_KGdKHdKEdR(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
Bit32u opmask = BX_READ_32BIT_OPMASK(i->src1()) | BX_READ_32BIT_OPMASK(i->src2());
|
||||
BX_WRITE_OPMASK(i->dst(), opmask);
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KORTESTD_KGdKEdR(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
Bit32u tmp = BX_READ_32BIT_OPMASK(i->src1()) | BX_READ_32BIT_OPMASK(i->src2());
|
||||
unsigned flags = 0;
|
||||
if (tmp == 0)
|
||||
flags |= EFlagsZFMask;
|
||||
else if (tmp == 0xffffffff)
|
||||
flags |= EFlagsCFMask;
|
||||
|
||||
setEFlagsOSZAPC(flags);
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KSHIFTLD_KGdKEdIbR(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
unsigned count = i->Ib();
|
||||
Bit32u opmask = 0;
|
||||
if (count < 32)
|
||||
opmask = BX_READ_32BIT_OPMASK(i->src()) << count;
|
||||
|
||||
BX_WRITE_OPMASK(i->dst(), opmask);
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KSHIFTRD_KGdKEdIbR(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
unsigned count = i->Ib();
|
||||
Bit32u opmask = 0;
|
||||
if (count < 32)
|
||||
opmask = BX_READ_32BIT_OPMASK(i->src()) >> count;
|
||||
|
||||
BX_WRITE_OPMASK(i->dst(), opmask);
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KXNORD_KGdKHdKEdR(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
Bit32u opmask = ~(BX_READ_32BIT_OPMASK(i->src1()) ^ BX_READ_32BIT_OPMASK(i->src2()));
|
||||
BX_WRITE_OPMASK(i->dst(), opmask);
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KXORD_KGdKHdKEdR(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
Bit32u opmask = BX_READ_32BIT_OPMASK(i->src1()) ^ BX_READ_32BIT_OPMASK(i->src2());
|
||||
BX_WRITE_OPMASK(i->dst(), opmask);
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KTESTD_KGdKEdR(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
Bit32u op1 = BX_READ_32BIT_OPMASK(i->src1()), op2 = BX_READ_32BIT_OPMASK(i->src2());
|
||||
unsigned flags = 0;
|
||||
|
||||
if ((op1 & op2) == 0)
|
||||
flags |= EFlagsZFMask;
|
||||
if ((~op1 & op2) == 0)
|
||||
flags |= EFlagsCFMask;
|
||||
|
||||
setEFlagsOSZAPC(flags);
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
#endif
|
221
bochs/cpu/avx512_mask64.cc
Normal file
221
bochs/cpu/avx512_mask64.cc
Normal file
@ -0,0 +1,221 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id$
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (c) 2014 Stanislav Shwartsman
|
||||
// Written by Stanislav Shwartsman [sshwarts at sourceforge net]
|
||||
//
|
||||
// This library 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 Foundation; either
|
||||
// version 2 of the License, or (at your option) any later version.
|
||||
//
|
||||
// This library 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
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA B 02110-1301 USA
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define NEED_CPU_REG_SHORTCUTS 1
|
||||
#include "bochs.h"
|
||||
#include "cpu.h"
|
||||
#define LOG_THIS BX_CPU_THIS_PTR
|
||||
|
||||
#if BX_SUPPORT_AVX
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KADDQ_KGqKHqKEqR(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
Bit64u opmask = BX_READ_OPMASK(i->src1()) + BX_READ_OPMASK(i->src2());
|
||||
BX_WRITE_OPMASK(i->dst(), opmask);
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KANDQ_KGqKHqKEqR(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
Bit64u opmask = BX_READ_OPMASK(i->src1()) & BX_READ_OPMASK(i->src2());
|
||||
BX_WRITE_OPMASK(i->dst(), opmask);
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KANDNQ_KGqKHqKEqR(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
Bit64u opmask = ~(BX_READ_OPMASK(i->src1())) & BX_READ_OPMASK(i->src2());
|
||||
BX_WRITE_OPMASK(i->dst(), opmask);
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KMOVQ_KGqKEqM(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
bx_address eaddr = BX_CPU_CALL_METHODR(i->ResolveModrm, (i));
|
||||
Bit64u opmask = read_virtual_qword(i->seg(), eaddr);
|
||||
BX_WRITE_OPMASK(i->dst(), opmask);
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KMOVQ_KGqKEqR(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
BX_WRITE_OPMASK(i->dst(), BX_READ_OPMASK(i->src()));
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KMOVQ_KEqKGqM(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
bx_address eaddr = BX_CPU_CALL_METHODR(i->ResolveModrm, (i));
|
||||
write_virtual_qword(i->seg(), eaddr, BX_READ_OPMASK(i->src()));
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KMOVQ_KGqEqR(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
BX_WRITE_OPMASK(i->dst(), BX_READ_64BIT_REG(i->src()));
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KMOVQ_GqKEqR(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
BX_WRITE_64BIT_REG(i->dst(), BX_READ_OPMASK(i->src()));
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KUNPCKDQ_KGqKHdKEdR(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
Bit64u opmask = BX_READ_32BIT_OPMASK(i->src1());
|
||||
opmask = (opmask << 32) | BX_READ_32BIT_OPMASK(i->src2());
|
||||
|
||||
BX_WRITE_OPMASK(i->dst(), opmask);
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KNOTQ_KGqKEqR(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
BX_WRITE_OPMASK(i->dst(), ~BX_READ_OPMASK(i->src()));
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KORQ_KGqKHqKEqR(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
Bit64u opmask = BX_READ_OPMASK(i->src1()) | BX_READ_OPMASK(i->src2());
|
||||
BX_WRITE_OPMASK(i->dst(), opmask);
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KORTESTQ_KGqKEqR(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
Bit64u tmp = BX_READ_OPMASK(i->src1()) | BX_READ_OPMASK(i->src2());
|
||||
unsigned flags = 0;
|
||||
if (tmp == 0)
|
||||
flags |= EFlagsZFMask;
|
||||
else if (tmp == BX_CONST64(0xffffffffffffffff))
|
||||
flags |= EFlagsCFMask;
|
||||
|
||||
setEFlagsOSZAPC(flags);
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KSHIFTLQ_KGqKEqIbR(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
unsigned count = i->Ib();
|
||||
Bit64u opmask = 0;
|
||||
if (count < 64)
|
||||
opmask = BX_READ_OPMASK(i->src()) << count;
|
||||
|
||||
BX_WRITE_OPMASK(i->dst(), opmask);
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KSHIFTRQ_KGqKEqIbR(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
unsigned count = i->Ib();
|
||||
Bit64u opmask = 0;
|
||||
if (count < 64)
|
||||
opmask = BX_READ_OPMASK(i->src()) >> count;
|
||||
|
||||
BX_WRITE_OPMASK(i->dst(), opmask);
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KXNORQ_KGqKHqKEqR(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
Bit64u opmask = ~(BX_READ_OPMASK(i->src1()) ^ BX_READ_OPMASK(i->src2()));
|
||||
BX_WRITE_OPMASK(i->dst(), opmask);
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KXORQ_KGqKHqKEqR(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
Bit64u opmask = BX_READ_OPMASK(i->src1()) ^ BX_READ_OPMASK(i->src2());
|
||||
BX_WRITE_OPMASK(i->dst(), opmask);
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KTESTQ_KGqKEqR(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
Bit64u op1 = BX_READ_OPMASK(i->src1()), op2 = BX_READ_OPMASK(i->src2());
|
||||
unsigned flags = 0;
|
||||
|
||||
if ((op1 & op2) == 0)
|
||||
flags |= EFlagsZFMask;
|
||||
if ((~op1 & op2) == 0)
|
||||
flags |= EFlagsCFMask;
|
||||
|
||||
setEFlagsOSZAPC(flags);
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
#endif
|
210
bochs/cpu/avx512_mask8.cc
Normal file
210
bochs/cpu/avx512_mask8.cc
Normal file
@ -0,0 +1,210 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id$
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (c) 2014 Stanislav Shwartsman
|
||||
// Written by Stanislav Shwartsman [sshwarts at sourceforge net]
|
||||
//
|
||||
// This library 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 Foundation; either
|
||||
// version 2 of the License, or (at your option) any later version.
|
||||
//
|
||||
// This library 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
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA B 02110-1301 USA
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define NEED_CPU_REG_SHORTCUTS 1
|
||||
#include "bochs.h"
|
||||
#include "cpu.h"
|
||||
#define LOG_THIS BX_CPU_THIS_PTR
|
||||
|
||||
#if BX_SUPPORT_AVX
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KADDB_KGbKHbKEbR(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
Bit8u opmask = BX_READ_8BIT_OPMASK(i->src1()) + BX_READ_8BIT_OPMASK(i->src2());
|
||||
BX_WRITE_OPMASK(i->dst(), opmask);
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KANDB_KGbKHbKEbR(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
Bit8u opmask = BX_READ_8BIT_OPMASK(i->src1()) & BX_READ_8BIT_OPMASK(i->src2());
|
||||
BX_WRITE_OPMASK(i->dst(), opmask);
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KANDNB_KGbKHbKEbR(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
Bit8u opmask = ~(BX_READ_8BIT_OPMASK(i->src1())) & BX_READ_8BIT_OPMASK(i->src2());
|
||||
BX_WRITE_OPMASK(i->dst(), opmask);
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KMOVB_KGbKEbM(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
bx_address eaddr = BX_CPU_CALL_METHODR(i->ResolveModrm, (i));
|
||||
Bit8u opmask = read_virtual_byte(i->seg(), eaddr);
|
||||
BX_WRITE_OPMASK(i->dst(), opmask);
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KMOVB_KGbKEbR(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
BX_WRITE_OPMASK(i->dst(), BX_READ_8BIT_OPMASK(i->src()));
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KMOVB_KEbKGbM(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
bx_address eaddr = BX_CPU_CALL_METHODR(i->ResolveModrm, (i));
|
||||
write_virtual_byte(i->seg(), eaddr, BX_READ_8BIT_OPMASK(i->src()));
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KMOVB_KGbEbR(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
BX_WRITE_OPMASK(i->dst(), BX_READ_8BIT_REGL(i->src()));
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KMOVB_GdKEbR(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
BX_WRITE_32BIT_REGZ(i->dst(), BX_READ_8BIT_OPMASK(i->src()));
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KNOTB_KGbKEbR(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
Bit8u opmask = ~BX_READ_8BIT_OPMASK(i->src());
|
||||
BX_WRITE_OPMASK(i->dst(), opmask);
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KORB_KGbKHbKEbR(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
Bit8u opmask = BX_READ_8BIT_OPMASK(i->src1()) | BX_READ_8BIT_OPMASK(i->src2());
|
||||
BX_WRITE_OPMASK(i->dst(), opmask);
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KORTESTB_KGbKEbR(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
Bit8u tmp = BX_READ_8BIT_OPMASK(i->src1()) | BX_READ_8BIT_OPMASK(i->src2());
|
||||
unsigned flags = 0;
|
||||
if (tmp == 0)
|
||||
flags |= EFlagsZFMask;
|
||||
else if (tmp == 0xff)
|
||||
flags |= EFlagsCFMask;
|
||||
|
||||
setEFlagsOSZAPC(flags);
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KSHIFTLB_KGbKEbIbR(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
unsigned count = i->Ib();
|
||||
Bit8u opmask = 0;
|
||||
if (count < 8)
|
||||
opmask = BX_READ_8BIT_OPMASK(i->src()) << count;
|
||||
|
||||
BX_WRITE_OPMASK(i->dst(), opmask);
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KSHIFTRB_KGbKEbIbR(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
unsigned count = i->Ib();
|
||||
Bit8u opmask = 0;
|
||||
if (count < 8)
|
||||
opmask = BX_READ_8BIT_OPMASK(i->src()) >> count;
|
||||
|
||||
BX_WRITE_OPMASK(i->dst(), opmask);
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KXNORB_KGbKHbKEbR(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
Bit8u opmask = ~(BX_READ_8BIT_OPMASK(i->src1()) ^ BX_READ_8BIT_OPMASK(i->src2()));
|
||||
BX_WRITE_OPMASK(i->dst(), opmask);
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KXORB_KGbKHbKEbR(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
Bit8u opmask = BX_READ_8BIT_OPMASK(i->src1()) ^ BX_READ_8BIT_OPMASK(i->src2());
|
||||
BX_WRITE_OPMASK(i->dst(), opmask);
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::KTESTB_KGbKEbR(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_SUPPORT_EVEX
|
||||
Bit8u op1 = BX_READ_8BIT_OPMASK(i->src1()), op2 = BX_READ_8BIT_OPMASK(i->src2());
|
||||
unsigned flags = 0;
|
||||
|
||||
if ((op1 & op2) == 0)
|
||||
flags |= EFlagsZFMask;
|
||||
if ((~op1 & op2) == 0)
|
||||
flags |= EFlagsCFMask;
|
||||
|
||||
setEFlagsOSZAPC(flags);
|
||||
#endif
|
||||
|
||||
BX_NEXT_INSTR(i);
|
||||
}
|
||||
|
||||
#endif
|
0
bochs/cpu/avx512_rsqrt14.cc
Executable file → Normal file
0
bochs/cpu/avx512_rsqrt14.cc
Executable file → Normal file
Loading…
Reference in New Issue
Block a user