[BFIN] PR target/49862
Hi, I have committed this patch on trunk for PR target/49862. Regards, Jie PR target/49862 * config/bfin/bfin.c (hwloop_optimize): Fix unused variable warnings. (hwloop_pattern_reg): Fix set but not used warning. (bfin_reorg_loops): Remove unused parameter. (bfin_reorg): Update use of bfin_reorg_loops. Index: config/bfin/bfin.c === --- config/bfin/bfin.c (revision 185124) +++ config/bfin/bfin.c (working copy) @@ -3411,14 +3411,12 @@ static bool hwloop_optimize (hwloop_info loop) { basic_block bb; - hwloop_info inner; rtx insn, last_insn; rtx loop_init, start_label, end_label; rtx iter_reg, scratchreg, scratch_init, scratch_init_insn; rtx lc_reg, lt_reg, lb_reg; rtx seq, seq_end; int length; - unsigned ix; bool clobber0, clobber1; if (loop-depth MAX_LOOP_DEPTH) @@ -3840,12 +3838,11 @@ hwloop_fail (hwloop_info loop) static rtx hwloop_pattern_reg (rtx insn) { - rtx pat, reg; + rtx reg; if (!JUMP_P (insn) || recog_memoized (insn) != CODE_FOR_loop_end) return NULL_RTX; - pat = PATTERN (insn); reg = SET_DEST (XVECEXP (PATTERN (insn), 0, 1)); if (!REG_P (reg)) return NULL_RTX; @@ -3864,7 +3861,7 @@ static struct hw_doloop_hooks bfin_doloo hardware loops are generated. */ static void -bfin_reorg_loops (FILE *dump_file) +bfin_reorg_loops (void) { reorg_loops (true, bfin_doloop_hooks); } @@ -4601,7 +4598,7 @@ bfin_reorg (void) /* Doloop optimization */ if (cfun-machine-has_hardware_loops) -bfin_reorg_loops (dump_file); +bfin_reorg_loops (); workaround_speculation ();
Re: [BFIN] Hookize PREFERRED_RELOAD_CLASS
On 01/06/2012 12:07 PM, Anatoly Sokolov wrote: Hi, Jie. On Jan 6, 2012, Jie Zhangjzhang...@gmail.com wrote: Hi Anatoly, The patch looks OK. But I cannot apply your patch by saving your email as a patch file. If you take a look at this: I attach the patch. I can apply the attached patch. OK. Thank you. Jie
Re: [BFIN] Hookize PREFERRED_RELOAD_CLASS
Hi Anatoly, The patch looks OK. But I cannot apply your patch by saving your email as a patch file. If you take a look at this: http://gcc.gnu.org/cgi-bin/get-raw-msg?listname=gcc-patchesdate=2012-01msgid=4F05F12F.607%40post.ru you will find that there is a extra white space before each context line. But these extra white spaces do not show up in http://gcc.gnu.org/ml/gcc-patches/2012-01/msg00262.html while the starting white space of the last line of the patch is missing. Regards, Jie On Thu, Jan 5, 2012 at 1:51 PM, Anatoly Sokolov ae...@post.ru wrote: Hi. This patch removes obsolete PREFERRED_RELOAD_CLASS macro from the BFIN back end in the GCC and introduces equivalent TARGET_PREFERRED_RELOAD_CLASS target hook. Compiled. Untested. OK to install? * config/bfin/bfin.h (PREFERRED_RELOAD_CLASS): Remove. * config/bfin/bfin.c (TARGET_PREFERRED_RELOAD_CLASS): Define. (bfin_preferred_reload_class): New function. Index: gcc/config/bfin/bfin.c === --- gcc/config/bfin/bfin.c (revision 182912) +++ gcc/config/bfin/bfin.c (working copy) @@ -2648,6 +2648,19 @@ split_load_immediate (rtx operands[]) return 0; } +/* Worker function for TARGET_PREFERRED_RELOAD_CLASS. */ + +static reg_class_t +bfin_preferred_reload_class (rtx x, reg_class_t rclass) +{ + if (GET_CODE (x) == POST_INC + || GET_CODE (x) == POST_DEC + || GET_CODE (x) == PRE_DEC) + return PREGS; + + return rclass; +} + /* Return true if the legitimate memory address for a memory operand of mode MODE. Return false if not. */ @@ -5771,6 +5784,9 @@ bfin_conditional_register_usage (void) #undef TARGET_RETURN_IN_MEMORY #define TARGET_RETURN_IN_MEMORY bfin_return_in_memory +#undef TARGET_PREFERRED_RELOAD_CLASS +#define TARGET_PREFERRED_RELOAD_CLASS bfin_preferred_reload_class + #undef TARGET_LEGITIMATE_ADDRESS_P #define TARGET_LEGITIMATE_ADDRESS_P bfin_legitimate_address_p Index: gcc/config/bfin/bfin.h === --- gcc/config/bfin/bfin.h (revision 182912) +++ gcc/config/bfin/bfin.h (working copy) @@ -707,16 +707,6 @@ enum reg_class GET_MODE_SIZE (MODE1) = UNITS_PER_WORD \ GET_MODE_SIZE (MODE2) = UNITS_PER_WORD)) -/* `PREFERRED_RELOAD_CLASS (X, CLASS)' - A C expression that places additional restrictions on the register - class to use when it is necessary to copy value X into a register - in class CLASS. The value is a register class; perhaps CLASS, or - perhaps another, smaller class. */ -#define PREFERRED_RELOAD_CLASS(X, CLASS) \ - (GET_CODE (X) == POST_INC \ - || GET_CODE (X) == POST_DEC \ - || GET_CODE (X) == PRE_DEC ? PREGS : (CLASS)) - /* Function Calling Conventions. */ /* The type of the current function; normal functions are of type -- Anatoly.
Re: [BFIN] Hookize REGISTER_MOVE_COST and MEMORY_MOVE_COST
Hi Anatoly, I cannot apply your patch to a lean tree. I tried to save your email as a text file, copy from thunderbird, copy from gmail, copy from the mailing list archive. But neither works. Regards, Jie 2011/12/23 Anatoly Sokolov ae...@post.ru: Hi. This patch removes obsolete REGISTER_MOVE_COST and MEMORY_MOVE_COST macros from the Blackfin back end in the GCC and introduces equivalent TARGET_REGISTER_MOVE_COST and TARGET_MEMORY_MOVE_COST target hooks. Untested. OK to install? * config/bfin/bfin.h (REGISTER_MOVE_COST, MEMORY_MOVE_COST): Remove. * config/bfin/bfin-protos.h (bfin_register_move_cost, bfin_memory_move_cost): Remove. * config/bfin/bfin.c (bfin_register_move_cost, bfin_memory_move_cost): Make static. Change arguments type from enum reg_class to reg_class_t and from int to bool. (TARGET_REGISTER_MOVE_COST, TARGET_MEMORY_MOVE_COST): Define. Index: gcc/config/bfin/bfin-protos.h === --- gcc/config/bfin/bfin-protos.h (revision 182658) +++ gcc/config/bfin/bfin-protos.h (working copy) @@ -85,9 +85,6 @@ extern bool bfin_longcall_p (rtx, int); extern bool bfin_dsp_memref_p (rtx); extern bool bfin_expand_movmem (rtx, rtx, rtx, rtx); -extern int bfin_register_move_cost (enum machine_mode, enum reg_class, - enum reg_class); -extern int bfin_memory_move_cost (enum machine_mode, enum reg_class, int in); extern enum reg_class secondary_input_reload_class (enum reg_class, enum machine_mode, rtx); Index: gcc/config/bfin/bfin.c === --- gcc/config/bfin/bfin.c (revision 182658) +++ gcc/config/bfin/bfin.c (working copy) @@ -2149,12 +2149,11 @@ bfin_vector_mode_supported_p (enum machi return mode == V2HImode; } -/* Return the cost of moving data from a register in class CLASS1 to - one in class CLASS2. A cost of 2 is the default. */ +/* Worker function for TARGET_REGISTER_MOVE_COST. */ -int +static int bfin_register_move_cost (enum machine_mode mode, - enum reg_class class1, enum reg_class class2) + reg_class_t class1, reg_class_t class2) { /* These need secondary reloads, so they're more expensive. */ if ((class1 == CCREGS !reg_class_subset_p (class2, DREGS)) @@ -2177,18 +2176,16 @@ bfin_register_move_cost (enum machine_mo return 2; } -/* Return the cost of moving data of mode M between a - register and memory. A value of 2 is the default; this cost is - relative to those in `REGISTER_MOVE_COST'. +/* Worker function for TARGET_MEMORY_MOVE_COST. ??? In theory L1 memory has single-cycle latency. We should add a switch that tells the compiler whether we expect to use only L1 memory for the program; it'll make the costs more accurate. */ -int +static int bfin_memory_move_cost (enum machine_mode mode ATTRIBUTE_UNUSED, - enum reg_class rclass, - int in ATTRIBUTE_UNUSED) + reg_class_t rclass, + bool in ATTRIBUTE_UNUSED) { /* Make memory accesses slightly more expensive than any register-register move. Also, penalize non-DP registers, since they need secondary @@ -5703,6 +5700,12 @@ bfin_conditional_register_usage (void) #undef TARGET_ADDRESS_COST #define TARGET_ADDRESS_COST bfin_address_cost +#undef TARGET_REGISTER_MOVE_COST +#define TARGET_REGISTER_MOVE_COST bfin_register_move_cost + +#undef TARGET_MEMORY_MOVE_COST +#define TARGET_MEMORY_MOVE_COST bfin_memory_move_cost + #undef TARGET_ASM_INTEGER #define TARGET_ASM_INTEGER bfin_assemble_integer Index: gcc/config/bfin/bfin.h === --- gcc/config/bfin/bfin.h (revision 182658) +++ gcc/config/bfin/bfin.h (working copy) @@ -975,29 +975,6 @@ typedef struct { /* Do not put function addr into constant pool */ #define NO_FUNCTION_CSE 1 -/* A C expression for the cost of moving data from a register in class FROM to - one in class TO. The classes are expressed using the enumeration values - such as `GENERAL_REGS'. A value of 2 is the default; other values are - interpreted relative to that. - - It is not required that the cost always equal 2 when FROM is the same as TO; - on some machines it is expensive to move between registers if they are not - general registers. */ - -#define REGISTER_MOVE_COST(MODE, CLASS1, CLASS2) \ - bfin_register_move_cost ((MODE), (CLASS1), (CLASS2)) - -/* A C expression for the cost of moving data of mode M between a - register and memory. A value of 2 is the default; this cost is - relative to those in `REGISTER_MOVE_COST'. - -
Re: [RFC] Cleanup DW_CFA_GNU_args_size handling
Hi, On Tue, Aug 2, 2011 at 6:32 PM, Richard Henderson r...@redhat.com wrote: I got Jeff Law to review the reload change on IRC and committed the composite patch. Tested on x86_64, i586, avr, and h8300. Most other tier1 targets ought not be affected, as this patch only applies to ACCUMULATE_OUTGOING_ARGS == 0 targets. This commit may have caused http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51552 Regards, Jie
Update my email address
Hi, I have committed this patch to update my email address. Jie 2011-04-21 Jie Zhang jzhang...@gmail.com * MAINTAINERS: Update my email address. Index: MAINTAINERS === --- MAINTAINERS (revision 172853) +++ MAINTAINERS (working copy) @@ -49,7 +49,7 @@ avr port Anatoly Sokolov ae...@post.ru avr port Eric Weddington eric.wedding...@atmel.com bfin port Bernd Schmidt ber...@codesourcery.com -bfin port Jie Zhang j...@codesourcery.com +bfin port Jie Zhang jzhang...@gmail.com cris port Hans-Peter Nilsson h...@axis.com fr30 port Nick Clifton ni...@redhat.com frv port Nick Clifton ni...@redhat.com
Re: [PATCH] use build_function_type_list in the bfin backend
On 04/20/2011 03:24 PM, Nathan Froyd wrote: As $SUBJECT suggests. Tested with cross to bfin-elf. OK to commit? OK. Thanks! Jie -Nathan * config/bfin/bfin.c (bfin_init_builtins): Call build_function_type_list instead of build_function_type. diff --git a/gcc/config/bfin/bfin.c b/gcc/config/bfin/bfin.c index 5d08437..03a833d 100644 --- a/gcc/config/bfin/bfin.c +++ b/gcc/config/bfin/bfin.c @@ -5967,7 +5967,7 @@ bfin_init_builtins (void) { tree V2HI_type_node = build_vector_type_for_mode (intHI_type_node, V2HImode); tree void_ftype_void -= build_function_type (void_type_node, void_list_node); += build_function_type_list (void_type_node, NULL_TREE); tree short_ftype_short = build_function_type_list (short_integer_type_node, short_integer_type_node, NULL_TREE);
Re: [ARM] [3/3] Implement TARGET_BUILTIN_DECL
Thank you for review, update and commit this patch set! Jie On 04/18/2011 10:04 AM, Richard Earnshaw wrote: On Mon, 2010-10-11 at 15:44 +0800, Jie Zhang wrote: This patch implements TARGET_BUILTIN_DECL for ARM. With the changes of the previous two patches, this one is straightforward. Is it OK? Sorry for the long time reviewing this set of patches. I've just tweaked it to bring it up to the current code base and committed it. It's largely unchanged from your submission apart from: 1) Updates to incorporate latest changes made by Richard Sandiford. 2) Minor tweak to simplyfy the iWMMXT builtins initialization. R. 2011-04-18 Jie Zhangj...@codesourcery.com Richard Earnshawrearn...@arm.com * arm.c (neon_builtin_type_bits): Remove. (typedef enum neon_builtin_mode): New. (T_MAX): Don't define. (typedef enum neon_builtin_datum): Remove bits, codes[], num_vars and base_fcode. Add mode, code and fcode. (VAR1, VAR2, VAR3, VAR4, VAR5, VAR6, VAR7, VAR8, VAR9 VAR10): Change accordingly. (neon_builtin_data[]): Change accordingly (arm_init_neon_builtins): Change accordingly. (neon_builtin_compare): Remove. (locate_neon_builtin_icode): Remove. (arm_expand_neon_builtin): Change accordingly. * arm.h (enum arm_builtins): Move to ... * arm.c (enum arm_builtins): ... here; and rearrange builtin code. * arm.c (arm_builtin_decl): Declare. (TARGET_BUILTIN_DECL): Define. (enum arm_builtins): Correct ARM_BUILTIN_MAX. (arm_builtin_decls[]): New. (arm_init_neon_builtins): Store builtin declarations in arm_builtin_decls[]. (arm_init_tls_builtins): Likewise. (arm_init_iwmmxt_builtins): Likewise. Refactor initialization code. (arm_builtin_decl): New.