Elaborate on the entry on integer vector multiplication by constants.
authorDan Gohman <gohman@apple.com>
Fri, 23 May 2008 18:05:39 +0000 (18:05 +0000)
committerDan Gohman <gohman@apple.com>
Fri, 23 May 2008 18:05:39 +0000 (18:05 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51491 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/README-SSE.txt

index 7269fa2964583579690203add2888b45ad55967f..1f5f2037cee3375ff6ff332544cf5d30e23cd265 100644 (file)
@@ -814,7 +814,7 @@ define <4 x i32> @f(<4 x i32> %i) nounwind  {
        ret <4 x i32> %A
 }
 
-Compiles into:
+On targets without SSE4.1, this compiles into:
 
 LCPI1_0:                                       ##  <4 x i32>
        .long   10
@@ -846,6 +846,11 @@ _f:
        punpckldq       %xmm2, %xmm0
        ret
 
+It would be better to synthesize integer vector multiplication by constants
+using shifts and adds, pslld and paddd here. And even on targets with SSE4.1,
+simple cases such as multiplication by powers of two would be better as
+vector shifts than as multiplications.
+
 //===---------------------------------------------------------------------===//
 
 We compile this: