This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFA: patch to avoid multiple zero vectors (Was: Re: zero vector usage)
> + /* Generate a vector like gen_rtx_CONST_VEC, but use the zero vector when
> + all elements are zero. */
> + rtx
> + gen_const_vector (mode, v)
> + enum machine_mode mode;
> + rtvec v;
> + {
> + rtx inner_zero = CONST0_RTX (GET_MODE_INNER (mode));
> + int i;
> +
> + for (i = GET_MODE_NUNITS (mode) - 1; i >= 0; i--)
> + if (RTVEC_ELT (v, i) != inner_zero)
> + return gen_rtx_CONST_VECTOR (mode, v);
> + return CONST0_RTX (mode);
> + }
> +
sweet! this looks good. thanks.
...of course you have to wait for approval.
aldy