[x86] Replace builtins with vector extensions

Marc Glisse marc.glisse@inria.fr
Fri Oct 17 20:41:00 GMT 2014


On Fri, 17 Oct 2014, Uros Bizjak wrote:

> While looking correct, I am a bit nervous about avx512fintrin.h
> changes, mainly because I have not much experience with these
> patterns. I have adder Kirill to CC for possible comments.

He asked for this part of the patch, and tested it:
https://gcc.gnu.org/ml/gcc-patches/2014-07/msg01954.html

> I don't have many comments on simple arithmetic, and changes look
> "trivial". I'd say that simple arithmetic part is OK for branch.

Thanks. I am testing the updated patch tonight and I'll commit. I am 
planning on making a branch: ^/branches/x86-intrinsics-ext if noone 
complains about the name.

> One last note: scalar builtins preserve highpart of target register.
> IIRC, I have tried to convert _mm_frcz_s{s,d} to use scalars, but
> resulted in a horrible code. Current approach uses
> __builtin_ia32_movs{s,d} to generate optimal code, but I didn't test
> if current gcc improved in this part.

Operations that act on only part of a vector do tend to go badly indeed. I 
remember working on something related at some point (the goal was to 
handle v[0]+=2):

https://gcc.gnu.org/ml/gcc-patches/2012-12/msg00824.html

I don't remember exactly why I gave up on this. It may be a different 
issue from yours with frcz, but I kept the impression from then that 
builtins were still the way to go for anything non-trivial.

-- 
Marc Glisse



More information about the Gcc-patches mailing list