aboutsummaryrefslogtreecommitdiff
path: root/gcc/genconfig.c
diff options
context:
space:
mode:
authorSegher Boessenkool <segher@kernel.crashing.org>2014-07-02 22:19:19 +0200
committerSegher Boessenkool <segher@gcc.gnu.org>2014-07-02 22:19:19 +0200
commit4ed3092ff8fe1a769f8c18d3f215cfafaf44a95d (patch)
tree55483e0c6041d55004fd9e1326e9f7d35571d985 /gcc/genconfig.c
parent1680a432083fd5e3c7e84a246595f3df9e9165d7 (diff)
downloadgcc-4ed3092ff8fe1a769f8c18d3f215cfafaf44a95d.zip
gcc-4ed3092ff8fe1a769f8c18d3f215cfafaf44a95d.tar.gz
gcc-4ed3092ff8fe1a769f8c18d3f215cfafaf44a95d.tar.bz2
Only transform rotate to rotatert and v.v. if target has both
Many targets do not have both rotate and rotatert. Of the 47 targets in the tree, 17 have both, 9 have only rotate, 2 have only rotatert, and 19 have neither (this is based on "grep -wil" so it can be slightly off). rs6000 has only rotate, and mips has only rotatert. For such targets simplifying rotate to rotatert and vice versa is not simplifying things at all. rs6000 has already way too many rotate patterns (some days it seems like two thousand, but it is somewhat less in reality still); I would prefer not to double that again. So, this patch makes genrecog define HAVE_rotate and HAVE_rotatert if those RTL codes are mentioned anywhere in the machine description, and then does the transformation in simplify-rtx.c only if both these flags are set. From-SVN: r212239
Diffstat (limited to 'gcc/genconfig.c')
-rw-r--r--gcc/genconfig.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/genconfig.c b/gcc/genconfig.c
index cafa8d3..d1996c3 100644
--- a/gcc/genconfig.c
+++ b/gcc/genconfig.c
@@ -36,6 +36,8 @@ static int have_cc0_flag;
static int have_cmove_flag;
static int have_cond_exec_flag;
static int have_lo_sum_flag;
+static int have_rotate_flag;
+static int have_rotatert_flag;
static int have_peephole_flag;
static int have_peephole2_flag;
@@ -117,6 +119,16 @@ walk_insn_part (rtx part, int recog_p, int non_pc_set_src)
have_lo_sum_flag = 1;
return;
+ case ROTATE:
+ if (recog_p)
+ have_rotate_flag = 1;
+ return;
+
+ case ROTATERT:
+ if (recog_p)
+ have_rotatert_flag = 1;
+ return;
+
case SET:
walk_insn_part (SET_DEST (part), 0, recog_p);
walk_insn_part (SET_SRC (part), recog_p,
@@ -346,6 +358,12 @@ main (int argc, char **argv)
if (have_lo_sum_flag)
printf ("#define HAVE_lo_sum 1\n");
+ if (have_rotate_flag)
+ printf ("#define HAVE_rotate 1\n");
+
+ if (have_rotatert_flag)
+ printf ("#define HAVE_rotatert 1\n");
+
if (have_peephole_flag)
printf ("#define HAVE_peephole 1\n");