This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: RFA: patch to avoid multiple zero vectors (Was: Re: zero vector usage)
- From: Aldy Hernandez <aldyh at redhat dot com>
- To: Joern Rennecke <joern dot rennecke at superh dot com>
- Cc: Daniel Egger <degger at fhm dot edu>, GCC Patches <gcc-patches at gcc dot gnu dot org>, gcc at gcc dot gnu dot org
- Date: Mon, 8 Jul 2002 15:24:42 -0700
- Subject: Re: RFA: patch to avoid multiple zero vectors (Was: Re: zero vector usage)
- References: <3D287F6F.E25C9323@superh.com> <1026066347.6648.2.camel@sonja.de.interearth.com> <3D296C3F.83381D5C@superh.com> <m2y9cmw6l2.fsf@culebra.cygnus.com> <3D29C2EA.E79EBA1@superh.com> <20020708173210.GA10888@redhat.com> <3D2A0EE1.6F1090F0@superh.com>
> + /* 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