diff options
author | johannst <johannst@users.noreply.github.com> | 2023-12-07 23:53:44 +0000 |
---|---|---|
committer | johannst <johannst@users.noreply.github.com> | 2023-12-07 23:53:44 +0000 |
commit | d3e1eff9593501ff8677b9399e1f0625f415ec78 (patch) | |
tree | fbc8aa062fdd4ca510fae17ea515354549636f29 /src/juicebox_asm/reg.rs.html | |
parent | 2294180c3778d0fcfa877818e98c420fcd54bb8a (diff) | |
download | juicebox-asm-d3e1eff9593501ff8677b9399e1f0625f415ec78.tar.gz juicebox-asm-d3e1eff9593501ff8677b9399e1f0625f415ec78.zip |
deploy: b5aea3fb5fcce31599e3d7397d5413a934132231
Diffstat (limited to 'src/juicebox_asm/reg.rs.html')
-rw-r--r-- | src/juicebox_asm/reg.rs.html | 98 |
1 files changed, 19 insertions, 79 deletions
diff --git a/src/juicebox_asm/reg.rs.html b/src/juicebox_asm/reg.rs.html index a511005..fe4b50c 100644 --- a/src/juicebox_asm/reg.rs.html +++ b/src/juicebox_asm/reg.rs.html @@ -302,36 +302,6 @@ <a href="#302" id="302">302</a> <a href="#303" id="303">303</a> <a href="#304" id="304">304</a> -<a href="#305" id="305">305</a> -<a href="#306" id="306">306</a> -<a href="#307" id="307">307</a> -<a href="#308" id="308">308</a> -<a href="#309" id="309">309</a> -<a href="#310" id="310">310</a> -<a href="#311" id="311">311</a> -<a href="#312" id="312">312</a> -<a href="#313" id="313">313</a> -<a href="#314" id="314">314</a> -<a href="#315" id="315">315</a> -<a href="#316" id="316">316</a> -<a href="#317" id="317">317</a> -<a href="#318" id="318">318</a> -<a href="#319" id="319">319</a> -<a href="#320" id="320">320</a> -<a href="#321" id="321">321</a> -<a href="#322" id="322">322</a> -<a href="#323" id="323">323</a> -<a href="#324" id="324">324</a> -<a href="#325" id="325">325</a> -<a href="#326" id="326">326</a> -<a href="#327" id="327">327</a> -<a href="#328" id="328">328</a> -<a href="#329" id="329">329</a> -<a href="#330" id="330">330</a> -<a href="#331" id="331">331</a> -<a href="#332" id="332">332</a> -<a href="#333" id="333">333</a> -<a href="#334" id="334">334</a> </pre></div><pre class="rust"><code><span class="doccomment">//! Definition of registers which are used as input operands for various instructions. /// Trait to interact with register operands. @@ -489,27 +459,21 @@ <span class="macro">assert_eq!</span>(r.idx(), idx); <span class="comment">// Check REX.W bit. - </span><span class="macro">assert_eq!</span>(r.rexw(), <span class="bool-val">false</span>); + </span><span class="macro">assert!</span>(!r.rexw()); <span class="comment">// Check need REX byte. - </span><span class="kw">let </span>rex = <span class="kw">match </span>r { - r8l | r9l | r10l | r11l | r12l | r13l | r14l | r15l | spl | bpl | sil | dil => <span class="bool-val">true</span>, - <span class="kw">_ </span>=> <span class="bool-val">false</span>, - }; + </span><span class="kw">let </span>rex = <span class="macro">matches!</span>( + r, + r8l | r9l | r10l | r11l | r12l | r13l | r14l | r15l | spl | bpl | sil | dil + ); <span class="macro">assert_eq!</span>(r.need_rex(), rex); <span class="comment">// Check need SIB byte. - </span><span class="kw">let </span>sib = <span class="kw">match </span>r { - spl | r12l | ah => <span class="bool-val">true</span>, - <span class="kw">_ </span>=> <span class="bool-val">false</span>, - }; + </span><span class="kw">let </span>sib = <span class="macro">matches!</span>(r, spl | r12l | ah); <span class="macro">assert_eq!</span>(r.need_sib(), sib); <span class="comment">// Check if is PC relative addressing. - </span><span class="kw">let </span>rel = <span class="kw">match </span>r { - bpl | r13l | ch => <span class="bool-val">true</span>, - <span class="kw">_ </span>=> <span class="bool-val">false</span>, - }; + </span><span class="kw">let </span>rel = <span class="macro">matches!</span>(r, bpl | r13l | ch); <span class="macro">assert_eq!</span>(r.is_pc_rel(), rel); } } @@ -541,27 +505,18 @@ <span class="macro">assert_eq!</span>(r.idx(), idx); <span class="comment">// Check REX.W bit. - </span><span class="macro">assert_eq!</span>(r.rexw(), <span class="bool-val">false</span>); + </span><span class="macro">assert!</span>(!r.rexw()); <span class="comment">// Check need REX byte. - </span><span class="kw">let </span>rex = <span class="kw">match </span>r { - r8w | r9w | r10w | r11w | r12w | r13w | r14w | r15w => <span class="bool-val">true</span>, - <span class="kw">_ </span>=> <span class="bool-val">false</span>, - }; + </span><span class="kw">let </span>rex = <span class="macro">matches!</span>(r, r8w | r9w | r10w | r11w | r12w | r13w | r14w | r15w); <span class="macro">assert_eq!</span>(r.need_rex(), rex); <span class="comment">// Check need SIB byte. - </span><span class="kw">let </span>sib = <span class="kw">match </span>r { - sp | r12w => <span class="bool-val">true</span>, - <span class="kw">_ </span>=> <span class="bool-val">false</span>, - }; + </span><span class="kw">let </span>sib = <span class="macro">matches!</span>(r, sp | r12w); <span class="macro">assert_eq!</span>(r.need_sib(), sib); <span class="comment">// Check if is PC relative addressing. - </span><span class="kw">let </span>rel = <span class="kw">match </span>r { - bp | r13w => <span class="bool-val">true</span>, - <span class="kw">_ </span>=> <span class="bool-val">false</span>, - }; + </span><span class="kw">let </span>rel = <span class="macro">matches!</span>(r, bp | r13w); <span class="macro">assert_eq!</span>(r.is_pc_rel(), rel); } } @@ -593,27 +548,18 @@ <span class="macro">assert_eq!</span>(r.idx(), idx); <span class="comment">// Check REX.W bit. - </span><span class="macro">assert_eq!</span>(r.rexw(), <span class="bool-val">false</span>); + </span><span class="macro">assert!</span>(!r.rexw()); <span class="comment">// Check need REX byte. - </span><span class="kw">let </span>rex = <span class="kw">match </span>r { - r8d | r9d | r10d | r11d | r12d | r13d | r14d | r15d => <span class="bool-val">true</span>, - <span class="kw">_ </span>=> <span class="bool-val">false</span>, - }; + </span><span class="kw">let </span>rex = <span class="macro">matches!</span>(r, r8d | r9d | r10d | r11d | r12d | r13d | r14d | r15d); <span class="macro">assert_eq!</span>(r.need_rex(), rex); <span class="comment">// Check need SIB byte. - </span><span class="kw">let </span>sib = <span class="kw">match </span>r { - esp | r12d => <span class="bool-val">true</span>, - <span class="kw">_ </span>=> <span class="bool-val">false</span>, - }; + </span><span class="kw">let </span>sib = <span class="macro">matches!</span>(r, esp | r12d); <span class="macro">assert_eq!</span>(r.need_sib(), sib); <span class="comment">// Check if is PC relative addressing. - </span><span class="kw">let </span>rel = <span class="kw">match </span>r { - ebp | r13d => <span class="bool-val">true</span>, - <span class="kw">_ </span>=> <span class="bool-val">false</span>, - }; + </span><span class="kw">let </span>rel = <span class="macro">matches!</span>(r, ebp | r13d); <span class="macro">assert_eq!</span>(r.is_pc_rel(), rel); } } @@ -645,23 +591,17 @@ <span class="macro">assert_eq!</span>(r.idx(), idx); <span class="comment">// Check REX.W bit. - </span><span class="macro">assert_eq!</span>(r.rexw(), <span class="bool-val">true</span>); + </span><span class="macro">assert!</span>(r.rexw()); <span class="comment">// Check need REX byte. - </span><span class="macro">assert_eq!</span>(r.need_rex(), <span class="bool-val">true</span>); + </span><span class="macro">assert!</span>(r.need_rex()); <span class="comment">// Check need SIB byte. - </span><span class="kw">let </span>sib = <span class="kw">match </span>r { - rsp | r12 => <span class="bool-val">true</span>, - <span class="kw">_ </span>=> <span class="bool-val">false</span>, - }; + </span><span class="kw">let </span>sib = <span class="macro">matches!</span>(r, rsp | r12); <span class="macro">assert_eq!</span>(r.need_sib(), sib); <span class="comment">// Check if is PC relative addressing. - </span><span class="kw">let </span>rel = <span class="kw">match </span>r { - rbp | r13 => <span class="bool-val">true</span>, - <span class="kw">_ </span>=> <span class="bool-val">false</span>, - }; + </span><span class="kw">let </span>rel = <span class="macro">matches!</span>(r, rbp | r13); <span class="macro">assert_eq!</span>(r.is_pc_rel(), rel); } } |