diff options
| author | crux <crux@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-09-08 09:39:23 +0000 |
|---|---|---|
| committer | crux <crux@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-09-08 09:39:23 +0000 |
| commit | 317b4eae18be164112221bc3bfe2b89b68badfd6 (patch) | |
| tree | 4f6d42c06e9dfee4a87179059fbbc9be5d35507b | |
| parent | 74cfc8e3262c354cce0103002fedff35d968af07 (diff) | |
| download | ppe42-gcc-317b4eae18be164112221bc3bfe2b89b68badfd6.tar.gz ppe42-gcc-317b4eae18be164112221bc3bfe2b89b68badfd6.zip | |
Some vector operation simplifications.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@36263 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/combine.c | 39 |
2 files changed, 44 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1a215366390..6e2837b660a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2000-09-08 Bernd Schmidt <bernds@redhat.co.uk> + + * combine.c (combine_simplify_rtx): Try to simplify VEC_SELECT of a + VEC_CONCAT. + 2000-09-07 Richard Henderson <rth@cygnus.com> * config/ia64/lib1funcs.asm (__divsi3): Use .s1 for frcpa. diff --git a/gcc/combine.c b/gcc/combine.c index 56bedce3b3b..053b42060ce 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -4539,6 +4539,45 @@ combine_simplify_rtx (x, op0_mode, last, in_dest) break; + case VEC_SELECT: + { + rtx op0 = XEXP (x, 0); + rtx op1 = XEXP (x, 1); + int len; + + if (GET_CODE (op1) != PARALLEL) + abort (); + len = XVECLEN (op1, 0); + if (len == 1 + && GET_CODE (XVECEXP (op1, 0, 0)) == CONST_INT + && GET_CODE (op0) == VEC_CONCAT) + { + int offset = INTVAL (XVECEXP (op1, 0, 0)) * GET_MODE_SIZE (GET_MODE (x)); + + /* Try to find the element in the VEC_CONCAT. */ + for (;;) + { + if (GET_MODE (op0) == GET_MODE (x)) + return op0; + if (GET_CODE (op0) == VEC_CONCAT) + { + HOST_WIDE_INT op0_size = GET_MODE_SIZE (GET_MODE (XEXP (op0, 0))); + if (op0_size < offset) + op0 = XEXP (op0, 0); + else + { + offset -= op0_size; + op0 = XEXP (op0, 1); + } + } + else + break; + } + } + } + + break; + default: break; } |

