* [FR30] Hookize FUNCTION_VALUE, LIBCALL_VALUE and FUNCTION_VALUE_REGNO_P
@ 2010-11-05 20:26 Anatoly Sokolov
2010-11-05 23:01 ` Richard Henderson
2010-11-08 10:46 ` Nick Clifton
0 siblings, 2 replies; 3+ messages in thread
From: Anatoly Sokolov @ 2010-11-05 20:26 UTC (permalink / raw)
To: gcc-patches; +Cc: nickc
Hello.
This patch removes obsolete FUNCTION_VALUE, LIBCALL_VALUE and
FUNCTION_VALUE_REGNO_P macros from FR30 back end in the GCC and introduces
equivalent TARGET_FUNCTION_VALUE, TARGET_LIBCALL_VALUE and
TARGET_FUNCTION_VALUE_REGNO_P target hooks.
Regression tested on fr30-unknown-elf with no new failure.
=== gcc Summary ===
# of expected passes 49499
# of unexpected failures 13084
# of unexpected successes 1
# of expected failures 105
# of unresolved testcases 2960
# of unsupported tests 1064
OK to install?
* config/fr30/fr30.h (FUNCTION_VALUE_REGNO_P, FUNCTION_VALUE,
LIBCALL_VALUE): Remove macros.
* config/fr30/fr30.c (TARGET_FUNCTION_VALUE, TARGET_LIBCALL_VALUE,
TARGET_FUNCTION_VALUE_REGNO_P): Define.
(fr30_function_value_regno_p, fr30_function_value,
fr30_libcall_value): New functions
Index: gcc/config/fr30/fr30.h
===================================================================
--- gcc/config/fr30/fr30.h (revision 166360)
+++ gcc/config/fr30/fr30.h (working copy)
@@ -588,31 +588,6 @@
((REGNO) >= FIRST_ARG_REGNUM && ((REGNO) < FIRST_ARG_REGNUM + FR30_NUM_ARG_REGS))
/*}}}*/ \f
-/*{{{ How Scalar Function Values are Returned. */
-
-#define FUNCTION_VALUE(VALTYPE, FUNC) \
- gen_rtx_REG (TYPE_MODE (VALTYPE), RETURN_VALUE_REGNUM)
-
-/* A C expression to create an RTX representing the place where a library
- function returns a value of mode MODE. If the precise function being called
- is known, FUNC is a tree node (`FUNCTION_DECL') for it; otherwise, FUNC is a
- null pointer. This makes it possible to use a different value-returning
- convention for specific functions when all their calls are known.
-
- Note that "library function" in this context means a compiler support
- routine, used to perform arithmetic, whose name is known specially by the
- compiler and was not mentioned in the C code being compiled.
-
- The definition of `LIBRARY_VALUE' need not be concerned aggregate data
- types, because none of the library functions returns such types. */
-#define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, RETURN_VALUE_REGNUM)
-
-/* A C expression that is nonzero if REGNO is the number of a hard register in
- which the values of called function may come back. */
-
-#define FUNCTION_VALUE_REGNO_P(REGNO) ((REGNO) == RETURN_VALUE_REGNUM)
-
-/*}}}*/ \f
/*{{{ How Large Values are Returned. */
/* Define this macro to be 1 if all structure and union return values must be
Index: gcc/config/fr30/fr30.c
===================================================================
--- gcc/config/fr30/fr30.c (revision 166360)
+++ gcc/config/fr30/fr30.c (working copy)
@@ -124,6 +125,9 @@
static void fr30_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode,
const_tree, bool);
static bool fr30_frame_pointer_required (void);
+static rtx fr30_function_value (const_tree, const_tree, bool);
+static rtx fr30_libcall_value (enum machine_mode, const_rtx);
+static bool fr30_function_value_regno_p (const unsigned int);
static bool fr30_can_eliminate (const int, const int);
static void fr30_asm_trampoline_template (FILE *);
static void fr30_trampoline_init (rtx, tree, rtx);
@@ -172,6 +176,13 @@
#undef TARGET_FUNCTION_ARG_ADVANCE
#define TARGET_FUNCTION_ARG_ADVANCE fr30_function_arg_advance
+#undef TARGET_FUNCTION_VALUE
+#define TARGET_FUNCTION_VALUE fr30_function_value
+#undef TARGET_LIBCALL_VALUE
+#define TARGET_LIBCALL_VALUE fr30_libcall_value
+#undef TARGET_FUNCTION_VALUE_REGNO_P
+#define TARGET_FUNCTION_VALUE_REGNO_P fr30_function_value_regno_p
+
#undef TARGET_SETUP_INCOMING_VARARGS
#define TARGET_SETUP_INCOMING_VARARGS fr30_setup_incoming_varargs
#undef TARGET_MUST_PASS_IN_STACK
@@ -703,6 +714,34 @@
}
/*}}}*/
+
+/* Implements TARGET_FUNCTION_VALUE. */
+
+static rtx
+fr30_function_value (const_tree valtype,
+ const_tree fntype_or_decli ATTRIBUTE_UNUSED,
+ bool outgoing ATTRIBUTE_UNUSED)
+{
+ return gen_rtx_REG (TYPE_MODE (valtype), RETURN_VALUE_REGNUM);
+}
+
+/* Implements TARGET_LIBCALL_VALUE. */
+
+static rtx
+fr30_libcall_value (enum machine_mode mode,
+ const_rtx fun ATTRIBUTE_UNUSED)
+{
+ return gen_rtx_REG (mode, RETURN_VALUE_REGNUM);
+}
+
+/* Implements TARGET_FUNCTION_VALUE_REGNO_P. */
+
+static bool
+fr30_function_value_regno_p (const unsigned int regno)
+{
+ return (regno == RETURN_VALUE_REGNUM);
+}
+
/*{{{ Function arguments */
/* Return true if we should pass an argument on the stack rather than
Anatoly.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [FR30] Hookize FUNCTION_VALUE, LIBCALL_VALUE and FUNCTION_VALUE_REGNO_P
2010-11-05 20:26 [FR30] Hookize FUNCTION_VALUE, LIBCALL_VALUE and FUNCTION_VALUE_REGNO_P Anatoly Sokolov
@ 2010-11-05 23:01 ` Richard Henderson
2010-11-08 10:46 ` Nick Clifton
1 sibling, 0 replies; 3+ messages in thread
From: Richard Henderson @ 2010-11-05 23:01 UTC (permalink / raw)
To: Anatoly Sokolov; +Cc: gcc-patches, nickc
On 11/05/2010 01:23 PM, Anatoly Sokolov wrote:
> * config/fr30/fr30.h (FUNCTION_VALUE_REGNO_P, FUNCTION_VALUE,
> LIBCALL_VALUE): Remove macros.
> * config/fr30/fr30.c (TARGET_FUNCTION_VALUE, TARGET_LIBCALL_VALUE,
> TARGET_FUNCTION_VALUE_REGNO_P): Define.
> (fr30_function_value_regno_p, fr30_function_value,
> fr30_libcall_value): New functions
Ok.
r~
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [FR30] Hookize FUNCTION_VALUE, LIBCALL_VALUE and FUNCTION_VALUE_REGNO_P
2010-11-05 20:26 [FR30] Hookize FUNCTION_VALUE, LIBCALL_VALUE and FUNCTION_VALUE_REGNO_P Anatoly Sokolov
2010-11-05 23:01 ` Richard Henderson
@ 2010-11-08 10:46 ` Nick Clifton
1 sibling, 0 replies; 3+ messages in thread
From: Nick Clifton @ 2010-11-08 10:46 UTC (permalink / raw)
To: Anatoly Sokolov; +Cc: gcc-patches
Hi Anatoly,
> * config/fr30/fr30.h (FUNCTION_VALUE_REGNO_P, FUNCTION_VALUE,
> LIBCALL_VALUE): Remove macros.
> * config/fr30/fr30.c (TARGET_FUNCTION_VALUE, TARGET_LIBCALL_VALUE,
> TARGET_FUNCTION_VALUE_REGNO_P): Define.
> (fr30_function_value_regno_p, fr30_function_value,
> fr30_libcall_value): New functions
Approved - please apply.
Cheers
Nick
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-11-08 10:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-05 20:26 [FR30] Hookize FUNCTION_VALUE, LIBCALL_VALUE and FUNCTION_VALUE_REGNO_P Anatoly Sokolov
2010-11-05 23:01 ` Richard Henderson
2010-11-08 10:46 ` Nick Clifton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).