This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, rs6000, testsuite] Changes for unaligned vector load/store support on POWER8
- From: Bill Schmidt <wschmidt at linux dot vnet dot ibm dot com>
- To: David Edelsohn <dje dot gcc at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 26 Feb 2015 14:40:53 -0600
- Subject: Re: [PATCH, rs6000, testsuite] Changes for unaligned vector load/store support on POWER8
- Authentication-results: sourceware.org; auth=none
- References: <1422033820 dot 321 dot 25 dot camel at gnopaine> <CAGWvnykScWMiZq_75jW3PFhD=oFz5tE26ZvLNi7YzqTF6hPU1w at mail dot gmail dot com> <1423617508 dot 32509 dot 46 dot camel at gnopaine> <CAGWvny=mjD-K0S4A1D-3q_XKEAuGQtmbBUAToTwex_+KYq74qw at mail dot gmail dot com>
On Thu, 2015-02-26 at 10:36 -0500, David Edelsohn wrote:
> My one concern is the interaction between TARGET_ALLOW_MOVMISALIGN and
> TARGET_EFFICIENT_UNALIGNED_VSX in the movmisalign<mode> pattern in
> vector.md. Your patch changes
> rs6000_builtin_support_vector_misalignment to return TRUE if
> TARGET_EFFICIENT_UNALIGNED_VSX is enabled, which seems to enable the
> use of the movmisalign<mode> pattern, but the pattern final condition
> depends on TARGET_ALLOW_MOVMISALIGN.
>
> -mcpu=power8 will enable both flags, but if a user manually overrides
> one or both flags, the hook could return TRUE while the pattern is
> disabled, which would lead to an ICE. The relationship between the
> hook and the pattern need to be consistent. I'm not sure about the
> best way to rationalize it.
>
> Thanks, David
>
This is a good point. I think the following is probably the right way
to fix this:
/* Determine when unaligned vector accesses are permitted, and when
they are preferred over masked Altivec loads. Note that if
TARGET_ALLOW_MOVMISALIGN has been disabled by the user, then
TARGET_EFFICIENT_UNALIGNED_VSX must be as well. The converse
is not true. */
if (TARGET_EFFICIENT_UNALIGNED_VSX == -1) {
if (TARGET_VSX && rs6000_cpu == PROCESSOR_POWER8
&& TARGET_ALLOW_MOVMISALIGN != 0)
TARGET_EFFICIENT_UNALIGNED_VSX = 1;
else
TARGET_EFFICIENT_UNALIGNED_VSX = 0;
}
if (TARGET_ALLOW_MOVMISALIGN == -1 && rs6000_cpu == PROCESSOR_POWER8)
TARGET_ALLOW_MOVMISALIGN = 1;
That is, determine TARGET_EFFICIENT_UNALIGNED_VSX first, and only allow
it if TARGET_ALLOW_MOVMISALIGN hasn't been specifically disabled. Sound
reasonable?
Bill