Re: [PATCH i386 7/8] [AVX-512] Add tests.
Hello, On 18 Dec 17:08, Uros Bizjak wrote: > Whoa. > > --- a/gcc/config/i386/sse.md > +++ b/gcc/config/i386/sse.md > > No, not in this patch. Okay, moved it to 5/8 patch. -- Thanks, K
Re: [PATCH i386 7/8] [AVX-512] Add tests.
On Wed, Dec 18, 2013 at 2:23 PM, Kirill Yukhin wrote: > Hello, > On 02 Dec 16:18, Kirill Yukhin wrote: >> Hello, >> > Is it ok now? >> Ping? > Ping. > > Rebased patch attached. Whoa. --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md No, not in this patch. +/* { dg-do run } */ +/* { dg-options "-O2 -mavx512cd -DHAVE_512 -DAVX512CD" } */ +/* { dg-require-effective-target avx512cd } */ + +#include "avx512f-helper.h" Please put the definitions in the source itself, not in command line. + if ((ecx & bit_OSXSAVE) == (bit_OSXSAVE)) +{ + if (__get_cpuid_max (0, NULL) < 7) +return 0; + + __cpuid_count (7, 0, eax, ebx, ecx, edx); + + if ((avx512f_os_support ()) && ((ebx & (bit_AVX512ER)) == (bit_AVX512ER))) No need for parenthesis around bit_* constants. They alredy have needed parenthesis in cpuid.h. +++ b/gcc/testsuite/gcc.target/i386/avx512f-vgetmantps-2.c @@ -0,0 +1,110 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -mavx512f -DAVX512F" } */ +/* { dg-require-effective-target avx512f } */ + +#include "avx512f-helper.h" + +#define SIZE (AVX512F_LEN / 32) +#include "avx512f-mask-type.h" +#include + +#ifndef GET_NORM_MANT +#define GET_NORM_MANT +float +get_norm_mant (float source, int signctrl, int interv) +{ + int dest, src, sign, exp, fraction; + src = *(int *) &source; Strict aliasing violation. + dest = (sign << 31) | (exp << 23) | fraction; + return *(float *) &dest; also here. I wonder, why you didn't get: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] src = *(int *) &source; warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] return *(float *) &dest; Can you please review testcases for aliasing violations (you can check the new tests with -Wstrict-aliasing warning enabled) The patch is otherwise OK for mainline, on the (obvious) condition that other patches get approved and committed first. Thanks, Uros.
Re: [PATCH i386 7/8] [AVX-512] Add tests.
Hello, > Is it ok now? Ping? -- Thanks, K
Re: [PATCH i386 7/8] [AVX-512] Add tests.
On Tue, Nov 19, 2013 at 11:35 AM, Kirill Yukhin wrote: > Here is a patch that introduces tests for AVX-512 instructions. > > While implementing testsuite we were strongly connected to the fact that we > don't want more then 2 test files per each instruction - a scan assembler test > and a runtime test. > > Consider that in general case for most new instuctions we have a simple > intrinsic, an intrinsic with merge masking and an intrinsic with zero masking > - > and we need to have scan tests and runtimes test for them all. Also, there may > be rounding support, i.e. an intrinsic with rounding. For this case we only > have scan tests and do not have runtime tests because it's unclear how to > implement a runtime test in this case. > > Firstly, scan tests (avx512f--1.c). Each test should aggregate all > intrinsics that generate appropriate instruction . I.e. simple > intrinsic, > merge masking, zero masking, rounding intrinsics and maybe some aliases that > worth testing. Tests are written in exactly the same manner as AVX2 scan > tests. > See avx2-*-1.c for reference. > > Secondly, runtime tests (avx512f--2.c). Basically, the approach was the > same for AVX2 runtime tests - call an intrinsic with some pre-initialized > source > and destination and check if results meet expectation - except that we have > 3-4 > intrinsics with the same semantics. To avoid lots of duplicate code, we use > macros in runtime tests. Macros are defined in avx512f-helper.h, and every > runtime test includes this file. Also, avx512f-helper.h contains definition of > core testing function - avx512f_test. Note that some macros are defined in > dg-options. This machinery may seem redundand for now, but it will be > extremely > useful for future extensions. There're also some stand-alone AVX512F runtime > tests that are implemented without our macros machinery just like AVX2 tests. > > Finally, we have updated avx-1.c, sse-*.c, testimm-*.c tests with new > intrinsics > and builtins. To check messaging for intrinsics with rouning, we have added > testround-*.c tests. Please also add new options to g++.dg/other/i386-{2,3}.C. They check if x86intrin.h additions can be compiled under c++. Uros.