<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Apr 3, 2014 at 4:04 AM, Stephen Canon <span dir="ltr"><<a href="mailto:scanon@apple.com" target="_blank">scanon@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On Apr 2, 2014, at 3:14 PM, Chris Lattner <<a href="mailto:clattner@apple.com">clattner@apple.com</a>> wrote:<br>

<br>
> On Apr 2, 2014, at 12:14 PM, Chris Lattner <<a href="mailto:clattner@apple.com">clattner@apple.com</a>> wrote:<br>
><br>
>> On Apr 2, 2014, at 10:27 AM, Roman Divacky <<a href="mailto:rdivacky@freebsd.org">rdivacky@freebsd.org</a>> wrote:<br>
>><br>
>>> Author: rdivacky<br>
>>> Date: Wed Apr  2 12:27:03 2014<br>
>>> New Revision: 205436<br>
>>><br>
>>> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=205436&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=205436&view=rev</a><br>
>>> Log:<br>
>>> Extend the SSE2 comment lexing to AVX2. Only 16byte align when not on AVX2.<br>
>>><br>
>>> This provides some 3% speedup when preprocessing gcc.c as a single file.<br>
>><br>
>> Nice!<br>
><br>
> I haven’t looked closely at them, but would any of the SSE 4.2 “string processing” instructions be helpful here?<br>
<br>
</div>For simply scanning for '/', SSE4.2 won't be a win; it's usually not significantly faster than PCMPEQB + PMOVMSKB in strchr-type loops.<br>
<br>
One could use it to search for "*/" instead, which would be somewhat more interesting.</blockquote><div><br></div><div>It would, alas, not be correct. There can be escaped newlines between the * and the /.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">  There's no 32B VPCMPESTRI however, so if there aren't many false-positive '/' characters in block comments (I expect this to be the case), then using AVX2 to scan for '/' should still win.<br>

<br>
– Steve<br>
<div class="HOEnZb"><div class="h5">_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</div></div></blockquote></div><br></div></div>