From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16340 invoked by alias); 25 Oct 2009 12:12:38 -0000 Received: (qmail 16332 invoked by uid 22791); 25 Oct 2009 12:12:37 -0000 X-SWARE-Spam-Status: No, hits=4.4 required=5.0 tests=AWL,BAYES_40,KAM_STOCKGEN,KAM_THEBAT,SPF_PASS X-Spam-Check-By: sourceware.org Received: from contrabass.post.ru (HELO contrabass.post.ru) (85.21.78.5) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 25 Oct 2009 12:12:33 +0000 Received: from corbina.ru (mail.post.ru [195.14.50.16]) by contrabass.post.ru (Postfix) with ESMTP id BD18CAA333 for ; Sun, 25 Oct 2009 15:12:30 +0300 (MSK) Received: from [95.27.159.146] (account aesok@post.ru HELO Vista.corbina.ru) by corbina.ru (CommuniGate Pro SMTP 5.1.14) with ESMTPA id 80958279 for gcc-patches@gcc.gnu.org; Sun, 25 Oct 2009 15:12:30 +0300 Date: Sun, 25 Oct 2009 13:37:00 -0000 From: Anatoly Sokolov Message-ID: <1293480902.20091025151247@post.ru> To: gcc-patches Subject: [FRV] Remove FUNCTION_VALUE and LIBCALL_VALUE macros. MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1251 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2009-10/txt/msg01525.txt.bz2 Hello. This patch removes obsolete FUNCTION_VALUE and LIBCALL_VALUE macros from FRV back end in the GCC and introduces equivalent TARGET_FUNCTION_VALUE and TARGET_LIBCALL_VALUE target hooks. Also this patch convert FUNCTION_VALUE_REGNO_P macro to frv_function_value_regno_p function, this should simplify hookize FUNCTION_VALUE_REGNO_P macro in the future. Regression tested on frv-unknown-elf. * config/frv/frv.c (frv_function_value, frv_libcall_value, frv_function_value_regno_p): New functions. (TARGET_FUNCTION_VALUE, TARGET_LIBCALL_VALUE): Declare. * config/frv/frv.h: (FUNCTION_VALUE, LIBCALL_VALUE): Remove. (FUNCTION_VALUE_REGNO_P): Redefine, use frv_function_value_regno_p. * config/frv/frv-protos.h (frv_function_value_regno_p): Declare. OK to install? Index: gcc/config/frv/frv.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- gcc/config/frv/frv.h (revision 153538) +++ gcc/config/frv/frv.h (working copy) @@ -1746,49 +1746,8 @@ function call. */ #define RETURN_VALUE_REGNUM (GPR_FIRST + 8) =20 -/* A C expression to create an RTX representing the place where a function - returns a value of data type VALTYPE. VALTYPE is a tree node represent= ing a - data type. Write `TYPE_MODE (VALTYPE)' to get the machine mode used to - represent that type. On many machines, only the mode is relevant. - (Actually, on most machines, scalar values are returned in the same pla= ce - regardless of mode). +#define FUNCTION_VALUE_REGNO_P(REGNO) frv_function_value_regno_p (REGNO) =20 - If the precise function being called is known, FUNC is a tree node - (`FUNCTION_DECL') for it; otherwise, FUNC is a null pointer. This make= s it - possible to use a different value-returning convention for specific - functions when all their calls are known. - - `FUNCTION_VALUE' is not used for return vales with aggregate data types, - because these are returned in another way. See - `TARGET_STRUCT_VALUE_RTX' and related macros, below. */ -#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. - - Note that "library function" in this context means a compiler support - routine, used to perform arithmetic, whose name is known specially by t= he - 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 registe= r in - which the values of called function may come back. - - A register whose use for returning values is limited to serving as the - second of a pair (for a value of type `double', say) need not be recogn= ized - by this macro. So for most machines, this definition suffices: - - #define FUNCTION_VALUE_REGNO_P(N) ((N) =3D=3D RETURN) - - If the machine has register windows, so that the caller and the called - function use different registers for the return value, this macro should - recognize only the caller's register numbers. */ -#define FUNCTION_VALUE_REGNO_P(REGNO) ((REGNO) =3D=3D RETURN_VALUE_REGNUM) - =0C /* How Large Values are Returned. */ =20 Index: gcc/config/frv/frv-protos.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- gcc/config/frv/frv-protos.h (revision 153538) +++ gcc/config/frv/frv-protos.h (working copy) @@ -62,6 +62,7 @@ extern void frv_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode, tree, int); +extern bool frv_function_value_regno_p (const unsigned int); #endif /* TREE_CODE */ =20 extern int frv_expand_block_move (rtx *); Index: gcc/config/frv/frv.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- gcc/config/frv/frv.c (revision 153538) +++ gcc/config/frv/frv.c (working copy) @@ -273,6 +273,10 @@ static void frv_print_operand_memory_reference (FILE *, rtx, int); static int frv_print_operand_jump_hint (rtx); static const char *comparison_string (enum rtx_code, rtx); +static rtx frv_function_value (const_tree, const_tree, + bool); +static rtx frv_libcall_value (enum machine_mode, + const_rtx); static FRV_INLINE int frv_regno_ok_for_base_p (int, int); static rtx single_set_pattern (rtx); static int frv_function_contains_far_jump (void); @@ -483,6 +487,11 @@ #undef TARGET_TRAMPOLINE_INIT #define TARGET_TRAMPOLINE_INIT frv_trampoline_init =20 +#undef TARGET_FUNCTION_VALUE +#define TARGET_FUNCTION_VALUE frv_function_value +#undef TARGET_LIBCALL_VALUE +#define TARGET_LIBCALL_VALUE frv_libcall_value + struct gcc_target targetm =3D TARGET_INITIALIZER; =20 #define FRV_SYMBOL_REF_TLS_P(RTX) \ @@ -3291,6 +3300,35 @@ } =20 =0C +/* Implements TARGET_FUNCTION_VALUE. */ + +static rtx +frv_function_value (const_tree valtype, + const_tree fn_decl_or_type ATTRIBUTE_UNUSED, + bool outgoing ATTRIBUTE_UNUSED) +{ + return gen_rtx_REG (TYPE_MODE (valtype), RETURN_VALUE_REGNUM); +} + +=0C +/* Implements TARGET_LIBCALL_VALUE. */ + +static rtx +frv_libcall_value (enum machine_mode mode, + const_rtx fun ATTRIBUTE_UNUSED) +{ + return gen_rtx_REG (mode, RETURN_VALUE_REGNUM); +} + +=0C +/* Implements FUNCTION_VALUE_REGNO_P. */ + +bool +frv_function_value_regno_p (const unsigned int regno) +{ + return (regno =3D=3D RETURN_VALUE_REGNUM); +} +=0C /* Return true if a register is ok to use as a base or index register. */ =20 static FRV_INLINE int Anatoly.