From patchwork Tue Dec 9 15:27:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charles Baylis X-Patchwork-Id: 42055 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1BFBC25E75 for ; Tue, 9 Dec 2014 15:29:28 +0000 (UTC) Received: by mail-la0-f70.google.com with SMTP id hs14sf658889lab.9 for ; Tue, 09 Dec 2014 07:29:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:mailing-list :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:sender:delivered-to:from:to:subject:date:message-id :in-reply-to:references:x-original-sender :x-original-authentication-results; bh=OtvKSA+KWGDFoal/lBhoe2kTu3tc81aHg/z8MK1RMto=; b=YnDt/kdOStH3jDnBqG7KVbwaadqeklKCrEdbStlUIyPj212KF99dwrH0zcmbGYhHeV I0v9sq+XyAnlWaYiEKBjR6G5EPofnH8pqWNMX5PTk6z6o4PXN8pOanZZRK2eXpZgtU+f 0n5GTtSCpl7QXCFzHrWdfHpP6FBE6TGLRCNyChxr5MyKhzbBDhV4wmyiHGsDNNrgsbmM bcgWbFojoIihxXWqXIvxPAjwLftjhcFw8iMSbG4f0ikGOmx+0u0xNnXDYU9NksbFXAh3 zI1ohn4+7kSbcmXgpPhYxqUPhCN0pP05giz0TxNRJO7XrJSktAtp5kRTiYAHjWDWrevD f4lQ== X-Gm-Message-State: ALoCoQmF0IsgIQ/reUiREpHzfsUguQT/cvcU/vnWtgh4bMcY/Tk/FuZijip6Q4Lu1d+0pSdET5yZ X-Received: by 10.112.162.199 with SMTP id yc7mr22384lbb.23.1418138966840; Tue, 09 Dec 2014 07:29:26 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.7.193 with SMTP id l1ls51628laa.79.gmail; Tue, 09 Dec 2014 07:29:26 -0800 (PST) X-Received: by 10.112.12.102 with SMTP id x6mr22852679lbb.29.1418138966698; Tue, 09 Dec 2014 07:29:26 -0800 (PST) Received: from mail-lb0-x229.google.com (mail-lb0-x229.google.com. [2a00:1450:4010:c04::229]) by mx.google.com with ESMTPS id ap1si799056lbc.100.2014.12.09.07.29.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 09 Dec 2014 07:29:26 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::229 as permitted sender) client-ip=2a00:1450:4010:c04::229; Received: by mail-lb0-f169.google.com with SMTP id p9so692106lbv.14 for ; Tue, 09 Dec 2014 07:29:26 -0800 (PST) X-Received: by 10.152.2.165 with SMTP id 5mr22527684lav.40.1418138966290; Tue, 09 Dec 2014 07:29:26 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp767685lbc; Tue, 9 Dec 2014 07:29:25 -0800 (PST) X-Received: by 10.66.235.135 with SMTP id um7mr6537226pac.94.1418138964612; Tue, 09 Dec 2014 07:29:24 -0800 (PST) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id ds1si2210956pbb.197.2014.12.09.07.29.23 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Dec 2014 07:29:24 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-386968-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 12754 invoked by alias); 9 Dec 2014 15:28:08 -0000 Mailing-List: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 12637 invoked by uid 89); 9 Dec 2014 15:28:06 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wi0-f171.google.com Received: from mail-wi0-f171.google.com (HELO mail-wi0-f171.google.com) (209.85.212.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 09 Dec 2014 15:28:05 +0000 Received: by mail-wi0-f171.google.com with SMTP id bs8so8248298wib.10 for ; Tue, 09 Dec 2014 07:28:02 -0800 (PST) X-Received: by 10.181.12.38 with SMTP id en6mr34323944wid.5.1418138882355; Tue, 09 Dec 2014 07:28:02 -0800 (PST) Received: from sale.linaroharston ([81.128.185.34]) by mx.google.com with ESMTPSA id jp3sm14246558wid.9.2014.12.09.07.28.01 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 09 Dec 2014 07:28:01 -0800 (PST) From: charles.baylis@linaro.org To: rearnsha@arm.com, gcc-patches@gcc.gnu.org, marcus.shawcroft@arm.com, tejas.belagod@arm.com, alan.lawrence@arm.com Subject: [PATCH 4/4] vstN_lane error message enhancements (D registers) Date: Tue, 9 Dec 2014 15:27:54 +0000 Message-Id: <1418138874-13285-5-git-send-email-charles.baylis@linaro.org> In-Reply-To: <1418138874-13285-1-git-send-email-charles.baylis@linaro.org> References: <1418138874-13285-1-git-send-email-charles.baylis@linaro.org> X-IsSubscribed: yes X-Original-Sender: charles.baylis@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::229 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@gcc.gnu.org X-Google-Group-Id: 836684582541 From: Charles Baylis gcc/ChangeLog: Charles Baylis * config/aarch64/arm_neon.h (__ST2_LANE_FUNC): Add explicit lane bounds check. (__ST3_LANE_FUNC): Likewise. (__ST4_LANE_FUNC): Likewise. gcc/testsuite/ChangeLog: Charles Baylis * gcc.target/aarch64/simd/vst4_lane.c: New test. Change-Id: I6bceaeb7773bf20860daca4013ea1c4d2c06afa6 --- gcc/config/aarch64/arm_neon.h | 6 ++++++ gcc/testsuite/gcc.target/aarch64/simd/vst4_lane.c | 14 ++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 gcc/testsuite/gcc.target/aarch64/simd/vst4_lane.c diff --git a/gcc/config/aarch64/arm_neon.h b/gcc/config/aarch64/arm_neon.h index 22df564..22c6d06 100644 --- a/gcc/config/aarch64/arm_neon.h +++ b/gcc/config/aarch64/arm_neon.h @@ -11181,6 +11181,8 @@ vst2_lane_ ## funcsuffix (ptrtype *__ptr, \ __temp.val[1] \ = vcombine_##funcsuffix (__b.val[1], \ vcreate_##funcsuffix (__AARCH64_UINT64_C (0))); \ + __builtin_aarch64_im_lane_boundsi (__c, \ + sizeof (__b.val[0]) / sizeof (*__ptr)); \ __o = __builtin_aarch64_set_qregoi##mode (__o, \ (signedtype) __temp.val[0], 0); \ __o = __builtin_aarch64_set_qregoi##mode (__o, \ @@ -11258,6 +11260,8 @@ vst3_lane_ ## funcsuffix (ptrtype *__ptr, \ (signedtype) __temp.val[1], 1); \ __o = __builtin_aarch64_set_qregci##mode (__o, \ (signedtype) __temp.val[2], 2); \ + __builtin_aarch64_im_lane_boundsi (__c, \ + sizeof (__b.val[0]) / sizeof (*__ptr)); \ __builtin_aarch64_st3_lane##mode ((__builtin_aarch64_simd_ ## ptr_mode *) \ __ptr, __o, __c); \ } @@ -11336,6 +11340,8 @@ vst4_lane_ ## funcsuffix (ptrtype *__ptr, \ (signedtype) __temp.val[2], 2); \ __o = __builtin_aarch64_set_qregxi##mode (__o, \ (signedtype) __temp.val[3], 3); \ + __builtin_aarch64_im_lane_boundsi (__c, \ + sizeof (__b.val[0]) / sizeof (*__ptr)); \ __builtin_aarch64_st4_lane##mode ((__builtin_aarch64_simd_ ## ptr_mode *) \ __ptr, __o, __c); \ } diff --git a/gcc/testsuite/gcc.target/aarch64/simd/vst4_lane.c b/gcc/testsuite/gcc.target/aarch64/simd/vst4_lane.c new file mode 100644 index 0000000..6627ecf --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/simd/vst4_lane.c @@ -0,0 +1,14 @@ +/* Test error message when passing an invalid value as a lane index. */ + +/* { dg-do compile } */ + +#include + +void +f_vst4_lane (int8_t * p, int8x8x4_t v) +{ + /* { dg-error "lane 8 out of range 0 - 7" "" { target *-*-* } 0 } */ + vst4_lane_s8 (p, v, 8); + return; +} +