<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://vegard.wiki/mediawiki/index.php?action=history&amp;feed=atom&amp;title=SSE_routines</id>
	<title>SSE routines - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://vegard.wiki/mediawiki/index.php?action=history&amp;feed=atom&amp;title=SSE_routines"/>
	<link rel="alternate" type="text/html" href="http://vegard.wiki/mediawiki/index.php?title=SSE_routines&amp;action=history"/>
	<updated>2026-07-04T14:43:05Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>http://vegard.wiki/mediawiki/index.php?title=SSE_routines&amp;diff=339&amp;oldid=prev</id>
		<title>Vegard: add link from saidwho12</title>
		<link rel="alternate" type="text/html" href="http://vegard.wiki/mediawiki/index.php?title=SSE_routines&amp;diff=339&amp;oldid=prev"/>
		<updated>2022-11-22T08:54:26Z</updated>

		<summary type="html">&lt;p&gt;add link from saidwho12&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 08:54, 22 November 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 64:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 64:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* https://software.intel.com/sites/landingpage/IntrinsicsGuide/&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* https://software.intel.com/sites/landingpage/IntrinsicsGuide/&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* https://woboq.com/blog/utf-8-processing-using-simd.html&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Programming]]&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Programming]]&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;!-- diff cache key mediawiki:diff:1.41:old-48:rev-339:wikidiff2=table:1.13.0:bc2a06be --&gt;
&lt;/table&gt;</summary>
		<author><name>Vegard</name></author>
	</entry>
	<entry>
		<id>http://vegard.wiki/mediawiki/index.php?title=SSE_routines&amp;diff=48&amp;oldid=prev</id>
		<title>Vegard at 22:33, 14 December 2019</title>
		<link rel="alternate" type="text/html" href="http://vegard.wiki/mediawiki/index.php?title=SSE_routines&amp;diff=48&amp;oldid=prev"/>
		<updated>2019-12-14T22:33:12Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 22:33, 14 December 2019&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 68:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 68:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:C]]&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:C]]&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:C++]]&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:C++]]&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:x86]]&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;!-- diff cache key mediawiki:diff:1.41:old-35:rev-48:wikidiff2=table:1.13.0:bc2a06be --&gt;
&lt;/table&gt;</summary>
		<author><name>Vegard</name></author>
	</entry>
	<entry>
		<id>http://vegard.wiki/mediawiki/index.php?title=SSE_routines&amp;diff=35&amp;oldid=prev</id>
		<title>Vegard: new page</title>
		<link rel="alternate" type="text/html" href="http://vegard.wiki/mediawiki/index.php?title=SSE_routines&amp;diff=35&amp;oldid=prev"/>
		<updated>2019-12-14T19:23:28Z</updated>

		<summary type="html">&lt;p&gt;new page&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=== Boilerplate ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;C&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;emmintrin.h&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Get length of string prefix consisting of letters and underscore ===&lt;br /&gt;
&lt;br /&gt;
This can be useful for e.g. parsing identifiers.&lt;br /&gt;
&lt;br /&gt;
The string does not need to be aligned, but beware that up to 15 bytes after the NUL terminator may be loaded from memory, so if these cross a page boundary you can get spurious page faults.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;C&amp;quot;&amp;gt;&lt;br /&gt;
int nr_alpha(const char *s)&lt;br /&gt;
{&lt;br /&gt;
    const char *start = s;&lt;br /&gt;
    &lt;br /&gt;
    __m128i ch_A = _mm_set1_epi8(&amp;#039;A&amp;#039; - 1);&lt;br /&gt;
    __m128i ch_Z = _mm_set1_epi8(&amp;#039;Z&amp;#039;);&lt;br /&gt;
    __m128i ch_underscore = _mm_set1_epi8(&amp;#039;_&amp;#039;);&lt;br /&gt;
&lt;br /&gt;
    while (1) {&lt;br /&gt;
        __m128i ch = _mm_loadu_si128((__m128i *) s);&lt;br /&gt;
        __m128i b = _mm_and_si128(ch, _mm_set1_epi8(~0x20));&lt;br /&gt;
        b = _mm_or_si128(_mm_and_si128(_mm_cmpgt_epi8(b, ch_A),&lt;br /&gt;
                                       _mm_cmplt_epi8(b, ch_Z)),&lt;br /&gt;
                         _mm_cmpeq_epi8(ch, ch_underscore));&lt;br /&gt;
&lt;br /&gt;
        unsigned int ffs = __builtin_ffs(~_mm_movemask_epi8(b)) - 1;&lt;br /&gt;
        s += ffs;&lt;br /&gt;
&lt;br /&gt;
        if (ffs &amp;lt; 16)&lt;br /&gt;
            return s - start;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Get length of string prefix consisting of whitespace ===&lt;br /&gt;
&lt;br /&gt;
(See caveats above.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;C&amp;quot;&amp;gt;&lt;br /&gt;
int nr_whitespace(const char *s)&lt;br /&gt;
{&lt;br /&gt;
    const char *start = s;&lt;br /&gt;
&lt;br /&gt;
    while (1) {&lt;br /&gt;
        __m128i ch = _mm_loadu_si128((__m128i *) s);&lt;br /&gt;
        __m128i b = _mm_or_si128(_mm_cmpeq_epi8(ch, _mm_set1_epi8(&amp;#039; &amp;#039;)),&lt;br /&gt;
                                 _mm_cmpeq_epi8(ch, _mm_set1_epi8(&amp;#039;\t&amp;#039;)));&lt;br /&gt;
        b = _mm_or_si128(b, _mm_cmpeq_epi8(ch, _mm_set1_epi8(&amp;#039;\r&amp;#039;)));&lt;br /&gt;
        b = _mm_or_si128(b, _mm_cmpeq_epi8(ch, _mm_set1_epi8(&amp;#039;\n&amp;#039;)));&lt;br /&gt;
&lt;br /&gt;
        unsigned int ffs = __builtin_ffs(~_mm_movemask_epi8(b)) - 1;&lt;br /&gt;
        s += ffs;&lt;br /&gt;
&lt;br /&gt;
        if (ffs &amp;lt; 16)&lt;br /&gt;
            return s - start;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* https://software.intel.com/sites/landingpage/IntrinsicsGuide/&lt;br /&gt;
&lt;br /&gt;
[[Category:Programming]]&lt;br /&gt;
[[Category:C]]&lt;br /&gt;
[[Category:C++]]&lt;/div&gt;</summary>
		<author><name>Vegard</name></author>
	</entry>
</feed>