Fixes register reading and writing for XMM8-15 on x86-64 (#1090)
This commit is contained in:

committed by
Nguyen Anh Quynh

parent
778171fc95
commit
ae6e3c193d
@ -767,6 +767,21 @@ int x86_reg_read(struct uc_struct *uc, unsigned int *regs, void **vals, int coun
|
|||||||
case UC_X86_REG_MXCSR:
|
case UC_X86_REG_MXCSR:
|
||||||
*(uint32_t *)value = X86_CPU(uc, mycpu)->env.mxcsr;
|
*(uint32_t *)value = X86_CPU(uc, mycpu)->env.mxcsr;
|
||||||
break;
|
break;
|
||||||
|
case UC_X86_REG_XMM8:
|
||||||
|
case UC_X86_REG_XMM9:
|
||||||
|
case UC_X86_REG_XMM10:
|
||||||
|
case UC_X86_REG_XMM11:
|
||||||
|
case UC_X86_REG_XMM12:
|
||||||
|
case UC_X86_REG_XMM13:
|
||||||
|
case UC_X86_REG_XMM14:
|
||||||
|
case UC_X86_REG_XMM15:
|
||||||
|
{
|
||||||
|
float64 *dst = (float64*)value;
|
||||||
|
XMMReg *reg = &X86_CPU(uc, mycpu)->env.xmm_regs[regid - UC_X86_REG_XMM0];
|
||||||
|
dst[0] = reg->_d[0];
|
||||||
|
dst[1] = reg->_d[1];
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
@ -1338,6 +1353,21 @@ int x86_reg_write(struct uc_struct *uc, unsigned int *regs, void *const *vals, i
|
|||||||
case UC_X86_REG_MXCSR:
|
case UC_X86_REG_MXCSR:
|
||||||
cpu_set_mxcsr(&X86_CPU(uc, mycpu)->env, *(uint32_t *)value);
|
cpu_set_mxcsr(&X86_CPU(uc, mycpu)->env, *(uint32_t *)value);
|
||||||
break;
|
break;
|
||||||
|
case UC_X86_REG_XMM8:
|
||||||
|
case UC_X86_REG_XMM9:
|
||||||
|
case UC_X86_REG_XMM10:
|
||||||
|
case UC_X86_REG_XMM11:
|
||||||
|
case UC_X86_REG_XMM12:
|
||||||
|
case UC_X86_REG_XMM13:
|
||||||
|
case UC_X86_REG_XMM14:
|
||||||
|
case UC_X86_REG_XMM15:
|
||||||
|
{
|
||||||
|
float64 *src = (float64*)value;
|
||||||
|
XMMReg *reg = &X86_CPU(uc, mycpu)->env.xmm_regs[regid - UC_X86_REG_XMM0];
|
||||||
|
reg->_d[0] = src[0];
|
||||||
|
reg->_d[1] = src[1];
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user