diff options
author | Marc Glisse <marc.glisse@inria.fr> | 2012-08-17 19:53:57 +0200 |
---|---|---|
committer | Marc Glisse <glisse@gcc.gnu.org> | 2012-08-17 17:53:57 +0000 |
commit | fd9da2c807e91636a3faaf381c9d37a6c3f9a216 (patch) | |
tree | 60c5a55e6ad9bcc6520e2b4eb53f6dc52689af2d /gcc/simplify-rtx.c | |
parent | d9886a9e04caf0bd1e9147d95af2ea8350ad8e1c (diff) | |
download | gcc-fd9da2c807e91636a3faaf381c9d37a6c3f9a216.zip gcc-fd9da2c807e91636a3faaf381c9d37a6c3f9a216.tar.gz gcc-fd9da2c807e91636a3faaf381c9d37a6c3f9a216.tar.bz2 |
simplify-rtx.c (simplify_binary_operation_1): Optimize shuffle of a concatenation.
2012-08-17 Marc Glisse <marc.glisse@inria.fr>
gcc/
* simplify-rtx.c (simplify_binary_operation_1): Optimize shuffle of
a concatenation.
gcc/testsuite/
* gcc.target/i386/perm-concat.c: New test.
From-SVN: r190490
Diffstat (limited to 'gcc/simplify-rtx.c')
-rw-r--r-- | gcc/simplify-rtx.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index 16dbd8a..a878048 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -3255,6 +3255,23 @@ simplify_binary_operation_1 (enum rtx_code code, enum machine_mode mode, return simplify_gen_binary (VEC_CONCAT, mode, subop0, subop1); } + + if (XVECLEN (trueop1, 0) == 2 + && CONST_INT_P (XVECEXP (trueop1, 0, 0)) + && CONST_INT_P (XVECEXP (trueop1, 0, 1)) + && GET_CODE (trueop0) == VEC_CONCAT + && GET_MODE (trueop0) == mode) + { + unsigned int i0 = INTVAL (XVECEXP (trueop1, 0, 0)); + unsigned int i1 = INTVAL (XVECEXP (trueop1, 0, 1)); + rtx subop0, subop1; + + gcc_assert (i0 < 2 && i1 < 2); + subop0 = XEXP (trueop0, i0); + subop1 = XEXP (trueop0, i1); + + return simplify_gen_binary (VEC_CONCAT, mode, subop0, subop1); + } } if (XVECLEN (trueop1, 0) == 1 |