This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix memory alignment on AVX512VL masked floating point stores (PR target/69198)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: Uros Bizjak <ubizjak at gmail dot com>, Kirill Yukhin <kirill dot yukhin at gmail dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 8 Jan 2016 21:48:02 +0100
- Subject: Re: [PATCH] Fix memory alignment on AVX512VL masked floating point stores (PR target/69198)
- Authentication-results: sourceware.org; auth=none
- References: <20160108202056 dot GG18720 at tucnak dot redhat dot com> <CAMe9rOq_HCpUzfcp-hN9p-yTUpgM-1u983=j0hOQYof7Y9Vefg at mail dot gmail dot com> <20160108203539 dot GH18720 at tucnak dot redhat dot com> <CAMe9rOrhjZQk1SArCskK9Y5ygeGUuwt_kH5XDUucU7joM+0Cdw at mail dot gmail dot com> <20160108204422 dot GJ18720 at tucnak dot redhat dot com> <CAMe9rOrJJGY+tt_sFzMj4sEcw4J5PGaPUAyY8yP5F51Wy_uaDg at mail dot gmail dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, Jan 08, 2016 at 12:46:01PM -0800, H.J. Lu wrote:
> On Fri, Jan 8, 2016 at 12:44 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> > On Fri, Jan 08, 2016 at 12:39:50PM -0800, H.J. Lu wrote:
> >> > p is not misaligned, it has just unknown alignment.
> >>
> >> And it may be 8 byte aligned.
> >
> > Yes. But if you call the routine with just 8 byte aligned p,
> > you invoke undefined behavior. So, there is nothing wrong on the testcase,
> > it tests what it means to.
> >
>
> Testing what? Undefined behavior?
No. Testing that if you use an intrinsic through which you tell the
compiler the memory is aligned, it doesn't ignore that and actually uses
the instruction you've asked for.
If you use the *storeu* instrinsics instead, and if the compiler can't prove
the memory is sufficiently aligned, of course it has to use the unaligned
stores.
Jakub