This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR 47272 to restore Altivec vec_ld/vec_st
- From: David Edelsohn <dje dot gcc at gmail dot com>
- To: Michael Meissner <meissner at linux dot vnet dot ibm dot com>, Mark Mitchell <mark at codesourcery dot com>, gcc-patches at gcc dot gnu dot org, rth at redhat dot com, rguenther at suse dot de, jakub at redhat dot com, berner at vnet dot ibm dot com, geoffk at geoffk dot org, joseph at codesourcery dot com, pinskia at gmail dot com, dominiq at lps dot ens dot fr
- Date: Wed, 2 Feb 2011 16:08:44 -0500
- Subject: Re: [PATCH] Fix PR 47272 to restore Altivec vec_ld/vec_st
- References: <20110124213133.GA21518@hungry-tiger.westford.ibm.com> <4D3DF07A.3030101@codesourcery.com> <20110124215225.GA22498@hungry-tiger.westford.ibm.com> <20110131201404.GA13933@hungry-tiger.westford.ibm.com>
On Mon, Jan 31, 2011 at 3:14 PM, Michael Meissner
<meissner@linux.vnet.ibm.com> wrote:
> Here are my latest patches to fix the problem. ?It does give the user the
> ability to use the VSX instructions that they had with GCC 4.5 in case there
> was new code that used vec_ld/vec_st incorrectly by using the new vec_vsx_ld
> and vec_vsx_st functions in altivec.h. ?At present, I have not added an #ifdef
> so the user could switch to the GCC 4.5 behavior, but I could do that if
> desired.
>
> I noticed that the new vector types weren't supported by vec_ld/vec_st, so I
> added them.
>
> I'm including the libcpp/lex.c patch that allows the compiler to be built with
> GCC 4.5 using CFLAGS='-mcpu=power7 -O2 -g'.
>
> I also included 3 test suite fixes in this patch.
>
> I just did a side by side build of unpatched GCC 4.6 without special options,
> and one with these patches and adding --with-cpu=power7. ?I'm seeing the
> following regressions:
>
> gcc.dg/pr41551.c ? ? ? ? ? ? ? ? ? ? ? ?(64-bit only, unrecognized insn)
> gcc.dg/pr42461.c ? ? ? ? ? ? ? ? ? ? ? ?(Peter Bergner has a fix)
> gcc.dg/pr46909.c
> gcc.dg/sms-3.c ? ? ? ? ? ? ? ? ? ? ? ? ?(64-bit only, both fail on 32-bit)
> gcc.dg/stack-usage-1.c ? ? ? ? ? ? ? ? ?(32-bit only)
> gcc.c-torture/execute/20050121-1.c ? ? ?(32-bit only, unrecognized insn)
>
> I'm seeing passes in:
>
> gcc.dg/torture/va-arg-25.c
> gcc.dg/torture/vector-1.c
> gcc.dg/torture/vector-2.c
> c-c++-common/dfp/pr35620.c
> gcc.target/powerpc/ppc64-abi-dfp-1.c
>
> Are these patches ok to install?
>
> [gcc]
> 2011-01-28 ?Michael Meissner ?<meissner@linux.vnet.ibm.com>
>
> ? ? ? ?PR target/47272
> ? ? ? ?* doc/extend.texi (PowerPC AltiVec/VSX Built-in Functions):
> ? ? ? ?Document using vector double with the load/store builtins, and
> ? ? ? ?that the load/store builtins always use Altivec instructions.
>
> ? ? ? ?* config/rs6000/vector.md (vector_altivec_load_<mode>): New insns
> ? ? ? ?to use altivec memory instructions, even on VSX.
> ? ? ? ?(vector_altivec_store_<mode>): Ditto.
>
> ? ? ? ?* config/rs6000/rs6000-protos.h (rs6000_address_for_altivec): New
> ? ? ? ?function.
>
> ? ? ? ?* config/rs6000/rs6000-c.c (altivec_overloaded_builtins): Add
> ? ? ? ?V2DF, V2DI support to load/store overloaded builtins.
>
> ? ? ? ?* config/rs6000/rs6000-builtin.def (ALTIVEC_BUILTIN_*): Add
> ? ? ? ?altivec load/store builtins for V2DF/V2DI types.
>
> ? ? ? ?* config/rs6000/rs6000.c (rs6000_option_override_internal): Don't
> ? ? ? ?set avoid indexed addresses on power6 if -maltivec.
> ? ? ? ?(altivec_expand_ld_builtin): Add V2DF, V2DI support, use
> ? ? ? ?vector_altivec_load/vector_altivec_store builtins.
> ? ? ? ?(altivec_expand_st_builtin): Ditto.
> ? ? ? ?(altivec_expand_builtin): Add VSX memory builtins.
> ? ? ? ?(rs6000_init_builtins): Add V2DI types to internal types.
> ? ? ? ?(altivec_init_builtins): Add support for V2DF/V2DI altivec
> ? ? ? ?load/store builtins.
> ? ? ? ?(rs6000_address_for_altivec): Insure memory address is appropriate
> ? ? ? ?for Altivec.
>
> ? ? ? ?* config/rs6000/vsx.md (vsx_load_<mode>): New expanders for
> ? ? ? ?vec_vsx_ld and vec_vsx_st.
> ? ? ? ?(vsx_store_<mode>): Ditto.
>
> ? ? ? ?* config/rs6000/rs6000.h (RS6000_BTI_long_long): New type
> ? ? ? ?variables to hold long long types for VSX vector memory builtins.
> ? ? ? ?(RS6000_BTI_unsigned_long_long): Ditto.
> ? ? ? ?(long_long_integer_type_internal_node): Ditti.
> ? ? ? ?(long_long_unsigned_type_internal_node): Ditti.
>
> ? ? ? ?* config/rs6000/altivec.md (UNSPEC_LVX): New UNSPEC.
> ? ? ? ?(altivec_lvx_<mode>): Make altivec_lvx use a mode iterator.
> ? ? ? ?(altivec_stvx_<mode>): Make altivec_stvx use a mode iterator.
>
> ? ? ? ?* config/rs6000/altivec.h (vec_vsx_ld): Define VSX memory builtin
> ? ? ? ?short cuts.
> ? ? ? ?(vec_vsx_st): Ditto.
> [gcc/testsuite]
> 2011-01-28 ?Michael Meissner ?<meissner@linux.vnet.ibm.com>
>
> ? ? ? ?PR target/47272
> ? ? ? ?* gcc.target/powerpc/vsx-builtin-8.c: New file, test vec_vsx_ld
> ? ? ? ?and vec_vsx_st.
>
> ? ? ? ?* gcc.target/powerpc/avoid-indexed-addresses.c: Disable altivec
> ? ? ? ?and vsx so a default --with-cpu=power7 doesn't give an error
> ? ? ? ?when -mavoid-indexed-addresses is used.
>
> ? ? ? ?* gcc.target/powerpc/ppc32-abi-dfp-1.c: Rewrite to use an asm
> ? ? ? ?wrapper function to save the arguments and then jump to the real
> ? ? ? ?function, rather than depending on the compiler not to move stuff
> ? ? ? ?before an asm.
> ? ? ? ?* gcc.target/powerpc/ppc64-abi-dfp-2.c: Ditto.
Okay, without the libcpp/lex.c change, as discussed offline.
Some of the XXX_type_node lines are too long (replacing lines that
were too long).
Thanks, David