aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/juicebox_asm/imm.rs.html
diff options
context:
space:
mode:
Diffstat (limited to 'src/juicebox_asm/imm.rs.html')
-rw-r--r--src/juicebox_asm/imm.rs.html44
1 files changed, 37 insertions, 7 deletions
diff --git a/src/juicebox_asm/imm.rs.html b/src/juicebox_asm/imm.rs.html
index 0990c92..0a9933e 100644
--- a/src/juicebox_asm/imm.rs.html
+++ b/src/juicebox_asm/imm.rs.html
@@ -33,15 +33,33 @@
<a href="#33" id="33">33</a>
<a href="#34" id="34">34</a>
<a href="#35" id="35">35</a>
-</pre><pre class="rust"><code><span class="doccomment">/// Trait to interact with immediate operands.
+<a href="#36" id="36">36</a>
+<a href="#37" id="37">37</a>
+<a href="#38" id="38">38</a>
+<a href="#39" id="39">39</a>
+<a href="#40" id="40">40</a>
+<a href="#41" id="41">41</a>
+<a href="#42" id="42">42</a>
+<a href="#43" id="43">43</a>
+<a href="#44" id="44">44</a>
+<a href="#45" id="45">45</a>
+<a href="#46" id="46">46</a>
+<a href="#47" id="47">47</a>
+<a href="#48" id="48">48</a>
+<a href="#49" id="49">49</a>
+<a href="#50" id="50">50</a>
+</pre><pre class="rust"><code><span class="doccomment">//! Definition of different immediate types which are used as input operands for various
+//! instructions.
+
+/// Trait to interact with immediate operands.
</span><span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">trait </span>Imm {
<span class="doccomment">/// Get immediate operand as slice of bytes.
</span><span class="kw">fn </span>bytes(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; <span class="kw-2">&amp;</span>[u8];
}
<span class="macro">macro_rules! </span>impl_imm {
- (<span class="macro-nonterminal">$name</span>:ident, <span class="macro-nonterminal">$size</span>:expr, from: $( <span class="macro-nonterminal">$from</span>:ty ),* $(,)<span class="question-mark">?</span>) =&gt; {
- <span class="doccomment">/// Immediate operand.
+ (<span class="attr">#[<span class="macro-nonterminal">$doc</span>:meta] </span><span class="macro-nonterminal">$name</span>:ident, <span class="macro-nonterminal">$size</span>:expr, from: { $( <span class="macro-nonterminal">$from</span>:ty ),* $(,)<span class="question-mark">? </span>}) =&gt; {
+ <span class="attr">#[<span class="macro-nonterminal">$doc</span>]
</span><span class="kw">pub struct </span><span class="macro-nonterminal">$name</span>([u8; <span class="macro-nonterminal">$size</span>]);
<span class="kw">impl </span>Imm <span class="kw">for </span><span class="macro-nonterminal">$name </span>{
@@ -64,9 +82,21 @@
}
}
-<span class="macro">impl_imm!</span>(Imm8, <span class="number">1</span>, from: u8, i8);
-<span class="macro">impl_imm!</span>(Imm16, <span class="number">2</span>, from: u16, i16, u8, i8);
-<span class="macro">impl_imm!</span>(Imm32, <span class="number">4</span>, from: u32, i32, u16, i16, u8, i8);
-<span class="macro">impl_imm!</span>(Imm64, <span class="number">8</span>, from: u64, i64, u32, i32, u16, i16, u8, i8);
+<span class="macro">impl_imm!</span>(
+ <span class="doccomment">/// Type representing an 8 bit immediate.
+ </span>Imm8, <span class="number">1</span>, from: { u8, i8 }
+);
+<span class="macro">impl_imm!</span>(
+ <span class="doccomment">/// Type representing a 16 bit immediate.
+ </span>Imm16, <span class="number">2</span>, from: { u16, i16, u8, i8 }
+);
+<span class="macro">impl_imm!</span>(
+ <span class="doccomment">/// Type representing a 32 bit immediate.
+ </span>Imm32, <span class="number">4</span>, from: { u32, i32, u16, i16, u8, i8 }
+);
+<span class="macro">impl_imm!</span>(
+ <span class="doccomment">/// Type representing a 64 bit immediate.
+ </span>Imm64, <span class="number">8</span>, from: { u64, i64, u32, i32, u16, i16, u8, i8 }
+);
</code></pre></div>
</section></div></main><div id="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="juicebox_asm" data-themes="" data-resource-suffix="" data-rustdoc-version="1.67.1 (d5a82bbd2 2023-02-07)" data-search-js="search-444266647c4dba98.js" data-settings-js="settings-bebeae96e00e4617.js" data-settings-css="settings-af96d9e2fc13e081.css" ></div></body></html> \ No newline at end of file