diff options
Diffstat (limited to 'src/juicebox_asm')
-rw-r--r-- | src/juicebox_asm/asm.rs.html | 6 | ||||
-rw-r--r-- | src/juicebox_asm/insn.rs.html | 32 | ||||
-rw-r--r-- | src/juicebox_asm/insn/add.rs.html | 4 | ||||
-rw-r--r-- | src/juicebox_asm/insn/cmovnz.rs.html | 18 | ||||
-rw-r--r-- | src/juicebox_asm/insn/cmovz.rs.html | 18 | ||||
-rw-r--r-- | src/juicebox_asm/insn/mov.rs.html | 8 | ||||
-rw-r--r-- | src/juicebox_asm/insn/test.rs.html | 4 |
7 files changed, 80 insertions, 10 deletions
diff --git a/src/juicebox_asm/asm.rs.html b/src/juicebox_asm/asm.rs.html index e58260d..4418397 100644 --- a/src/juicebox_asm/asm.rs.html +++ b/src/juicebox_asm/asm.rs.html @@ -343,6 +343,7 @@ <a href="#342" id="342">342</a> <a href="#343" id="343">343</a> <a href="#344" id="344">344</a> +<a href="#345" id="345">345</a> </pre></div><pre class="rust"><code><span class="doccomment">//! The `x64` jit assembler. </span><span class="kw">use crate</span>::<span class="kw-2">*</span>; @@ -437,7 +438,7 @@ <span class="comment">// -- Encode utilities. </span><span class="doccomment">/// Encode an register-register instruction. - </span><span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">fn </span>encode_rr<T: Reg>(<span class="kw-2">&mut </span><span class="self">self</span>, opc: u8, op1: T, op2: T) + </span><span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">fn </span>encode_rr<T: Reg>(<span class="kw-2">&mut </span><span class="self">self</span>, opc: <span class="kw-2">&</span>[u8], op1: T, op2: T) <span class="kw">where </span><span class="self">Self</span>: EncodeRR<T>, { @@ -454,7 +455,8 @@ <span class="kw">let </span>rex = <<span class="self">Self </span><span class="kw">as </span>EncodeRR<T>>::rex(op1, op2); <span class="self">self</span>.emit_optional(<span class="kw-2">&</span>[prefix, rex]); - <span class="self">self</span>.emit(<span class="kw-2">&</span>[opc, modrm]); + <span class="self">self</span>.emit(opc); + <span class="self">self</span>.emit(<span class="kw-2">&</span>[modrm]); } <span class="doccomment">/// Encode an offset-immediate instruction. diff --git a/src/juicebox_asm/insn.rs.html b/src/juicebox_asm/insn.rs.html index 7198773..029258c 100644 --- a/src/juicebox_asm/insn.rs.html +++ b/src/juicebox_asm/insn.rs.html @@ -86,10 +86,28 @@ <a href="#85" id="85">85</a> <a href="#86" id="86">86</a> <a href="#87" id="87">87</a> +<a href="#88" id="88">88</a> +<a href="#89" id="89">89</a> +<a href="#90" id="90">90</a> +<a href="#91" id="91">91</a> +<a href="#92" id="92">92</a> +<a href="#93" id="93">93</a> +<a href="#94" id="94">94</a> +<a href="#95" id="95">95</a> +<a href="#96" id="96">96</a> +<a href="#97" id="97">97</a> +<a href="#98" id="98">98</a> +<a href="#99" id="99">99</a> +<a href="#100" id="100">100</a> +<a href="#101" id="101">101</a> +<a href="#102" id="102">102</a> +<a href="#103" id="103">103</a> </pre></div><pre class="rust"><code><span class="doccomment">//! Trait definitions of various instructions. </span><span class="kw">mod </span>add; <span class="kw">mod </span>call; +<span class="kw">mod </span>cmovnz; +<span class="kw">mod </span>cmovz; <span class="kw">mod </span>cmp; <span class="kw">mod </span>dec; <span class="kw">mod </span>jmp; @@ -114,6 +132,20 @@ </span><span class="kw">fn </span>call(<span class="kw-2">&mut </span><span class="self">self</span>, op1: T); } +<span class="kw">pub trait </span>Cmovnz<T, U> { + <span class="doccomment">/// Emit a (conditional) move if not zero instruction. + /// + /// Move is only commited if (ZF=0). + </span><span class="kw">fn </span>cmovnz(<span class="kw-2">&mut </span><span class="self">self</span>, op1: T, op2: U); +} + +<span class="kw">pub trait </span>Cmovz<T, U> { + <span class="doccomment">/// Emit a (conditional) move if zero instruction. + /// + /// Move is only commited if (ZF=1). + </span><span class="kw">fn </span>cmovz(<span class="kw-2">&mut </span><span class="self">self</span>, op1: T, op2: U); +} + <span class="doccomment">/// Trait for [`cmp`](https://www.felixcloutier.com/x86/cmp) instruction kinds. </span><span class="kw">pub trait </span>Cmp<T, U> { <span class="doccomment">/// Emit a compare instruction. diff --git a/src/juicebox_asm/insn/add.rs.html b/src/juicebox_asm/insn/add.rs.html index a6ac132..6146498 100644 --- a/src/juicebox_asm/insn/add.rs.html +++ b/src/juicebox_asm/insn/add.rs.html @@ -30,13 +30,13 @@ <span class="kw">impl </span>Add<Reg64, Reg64> <span class="kw">for </span>Asm { <span class="kw">fn </span>add(<span class="kw-2">&mut </span><span class="self">self</span>, op1: Reg64, op2: Reg64) { - <span class="self">self</span>.encode_rr(<span class="number">0x01</span>, op1, op2); + <span class="self">self</span>.encode_rr(<span class="kw-2">&</span>[<span class="number">0x01</span>], op1, op2); } } <span class="kw">impl </span>Add<Reg32, Reg32> <span class="kw">for </span>Asm { <span class="kw">fn </span>add(<span class="kw-2">&mut </span><span class="self">self</span>, op1: Reg32, op2: Reg32) { - <span class="self">self</span>.encode_rr(<span class="number">0x01</span>, op1, op2); + <span class="self">self</span>.encode_rr(<span class="kw-2">&</span>[<span class="number">0x01</span>], op1, op2); } } diff --git a/src/juicebox_asm/insn/cmovnz.rs.html b/src/juicebox_asm/insn/cmovnz.rs.html new file mode 100644 index 0000000..29bfb58 --- /dev/null +++ b/src/juicebox_asm/insn/cmovnz.rs.html @@ -0,0 +1,18 @@ +<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `src/insn/cmovnz.rs`."><title>cmovnz.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../static.files/rustdoc-ac92e1bbe349e143.css"><meta name="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.76.0 (07dca489a 2024-02-04)" data-channel="1.76.0" data-search-js="search-2b6ce74ff89ae146.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../../static.files/storage-f2adc0d6ca4d09fb.js"></script><script defer src="../../../static.files/src-script-39ed315d46fb705f.js"></script><script defer src="../../../src-files.js"></script><script defer src="../../../static.files/main-305769736d49e732.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-feafe1bb7466e4bd.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><div class="sidebar-resizer"></div> + <main><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../../../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a> +<a href="#2" id="2">2</a> +<a href="#3" id="3">3</a> +<a href="#4" id="4">4</a> +<a href="#5" id="5">5</a> +<a href="#6" id="6">6</a> +<a href="#7" id="7">7</a> +<a href="#8" id="8">8</a> +</pre></div><pre class="rust"><code><span class="kw">use </span><span class="kw">super</span>::Cmovnz; +<span class="kw">use crate</span>::{Asm, Reg64}; + +<span class="kw">impl </span>Cmovnz<Reg64, Reg64> <span class="kw">for </span>Asm { + <span class="kw">fn </span>cmovnz(<span class="kw-2">&mut </span><span class="self">self</span>, op1: Reg64, op2: Reg64) { + <span class="self">self</span>.encode_rr(<span class="kw-2">&</span>[<span class="number">0x0f</span>, <span class="number">0x45</span>], op2, op1); + } +} +</code></pre></div></section></main></body></html>
\ No newline at end of file diff --git a/src/juicebox_asm/insn/cmovz.rs.html b/src/juicebox_asm/insn/cmovz.rs.html new file mode 100644 index 0000000..ecb62f1 --- /dev/null +++ b/src/juicebox_asm/insn/cmovz.rs.html @@ -0,0 +1,18 @@ +<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `src/insn/cmovz.rs`."><title>cmovz.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../static.files/rustdoc-ac92e1bbe349e143.css"><meta name="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.76.0 (07dca489a 2024-02-04)" data-channel="1.76.0" data-search-js="search-2b6ce74ff89ae146.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../../static.files/storage-f2adc0d6ca4d09fb.js"></script><script defer src="../../../static.files/src-script-39ed315d46fb705f.js"></script><script defer src="../../../src-files.js"></script><script defer src="../../../static.files/main-305769736d49e732.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-feafe1bb7466e4bd.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><div class="sidebar-resizer"></div> + <main><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../../../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a> +<a href="#2" id="2">2</a> +<a href="#3" id="3">3</a> +<a href="#4" id="4">4</a> +<a href="#5" id="5">5</a> +<a href="#6" id="6">6</a> +<a href="#7" id="7">7</a> +<a href="#8" id="8">8</a> +</pre></div><pre class="rust"><code><span class="kw">use </span><span class="kw">super</span>::Cmovz; +<span class="kw">use crate</span>::{Asm, Reg64}; + +<span class="kw">impl </span>Cmovz<Reg64, Reg64> <span class="kw">for </span>Asm { + <span class="kw">fn </span>cmovz(<span class="kw-2">&mut </span><span class="self">self</span>, op1: Reg64, op2: Reg64) { + <span class="self">self</span>.encode_rr(<span class="kw-2">&</span>[<span class="number">0x0f</span>, <span class="number">0x44</span>], op2, op1); + } +} +</code></pre></div></section></main></body></html>
\ No newline at end of file diff --git a/src/juicebox_asm/insn/mov.rs.html b/src/juicebox_asm/insn/mov.rs.html index 6d6e6e7..8f10e31 100644 --- a/src/juicebox_asm/insn/mov.rs.html +++ b/src/juicebox_asm/insn/mov.rs.html @@ -120,25 +120,25 @@ </span><span class="kw">impl </span>Mov<Reg64, Reg64> <span class="kw">for </span>Asm { <span class="kw">fn </span>mov(<span class="kw-2">&mut </span><span class="self">self</span>, op1: Reg64, op2: Reg64) { - <span class="self">self</span>.encode_rr(<span class="number">0x89</span>, op1, op2); + <span class="self">self</span>.encode_rr(<span class="kw-2">&</span>[<span class="number">0x89</span>], op1, op2); } } <span class="kw">impl </span>Mov<Reg32, Reg32> <span class="kw">for </span>Asm { <span class="kw">fn </span>mov(<span class="kw-2">&mut </span><span class="self">self</span>, op1: Reg32, op2: Reg32) { - <span class="self">self</span>.encode_rr(<span class="number">0x89</span>, op1, op2); + <span class="self">self</span>.encode_rr(<span class="kw-2">&</span>[<span class="number">0x89</span>], op1, op2); } } <span class="kw">impl </span>Mov<Reg16, Reg16> <span class="kw">for </span>Asm { <span class="kw">fn </span>mov(<span class="kw-2">&mut </span><span class="self">self</span>, op1: Reg16, op2: Reg16) { - <span class="self">self</span>.encode_rr(<span class="number">0x89</span>, op1, op2); + <span class="self">self</span>.encode_rr(<span class="kw-2">&</span>[<span class="number">0x89</span>], op1, op2); } } <span class="kw">impl </span>Mov<Reg8, Reg8> <span class="kw">for </span>Asm { <span class="kw">fn </span>mov(<span class="kw-2">&mut </span><span class="self">self</span>, op1: Reg8, op2: Reg8) { - <span class="self">self</span>.encode_rr(<span class="number">0x88</span>, op1, op2); + <span class="self">self</span>.encode_rr(<span class="kw-2">&</span>[<span class="number">0x88</span>], op1, op2); } } diff --git a/src/juicebox_asm/insn/test.rs.html b/src/juicebox_asm/insn/test.rs.html index 6a0372d..53a4e39 100644 --- a/src/juicebox_asm/insn/test.rs.html +++ b/src/juicebox_asm/insn/test.rs.html @@ -24,13 +24,13 @@ <span class="kw">impl </span>Test<Reg64, Reg64> <span class="kw">for </span>Asm { <span class="kw">fn </span>test(<span class="kw-2">&mut </span><span class="self">self</span>, op1: Reg64, op2: Reg64) { - <span class="self">self</span>.encode_rr(<span class="number">0x85</span>, op1, op2); + <span class="self">self</span>.encode_rr(<span class="kw-2">&</span>[<span class="number">0x85</span>], op1, op2); } } <span class="kw">impl </span>Test<Reg32, Reg32> <span class="kw">for </span>Asm { <span class="kw">fn </span>test(<span class="kw-2">&mut </span><span class="self">self</span>, op1: Reg32, op2: Reg32) { - <span class="self">self</span>.encode_rr(<span class="number">0x85</span>, op1, op2); + <span class="self">self</span>.encode_rr(<span class="kw-2">&</span>[<span class="number">0x85</span>], op1, op2); } } |