if (i >= FPC_REGNUM
&& i != FIOFF_REGNUM && i != FOOFF_REGNUM)
{
+ char buf[4];
+
+ regcache_collect (i, buf);
+
if (i == FOP_REGNUM)
{
unsigned short oldval, newval;
/* The opcode occupies only 11 bits. */
oldval = (*(unsigned short *) (FSAVE_ADDR (fsave, i)));
- newval = *(unsigned short *) ®isters[REGISTER_BYTE (i)];
+ newval = *(unsigned short *) buf;
newval &= ((1 << 11) - 1);
newval |= oldval & ~((1 << 11) - 1);
memcpy (FSAVE_ADDR (fsave, i), &newval, 2);
}
else
- memcpy (FSAVE_ADDR (fsave, i), ®isters[REGISTER_BYTE (i)], 2);
+ memcpy (FSAVE_ADDR (fsave, i), buf, 2);
}
else
- memcpy (FSAVE_ADDR (fsave, i), ®isters[REGISTER_BYTE (i)],
- REGISTER_RAW_SIZE (i));
+ regcache_collect (i, FSAVE_ADDR (fsave, i));
}
}
\f
if (i >= FPC_REGNUM && i < XMM0_REGNUM
&& i != FIOFF_REGNUM && i != FDOFF_REGNUM)
{
+ char buf[4];
+
+ regcache_collect (i, buf);
+
if (i == FOP_REGNUM)
{
unsigned short oldval, newval;
/* The opcode occupies only 11 bits. */
oldval = (*(unsigned short *) (FXSAVE_ADDR (fxsave, i)));
- newval = *(unsigned short *) ®isters[REGISTER_BYTE (i)];
+ newval = *(unsigned short *) buf;
newval &= ((1 << 11) - 1);
newval |= oldval & ~((1 << 11) - 1);
memcpy (FXSAVE_ADDR (fxsave, i), &newval, 2);
unsigned short ftag;
int fpreg;
- ftag = *(unsigned short *) ®isters[REGISTER_BYTE (i)];
+ ftag = *(unsigned short *) buf;
for (fpreg = 7; fpreg >= 0; fpreg--)
{
memcpy (FXSAVE_ADDR (fxsave, i), &val, 2);
}
else
- memcpy (FXSAVE_ADDR (fxsave, i),
- ®isters[REGISTER_BYTE (i)], 2);
+ memcpy (FXSAVE_ADDR (fxsave, i), buf, 2);
}
else
- memcpy (FXSAVE_ADDR (fxsave, i), ®isters[REGISTER_BYTE (i)],
- REGISTER_RAW_SIZE (i));
+ regcache_collect (i, FXSAVE_ADDR (fxsave, i));
}
}