-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add riscv64 backend for cranelift. (#4271)
Add a RISC-V 64 (`riscv64`, RV64GC) backend. Co-authored-by: yuyang <[email protected]> Co-authored-by: Chris Fallin <[email protected]> Co-authored-by: Afonso Bordado <[email protected]>
- Loading branch information
1 parent
9715d91
commit cdecc85
Showing
182 changed files
with
21,024 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM ubuntu:22.04 | ||
|
||
RUN apt-get update -y && apt-get install -y gcc gcc-riscv64-linux-gnu ca-certificates | ||
|
||
ENV PATH=$PATH:/rust/bin | ||
ENV CARGO_BUILD_TARGET=riscv64gc-unknown-linux-gnu | ||
ENV CARGO_TARGET_RISCV64GC_UNKNOWN_LINUX_GNU_LINKER=riscv64-linux-gnu-gcc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
use crate::cdsl::isa::TargetIsa; | ||
use crate::cdsl::settings::{SettingGroup, SettingGroupBuilder}; | ||
|
||
use crate::shared::Definitions as SharedDefinitions; | ||
|
||
fn define_settings(_shared: &SettingGroup) -> SettingGroup { | ||
let mut setting = SettingGroupBuilder::new("riscv64"); | ||
|
||
let _has_m = setting.add_bool("has_m", "has extension M?", "", false); | ||
let _has_a = setting.add_bool("has_a", "has extension A?", "", false); | ||
let _has_f = setting.add_bool("has_f", "has extension F?", "", false); | ||
let _has_d = setting.add_bool("has_d", "has extension D?", "", false); | ||
let _has_v = setting.add_bool("has_v", "has extension V?", "", false); | ||
let _has_b = setting.add_bool("has_b", "has extension B?", "", false); | ||
let _has_c = setting.add_bool("has_c", "has extension C?", "", false); | ||
let _has_zbkb = setting.add_bool("has_zbkb", "has extension zbkb?", "", false); | ||
|
||
let _has_zicsr = setting.add_bool("has_zicsr", "has extension zicsr?", "", false); | ||
let _has_zifencei = setting.add_bool("has_zifencei", "has extension zifencei?", "", false); | ||
|
||
setting.build() | ||
} | ||
|
||
pub(crate) fn define(shared_defs: &mut SharedDefinitions) -> TargetIsa { | ||
let settings = define_settings(&shared_defs.settings); | ||
TargetIsa::new("riscv64", settings) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.