[PATCH][X86] Factor out new helper getPSHUFB

Adam Nemet anemet at apple.com
Mon Mar 24 22:52:57 PDT 2014

I found three implementations of this.  This splits it out into a new function
and uses it from the three places.

My plan is to add a fourth use when lowering a vector_shuffle:v16i16.

Compared the assembly output of test/CodeGen/X86 before and after.

The only change is due to how the first PSHUFB was generated in
LowerVECTOR_SHUFFLEv8i16.  If the shuffle mask specified undef (i.e. -1), the
old implementation would write -1 * 2 and -1 * 2 + 1 (254 and 255) in the
control mask.  Now we write 0x80.  These are of course interchangeable since
bit 7 decides if a constant zero is written in the result byte.  The other
instances of this code used 0x80 consistently.

Related to <rdar://problem/16167303>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: X86-Factor-out-new-helper-getPSHUFB.patch
Type: application/octet-stream
Size: 6564 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140324/76d96811/attachment.obj>

More information about the llvm-commits mailing list