public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Alan Lawrence <alan.lawrence@arm.com>
To: "charles.baylis@linaro.org" <charles.baylis@linaro.org>
Cc: Richard Earnshaw <Richard.Earnshaw@arm.com>,
	 "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
	Marcus Shawcroft <Marcus.Shawcroft@arm.com>,
	 Tejas Belagod <Tejas.Belagod@arm.com>
Subject: Re: [PATCH 0/4] [AARCH64,SIMD] PR63870 Improve error messages for single lane load/store
Date: Wed, 10 Dec 2014 10:34:00 -0000	[thread overview]
Message-ID: <5488219F.3080202@arm.com> (raw)
In-Reply-To: <1418138874-13285-1-git-send-email-charles.baylis@linaro.org>

Thanks, Charles. A couple of thoughts.

I think the approach in patches 2+3+4 of using __builtin_aarch64_im_lane_boundsi 
is justified and works quite neatly. Modulo the question of argument ordering 
and __AARCH64_LANE_CHECK, those patches look good.

However, the SIMD_ARG_STRUCT_LOAD_STORE_LANE_INDEX, seems a lot of 
infrastructure to introduce if we are only going to use it in one place, and I 
think I might argue in favour of using ...__im_lane_bound or AARCH64_LANE_CHECK 
there also. Of course all of this palaver stems from using the same builtins for 
both D- and Q-reg intrinsics, and I suspect some cleanup may be due to those 
intrinsics *at some point*, but probably not in time for gcc 5.0. However, this 
does mean that if I use a D-reg intrinsic with a lane index that's out of bounds 
for the Q-reg too, I get a double error message: e.g. for testcase

int8x8x4_t
f_vld4_lane (int8_t * p, int8x8x4_t v)
{
   int8x8x4_t res;
   return vld4_lane_s8 (p, v, 18);
}

I get output:

In file included from gcc/testsuite/gcc.target/aarch64/simd/vld4_lane.c:5:0:
.../install/lib/gcc/aarch64-none-elf/5.0.0/include/arm_neon.h: In function 
'f_vld4_lane':
.../install/lib/gcc/aarch64-none-elf/5.0.0/include/arm_neon.h:18123:1: error: 
lane 18 out of range 0 - 7
  __LD4_LANE_FUNC (int8x8x4_t, int8x8_t, int8x16x4_t, int8_t, v16qi, qi, s8,
  ^
In function 'vld4_lane_s8',
     inlined from 'f_vld4_lane' at 
gcc/testsuite/gcc.target/aarch64/simd/vld4_lane.c:12:7:
.../install/lib/gcc/aarch64-none-elf/5.0.0/include/arm_neon.h:18123:1: error: 
lane 18 out of range 0 - 15
  __LD4_LANE_FUNC (int8x8x4_t, int8x8_t, int8x16x4_t, int8_t, v16qi, qi, s8,
  ^

which (although not serious) could be mildly confusing.

--Alan

charles.baylis@linaro.org wrote:
> From: Charles Baylis <charles.baylis@linaro.org>
> 
> This patch series moves the checking of lane indices for vld[234](q?)_lane and
> vst[234](q?)_lane intrinsics so that it occurs during builtin expansion.
> 
> The q register variants are checked directly, but since the d register variants
> use the same intrinsics, these are checked in arm_neon.h using
> __builtin_aarch64_im_land_boundsi().
> 
> Tested with make check-gcc on aarch64-oe-linux, with no regressions.
> 
> Charles Baylis (4):
>   vldN_lane error message enhancements (Q registers)
>   vldN_lane error message enhancements (D registers)
>   vstN_lane error message enhancements (Q register)
>   vstN_lane error message enhancements (D registers)
> 
>  gcc/config/aarch64/aarch64-builtins.c | 32 +++++++++++++++++++++++++++-----
>  gcc/config/aarch64/aarch64-simd.md    | 12 ++++++------
>  gcc/config/aarch64/arm_neon.h         | 12 ++++++++++++
>  3 files changed, 45 insertions(+), 11 deletions(-)
> 


  parent reply	other threads:[~2014-12-10 10:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-09 15:28 charles.baylis
2014-12-09 15:28 ` [PATCH 3/4] vstN_lane error message enhancements (Q register) charles.baylis
2014-12-09 15:28 ` [PATCH 2/4] vldN_lane error message enhancements (D registers) charles.baylis
2014-12-10  9:23   ` Christophe Lyon
2014-12-10 10:26     ` Alan Lawrence
2014-12-09 15:28 ` [PATCH 1/4] vldN_lane error message enhancements (Q registers) charles.baylis
     [not found]   ` <CAOckXuMSZyHU80A6-VjSzZ7bHrtRikTKwn-45DZ9oPPuRX_0HQ@mail.gmail.com>
2015-04-14 16:30     ` Charles Baylis
2015-04-14 17:20       ` Alan Lawrence
2014-12-09 15:28 ` [PATCH 4/4] vstN_lane error message enhancements (D registers) charles.baylis
2014-12-10 10:34 ` Alan Lawrence [this message]
2014-12-12 14:12   ` [PATCH 0/4] [AARCH64,SIMD] PR63870 Improve error messages for single lane load/store Charles Baylis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5488219F.3080202@arm.com \
    --to=alan.lawrence@arm.com \
    --cc=Marcus.Shawcroft@arm.com \
    --cc=Richard.Earnshaw@arm.com \
    --cc=Tejas.Belagod@arm.com \
    --cc=charles.baylis@linaro.org \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).