This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][BZ #12100] strstr with unaligned loads.


On Thu, Sep 26, 2013 at 03:01:08PM +0400, Liubov Dmitrieva wrote:
> I can't run your tests on Haswell. It got Segmentation fault.

That was caused by avx2 implementation. I wanted to know rough
characteristic of using avx2 in loops. You could disable it by 
simply deleting variant/strstr_avx2.s file.

Or as I looked to file I missed checking that bytes are zero, following
change should suffice.

diff --git a/strstr_profile/variant/strstr_avx2.s b/strstr_profile/variant/strstr_avx2.s
index 58048aa..9bd8348 100644
--- a/strstr_profile/variant/strstr_avx2.s
+++ b/strstr_profile/variant/strstr_avx2.s
@@ -176,6 +176,7 @@
  vpor %ymm0, %ymm9,%ymm9
  vpminub %ymm9, %ymm5, %ymm0
  addq $64, %rdi
+ vpcmpeqb %ymm7, %ymm0, %ymm0
  vpmovmskb %ymm0, %eax
 
  testl %eax, %eax


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]