]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[V850] Hookize LIBCALL_VALUE
authorAnatoly Sokolov <aesok@post.ru>
Thu, 30 Jul 2015 21:36:18 +0000 (00:36 +0300)
committerAnatoly Sokolov <aesok@gcc.gnu.org>
Thu, 30 Jul 2015 21:36:18 +0000 (00:36 +0300)
From-SVN: r226418

gcc/ChangeLog
gcc/config/v850/v850.c
gcc/config/v850/v850.h
gcc/config/v850/v850.md

index 1eca23df1e8b2c0ef2eada06f240d5ad73e5028c..4985050a743e7a4e2cc5842b49046d75e0a901b8 100644 (file)
@@ -1,3 +1,11 @@
+2015-07-30  Anatoly Sokolov  <aesok@post.ru>
+
+       * config/v850/v850.h (LIBCALL_VALUE): Remove macros.
+       * config/v850/v850.md (RV_REGNUM): New constants.
+       * config/v850/v850.c (v850_libcall_value): New functions.
+       (v850_function_value_regno_p, v850_function_value): Use RV_REGNUM.
+       (TARGET_LIBCALL_VALUE): Define.
+
 2015-07-30  Anatoly Sokolov  <aesok@post.ru>
 
        * rtl.h (lowpart_subreg): Move in file.
index 2474e756d47889586b55102d1b75197e8f5b30da..a03f5e2fc9d563173d3c490cfce474c49825f366 100644 (file)
@@ -2979,7 +2979,7 @@ v850_select_section (tree exp,
 static bool
 v850_function_value_regno_p (const unsigned int regno)
 {
-  return (regno == 10);
+  return (regno == RV_REGNUM);
 }
 
 /* Worker function for TARGET_RETURN_IN_MEMORY.  */
@@ -3002,7 +3002,16 @@ v850_function_value (const_tree valtype,
                     const_tree fn_decl_or_type ATTRIBUTE_UNUSED,
                     bool outgoing ATTRIBUTE_UNUSED)
 {
-  return gen_rtx_REG (TYPE_MODE (valtype), 10);
+  return gen_rtx_REG (TYPE_MODE (valtype), RV_REGNUM);
+}
+
+/* Implement TARGET_LIBCALL_VALUE.  */
+
+static rtx
+v850_libcall_value (machine_mode mode,
+                   const_rtx func ATTRIBUTE_UNUSED)
+{
+  return gen_rtx_REG (mode, RV_REGNUM);
 }
 
 \f
@@ -3304,6 +3313,8 @@ v850_gen_movdi (rtx * operands)
 #define TARGET_FUNCTION_VALUE_REGNO_P v850_function_value_regno_p
 #undef  TARGET_FUNCTION_VALUE
 #define TARGET_FUNCTION_VALUE v850_function_value
+#undef  TARGET_LIBCALL_VALUE
+#define TARGET_LIBCALL_VALUE v850_libcall_value
 
 #undef  TARGET_PROMOTE_PROTOTYPES
 #define TARGET_PROMOTE_PROTOTYPES hook_bool_const_tree_true
index dcc169bcdfdd099e2b416ca8e1dd72d0a9b8e6c0..7b65187de7942235ef0e82bfd1d59c015e57ae3e 100644 (file)
@@ -549,12 +549,6 @@ struct cum_arg { int nbytes; };
 
 #define FUNCTION_ARG_REGNO_P(N) (N >= 6 && N <= 9)
 
-/* Define how to find the value returned by a library function
-   assuming the value has mode MODE.  */
-
-#define LIBCALL_VALUE(MODE) \
-  gen_rtx_REG (MODE, 10)
-
 #define DEFAULT_PCC_STRUCT_RETURN 0
 
 /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
index 7f2c5bb1bfbc641701bbc3ccdcd79a20333420be..5d7bd5ff2af91b724097d904ed19bdfd580abeee 100644 (file)
@@ -39,6 +39,7 @@
   [(ZERO_REGNUM                0)          ; constant zero
    (SP_REGNUM                  3)          ; Stack Pointer
    (GP_REGNUM                  4)          ; GP Pointer
+   (RV_REGNUM                  10)         ; Return value register
    (EP_REGNUM                  30)         ; EP pointer
    (LP_REGNUM                  31)         ; Return address register
    (CC_REGNUM                  32)         ; Condition code pseudo register