Skip to content

Commit

Permalink
deploy: 158e240
Browse files Browse the repository at this point in the history
  • Loading branch information
calebzulawski committed Sep 28, 2024
1 parent debc971 commit 3f79b14
Show file tree
Hide file tree
Showing 7 changed files with 175 additions and 19 deletions.
22 changes: 13 additions & 9 deletions core_simd/simd/struct.Mask.html

Large diffs are not rendered by default.

16 changes: 10 additions & 6 deletions core_simd/simd/struct.Simd.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion search-index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion search.desc/core_simd/core_simd-desc-0-.js

Large diffs are not rendered by default.

148 changes: 148 additions & 0 deletions src/core_simd/swizzle.rs.html
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,80 @@
<a href="#561" id="561">561</a>
<a href="#562" id="562">562</a>
<a href="#563" id="563">563</a>
<a href="#564" id="564">564</a>
<a href="#565" id="565">565</a>
<a href="#566" id="566">566</a>
<a href="#567" id="567">567</a>
<a href="#568" id="568">568</a>
<a href="#569" id="569">569</a>
<a href="#570" id="570">570</a>
<a href="#571" id="571">571</a>
<a href="#572" id="572">572</a>
<a href="#573" id="573">573</a>
<a href="#574" id="574">574</a>
<a href="#575" id="575">575</a>
<a href="#576" id="576">576</a>
<a href="#577" id="577">577</a>
<a href="#578" id="578">578</a>
<a href="#579" id="579">579</a>
<a href="#580" id="580">580</a>
<a href="#581" id="581">581</a>
<a href="#582" id="582">582</a>
<a href="#583" id="583">583</a>
<a href="#584" id="584">584</a>
<a href="#585" id="585">585</a>
<a href="#586" id="586">586</a>
<a href="#587" id="587">587</a>
<a href="#588" id="588">588</a>
<a href="#589" id="589">589</a>
<a href="#590" id="590">590</a>
<a href="#591" id="591">591</a>
<a href="#592" id="592">592</a>
<a href="#593" id="593">593</a>
<a href="#594" id="594">594</a>
<a href="#595" id="595">595</a>
<a href="#596" id="596">596</a>
<a href="#597" id="597">597</a>
<a href="#598" id="598">598</a>
<a href="#599" id="599">599</a>
<a href="#600" id="600">600</a>
<a href="#601" id="601">601</a>
<a href="#602" id="602">602</a>
<a href="#603" id="603">603</a>
<a href="#604" id="604">604</a>
<a href="#605" id="605">605</a>
<a href="#606" id="606">606</a>
<a href="#607" id="607">607</a>
<a href="#608" id="608">608</a>
<a href="#609" id="609">609</a>
<a href="#610" id="610">610</a>
<a href="#611" id="611">611</a>
<a href="#612" id="612">612</a>
<a href="#613" id="613">613</a>
<a href="#614" id="614">614</a>
<a href="#615" id="615">615</a>
<a href="#616" id="616">616</a>
<a href="#617" id="617">617</a>
<a href="#618" id="618">618</a>
<a href="#619" id="619">619</a>
<a href="#620" id="620">620</a>
<a href="#621" id="621">621</a>
<a href="#622" id="622">622</a>
<a href="#623" id="623">623</a>
<a href="#624" id="624">624</a>
<a href="#625" id="625">625</a>
<a href="#626" id="626">626</a>
<a href="#627" id="627">627</a>
<a href="#628" id="628">628</a>
<a href="#629" id="629">629</a>
<a href="#630" id="630">630</a>
<a href="#631" id="631">631</a>
<a href="#632" id="632">632</a>
<a href="#633" id="633">633</a>
<a href="#634" id="634">634</a>
<a href="#635" id="635">635</a>
<a href="#636" id="636">636</a>
<a href="#637" id="637">637</a>
</pre></div><pre class="rust"><code><span class="kw">use </span><span class="kw">crate</span>::simd::{LaneCount, Mask, MaskElement, Simd, SimdElement, SupportedLaneCount};

<span class="doccomment">/// Constructs a new SIMD vector by copying elements from selected elements in other vectors.
Expand Down Expand Up @@ -814,6 +888,50 @@
Rotate::&lt;OFFSET&gt;::swizzle(<span class="self">self</span>)
}

<span class="doccomment">/// Shifts the vector elements to the left by `OFFSET`, filling in with
/// `padding` from the right.
</span><span class="attr">#[inline]
#[must_use = <span class="string">"method returns a new vector and does not mutate the original inputs"</span>]
</span><span class="kw">pub fn </span>shift_elements_left&lt;<span class="kw">const </span>OFFSET: usize&gt;(<span class="self">self</span>, padding: T) -&gt; <span class="self">Self </span>{
<span class="kw">struct </span>Shift&lt;<span class="kw">const </span>OFFSET: usize&gt;;

<span class="kw">impl</span>&lt;<span class="kw">const </span>OFFSET: usize, <span class="kw">const </span>N: usize&gt; Swizzle&lt;N&gt; <span class="kw">for </span>Shift&lt;OFFSET&gt; {
<span class="kw">const </span>INDEX: [usize; N] = <span class="kw">const </span>{
<span class="kw">let </span><span class="kw-2">mut </span>index = [N; N];
<span class="kw">let </span><span class="kw-2">mut </span>i = <span class="number">0</span>;
<span class="kw">while </span>i + OFFSET &lt; N {
index[i] = i + OFFSET;
i += <span class="number">1</span>;
}
index
};
}

Shift::&lt;OFFSET&gt;::concat_swizzle(<span class="self">self</span>, Simd::splat(padding))
}

<span class="doccomment">/// Shifts the vector elements to the right by `OFFSET`, filling in with
/// `padding` from the left.
</span><span class="attr">#[inline]
#[must_use = <span class="string">"method returns a new vector and does not mutate the original inputs"</span>]
</span><span class="kw">pub fn </span>shift_elements_right&lt;<span class="kw">const </span>OFFSET: usize&gt;(<span class="self">self</span>, padding: T) -&gt; <span class="self">Self </span>{
<span class="kw">struct </span>Shift&lt;<span class="kw">const </span>OFFSET: usize&gt;;

<span class="kw">impl</span>&lt;<span class="kw">const </span>OFFSET: usize, <span class="kw">const </span>N: usize&gt; Swizzle&lt;N&gt; <span class="kw">for </span>Shift&lt;OFFSET&gt; {
<span class="kw">const </span>INDEX: [usize; N] = <span class="kw">const </span>{
<span class="kw">let </span><span class="kw-2">mut </span>index = [N; N];
<span class="kw">let </span><span class="kw-2">mut </span>i = OFFSET;
<span class="kw">while </span>i &lt; N {
index[i] = i - OFFSET;
i += <span class="number">1</span>;
}
index
};
}

Shift::&lt;OFFSET&gt;::concat_swizzle(<span class="self">self</span>, Simd::splat(padding))
}

<span class="doccomment">/// Interleave two vectors.
///
/// The resulting vectors contain elements taken alternatively from `self` and `other`, first
Expand Down Expand Up @@ -1014,6 +1132,36 @@
</span><span class="kw">unsafe </span>{ <span class="self">Self</span>::from_int_unchecked(<span class="self">self</span>.to_int().rotate_elements_right::&lt;OFFSET&gt;()) }
}

<span class="doccomment">/// Shifts the mask elements to the left by `OFFSET`, filling in with
/// `padding` from the right.
</span><span class="attr">#[inline]
#[must_use = <span class="string">"method returns a new mask and does not mutate the original inputs"</span>]
</span><span class="kw">pub fn </span>shift_elements_left&lt;<span class="kw">const </span>OFFSET: usize&gt;(<span class="self">self</span>, padding: bool) -&gt; <span class="self">Self </span>{
<span class="comment">// Safety: swizzles are safe for masks
</span><span class="kw">unsafe </span>{
<span class="self">Self</span>::from_int_unchecked(<span class="self">self</span>.to_int().shift_elements_left::&lt;OFFSET&gt;(<span class="kw">if </span>padding {
T::TRUE
} <span class="kw">else </span>{
T::FALSE
}))
}
}

<span class="doccomment">/// Shifts the mask elements to the right by `OFFSET`, filling in with
/// `padding` from the left.
</span><span class="attr">#[inline]
#[must_use = <span class="string">"method returns a new mask and does not mutate the original inputs"</span>]
</span><span class="kw">pub fn </span>shift_elements_right&lt;<span class="kw">const </span>OFFSET: usize&gt;(<span class="self">self</span>, padding: bool) -&gt; <span class="self">Self </span>{
<span class="comment">// Safety: swizzles are safe for masks
</span><span class="kw">unsafe </span>{
<span class="self">Self</span>::from_int_unchecked(<span class="self">self</span>.to_int().shift_elements_right::&lt;OFFSET&gt;(<span class="kw">if </span>padding {
T::TRUE
} <span class="kw">else </span>{
T::FALSE
}))
}
}

<span class="doccomment">/// Interleave two masks.
///
/// The resulting masks contain elements taken alternatively from `self` and `other`, first
Expand Down
2 changes: 1 addition & 1 deletion type.impl/core_simd/simd/struct.Mask.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion type.impl/core_simd/simd/struct.Simd.js

Large diffs are not rendered by default.

0 comments on commit 3f79b14

Please sign in to comment.