diff options
author | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-05-01 14:45:24 +0000 |
---|---|---|
committer | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-05-01 14:45:24 +0000 |
commit | c7944dcedf702fbf1a8a802158732a46b5d72830 (patch) | |
tree | 4e8ab9b9d983a212b8aa35ed9a63c7bffb107ef5 /gcc/lower-subreg.h | |
parent | e7fd8dfafd84cfd4c885a178508ade470abac0e6 (diff) | |
download | gcc-c7944dcedf702fbf1a8a802158732a46b5d72830.tar.gz |
gcc/
2012-03-31 Kenneth Zadeck <zadeck@naturalbridge.com>
Richard Sandiford <r.sandiford@uk.ibm.com>
* Makefile.in (lower-subreg.o, target-globals.o): Depend on
lower-subreg.h.
* lower-subreg.h: New file.
* target-globals.h (this_target_lower_subreg): Declare.
(target_globals): Add lower_subreg;
(restore_target_globals): Restore this_target_lower_subreg.
* target-globals.c: Include it.
(default_target_globals): Add default_target_lower_subreg.
(save_target_globals): Initialize target_lower_subreg.
* rtl.h (init_lower_subreg): Added declaration.
* toplev.c (backend_init_target): Call initializer for lower-subreg
pass.
* lower-subreg.c (LOG_COSTS, FORCE_LOWERING): New macros.
(default_target_lower_subreg): New variable.
(this_target_lower_subreg): Likewise.
(twice_word_mode, choices): New macros.
(shift_cost, compute_splitting_shift, compute_costs)
(init_lower_subreg): New functions.
(resolve_simple_move): Add speed_p argument. Check choices.
(find_pseudo_copy): Don't check the mode size here.
(resolve_simple_move): Assert the mode size.
(find_decomposable_shift_zext): Add speed_p argument and return
a bool. Check choices.
(resolve_shift_zext): Add comment.
(dump_shift_choices, dump_choices): New functions.
(decompose_multiword_subregs): Dump list of profitable
transformations. Add code to skip non profitable transformations.
Update calls to simple_move and find_decomposable_shift_zext.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187015 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lower-subreg.h')
-rw-r--r-- | gcc/lower-subreg.h | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/gcc/lower-subreg.h b/gcc/lower-subreg.h new file mode 100644 index 00000000000..5c960dbfd09 --- /dev/null +++ b/gcc/lower-subreg.h @@ -0,0 +1,59 @@ +/* Target-dependent costs for lower-subreg.c. + Copyright (C) 2012 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 3, or (at your option; any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +<http://www.gnu.org/licenses/>. */ + +#ifndef LOWER_SUBREG_H +#define LOWER_SUBREG_H 1 + +/* Information about whether, and where, lower-subreg should be applied. */ +struct lower_subreg_choices { + /* A boolean vector for move splitting that is indexed by mode and is + true for each mode that is to have its copies split. */ + bool move_modes_to_split[MAX_MACHINE_MODE]; + + /* True if zero-extensions from word_mode to twice_word_mode should + be split. */ + bool splitting_zext; + + /* Index X is true if twice_word_mode shifts by X + BITS_PER_WORD + should be split. */ + bool splitting_ashift[MAX_BITS_PER_WORD]; + bool splitting_lshiftrt[MAX_BITS_PER_WORD]; + + /* True if there is at least one mode that is worth splitting. */ + bool something_to_do; +}; + +/* Target-specific information for the subreg lowering pass. */ +struct target_lower_subreg { + /* An integer mode that is twice as wide as word_mode. */ + enum machine_mode x_twice_word_mode; + + /* What we have decided to do when optimizing for size (index 0) + and speed (index 1). */ + struct lower_subreg_choices x_choices[2]; +}; + +extern struct target_lower_subreg default_target_lower_subreg; +#if SWITCHABLE_TARGET +extern struct target_lower_subreg *this_target_lower_subreg; +#else +#define this_target_lower_subreg (&default_target_lower_subreg) +#endif + +#endif |