add riscv64 backend for cranelift. (#4271)

Add a RISC-V 64 (`riscv64`, RV64GC) backend.

Co-authored-by: yuyang <756445638@qq.com>
Co-authored-by: Chris Fallin <chris@cfallin.org>
Co-authored-by: Afonso Bordado <afonsobordado@az8.co>
This commit is contained in:
yuyang-ok
2022-09-28 08:30:31 +08:00
committed by GitHub
parent 9715d91c50
commit cdecc858b4
182 changed files with 21024 additions and 36 deletions

View File

@@ -30,8 +30,8 @@ wasmi = "0.11.0"
# We rely on precompiled v8 binaries, but rusty-v8 doesn't have a precompiled
# binary for MinGW which is built on our CI. It does have one for Windows-msvc,
# though, so we could use that if we wanted. For now though just simplify a bit
# and don't depend on this on Windows. The same applies on s390x.
[target.'cfg(not(any(windows, target_arch = "s390x")))'.dependencies]
# and don't depend on this on Windows. The same applies on s390x and riscv.
[target.'cfg(not(any(windows, target_arch = "s390x", target_arch = "riscv64")))'.dependencies]
v8 = "0.44.3"
[dev-dependencies]

View File

@@ -31,7 +31,7 @@ use std::time::{Duration, Instant};
use wasmtime::*;
use wasmtime_wast::WastContext;
#[cfg(not(any(windows, target_arch = "s390x")))]
#[cfg(not(any(windows, target_arch = "s390x", target_arch = "riscv64")))]
mod diff_v8;
static CNT: AtomicUsize = AtomicUsize::new(0);

View File

@@ -24,9 +24,9 @@ pub fn build(
#[cfg(not(feature = "fuzz-spec-interpreter"))]
"spec" => return Ok(None),
#[cfg(not(any(windows, target_arch = "s390x")))]
#[cfg(not(any(windows, target_arch = "s390x", target_arch = "riscv64")))]
"v8" => Box::new(crate::oracles::diff_v8::V8Engine::new(config)),
#[cfg(any(windows, target_arch = "s390x"))]
#[cfg(any(windows, target_arch = "s390x", target_arch = "riscv64"))]
"v8" => return Ok(None),
_ => panic!("unknown engine {name}"),