===================================================================
@@ -166,6 +166,7 @@ extern const unsigned char mode_class[NU
/* Nonzero if CLASS modes can be widened. */
#define CLASS_HAS_WIDER_MODES_P(CLASS) \
(CLASS == MODE_INT \
+ || CLASS == MODE_PARTIAL_INT \
|| CLASS == MODE_FLOAT \
|| CLASS == MODE_DECIMAL_FLOAT \
|| CLASS == MODE_COMPLEX_FLOAT \
===================================================================
@@ -438,21 +438,20 @@ convert_move (rtx to, rtx from, int unsi
rtx new_from;
enum machine_mode full_mode
= smallest_mode_for_size (GET_MODE_BITSIZE (from_mode), MODE_INT);
+ convert_optab ctab = unsignedp ? zext_optab : sext_optab;
+ enum insn_code icode;
- gcc_assert (convert_optab_handler (sext_optab, full_mode, from_mode)
- != CODE_FOR_nothing);
+ icode = convert_optab_handler (ctab, full_mode, from_mode);
+ gcc_assert (icode != CODE_FOR_nothing);
if (to_mode == full_mode)
{
- emit_unop_insn (convert_optab_handler (sext_optab, full_mode,
- from_mode),
- to, from, UNKNOWN);
+ emit_unop_insn (icode, to, from, UNKNOWN);
return;
}
new_from = gen_reg_rtx (full_mode);
- emit_unop_insn (convert_optab_handler (sext_optab, full_mode, from_mode),
- new_from, from, UNKNOWN);
+ emit_unop_insn (icode, new_from, from, UNKNOWN);
/* else proceed to integer conversions below. */
from_mode = full_mode;
===================================================================
@@ -360,7 +360,6 @@ complete_mode (struct mode_data *m)
m->bytesize = m->component->bytesize;
m->ncomponents = 1;
- m->component = 0; /* ??? preserve this */
break;
case MODE_COMPLEX_INT:
@@ -823,7 +822,13 @@ calc_wider_mode (void)
sortbuf[i] = 0;
for (j = 0; j < i; j++)
- sortbuf[j]->next = sortbuf[j]->wider = sortbuf[j + 1];
+ {
+ sortbuf[j]->next = sortbuf[j + 1];
+ if (c == MODE_PARTIAL_INT)
+ sortbuf[j]->wider = sortbuf[j]->component;
+ else
+ sortbuf[j]->wider = sortbuf[j]->next;
+ }
modes[c] = sortbuf[0];
}
@@ -1120,7 +1125,8 @@ emit_mode_inner (void)
for_all_modes (c, m)
tagged_printf ("%smode",
- m->component ? m->component->name : void_mode->name,
+ c != MODE_PARTIAL_INT && m->component
+ ? m->component->name : void_mode->name,
m->name);
print_closer ();