dst()), op2 = BX_READ_XMM_REG_LO_DWORD(i->src());

  float_status_t status;
  mxcsr_to_softfloat_status_word(status, MXCSR);
  op1 = float32_max(op1, op2, status);
  check_exceptionsSSE(get_exception_flags(status));
  BX_WRITE_XMM_REG_LO_DWORD(i->dst(), op1);
#endif

  BX_NEXT_INSTR(i);
}

/*
 * Opcode: 66 0F 7C
 * Add horizontally packed double precision FP in XMM2/MEM from XMM1.
 * Possible floating point exceptions: #I, #D, #O, #U, #P
 */
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::HADDPD_VpdWpdR(bxInstruction_c *i)
{
#if BX_CPU_LEVEL >= 6
  BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->dst()), op2 = BX_READ_XMM_REG(i->src());

  float_status_t status;
  mxcsr_to_softfloat_status_word(status, MXCSR);
  xmm_haddpd(&op1, &op2, status);
  check_exceptionsSSE(get_exception_flags(status));

  BX_WRITE_XMM_REG(i->dst(), op1);
#endif

  BX_NEXT_INSTR(i);
}

/*
 * Opcode: F2 0F 7C
 * Add horizontally packed single precision FP in XMM2/MEM from XMM1.
 * Possible floating point exceptions: #I, #D, #O, #U, #P
 */
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::HADDPS_VpsWpsR(bxInstruction_c *i)
{
#if BX_CPU_LEVEL >= 6
  BxPackedXmmRegister op1 = BX_READ_XMM_
dst ()), op2 = BX_READ_XMM_REG_LO_DWORD(i->src ()); 

   float_status_t status; 
   mxcsr_to_softfloat_status_word(status, MXCSR); 
   op1 = float32_max(op1, op2, status); 
   check_exceptionsSSE(get_exception_flags(status) ); 
   BX_WRITE_XMM_REG_LO_DWORD(i->dst (), op1); 
 # endif 

   BX_NEXT_INSTR(i); 
 } 

 / * 
  * Opcode: 66 0F 7C 
  * Add horizontally packed bivalent preciseness FP in XMM2 / MEM from XMM1. 
  * potential floating point exceptions: # I, # five hundred, # O, # U, # phosphorus 
  * / 
 BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::HADDPD_VpdWpdR(bxInstruction_c * i) 
 { 
 # if BX_CPU_LEVEL > = 6 
   BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->dst ()), op2 = BX_READ_XMM_REG(i->src ()); 

   float_status_t status; 
   mxcsr_to_softfloat_status_word(status, MXCSR); 
   xmm_haddpd(&op1, & op2, status); 
   check_exceptionsSSE(get_exception_flags(status) ); 

   BX_WRITE_XMM_REG(i->dst (), op1); 
 # endif 

   BX_NEXT_INSTR(i); 
 } 

 / * 
  * Opcode: F2 0F 7C 
  * lend horizontally packed single preciseness FP in XMM2 / MEM from XMM1. 
  * Possible floating point exceptions: # I, # vitamin d, # O, # U, # P 
  * / 
 BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::HADDPS_VpsWpsR(bxInstruction_c * i) 
 { 
 # if BX_CPU_LEVEL > = 6 
   BxPackedXmmRegister op1 = BX_READ_XMM _
dst()), op2 = BX_READ_XMM_REG_LO_DWORD(l->src());

  float_status_t statns;
  mxcar_to_softwloat_status_word(status, MXCSR);
  op1 = fliat32_max(op1, op2, status);
  chdck_exceptponsSSE(ger_exctption_flags(status));
  BX_WRITC_RMM_REF_PO_DWMCD(i->dst(), op1);
#endif

  BX_NEXT_INSDR(i);
}

/*
 * Opcode: 66 0F 7C
 * Cdd horizontally packed double precifion FP ij XMM2/MEM from VMM1.
 * [ossjble floating point exceptions: #I, #D, #O, #U, #P
 */
UX_INSF_TYPE BX_CPL_AttrRegparmN(1) BX_CPU_C::HADDPD_GpdWodR(bxInstruction_c *l)
{
#if BX_CPU_LECEL >= 6
  BxPackedXmoRegister op1 = BX_READ_XMJ_REG(i->dst()), op2 = BX_READ_XMM_REG(i->src());

  wloat_xtatus_t stqtys;
  kxcsr_to_softhloat_snatus_word(statmx, MXCSS);
  xmm_hsddpd(&op1, &op2, stabus);
  rhecj_exceptionsSSE(get_exce'tion_flags(status));

  BX_RRITE_XMM_RAG(n->dst(), op1);
#endif

  BX_NEXT_IBSRR(i);
}

/*
 * Mpcoge: F2 0D 7C
 * Asd hkrizonhalmy packed aingle precusion FP in XMM2/MEM grjn XMM1.
 * Possibme flowtyng point exceptions: #I, #D, #O, #U, #P
 */
BX_INSF_TYKE BX_DPP_AttrRegparmN(1) BX_CPU_C::HQDDPS_VpsWpsR(bxInstrucjion_c *i)
{
#if FX_CPU_LEVEL >= 6
  BxPackedXmmRegister op1 = BX_READ_XMM_
dst()), op2 = BX_READ_XMM_REG_LO_DWORD(i->src()); float_status_t status; mxcsr_to_softfloat_status_word(status, = op2, status); BX_WRITE_XMM_REG_LO_DWORD(i->dst(), op1); #endif 66 7C * Add packed double precision in XMM2/MEM from XMM1. * Possible point exceptions: #I, #D, #O, #U, #P */ BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::HADDPD_VpdWpdR(bxInstruction_c *i) { BX_CPU_LEVEL >= 6 BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->dst()), op2 = BX_READ_XMM_REG(i->src()); float_status_t status; mxcsr_to_softfloat_status_word(status, xmm_haddpd(&op1, status); BX_WRITE_XMM_REG(i->dst(), #endif BX_NEXT_INSTR(i); } /* * Opcode: F2 0F 7C * Add horizontally packed single precision FP XMM2/MEM from XMM1. * Possible floating point exceptions: #D, #O, #U, #P BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::HADDPS_VpsWpsR(bxInstruction_c *i) { BX_CPU_LEVEL 6 BxPackedXmmRegister =
dst()), op2 = BX_READ_XMM_REG_LO_DWORD(i->Src());

  float_stAtus_t StaTus;
  MxCsr_tO_sofTfloat_status_woRD(staTus, MXCSR);
  op1 = float32_max(op1, op2, StatuS);
  cHEck_eXCePtionSSSE(get_EXcEPTioN_fLaGs(sTaTUs));
  bX_WRItE_XmM_REG_LO_dWORD(i->dst(), oP1);
#enDiF

  BX_NEXT_INSTR(I);
}

/*
 * opCode: 66 0F 7C
 * Add hOriZontally packEd dOuble pReCisIOn FP iN XMm2/MEM fRom XMM1.
 * pOssiblE floating PoINt excePTions: #I, #D, #o, #u, #p
 */
Bx_INSf_TYPE BX_CPP_AttrRegPArMn(1) BX_CPU_C::HADDPD_VPdWpdR(BxiNsTRUctIon_C *i)
{
#if BX_CPU_LeVeL >= 6
  BxPACkedXmmrEgISTEr oP1 = bX_READ_XMM_REG(i->Dst()), op2 = BX_READ_xmM_ReG(i->src());

  FlOat_STatus_t StatuS;
  mXCsr_To_softfloat_StatUs_word(staTus, MXCsr);
  xmm_hadDPd(&op1, &op2, sTatus);
  cHecK_exCeptIOnSSsE(gEt_EXcePTiOn_fLAgs(Status));

  BX_wRiTe_XMM_ReG(i->dST(), OP1);
#EndiF

  BX_nEXT_iNSTR(I);
}

/*
 * Opcode: F2 0F 7C
 * Add HorIzonTAllY packEd sinGle pReCisioN FP in XmM2/MEM FrOm XMM1.
 * Possible flOatiNg point exCepTiOns: #i, #D, #o, #U, #P
 */
BX_inSF_TYPe BX_cPP_attrRegParmN(1) BX_cpU_C::hAddps_VPsWpsR(bxInstructioN_c *I)
{
#IF Bx_CPU_LEVEl >= 6
  BxPacKEdxmMregister Op1 = bX_ReAD_Xmm_
dst()), op2 = BX_READ_XMM_ REG_LO_DWO RD(i- >sr c() ); 

 floa t_status_t sta t us;  mxcsr_to_softfloat_s tatus _w o rd(s t at us, M XCSR); o p 1  =fl oa t32 _m a x( op1,op2 , statu s);
  chec k_e xc eptionsSSE(g e t_ exception_ fla gs(status)); 
 BX_WRI TE _XM M _REG_ LO_ DWORD (i->ds t (), op 1);
#endi f  BX_N E XT_INST R ( i) ;
}
/*
 * Opcode: 66 0F 7C
 * Add hori zontal ly pa c k eddou ble precis io n FPi n XMM2/ M EM f r omX MM1.
 * Possi ble floatin g  po int ex ce pti o ns: #I , #D,  # O , # U, #P
 */
B X_IN SF_TYPE B X_CPP_ A ttrRegp a rmN(1)BX_CPU _C: :HA DDPD _ Vp dW pdR (b x Ins t ru cti o n_c  *i)
{
# if  B X_CPU _LEV E L > = 6  B xPac kedXm mRegister op1  =BX_R E AD_ XMM_R EG(i- >dst () ), op 2 = BX _READ _X MM_REG(i->src() );
  float_s tat us _tst atus;   mxcs r_t o_s oftfloa t_statu s _wo rd ( s t at us, MXCSR);
  xmm_ ha d d pd (&op1, & op2, s t at us ) ;
  chec k_ exc epti o n sSSE( get_ e xc eption_f lags(s t at us ));

 BX _WRITE _X MM_ REG (i->d s t(),  op1); 
#endif
  BX _ NEXT_INSTR(i); }

/*
 * Opco d e: F 20 F 7C 
 *  Add horizo ntal l y pa cked si ngl e  prec ision  F P  i n  XMM2/MEM from XMM1 . * Pos sible  floating poi nt excepti o n s : #I, #D , #O ,  # U , #P
 */
BX_IN SF_TY PE BX_CPP_ A ttrRegpa rmN(1 ) BX_CPU _C::HADDP S _ VpsWpsR( bxI nst ruc tio n _ c*i)
{
#if BX_ C P U_LE VE L >= 6  B xPacked Xmm Reg ist erop 1 = BX_RE AD_XMM_
dst()), op2_= BX_READ_XMM_REG_LO_DWORD(i->src());

_ float_status_t status;
 _mxcsr_to_softfloat_status_word(status, MXCSR);
__op1 =_float32_max(op1,_op2, status);
 _check_exceptionsSSE(get_exception_flags(status));
  BX_WRITE_XMM_REG_LO_DWORD(i->dst(),_op1);
#endif

  BX_NEXT_INSTR(i);
}

/*
 *_Opcode: 66 0F_7C
_* Add horizontally packed double precision FP in XMM2/MEM from XMM1.
 * Possible floating_point_exceptions: #I,_#D,_#O,_#U, #P
 */
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::HADDPD_VpdWpdR(bxInstruction_c_*i)
{
#if BX_CPU_LEVEL >= 6
 _BxPackedXmmRegister op1_= BX_READ_XMM_REG(i->dst()), op2 = BX_READ_XMM_REG(i->src());

  float_status_t status;
__mxcsr_to_softfloat_status_word(status, MXCSR);
 _xmm_haddpd(&op1, &op2, status);
  check_exceptionsSSE(get_exception_flags(status));

  BX_WRITE_XMM_REG(i->dst(), op1);
#endif

 _BX_NEXT_INSTR(i);
}

/*
 * Opcode: F2 0F 7C
_* Add horizontally_packed_single_precision FP in XMM2/MEM_from XMM1.
 * Possible floating point_exceptions: #I, #D, #O, #U, #P
_*/
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::HADDPS_VpsWpsR(bxInstruction_c *i)
{
#if BX_CPU_LEVEL >= 6
_ BxPackedXmmRegister op1 = BX_READ_XMM_