2011-08-27 17:47:16 +04:00
|
|
|
/////////////////////////////////////////////////////////////////////////
|
|
|
|
// $Id$
|
|
|
|
/////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2018-02-16 10:57:32 +03:00
|
|
|
// Copyright (c) 2011-2018 Stanislav Shwartsman
|
2011-08-27 17:47:16 +04:00
|
|
|
// 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
|
|
|
|
|
2011-10-20 00:54:04 +04:00
|
|
|
#if BX_SUPPORT_AVX
|
2011-08-27 17:47:16 +04:00
|
|
|
|
|
|
|
#include "simd_int.h"
|
2011-10-20 00:54:04 +04:00
|
|
|
#include "simd_compare.h"
|
2011-08-27 17:47:16 +04:00
|
|
|
|
2012-08-05 17:52:40 +04:00
|
|
|
#define AVX_2OP(HANDLER, func) \
|
|
|
|
/* AVX instruction with two src operands */ \
|
2018-02-16 10:57:32 +03:00
|
|
|
void BX_CPP_AttrRegparmN(1) BX_CPU_C :: HANDLER (bxInstruction_c *i) \
|
2012-08-05 17:52:40 +04:00
|
|
|
{ \
|
2013-09-22 00:40:57 +04:00
|
|
|
BxPackedAvxRegister op1 = BX_READ_AVX_REG(i->src1()), op2 = BX_READ_AVX_REG(i->src2()); \
|
2012-08-05 17:52:40 +04:00
|
|
|
unsigned len = i->getVL(); \
|
|
|
|
\
|
|
|
|
for (unsigned n=0; n < len; n++) \
|
2013-09-22 00:40:57 +04:00
|
|
|
(func)(&op1.vmm128(n), &op2.vmm128(n)); \
|
2012-08-05 17:52:40 +04:00
|
|
|
\
|
2013-09-22 00:40:57 +04:00
|
|
|
BX_WRITE_AVX_REGZ(i->dst(), op1, len); \
|
2012-08-05 17:52:40 +04:00
|
|
|
\
|
|
|
|
BX_NEXT_INSTR(i); \
|
2011-08-27 17:47:16 +04:00
|
|
|
}
|
|
|
|
|
2013-09-17 21:34:20 +04:00
|
|
|
AVX_2OP(VANDPS_VpsHpsWpsR, xmm_andps)
|
|
|
|
AVX_2OP(VANDNPS_VpsHpsWpsR, xmm_andnps)
|
|
|
|
AVX_2OP(VXORPS_VpsHpsWpsR, xmm_xorps)
|
|
|
|
AVX_2OP(VORPS_VpsHpsWpsR, xmm_orps)
|
|
|
|
|
|
|
|
AVX_2OP(VUNPCKLPS_VpsHpsWpsR, xmm_unpcklps)
|
|
|
|
AVX_2OP(VUNPCKLPD_VpdHpdWpdR, xmm_unpcklpd)
|
|
|
|
AVX_2OP(VUNPCKHPS_VpsHpsWpsR, xmm_unpckhps)
|
|
|
|
AVX_2OP(VUNPCKHPD_VpdHpdWpdR, xmm_unpckhpd)
|
|
|
|
|
|
|
|
AVX_2OP(VPADDB_VdqHdqWdqR, xmm_paddb)
|
|
|
|
AVX_2OP(VPADDW_VdqHdqWdqR, xmm_paddw)
|
|
|
|
AVX_2OP(VPADDD_VdqHdqWdqR, xmm_paddd)
|
|
|
|
AVX_2OP(VPADDQ_VdqHdqWdqR, xmm_paddq)
|
|
|
|
AVX_2OP(VPSUBB_VdqHdqW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
|
|
AVX_2OP(VPMULHRSW_VdqHdqWdqR, xmm_pmulhrsw)
|
|
|
|
|
|
|
|
AVX_2OP(VPMADDWD_VdqHdqWdqR, xmm_pmaddwd)
|
|
|
|
AVX_2OP(VPMADDUBSW_VdqHdqWdqR, xmm_pmaddubsw)
|
|
|
|
|
|
|
|
AVX_2OP(VPSADBW_VdqHdqWdqR, xmm_psadbw)
|
|
|
|
|
2014-07-26 01:15:48 +04:00
|
|
|
AVX_2OP(VPSRAVW_VdqHdqWdqR, xmm_psravw)
|
2013-09-17 21:34:20 +04:00
|
|
|
AVX_2OP(VPSRAVD_VdqHdqWdqR, xmm_psravd)
|
2013-12-02 23:16:48 +04:00
|
|
|
AVX_2OP(VPSRAVQ_VdqHdqWdqR, xmm_psravq)
|
2014-07-26 01:15:48 +04:00
|
|
|
AVX_2OP(VPSLLVW_VdqHdqWdqR, xmm_psllvw)
|
2013-09-17 21:34:20 +04:00
|
|
|
AVX_2OP(VPSLLVD_VdqHdqWdqR, xmm_psllvd)
|
|
|
|
AVX_2OP(VPSLLVQ_VdqHdqWdqR, xmm_psllvq)
|
2014-07-26 01:15:48 +04:00
|
|
|
AVX_2OP(VPSRLVW_VdqHdqWdqR, xmm_psrlvw)
|
2013-09-17 21:34:20 +04:00
|
|
|
AVX_2OP(VPSRLVD_VdqHdqWdqR, xmm_psrlvd)
|
|
|
|
AVX_2OP(VPSRLVQ_VdqHdqWdqR, xmm_psrlvq)
|
2013-12-03 19:44:23 +04:00
|
|
|
AVX_2OP(VPROLVD_VdqHdqWdqR, xmm_prolvd)
|
|
|
|
AVX_2OP(VPROLVQ_VdqHdqWdqR, xmm_prolvq)
|
|
|
|
AVX_2OP(VPRORVD_VdqHdqWdqR, xmm_prorvd)
|
|
|
|
AVX_2OP(VPRORVQ_VdqHdqWdqR, xmm_prorvq)
|
2011-08-27 17:47:16 +04:00
|
|
|
|
|
|
|
#define AVX_1OP(HANDLER, func) \
|
|
|
|
/* AVX instruction with single src operand */ \
|
2018-02-16 10:57:32 +03:00
|
|
|
void BX_CPP_AttrRegparmN(1) BX_CPU_C :: HANDLER (bxInstruction_c *i) \
|
2011-08-27 17:47:16 +04:00
|
|
|
{ \
|
2013-09-22 00:40:57 +04:00
|
|
|
BxPackedAvxRegister op = BX_READ_AVX_REG(i->src()); \
|
2011-08-27 17:47:16 +04:00
|
|
|
unsigned len = i->getVL(); \
|
|
|
|
\
|
|
|
|
for (unsigned n=0; n < len; n++) \
|
2013-09-22 00:40:57 +04:00
|
|
|
(func)(&op.vmm128(n)); \
|
2011-08-27 17:47:16 +04:00
|
|
|
\
|
2013-09-22 00:40:57 +04:00
|
|
|
BX_WRITE_AVX_REGZ(i->dst(), op, len); \
|
2011-08-27 17:47:16 +04:00
|
|
|
\
|
|
|
|
BX_NEXT_INSTR(i); \
|
|
|
|
}
|
|
|
|
|
2013-09-17 21:34:20 +04:00
|
|
|
AVX_1OP(VPABSB_VdqWdqR, xmm_pabsb)
|
|
|
|
AVX_1OP(VPABSW_VdqWdqR, xmm_pabsw)
|
|
|
|
AVX_1OP(VPABSD_VdqWdqR, xmm_pabsd)
|
2013-12-02 00:10:39 +04:00
|
|
|
AVX_1OP(VPABSQ_VdqWdqR, xmm_pabsq)
|
2011-08-27 17:47:16 +04:00
|
|
|
|
|
|
|
#define AVX_PSHIFT(HANDLER, func) \
|
|
|
|
/* AVX packed shift instruction */ \
|
2018-02-16 10:57:32 +03:00
|
|
|
void BX_CPP_AttrRegparmN(1) BX_CPU_C:: HANDLER (bxInstruction_c *i) \
|
2011-08-27 17:47:16 +04:00
|
|
|
{ \
|
2013-09-22 00:40:57 +04:00
|
|
|
BxPackedAvxRegister op = BX_READ_AVX_REG(i->src1()); \
|
2013-12-11 01:09:46 +04:00
|
|
|
Bit64u count = BX_READ_XMM_REG_LO_QWORD(i->src2()); \
|
2011-08-27 17:47:16 +04:00
|
|
|
unsigned len = i->getVL(); \
|
|
|
|
\
|
|
|
|
for (unsigned n=0; n < len; n++) \
|
2013-12-11 01:09:46 +04:00
|
|
|
(func)(&op.vmm128(n), count); \
|
2011-08-27 17:47:16 +04:00
|
|
|
\
|
2013-09-22 00:40:57 +04:00
|
|
|
BX_WRITE_AVX_REGZ(i->dst(), op, len); \
|
2011-08-27 17:47:16 +04:00
|
|
|
\
|
|
|
|
BX_NEXT_INSTR(i); \
|
|
|
|
}
|
|
|
|
|
2013-09-17 21:34:20 +04:00
|
|
|
AVX_PSHIFT(VPSRLW_VdqHdqWdqR, xmm_psrlw);
|
|
|
|
AVX_PSHIFT(VPSRLD_VdqHdqWdqR, xmm_psrld);
|
|
|
|
AVX_PSHIFT(VPSRLQ_VdqHdqWdqR, xmm_psrlq);
|
|
|
|
AVX_PSHIFT(VPSRAW_VdqHdqWdqR, xmm_psraw);
|
|
|
|
AVX_PSHIFT(VPSRAD_VdqHdqWdqR, xmm_psrad);
|
2013-12-03 19:44:23 +04:00
|
|
|
AVX_PSHIFT(VPSRAQ_VdqHdqWdqR, xmm_psraq);
|
2013-09-17 21:34:20 +04:00
|
|
|
AVX_PSHIFT(VPSLLW_VdqHdqWdqR, xmm_psllw);
|
|
|
|
AVX_PSHIFT(VPSLLD_VdqHdqWdqR, xmm_pslld);
|
|
|
|
AVX_PSHIFT(VPSLLQ_VdqHdqWdqR, xmm_psllq);
|
2011-08-27 17:47:16 +04:00
|
|
|
|
|
|
|
#define AVX_PSHIFT_IMM(HANDLER, func) \
|
|
|
|
/* AVX packed shift with imm8 instruction */ \
|
2018-02-16 10:57:32 +03:00
|
|
|
void BX_CPP_AttrRegparmN(1) BX_CPU_C:: HANDLER (bxInstruction_c *i) \
|
2011-08-27 17:47:16 +04:00
|
|
|
{ \
|
2013-09-22 00:40:57 +04:00
|
|
|
BxPackedAvxRegister op = BX_READ_AVX_REG(i->src()); \
|
2011-08-27 17:47:16 +04:00
|
|
|
unsigned len = i->getVL(); \
|
|
|
|
\
|
|
|
|
for (unsigned n=0; n < len; n++) \
|
2013-09-22 00:40:57 +04:00
|
|
|
(func)(&op.vmm128(n), i->Ib()); \
|
2011-08-27 17:47:16 +04:00
|
|
|
\
|
2013-09-22 00:40:57 +04:00
|
|
|
BX_WRITE_AVX_REGZ(i->dst(), op, len); \
|
2011-08-27 17:47:16 +04:00
|
|
|
\
|
|
|
|
BX_NEXT_INSTR(i); \
|
|
|
|
}
|
|
|
|
|
2013-09-17 21:34:20 +04:00
|
|
|
AVX_PSHIFT_IMM(VPSRLW_UdqIb, xmm_psrlw);
|
|
|
|
AVX_PSHIFT_IMM(VPSRLD_UdqIb, xmm_psrld);
|
|
|
|
AVX_PSHIFT_IMM(VPSRLQ_UdqIb, xmm_psrlq);
|
|
|
|
AVX_PSHIFT_IMM(VPSRAW_UdqIb, xmm_psraw);
|
|
|
|
AVX_PSHIFT_IMM(VPSRAD_UdqIb, xmm_psrad);
|
2013-12-03 19:44:23 +04:00
|
|
|
AVX_PSHIFT_IMM(VPSRAQ_UdqIb, xmm_psraq);
|
2013-09-17 21:34:20 +04:00
|
|
|
AVX_PSHIFT_IMM(VPSLLW_UdqIb, xmm_psllw);
|
|
|
|
AVX_PSHIFT_IMM(VPSLLD_UdqIb, xmm_pslld);
|
|
|
|
AVX_PSHIFT_IMM(VPSLLQ_UdqIb, xmm_psllq);
|
2013-12-03 19:44:23 +04:00
|
|
|
AVX_PSHIFT_IMM(VPROLD_UdqIb, xmm_prold);
|
|
|
|
AVX_PSHIFT_IMM(VPROLQ_UdqIb, xmm_prolq);
|
|
|
|
AVX_PSHIFT_IMM(VPRORD_UdqIb, xmm_prord);
|
|
|
|
AVX_PSHIFT_IMM(VPRORQ_UdqIb, xmm_prorq);
|
2011-08-27 17:47:16 +04:00
|
|
|
|
2013-09-17 21:34:20 +04:00
|
|
|
AVX_PSHIFT_IMM(VPSRLDQ_UdqIb, xmm_psrldq);
|
|
|
|
AVX_PSHIFT_IMM(VPSLLDQ_UdqIb, xmm_pslldq);
|
2011-08-27 17:47:16 +04:00
|
|
|
|
2018-02-16 10:57:32 +03:00
|
|
|
void BX_CPP_AttrRegparmN(1) BX_CPU_C::VPSHUFHW_VdqWdqIbR(bxInstruction_c *i)
|
2011-08-27 17:47:16 +04:00
|
|
|
{
|
2013-09-22 00:40:57 +04:00
|
|
|
BxPackedAvxRegister op = BX_READ_AVX_REG(i->src()), result;
|
2011-08-27 17:47:16 +04:00
|
|
|
Bit8u order = i->Ib();
|
|
|
|
unsigned len = i->getVL();
|
|
|
|
|
2018-05-27 22:09:59 +03:00
|
|
|
result.clear();
|
|
|
|
|
2011-08-27 17:47:16 +04:00
|
|
|
for (unsigned n=0; n < len; n++)
|
2013-09-22 00:40:57 +04:00
|
|
|
xmm_pshufhw(&result.vmm128(n), &op.vmm128(n), order);
|
2011-08-27 17:47:16 +04:00
|
|
|
|
2018-05-27 22:09:59 +03:00
|
|
|
BX_WRITE_AVX_REG(i->dst(), result);
|
2011-08-27 17:47:16 +04:00
|
|
|
BX_NEXT_INSTR(i);
|
|
|
|
}
|
|
|
|
|
2018-02-16 10:57:32 +03:00
|
|
|
void BX_CPP_AttrRegparmN(1) BX_CPU_C::VPSHUFLW_VdqWdqIbR(bxInstruction_c *i)
|
2011-08-27 17:47:16 +04:00
|
|
|
{
|
2013-09-22 00:40:57 +04:00
|
|
|
BxPackedAvxRegister op = BX_READ_AVX_REG(i->src()), result;
|
2011-08-27 17:47:16 +04:00
|
|
|
Bit8u order = i->Ib();
|
|
|
|
unsigned len = i->getVL();
|
|
|
|
|
2018-05-27 22:09:59 +03:00
|
|
|
result.clear();
|
|
|
|
|
2011-08-27 17:47:16 +04:00
|
|
|
for (unsigned n=0; n < len; n++)
|
2013-09-22 00:40:57 +04:00
|
|
|
xmm_pshuflw(&result.vmm128(n), &op.vmm128(n), order);
|
2011-08-27 17:47:16 +04:00
|
|
|
|
2018-05-27 22:09:59 +03:00
|
|
|
BX_WRITE_AVX_REG(i->dst(), result);
|
2011-08-27 17:47:16 +04:00
|
|
|
BX_NEXT_INSTR(i);
|
|
|
|
}
|
|
|
|
|
2018-02-16 10:57:32 +03:00
|
|
|
void BX_CPP_AttrRegparmN(1) BX_CPU_C::VPSHUFB_VdqHdqWdqR(bxInstruction_c *i)
|
2011-08-27 17:47:16 +04:00
|
|
|
{
|
2013-09-22 00:40:57 +04:00
|
|
|
BxPackedAvxRegister op1 = BX_READ_AVX_REG(i->src1());
|
|
|
|
BxPackedAvxRegister op2 = BX_READ_AVX_REG(i->src2()), result;
|
2011-08-27 17:47:16 +04:00
|
|
|
unsigned len = i->getVL();
|
|
|
|
|
2018-05-27 22:09:59 +03:00
|
|
|
result.clear();
|
|
|
|
|
2011-08-27 17:47:16 +04:00
|
|
|
for (unsigned n=0; n < len; n++)
|
2013-09-22 00:40:57 +04:00
|
|
|
xmm_pshufb(&result.vmm128(n), &op1.vmm128(n), &op2.vmm128(n));
|
2011-08-27 17:47:16 +04:00
|
|
|
|
2018-05-27 22:09:59 +03:00
|
|
|
BX_WRITE_AVX_REG(i->dst(), result);
|
2011-08-27 17:47:16 +04:00
|
|
|
BX_NEXT_INSTR(i);
|
|
|
|
}
|
|
|
|
|
2018-02-16 10:57:32 +03:00
|
|
|
void BX_CPP_AttrRegparmN(1) BX_CPU_C::VMPSADBW_VdqHdqWdqIbR(bxInstruction_c *i)
|
2011-08-27 17:47:16 +04:00
|
|
|
{
|
2013-09-22 00:40:57 +04:00
|
|
|
BxPackedAvxRegister op1 = BX_READ_AVX_REG(i->src1());
|
|
|
|
BxPackedAvxRegister op2 = BX_READ_AVX_REG(i->src2()), result;
|
2011-08-27 17:47:16 +04:00
|
|
|
|
2018-05-27 22:09:59 +03:00
|
|
|
result.clear();
|
|
|
|
|
2011-08-27 17:47:16 +04:00
|
|
|
Bit8u control = i->Ib();
|
|
|
|
unsigned len = i->getVL();
|
|
|
|
|
|
|
|
for (unsigned n=0; n < len; n++) {
|
2013-09-22 00:40:57 +04:00
|
|
|
xmm_mpsadbw(&result.vmm128(n), &op1.vmm128(n), &op2.vmm128(n), control & 0x7);
|
2011-08-27 17:47:16 +04:00
|
|
|
control >>= 3;
|
|
|
|
}
|
|
|
|
|
2018-05-27 22:09:59 +03:00
|
|
|
BX_WRITE_AVX_REG(i->dst(), result);
|
2011-08-27 17:47:16 +04:00
|
|
|
BX_NEXT_INSTR(i);
|
|
|
|
}
|
|
|
|
|
2018-02-16 10:57:32 +03:00
|
|
|
void BX_CPP_AttrRegparmN(1) BX_CPU_C::VPBLENDW_VdqHdqWdqIbR(bxInstruction_c *i)
|
2011-08-27 17:47:16 +04:00
|
|
|
{
|
2013-09-22 00:40:57 +04:00
|
|
|
BxPackedAvxRegister op1 = BX_READ_AVX_REG(i->src1()), op2 = BX_READ_AVX_REG(i->src2());
|
2011-08-27 17:47:16 +04:00
|
|
|
|
|
|
|
unsigned len = i->getVL();
|
|
|
|
Bit8u mask = i->Ib();
|
|
|
|
|
|
|
|
for (unsigned n=0; n < len; n++)
|
2013-09-22 00:40:57 +04:00
|
|
|
xmm_pblendw(&op1.vmm128(n), &op2.vmm128(n), mask);
|
2011-08-27 17:47:16 +04:00
|
|
|
|
2013-09-22 00:40:57 +04:00
|
|
|
BX_WRITE_AVX_REGZ(i->dst(), op1, len);
|
2011-08-27 17:47:16 +04:00
|
|
|
BX_NEXT_INSTR(i);
|
|
|
|
}
|
|
|
|
|
2018-02-16 10:57:32 +03:00
|
|
|
void BX_CPP_AttrRegparmN(1) BX_CPU_C::VPBROADCASTB_VdqWbR(bxInstruction_c *i)
|
2011-08-27 17:47:16 +04:00
|
|
|
{
|
2013-12-04 22:30:44 +04:00
|
|
|
BxPackedAvxRegister op;
|
2011-08-27 17:47:16 +04:00
|
|
|
unsigned len = i->getVL();
|
2018-05-27 22:09:59 +03:00
|
|
|
op.clear();
|
2011-08-27 17:47:16 +04:00
|
|
|
|
2013-09-16 23:10:42 +04:00
|
|
|
Bit8u val_8 = BX_READ_XMM_REG_LO_BYTE(i->src());
|
|
|
|
|
|
|
|
for (unsigned n=0; n < len; n++)
|
2013-12-04 22:30:44 +04:00
|
|
|
xmm_pbroadcastb(&op.vmm128(n), val_8);
|
2011-08-27 17:47:16 +04:00
|
|
|
|
2018-05-27 22:09:59 +03:00
|
|
|
BX_WRITE_AVX_REG(i->dst(), op);
|
2011-08-27 17:47:16 +04:00
|
|
|
BX_NEXT_INSTR(i);
|
|
|
|
}
|
|
|
|
|
2018-02-16 10:57:32 +03:00
|
|
|
void BX_CPP_AttrRegparmN(1) BX_CPU_C::VPBROADCASTW_VdqWwR(bxInstruction_c *i)
|
2011-08-27 17:47:16 +04:00
|
|
|
{
|
2013-12-04 22:30:44 +04:00
|
|
|
BxPackedAvxRegister op;
|
2011-08-27 17:47:16 +04:00
|
|
|
unsigned len = i->getVL();
|
2018-05-27 22:09:59 +03:00
|
|
|
op.clear();
|
2011-08-27 17:47:16 +04:00
|
|
|
|
2013-09-16 23:10:42 +04:00
|
|
|
Bit16u val_16 = BX_READ_XMM_REG_LO_WORD(i->src());
|
|
|
|
|
|
|
|
for (unsigned n=0; n < len; n++)
|
2013-12-04 22:30:44 +04:00
|
|
|
xmm_pbroadcastw(&op.vmm128(n), val_16);
|
2011-08-27 17:47:16 +04:00
|
|
|
|
2018-05-27 22:09:59 +03:00
|
|
|
BX_WRITE_AVX_REG(i->dst(), op);
|
2011-08-27 17:47:16 +04:00
|
|
|
BX_NEXT_INSTR(i);
|
|
|
|
}
|
|
|
|
|
2018-02-16 10:57:32 +03:00
|
|
|
void BX_CPP_AttrRegparmN(1) BX_CPU_C::VPBROADCASTD_VdqWdR(bxInstruction_c *i)
|
2011-08-27 17:47:16 +04:00
|
|
|
{
|
2013-12-04 22:30:44 +04:00
|
|
|
BxPackedAvxRegister op;
|
2011-08-27 17:47:16 +04:00
|
|
|
unsigned len = i->getVL();
|
2018-05-27 22:09:59 +03:00
|
|
|
op.clear();
|
2011-08-27 17:47:16 +04:00
|
|
|
|
2013-09-16 23:10:42 +04:00
|
|
|
Bit32u val_32 = BX_READ_XMM_REG_LO_DWORD(i->src());
|
|
|
|
|
|
|
|
for (unsigned n=0; n < len; n++)
|
2013-12-04 22:30:44 +04:00
|
|
|
xmm_pbroadcastd(&op.vmm128(n), val_32);
|
2011-08-27 17:47:16 +04:00
|
|
|
|
2018-05-27 22:09:59 +03:00
|
|
|
BX_WRITE_AVX_REG(i->dst(), op);
|
2011-08-27 17:47:16 +04:00
|
|
|
BX_NEXT_INSTR(i);
|
|
|
|
}
|
|
|
|
|
2018-02-16 10:57:32 +03:00
|
|
|
void BX_CPP_AttrRegparmN(1) BX_CPU_C::VPBROADCASTQ_VdqWqR(bxInstruction_c *i)
|
2011-08-27 17:47:16 +04:00
|
|
|
{
|
2013-12-04 22:30:44 +04:00
|
|
|
BxPackedAvxRegister op;
|
2011-08-27 17:47:16 +04:00
|
|
|
unsigned len = i->getVL();
|
2018-05-27 22:09:59 +03:00
|
|
|
op.clear();
|
2011-08-27 17:47:16 +04:00
|
|
|
|
2013-09-16 23:10:42 +04:00
|
|
|
Bit64u val_64 = BX_READ_XMM_REG_LO_QWORD(i->src());
|
|
|
|
|
|
|
|
for (unsigned n=0; n < len; n++)
|
2013-12-04 22:30:44 +04:00
|
|
|
xmm_pbroadcastq(&op.vmm128(n), val_64);
|
2011-08-27 17:47:16 +04:00
|
|
|
|
2018-05-27 22:09:59 +03:00
|
|
|
BX_WRITE_AVX_REG(i->dst(), op);
|
2011-08-27 17:47:16 +04:00
|
|
|
BX_NEXT_INSTR(i);
|
|
|
|
}
|
|
|
|
|
2018-02-16 10:57:32 +03:00
|
|
|
void BX_CPP_AttrRegparmN(1) BX_CPU_C::VPMOVSXBW_VdqWdqR(bxInstruction_c *i)
|
2011-08-27 17:47:16 +04:00
|
|
|
{
|
2014-02-02 23:56:08 +04:00
|
|
|
BxPackedYmmRegister op = BX_READ_YMM_REG(i->src());
|
|
|
|
BxPackedAvxRegister result;
|
|
|
|
unsigned len = i->getVL();
|
2011-08-27 17:47:16 +04:00
|
|
|
|
2014-02-02 23:56:08 +04:00
|
|
|
for (unsigned n=0; n < WORD_ELEMENTS(len); n++)
|
|
|
|
result.vmm16s(n) = (Bit16s) op.ymmsbyte(n);
|
2011-08-27 17:47:16 +04:00
|
|
|
|
2014-02-02 23:56:08 +04:00
|
|
|
BX_WRITE_AVX_REGZ(i->dst(), result, len);
|
2011-08-27 17:47:16 +04:00
|
|
|
BX_NEXT_INSTR(i);
|
|
|
|
}
|
|
|
|
|
2018-02-16 10:57:32 +03:00
|
|
|
void BX_CPP_AttrRegparmN(1) BX_CPU_C::VPMOVSXBD_VdqWdqR(bxInstruction_c *i)
|
2011-08-27 17:47:16 +04:00
|
|
|
{
|
2014-02-02 23:56:08 +04:00
|
|
|
BxPackedXmmRegister op = BX_READ_XMM_REG(i->src());
|
|
|
|
BxPackedAvxRegister result;
|
|
|
|
unsigned len = i->getVL();
|
2011-08-27 17:47:16 +04:00
|
|
|
|
2014-02-02 23:56:08 +04:00
|
|
|
for (unsigned n=0; n < DWORD_ELEMENTS(len); n++)
|
|
|
|
result.vmm32s(n) = (Bit32s) op.xmmsbyte(n);
|
2011-08-27 17:47:16 +04:00
|
|
|
|
2014-02-02 23:56:08 +04:00
|
|
|
BX_WRITE_AVX_REGZ(i->dst(), result, len);
|
2011-08-27 17:47:16 +04:00
|
|
|
BX_NEXT_INSTR(i);
|
|
|
|
}
|
|
|
|
|
2018-02-16 10:57:32 +03:00
|
|
|
void BX_CPP_AttrRegparmN(1) BX_CPU_C::VPMOVSXBQ_VdqWdqR(bxInstruction_c *i)
|
2011-08-27 17:47:16 +04:00
|
|
|
{
|
2014-02-02 23:56:08 +04:00
|
|
|
BxPackedXmmRegister op = BX_READ_XMM_REG(i->src());
|
|
|
|
BxPackedAvxRegister result;
|
|
|
|
unsigned len = i->getVL();
|
2011-08-27 17:47:16 +04:00
|
|
|
|
2014-02-02 23:56:08 +04:00
|
|
|
for (unsigned n=0; n < QWORD_ELEMENTS(len); n++)
|
|
|
|
result.vmm64s(n) = (Bit64s) op.xmmsbyte(n);
|
2011-08-27 17:47:16 +04:00
|
|
|
|
2014-02-02 23:56:08 +04:00
|
|
|
BX_WRITE_AVX_REGZ(i->dst(), result, len);
|
2011-08-27 17:47:16 +04:00
|
|
|
BX_NEXT_INSTR(i);
|
|
|
|
}
|
|
|
|
|
2018-02-16 10:57:32 +03:00
|
|
|
void BX_CPP_AttrRegparmN(1) BX_CPU_C::VPMOVSXWD_VdqWdqR(bxInstruction_c *i)
|
2011-08-27 17:47:16 +04:00
|
|
|
{
|
2014-02-02 23:56:08 +04:00
|
|
|
BxPackedYmmRegister op = BX_READ_YMM_REG(i->src());
|
|
|
|
BxPackedAvxRegister result;
|
|
|
|
unsigned len = i->getVL();
|
2011-08-27 17:47:16 +04:00
|
|
|
|
2014-02-02 23:56:08 +04:00
|
|
|
for (unsigned n=0; n < DWORD_ELEMENTS(len); n++)
|
|
|
|
result.vmm32s(n) = (Bit32s) op.ymm16s(n);
|
2011-08-27 17:47:16 +04:00
|
|
|
|
2014-02-02 23:56:08 +04:00
|
|
|
BX_WRITE_AVX_REGZ(i->dst(), result, len);
|
2011-08-27 17:47:16 +04:00
|
|
|
BX_NEXT_INSTR(i);
|
|
|
|
}
|
|
|
|
|
2018-02-16 10:57:32 +03:00
|
|
|
void BX_CPP_AttrRegparmN(1) BX_CPU_C::VPMOVSXWQ_VdqWdqR(bxInstruction_c *i)
|
2011-08-27 17:47:16 +04:00
|
|
|
{
|
2014-02-02 23:56:08 +04:00
|
|
|
BxPackedXmmRegister op = BX_READ_XMM_REG(i->src());
|
|
|
|
BxPackedAvxRegister result;
|
|
|
|
unsigned len = i->getVL();
|
2011-08-27 17:47:16 +04:00
|
|
|
|
2014-02-02 23:56:08 +04:00
|
|
|
for (unsigned n=0; n < QWORD_ELEMENTS(len); n++)
|
|
|
|
result.vmm64s(n) = (Bit64s) op.xmm16s(n);
|
2011-08-27 17:47:16 +04:00
|
|
|
|
2014-02-02 23:56:08 +04:00
|
|
|
BX_WRITE_AVX_REGZ(i->dst(), result, len);
|
2011-08-27 17:47:16 +04:00
|
|
|
BX_NEXT_INSTR(i);
|
|
|
|
}
|
|
|
|
|
2018-02-16 10:57:32 +03:00
|
|
|
void BX_CPP_AttrRegparmN(1) BX_CPU_C::VPMOVSXDQ_VdqWdqR(bxInstruction_c *i)
|
2011-08-27 17:47:16 +04:00
|
|
|
{
|
2014-02-02 23:56:08 +04:00
|
|
|
BxPackedYmmRegister op = BX_READ_YMM_REG(i->src());
|
|
|
|
BxPackedAvxRegister result;
|
|
|
|
unsigned len = i->getVL();
|
2011-08-27 17:47:16 +04:00
|
|
|
|
2014-02-02 23:56:08 +04:00
|
|
|
for (unsigned n=0; n < QWORD_ELEMENTS(len); n++)
|
|
|
|
result.vmm64s(n) = (Bit64s) op.ymm32s(n);
|
2011-08-27 17:47:16 +04:00
|
|
|
|
2014-02-02 23:56:08 +04:00
|
|
|
BX_WRITE_AVX_REGZ(i->dst(), result, len);
|
2011-08-27 17:47:16 +04:00
|
|
|
BX_NEXT_INSTR(i);
|
|
|
|
}
|
|
|
|
|
2018-02-16 10:57:32 +03:00
|
|
|
void BX_CPP_AttrRegparmN(1) BX_CPU_C::VPMOVZXBW_VdqWdqR(bxInstruction_c *i)
|
2011-08-27 17:47:16 +04:00
|
|
|
{
|
2014-02-02 23:56:08 +04:00
|
|
|
BxPackedYmmRegister op = BX_READ_YMM_REG(i->src());
|
|
|
|
BxPackedAvxRegister result;
|
|
|
|
unsigned len = i->getVL();
|
2011-08-27 17:47:16 +04:00
|
|
|
|
2014-02-02 23:56:08 +04:00
|
|
|
for (unsigned n=0; n < WORD_ELEMENTS(len); n++)
|
|
|
|
result.vmm16u(n) = (Bit16u) op.ymmubyte(n);
|
2011-08-27 17:47:16 +04:00
|
|
|
|
2014-02-02 23:56:08 +04:00
|
|
|
BX_WRITE_AVX_REGZ(i->dst(), result, len);
|
2011-08-27 17:47:16 +04:00
|
|
|
BX_NEXT_INSTR(i);
|
|
|
|
}
|
|
|
|
|
2018-02-16 10:57:32 +03:00
|
|
|
void BX_CPP_AttrRegparmN(1) BX_CPU_C::VPMOVZXBD_VdqWdqR(bxInstruction_c *i)
|
2011-08-27 17:47:16 +04:00
|
|
|
{
|
2014-02-02 23:56:08 +04:00
|
|
|
BxPackedXmmRegister op = BX_READ_XMM_REG(i->src());
|
|
|
|
BxPackedAvxRegister result;
|
|
|
|
unsigned len = i->getVL();
|
2011-08-27 17:47:16 +04:00
|
|
|
|
2014-02-02 23:56:08 +04:00
|
|
|
for (unsigned n=0; n < DWORD_ELEMENTS(len); n++)
|
|
|
|
result.vmm32u(n) = (Bit32u) op.xmmubyte(n);
|
2011-08-27 17:47:16 +04:00
|
|
|
|
2014-02-02 23:56:08 +04:00
|
|
|
BX_WRITE_AVX_REGZ(i->dst(), result, len);
|
2011-08-27 17:47:16 +04:00
|
|
|
BX_NEXT_INSTR(i);
|
|
|
|
}
|
|
|
|
|
2018-02-16 10:57:32 +03:00
|
|
|
void BX_CPP_AttrRegparmN(1) BX_CPU_C::VPMOVZXBQ_VdqWdqR(bxInstruction_c *i)
|
2011-08-27 17:47:16 +04:00
|
|
|
{
|
2014-02-02 23:56:08 +04:00
|
|
|
BxPackedXmmRegister op = BX_READ_XMM_REG(i->src());
|
|
|
|
BxPackedAvxRegister result;
|
|
|
|
unsigned len = i->getVL();
|
2011-08-27 17:47:16 +04:00
|
|
|
|
2014-02-02 23:56:08 +04:00
|
|
|
for (unsigned n=0; n < QWORD_ELEMENTS(len); n++)
|
|
|
|
result.vmm64u(n) = (Bit64u) op.xmmubyte(n);
|
2011-08-27 17:47:16 +04:00
|
|
|
|
2014-02-02 23:56:08 +04:00
|
|
|
BX_WRITE_AVX_REGZ(i->dst(), result, len);
|
2011-08-27 17:47:16 +04:00
|
|
|
BX_NEXT_INSTR(i);
|
|
|
|
}
|
|
|
|
|
2018-02-16 10:57:32 +03:00
|
|
|
void BX_CPP_AttrRegparmN(1) BX_CPU_C::VPMOVZXWD_VdqWdqR(bxInstruction_c *i)
|
2011-08-27 17:47:16 +04:00
|
|
|
{
|
2014-02-02 23:56:08 +04:00
|
|
|
BxPackedYmmRegister op = BX_READ_YMM_REG(i->src());
|
|
|
|
BxPackedAvxRegister result;
|
|
|
|
unsigned len = i->getVL();
|
2011-08-27 17:47:16 +04:00
|
|
|
|
2014-02-02 23:56:08 +04:00
|
|
|
for (unsigned n=0; n < DWORD_ELEMENTS(len); n++)
|
|
|
|
result.vmm32u(n) = (Bit32u) op.ymm16u(n);
|
2011-08-27 17:47:16 +04:00
|
|
|
|
2014-02-02 23:56:08 +04:00
|
|
|
BX_WRITE_AVX_REGZ(i->dst(), result, len);
|
2011-08-27 17:47:16 +04:00
|
|
|
BX_NEXT_INSTR(i);
|
|
|
|
}
|
|
|
|
|
2018-02-16 10:57:32 +03:00
|
|
|
void BX_CPP_AttrRegparmN(1) BX_CPU_C::VPMOVZXWQ_VdqWdqR(bxInstruction_c *i)
|
2011-08-27 17:47:16 +04:00
|
|
|
{
|
2014-02-02 23:56:08 +04:00
|
|
|
BxPackedXmmRegister op = BX_READ_XMM_REG(i->src());
|
|
|
|
BxPackedAvxRegister result;
|
|
|
|
unsigned len = i->getVL();
|
2011-08-27 17:47:16 +04:00
|
|
|
|
2014-02-02 23:56:08 +04:00
|
|
|
for (unsigned n=0; n < QWORD_ELEMENTS(len); n++)
|
|
|
|
result.vmm64u(n) = (Bit64u) op.xmm16u(n);
|
2011-08-27 17:47:16 +04:00
|
|
|
|
2014-02-02 23:56:08 +04:00
|
|
|
BX_WRITE_AVX_REGZ(i->dst(), result, len);
|
2011-08-27 17:47:16 +04:00
|
|
|
BX_NEXT_INSTR(i);
|
|
|
|
}
|
|
|
|
|
2018-02-16 10:57:32 +03:00
|
|
|
void BX_CPP_AttrRegparmN(1) BX_CPU_C::VPMOVZXDQ_VdqWdqR(bxInstruction_c *i)
|
2011-08-27 17:47:16 +04:00
|
|
|
{
|
2014-02-02 23:56:08 +04:00
|
|
|
BxPackedYmmRegister op = BX_READ_YMM_REG(i->src());
|
|
|
|
BxPackedAvxRegister result;
|
|
|
|
unsigned len = i->getVL();
|
2011-08-27 17:47:16 +04:00
|
|
|
|
2014-02-02 23:56:08 +04:00
|
|
|
for (unsigned n=0; n < QWORD_ELEMENTS(len); n++)
|
|
|
|
result.vmm64u(n) = (Bit64u) op.ymm32u(n);
|
2011-08-27 17:47:16 +04:00
|
|
|
|
2014-02-02 23:56:08 +04:00
|
|
|
BX_WRITE_AVX_REGZ(i->dst(), result, len);
|
2011-08-27 17:47:16 +04:00
|
|
|
BX_NEXT_INSTR(i);
|
|
|
|
}
|
|
|
|
|
2018-02-16 10:57:32 +03:00
|
|
|
void BX_CPP_AttrRegparmN(1) BX_CPU_C::VPALIGNR_VdqHdqWdqIbR(bxInstruction_c *i)
|
2011-08-27 17:47:16 +04:00
|
|
|
{
|
2013-12-03 19:44:23 +04:00
|
|
|
BxPackedAvxRegister op1 = BX_READ_AVX_REG(i->src1()), op2 = BX_READ_AVX_REG(i->src2());
|
2011-08-27 17:47:16 +04:00
|
|
|
unsigned len = i->getVL();
|
|
|
|
|
|
|
|
for (unsigned n=0; n<len; n++)
|
2013-12-03 19:44:23 +04:00
|
|
|
xmm_palignr(&op2.vmm128(n), &op1.vmm128(n), i->Ib());
|
2011-08-27 17:47:16 +04:00
|
|
|
|
2013-12-03 19:44:23 +04:00
|
|
|
BX_WRITE_AVX_REGZ(i->dst(), op2, i->getVL());
|
2011-08-27 17:47:16 +04:00
|
|
|
|
|
|
|
BX_NEXT_INSTR(i);
|
|
|
|
}
|
|
|
|
|
2018-02-16 10:57:32 +03:00
|
|
|
void BX_CPP_AttrRegparmN(1) BX_CPU_C::VPERMD_VdqHdqWdqR(bxInstruction_c *i)
|
2011-08-27 17:47:16 +04:00
|
|
|
{
|
2013-07-26 16:50:56 +04:00
|
|
|
BxPackedYmmRegister op1 = BX_READ_YMM_REG(i->src1());
|
|
|
|
BxPackedYmmRegister op2 = BX_READ_YMM_REG(i->src2()), result;
|
2011-08-27 17:47:16 +04:00
|
|
|
|
2014-01-23 01:21:32 +04:00
|
|
|
for (unsigned n=0;n < 8;n++)
|
|
|
|
result.ymm32u(n) = op2.ymm32u(op1.ymm32u(n) & 0x7);
|
2011-08-27 17:47:16 +04:00
|
|
|
|
2013-07-26 16:50:56 +04:00
|
|
|
BX_WRITE_YMM_REGZ(i->dst(), result);
|
2011-08-27 17:47:16 +04:00
|
|
|
BX_NEXT_INSTR(i);
|
|
|
|
}
|
|
|
|
|
2018-02-16 10:57:32 +03:00
|
|
|
void BX_CPP_AttrRegparmN(1) BX_CPU_C::VPERMQ_VdqWdqIbR(bxInstruction_c *i)
|
2011-08-27 17:47:16 +04:00
|
|
|
{
|
2014-01-23 01:21:32 +04:00
|
|
|
BxPackedYmmRegister op = BX_READ_YMM_REG(i->src()), result;
|
2011-08-27 17:47:16 +04:00
|
|
|
|
2014-01-23 01:21:32 +04:00
|
|
|
ymm_vpermq(&result, &op, i->Ib());
|
2011-08-27 17:47:16 +04:00
|
|
|
|
2013-07-26 16:50:56 +04:00
|
|
|
BX_WRITE_YMM_REGZ(i->dst(), result);
|
2011-08-27 17:47:16 +04:00
|
|
|
BX_NEXT_INSTR(i);
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|