-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add riscv64 backend for cranelift. #4271
Merged
Merged
Changes from all commits
Commits
Show all changes
208 commits
Select commit
Hold shift + click to select a range
a638a87
risc-v hello_work works
756445638 4a2c69f
virtual sp ajust
756445638 ee7225e
better print for Amode
756445638 c7dc9b8
wired..
756445638 62e74ae
float compare
756445638 60a44a1
atomic operations and op_name
756445638 53a3915
commit for save now.
756445638 90690c3
name upper snake case to camel case
756445638 a4dbc28
float compare and refactor int compare and ...
756445638 1c7c644
some regclass error
756445638 1592896
Merge branch 'bytecodealliance:main' into risc-v
yuyang-ok ff0af05
simple atomic operation
756445638 d1837ed
Merge branch 'risc-v' of https://github.com/yuyang-ok/wasmtime into r…
756445638 fb9a098
keep up with upstream
756445638 018448b
Merge branch 'bytecodealliance:main' into risc-v
yuyang-ok acdd022
save prologue register error and abi
756445638 1fe486d
load and store
756445638 075fc04
test_riscv64_binemit and abi is wried
756445638 61ef4f0
abi reference outdated paper
756445638 6490e28
atomic load and store
756445638 03d5b18
Jump -> Jal
756445638 e47480c
you cannot know patch size at lower stage,so BranchTarge::Patch is al…
756445638 3679f94
Merge branch 'bytecodealliance:main' into risc-v
yuyang-ok 2dcd48a
reg alloc not working but I need merge upstream
756445638 1252292
Merge branch 'risc-v' of https://github.com/yuyang-ok/wasmtime into r…
756445638 fac524c
use alloc consumer correctly
756445638 a89e43e
missing bind label
756445638 8b3705c
lower select
756445638 c5b12b8
lower is_null
756445638 f6fc47d
i128 compare
756445638 8c730fb
brtable
756445638 5c0f12c
emit test
756445638 ba132f6
emit_test forget fcsr operations
756445638 a09120d
Merge branch 'bytecodealliance:main' into risc-v
yuyang-ok e246e89
jalr12 is not a labeluse
756445638 5ffa538
atomic cas and atomic sub
756445638 c87312c
extend integer and bool value
756445638 d0cc8e9
lower insts
756445638 2af34ca
imax ,imin ... and fadd
756445638 1247e91
float binary op generate moved different palce
756445638 289ac35
risc_v rename to riscv64
756445638 ccd2347
branch offset should contains itself
756445638 554ef78
Update main.yml
yuyang-ok 1b17f30
callind
756445638 0b642eb
Merge branch 'risc-v' of https://github.com/yuyang-ok/wasmtime into r…
756445638 0842513
gen callind,look like caller save register not save,figure it out.
756445638 fe2d9a8
explicitly save ra register.
756445638 5df6e49
lower load_addr
756445638 5429858
Merge branch 'bytecodealliance:main' into risc-v
yuyang-ok 2dcdb34
atomic cas test on my qemu emulator
756445638 f03b082
pass test arithmetic.clif on my local machine.
756445638 7e90d80
Merge branch 'bytecodealliance:main' into risc-v
yuyang-ok 8240808
generate bool const and band
756445638 3fc2560
Merge branch 'risc-v' of https://github.com/yuyang-ok/wasmtime into r…
756445638 de1b428
i128 add implemented
756445638 4a0db0d
i12b sub implemented.
756445638 142ca99
compute_abi_loc should in params order
756445638 c825028
read and write csrs
756445638 736eb21
add bitmanip instructions
756445638 92f9d49
I need mrege upstream
756445638 e77a395
emit test for bitmanip
756445638 cf687eb
Merge branch 'bytecodealliance:main' into risc-v
yuyang-ok 0466b9b
Merge branch 'bytecodealliance:main' into risc-v
yuyang-ok a8ca031
keep up with upstream
yuyang-ok df3173b
Merge branch 'risc-v' of https://github.com/yuyang-ok/wasmtime into r…
yuyang-ok 5147f7d
compute args location
yuyang-ok 83aa914
Merge branch 'bytecodealliance:main' into risc-v
yuyang-ok 89e8f32
brbr_table
yuyang-ok 1985271
uextend
yuyang-ok a3a44a0
modify the design of funct12
yuyang-ok 386a5d4
implemente band_not
yuyang-ok bf222c5
lower icmp and popcnt
yuyang-ok d18f4f6
lower float compare
yuyang-ok 281173c
mul high part
yuyang-ok 2276e3c
lower rotl and rotr
yuyang-ok 11c0599
lower i128 compare
yuyang-ok 0eceee5
riscv64 add first pricise-output test
yuyang-ok c8df735
lower cls
yuyang-ok f85c4c3
lower ctz
yuyang-ok 8b9bf6e
lower i128 xnor
yuyang-ok 0443019
lower bits rotation.
yuyang-ok e90472b
remove function patch_taken_list.
yuyang-ok 2887e37
lower float operations
yuyang-ok 0c3df39
fcvt_int_sat missing save fcsr
yuyang-ok 9dbc1b3
lower call
yuyang-ok 1314026
lower instruction and add some test
yuyang-ok 047c188
implement bitrev.
yuyang-ok a295c76
look up architecture for riscv64
yuyang-ok c3b7aae
lower cls
yuyang-ok 0833064
lower i128 sshr.
yuyang-ok b38375a
lowering instructions.
yuyang-ok 7ae0a77
lowring and do some testing.
yuyang-ok df86448
emit island for brtable emit and caculate worst instruction size.
yuyang-ok da1b55d
move some code.
yuyang-ok 38bad2e
using float rounding mode in instruction instead of fcsr.
yuyang-ok 8e82985
divide integer operation and float operation instruction.
yuyang-ok bf4f94c
emit call.
yuyang-ok 93e9e43
lowering instrctions and maybe better naming.
yuyang-ok 5d7f4ab
riscv64 mod test.
yuyang-ok 006d1ae
remove static TRIPLE
yuyang-ok 2e17b2d
add precise-output test.
yuyang-ok 350211a
format uextend and sextend.
yuyang-ok d525770
generate settings for riscv64gc
yuyang-ok a4e94f3
test target shoule be riscv64gc.
yuyang-ok 506db09
add some test for float.
yuyang-ok 6c9cac3
add all float test for riscv64.
yuyang-ok b0a3ac4
Merge branch 'bytecodealliance:main' into risc-v
yuyang-ok 6af7fb1
fix load constant bug.
yuyang-ok b1ab139
atomic operations.
yuyang-ok 18fd653
pass all runtests.
yuyang-ok aa6fcd2
handle immediates.
yuyang-ok 50d627e
some tests.
yuyang-ok fd3ce1a
Update main.yml
yuyang-ok 68f1c80
fix LableUse max range error.
yuyang-ok 851354c
Merge branch 'risc-v' of https://github.com/yuyang-ok/wasmtime into r…
yuyang-ok bd31fda
construct_auipc_and_jalr should use generate_imm and some better coding.
yuyang-ok 788290e
reimplemented floatnot equal compare and float compare args.
yuyang-ok 3cce489
float to int representation should use little endian.
yuyang-ok d154b77
comment in assembly should using '##' instead of ';;'.
yuyang-ok da37a7a
modify the way to construct AluRRImm12.
yuyang-ok 67c0d55
aluRRImm12 emiting.
yuyang-ok 570c88b
Merge branch 'bytecodealliance:main' into risc-v
yuyang-ok c9e487c
lower atomic rmw using ISLE.
yuyang-ok fa409ba
rewrite float lowering using ISLE.
yuyang-ok c31e977
rewrite some handwritten code to ISLE.
yuyang-ok f2109d3
Merge branch 'bytecodealliance:main' into risc-v
yuyang-ok 48592cc
continue to rewritting handwritten code to ISLE.
yuyang-ok 32c93d1
rewrite load store and fcmp to ISLE.
yuyang-ok 80c5ec4
rewrite float convert and symbol_value ... to ISLE.
yuyang-ok e922f95
rewrite clz and i128 add ... to ISLE.
yuyang-ok 933a5af
remote cls umlhi and ... to ISLE.
yuyang-ok 4745f9c
remove parameter Type for alu_rrr.
yuyang-ok b9868ed
rewite i128 rorate to ISLE.
yuyang-ok b07a99e
lower i128 rotate remove shamt127.
yuyang-ok 25d6ade
reimplemented cls.
yuyang-ok 3093d1c
Merge branch 'main' of https://github.com/bytecodealliance/wasmtime i…
yuyang-ok 02c8876
rewrite i128 shifts to ISLE.
yuyang-ok 8bca3d2
remove term ty_unused_bits_neg.
yuyang-ok 65f0e43
rewrite selectif trapif... to ISLE.
yuyang-ok f26d2db
float binary op should move to x and atomic_store.
yuyang-ok e599fd7
reimplemet atomic load store cas ...
yuyang-ok 117df88
better sextend.
yuyang-ok 8e88517
save ra register at gen_prologue_frame_setup.
yuyang-ok eb8dc89
lowering integer compare.
yuyang-ok 4c0a8f3
remove gcc tool chain in emit_test.rs.
yuyang-ok 7cef970
save return address using wrong stack offset.
yuyang-ok ac2219a
Merge branch 'bytecodealliance:main' into risc-v
yuyang-ok 027bfe2
add unwindinfo for riscv64.
yuyang-ok c8b2142
fabs implemetation and run tests.
yuyang-ok 67962f7
emiting nearest ceil ....
yuyang-ok 03f377d
rename riscv64gc to riscv64
yuyang-ok 6e6da4d
fmax-pseudo implement in riscv64 and code tidy.
yuyang-ok 05b31d6
missing meta file for riscv64.
yuyang-ok ed14d45
remove function param_or_rets_xregs.
yuyang-ok bf5d0ad
Update run_command.rs
yuyang-ok 64a03c7
add test fadd ... on riscv64.
yuyang-ok 485b982
riscv64 merge upstream.
yuyang-ok c05c82d
Merge branch 'risc-v' of https://github.com/yuyang-ok/wasmtime into r…
yuyang-ok 0487b9d
emit libcall.
yuyang-ok ddda7c6
port fiber to riscv64 but unwind not working.
yuyang-ok 1184370
fix riscv64 fiber cfi directives.
yuyang-ok cd86265
keep up with upstream.
yuyang-ok 2c0f434
Update main.yml
yuyang-ok ecfba31
code tidy.
yuyang-ok 283753d
port riscv64 trampolines traphandlers ...
yuyang-ok 6a1de05
gen probe_stack and int_zero_reg can take bool type.
yuyang-ok 5cbaa01
riscv reloc and dwarf register mapping.
yuyang-ok 5f66faf
implemented popcnt when extension B are absent and setup frame ...
yuyang-ok 1dbfb79
implemented rev8... when b extension is missing.
yuyang-ok 1260b00
remodel call convertion from x86_64.
yuyang-ok bf03d8a
wasmtime_system_v only use one register to store result.
yuyang-ok 19ef4a6
riscv64 wasmtime abi only one value can in a register.
yuyang-ok dee6661
add HeapOutOfBounds for memory operation.
yuyang-ok cfb3371
re-implemented rev8 using loop.
yuyang-ok 3ab74a5
Merge branch 'main' of https://github.com/bytecodealliance/wasmtime i…
yuyang-ok 78a1bc6
Merge branch 'main' of https://github.com/bytecodealliance/wasmtime i…
yuyang-ok 34477cf
riscv support atomic i8 and i16.
yuyang-ok 8c5b50f
Merge branch 'main' of https://github.com/bytecodealliance/wasmtime i…
yuyang-ok 940d5ea
float convert to int overflow and div by zero exceptions.
yuyang-ok f0d5235
fix br_table.
yuyang-ok 0de2cd5
move i32 to f32 register use fmv.w.x instead of fmx.d.x.
yuyang-ok 0dc632f
gen divide by zero trap at ISLE.
yuyang-ok b0d4930
Merge branch 'bytecodealliance:main' into risc-v
yuyang-ok 5cf133b
Fix some errors, and disable SIMD tests on rv64gc.
cfallin ec084de
Merge remote-tracking branch 'upstream/main' into risc-v
cfallin 12316b8
Test updates.
cfallin 07e90ba
cargo-fmt.
cfallin 28e2d8f
Miscellaneous fixups.
cfallin dc8b7ee
cargo-fmt.
cfallin 73c7096
add inline_probe_stack and remove some extractor for ISLE.
yuyang-ok 924f67f
load_ra base on if preserve_frame_pointers.
yuyang-ok b51a998
uadd_overflow add i8... and add for i128.
yuyang-ok 9f283ef
Run CI on all branches
afonso360 e3f5de3
Add riscv64 builds
afonso360 d3ef08b
cranelift: Cleanup warning
afonso360 eb7148a
Merge branch 'main' of https://github.com/bytecodealliance/wasmtime i…
yuyang-ok 5887d57
Merge branch 'risc-v' of https://github.com/afonso360/wasmtime into r…
yuyang-ok 995a695
disable host_segfault async pooling-alloctor test.
yuyang-ok 16b1b19
Merge branch 'main' of https://github.com/bytecodealliance/wasmtime i…
yuyang-ok 862c9ad
fix accidently remove test target for urem.clif.
yuyang-ok e48549a
Merge branch 'main' of https://github.com/bytecodealliance/wasmtime i…
yuyang-ok 822ebd5
fix gen_call and gen_memcpy.
yuyang-ok b20499a
fix riscv64 test compiler-output.
yuyang-ok 5463532
fix test_isa_flags_mismatch test failed on riscv64.
yuyang-ok 75ef742
fix test_isa_flags_mismatch test failed on riscv64.
yuyang-ok e71d655
Merge branch 'main' of https://github.com/bytecodealliance/wasmtime i…
yuyang-ok 0aa33c1
fix ISLE formatting.
yuyang-ok 96ef1e7
fix is_isa_compatible for riscv64.
yuyang-ok File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you say what ELF relocation kind this is equivalent to?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not very clear, I found it in riscv-abi.pdf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cfallin I not quit understand the question.
I found this at riscv-abi.pdf .
riscv-abi.pdf