From 4ed3092ff8fe1a769f8c18d3f215cfafaf44a95d Mon Sep 17 00:00:00 2001 From: Segher Boessenkool Date: Wed, 2 Jul 2014 22:19:19 +0200 Subject: 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 --- gcc/simplify-rtx.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gcc/simplify-rtx.c') diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index 181b56f..07b9353 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -3076,6 +3076,7 @@ simplify_binary_operation_1 (enum rtx_code code, enum machine_mode mode, prefer left rotation, if op1 is from bitsize / 2 + 1 to bitsize - 1, use other direction of rotate with 1 .. bitsize / 2 - 1 amount instead. */ +#if defined(HAVE_rotate) && defined(HAVE_rotatert) if (CONST_INT_P (trueop1) && IN_RANGE (INTVAL (trueop1), GET_MODE_BITSIZE (mode) / 2 + (code == ROTATE), @@ -3083,6 +3084,7 @@ simplify_binary_operation_1 (enum rtx_code code, enum machine_mode mode, return simplify_gen_binary (code == ROTATE ? ROTATERT : ROTATE, mode, op0, GEN_INT (GET_MODE_BITSIZE (mode) - INTVAL (trueop1))); +#endif /* FALLTHRU */ case ASHIFTRT: if (trueop1 == CONST0_RTX (mode)) -- cgit v1.1