Vector Class Discussion

Test suite for VCL? And how to submit patches
Author:  Date: 2016-06-05 11:08
Agner wrote:

Peter Cordes wrote:

is there an existing test suite?
Not a reliable one. I have a primitive test suite that somebody else has made, but it doesn't cover the necessary number of cases for data values, etc.

Can I have a copy of the test-suite? It might be easier to start with your primitive one than to start completely from scratch. I definitely need to test my changes (for SSE2, SSE4, AVX, and AVX2). (including operator >>(Vec2q) and 4q which I pushed to github yesterday)

Also, have you looked into using immediate blends (pblendw, blendps, vpblendd) instead of variable-blends with a _mm_setr mask? clang-3.8 manages to optimize that to vpblendd, but gcc loads the 32B mask from memory and uses the 2-uop pblendvb. (And constant8i<0,-1,0,-1,0,-1,0,-1>() instead of _mm_setr also defeats clang).

I'm planning to have a look at template static inline Vec4q blend4q and so on, to add detection of patterns that can use vpblendd or pblendw. However, some of the implementations of other functions use select, which isn't able to notice compile-time-constant blends. It's probably not worth it to try to change select to use gcc's __builtin_constant_p, because then we'd still have to pick apart the vector mask, which might not optimize away at compile time. Probably better to simply change other functions to use pblendw, or vpblendd when AVX2 is available.

 
thread Test suite for VCL? And how to submit patches new - Peter Cordes - 2016-05-31
replythread Test suite for VCL? And how to submit patches new - Agner - 2016-05-31
replythread Factoring out boilerplate for integer vectors new - Peter Cordes - 2016-05-31
last reply Factoring out boilerplate for integer vectors new - Agner - 2016-06-01
last reply Test suite for VCL? And how to submit patches - Peter Cordes - 2016-06-05
last replythread Test suite for VCL? And how to submit patches new - Peter Cordes - 2016-06-02
last replythread Test suite for VCL? And how to submit patches new - Agner - 2016-06-03
last reply Test suite for VCL? And how to submit patches new - Peter Cordes - 2016-06-03