FreeBSD/sys/amd64/amd64/machdep.c
/* XXX check all this stuff! */
/* externalize from sv_xmm */
XXX check all this stuff.
XXX check all this stuff .
static void
fill_fpregs_xmm(struct savefpu *sv_xmm, struct fpreg *fpregs)
{
	struct envxmm *penv_fpreg = (struct envxmm *)&fpregs->fpr_env;
	struct envxmm *penv_xmm = &sv_xmm->sv_env;
	int i;
	bzero(fpregs, sizeof(*fpregs));
	penv_fpreg->en_cw = penv_xmm->en_cw;
	penv_fpreg->en_sw = penv_xmm->en_sw;
	penv_fpreg->en_tw = penv_xmm->en_tw;
	penv_fpreg->en_opcode = penv_xmm->en_opcode;
	penv_fpreg->en_rip = penv_xmm->en_rip;
	penv_fpreg->en_rdp = penv_xmm->en_rdp;
	penv_fpreg->en_mxcsr = penv_xmm->en_mxcsr;
	penv_fpreg->en_mxcsr_mask = penv_xmm->en_mxcsr_mask;
	for (i = 0; i < 8; ++i)
		bcopy(sv_xmm->sv_fp[i].fp_acc.fp_bytes, fpregs->fpr_acc[i], 10);
	for (i = 0; i < 16; ++i)
		bcopy(sv_xmm->sv_xmm[i].xmm_bytes, fpregs->fpr_xacc[i], 16);
}
static void fill_fpregs_xmm ( struct savefpu * sv_xmm , struct fpreg * fpregs ) { struct envxmm * penv_fpreg = ( struct envxmm * ) & fpregs -> fpr_env ; struct envxmm * penv_xmm = & sv_xmm -> sv_env ; int i ; bzero ( fpregs , sizeof ( * fpregs ) ) ; penv_fpreg -> en_cw = penv_xmm -> en_cw ; penv_fpreg -> en_sw = penv_xmm -> en_sw ; penv_fpreg -> en_tw = penv_xmm -> en_tw ; penv_fpreg -> en_opcode = penv_xmm -> en_opcode ; penv_fpreg -> en_rip = penv_xmm -> en_rip ; penv_fpreg -> en_rdp = penv_xmm -> en_rdp ; penv_fpreg -> en_mxcsr = penv_xmm -> en_mxcsr ; penv_fpreg -> en_mxcsr_mask = penv_xmm -> en_mxcsr_mask ; for ( i = 0 ; i < 8 ; ++ i ) bcopy ( sv_xmm -> sv_fp [ i ] . fp_acc . fp_bytes , fpregs -> fpr_acc [ i ] , 10 ) ; for ( i = 0 ; i < 16 ; ++ i ) bcopy ( sv_xmm -> sv_xmm [ i ] . xmm_bytes , fpregs -> fpr_xacc [ i ] , 16 ) ; }
XXX check all this stuff!
XXX check all this stuff!
/* pcb -> fpregs */ /* FPU control/status */ /* FPU registers */ /* SSE registers */