]> Cypherpunks repositories - gostls13.git/commit
strings: use SSE4.2 in strings.Index on AMD64
authorIlya Tocar <ilya.tocar@intel.com>
Thu, 21 Apr 2016 15:24:12 +0000 (18:24 +0300)
committerIlya Tocar <ilya.tocar@intel.com>
Tue, 26 Apr 2016 10:14:26 +0000 (10:14 +0000)
commit6b02a1924725688b4d264065454ac5287fbed535
treea875cf2fb09770288dfb633c941f19e59aa9fcc6
parentd78c84c419b0ecdd70e85aad22951798c1707f50
strings: use SSE4.2 in strings.Index on AMD64

Use PCMPESTRI instruction if available.

Index-4              21.1ns ± 0%  21.1ns ± 0%     ~     (all samples are equal)
IndexHard1-4          395µs ± 0%   105µs ± 0%  -73.53%        (p=0.000 n=19+20)
IndexHard2-4          300µs ± 0%   147µs ± 0%  -51.11%        (p=0.000 n=19+20)
IndexHard3-4          665µs ± 0%   665µs ± 0%     ~           (p=0.942 n=16+19)

Change-Id: I4f66794164740a2b939eb1c78934e2390b489064
Reviewed-on: https://go-review.googlesource.com/22337
Run-TryBot: Ilya Tocar <ilya.tocar@intel.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
src/cmd/internal/obj/x86/a.out.go
src/cmd/internal/obj/x86/anames.go
src/cmd/internal/obj/x86/asm6.go
src/runtime/asm_amd64.s