* tc-i386.c (i386_align_code): Implement x86_64 neutral code fillers.
This commit is contained in:
parent
f7ef933922
commit
33fef721a1
|
@ -1,3 +1,7 @@
|
||||||
|
Wed Jul 17 00:30:13 CEST 2002 Jan Hubicka <jh@suse.cz>
|
||||||
|
|
||||||
|
* tc-i386.c (i386_align_code): Implement x86_64 neutral code fillers.
|
||||||
|
|
||||||
2002-07-16 Moritz Jodeit <moritz@jodeit.org>
|
2002-07-16 Moritz Jodeit <moritz@jodeit.org>
|
||||||
|
|
||||||
* config/tc-z8k.c (build_bytes): Correct order of memset args.
|
* config/tc-z8k.c (build_bytes): Correct order of memset args.
|
||||||
|
|
|
@ -521,13 +521,33 @@ i386_align_code (fragP, count)
|
||||||
f32_15, f32_15, f32_15, f32_15, f32_15, f32_15, f32_15
|
f32_15, f32_15, f32_15, f32_15, f32_15, f32_15, f32_15
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ??? We can't use these fillers for x86_64, since they often kills the
|
if (count <= 0 || count > 15)
|
||||||
upper halves. Solve later. */
|
return;
|
||||||
if (flag_code == CODE_64BIT)
|
|
||||||
count = 1;
|
|
||||||
|
|
||||||
if (count > 0 && count <= 15)
|
/* The recommended way to pad 64bit code is to use NOPs preceded by
|
||||||
|
maximally four 0x66 prefixes. Balance the size of nops. */
|
||||||
|
if (flag_code == CODE_64BIT)
|
||||||
{
|
{
|
||||||
|
int i;
|
||||||
|
int nnops = (count + 3) / 4;
|
||||||
|
int len = count / nnops;
|
||||||
|
int remains = count - nnops * len;
|
||||||
|
int pos = 0;
|
||||||
|
|
||||||
|
for (i = 0; i < remains; i++)
|
||||||
|
{
|
||||||
|
memset (fragP->fr_literal + fragP->fr_fix + pos, 0x66, len);
|
||||||
|
fragP->fr_literal[fragP->fr_fix + pos + len] = 0x90;
|
||||||
|
pos += len + 1;
|
||||||
|
}
|
||||||
|
for (; i < nnops; i++)
|
||||||
|
{
|
||||||
|
memset (fragP->fr_literal + fragP->fr_fix + pos, 0x66, len - 1);
|
||||||
|
fragP->fr_literal[fragP->fr_fix + pos + len - 1] = 0x90;
|
||||||
|
pos += len;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
if (flag_code == CODE_16BIT)
|
if (flag_code == CODE_16BIT)
|
||||||
{
|
{
|
||||||
memcpy (fragP->fr_literal + fragP->fr_fix,
|
memcpy (fragP->fr_literal + fragP->fr_fix,
|
||||||
|
@ -541,7 +561,6 @@ i386_align_code (fragP, count)
|
||||||
f32_patt[count - 1], count);
|
f32_patt[count - 1], count);
|
||||||
fragP->fr_var = count;
|
fragP->fr_var = count;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
static INLINE unsigned int
|
static INLINE unsigned int
|
||||||
mode_from_disp_size (t)
|
mode_from_disp_size (t)
|
||||||
|
|
Loading…
Reference in New Issue