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 3/3] aarch64: Optimized memchr specific to AmpereComputing skylark


Yes, I missed one situation. If the next block is just the start of a new page with no access, this load will cause a segfault.

Thanks,
Feng

________________________________________
From: Richard Henderson <rth7680@gmail.com> on behalf of Richard Henderson <rth@twiddle.net>
Sent: Saturday, October 13, 2018 0:18
To: Xue Feng; libc-alpha@sourceware.org
Cc: marcus.shawcroft@linaro.org; szabolcs.nagy@arm.com; Feng Xue
Subject: Re: [PATCH 3/3] aarch64: Optimized memchr specific to AmpereComputing skylark

On 10/12/18 4:44 AM, Xue Feng wrote:
&gt; +L(loop):
&gt; +     /*
&gt; +      * Preload the next 16-byte aligned block to hide some memory
&gt; +      * access latency.
&gt; +      */
&gt; +     ldp     data1, data2, [src, 16]!

You seem to be under the mistaken impression that you are allowed to search all
cntin bytes.  However, memchr "shall behave as if it reads the characters
sequentially and stops as soon as a matching character is found."


r~
</rth@twiddle.net></rth7680@gmail.com>

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