From 52a0308e18fbbec25f0e9f31ec8f11589a35f351 Mon Sep 17 00:00:00 2001 From: johannst Date: Mon, 18 Mar 2024 22:02:54 +0000 Subject: deploy: 7653ced7e8ce18b9ada2b666c63832007f8becf2 --- juicebox_asm/all.html | 2 +- juicebox_asm/enum.Reg64.html | 4 ++-- juicebox_asm/insn/index.html | 4 ++-- juicebox_asm/insn/sidebar-items.js | 2 +- juicebox_asm/insn/trait.Add.html | 4 ++-- juicebox_asm/insn/trait.Call.html | 4 ++-- juicebox_asm/insn/trait.Cmovnz.html | 7 ++++++ juicebox_asm/insn/trait.Cmovz.html | 7 ++++++ juicebox_asm/insn/trait.Cmp.html | 4 ++-- juicebox_asm/insn/trait.Dec.html | 4 ++-- juicebox_asm/insn/trait.Jmp.html | 4 ++-- juicebox_asm/insn/trait.Jnz.html | 4 ++-- juicebox_asm/insn/trait.Jz.html | 4 ++-- juicebox_asm/insn/trait.Mov.html | 4 ++-- juicebox_asm/insn/trait.Pop.html | 4 ++-- juicebox_asm/insn/trait.Push.html | 4 ++-- juicebox_asm/insn/trait.Test.html | 4 ++-- juicebox_asm/struct.Asm.html | 6 +++--- search-index.js | 2 +- src-files.js | 2 +- src/juicebox_asm/asm.rs.html | 6 ++++-- src/juicebox_asm/insn.rs.html | 32 ++++++++++++++++++++++++++++ src/juicebox_asm/insn/add.rs.html | 4 ++-- src/juicebox_asm/insn/cmovnz.rs.html | 18 ++++++++++++++++ src/juicebox_asm/insn/cmovz.rs.html | 18 ++++++++++++++++ src/juicebox_asm/insn/mov.rs.html | 8 +++---- src/juicebox_asm/insn/test.rs.html | 4 ++-- src/tiny_vm/tiny_vm.rs.html | 14 ++++++------ trait.impl/juicebox_asm/insn/trait.Cmovnz.js | 3 +++ trait.impl/juicebox_asm/insn/trait.Cmovz.js | 3 +++ 30 files changed, 140 insertions(+), 50 deletions(-) create mode 100644 juicebox_asm/insn/trait.Cmovnz.html create mode 100644 juicebox_asm/insn/trait.Cmovz.html create mode 100644 src/juicebox_asm/insn/cmovnz.rs.html create mode 100644 src/juicebox_asm/insn/cmovz.rs.html create mode 100644 trait.impl/juicebox_asm/insn/trait.Cmovnz.js create mode 100644 trait.impl/juicebox_asm/insn/trait.Cmovz.js diff --git a/juicebox_asm/all.html b/juicebox_asm/all.html index 93155c0..34a7139 100644 --- a/juicebox_asm/all.html +++ b/juicebox_asm/all.html @@ -1,2 +1,2 @@ List of all items in this crate -
\ No newline at end of file +
\ No newline at end of file diff --git a/juicebox_asm/enum.Reg64.html b/juicebox_asm/enum.Reg64.html index faef682..764b191 100644 --- a/juicebox_asm/enum.Reg64.html +++ b/juicebox_asm/enum.Reg64.html @@ -1,4 +1,4 @@ -Reg64 in juicebox_asm - Rust +Reg64 in juicebox_asm - Rust

Enum juicebox_asm::Reg64

source ·
#[repr(u8)]
pub enum Reg64 {
Show 16 variants rax = 0, rcx = 1, @@ -17,7 +17,7 @@ r14 = 14, r15 = 15,
}
Expand description

Definition of 64 bit registers.

-

Variants§

§

rax = 0

§

rcx = 1

§

rdx = 2

§

rbx = 3

§

rsp = 4

§

rbp = 5

§

rsi = 6

§

rdi = 7

§

r8 = 8

§

r9 = 9

§

r10 = 10

§

r11 = 11

§

r12 = 12

§

r13 = 13

§

r14 = 14

§

r15 = 15

Trait Implementations§

source§

impl Add<Reg64, Reg64> for Asm

source§

fn add(&mut self, op1: Reg64, op2: Reg64)

Emit an add instruction.
source§

impl Call<Reg64> for Asm

source§

fn call(&mut self, op1: Reg64)

Emit a call instruction.
source§

impl Clone for Reg64

source§

fn clone(&self) -> Reg64

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Dec<Reg64> for Asm

source§

fn dec(&mut self, op1: Reg64)

Emit a decrement instruction.
source§

impl Mov<MemOp, Reg64> for Asm

source§

fn mov(&mut self, op1: MemOp, op2: Reg64)

Emit an move instruction.
source§

impl Mov<Reg64, Imm64> for Asm

source§

fn mov(&mut self, op1: Reg64, op2: Imm64)

Emit an move instruction.
source§

impl Mov<Reg64, MemOp> for Asm

source§

fn mov(&mut self, op1: Reg64, op2: MemOp)

Emit an move instruction.
source§

impl Mov<Reg64, Reg64> for Asm

source§

fn mov(&mut self, op1: Reg64, op2: Reg64)

Emit an move instruction.
source§

impl Pop<Reg64> for Asm

source§

fn pop(&mut self, op1: Reg64)

Emit a pop instruction.
source§

impl Push<Reg64> for Asm

source§

fn push(&mut self, op1: Reg64)

Emit a push instruction.
source§

impl Test<Reg64, Reg64> for Asm

source§

fn test(&mut self, op1: Reg64, op2: Reg64)

Emit a logical compare instruction. Read more
source§

impl Copy for Reg64

Auto Trait Implementations§

§

impl RefUnwindSafe for Reg64

§

impl Send for Reg64

§

impl Sync for Reg64

§

impl Unpin for Reg64

§

impl UnwindSafe for Reg64

Blanket Implementations§

source§

impl<T> Any for T
where +

Variants§

§

rax = 0

§

rcx = 1

§

rdx = 2

§

rbx = 3

§

rsp = 4

§

rbp = 5

§

rsi = 6

§

rdi = 7

§

r8 = 8

§

r9 = 9

§

r10 = 10

§

r11 = 11

§

r12 = 12

§

r13 = 13

§

r14 = 14

§

r15 = 15

Trait Implementations§

source§

impl Add<Reg64, Reg64> for Asm

source§

fn add(&mut self, op1: Reg64, op2: Reg64)

Emit an add instruction.
source§

impl Call<Reg64> for Asm

source§

fn call(&mut self, op1: Reg64)

Emit a call instruction.
source§

impl Clone for Reg64

source§

fn clone(&self) -> Reg64

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Cmovnz<Reg64, Reg64> for Asm

source§

fn cmovnz(&mut self, op1: Reg64, op2: Reg64)

Emit a (conditional) move if not zero instruction. Read more
source§

impl Cmovz<Reg64, Reg64> for Asm

source§

fn cmovz(&mut self, op1: Reg64, op2: Reg64)

Emit a (conditional) move if zero instruction. Read more
source§

impl Dec<Reg64> for Asm

source§

fn dec(&mut self, op1: Reg64)

Emit a decrement instruction.
source§

impl Mov<MemOp, Reg64> for Asm

source§

fn mov(&mut self, op1: MemOp, op2: Reg64)

Emit an move instruction.
source§

impl Mov<Reg64, Imm64> for Asm

source§

fn mov(&mut self, op1: Reg64, op2: Imm64)

Emit an move instruction.
source§

impl Mov<Reg64, MemOp> for Asm

source§

fn mov(&mut self, op1: Reg64, op2: MemOp)

Emit an move instruction.
source§

impl Mov<Reg64, Reg64> for Asm

source§

fn mov(&mut self, op1: Reg64, op2: Reg64)

Emit an move instruction.
source§

impl Pop<Reg64> for Asm

source§

fn pop(&mut self, op1: Reg64)

Emit a pop instruction.
source§

impl Push<Reg64> for Asm

source§

fn push(&mut self, op1: Reg64)

Emit a push instruction.
source§

impl Test<Reg64, Reg64> for Asm

source§

fn test(&mut self, op1: Reg64, op2: Reg64)

Emit a logical compare instruction. Read more
source§

impl Copy for Reg64

Auto Trait Implementations§

§

impl RefUnwindSafe for Reg64

§

impl Send for Reg64

§

impl Sync for Reg64

§

impl Unpin for Reg64

§

impl UnwindSafe for Reg64

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

diff --git a/juicebox_asm/insn/index.html b/juicebox_asm/insn/index.html index cf23995..093289e 100644 --- a/juicebox_asm/insn/index.html +++ b/juicebox_asm/insn/index.html @@ -1,3 +1,3 @@ juicebox_asm::insn - Rust -

Module juicebox_asm::insn

source ·
Expand description

Trait definitions of various instructions.

-

Traits

  • Trait for add instruction kinds.
  • Trait for call instruction kinds.
  • Trait for cmp instruction kinds.
  • Trait for dec instruction kinds.
  • Trait for jmp instruction kinds.
  • Trait for jnz instruction kinds.
  • Trait for jz instruction kinds.
  • Trait for mov instruction kinds.
  • Trait for pop instruction kinds.
  • Trait for push instruction kinds.
  • Trait for test instruction kinds.
\ No newline at end of file +

Module juicebox_asm::insn

source ·
Expand description

Trait definitions of various instructions.

+

Traits

\ No newline at end of file diff --git a/juicebox_asm/insn/sidebar-items.js b/juicebox_asm/insn/sidebar-items.js index 23ed650..894686f 100644 --- a/juicebox_asm/insn/sidebar-items.js +++ b/juicebox_asm/insn/sidebar-items.js @@ -1 +1 @@ -window.SIDEBAR_ITEMS = {"trait":["Add","Call","Cmp","Dec","Jmp","Jnz","Jz","Mov","Pop","Push","Test"]}; \ No newline at end of file +window.SIDEBAR_ITEMS = {"trait":["Add","Call","Cmovnz","Cmovz","Cmp","Dec","Jmp","Jnz","Jz","Mov","Pop","Push","Test"]}; \ No newline at end of file diff --git a/juicebox_asm/insn/trait.Add.html b/juicebox_asm/insn/trait.Add.html index f64bb18..ab5accc 100644 --- a/juicebox_asm/insn/trait.Add.html +++ b/juicebox_asm/insn/trait.Add.html @@ -1,7 +1,7 @@ Add in juicebox_asm::insn - Rust -

Trait juicebox_asm::insn::Add

source ·
pub trait Add<T, U> {
+    

Trait juicebox_asm::insn::Add

source ·
pub trait Add<T, U> {
     // Required method
     fn add(&mut self, op1: T, op2: U);
 }
Expand description

Trait for add instruction kinds.

-

Required Methods§

source

fn add(&mut self, op1: T, op2: U)

Emit an add instruction.

+

Required Methods§

source

fn add(&mut self, op1: T, op2: U)

Emit an add instruction.

Implementors§

\ No newline at end of file diff --git a/juicebox_asm/insn/trait.Call.html b/juicebox_asm/insn/trait.Call.html index e306d73..6d929cb 100644 --- a/juicebox_asm/insn/trait.Call.html +++ b/juicebox_asm/insn/trait.Call.html @@ -1,7 +1,7 @@ Call in juicebox_asm::insn - Rust -

Trait juicebox_asm::insn::Call

source ·
pub trait Call<T> {
+    

Trait juicebox_asm::insn::Call

source ·
pub trait Call<T> {
     // Required method
     fn call(&mut self, op1: T);
 }
Expand description

Trait for call instruction kinds.

-

Required Methods§

source

fn call(&mut self, op1: T)

Emit a call instruction.

+

Required Methods§

source

fn call(&mut self, op1: T)

Emit a call instruction.

Implementors§

\ No newline at end of file diff --git a/juicebox_asm/insn/trait.Cmovnz.html b/juicebox_asm/insn/trait.Cmovnz.html new file mode 100644 index 0000000..ca0fef1 --- /dev/null +++ b/juicebox_asm/insn/trait.Cmovnz.html @@ -0,0 +1,7 @@ +Cmovnz in juicebox_asm::insn - Rust +

Trait juicebox_asm::insn::Cmovnz

source ·
pub trait Cmovnz<T, U> {
+    // Required method
+    fn cmovnz(&mut self, op1: T, op2: U);
+}

Required Methods§

source

fn cmovnz(&mut self, op1: T, op2: U)

Emit a (conditional) move if not zero instruction.

+

Move is only commited if (ZF=0).

+

Implementors§

\ No newline at end of file diff --git a/juicebox_asm/insn/trait.Cmovz.html b/juicebox_asm/insn/trait.Cmovz.html new file mode 100644 index 0000000..3da1ed4 --- /dev/null +++ b/juicebox_asm/insn/trait.Cmovz.html @@ -0,0 +1,7 @@ +Cmovz in juicebox_asm::insn - Rust +

Trait juicebox_asm::insn::Cmovz

source ·
pub trait Cmovz<T, U> {
+    // Required method
+    fn cmovz(&mut self, op1: T, op2: U);
+}

Required Methods§

source

fn cmovz(&mut self, op1: T, op2: U)

Emit a (conditional) move if zero instruction.

+

Move is only commited if (ZF=1).

+

Implementors§

\ No newline at end of file diff --git a/juicebox_asm/insn/trait.Cmp.html b/juicebox_asm/insn/trait.Cmp.html index cd38840..9c57b54 100644 --- a/juicebox_asm/insn/trait.Cmp.html +++ b/juicebox_asm/insn/trait.Cmp.html @@ -1,9 +1,9 @@ Cmp in juicebox_asm::insn - Rust -

Trait juicebox_asm::insn::Cmp

source ·
pub trait Cmp<T, U> {
+    

Trait juicebox_asm::insn::Cmp

source ·
pub trait Cmp<T, U> {
     // Required method
     fn cmp(&mut self, op1: T, op2: U);
 }
Expand description

Trait for cmp instruction kinds.

-

Required Methods§

source

fn cmp(&mut self, op1: T, op2: U)

Emit a compare instruction.

+

Required Methods§

source

fn cmp(&mut self, op1: T, op2: U)

Emit a compare instruction.

Computes op2 - op1 and sets the status flags in the same way as the sub instruction, the result is discarded.

Implementors§

\ No newline at end of file diff --git a/juicebox_asm/insn/trait.Dec.html b/juicebox_asm/insn/trait.Dec.html index d53ac3b..2f9ce80 100644 --- a/juicebox_asm/insn/trait.Dec.html +++ b/juicebox_asm/insn/trait.Dec.html @@ -1,7 +1,7 @@ Dec in juicebox_asm::insn - Rust -

Trait juicebox_asm::insn::Dec

source ·
pub trait Dec<T> {
+    

Trait juicebox_asm::insn::Dec

source ·
pub trait Dec<T> {
     // Required method
     fn dec(&mut self, op1: T);
 }
Expand description

Trait for dec instruction kinds.

-

Required Methods§

source

fn dec(&mut self, op1: T)

Emit a decrement instruction.

+

Required Methods§

source

fn dec(&mut self, op1: T)

Emit a decrement instruction.

Implementors§

\ No newline at end of file diff --git a/juicebox_asm/insn/trait.Jmp.html b/juicebox_asm/insn/trait.Jmp.html index 21b50fa..e7e8cba 100644 --- a/juicebox_asm/insn/trait.Jmp.html +++ b/juicebox_asm/insn/trait.Jmp.html @@ -1,7 +1,7 @@ Jmp in juicebox_asm::insn - Rust -

Trait juicebox_asm::insn::Jmp

source ·
pub trait Jmp<T> {
+    

Trait juicebox_asm::insn::Jmp

source ·
pub trait Jmp<T> {
     // Required method
     fn jmp(&mut self, op1: T);
 }
Expand description

Trait for jmp instruction kinds.

-

Required Methods§

source

fn jmp(&mut self, op1: T)

Emit an unconditional jump instruction.

+

Required Methods§

source

fn jmp(&mut self, op1: T)

Emit an unconditional jump instruction.

Implementors§

source§

impl Jmp<&mut Label> for Asm

\ No newline at end of file diff --git a/juicebox_asm/insn/trait.Jnz.html b/juicebox_asm/insn/trait.Jnz.html index db1e536..b8a0a51 100644 --- a/juicebox_asm/insn/trait.Jnz.html +++ b/juicebox_asm/insn/trait.Jnz.html @@ -1,7 +1,7 @@ Jnz in juicebox_asm::insn - Rust -

Trait juicebox_asm::insn::Jnz

source ·
pub trait Jnz<T> {
+    

Trait juicebox_asm::insn::Jnz

source ·
pub trait Jnz<T> {
     // Required method
     fn jnz(&mut self, op1: T);
 }
Expand description

Trait for jnz instruction kinds.

-

Required Methods§

source

fn jnz(&mut self, op1: T)

Emit a conditional jump if not zero instruction (ZF = 0).

+

Required Methods§

source

fn jnz(&mut self, op1: T)

Emit a conditional jump if not zero instruction (ZF = 0).

Implementors§

source§

impl Jnz<&mut Label> for Asm

\ No newline at end of file diff --git a/juicebox_asm/insn/trait.Jz.html b/juicebox_asm/insn/trait.Jz.html index 799b9bc..7e6020b 100644 --- a/juicebox_asm/insn/trait.Jz.html +++ b/juicebox_asm/insn/trait.Jz.html @@ -1,7 +1,7 @@ Jz in juicebox_asm::insn - Rust -

Trait juicebox_asm::insn::Jz

source ·
pub trait Jz<T> {
+    

Trait juicebox_asm::insn::Jz

source ·
pub trait Jz<T> {
     // Required method
     fn jz(&mut self, op1: T);
 }
Expand description

Trait for jz instruction kinds.

-

Required Methods§

source

fn jz(&mut self, op1: T)

Emit a conditional jump if zero instruction (ZF = 1).

+

Required Methods§

source

fn jz(&mut self, op1: T)

Emit a conditional jump if zero instruction (ZF = 1).

Implementors§

source§

impl Jz<&mut Label> for Asm

\ No newline at end of file diff --git a/juicebox_asm/insn/trait.Mov.html b/juicebox_asm/insn/trait.Mov.html index 86659f9..63bb10e 100644 --- a/juicebox_asm/insn/trait.Mov.html +++ b/juicebox_asm/insn/trait.Mov.html @@ -1,7 +1,7 @@ Mov in juicebox_asm::insn - Rust -

Trait juicebox_asm::insn::Mov

source ·
pub trait Mov<T, U> {
+    

Trait juicebox_asm::insn::Mov

source ·
pub trait Mov<T, U> {
     // Required method
     fn mov(&mut self, op1: T, op2: U);
 }
Expand description

Trait for mov instruction kinds.

-

Required Methods§

source

fn mov(&mut self, op1: T, op2: U)

Emit an move instruction.

+

Required Methods§

source

fn mov(&mut self, op1: T, op2: U)

Emit an move instruction.

Implementors§

\ No newline at end of file diff --git a/juicebox_asm/insn/trait.Pop.html b/juicebox_asm/insn/trait.Pop.html index 02083ec..d248e80 100644 --- a/juicebox_asm/insn/trait.Pop.html +++ b/juicebox_asm/insn/trait.Pop.html @@ -1,7 +1,7 @@ Pop in juicebox_asm::insn - Rust -

Trait juicebox_asm::insn::Pop

source ·
pub trait Pop<T> {
+    

Trait juicebox_asm::insn::Pop

source ·
pub trait Pop<T> {
     // Required method
     fn pop(&mut self, op1: T);
 }
Expand description

Trait for pop instruction kinds.

-

Required Methods§

source

fn pop(&mut self, op1: T)

Emit a pop instruction.

+

Required Methods§

source

fn pop(&mut self, op1: T)

Emit a pop instruction.

Implementors§

\ No newline at end of file diff --git a/juicebox_asm/insn/trait.Push.html b/juicebox_asm/insn/trait.Push.html index 7b49d03..32287bb 100644 --- a/juicebox_asm/insn/trait.Push.html +++ b/juicebox_asm/insn/trait.Push.html @@ -1,7 +1,7 @@ Push in juicebox_asm::insn - Rust -

Trait juicebox_asm::insn::Push

source ·
pub trait Push<T> {
+    

Trait juicebox_asm::insn::Push

source ·
pub trait Push<T> {
     // Required method
     fn push(&mut self, op1: T);
 }
Expand description

Trait for push instruction kinds.

-

Required Methods§

source

fn push(&mut self, op1: T)

Emit a push instruction.

+

Required Methods§

source

fn push(&mut self, op1: T)

Emit a push instruction.

Implementors§

\ No newline at end of file diff --git a/juicebox_asm/insn/trait.Test.html b/juicebox_asm/insn/trait.Test.html index 331dfad..7c3bd8e 100644 --- a/juicebox_asm/insn/trait.Test.html +++ b/juicebox_asm/insn/trait.Test.html @@ -1,9 +1,9 @@ Test in juicebox_asm::insn - Rust -

Trait juicebox_asm::insn::Test

source ·
pub trait Test<T, U> {
+    

Trait juicebox_asm::insn::Test

source ·
pub trait Test<T, U> {
     // Required method
     fn test(&mut self, op1: T, op2: U);
 }
Expand description

Trait for test instruction kinds.

-

Required Methods§

source

fn test(&mut self, op1: T, op2: U)

Emit a logical compare instruction.

+

Required Methods§

source

fn test(&mut self, op1: T, op2: U)

Emit a logical compare instruction.

Computes the bit-wise logical AND of first operand and the second operand and sets the SF, ZF, and PF status flags, the result is discarded.

Implementors§

\ No newline at end of file diff --git a/juicebox_asm/struct.Asm.html b/juicebox_asm/struct.Asm.html index c8cea5f..80e3152 100644 --- a/juicebox_asm/struct.Asm.html +++ b/juicebox_asm/struct.Asm.html @@ -1,11 +1,11 @@ -Asm in juicebox_asm - Rust +Asm in juicebox_asm - Rust

Struct juicebox_asm::Asm

source ·
pub struct Asm { /* private fields */ }
Expand description

x64 jit assembler.

-

Implementations§

source§

impl Asm

source

pub fn new() -> Asm

Create a new x64 jit assembler.

+

Implementations§

source§

impl Asm

source

pub fn new() -> Asm

Create a new x64 jit assembler.

source

pub fn into_code(self) -> Vec<u8>

Consume the assembler and get the emitted code.

source

pub fn bind(&mut self, label: &mut Label)

Bind the Label to the current location.

source§

impl Asm

source

pub fn nop(&mut self)

Emit a nop instruction.

source§

impl Asm

source

pub fn ret(&mut self)

Emit a ret instruction.

-

Trait Implementations§

source§

impl Add<MemOp, Imm16> for Asm

source§

fn add(&mut self, op1: MemOp, op2: Imm16)

Emit an add instruction.
source§

impl Add<MemOp, Reg16> for Asm

source§

fn add(&mut self, op1: MemOp, op2: Reg16)

Emit an add instruction.
source§

impl Add<Reg32, Reg32> for Asm

source§

fn add(&mut self, op1: Reg32, op2: Reg32)

Emit an add instruction.
source§

impl Add<Reg64, Reg64> for Asm

source§

fn add(&mut self, op1: Reg64, op2: Reg64)

Emit an add instruction.
source§

impl Call<Reg64> for Asm

source§

fn call(&mut self, op1: Reg64)

Emit a call instruction.
source§

impl Cmp<MemOp, Imm16> for Asm

source§

fn cmp(&mut self, op1: MemOp, op2: Imm16)

Emit a compare instruction. Read more
source§

impl Dec<Reg32> for Asm

source§

fn dec(&mut self, op1: Reg32)

Emit a decrement instruction.
source§

impl Dec<Reg64> for Asm

source§

fn dec(&mut self, op1: Reg64)

Emit a decrement instruction.
source§

impl Jmp<&mut Label> for Asm

source§

fn jmp(&mut self, op1: &mut Label)

Emit an unconditional jump instruction.
source§

impl Jnz<&mut Label> for Asm

source§

fn jnz(&mut self, op1: &mut Label)

Emit a conditional jump if not zero instruction (ZF = 0).
source§

impl Jz<&mut Label> for Asm

source§

fn jz(&mut self, op1: &mut Label)

Emit a conditional jump if zero instruction (ZF = 1).
source§

impl Mov<MemOp, Imm16> for Asm

source§

fn mov(&mut self, op1: MemOp, op2: Imm16)

Emit an move instruction.
source§

impl Mov<MemOp, Reg16> for Asm

source§

fn mov(&mut self, op1: MemOp, op2: Reg16)

Emit an move instruction.
source§

impl Mov<MemOp, Reg32> for Asm

source§

fn mov(&mut self, op1: MemOp, op2: Reg32)

Emit an move instruction.
source§

impl Mov<MemOp, Reg64> for Asm

source§

fn mov(&mut self, op1: MemOp, op2: Reg64)

Emit an move instruction.
source§

impl Mov<MemOp, Reg8> for Asm

source§

fn mov(&mut self, op1: MemOp, op2: Reg8)

Emit an move instruction.
source§

impl Mov<Reg16, Imm16> for Asm

source§

fn mov(&mut self, op1: Reg16, op2: Imm16)

Emit an move instruction.
source§

impl Mov<Reg16, MemOp> for Asm

source§

fn mov(&mut self, op1: Reg16, op2: MemOp)

Emit an move instruction.
source§

impl Mov<Reg16, Reg16> for Asm

source§

fn mov(&mut self, op1: Reg16, op2: Reg16)

Emit an move instruction.
source§

impl Mov<Reg32, Imm32> for Asm

source§

fn mov(&mut self, op1: Reg32, op2: Imm32)

Emit an move instruction.
source§

impl Mov<Reg32, MemOp> for Asm

source§

fn mov(&mut self, op1: Reg32, op2: MemOp)

Emit an move instruction.
source§

impl Mov<Reg32, Reg32> for Asm

source§

fn mov(&mut self, op1: Reg32, op2: Reg32)

Emit an move instruction.
source§

impl Mov<Reg64, Imm64> for Asm

source§

fn mov(&mut self, op1: Reg64, op2: Imm64)

Emit an move instruction.
source§

impl Mov<Reg64, MemOp> for Asm

source§

fn mov(&mut self, op1: Reg64, op2: MemOp)

Emit an move instruction.
source§

impl Mov<Reg64, Reg64> for Asm

source§

fn mov(&mut self, op1: Reg64, op2: Reg64)

Emit an move instruction.
source§

impl Mov<Reg8, Imm8> for Asm

source§

fn mov(&mut self, op1: Reg8, op2: Imm8)

Emit an move instruction.
source§

impl Mov<Reg8, MemOp> for Asm

source§

fn mov(&mut self, op1: Reg8, op2: MemOp)

Emit an move instruction.
source§

impl Mov<Reg8, Reg8> for Asm

source§

fn mov(&mut self, op1: Reg8, op2: Reg8)

Emit an move instruction.
source§

impl Pop<Reg16> for Asm

source§

fn pop(&mut self, op1: Reg16)

Emit a pop instruction.
source§

impl Pop<Reg64> for Asm

source§

fn pop(&mut self, op1: Reg64)

Emit a pop instruction.
source§

impl Push<Reg16> for Asm

source§

fn push(&mut self, op1: Reg16)

Emit a push instruction.
source§

impl Push<Reg64> for Asm

source§

fn push(&mut self, op1: Reg64)

Emit a push instruction.
source§

impl Test<MemOp, Imm16> for Asm

source§

fn test(&mut self, op1: MemOp, op2: Imm16)

Emit a logical compare instruction. Read more
source§

impl Test<Reg32, Reg32> for Asm

source§

fn test(&mut self, op1: Reg32, op2: Reg32)

Emit a logical compare instruction. Read more
source§

impl Test<Reg64, Reg64> for Asm

source§

fn test(&mut self, op1: Reg64, op2: Reg64)

Emit a logical compare instruction. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for Asm

§

impl Send for Asm

§

impl Sync for Asm

§

impl Unpin for Asm

§

impl UnwindSafe for Asm

Blanket Implementations§

source§

impl<T> Any for T
where +

Trait Implementations§

source§

impl Add<MemOp, Imm16> for Asm

source§

fn add(&mut self, op1: MemOp, op2: Imm16)

Emit an add instruction.
source§

impl Add<MemOp, Reg16> for Asm

source§

fn add(&mut self, op1: MemOp, op2: Reg16)

Emit an add instruction.
source§

impl Add<Reg32, Reg32> for Asm

source§

fn add(&mut self, op1: Reg32, op2: Reg32)

Emit an add instruction.
source§

impl Add<Reg64, Reg64> for Asm

source§

fn add(&mut self, op1: Reg64, op2: Reg64)

Emit an add instruction.
source§

impl Call<Reg64> for Asm

source§

fn call(&mut self, op1: Reg64)

Emit a call instruction.
source§

impl Cmovnz<Reg64, Reg64> for Asm

source§

fn cmovnz(&mut self, op1: Reg64, op2: Reg64)

Emit a (conditional) move if not zero instruction. Read more
source§

impl Cmovz<Reg64, Reg64> for Asm

source§

fn cmovz(&mut self, op1: Reg64, op2: Reg64)

Emit a (conditional) move if zero instruction. Read more
source§

impl Cmp<MemOp, Imm16> for Asm

source§

fn cmp(&mut self, op1: MemOp, op2: Imm16)

Emit a compare instruction. Read more
source§

impl Dec<Reg32> for Asm

source§

fn dec(&mut self, op1: Reg32)

Emit a decrement instruction.
source§

impl Dec<Reg64> for Asm

source§

fn dec(&mut self, op1: Reg64)

Emit a decrement instruction.
source§

impl Jmp<&mut Label> for Asm

source§

fn jmp(&mut self, op1: &mut Label)

Emit an unconditional jump instruction.
source§

impl Jnz<&mut Label> for Asm

source§

fn jnz(&mut self, op1: &mut Label)

Emit a conditional jump if not zero instruction (ZF = 0).
source§

impl Jz<&mut Label> for Asm

source§

fn jz(&mut self, op1: &mut Label)

Emit a conditional jump if zero instruction (ZF = 1).
source§

impl Mov<MemOp, Imm16> for Asm

source§

fn mov(&mut self, op1: MemOp, op2: Imm16)

Emit an move instruction.
source§

impl Mov<MemOp, Reg16> for Asm

source§

fn mov(&mut self, op1: MemOp, op2: Reg16)

Emit an move instruction.
source§

impl Mov<MemOp, Reg32> for Asm

source§

fn mov(&mut self, op1: MemOp, op2: Reg32)

Emit an move instruction.
source§

impl Mov<MemOp, Reg64> for Asm

source§

fn mov(&mut self, op1: MemOp, op2: Reg64)

Emit an move instruction.
source§

impl Mov<MemOp, Reg8> for Asm

source§

fn mov(&mut self, op1: MemOp, op2: Reg8)

Emit an move instruction.
source§

impl Mov<Reg16, Imm16> for Asm

source§

fn mov(&mut self, op1: Reg16, op2: Imm16)

Emit an move instruction.
source§

impl Mov<Reg16, MemOp> for Asm

source§

fn mov(&mut self, op1: Reg16, op2: MemOp)

Emit an move instruction.
source§

impl Mov<Reg16, Reg16> for Asm

source§

fn mov(&mut self, op1: Reg16, op2: Reg16)

Emit an move instruction.
source§

impl Mov<Reg32, Imm32> for Asm

source§

fn mov(&mut self, op1: Reg32, op2: Imm32)

Emit an move instruction.
source§

impl Mov<Reg32, MemOp> for Asm

source§

fn mov(&mut self, op1: Reg32, op2: MemOp)

Emit an move instruction.
source§

impl Mov<Reg32, Reg32> for Asm

source§

fn mov(&mut self, op1: Reg32, op2: Reg32)

Emit an move instruction.
source§

impl Mov<Reg64, Imm64> for Asm

source§

fn mov(&mut self, op1: Reg64, op2: Imm64)

Emit an move instruction.
source§

impl Mov<Reg64, MemOp> for Asm

source§

fn mov(&mut self, op1: Reg64, op2: MemOp)

Emit an move instruction.
source§

impl Mov<Reg64, Reg64> for Asm

source§

fn mov(&mut self, op1: Reg64, op2: Reg64)

Emit an move instruction.
source§

impl Mov<Reg8, Imm8> for Asm

source§

fn mov(&mut self, op1: Reg8, op2: Imm8)

Emit an move instruction.
source§

impl Mov<Reg8, MemOp> for Asm

source§

fn mov(&mut self, op1: Reg8, op2: MemOp)

Emit an move instruction.
source§

impl Mov<Reg8, Reg8> for Asm

source§

fn mov(&mut self, op1: Reg8, op2: Reg8)

Emit an move instruction.
source§

impl Pop<Reg16> for Asm

source§

fn pop(&mut self, op1: Reg16)

Emit a pop instruction.
source§

impl Pop<Reg64> for Asm

source§

fn pop(&mut self, op1: Reg64)

Emit a pop instruction.
source§

impl Push<Reg16> for Asm

source§

fn push(&mut self, op1: Reg16)

Emit a push instruction.
source§

impl Push<Reg64> for Asm

source§

fn push(&mut self, op1: Reg64)

Emit a push instruction.
source§

impl Test<MemOp, Imm16> for Asm

source§

fn test(&mut self, op1: MemOp, op2: Imm16)

Emit a logical compare instruction. Read more
source§

impl Test<Reg32, Reg32> for Asm

source§

fn test(&mut self, op1: Reg32, op2: Reg32)

Emit a logical compare instruction. Read more
source§

impl Test<Reg64, Reg64> for Asm

source§

fn test(&mut self, op1: Reg64, op2: Reg64)

Emit a logical compare instruction. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for Asm

§

impl Send for Asm

§

impl Sync for Asm

§

impl Unpin for Asm

§

impl UnwindSafe for Asm

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

diff --git a/search-index.js b/search-index.js index 66516d6..a388764 100644 --- a/search-index.js +++ b/search-index.js @@ -1,7 +1,7 @@ var searchIndex = new Map(JSON.parse('[\ ["add",{"doc":"Add example.","t":"","n":[],"q":[],"d":[],"i":[],"f":[],"c":[],"p":[],"b":[]}],\ ["fib",{"doc":"Fibonacci example.","t":"","n":[],"q":[],"d":[],"i":[],"f":[],"c":[],"p":[],"b":[]}],\ -["juicebox_asm",{"doc":"A simple x64 jit assembler with a minimal runtime to …","t":"FFFFFPPFGGGGGFNNNNNPPPPNPNNNNNNNNNNNNNNNNNNNNNNNNPPPNPPNNNNNNNNNPNNPPPPNNNPPPPPPPPPNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNCNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPNPPPPPPNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNKKKKKKKKKKKMMMMMMMMMMM","n":["Asm","Imm16","Imm32","Imm64","Imm8","Indirect","IndirectDisp","Label","MemOp","Reg16","Reg32","Reg64","Reg8","Runtime","add","add","add","add","add_code","ah","al","ax","bh","bind","bl","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","bp","bpl","bx","call","ch","cl","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","cmp","cx","dec","dec","dh","di","dil","dl","drop","drop","dump","dx","eax","ebp","ebx","ecx","edi","edx","esi","esp","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","insn","into","into","into","into","into","into","into","into","into","into","into","into","into_code","jmp","jnz","jz","mov","mov","mov","mov","mov","mov","mov","mov","mov","mov","mov","mov","mov","mov","mov","mov","mov","new","new","new","nop","pop","pop","push","push","r10","r10d","r10l","r10w","r11","r11d","r11l","r11w","r12","r12d","r12l","r12w","r13","r13d","r13l","r13w","r14","r14d","r14l","r14w","r15","r15d","r15l","r15w","r8","r8d","r8l","r8w","r9","r9d","r9l","r9w","rax","rbp","rbx","rcx","rdi","rdx","ret","rsi","rsp","si","sil","sp","spl","test","test","test","to_owned","to_owned","to_owned","to_owned","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","with_profile","Add","Call","Cmp","Dec","Jmp","Jnz","Jz","Mov","Pop","Push","Test","add","call","cmp","dec","jmp","jnz","jz","mov","pop","push","test"],"q":[[0,"juicebox_asm"],[248,"juicebox_asm::insn"],[270,"core::convert"],[271,"alloc::vec"],[272,"core::result"],[273,"core::any"]],"d":["x64 jit assembler.","Type representing a 16 bit immediate.","Type representing a 32 bit immediate.","Type representing a 64 bit immediate.","Type representing an 8 bit immediate.","An indirect memory operand, eg mov [rax], rcx.","An indirect memory operand with additional displacement, …","A label which is used as target for jump instructions.","Type representing a memory operand.","Definition of 16 bit registers.","Definition of 32 bit registers.","Definition of 64 bit registers.","Definition of 8 bit registers.","A simple mmaped runtime with executable pages.","","","","","Add the block of code to the runtime and a get function …","","","","","Bind the Label to the current location.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Unmaps the code page. This invalidates all the function …","Dump the code added so far to the runtime into a file …","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","Returns the argument unchanged.","","","Returns the argument unchanged.","","","","","","Returns the argument unchanged.","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Trait definitions of various instructions.","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Consume the assembler and get the emitted code.","","","","","","","","","","","","","","","","","","","","","Create a new x64 jit assembler.","Create a new unbound Label.","Create a new Runtime.","Emit a nop instruction.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Emit a ret instruction.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Create a new Runtime which also generates static perf …","Trait for add instruction kinds.","Trait for call instruction kinds.","Trait for cmp instruction kinds.","Trait for dec instruction kinds.","Trait for jmp instruction kinds.","Trait for jnz instruction kinds.","Trait for jz instruction kinds.","Trait for mov instruction kinds.","Trait for pop instruction kinds.","Trait for push instruction kinds.","Trait for test instruction kinds.","Emit an add instruction.","Emit a call instruction.","Emit a compare instruction.","Emit a decrement instruction.","Emit an unconditional jump instruction.","Emit a conditional jump if not zero instruction (ZF = 0).","Emit a conditional jump if zero instruction (ZF = 1).","Emit an move instruction.","Emit a pop instruction.","Emit a push instruction.","Emit a logical compare instruction."],"i":[0,0,0,0,0,2,2,0,0,0,0,0,0,0,1,1,1,1,8,13,13,6,13,1,13,1,12,8,2,14,3,18,21,7,5,6,13,1,12,8,2,14,3,18,21,7,5,6,13,6,13,6,1,13,13,7,5,6,13,7,5,6,13,1,6,1,1,13,6,13,13,12,8,8,6,5,5,5,5,5,5,5,5,1,12,8,2,14,14,14,3,3,3,3,3,18,18,18,18,18,18,18,21,21,21,21,21,21,21,21,21,21,21,7,5,6,13,0,1,12,8,2,14,3,18,21,7,5,6,13,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,12,8,1,1,1,1,1,7,5,13,6,7,5,13,6,7,5,13,6,7,5,13,6,7,5,13,6,7,5,13,6,7,5,13,6,7,5,13,6,7,7,7,7,7,7,1,7,7,6,13,6,13,1,1,1,7,5,6,13,1,12,8,2,14,3,18,21,7,5,6,13,1,12,8,2,14,3,18,21,7,5,6,13,1,12,8,2,14,3,18,21,7,5,6,13,8,0,0,0,0,0,0,0,0,0,0,0,29,30,31,32,33,34,35,36,37,38,39],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[1,2,3],4],[[1,5,5],4],[[1,2,6],4],[[1,7,7],4],[[8,-1],-2,[[11,[[10,[9]]]]],[]],0,0,0,0,[[1,12],4],0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0,0,[[1,7],4],0,0,[7,7],[5,5],[6,6],[13,13],[[-1,-2],4,[],[]],[[-1,-2],4,[],[]],[[-1,-2],4,[],[]],[[-1,-2],4,[],[]],[[1,2,3],4],0,[[1,5],4],[[1,7],4],0,0,0,0,[12,4],[8,4],[8,4],0,0,0,0,0,0,0,0,0,[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[9,14],[15,14],[16,3],[15,3],[9,3],[-1,-1,[]],[17,3],[15,18],[-1,-1,[]],[17,18],[16,18],[9,18],[19,18],[20,18],[-1,-1,[]],[17,21],[22,21],[15,21],[20,21],[19,21],[23,21],[24,21],[9,21],[25,21],[16,21],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[1,[[26,[9]]]],[[1,12],4],[[1,12],4],[[1,12],4],[[1,7,2],4],[[1,7,7],4],[[1,6,6],4],[[1,2,5],4],[[1,13,14],4],[[1,2,6],4],[[1,5,18],4],[[1,2,13],4],[[1,2,7],4],[[1,13,2],4],[[1,2,3],4],[[1,13,13],4],[[1,7,21],4],[[1,6,2],4],[[1,5,2],4],[[1,6,3],4],[[1,5,5],4],[[],1],[[],12],[[],8],[1,4],[[1,6],4],[[1,7],4],[[1,7],4],[[1,6],4],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[1,4],0,0,0,0,0,0,[[1,2,3],4],[[1,7,7],4],[[1,5,5],4],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,[[27,[-2]]],[],[]],[-1,[[27,[-2]]],[],[]],[-1,[[27,[-2]]],[],[]],[-1,[[27,[-2]]],[],[]],[-1,[[27,[-2]]],[],[]],[-1,[[27,[-2]]],[],[]],[-1,[[27,[-2]]],[],[]],[-1,[[27,[-2]]],[],[]],[-1,[[27,[-2]]],[],[]],[-1,[[27,[-2]]],[],[]],[-1,[[27,[-2]]],[],[]],[-1,[[27,[-2]]],[],[]],[-1,[[27,[-2]]],[],[]],[-1,[[27,[-2]]],[],[]],[-1,[[27,[-2]]],[],[]],[-1,[[27,[-2]]],[],[]],[-1,[[27,[-2]]],[],[]],[-1,[[27,[-2]]],[],[]],[-1,[[27,[-2]]],[],[]],[-1,[[27,[-2]]],[],[]],[-1,[[27,[-2]]],[],[]],[-1,[[27,[-2]]],[],[]],[-1,[[27,[-2]]],[],[]],[-1,[[27,[-2]]],[],[]],[-1,28,[]],[-1,28,[]],[-1,28,[]],[-1,28,[]],[-1,28,[]],[-1,28,[]],[-1,28,[]],[-1,28,[]],[-1,28,[]],[-1,28,[]],[-1,28,[]],[-1,28,[]],[[],8],0,0,0,0,0,0,0,0,0,0,0,[[29,-1,-2],4,[],[]],[[30,-1],4,[]],[[31,-1,-2],4,[],[]],[[32,-1],4,[]],[[33,-1],4,[]],[[34,-1],4,[]],[[35,-1],4,[]],[[36,-1,-2],4,[],[]],[[37,-1],4,[]],[[38,-1],4,[]],[[39,-1,-2],4,[],[]]],"c":[],"p":[[5,"Asm",0],[6,"MemOp",0],[5,"Imm16",0],[1,"tuple"],[6,"Reg32",0],[6,"Reg16",0],[6,"Reg64",0],[5,"Runtime",0],[1,"u8"],[1,"slice"],[10,"AsRef",270],[5,"Label",0],[6,"Reg8",0],[5,"Imm8",0],[1,"i8"],[1,"u16"],[1,"i16"],[5,"Imm32",0],[1,"i32"],[1,"u32"],[5,"Imm64",0],[1,"i64"],[1,"usize"],[1,"u64"],[1,"isize"],[5,"Vec",271],[6,"Result",272],[5,"TypeId",273],[10,"Add",248],[10,"Call",248],[10,"Cmp",248],[10,"Dec",248],[10,"Jmp",248],[10,"Jnz",248],[10,"Jz",248],[10,"Mov",248],[10,"Pop",248],[10,"Push",248],[10,"Test",248]],"b":[[14,"impl-Add%3CMemOp,+Imm16%3E-for-Asm"],[15,"impl-Add%3CReg32,+Reg32%3E-for-Asm"],[16,"impl-Add%3CMemOp,+Reg16%3E-for-Asm"],[17,"impl-Add%3CReg64,+Reg64%3E-for-Asm"],[65,"impl-Dec%3CReg32%3E-for-Asm"],[66,"impl-Dec%3CReg64%3E-for-Asm"],[88,"impl-From%3Cu8%3E-for-Imm8"],[89,"impl-From%3Ci8%3E-for-Imm8"],[90,"impl-From%3Cu16%3E-for-Imm16"],[91,"impl-From%3Ci8%3E-for-Imm16"],[92,"impl-From%3Cu8%3E-for-Imm16"],[94,"impl-From%3Ci16%3E-for-Imm16"],[95,"impl-From%3Ci8%3E-for-Imm32"],[97,"impl-From%3Ci16%3E-for-Imm32"],[98,"impl-From%3Cu16%3E-for-Imm32"],[99,"impl-From%3Cu8%3E-for-Imm32"],[100,"impl-From%3Ci32%3E-for-Imm32"],[101,"impl-From%3Cu32%3E-for-Imm32"],[103,"impl-From%3Ci16%3E-for-Imm64"],[104,"impl-From%3Ci64%3E-for-Imm64"],[105,"impl-From%3Ci8%3E-for-Imm64"],[106,"impl-From%3Cu32%3E-for-Imm64"],[107,"impl-From%3Ci32%3E-for-Imm64"],[108,"impl-From%3Cusize%3E-for-Imm64"],[109,"impl-From%3Cu64%3E-for-Imm64"],[110,"impl-From%3Cu8%3E-for-Imm64"],[111,"impl-From%3Cisize%3E-for-Imm64"],[112,"impl-From%3Cu16%3E-for-Imm64"],[134,"impl-Mov%3CReg64,+MemOp%3E-for-Asm"],[135,"impl-Mov%3CReg64,+Reg64%3E-for-Asm"],[136,"impl-Mov%3CReg16,+Reg16%3E-for-Asm"],[137,"impl-Mov%3CMemOp,+Reg32%3E-for-Asm"],[138,"impl-Mov%3CReg8,+Imm8%3E-for-Asm"],[139,"impl-Mov%3CMemOp,+Reg16%3E-for-Asm"],[140,"impl-Mov%3CReg32,+Imm32%3E-for-Asm"],[141,"impl-Mov%3CMemOp,+Reg8%3E-for-Asm"],[142,"impl-Mov%3CMemOp,+Reg64%3E-for-Asm"],[143,"impl-Mov%3CReg8,+MemOp%3E-for-Asm"],[144,"impl-Mov%3CMemOp,+Imm16%3E-for-Asm"],[145,"impl-Mov%3CReg8,+Reg8%3E-for-Asm"],[146,"impl-Mov%3CReg64,+Imm64%3E-for-Asm"],[147,"impl-Mov%3CReg16,+MemOp%3E-for-Asm"],[148,"impl-Mov%3CReg32,+MemOp%3E-for-Asm"],[149,"impl-Mov%3CReg16,+Imm16%3E-for-Asm"],[150,"impl-Mov%3CReg32,+Reg32%3E-for-Asm"],[155,"impl-Pop%3CReg16%3E-for-Asm"],[156,"impl-Pop%3CReg64%3E-for-Asm"],[157,"impl-Push%3CReg64%3E-for-Asm"],[158,"impl-Push%3CReg16%3E-for-Asm"],[204,"impl-Test%3CMemOp,+Imm16%3E-for-Asm"],[205,"impl-Test%3CReg64,+Reg64%3E-for-Asm"],[206,"impl-Test%3CReg32,+Reg32%3E-for-Asm"]]}],\ +["juicebox_asm",{"doc":"A simple x64 jit assembler with a minimal runtime to …","t":"FFFFFPPFGGGGGFNNNNNPPPPNPNNNNNNNNNNNNNNNNNNNNNNNNPPPNPPNNNNNNNNNNNPNNPPPPNNNPPPPPPPPPNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNCNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPNPPPPPPNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNKKKKKKKKKKKKKMMMMMMMMMMMMM","n":["Asm","Imm16","Imm32","Imm64","Imm8","Indirect","IndirectDisp","Label","MemOp","Reg16","Reg32","Reg64","Reg8","Runtime","add","add","add","add","add_code","ah","al","ax","bh","bind","bl","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","bp","bpl","bx","call","ch","cl","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","cmovnz","cmovz","cmp","cx","dec","dec","dh","di","dil","dl","drop","drop","dump","dx","eax","ebp","ebx","ecx","edi","edx","esi","esp","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","insn","into","into","into","into","into","into","into","into","into","into","into","into","into_code","jmp","jnz","jz","mov","mov","mov","mov","mov","mov","mov","mov","mov","mov","mov","mov","mov","mov","mov","mov","mov","new","new","new","nop","pop","pop","push","push","r10","r10d","r10l","r10w","r11","r11d","r11l","r11w","r12","r12d","r12l","r12w","r13","r13d","r13l","r13w","r14","r14d","r14l","r14w","r15","r15d","r15l","r15w","r8","r8d","r8l","r8w","r9","r9d","r9l","r9w","rax","rbp","rbx","rcx","rdi","rdx","ret","rsi","rsp","si","sil","sp","spl","test","test","test","to_owned","to_owned","to_owned","to_owned","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","with_profile","Add","Call","Cmovnz","Cmovz","Cmp","Dec","Jmp","Jnz","Jz","Mov","Pop","Push","Test","add","call","cmovnz","cmovz","cmp","dec","jmp","jnz","jz","mov","pop","push","test"],"q":[[0,"juicebox_asm"],[250,"juicebox_asm::insn"],[276,"core::convert"],[277,"alloc::vec"],[278,"core::result"],[279,"core::any"]],"d":["x64 jit assembler.","Type representing a 16 bit immediate.","Type representing a 32 bit immediate.","Type representing a 64 bit immediate.","Type representing an 8 bit immediate.","An indirect memory operand, eg mov [rax], rcx.","An indirect memory operand with additional displacement, …","A label which is used as target for jump instructions.","Type representing a memory operand.","Definition of 16 bit registers.","Definition of 32 bit registers.","Definition of 64 bit registers.","Definition of 8 bit registers.","A simple mmaped runtime with executable pages.","","","","","Add the block of code to the runtime and a get function …","","","","","Bind the Label to the current location.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Unmaps the code page. This invalidates all the function …","Dump the code added so far to the runtime into a file …","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","Returns the argument unchanged.","","","","","","","Returns the argument unchanged.","","","","","","","","","","","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Trait definitions of various instructions.","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Consume the assembler and get the emitted code.","","","","","","","","","","","","","","","","","","","","","Create a new x64 jit assembler.","Create a new unbound Label.","Create a new Runtime.","Emit a nop instruction.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Emit a ret instruction.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Create a new Runtime which also generates static perf …","Trait for add instruction kinds.","Trait for call instruction kinds.","","","Trait for cmp instruction kinds.","Trait for dec instruction kinds.","Trait for jmp instruction kinds.","Trait for jnz instruction kinds.","Trait for jz instruction kinds.","Trait for mov instruction kinds.","Trait for pop instruction kinds.","Trait for push instruction kinds.","Trait for test instruction kinds.","Emit an add instruction.","Emit a call instruction.","Emit a (conditional) move if not zero instruction.","Emit a (conditional) move if zero instruction.","Emit a compare instruction.","Emit a decrement instruction.","Emit an unconditional jump instruction.","Emit a conditional jump if not zero instruction (ZF = 0).","Emit a conditional jump if zero instruction (ZF = 1).","Emit an move instruction.","Emit a pop instruction.","Emit a push instruction.","Emit a logical compare instruction."],"i":[0,0,0,0,0,2,2,0,0,0,0,0,0,0,1,1,1,1,8,13,13,3,13,1,13,1,12,8,2,14,5,19,21,6,7,3,13,1,12,8,2,14,5,19,21,6,7,3,13,3,13,3,1,13,13,6,7,3,13,6,7,3,13,1,1,1,3,1,1,13,3,13,13,12,8,8,3,7,7,7,7,7,7,7,7,1,12,8,2,14,14,14,5,5,5,5,5,19,19,19,19,19,19,19,21,21,21,21,21,21,21,21,21,21,21,6,7,3,13,0,1,12,8,2,14,5,19,21,6,7,3,13,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,12,8,1,1,1,1,1,6,7,13,3,6,7,13,3,6,7,13,3,6,7,13,3,6,7,13,3,6,7,13,3,6,7,13,3,6,7,13,3,6,6,6,6,6,6,1,6,6,3,13,3,13,1,1,1,6,7,3,13,1,12,8,2,14,5,19,21,6,7,3,13,1,12,8,2,14,5,19,21,6,7,3,13,1,12,8,2,14,5,19,21,6,7,3,13,8,0,0,0,0,0,0,0,0,0,0,0,0,0,29,30,31,32,33,34,35,36,37,38,39,40,41],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[1,2,3],4],[[1,2,5],4],[[1,6,6],4],[[1,7,7],4],[[8,-1],-2,[[11,[[10,[9]]]]],[]],0,0,0,0,[[1,12],4],0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0,0,[[1,6],4],0,0,[6,6],[7,7],[3,3],[13,13],[[-1,-2],4,[],[]],[[-1,-2],4,[],[]],[[-1,-2],4,[],[]],[[-1,-2],4,[],[]],[[1,6,6],4],[[1,6,6],4],[[1,2,5],4],0,[[1,6],4],[[1,7],4],0,0,0,0,[12,4],[8,4],[8,4],0,0,0,0,0,0,0,0,0,[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[9,14],[15,14],[16,5],[9,5],[15,5],[-1,-1,[]],[17,5],[18,19],[15,19],[16,19],[17,19],[9,19],[-1,-1,[]],[20,19],[17,21],[16,21],[22,21],[23,21],[24,21],[9,21],[20,21],[18,21],[25,21],[-1,-1,[]],[15,21],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[1,[[26,[9]]]],[[1,12],4],[[1,12],4],[[1,12],4],[[1,6,6],4],[[1,2,7],4],[[1,13,2],4],[[1,2,5],4],[[1,13,13],4],[[1,3,2],4],[[1,7,2],4],[[1,3,5],4],[[1,7,7],4],[[1,6,21],4],[[1,2,13],4],[[1,2,3],4],[[1,6,2],4],[[1,13,14],4],[[1,2,6],4],[[1,3,3],4],[[1,7,19],4],[[],1],[[],12],[[],8],[1,4],[[1,3],4],[[1,6],4],[[1,3],4],[[1,6],4],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[1,4],0,0,0,0,0,0,[[1,2,5],4],[[1,6,6],4],[[1,7,7],4],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,[[27,[-2]]],[],[]],[-1,[[27,[-2]]],[],[]],[-1,[[27,[-2]]],[],[]],[-1,[[27,[-2]]],[],[]],[-1,[[27,[-2]]],[],[]],[-1,[[27,[-2]]],[],[]],[-1,[[27,[-2]]],[],[]],[-1,[[27,[-2]]],[],[]],[-1,[[27,[-2]]],[],[]],[-1,[[27,[-2]]],[],[]],[-1,[[27,[-2]]],[],[]],[-1,[[27,[-2]]],[],[]],[-1,[[27,[-2]]],[],[]],[-1,[[27,[-2]]],[],[]],[-1,[[27,[-2]]],[],[]],[-1,[[27,[-2]]],[],[]],[-1,[[27,[-2]]],[],[]],[-1,[[27,[-2]]],[],[]],[-1,[[27,[-2]]],[],[]],[-1,[[27,[-2]]],[],[]],[-1,[[27,[-2]]],[],[]],[-1,[[27,[-2]]],[],[]],[-1,[[27,[-2]]],[],[]],[-1,[[27,[-2]]],[],[]],[-1,28,[]],[-1,28,[]],[-1,28,[]],[-1,28,[]],[-1,28,[]],[-1,28,[]],[-1,28,[]],[-1,28,[]],[-1,28,[]],[-1,28,[]],[-1,28,[]],[-1,28,[]],[[],8],0,0,0,0,0,0,0,0,0,0,0,0,0,[[29,-1,-2],4,[],[]],[[30,-1],4,[]],[[31,-1,-2],4,[],[]],[[32,-1,-2],4,[],[]],[[33,-1,-2],4,[],[]],[[34,-1],4,[]],[[35,-1],4,[]],[[36,-1],4,[]],[[37,-1],4,[]],[[38,-1,-2],4,[],[]],[[39,-1],4,[]],[[40,-1],4,[]],[[41,-1,-2],4,[],[]]],"c":[],"p":[[5,"Asm",0],[6,"MemOp",0],[6,"Reg16",0],[1,"tuple"],[5,"Imm16",0],[6,"Reg64",0],[6,"Reg32",0],[5,"Runtime",0],[1,"u8"],[1,"slice"],[10,"AsRef",276],[5,"Label",0],[6,"Reg8",0],[5,"Imm8",0],[1,"i8"],[1,"u16"],[1,"i16"],[1,"u32"],[5,"Imm32",0],[1,"i32"],[5,"Imm64",0],[1,"i64"],[1,"isize"],[1,"usize"],[1,"u64"],[5,"Vec",277],[6,"Result",278],[5,"TypeId",279],[10,"Add",250],[10,"Call",250],[10,"Cmovnz",250],[10,"Cmovz",250],[10,"Cmp",250],[10,"Dec",250],[10,"Jmp",250],[10,"Jnz",250],[10,"Jz",250],[10,"Mov",250],[10,"Pop",250],[10,"Push",250],[10,"Test",250]],"b":[[14,"impl-Add%3CMemOp,+Reg16%3E-for-Asm"],[15,"impl-Add%3CMemOp,+Imm16%3E-for-Asm"],[16,"impl-Add%3CReg64,+Reg64%3E-for-Asm"],[17,"impl-Add%3CReg32,+Reg32%3E-for-Asm"],[67,"impl-Dec%3CReg64%3E-for-Asm"],[68,"impl-Dec%3CReg32%3E-for-Asm"],[90,"impl-From%3Cu8%3E-for-Imm8"],[91,"impl-From%3Ci8%3E-for-Imm8"],[92,"impl-From%3Cu16%3E-for-Imm16"],[93,"impl-From%3Cu8%3E-for-Imm16"],[94,"impl-From%3Ci8%3E-for-Imm16"],[96,"impl-From%3Ci16%3E-for-Imm16"],[97,"impl-From%3Cu32%3E-for-Imm32"],[98,"impl-From%3Ci8%3E-for-Imm32"],[99,"impl-From%3Cu16%3E-for-Imm32"],[100,"impl-From%3Ci16%3E-for-Imm32"],[101,"impl-From%3Cu8%3E-for-Imm32"],[103,"impl-From%3Ci32%3E-for-Imm32"],[104,"impl-From%3Ci16%3E-for-Imm64"],[105,"impl-From%3Cu16%3E-for-Imm64"],[106,"impl-From%3Ci64%3E-for-Imm64"],[107,"impl-From%3Cisize%3E-for-Imm64"],[108,"impl-From%3Cusize%3E-for-Imm64"],[109,"impl-From%3Cu8%3E-for-Imm64"],[110,"impl-From%3Ci32%3E-for-Imm64"],[111,"impl-From%3Cu32%3E-for-Imm64"],[112,"impl-From%3Cu64%3E-for-Imm64"],[114,"impl-From%3Ci8%3E-for-Imm64"],[136,"impl-Mov%3CReg64,+Reg64%3E-for-Asm"],[137,"impl-Mov%3CMemOp,+Reg32%3E-for-Asm"],[138,"impl-Mov%3CReg8,+MemOp%3E-for-Asm"],[139,"impl-Mov%3CMemOp,+Imm16%3E-for-Asm"],[140,"impl-Mov%3CReg8,+Reg8%3E-for-Asm"],[141,"impl-Mov%3CReg16,+MemOp%3E-for-Asm"],[142,"impl-Mov%3CReg32,+MemOp%3E-for-Asm"],[143,"impl-Mov%3CReg16,+Imm16%3E-for-Asm"],[144,"impl-Mov%3CReg32,+Reg32%3E-for-Asm"],[145,"impl-Mov%3CReg64,+Imm64%3E-for-Asm"],[146,"impl-Mov%3CMemOp,+Reg8%3E-for-Asm"],[147,"impl-Mov%3CMemOp,+Reg16%3E-for-Asm"],[148,"impl-Mov%3CReg64,+MemOp%3E-for-Asm"],[149,"impl-Mov%3CReg8,+Imm8%3E-for-Asm"],[150,"impl-Mov%3CMemOp,+Reg64%3E-for-Asm"],[151,"impl-Mov%3CReg16,+Reg16%3E-for-Asm"],[152,"impl-Mov%3CReg32,+Imm32%3E-for-Asm"],[157,"impl-Pop%3CReg16%3E-for-Asm"],[158,"impl-Pop%3CReg64%3E-for-Asm"],[159,"impl-Push%3CReg16%3E-for-Asm"],[160,"impl-Push%3CReg64%3E-for-Asm"],[206,"impl-Test%3CMemOp,+Imm16%3E-for-Asm"],[207,"impl-Test%3CReg64,+Reg64%3E-for-Asm"],[208,"impl-Test%3CReg32,+Reg32%3E-for-Asm"]]}],\ ["tiny_vm",{"doc":"TinyVm example.","t":"PPPPPPPFPPPFPGGFNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNHHHNNNNNNNNNNNNNNNNNNNNNNN","n":["A","Add","Addi","B","Branch","BranchZero","C","Fixup","Halt","Load","LoadImm","PhysAddr","Store","TinyInsn","TinyReg","TinyVm","bind","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","dump","eq","eq","fmt","fmt","from","from","from","from","from","interp","into","into","into","into","into","into","jit","make_tinyvm_fib","make_tinyvm_jit_perf","make_tinyvm_jit_test","new","new","read_mem","read_reg","to_owned","to_owned","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","write_mem","write_reg"],"q":[[0,"tiny_vm"],[75,"alloc::vec"],[76,"core::fmt"],[77,"core::fmt"],[78,"core::any"]],"d":["","Add the register to the register reg1 += reg2.","Add the immediate to the register reg += imm.","","Jump unconditional (absolute addressing) pc = disp.","Jump if the register is zero (absolute addressing) …","","A minial fixup utility to implement jump labels when …","Halt the VM.","Load a value from the memory (absolute addressing) into …","Load the immediate value into the register reg = imm.","A guest physical address.","Store a value from the register into the memory (absolute …","The instructions for the TinyVm.","The registers for the TinyVm.","The TinyVm virtual machine state.","Bind the Fixup to the current location of prog and resolve …","","","","","","","","","","","","","","","Dump the VM state to stdout.","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Run in interpreter mode until the next TinyInsn::Halt …","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Run in JIT mode until the next TinyInsn::Halt instruction …","Generate a guest program to compute the fiibonacci …","Generate a simple count down loop to crunch some …","Generate a test program for the jit.","Create a new TinyVm and initialize the instruction memory …","Create a new Fixup at the current pc.","Read guest data memory.","Read guest register.","","","","","","","","","","","","","","","","","","Write guest data memory.","Write guest register."],"i":[5,2,2,5,2,2,5,0,2,2,2,0,2,0,0,0,1,10,6,1,5,2,10,6,1,5,2,5,2,5,2,6,5,2,5,2,10,6,1,5,2,6,10,10,6,1,5,2,6,0,0,0,6,1,6,6,5,2,10,6,1,5,2,10,6,1,5,2,10,6,1,5,2,6,6],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[1,[3,[2]]],4],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[5,5],[2,2],[[-1,-2],4,[],[]],[[-1,-2],4,[],[]],[6,4],[[5,5],7],[[2,2],7],[[5,8],9],[[2,8],9],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[6,4],[10,11],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[6,4],[12,[[3,[2]]]],[[],[[3,[2]]]],[[],[[3,[2]]]],[[[3,[2]]],6],[11,1],[[6,10],12],[[6,5],12],[-1,-2,[],[]],[-1,-2,[],[]],[-1,[[13,[-2]]],[],[]],[-1,[[13,[-2]]],[],[]],[-1,[[13,[-2]]],[],[]],[-1,[[13,[-2]]],[],[]],[-1,[[13,[-2]]],[],[]],[-1,[[13,[-2]]],[],[]],[-1,[[13,[-2]]],[],[]],[-1,[[13,[-2]]],[],[]],[-1,[[13,[-2]]],[],[]],[-1,[[13,[-2]]],[],[]],[-1,14,[]],[-1,14,[]],[-1,14,[]],[-1,14,[]],[-1,14,[]],[[6,10,12],4],[[6,5,12],4]],"c":[],"p":[[5,"Fixup",0],[6,"TinyInsn",0],[5,"Vec",75],[1,"tuple"],[6,"TinyReg",0],[5,"TinyVm",0],[1,"bool"],[5,"Formatter",76],[8,"Result",76],[5,"PhysAddr",0],[1,"usize"],[1,"u16"],[6,"Result",77],[5,"TypeId",78]],"b":[]}]\ ]')); if (typeof exports !== 'undefined') exports.searchIndex = searchIndex; diff --git a/src-files.js b/src-files.js index d85add1..fe5bae1 100644 --- a/src-files.js +++ b/src-files.js @@ -1,7 +1,7 @@ var srcIndex = new Map(JSON.parse('[\ ["add",["",[],["add.rs"]]],\ ["fib",["",[],["fib.rs"]]],\ -["juicebox_asm",["",[["insn",[],["add.rs","call.rs","cmp.rs","dec.rs","jmp.rs","jnz.rs","jz.rs","mov.rs","nop.rs","pop.rs","push.rs","ret.rs","test.rs"]]],["asm.rs","imm.rs","insn.rs","label.rs","lib.rs","reg.rs","rt.rs"]]],\ +["juicebox_asm",["",[["insn",[],["add.rs","call.rs","cmovnz.rs","cmovz.rs","cmp.rs","dec.rs","jmp.rs","jnz.rs","jz.rs","mov.rs","nop.rs","pop.rs","push.rs","ret.rs","test.rs"]]],["asm.rs","imm.rs","insn.rs","label.rs","lib.rs","reg.rs","rt.rs"]]],\ ["tiny_vm",["",[],["tiny_vm.rs"]]]\ ]')); createSrcSidebar(); 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 @@ 342 343 344 +345
//! The `x64` jit assembler.
 
 use crate::*;
@@ -437,7 +438,7 @@
     // -- Encode utilities.
 
     /// Encode an register-register instruction.
-    pub(crate) fn encode_rr<T: Reg>(&mut self, opc: u8, op1: T, op2: T)
+    pub(crate) fn encode_rr<T: Reg>(&mut self, opc: &[u8], op1: T, op2: T)
     where
         Self: EncodeRR<T>,
     {
@@ -454,7 +455,8 @@
         let rex = <Self as EncodeRR<T>>::rex(op1, op2);
 
         self.emit_optional(&[prefix, rex]);
-        self.emit(&[opc, modrm]);
+        self.emit(opc);
+        self.emit(&[modrm]);
     }
 
     /// 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 @@
 85
 86
 87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
 
//! Trait definitions of various instructions.
 
 mod add;
 mod call;
+mod cmovnz;
+mod cmovz;
 mod cmp;
 mod dec;
 mod jmp;
@@ -114,6 +132,20 @@
     fn call(&mut self, op1: T);
 }
 
+pub trait Cmovnz<T, U> {
+    /// Emit a (conditional) move if not zero instruction.
+    ///
+    /// Move is only commited if (ZF=0).
+    fn cmovnz(&mut self, op1: T, op2: U);
+}
+
+pub trait Cmovz<T, U> {
+    /// Emit a (conditional) move if zero instruction.
+    ///
+    /// Move is only commited if (ZF=1).
+    fn cmovz(&mut self, op1: T, op2: U);
+}
+
 /// Trait for [`cmp`](https://www.felixcloutier.com/x86/cmp) instruction kinds.
 pub trait Cmp<T, U> {
     /// 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 @@
 
 impl Add<Reg64, Reg64> for Asm {
     fn add(&mut self, op1: Reg64, op2: Reg64) {
-        self.encode_rr(0x01, op1, op2);
+        self.encode_rr(&[0x01], op1, op2);
     }
 }
 
 impl Add<Reg32, Reg32> for Asm {
     fn add(&mut self, op1: Reg32, op2: Reg32) {
-        self.encode_rr(0x01, op1, op2);
+        self.encode_rr(&[0x01], 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 @@
+cmovnz.rs - source
+    
1
+2
+3
+4
+5
+6
+7
+8
+
use super::Cmovnz;
+use crate::{Asm, Reg64};
+
+impl Cmovnz<Reg64, Reg64> for Asm {
+    fn cmovnz(&mut self, op1: Reg64, op2: Reg64) {
+        self.encode_rr(&[0x0f, 0x45], op2, op1);
+    }
+}
+
\ 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 @@ +cmovz.rs - source +
1
+2
+3
+4
+5
+6
+7
+8
+
use super::Cmovz;
+use crate::{Asm, Reg64};
+
+impl Cmovz<Reg64, Reg64> for Asm {
+    fn cmovz(&mut self, op1: Reg64, op2: Reg64) {
+        self.encode_rr(&[0x0f, 0x44], op2, op1);
+    }
+}
+
\ 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 @@
impl Mov<Reg64, Reg64> for Asm { fn mov(&mut self, op1: Reg64, op2: Reg64) { - self.encode_rr(0x89, op1, op2); + self.encode_rr(&[0x89], op1, op2); } } impl Mov<Reg32, Reg32> for Asm { fn mov(&mut self, op1: Reg32, op2: Reg32) { - self.encode_rr(0x89, op1, op2); + self.encode_rr(&[0x89], op1, op2); } } impl Mov<Reg16, Reg16> for Asm { fn mov(&mut self, op1: Reg16, op2: Reg16) { - self.encode_rr(0x89, op1, op2); + self.encode_rr(&[0x89], op1, op2); } } impl Mov<Reg8, Reg8> for Asm { fn mov(&mut self, op1: Reg8, op2: Reg8) { - self.encode_rr(0x88, op1, op2); + self.encode_rr(&[0x88], 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 @@ impl Test<Reg64, Reg64> for Asm { fn test(&mut self, op1: Reg64, op2: Reg64) { - self.encode_rr(0x85, op1, op2); + self.encode_rr(&[0x85], op1, op2); } } impl Test<Reg32, Reg32> for Asm { fn test(&mut self, op1: Reg32, op2: Reg32) { - self.encode_rr(0x85, op1, op2); + self.encode_rr(&[0x85], op1, op2); } } diff --git a/src/tiny_vm/tiny_vm.rs.html b/src/tiny_vm/tiny_vm.rs.html index 938bc61..e8937f6 100644 --- a/src/tiny_vm/tiny_vm.rs.html +++ b/src/tiny_vm/tiny_vm.rs.html @@ -744,7 +744,7 @@ use juicebox_asm::insn::*; use juicebox_asm::Runtime; -use juicebox_asm::{Asm, Imm16, Imm64, Label, MemOp, Reg16, Reg64}; +use juicebox_asm::{Asm, Imm16, Imm64, MemOp, Reg16, Reg64}; /// A guest physical address. pub struct PhysAddr(pub u16); @@ -1036,13 +1036,13 @@ TinyInsn::BranchZero(a, disp) => { bb.cmp(reg_op(a), Imm16::from(0u16)); bb.mov(Reg64::rax, Imm64::from(bb_icnt())); - bb.mov(Reg64::rdx, Imm64::from(reenter_pc(disp))); + // Default fall-through PC (branch not taken). + bb.mov(Reg64::rdx, Imm64::from(reenter_pc(pc))); + + // Conditionally update PC if condition is ZERO (branch taken). + bb.mov(Reg64::r11, Imm64::from(reenter_pc(disp))); + bb.cmovz(Reg64::rdx, Reg64::r11); - let mut skip_next_pc = Label::new(); - // If register is zero, skip setting next pc as reenter pc. - bb.jz(&mut skip_next_pc); - bb.mov(Reg64::rdx, Imm64::from(reenter_pc(pc))); - bb.bind(&mut skip_next_pc); bb.ret(); break 'outer; } diff --git a/trait.impl/juicebox_asm/insn/trait.Cmovnz.js b/trait.impl/juicebox_asm/insn/trait.Cmovnz.js new file mode 100644 index 0000000..fccfcd2 --- /dev/null +++ b/trait.impl/juicebox_asm/insn/trait.Cmovnz.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"juicebox_asm":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/juicebox_asm/insn/trait.Cmovz.js b/trait.impl/juicebox_asm/insn/trait.Cmovz.js new file mode 100644 index 0000000..fccfcd2 --- /dev/null +++ b/trait.impl/juicebox_asm/insn/trait.Cmovz.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"juicebox_asm":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file -- cgit v1.2.3