i386.c (ix86_force_to_memory, [...]): Update for 64bit.
* i386.c (ix86_force_to_memory, ix86_free_from_memory): Update for 64bit. From-SVN: r41062
This commit is contained in:
parent
547a559d01
commit
898d374de9
2 changed files with 90 additions and 44 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Tue Apr 3 19:41:21 CEST 2001 Jan Hubicka <jh@suse.cz>
|
||||||
|
|
||||||
|
* i386.c (ix86_force_to_memory, ix86_free_from_memory):
|
||||||
|
Update for 64bit.
|
||||||
|
|
||||||
2001-04-03 Zack Weinberg <zackw@stanford.edu>
|
2001-04-03 Zack Weinberg <zackw@stanford.edu>
|
||||||
|
|
||||||
* config/i386/xm-beos.h, config/i386/xm-isc.h,
|
* config/i386/xm-beos.h, config/i386/xm-isc.h,
|
||||||
|
|
|
@ -10147,45 +10147,79 @@ ix86_force_to_memory (mode, operand)
|
||||||
enum machine_mode mode;
|
enum machine_mode mode;
|
||||||
rtx operand;
|
rtx operand;
|
||||||
{
|
{
|
||||||
|
rtx result;
|
||||||
if (!reload_completed)
|
if (!reload_completed)
|
||||||
abort ();
|
abort ();
|
||||||
switch (mode)
|
if (TARGET_64BIT && TARGET_RED_ZONE)
|
||||||
{
|
{
|
||||||
case DImode:
|
result = gen_rtx_MEM (mode,
|
||||||
{
|
gen_rtx_PLUS (Pmode,
|
||||||
rtx operands[2];
|
stack_pointer_rtx,
|
||||||
split_di (&operand, 1, operands, operands+1);
|
GEN_INT (-RED_ZONE_SIZE)));
|
||||||
emit_insn (
|
emit_move_insn (result, operand);
|
||||||
gen_rtx_SET (VOIDmode,
|
|
||||||
gen_rtx_MEM (SImode,
|
|
||||||
gen_rtx_PRE_DEC (Pmode,
|
|
||||||
stack_pointer_rtx)),
|
|
||||||
operands[1]));
|
|
||||||
emit_insn (
|
|
||||||
gen_rtx_SET (VOIDmode,
|
|
||||||
gen_rtx_MEM (SImode,
|
|
||||||
gen_rtx_PRE_DEC (Pmode,
|
|
||||||
stack_pointer_rtx)),
|
|
||||||
operands[0]));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case HImode:
|
|
||||||
/* It is better to store HImodes as SImodes. */
|
|
||||||
if (!TARGET_PARTIAL_REG_STALL)
|
|
||||||
operand = gen_lowpart (SImode, operand);
|
|
||||||
/* FALLTHRU */
|
|
||||||
case SImode:
|
|
||||||
emit_insn (
|
|
||||||
gen_rtx_SET (VOIDmode,
|
|
||||||
gen_rtx_MEM (GET_MODE (operand),
|
|
||||||
gen_rtx_PRE_DEC (SImode,
|
|
||||||
stack_pointer_rtx)),
|
|
||||||
operand));
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
abort();
|
|
||||||
}
|
}
|
||||||
return gen_rtx_MEM (mode, stack_pointer_rtx);
|
else if (TARGET_64BIT && !TARGET_RED_ZONE)
|
||||||
|
{
|
||||||
|
switch (mode)
|
||||||
|
{
|
||||||
|
case HImode:
|
||||||
|
case SImode:
|
||||||
|
operand = gen_lowpart (DImode, operand);
|
||||||
|
/* FALLTHRU */
|
||||||
|
case DImode:
|
||||||
|
emit_insn (
|
||||||
|
gen_rtx_SET (VOIDmode,
|
||||||
|
gen_rtx_MEM (DImode,
|
||||||
|
gen_rtx_PRE_DEC (DImode,
|
||||||
|
stack_pointer_rtx)),
|
||||||
|
operand));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
abort ();
|
||||||
|
}
|
||||||
|
result = gen_rtx_MEM (mode, stack_pointer_rtx);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
switch (mode)
|
||||||
|
{
|
||||||
|
case DImode:
|
||||||
|
{
|
||||||
|
rtx operands[2];
|
||||||
|
split_di (&operand, 1, operands, operands + 1);
|
||||||
|
emit_insn (
|
||||||
|
gen_rtx_SET (VOIDmode,
|
||||||
|
gen_rtx_MEM (SImode,
|
||||||
|
gen_rtx_PRE_DEC (Pmode,
|
||||||
|
stack_pointer_rtx)),
|
||||||
|
operands[1]));
|
||||||
|
emit_insn (
|
||||||
|
gen_rtx_SET (VOIDmode,
|
||||||
|
gen_rtx_MEM (SImode,
|
||||||
|
gen_rtx_PRE_DEC (Pmode,
|
||||||
|
stack_pointer_rtx)),
|
||||||
|
operands[0]));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case HImode:
|
||||||
|
/* It is better to store HImodes as SImodes. */
|
||||||
|
if (!TARGET_PARTIAL_REG_STALL)
|
||||||
|
operand = gen_lowpart (SImode, operand);
|
||||||
|
/* FALLTHRU */
|
||||||
|
case SImode:
|
||||||
|
emit_insn (
|
||||||
|
gen_rtx_SET (VOIDmode,
|
||||||
|
gen_rtx_MEM (GET_MODE (operand),
|
||||||
|
gen_rtx_PRE_DEC (SImode,
|
||||||
|
stack_pointer_rtx)),
|
||||||
|
operand));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
abort ();
|
||||||
|
}
|
||||||
|
result = gen_rtx_MEM (mode, stack_pointer_rtx);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Free operand from the memory. */
|
/* Free operand from the memory. */
|
||||||
|
@ -10193,15 +10227,22 @@ void
|
||||||
ix86_free_from_memory (mode)
|
ix86_free_from_memory (mode)
|
||||||
enum machine_mode mode;
|
enum machine_mode mode;
|
||||||
{
|
{
|
||||||
/* Use LEA to deallocate stack space. In peephole2 it will be converted
|
if (!TARGET_64BIT || !TARGET_RED_ZONE)
|
||||||
to pop or add instruction if registers are available. */
|
{
|
||||||
emit_insn (gen_rtx_SET (VOIDmode, stack_pointer_rtx,
|
int size;
|
||||||
gen_rtx_PLUS (Pmode, stack_pointer_rtx,
|
|
||||||
GEN_INT (mode == DImode
|
if (mode == DImode || TARGET_64BIT)
|
||||||
? 8
|
size = 8;
|
||||||
: mode == HImode && TARGET_PARTIAL_REG_STALL
|
else if (mode == HImode && TARGET_PARTIAL_REG_STALL)
|
||||||
? 2
|
size = 2;
|
||||||
: 4))));
|
else
|
||||||
|
size = 4;
|
||||||
|
/* Use LEA to deallocate stack space. In peephole2 it will be converted
|
||||||
|
to pop or add instruction if registers are available. */
|
||||||
|
emit_insn (gen_rtx_SET (VOIDmode, stack_pointer_rtx,
|
||||||
|
gen_rtx_PLUS (Pmode, stack_pointer_rtx,
|
||||||
|
GEN_INT (size))));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Put float CONST_DOUBLE in the constant pool instead of fp regs.
|
/* Put float CONST_DOUBLE in the constant pool instead of fp regs.
|
||||||
|
|
Loading…
Add table
Reference in a new issue