]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
cris.c (cris_function_value, [...]): New functions.
authorAnatoly Sokolov <aesok@post.ru>
Mon, 19 Oct 2009 20:54:07 +0000 (00:54 +0400)
committerAnatoly Sokolov <aesok@gcc.gnu.org>
Mon, 19 Oct 2009 20:54:07 +0000 (00:54 +0400)
* config/cris/cris.c (cris_function_value, cris_libcall_value,
cris_function_value_regno_p): New functions.
(cris_promote_function_mode): Update comment.
(TARGET_FUNCTION_VALUE, TARGET_LIBCALL_VALUE): Declare.
* config/cris/cris.h: (FUNCTION_VALUE, LIBCALL_VALUE): Remove.
(FUNCTION_VALUE_REGNO_P): Redefine, use cris_function_value_regno_p.
* config/cris/cris-protos.h (cris_function_value_regno_p): Declare.

From-SVN: r152992

gcc/ChangeLog
gcc/config/cris/cris-protos.h
gcc/config/cris/cris.c
gcc/config/cris/cris.h

index c9ec51257f05f4cb672bbc44d5ef9a68b666b83c..83b507adb28cbb2834da7695464b0c06cb8f99a4 100644 (file)
@@ -1,3 +1,13 @@
+2009-10-19  Anatoly Sokolov  <aesok@post.ru>
+
+       * config/cris/cris.c (cris_function_value, cris_libcall_value,
+       cris_function_value_regno_p): New functions.
+       (cris_promote_function_mode): Update comment.
+       (TARGET_FUNCTION_VALUE, TARGET_LIBCALL_VALUE): Declare.
+       * config/cris/cris.h: (FUNCTION_VALUE, LIBCALL_VALUE): Remove.
+       (FUNCTION_VALUE_REGNO_P): Redefine, use cris_function_value_regno_p.
+       * config/cris/cris-protos.h (cris_function_value_regno_p): Declare.
+
 2009-10-19  Jakub Jelinek  <jakub@redhat.com>
 
        * unwind-dw2.c (execute_stack_op): Fix operand order for
index db6aa9fe9ce0a476a835daed2a092008f0219cf8..721c90ff887f78ee109277d405cfd2c67e25a14f 100644 (file)
@@ -71,3 +71,5 @@ extern void cris_override_options (void);
 extern int cris_initial_elimination_offset (int, int);
 
 extern void cris_init_expanders (void);
+
+extern bool cris_function_value_regno_p (const unsigned int);
index bf00a57a3b6aa1939f4275c8b6fa6beb86246724..225ad403dda7eb657188a5883f1c583217ec589b 100644 (file)
@@ -130,6 +130,9 @@ static bool cris_frame_pointer_required (void);
 static void cris_asm_trampoline_template (FILE *);
 static void cris_trampoline_init (rtx, tree, rtx);
 
+static rtx cris_function_value(const_tree, const_tree, bool);
+static rtx cris_libcall_value (enum machine_mode, const_rtx);
+
 /* This is the parsed result of the "-max-stack-stackframe=" option.  If
    it (still) is zero, then there was no such option given.  */
 int cris_max_stackframe = 0;
@@ -197,6 +200,11 @@ int cris_cpu_version = CRIS_DEFAULT_CPU_VERSION;
 #undef TARGET_TRAMPOLINE_INIT
 #define TARGET_TRAMPOLINE_INIT cris_trampoline_init
 
+#undef TARGET_FUNCTION_VALUE
+#define TARGET_FUNCTION_VALUE cris_function_value
+#undef TARGET_LIBCALL_VALUE
+#define TARGET_LIBCALL_VALUE cris_libcall_value
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 
 /* Helper for cris_load_multiple_op and cris_ret_movem_op.  */
@@ -3777,13 +3785,42 @@ cris_promote_function_mode (const_tree type ATTRIBUTE_UNUSED,
                             int for_return)
 {
   /* Defining PROMOTE_FUNCTION_RETURN in gcc-2.7.2 uncovered bug 981110 (even
-     when modifying FUNCTION_VALUE to return the promoted mode).  Maybe
-     pointless as of now, but let's keep the old behavior.  */
+     when modifying TARGET_FUNCTION_VALUE to return the promoted mode).
+     Maybe pointless as of now, but let's keep the old behavior.  */
   if (for_return == 1)
     return mode;
   return CRIS_PROMOTED_MODE (mode, *punsignedp, type);
 } 
 
+/* Let's assume all functions return in r[CRIS_FIRST_ARG_REG] for the
+   time being.  */
+
+static rtx
+cris_function_value(const_tree type,
+                   const_tree func ATTRIBUTE_UNUSED,
+                   bool outgoing ATTRIBUTE_UNUSED)
+{
+  return gen_rtx_REG (TYPE_MODE (type), CRIS_FIRST_ARG_REG);
+}
+
+/* Let's assume all functions return in r[CRIS_FIRST_ARG_REG] for the
+   time being.  */
+
+static rtx
+cris_libcall_value (enum machine_mode mode,
+                   const_rtx fun ATTRIBUTE_UNUSED)
+{
+  return gen_rtx_REG (mode, CRIS_FIRST_ARG_REG);
+}
+
+/* Let's assume all functions return in r[CRIS_FIRST_ARG_REG] for the
+   time being.  */
+
+bool
+cris_function_value_regno_p (const unsigned int regno)
+{
+  return (regno == CRIS_FIRST_ARG_REG);
+}
 
 static int
 cris_arg_partial_bytes (CUMULATIVE_ARGS *ca, enum machine_mode mode,
index 76ebcefbae76bd5b5e2d495e8c24f654cf015d9a..0fea7d77b39f48dbc3102b5cf4e21866e1fb07a7 100644 (file)
@@ -906,14 +906,8 @@ struct cum_args {int regs;};
 
 /* Node: Scalar Return */
 
-/* Let's assume all functions return in r[CRIS_FIRST_ARG_REG] for the
-   time being.  */
-#define FUNCTION_VALUE(VALTYPE, FUNC)  \
- gen_rtx_REG (TYPE_MODE (VALTYPE), CRIS_FIRST_ARG_REG)
+#define FUNCTION_VALUE_REGNO_P(N) cris_function_value_regno_p (N)
 
-#define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, CRIS_FIRST_ARG_REG)
-
-#define FUNCTION_VALUE_REGNO_P(N) ((N) == CRIS_FIRST_ARG_REG)
 
 
 /* Node: Aggregate Return */