image/vector: add runtime check for SSE4.1

The PSHUFB instruction is also used by the floating-point
implementation, not just the fixed-point one.

Fixes golang/go#32835

Change-Id: I21f204319b28b664c862a7e3d938ba9366c74116
Reviewed-on: https://go-review.googlesource.com/c/image/+/184898
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Nigel Tao 2019-07-03 17:13:20 +10:00 коммит произвёл Bryan C. Mills
Родитель 7e034cad64
Коммит d6a02ce849
2 изменённых файлов: 8 добавлений и 5 удалений

Просмотреть файл

@ -10,9 +10,10 @@ package vector
func haveSSE4_1() bool
var haveFixedAccumulateSIMD = haveSSE4_1()
const haveFloatingAccumulateSIMD = true
var (
haveFixedAccumulateSIMD = haveSSE4_1()
haveFloatingAccumulateSIMD = haveSSE4_1()
)
//go:noescape
func fixedAccumulateOpOverSIMD(dst []uint8, src []uint32)

Просмотреть файл

@ -6,8 +6,10 @@
package vector
const haveFixedAccumulateSIMD = false
const haveFloatingAccumulateSIMD = false
const (
haveFixedAccumulateSIMD = false
haveFloatingAccumulateSIMD = false
)
func fixedAccumulateOpOverSIMD(dst []uint8, src []uint32) {}
func fixedAccumulateOpSrcSIMD(dst []uint8, src []uint32) {}