This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH][BZ #12100] strstr with unaligned loads.
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: Liubov Dmitrieva <liubov dot dmitrieva at gmail dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Thu, 26 Sep 2013 14:35:34 +0200
- Subject: Re: [PATCH][BZ #12100] strstr with unaligned loads.
- Authentication-results: sourceware.org; auth=none
- References: <20130825090758 dot GA23686 at domone dot kolej dot mff dot cuni dot cz> <20130923183149 dot GB11240 at domone dot podge> <CAHjhQ917c-+1Y8wg=GZujB28RE6rm6RXRL74e5X7Mw=UcRc-AA at mail dot gmail dot com> <CAHjhQ93N2wwcMJFpJa-jTGbymTRkiBZKrNO-Zjs7oYeFs5v=Og at mail dot gmail dot com> <20130925133907 dot GA24924 at domone dot podge> <CAHjhQ915AbEGizEsbQxGOk1XbU3Y7-ME5rxVqdpDW1PJXXpVbw at mail dot gmail dot com>
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