From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 86051 invoked by alias); 9 Nov 2015 22:53:57 -0000 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 Received: (qmail 86041 invoked by uid 89); 9 Nov 2015 22:53:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.4 required=5.0 tests=AWL,BAYES_40,KAM_ASCII_DIVIDERS,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 X-HELO: smtp.eu.adacore.com Received: from mel.act-europe.fr (HELO smtp.eu.adacore.com) (194.98.77.210) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 09 Nov 2015 22:53:54 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id AFF993305750 for ; Mon, 9 Nov 2015 23:53:51 +0100 (CET) Received: from smtp.eu.adacore.com ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nAzUnSw768z5 for ; Mon, 9 Nov 2015 23:53:51 +0100 (CET) Received: from polaris.localnet (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id 83AD23305740 for ; Mon, 9 Nov 2015 23:53:51 +0100 (CET) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [visium] Turn a few macros into hooks Date: Mon, 09 Nov 2015 22:53:00 -0000 Message-ID: <3592919.YWOUbQlgx6@polaris> User-Agent: KMail/4.14.9 (Linux/3.16.7-29-desktop; KDE/4.14.9; x86_64; ; ) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart2822953.b4LUVo3hj4" Content-Transfer-Encoding: 7Bit X-SW-Source: 2015-11/txt/msg01128.txt.bz2 This is a multi-part message in MIME format. --nextPart2822953.b4LUVo3hj4 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Content-length: 759 On the heels of Julian's patch, this turns the 3 PRINT_OPERAND_* macros into hooks for the Visium port. Tested on visium-elf, applied on the mainline. 2015-11-09 Eric Botcazou * config/visium/visium.h (PRINT_OPERAND): Delete. (PRINT_OPERAND_PUNCT_VALID_P): Likewise. (PRINT_OPERAND_ADDRESS): Likewise. * config/visium/visium.c (TARGET_PRINT_OPERAND_PUNCT_VALID_P): Define to... (visium_print_operand_punct_valid_p): ...this. New function. (TARGET_PRINT_OPERAND): Define to... (print_operand): Rename to... (visium_print_operand): ...this. (TARGET_PRINT_OPERAND_ADDRESS): Define to... (visium_output_address): Rename to... (visium_print_operand_address): ...this. (print_operand_address): Delete. -- Eric Botcazou --nextPart2822953.b4LUVo3hj4 Content-Disposition: attachment; filename="p.diff" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="UTF-8"; name="p.diff" Content-length: 6435 Index: config/visium/visium.c =================================================================== --- config/visium/visium.c (revision 230016) +++ config/visium/visium.c (working copy) @@ -99,7 +99,6 @@ int visium_indent_opcode = 0; given how unlikely it is to have a long branch in a leaf function. */ static unsigned int long_branch_regnum = 31; -static void visium_output_address (FILE *, enum machine_mode, rtx); static tree visium_handle_interrupt_attr (tree *, tree, tree, int, bool *); static inline bool current_function_saves_fp (void); static inline bool current_function_saves_lr (void); @@ -157,6 +156,10 @@ static bool visium_legitimate_constant_p static bool visium_legitimate_address_p (enum machine_mode, rtx, bool); +static bool visium_print_operand_punct_valid_p (unsigned char); +static void visium_print_operand (FILE *, rtx, int); +static void visium_print_operand_address (FILE *, machine_mode, rtx); + static void visium_conditional_register_usage (void); static rtx visium_legitimize_address (rtx, rtx, enum machine_mode); @@ -227,6 +230,13 @@ static unsigned int visium_reorg (void); #undef TARGET_LEGITIMATE_ADDRESS_P #define TARGET_LEGITIMATE_ADDRESS_P visium_legitimate_address_p +#undef TARGET_PRINT_OPERAND_PUNCT_VALID_P +#define TARGET_PRINT_OPERAND_PUNCT_VALID_P visium_print_operand_punct_valid_p +#undef TARGET_PRINT_OPERAND +#define TARGET_PRINT_OPERAND visium_print_operand +#undef TARGET_PRINT_OPERAND_ADDRESS +#define TARGET_PRINT_OPERAND_ADDRESS visium_print_operand_address + #undef TARGET_ATTRIBUTE_TABLE #define TARGET_ATTRIBUTE_TABLE visium_attribute_table @@ -3038,12 +3048,19 @@ output_cbranch (rtx label, enum rtx_code return output_branch (label, cond, insn); } -/* Helper function for PRINT_OPERAND (STREAM, X, CODE). Output to stdio - stream FILE the assembler syntax for an instruction operand OP subject - to the modifier LETTER. */ +/* Implement TARGET_PRINT_OPERAND_PUNCT_VALID_P. */ -void -print_operand (FILE *file, rtx op, int letter) +static bool +visium_print_operand_punct_valid_p (unsigned char code) +{ + return code == '#'; +} + +/* Implement TARGET_PRINT_OPERAND. Output to stdio stream FILE the assembler + syntax for an instruction operand OP subject to the modifier LETTER. */ + +static void +visium_print_operand (FILE *file, rtx op, int letter) { switch (letter) { @@ -3104,7 +3121,7 @@ print_operand (FILE *file, rtx op, int l break; case MEM: - visium_output_address (file, GET_MODE (op), XEXP (op, 0)); + visium_print_operand_address (file, GET_MODE (op), XEXP (op, 0)); break; case CONST_INT: @@ -3116,7 +3133,7 @@ print_operand (FILE *file, rtx op, int l break; case HIGH: - print_operand (file, XEXP (op, 1), letter); + visium_print_operand (file, XEXP (op, 1), letter); break; default: @@ -3124,11 +3141,12 @@ print_operand (FILE *file, rtx op, int l } } -/* Output to stdio stream FILE the assembler syntax for an instruction operand - that is a memory reference in MODE and whose address is ADDR. */ +/* Implement TARGET_PRINT_OPERAND_ADDRESS. Output to stdio stream FILE the + assembler syntax for an instruction operand that is a memory reference + whose address is ADDR. */ static void -visium_output_address (FILE *file, enum machine_mode mode, rtx addr) +visium_print_operand_address (FILE *file, enum machine_mode mode, rtx addr) { switch (GET_CODE (addr)) { @@ -3205,16 +3223,6 @@ visium_output_address (FILE *file, enum } } -/* Helper function for PRINT_OPERAND_ADDRESS (STREAM, X). Output to stdio - stream FILE the assembler syntax for an instruction operand that is a - memory reference whose address is ADDR. */ - -void -print_operand_address (FILE *file, rtx addr) -{ - visium_output_address (file, QImode, addr); -} - /* The Visium stack frames look like: Before call After call Index: config/visium/visium.h =================================================================== --- config/visium/visium.h (revision 230016) +++ config/visium/visium.h (working copy) @@ -1477,49 +1477,6 @@ do \ #define ADDITIONAL_REGISTER_NAMES \ {{"r22", HARD_FRAME_POINTER_REGNUM}, {"r23", STACK_POINTER_REGNUM}} -/* `PRINT_OPERAND (STREAM, X, CODE)' - - A C compound statement to output to stdio stream STREAM the - assembler syntax for an instruction operand X. X is an RTL - expression. - - CODE is a value that can be used to specify one of several ways of - printing the operand. It is used when identical operands must be - printed differently depending on the context. CODE comes from the - `%' specification that was used to request printing of the operand. - If the specification was just `%DIGIT' then CODE is 0; if the - specification was `%LTR DIGIT' then CODE is the ASCII code for LTR. - - If X is a register, this macro should print the register's name. - The names can be found in an array `reg_names' whose type is `char - *[]'. `reg_names' is initialized from `REGISTER_NAMES'. - - When the machine description has a specification `%PUNCT' (a `%' - followed by a punctuation character), this macro is called with a - null pointer for X and the punctuation character for CODE. */ -#define PRINT_OPERAND(STREAM, X, CODE) print_operand (STREAM, X, CODE) - -/* `PRINT_OPERAND_PUNCT_VALID_P (CODE)' - - A C expression which evaluates to true if CODE is a valid - punctuation character for use in the `PRINT_OPERAND' macro. If - `PRINT_OPERAND_PUNCT_VALID_P' is not defined, it means that no - punctuation characters (except for the standard one, `%') are used */ -#define PRINT_OPERAND_PUNCT_VALID_P(CODE) ((CODE) == '#') - -/* `PRINT_OPERAND_ADDRESS (STREAM, X)' - - A C compound statement to output to stdio stream STREAM the - assembler syntax for an instruction operand that is a memory - reference whose address is X. X is an RTL expression. - - On some machines, the syntax for a symbolic address depends on the - section that the address refers to. On these machines, define the - macro `ENCODE_SECTION_INFO' to store the information into the - `symbol_ref', and then check for it here. */ -#define PRINT_OPERAND_ADDRESS(STREAM, ADDR) \ - print_operand_address (STREAM, ADDR) - /* `REGISTER_PREFIX' `LOCAL_LABEL_PREFIX' `USER_LABEL_PREFIX' --nextPart2822953.b4LUVo3hj4--