forked from OSchip/llvm-project
Elaborate on the entry on integer vector multiplication by constants.
llvm-svn: 51491
This commit is contained in:
parent
01b7fffb29
commit
66eea1b9b3
|
@ -814,7 +814,7 @@ define <4 x i32> @f(<4 x i32> %i) nounwind {
|
||||||
ret <4 x i32> %A
|
ret <4 x i32> %A
|
||||||
}
|
}
|
||||||
|
|
||||||
Compiles into:
|
On targets without SSE4.1, this compiles into:
|
||||||
|
|
||||||
LCPI1_0: ## <4 x i32>
|
LCPI1_0: ## <4 x i32>
|
||||||
.long 10
|
.long 10
|
||||||
|
@ -846,6 +846,11 @@ _f:
|
||||||
punpckldq %xmm2, %xmm0
|
punpckldq %xmm2, %xmm0
|
||||||
ret
|
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:
|
We compile this:
|
||||||
|
|
Loading…
Reference in New Issue