Patchwork Cortex-A15 vfnma/vfnms test patch

login
register
mail settings
Submitter amol pise
Date Jan. 21, 2013, 10:03 a.m.
Message ID <CANUf=CA8fjsEkQG1fZOpb-8YhgeRnVUmZ7+p5Y+aRrbtWpF0UQ@mail.gmail.com>
Download mbox | patch
Permalink /patch/214059/
State New
Headers show

Comments

amol pise - Jan. 21, 2013, 10:03 a.m.
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
amol pise - Jan. 22, 2013, 5:04 a.m.
Dear All,

Please let me know the patch is OK for trunk ?

Thank You,
Amol Pise

On 1/21/13, amol pise <amolpise15@gmail.com> wrote:
> 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
>
Mike Stump - Jan. 25, 2013, 6:47 p.m.
Given what stage we are in for trunk, I'm going to let the arm folks review this…  [ this is my form of a ping for you! ]

On Jan 21, 2013, at 9:04 PM, amol pise <amolpise15@gmail.com> wrote:
> Please let me know the patch is OK for trunk ?
> 
> On 1/21/13, amol pise <amolpise15@gmail.com> wrote:
>> 
>> * gcc/testsuite/gcc.target/arm/neon-vfma-1.c
>> * gcc/testsuite/gcc.target/arm/neon-vfms-1.c
amol pise - Jan. 27, 2013, 3:27 p.m.
Dear Mike,

Thanks for the  information.

Thank You,
Amol Pise

On Sat, Jan 26, 2013 at 12:17 AM, Mike Stump <mikestump@comcast.net> wrote:
> Given what stage we are in for trunk, I'm going to let the arm folks review this…  [ this is my form of a ping for you! ]
>
> On Jan 21, 2013, at 9:04 PM, amol pise <amolpise15@gmail.com> wrote:
>> Please let me know the patch is OK for trunk ?
>>
>> On 1/21/13, amol pise <amolpise15@gmail.com> wrote:
>>>
>>> * gcc/testsuite/gcc.target/arm/neon-vfma-1.c
>>> * gcc/testsuite/gcc.target/arm/neon-vfms-1.c
Ramana Radhakrishnan - Jan. 28, 2013, 10:48 a.m.
[Taking gcc-help off this thread.]

Amol,

> I have tested these instruction with GCC and these instructions are generated.
> Please review and marge this test support patch in gcc main trunk.

Thanks for this patch and sorry about the delay in getting around to this.

This is ok and I'll take this under the 10 line rule this time .

If you intend to continue to submit patches to gcc can I ask that you 
start the process for copyright assignments or confirm that you have a 
copyright assignment on file ?

http://gcc.gnu.org/contribute.html#legal

If you don't, send an email to gcc@gcc.gnu.org with a request for 
copyright assignment papers and a maintainer will send you these.

http://gcc.gnu.org/contribute.html in general is a good summary of the 
process related to contributing patches to GCC in general . Please do 
read that and follow up on gcc@gcc.gnu.org if you have any more questions.

And finally don't forget to add a changelog to your patches as 
documented in links from the above mentioned page. Since this is your 
first time I've added the following Changelog entry for your patch and 
applied it.

regards
Ramana



2013-01-27  Amol Pise  <amolpise15@gmail.com>

	* gcc.target/arm/neon-vfnms-1.c: New test.
	* gcc.target/arm/neon-vfnma-1.c: New test.
amol pise - Jan. 28, 2013, 2:03 p.m.
Dear Ramana,

Thank You very much for the changelog and commit of my patch in gcc.
I will follow the steps mentioned by you.

Thank You,
Amol Pise


On Mon, Jan 28, 2013 at 4:18 PM, Ramana Radhakrishnan <ramrad01@arm.com> wrote:
>
>
> [Taking gcc-help off this thread.]
>
> Amol,
>
>
>> I have tested these instruction with GCC and these instructions are
>> generated.
>> Please review and marge this test support patch in gcc main trunk.
>
>
> Thanks for this patch and sorry about the delay in getting around to this.
>
> This is ok and I'll take this under the 10 line rule this time .
>
> If you intend to continue to submit patches to gcc can I ask that you start
> the process for copyright assignments or confirm that you have a copyright
> assignment on file ?
>
> http://gcc.gnu.org/contribute.html#legal
>
> If you don't, send an email to gcc@gcc.gnu.org with a request for copyright
> assignment papers and a maintainer will send you these.
>
> http://gcc.gnu.org/contribute.html in general is a good summary of the
> process related to contributing patches to GCC in general . Please do read
> that and follow up on gcc@gcc.gnu.org if you have any more questions.
>
> And finally don't forget to add a changelog to your patches as documented in
> links from the above mentioned page. Since this is your first time I've
> added the following Changelog entry for your patch and applied it.
>
> regards
> Ramana
>
>
>
> 2013-01-27  Amol Pise  <amolpise15@gmail.com>
>
>         * gcc.target/arm/neon-vfnms-1.c: New test.
>         * gcc.target/arm/neon-vfnma-1.c: New test.
>
>
>
>
Ramana Radhakrishnan - Jan. 31, 2013, 4:57 p.m.
On 01/28/13 14:03, amol pise wrote:
> Dear Ramana,
>
> Thank You very much for the changelog and commit of my patch in gcc.
> I will follow the steps mentioned by you.


There are no vector forms for the vfnma and vfnms instructions.

A co-worker (thanks Kyryll) just pointed out to me that I'd misread the 
ARM-ARM when I checked this and it looks like the test run I did had 
failed but it looks I looked I checked the wrong work area.

Looking at the output a bit more carefully now compared to what I did 
the other day I see only the scalar forms being generated.

Also the ARM-ARM specifies that these instructions only have the scalar 
forms (Section 8.8.318)

vfnm<>.f64 Dd, Dn, Dm
vfnm<>.f32 Sd, Sn, Sm

instructions.

I have now reverted this patch as obvious.

Sorry about the inconvenience caused.


regards
Ramana

>
> Thank You,
> Amol Pise
>
>
> On Mon, Jan 28, 2013 at 4:18 PM, Ramana Radhakrishnan <ramrad01@arm.com> wrote:
>>
>>
>> [Taking gcc-help off this thread.]
>>
>> Amol,
>>
>>
>>> I have tested these instruction with GCC and these instructions are
>>> generated.
>>> Please review and marge this test support patch in gcc main trunk.
>>
>>
>> Thanks for this patch and sorry about the delay in getting around to this.
>>
>> This is ok and I'll take this under the 10 line rule this time .
>>
>> If you intend to continue to submit patches to gcc can I ask that you start
>> the process for copyright assignments or confirm that you have a copyright
>> assignment on file ?
>>
>> http://gcc.gnu.org/contribute.html#legal
>>
>> If you don't, send an email to gcc@gcc.gnu.org with a request for copyright
>> assignment papers and a maintainer will send you these.
>>
>> http://gcc.gnu.org/contribute.html in general is a good summary of the
>> process related to contributing patches to GCC in general . Please do read
>> that and follow up on gcc@gcc.gnu.org if you have any more questions.
>>
>> And finally don't forget to add a changelog to your patches as documented in
>> links from the above mentioned page. Since this is your first time I've
>> added the following Changelog entry for your patch and applied it.
>>
>> regards
>> Ramana
>>
>>
>>
>> 2013-01-27  Amol Pise  <amolpise15@gmail.com>
>>
>>          * gcc.target/arm/neon-vfnms-1.c: New test.
>>          * gcc.target/arm/neon-vfnma-1.c: New test.
>>
>>
>>
>>
>

Patch

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];
+}