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: 419152 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id C762A1400D2 for ; Wed, 10 Dec 2014 02:29:16 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references; q=dns; s= default; b=unYEPLGiMwQzwjLRNX4X8bKCHsgzXKleycnQvXv+xSbrZwr4OnVpN nHEQT+zGD9P7yRDcySDtW5yxK4Oe5ft6RatYwahO3sTdXbbGBCKQCsvAxpIo/b3M L2wrZ4Bypm/7OLyhw0wP39iMxUlolgwyQTVuxX3vSGmTC9EiIWaVBU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references; s=default; bh=WLsQBv8o8WjbfylTyqYba3ev8Kk=; b=M5EANyfBV6uIXv5IezR5RYIt4V54 FnqFUCkfY+6K95RBDr7JkRWBoOB5CDMPInF1xUfMoy4avXG/+s1UNhP5wTMx4gVh m6Z0LO8VONM19cFzMMLUbY/1h+TtPadM1T96wAg6rrxpyp2BSRzCy9X7ULx+/3Wj QHxcIRAikpAC6iY= Received: (qmail 12754 invoked by alias); 9 Dec 2014 15:28:08 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk 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 Authentication-Results: sourceware.org; auth=none 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-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=OtvKSA+KWGDFoal/lBhoe2kTu3tc81aHg/z8MK1RMto=; b=JyxZeYRIRNS9imay1E9BhgJterD65R/UCfc9b99akPUOmc+T1FXgqFaPv/so3tGA3G sHaaYdY0m+WqPevraatjMRl0WnHwqgAk90/1COrc+H2/C6gdd64c82je11lWALLWY2ug yitXAOetef5fTA53/J1WLaGukzTd5bCUICXlZGs6x6GXtTGIsvLHII4/SDzrVuNq8ARZ FNQ5KXot+aKDig7It39bqfPMSNEOlxgWN6xmeJEUkR3GjdFmXCWvuP3oIss+ZCWxHQL9 JcimOvrcDQfHK5i6XN8WLjd8kRRywrMvZ1k7V6yjR/eJox0FkuStqt0pidcmFcoLy0u/ pemg== X-Gm-Message-State: ALoCoQmuKDvbvqQ4rfx8anuEbQ2o4AEGKVLUUvY/B4FJxst/4XpNhIx/49GVyINqvj1e52r/4ld3 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 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; +} +