From 130746bc856f5c2eb5672cceb0e1304ee2c95b1e Mon Sep 17 00:00:00 2001 From: johannst Date: Wed, 28 Feb 2024 18:32:44 +0000 Subject: deploy: 7cc72737a0140f5f71e9d83d4f87503eb4c7604f --- src/add/add.rs.html | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/add/add.rs.html') diff --git a/src/add/add.rs.html b/src/add/add.rs.html index dc8c566..5e602fb 100644 --- a/src/add/add.rs.html +++ b/src/add/add.rs.html @@ -1,4 +1,5 @@ -add.rs - source
1
+add.rs - source
+    
1
 2
 3
 4
@@ -41,14 +42,14 @@
 //! Jit compile a function at runtime (generate native host code) which calls a function defined in
 //! the example based on the SystemV abi to demonstrate the [`juicebox_asm`] crate.
 
-#[cfg(not(any(target_arch = "x86_64", target_os = "linux")))]
-compile_error!("Only supported on x86_64 with SystemV abi");
+#[cfg(not(any(target_arch = "x86_64", target_os = "linux")))]
+compile_error!("Only supported on x86_64 with SystemV abi");
 
 use juicebox_asm::insn::*;
 use juicebox_asm::Runtime;
 use juicebox_asm::{Asm, Imm64, Reg64::*};
 
-extern "C" fn add(a: u32, b: u32) -> u32 {
+extern "C" fn add(a: u32, b: u32) -> u32 {
     a + b
 }
 
@@ -66,10 +67,10 @@
     asm.ret();
 
     let code = asm.into_code();
-    std::fs::write("jit.asm", &code).unwrap();
+    std::fs::write("jit.asm", &code).unwrap();
 
     let mut rt = Runtime::new();
-    let add42 = unsafe { rt.add_code::<extern "C" fn(u32) -> u32>(code) };
+    let add42 = unsafe { rt.add_code::<extern "C" fn(u32) -> u32>(code) };
 
     let res = add42(5);
     assert_eq!(res, 47);
-- 
cgit v1.2.3