From patchwork Mon Sep 8 10:38:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Lawrence X-Patchwork-Id: 386856 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 0F2B414007B for ; Mon, 8 Sep 2014 20:39:10 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; q= dns; s=default; b=OTyH6iryqqFbuarmw0dVflkH5Uxf5aOkmRi4teO5DCMQch 1w4iDF9nYMTJbfyAsT9Qsc+bRocx6etV3ktorJJsegtrrnyEx5GzSQdkWy4I6ljg Pm1+5BR5GywbFqbZHhbHnQgnDXlDa1FBsdMpxZsm7hsormjQzQKER5LT1l1QQ= 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 :message-id:date:from:mime-version:to:subject:content-type; s= default; bh=A5oYS+2mIBLTLZwFYbl7wekhwYw=; b=VUXzc25ACuSCf9rk2+dF amkJZT9cwR46s3dIBvAFEDlU3k+RFZJoZQmB9dETehS5fPZrfePXbDGn5KHYOkfX 6lH50WMT0yaNEdqPdcIMIQnnRwjuuEDpGrRctpCYmqgZuGGqfzYUezDf3CO30/JR GKVJVMCC9pqoxvjjr4rPky8= Received: (qmail 7321 invoked by alias); 8 Sep 2014 10:39:04 -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 7304 invoked by uid 89); 8 Sep 2014 10:39:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=AWL, BAYES_00, SPF_PASS, UNSUBSCRIBE_BODY autolearn=no version=3.3.2 X-HELO: service87.mimecast.com Received: from service87.mimecast.com (HELO service87.mimecast.com) (91.220.42.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 08 Sep 2014 10:39:02 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Mon, 08 Sep 2014 11:38:59 +0100 Received: from [10.1.209.51] ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 8 Sep 2014 11:38:59 +0100 Message-ID: <540D873D.7040500@arm.com> Date: Mon, 08 Sep 2014 11:38:53 +0100 From: Alan Lawrence User-Agent: Thunderbird 2.0.0.24 (X11/20101213) MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" Subject: [PATCH][AArch64 Testsuite] Extend test of vld1+vst1 intrinsics to cover more variants X-MC-Unique: 114090811385907001 X-IsSubscribed: yes The existing vld1/vst1_1.c test in gcc.target/aarch64 covers only vld1_s8 and vld1q_s16. This extends it to cover all int/float variants via token-pasting. Passing on aarch64-none-elf and aarch64_be-none-elf. gcc/testsuite/ChangeLog: * gcc.target/aarch64/vld1-vst1_1.c: Rewrite to test all variants. diff --git a/gcc/testsuite/gcc.target/aarch64/vld1-vst1_1.c b/gcc/testsuite/gcc.target/aarch64/vld1-vst1_1.c index d1834a264708fe6ab901ac1a27544ca8ebb815cc..290444e357f933ad2fe8160936c0d3aea3452fac 100644 --- a/gcc/testsuite/gcc.target/aarch64/vld1-vst1_1.c +++ b/gcc/testsuite/gcc.target/aarch64/vld1-vst1_1.c @@ -5,48 +5,54 @@ extern void abort (void); -int __attribute__ ((noinline)) -test_vld1_vst1 () -{ - int8x8_t a; - int8x8_t b; - int i = 0; - int8_t c[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; - int8_t d[8]; - a = vld1_s8 (c); - asm volatile ("":::"memory"); - vst1_s8 (d, a); - asm volatile ("":::"memory"); - for (; i < 8; i++) - if (c[i] != d[i]) - return 1; - return 0; +#define TESTMETH(TYPE, NUM, BASETYPE, SUFFIX) \ +int __attribute__ ((noinline)) \ +test_vld1_vst1##SUFFIX () \ +{ \ + TYPE vec; \ + int i = 0; \ + BASETYPE src[NUM]; \ + BASETYPE dest[NUM]; \ + for (i = 0; i < NUM; i++) \ + src[i] = 2*i + 1; \ + asm volatile ("":::"memory"); \ + vec = vld1 ## SUFFIX (src); \ + asm volatile ("":::"memory"); \ + vst1 ## SUFFIX (dest, vec); \ + asm volatile ("":::"memory"); \ + for (i = 0; i < NUM; i++) \ + if (src[i] != dest[i]) \ + return 1; \ + return 0; \ } -int __attribute__ ((noinline)) -test_vld1q_vst1q () -{ - int16x8_t a; - int16x8_t b; - int i = 0; - int16_t c[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; - int16_t d[8]; - a = vld1q_s16 (c); - asm volatile ("":::"memory"); - vst1q_s16 (d, a); - asm volatile ("":::"memory"); - for (; i < 8; i++) - if (c[i] != d[i]) - return 1; - return 0; -} +#define VARIANTS(THING) \ +THING (int8x8_t, 8, int8_t, _s8) \ +THING (uint8x8_t, 8, uint8_t, _u8) \ +THING (int16x4_t, 4, int16_t, _s16) \ +THING (uint16x4_t, 4, uint16_t, _u16) \ +THING (int32x2_t, 2, int32_t, _s32) \ +THING (uint32x2_t, 2, uint32_t, _u32) \ +THING (float32x2_t, 2, float32_t, _f32) \ +THING (int8x16_t, 16, int8_t, q_s8) \ +THING (uint8x16_t, 16, uint8_t, q_u8) \ +THING (int16x8_t, 8, int16_t, q_s16) \ +THING (uint16x8_t, 8, uint16_t, q_u16) \ +THING (int32x4_t, 4, int32_t, q_s32) \ +THING (uint32x4_t, 4, uint32_t, q_u32) \ +THING (int64x2_t, 2, int64_t, q_s64) \ +THING (uint64x2_t, 2, uint64_t, q_u64) \ +THING (float64x2_t, 2, float64_t, q_f64) + +VARIANTS (TESTMETH) + +#define DOTEST(TYPE, NUM, BASETYPE, SUFFIX) \ + if (test_vld1_vst1##SUFFIX ()) \ + abort (); int main () { - if (test_vld1_vst1 ()) - abort (); - if (test_vld1q_vst1q ()) - abort (); + VARIANTS (DOTEST); return 0; }