rs6000.c (output_mi_thunk): Don't determine insns for loading delta with num_insns_constant_wide.

* config/rs6000/rs6000.c (output_mi_thunk): Don't determine insns
	for loading delta with num_insns_constant_wide.  Calculate
	delta_low, delta_high without using a conditional.

From-SVN: r56525
This commit is contained in:
Alan Modra 2002-08-23 01:18:06 +00:00 committed by Alan Modra
parent 5b770a964a
commit 56a7189af0
2 changed files with 14 additions and 13 deletions

View File

@ -1,3 +1,9 @@
2002-08-23 Alan Modra <amodra@bigpond.net.au>
* config/rs6000/rs6000.c (output_mi_thunk): Don't determine insns
for loading delta with num_insns_constant_wide. Calculate
delta_low, delta_high without using a conditional.
2002-08-22 Jason Merrill <jason@redhat.com>
* c-common.h (RETURN_STMT_EXPR): Rename from RETURN_EXPR.

View File

@ -11271,23 +11271,22 @@ output_mi_thunk (file, thunk_fndecl, delta, function)
fprintf (file, "\taddi %s,%s,%d\n", this_reg, this_reg, delta);
}
/* 64-bit constants. If "int" is 32 bits, we'll never hit this abort. */
else if (TARGET_64BIT && (delta < -2147483647 - 1 || delta > 2147483647))
abort ();
/* Large constants that can be done by one addis instruction. */
else if ((delta & 0xffff) == 0 && num_insns_constant_wide (delta) == 1)
else if ((delta & 0xffff) == 0)
asm_fprintf (file, "\t{cau|addis} %s,%s,%d\n", this_reg, this_reg,
delta >> 16);
/* 32-bit constants that can be done by an add and addis instruction. */
else if (TARGET_32BIT || num_insns_constant_wide (delta) == 1)
else
{
/* Break into two pieces, propagating the sign bit from the low
word to the upper word. */
int delta_high = delta >> 16;
int delta_low = delta & 0xffff;
if ((delta_low & 0x8000) != 0)
{
delta_high++;
delta_low = (delta_low ^ 0x8000) - 0x8000; /* sign extend */
}
int delta_low = ((delta & 0xffff) ^ 0x8000) - 0x8000;
int delta_high = (delta - delta_low) >> 16;
asm_fprintf (file, "\t{cau|addis} %s,%s,%d\n", this_reg, this_reg,
delta_high);
@ -11298,10 +11297,6 @@ output_mi_thunk (file, thunk_fndecl, delta, function)
fprintf (file, "\taddi %s,%s,%d\n", this_reg, this_reg, delta_low);
}
/* 64-bit constants, fixme */
else
abort ();
/* Get the prefix in front of the names. */
switch (DEFAULT_ABI)
{