Re: [Patch ARM-AArch64/testsuite v2 01/21] Neon intrinsics execution tests initial framework.

2014-10-08 Thread Ramana Radhakrishnan



What do you prefer me to do for these tests? I can think of:
- do not include them at all until fp16 is fully supported on both
AArch32 and AArch64
- include only those with float16x4_t
- include both float16x4_t and float16x8_t tests, leaving float16x8_t commented


I would include them both and XFAIL the failing tests. So when the 
support arrives, it's just a question of adjusting the tests.



regards
Ramana




Thanks,

Christophe.



Thanks
/Marcus




Re: [Patch ARM-AArch64/testsuite v2 01/21] Neon intrinsics execution tests initial framework.

2014-10-07 Thread Christophe Lyon
On 1 October 2014 17:11, Marcus Shawcroft marcus.shawcr...@gmail.com wrote:
 On 30 September 2014 15:27, Christophe Lyon christophe.l...@linaro.org 
 wrote:
 On 10 July 2014 12:12, Marcus Shawcroft marcus.shawcr...@gmail.com wrote:
 On 1 July 2014 11:05, Christophe Lyon christophe.l...@linaro.org wrote:
 * documentation (README)
 * dejanu driver (neon-intrinsics.exp)
 * support macros (arm-neon-ref.h, compute-ref-data.h)
 * Tests for 3 intrinsics: vaba, vld1, vshl

 Hi, The terminology in armv8 is advsimd rather than neon.  Can we
 rename neon-intrinsics to advsimd-intrinsics or simd-intrinsics
 throughout please.  The existing gcc.target/aarch64/simd directory of
 tests will presumably be superseded by this more comprehensive set of
 tests so I suggest these tests go in gcc.target/aarch64/advsimd and we
 eventually remove gcc.target/aarch64/simd/ directory.

 GNU style should apply throughout this patch series, notably double
 space after period in comments and README text.  Space before left
 parenthesis in function/macro call and function declaration.  The
 function name in a declaration goes on a new line.  The GCC wiki notes
 on test case state individual test should have file names ending in
 _number, see here https://gcc.gnu.org/wiki/TestCaseWriting


 Hi,

 For the record, these tests are based on a testsuite I wrote quite
 some time ago:
 https://gitorious.org/arm-neon-tests/

 where obviously I had no such requirement (and v8 wasn't public yet)

 So I prefer to apply the changes you request in my main version before
 re-submitting it here.
 (libsanitizer-style, sort-of).

 This will take me some time, so the next version of my patch series
 should not be expected really soon :-(


Ramana, Marcus,

 Hi Christophe,   Given that this test suite code is an existing body
 of work I see no reason to impose the GNU style change I originally
 asked for. I withdraw my original comment that these patches should
 conform to GNU style.  My comment on file names is also withdrawn.  I
 would like to see the terminology corrected.


Thanks, I have updated my patch according to this.

But meanwhile I have also updated my testsuite, and fixed the #define
flag I used to toggle float16 tests: I now use __ARM_FP16_FORMAT_IEEE,
such as:
#if defined(__ARM_FP16_FORMAT_IEEE)
  TEST_VLD1(vector, buffer, , float, f, 16, 4);
  TEST_VLD1(vector, buffer, q, float, f, 16, 8);
#endif

Which reminded me that:
- on ARM (AArch32), float16x4_t is supported, but float16x8_t isn't yet
- on AArch64, -mfp16-format=ieee is rejected, and I didn't see a
similar option in the doc

What do you prefer me to do for these tests? I can think of:
- do not include them at all until fp16 is fully supported on both
AArch32 and AArch64
- include only those with float16x4_t
- include both float16x4_t and float16x8_t tests, leaving float16x8_t commented
- include both, uncommented, but do not test with -mfp16-format=ieee

Thanks,

Christophe.


 Thanks
 /Marcus


Re: [Patch ARM-AArch64/testsuite v2 01/21] Neon intrinsics execution tests initial framework.

2014-10-01 Thread Marcus Shawcroft
On 30 September 2014 15:27, Christophe Lyon christophe.l...@linaro.org wrote:
 On 10 July 2014 12:12, Marcus Shawcroft marcus.shawcr...@gmail.com wrote:
 On 1 July 2014 11:05, Christophe Lyon christophe.l...@linaro.org wrote:
 * documentation (README)
 * dejanu driver (neon-intrinsics.exp)
 * support macros (arm-neon-ref.h, compute-ref-data.h)
 * Tests for 3 intrinsics: vaba, vld1, vshl

 Hi, The terminology in armv8 is advsimd rather than neon.  Can we
 rename neon-intrinsics to advsimd-intrinsics or simd-intrinsics
 throughout please.  The existing gcc.target/aarch64/simd directory of
 tests will presumably be superseded by this more comprehensive set of
 tests so I suggest these tests go in gcc.target/aarch64/advsimd and we
 eventually remove gcc.target/aarch64/simd/ directory.

 GNU style should apply throughout this patch series, notably double
 space after period in comments and README text.  Space before left
 parenthesis in function/macro call and function declaration.  The
 function name in a declaration goes on a new line.  The GCC wiki notes
 on test case state individual test should have file names ending in
 _number, see here https://gcc.gnu.org/wiki/TestCaseWriting


 Hi,

 For the record, these tests are based on a testsuite I wrote quite
 some time ago:
 https://gitorious.org/arm-neon-tests/

 where obviously I had no such requirement (and v8 wasn't public yet)

 So I prefer to apply the changes you request in my main version before
 re-submitting it here.
 (libsanitizer-style, sort-of).

 This will take me some time, so the next version of my patch series
 should not be expected really soon :-(


Hi Christophe,   Given that this test suite code is an existing body
of work I see no reason to impose the GNU style change I originally
asked for. I withdraw my original comment that these patches should
conform to GNU style.  My comment on file names is also withdrawn.  I
would like to see the terminology corrected.

Thanks
/Marcus


Re: [Patch ARM-AArch64/testsuite v2 01/21] Neon intrinsics execution tests initial framework.

2014-09-30 Thread Christophe Lyon
On 10 July 2014 12:12, Marcus Shawcroft marcus.shawcr...@gmail.com wrote:
 On 1 July 2014 11:05, Christophe Lyon christophe.l...@linaro.org wrote:
 * documentation (README)
 * dejanu driver (neon-intrinsics.exp)
 * support macros (arm-neon-ref.h, compute-ref-data.h)
 * Tests for 3 intrinsics: vaba, vld1, vshl

 Hi, The terminology in armv8 is advsimd rather than neon.  Can we
 rename neon-intrinsics to advsimd-intrinsics or simd-intrinsics
 throughout please.  The existing gcc.target/aarch64/simd directory of
 tests will presumably be superseded by this more comprehensive set of
 tests so I suggest these tests go in gcc.target/aarch64/advsimd and we
 eventually remove gcc.target/aarch64/simd/ directory.

 GNU style should apply throughout this patch series, notably double
 space after period in comments and README text.  Space before left
 parenthesis in function/macro call and function declaration.  The
 function name in a declaration goes on a new line.  The GCC wiki notes
 on test case state individual test should have file names ending in
 _number, see here https://gcc.gnu.org/wiki/TestCaseWriting


Hi,

For the record, these tests are based on a testsuite I wrote quite
some time ago:
https://gitorious.org/arm-neon-tests/

where obviously I had no such requirement (and v8 wasn't public yet)

So I prefer to apply the changes you request in my main version before
re-submitting it here.
(libsanitizer-style, sort-of).

This will take me some time, so the next version of my patch series
should not be expected really soon :-(

Christophe.


 I'm OK with the execute only no scan nature of the tests.

 diff --git a/gcc/testsuite/gcc.target/aarch64/neon-intrinsics/README 
 b/gcc/testsuite/gcc.target/aarch64/neon-intrinsics/README
 new file mode 100644
 index 000..232bb1d
 --- /dev/null
 +++ b/gcc/testsuite/gcc.target/aarch64/neon-intrinsics/README
 @@ -0,0 +1,132 @@
 +This directory contains executable tests for ARM/AArch64 Neon
 +intrinsics.

 Neon - Advanced SIMD as below.

 +
 +It is meant to cover execution cases of all the Advanced SIMD
 +intrinsics, but does not scan the generated assembler code.

 +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
 +
 +typedef union {
 +  struct {

 GNUstyle { on new lne.

 +#define Neon_Cumulative_Sat  __read_neon_cumulative_sat()
 +#define Set_Neon_Cumulative_Sat(x)  __set_neon_cumulative_sat((x))

 Upper case the macro's rather than camel case.

 +# Copyright (C) 2013 Free Software Foundation, Inc.

 s/13/14/

 Cheers
 /Marcus


Re: [Patch ARM-AArch64/testsuite v2 01/21] Neon intrinsics execution tests initial framework.

2014-07-11 Thread Richard Earnshaw
On 10/07/14 11:12, Marcus Shawcroft wrote:
 On 1 July 2014 11:05, Christophe Lyon christophe.l...@linaro.org wrote:
 * documentation (README)
 * dejanu driver (neon-intrinsics.exp)
 * support macros (arm-neon-ref.h, compute-ref-data.h)
 * Tests for 3 intrinsics: vaba, vld1, vshl
 
 Hi, The terminology in armv8 is advsimd rather than neon.  Can we
 rename neon-intrinsics to advsimd-intrinsics or simd-intrinsics
 throughout please.  The existing gcc.target/aarch64/simd directory of
 tests will presumably be superseded by this more comprehensive set of
 tests so I suggest these tests go in gcc.target/aarch64/advsimd and we
 eventually remove gcc.target/aarch64/simd/ directory.
 
 GNU style should apply throughout this patch series, notably double
 space after period in comments and README text.  Space before left
 parenthesis in function/macro call and function declaration.  The
 function name in a declaration goes on a new line.  The GCC wiki notes
 on test case state individual test should have file names ending in
 _number, see here https://gcc.gnu.org/wiki/TestCaseWriting
 
 I'm OK with the execute only no scan nature of the tests.
 
 diff --git a/gcc/testsuite/gcc.target/aarch64/neon-intrinsics/README 
 b/gcc/testsuite/gcc.target/aarch64/neon-intrinsics/README
 new file mode 100644
 index 000..232bb1d
 --- /dev/null
 +++ b/gcc/testsuite/gcc.target/aarch64/neon-intrinsics/README
 @@ -0,0 +1,132 @@
 +This directory contains executable tests for ARM/AArch64 Neon
 +intrinsics.
 
 Neon - Advanced SIMD as below.

On first use, I think Advanced SIMD (Neon) is even better.

R.

 
 +
 +It is meant to cover execution cases of all the Advanced SIMD
 +intrinsics, but does not scan the generated assembler code.
 
 +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
 +
 +typedef union {
 +  struct {
 
 GNUstyle { on new lne.
 
 +#define Neon_Cumulative_Sat  __read_neon_cumulative_sat()
 +#define Set_Neon_Cumulative_Sat(x)  __set_neon_cumulative_sat((x))
 
 Upper case the macro's rather than camel case.
 
 +# Copyright (C) 2013 Free Software Foundation, Inc.
 
 s/13/14/
 
 Cheers
 /Marcus
 




Re: [Patch ARM-AArch64/testsuite v2 01/21] Neon intrinsics execution tests initial framework.

2014-07-10 Thread Marcus Shawcroft
On 1 July 2014 11:05, Christophe Lyon christophe.l...@linaro.org wrote:
 * documentation (README)
 * dejanu driver (neon-intrinsics.exp)
 * support macros (arm-neon-ref.h, compute-ref-data.h)
 * Tests for 3 intrinsics: vaba, vld1, vshl

Hi, The terminology in armv8 is advsimd rather than neon.  Can we
rename neon-intrinsics to advsimd-intrinsics or simd-intrinsics
throughout please.  The existing gcc.target/aarch64/simd directory of
tests will presumably be superseded by this more comprehensive set of
tests so I suggest these tests go in gcc.target/aarch64/advsimd and we
eventually remove gcc.target/aarch64/simd/ directory.

GNU style should apply throughout this patch series, notably double
space after period in comments and README text.  Space before left
parenthesis in function/macro call and function declaration.  The
function name in a declaration goes on a new line.  The GCC wiki notes
on test case state individual test should have file names ending in
_number, see here https://gcc.gnu.org/wiki/TestCaseWriting

I'm OK with the execute only no scan nature of the tests.

 diff --git a/gcc/testsuite/gcc.target/aarch64/neon-intrinsics/README 
 b/gcc/testsuite/gcc.target/aarch64/neon-intrinsics/README
 new file mode 100644
 index 000..232bb1d
 --- /dev/null
 +++ b/gcc/testsuite/gcc.target/aarch64/neon-intrinsics/README
 @@ -0,0 +1,132 @@
 +This directory contains executable tests for ARM/AArch64 Neon
 +intrinsics.

Neon - Advanced SIMD as below.

 +
 +It is meant to cover execution cases of all the Advanced SIMD
 +intrinsics, but does not scan the generated assembler code.

 +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
 +
 +typedef union {
 +  struct {

GNUstyle { on new lne.

 +#define Neon_Cumulative_Sat  __read_neon_cumulative_sat()
 +#define Set_Neon_Cumulative_Sat(x)  __set_neon_cumulative_sat((x))

Upper case the macro's rather than camel case.

 +# Copyright (C) 2013 Free Software Foundation, Inc.

s/13/14/

Cheers
/Marcus


[Patch ARM-AArch64/testsuite v2 01/21] Neon intrinsics execution tests initial framework.

2014-07-01 Thread Christophe Lyon
* documentation (README)
* dejanu driver (neon-intrinsics.exp)
* support macros (arm-neon-ref.h, compute-ref-data.h)
* Tests for 3 intrinsics: vaba, vld1, vshl

diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index c2ed273..3a0f99b 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,14 @@
+2014-06-30  Christophe Lyon  christophe.l...@linaro.org
+
+   * gcc.target/arm/README.neon-intrinsics: New file.
+   * gcc.target/aarch64/neon-intrinsics/README: Likewise.
+   * gcc.target/aarch64/neon-intrinsics/arm-neon-ref.h: Likewise.
+   * gcc.target/aarch64/neon-intrinsics/compute-ref-data.h: Likewise.
+   * gcc.target/aarch64/neon-intrinsics/neon-intrinsics.exp: Likewise.
+   * gcc.target/aarch64/neon-intrinsics/vaba.c: Likewise.
+   * gcc.target/aarch64/neon-intrinsics/vld1.c: Likewise.
+   * gcc.target/aarch64/neon-intrinsics/vshl.c: Likewise.
+
 2014-06-30  Igor Zamyatin  igor.zamya...@intel.com
 
PR middle-end/57541
diff --git a/gcc/testsuite/gcc.target/aarch64/neon-intrinsics/README 
b/gcc/testsuite/gcc.target/aarch64/neon-intrinsics/README
new file mode 100644
index 000..232bb1d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/neon-intrinsics/README
@@ -0,0 +1,132 @@
+This directory contains executable tests for ARM/AArch64 Neon
+intrinsics.
+
+It is meant to cover execution cases of all the Advanced SIMD
+intrinsics, but does not scan the generated assembler code.
+
+The general framework is composed as follows:
+- neon-intrinsics.exp: main dejagnu driver
+- *.c: actual tests, generally one per intrinsinc family
+- arm-neon-ref.h: contains macro definitions to save typing in actual
+  test files
+- compute-ref-data.h: contains input vectors definitions
+- *.inc: generic tests, shared by several families of intrinsics. For
+   instance, unary or binary operators
+
+A typical .c test file starts with the following contents (look at
+vld1.c and vaba.c for sample cases):
+#include arm_neon.h
+#include arm-neon-ref.h
+#include compute-ref-data.h
+
+Then, definitions of expected results, based on common input values,
+as defined in compute-ref-data.h.
+For example:
+VECT_VAR_DECL(expected,int,16,4) [] = { 0x16, 0x17, 0x18, 0x19 };
+defines the expected results of an operator generating int16x4 values.
+
+The common input values defined in compute-ref-data.h have been chosen
+to avoid corner-case values for most operators, yet exposing negative
+values for signed operators. For this reason, their range is also
+limited. For instance, the initialization of buffer_int16x4 will be
+{ -16, -15, -14, -13 }.
+
+The initialization of floating-point values is done via hex notation,
+to avoid potential rounding problems.
+
+To test special values and corner cases, specific initialization
+values should be used in dedicated tests, to ensure proper coverage.
+An example of this is vshl.
+
+When a variant of an intrinsic is not available, its expected result
+should be defined to the value of CLEAN_PATTERN_8 as defined in
+arm-neon-ref.h. For example:
+VECT_VAR_DECL(expected,int,64,1) [] = { 0x };
+if the given intrinsic has no variant producing an int64x1 result,
+like the vcmp family (eg. vclt).
+
+This is because the helper function (check_results(), defined in
+arm-neon-ref.h), iterates over all the possible variants, to save
+typing in each individual test file. Alternatively, one can directly
+call the CHECK/CHECK_FP macros to check only a few expected results
+(see vabs.c for an example).
+
+Then, define the TEST_MSG string, which will be used when reporting errors.
+
+Next, define the function performing the actual tests, in general
+relying on the helpers provided by arm-neon-ref.h, which means:
+
+* declare necessary vectors of suitable types: using
+  DECL_VARIABLE_ALL_VARIANTS when all variants are supported, or the
+  relevant of subset calls to DECL_VARIABLE.
+
+* call clean_results() to initialize the 'results' buffers.
+
+* initialize the input vectors, using VLOAD, VDUP or VSET_LANE (vld*
+  tests do not need this step, since their actual purpose is to
+  initialize vectors).
+
+* execute the intrinsic on relevant variants, for instance using
+  TEST_MACRO_ALL_VARIANTS_2_5.
+
+* call check_results() to check that the results match the expected
+  values.
+
+A template test file could be:
+=
+#include arm_neon.h
+#include arm-neon-ref.h
+#include compute-ref-data.h
+
+/* Expected results.  */
+VECT_VAR_DECL(expected,int,8,8) [] = { 0xf6, 0xf7, 0xf8, 0xf9,
+  0xfa, 0xfb, 0xfc, 0xfd };
+/* and as many others as necessary.  */
+
+#define TEST_MSG VMYINTRINSIC
+void exec_myintrinsic (void)
+{
+  /* my test: v4=vmyintrinsic(v1,v2,v3), then store the result.  */
+#define TEST_VMYINTR(Q, T1, T2, W, N)  \
+  VECT_VAR(vector_res, T1, W, N) = \
+