int i, top;
unsigned long val;
unsigned int clear_bv;
- char *p;
+ gdb_byte *p;
/* The supported bits in `xstat_bv' are 1 byte. Clear part in
vector registers if its bit in xstat_bv is zero. */
clear_bv = (~fp->xstate_bv) & x86_xcr0;
/* Check if any x87 registers are changed. */
- if ((x86_xcr0 & I386_XSTATE_X87))
+ if ((x86_xcr0 & I386_XSTATE_X87) != 0)
{
int st0_regnum = find_regno ("st0");
- if ((clear_bv & I386_XSTATE_X87))
- p = NULL;
+ if ((clear_bv & I386_XSTATE_X87) != 0)
+ {
+ for (i = 0; i < 8; i++)
+ supply_register (regcache, i + st0_regnum, NULL);
+ }
else
- p = (char *) buf;
-
- for (i = 0; i < 8; i++)
{
- if (p)
- p = ((char *) &fp->st_space[0]) + i * 16;
- supply_register (regcache, i + st0_regnum, p);
+ p = (gdb_byte *) &fp->st_space[0];
+ for (i = 0; i < 8; i++)
+ supply_register (regcache, i + st0_regnum, p + i * 16);
}
}
- if ((x86_xcr0 & I386_XSTATE_SSE))
+ if ((x86_xcr0 & I386_XSTATE_SSE) != 0)
{
int xmm0_regnum = find_regno ("xmm0");
if ((clear_bv & I386_XSTATE_SSE))
- p = NULL;
+ {
+ for (i = 0; i < num_xmm_registers; i++)
+ supply_register (regcache, i + xmm0_regnum, NULL);
+ }
else
- p = (char *) buf;
-
- for (i = 0; i < num_xmm_registers; i++)
{
- if (p)
- p = ((char *) &fp->xmm_space[0]) + i * 16;
- supply_register (regcache, i + xmm0_regnum, p);
+ p = (gdb_byte *) &fp->xmm_space[0];
+ for (i = 0; i < num_xmm_registers; i++)
+ supply_register (regcache, i + xmm0_regnum, p + i * 16);
}
}
- if ((x86_xcr0 & I386_XSTATE_AVX))
+ if ((x86_xcr0 & I386_XSTATE_AVX) != 0)
{
int ymm0h_regnum = find_regno ("ymm0h");
- if ((clear_bv & I386_XSTATE_AVX))
- p = NULL;
+ if ((clear_bv & I386_XSTATE_AVX) != 0)
+ {
+ for (i = 0; i < num_xmm_registers; i++)
+ supply_register (regcache, i + ymm0h_regnum, NULL);
+ }
else
- p = (char *) buf;
-
- for (i = 0; i < num_xmm_registers; i++)
{
- if (p)
- p = ((char *) &fp->ymmh_space[0]) + i * 16;
- supply_register (regcache, i + ymm0h_regnum, p);
+ p = (gdb_byte *) &fp->ymmh_space[0];
+ for (i = 0; i < num_xmm_registers; i++)
+ supply_register (regcache, i + ymm0h_regnum, p + i * 16);
}
}