Skip to content

Commit

Permalink
Merge pull request #14 from parasyte/fix/non-x86
Browse files Browse the repository at this point in the history
Fix build on non-x86 platforms
  • Loading branch information
Rodrigodd authored Dec 24, 2024
2 parents 7cd9212 + d9b680d commit de6258f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions native/src/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use std::{
time::{Duration, Instant},
};

#[cfg(target_arch = "x86_64")]
use gameroy_jit::CompilerOpts;
use gameroy_lib::gameroy::{
consts::CLOCK_SPEED,
Expand Down Expand Up @@ -42,6 +43,7 @@ fn print_val(val: f64, err: f64) -> String {
format!("{:.p$} +/- {:.p$}", val, err, p = p)
}

#[allow(unused_variables)]
pub fn benchmark(
Bench {
rom_path: ref path,
Expand Down Expand Up @@ -109,9 +111,12 @@ pub fn benchmark(
);

// Remove first run, because in that one the code is traced.
times.remove(0);
#[cfg(target_arch = "x86_64")]
{
times.remove(0);

print_stats(times, game_boy.clock_count - start_clock_count);
print_stats(times, game_boy.clock_count - start_clock_count);
}
}
}

Expand Down Expand Up @@ -169,6 +174,7 @@ fn run_jitted(
times
}

#[cfg(target_arch = "x86_64")]
#[inline(never)]
fn pre_run(game_boy: &mut GameBoy, timeout: u64, jit_compiler: &mut gameroy_jit::JitCompiler) {
game_boy.reset();
Expand Down

0 comments on commit de6258f

Please sign in to comment.