optabs.c (prepare_cmp_insn): Let emit_library_call_value generate a pseudo reg that receives the result of a...

* optabs.c (prepare_cmp_insn): Let emit_library_call_value
	generate a pseudo reg that receives the result of a libcall.
	(prepare_float_lib_cmp): Likewise.

From-SVN: r57255
This commit is contained in:
Kazu Hirata 2002-09-17 19:02:58 +00:00 committed by Kazu Hirata
parent ec55ac6864
commit 24491a0950
2 changed files with 23 additions and 30 deletions

View File

@ -1,3 +1,9 @@
2002-09-17 Kazu Hirata <kazu@cs.umass.edu>
* optabs.c (prepare_cmp_insn): Let emit_library_call_value
generate a pseudo reg that receives the result of a libcall.
(prepare_float_lib_cmp): Likewise.
2002-09-17 Steve Ellcey <sje@cup.hp.com>
* config/ia64/elf.h: Remove CPP_PREDEFINES.

View File

@ -3436,29 +3436,23 @@ prepare_cmp_insn (px, py, pcomparison, size, pmode, punsignedp, purpose)
#endif
{
#ifdef TARGET_MEM_FUNCTIONS
emit_library_call (memcmp_libfunc, LCT_PURE_MAKE_BLOCK,
TYPE_MODE (integer_type_node), 3,
XEXP (x, 0), Pmode, XEXP (y, 0), Pmode,
convert_to_mode (TYPE_MODE (sizetype), size,
TREE_UNSIGNED (sizetype)),
TYPE_MODE (sizetype));
result = emit_library_call_value (memcmp_libfunc, NULL_RTX, LCT_PURE_MAKE_BLOCK,
TYPE_MODE (integer_type_node), 3,
XEXP (x, 0), Pmode, XEXP (y, 0), Pmode,
convert_to_mode (TYPE_MODE (sizetype), size,
TREE_UNSIGNED (sizetype)),
TYPE_MODE (sizetype));
#else
emit_library_call (bcmp_libfunc, LCT_PURE_MAKE_BLOCK,
TYPE_MODE (integer_type_node), 3,
XEXP (x, 0), Pmode, XEXP (y, 0), Pmode,
convert_to_mode (TYPE_MODE (integer_type_node),
size,
TREE_UNSIGNED (integer_type_node)),
TYPE_MODE (integer_type_node));
result = emit_library_call_value (bcmp_libfunc, NULL_RTX, LCT_PURE_MAKE_BLOCK,
TYPE_MODE (integer_type_node), 3,
XEXP (x, 0), Pmode, XEXP (y, 0), Pmode,
convert_to_mode (TYPE_MODE (integer_type_node),
size,
TREE_UNSIGNED (integer_type_node)),
TYPE_MODE (integer_type_node));
#endif
/* Immediately move the result of the libcall into a pseudo
register so reload doesn't clobber the value if it needs
the return register for a spill reg. */
result = gen_reg_rtx (TYPE_MODE (integer_type_node));
result_mode = TYPE_MODE (integer_type_node);
emit_move_insn (result,
hard_libcall_value (result_mode));
}
*px = result;
*py = const0_rtx;
@ -3483,14 +3477,8 @@ prepare_cmp_insn (px, py, pcomparison, size, pmode, punsignedp, purpose)
if (unsignedp && ucmp_optab->handlers[(int) mode].libfunc)
libfunc = ucmp_optab->handlers[(int) mode].libfunc;
emit_library_call (libfunc, LCT_CONST_MAKE_BLOCK, word_mode, 2, x, mode,
y, mode);
/* Immediately move the result of the libcall into a pseudo
register so reload doesn't clobber the value if it needs
the return register for a spill reg. */
result = gen_reg_rtx (word_mode);
emit_move_insn (result, hard_libcall_value (word_mode));
result = emit_library_call_value (libfunc, NULL_RTX, LCT_CONST_MAKE_BLOCK,
word_mode, 2, x, mode, y, mode);
/* Integer comparison returns a result that must be compared against 1,
so that even if we do an unsigned compare afterward,
@ -4006,9 +3994,8 @@ prepare_float_lib_cmp (px, py, pcomparison, pmode, punsignedp)
if (libfunc == 0)
abort ();
result = gen_reg_rtx (word_mode);
emit_library_call_value (libfunc, result, LCT_CONST_MAKE_BLOCK,
word_mode, 2, x, mode, y, mode);
result = emit_library_call_value (libfunc, NULL_RTX, LCT_CONST_MAKE_BLOCK,
word_mode, 2, x, mode, y, mode);
*px = result;
*py = const0_rtx;
*pmode = word_mode;