OSDN Git Service

* optabs.c (prepare_cmp_insn): Let emit_library_call_value
authorkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 17 Sep 2002 19:02:58 +0000 (19:02 +0000)
committerkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 17 Sep 2002 19:02:58 +0000 (19:02 +0000)
generate a pseudo reg that receives the result of a libcall.
(prepare_float_lib_cmp): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@57255 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/optabs.c

index debee29..34852fe 100644 (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.
index 7ceec12..0d13bb1 100644 (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;