Some vector operation simplifications.

From-SVN: r36263
This commit is contained in:
Bernd Schmidt 2000-09-08 09:39:23 +00:00 committed by Bernd Schmidt
parent d5e5ec886e
commit 82be40f7eb
2 changed files with 44 additions and 0 deletions

View File

@ -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.

View File

@ -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;
}