This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: patch: convert scalar literals to vector constants (PR/7277)


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~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]