From patchwork Mon Jan 21 10:03:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: amol pise X-Patchwork-Id: 214059 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]) by ozlabs.org (Postfix) with SMTP id 4CEFC2C00DE for ; Mon, 21 Jan 2013 21:03:17 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1359367397; h=Comment: DomainKey-Signature:Received:Received:Received:Received: MIME-Version:Received:Date:Message-ID:Subject:From:To:Cc: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=BDrQU+B EBCuPZnnHB9+ZOU+4Qig=; b=X3fek3muU1W32/RInC9kgzvUFbd0OwvJVbpoYiV XtrWV5C1fmEnXrQ4czQ8ot7A6goKZ0d/A4OW5V0v9IFq+htjfLxGZxsspvltsx1l 2K+xmPO1+r4Tn8bmGZ7ORNgFMj/5iwLcPy3yTDJsceXMFBN51phW1+vInbwdnMWr wDdY= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:MIME-Version:X-Received:Received:Date:Message-ID:Subject:From:To:Cc:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=s5dy5R6PzZbCgF9ykYv4PWWrTGwb8KqCwhAlxaKvfDP4wYZDX9osddHK8jzhQZ aPtaIjuUuYfWIbhbPWZZ139ds9MKfPX2NnOkaxn4LO5sHU9wb/R0Gd6HGodlQ5fO NjFs+HR5rC+SC2HGSLe3lGLQetB2Q1LDZv0REw1CnTpcM=; Received: (qmail 21939 invoked by alias); 21 Jan 2013 10:03:10 -0000 Received: (qmail 21925 invoked by uid 22791); 21 Jan 2013 10:03:09 -0000 X-SWARE-Spam-Status: No, hits=-4.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, TW_VF X-Spam-Check-By: sourceware.org Received: from mail-ie0-f169.google.com (HELO mail-ie0-f169.google.com) (209.85.223.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 21 Jan 2013 10:03:03 +0000 Received: by mail-ie0-f169.google.com with SMTP id c14so9689665ieb.0 for ; Mon, 21 Jan 2013 02:03:02 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.43.114.4 with SMTP id ey4mr11777367icc.27.1358762582457; Mon, 21 Jan 2013 02:03:02 -0800 (PST) Received: by 10.50.100.137 with HTTP; Mon, 21 Jan 2013 02:03:02 -0800 (PST) Date: Mon, 21 Jan 2013 15:33:02 +0530 Message-ID: Subject: Cortex-A15 vfnma/vfnms test patch From: amol pise To: gcc-patches@gcc.gnu.org, gcc-help@gcc.gnu.org Cc: amolpise15 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 Dear All, I am working on Cortex-A15 using latest GCC toolchain. As we know that VFPv4 and SIMDv2 are the Cortex-A15 CPU Features, so, compared to VFPv3/ SIMDv1, in VFPv4/SIMDv2 has following additional instruction support * VFMA, VFMS - Fused multiply accumulate, Fused multiply subtract. * VFNMA, VFNMS - Fused multiply accumulate with negation, Fused multiply subtract with negation. To check whether these instructions are generated or not. I took the GCC-4.8 branch (snapshot) from FSF. I noticed there are following testcases available for VFMA, VFMS instructions * gcc/testsuite/gcc.target/arm/neon-vfma-1.c * gcc/testsuite/gcc.target/arm/neon-vfms-1.c But for the VFNMA, VFNMS instructions there are no test case available. So I have created the patch to test these instruction. Please find the attached patch I have tested these instruction with GCC and these instructions are generated. Please review and marge this test support patch in gcc main trunk. Thank You, Amol Pise diff -Narub gcc/testsuite/gcc.target/arm/neon-vfnma-1.c gcc/testsuite/gcc.target/arm/neon-vfnma-1.c --- gcc/testsuite/gcc.target/arm/neon-vfnma-1.c 1970-01-01 05:30:00.000000000 +0530 +++ gcc/testsuite/gcc.target/arm/neon-vfnma-1.c 2013-01-21 14:30:13.000000000 +0530 @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_neonv2_ok } */ +/* { dg-options "-O2 -ftree-vectorize -ffast-math" } */ +/* { dg-add-options arm_neonv2 } */ +/* { dg-final { scan-assembler "vfnma\\.f32\[ \]+\[dDqQ]" } } */ + +/* Verify that VFNMA is used. */ +void f1(int n, float a, float x[], float y[]) { + int i; + for (i = 0; i < n; ++i) + y[i] = a * -x[i] - y[i]; +} diff -Narub gcc/testsuite/gcc.target/arm/neon-vfnms-1.c gcc/testsuite/gcc.target/arm/neon-vfnms-1.c --- gcc/testsuite/gcc.target/arm/neon-vfnms-1.c 1970-01-01 05:30:00.000000000 +0530 +++ gcc/testsuite/gcc.target/arm/neon-vfnms-1.c 2013-01-21 14:30:13.000000000 +0530 @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_neonv2_ok } */ +/* { dg-options "-O2 -ftree-vectorize -ffast-math" } */ +/* { dg-add-options arm_neonv2 } */ +/* { dg-final { scan-assembler "vfnms\\.f32\[ \]+\[dDqQ]" } } */ + +/* Verify that VFNMS is used. */ +void f1(int n, float a, float x[], float y[]) { + int i; + for (i = 0; i < n; ++i) + y[i] = a * x[i] - y[i]; +}