[llvm-commits] [llvm] r111813 - /llvm/trunk/lib/Target/X86/README-SSE.txt

Chris Lattner sabre at nondot.org
Mon Aug 23 10:30:29 PDT 2010


Author: lattner
Date: Mon Aug 23 12:30:29 2010
New Revision: 111813

URL: http://llvm.org/viewvc/llvm-project?rev=111813&view=rev
Log:
random improvement for variable shift codegen.

Modified:
    llvm/trunk/lib/Target/X86/README-SSE.txt

Modified: llvm/trunk/lib/Target/X86/README-SSE.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/README-SSE.txt?rev=111813&r1=111812&r2=111813&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/README-SSE.txt (original)
+++ llvm/trunk/lib/Target/X86/README-SSE.txt Mon Aug 23 12:30:29 2010
@@ -2,8 +2,20 @@
 // Random ideas for the X86 backend: SSE-specific stuff.
 //===---------------------------------------------------------------------===//
 
-- Consider eliminating the unaligned SSE load intrinsics, replacing them with
-  unaligned LLVM load instructions.
+//===---------------------------------------------------------------------===//
+
+SSE Variable shift can be custom lowered to something like this, which uses a
+small table + unaligned load + shuffle instead of going through memory.
+
+__m128i_shift_right:
+	.byte	  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15
+	.byte	 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
+
+...
+__m128i shift_right(__m128i value, unsigned long offset) {
+  return _mm_shuffle_epi8(value,
+               _mm_loadu_si128((__m128 *) (___m128i_shift_right + offset)));
+}
 
 //===---------------------------------------------------------------------===//
 





More information about the llvm-commits mailing list