[PATCH i386 7/8] [AVX-512] Add tests.

Uros Bizjak ubizjak@gmail.com
Tue Nov 19 15:23:00 GMT 2013


On Tue, Nov 19, 2013 at 11:35 AM, Kirill Yukhin <kirill.yukhin@gmail.com> 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-<insn>-1.c). Each test should aggregate all
> intrinsics that generate appropriate instruction <insn>. 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-<insn>-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.



More information about the Gcc-patches mailing list