Commit aea3d681 by DJ Delorie Committed by DJ Delorie

expr.c (convert_move): If the target has an explicit converter, use it.

* expr.c (convert_move): If the target has an explicit converter,
use it.

From-SVN: r214747
parent 4c907247
2014-08-29 DJ Delorie <dj@redhat.com>
* expr.c (convert_move): If the target has an explicit converter,
use it.
2014-08-29 David Malcolm <dmalcolm@redhat.com> 2014-08-29 David Malcolm <dmalcolm@redhat.com>
* gdbinit.in: Skip various inline functions in rtl.h when * gdbinit.in: Skip various inline functions in rtl.h when
...@@ -410,6 +410,26 @@ convert_move (rtx to, rtx from, int unsignedp) ...@@ -410,6 +410,26 @@ convert_move (rtx to, rtx from, int unsignedp)
} }
/* Handle pointer conversion. */ /* SPEE 900220. */ /* Handle pointer conversion. */ /* SPEE 900220. */
/* If the target has a converter from FROM_MODE to TO_MODE, use it. */
{
convert_optab ctab;
if (GET_MODE_PRECISION (from_mode) > GET_MODE_PRECISION (to_mode))
ctab = trunc_optab;
else if (unsignedp)
ctab = zext_optab;
else
ctab = sext_optab;
if (convert_optab_handler (ctab, to_mode, from_mode)
!= CODE_FOR_nothing)
{
emit_unop_insn (convert_optab_handler (ctab, to_mode, from_mode),
to, from, UNKNOWN);
return;
}
}
/* Targets are expected to provide conversion insns between PxImode and /* Targets are expected to provide conversion insns between PxImode and
xImode for all MODE_PARTIAL_INT modes they use, but no others. */ xImode for all MODE_PARTIAL_INT modes they use, but no others. */
if (GET_MODE_CLASS (to_mode) == MODE_PARTIAL_INT) if (GET_MODE_CLASS (to_mode) == MODE_PARTIAL_INT)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment