[PATCH] X86 Builtins: rewrite SSE2/AVX2 shift builtin intrinsics using shift operators

Andrea_DiBiagio at sn.scee.net Andrea_DiBiagio at sn.scee.net
Wed Jul 17 10:44:39 PDT 2013


Hi all,

I'd like to contribute a patch that rewrites (most of the) X86 
SSE2/AVX2 packed shifts builtin intrinsics using shift operators.

With this patch, SSE2/AVX2 shifts builtins no longer call the underlying
GCCBuiltin function.
The main advantage is that SSE2/AVX2 shifts become "visible" to the 
instruction
combiner and any x86 target specific combine rules which provide 
simplification
at early stages.
For example, the instruction combiner would be able fold SSE2/AVX2 
shift-by-1
into add to self and shift-by-0 into the first operand of the shift, etc.

This patch rewrites all the SSE2/AVX2 shift by immediate count.
It also rewrites all the quadword logical shifts by non-immediate count.

I avoided rewriting SSE2/AVX2 word/doubleword logical shifts by 
non-immediate count since I noticed that they tend to generate poor 
quality 
code at -O0.

I added a couple of new test files for sse2 and avx2 shifts.
Please let me know what do you think.



Thanks,
Andrea Di Biagio
SN Systems - Sony Computer Entertainment Group

**********************************************************************
This email and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to whom they are addressed. 
If you have received this email in error please notify postmaster at scee.net
This footnote also confirms that this email message has been checked for 
all known viruses.
Sony Computer Entertainment Europe Limited
Registered Office: 10 Great Marlborough Street, London W1F 7LP, United 
Kingdom
Registered in England: 3277793
**********************************************************************

P Please consider the environment before printing this e-mail
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-x86-builtins.diff
Type: application/octet-stream
Size: 23355 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130717/a9233845/attachment.obj>


More information about the cfe-commits mailing list