This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: patch: convert scalar literals to vector constants (PR/7277)
- From: Richard Henderson <rth at redhat dot com>
- To: Aldy Hernandez <aldyh at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 3 Jun 2003 09:08:13 -0700
- Subject: Re: patch: convert scalar literals to vector constants (PR/7277)
- References: <20030603005207.GE25928@redhat.com> <EFD83C30-95CC-11D7-93B0-000393750C1E@redhat.com>
On Tue, Jun 03, 2003 at 10:09:06AM -0400, Aldy Hernandez wrote:
> ! cst[0] = INTVAL (x);
> ! cst[1] = 0;
CONST_INT sign-extends.
> ! /* Convert 0x6699 into:
> ! (const_vector:M (const_int 0x0)
> ! ...
> ! (const_int 0x66)
> ! (const_int 0x99)). */
> !
> ! for (i = 0; i < units; ++i)
> ! {
> ! int idx;
> !
> ! idx = (i * inner_bits + 1) > HOST_BITS_PER_WIDE_INT ? 1 : 0;
> ! RTVEC_ELT (v, units - i - 1)
> ! = gen_rtx_CONST_INT (inner, cst[idx] & ((1 << inner_bits) - 1));
> ! cst[idx] >>= inner_bits;
Well, that works for integer vector modes. What about
fp vector modes? And how about
(v4sf)(v8hi)-1
where this routine should be called twice, the second
time to convert one vector mode to another?
r~