-
Notifications
You must be signed in to change notification settings - Fork 824
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 AArch64 support for singlepass. #713
Merged
Merged
Changes from 48 commits
Commits
Show all changes
131 commits
Select commit
Hold shift + click to select a range
4210715
AArch64 translation module.
losfair ce7c903
Add impl for more instructions for aarch64 translator.
losfair d3227f8
More instructions & aarch64 trampolines.
losfair 9b77677
Relax constraints a bit to compile on aarch64.
losfair 2af69f6
Fixed compilation on aarch64.
losfair 96163a0
Temporarily disable all lints in runtime-core.
losfair 05557fc
Bump dynasm to v0.5.1
losfair d8b313e
Fix emit_lea.
losfair 574e4c4
Print return value from pure WASM binary.
losfair b57aba4
Add homomorphic host redirection abstraction for vm->host calls.
losfair 97b75d0
Ensure callee-saved registers are properly preserved.
losfair e406005
Add missing `emit_mov` variants.
losfair 72b6123
Fix memory grow
losfair 8a91f80
Fix return from homomorphic host redirection trampoline.
losfair 5f8b289
movzx/movsx
losfair a124d87
Fix Operator::MemorySize.
losfair 3dadbc1
Integer subset done.
losfair 89d8b5a
Fixes for aarch64.
losfair b304317
More mov variants.
losfair 80d6c4c
Implement get_fault_info for aarch64.
losfair e0e7d58
Make state mapping work on non-x86 architectures.
losfair b5bb3fa
Move {push,pop}_code_version to caller side for non-mananged execution.
losfair c337999
x
losfair bd06aa0
x
losfair 3778352
Update a few examples.
losfair 8ee4b7f
Replace brk with undefined instruction.
losfair 2e1fb7a
Update call_trace middleware to include a counter.
losfair db59127
Inline breakpoint support in core.
losfair 94f9710
Include backend metadata in tiering module.
losfair 36f95fc
Support emitting inline breakpoints in singlepass.
losfair ad3faa0
Add CallTrace CLI option.
losfair c18bdd5
Fix inline breakpoints on macOS.
losfair 5499a69
Run cargo fmt on everything.
losfair 128b006
Add a BlockTrace middleware.
losfair b0b0983
Allow accessing execution state in middleware breakpoint handlers.
losfair ba7e2b7
Add block-trace flag to CLI.
losfair a525907
Emit state information for internal breakpoints.
losfair 2e532fa
Preserve fault.ip when calling middleware.
losfair e5f7dc8
Print the last frame in block trace output.
losfair ee88c45
Allow arbitrary size of `disp`.
losfair 81d538a
Fix disp < 0 case.
losfair 3de0c77
Skip inline non-instruction data.
losfair d325635
Increment aarch64 virtual stack size to 1MB.
losfair 00242cd
Fix LEA simulation on aarch64.
losfair 4df7973
Add mov variants.
losfair 3f35a74
Two more mov variants.
losfair a057296
(S32, Imm64, GPR)
losfair cd0b49e
popcnt for aarch64.
losfair 015491e
Add floating point instructions.
losfair 6135a00
Add itruncf/fconverti fast path.
losfair 0012137
Add fneg.
losfair 50c30ab
runtime-core: Support cross-compilation.
losfair 899fbed
Merge master.
losfair 7d5699c
Add missing instructions for aarch64.
losfair 03a9d1a
Cargo fmt
losfair 03c5614
Rerun cargo fmt
losfair 07ca48a
Try initial travis arm64 setup
bjfish 41d207d
Trigger a build
bjfish 2f699a3
Add cmake to CI
bjfish 9828a37
Whitelist specific branches to run
bjfish 8db67e4
Merge pull request #943 from bjfish/singlepass-aarch64-travis
losfair f1339b4
Fix known_registers size.
losfair c552514
Disable NaN canonicalizing on aarch64.
losfair 47f1e2a
Fix parameter loading.
losfair e2956e7
Run cargo fmt
losfair 08a1dd3
Merge master and add documentation.
losfair ccc474b
Remove debug files.
losfair 605ada7
Run cargo fmt.
losfair 66e9184
Specify test-threads=1 for singlepass spectests.
losfair a9c89eb
Merge remote-tracking branch 'origin/master' into feature/singlepass-…
losfair 342974e
Comment out failing test.
losfair 1db6425
Merge remote-tracking branch 'origin/master' into feature/singlepass-…
losfair 08beb99
Fix popcnt.
losfair cbaa94a
Fix movsx(S32, S64).
losfair 5d2ee4f
Fix floating point comparision involving NaNs.
losfair 1eed6ce
Fix CONSTRUCT_STACK_AND_CALL_WASM for aarch64.
losfair f7f91c3
Merge remote-tracking branch 'origin-http/master' into feature/single…
losfair 23f03f5
Fix compilation failure in tiering.rs.
losfair d7308c3
Fix call_indirect on imported functions.
losfair 06a7e54
Inline entry trampolines.
losfair ddbdb3e
Ignore extra arguments.
losfair 2776dae
Fix entry with more than 5/6 arguments.
losfair 8ebf898
Reduce stack size.
losfair a7577df
Try further reducing preallocated stack size.
losfair 3d48115
Allocate a big enough stack for invoke().
losfair 85b1935
Uncomment previously disabled test.
losfair 98052f8
Unmap stack after call.
losfair 34bb321
Rename `emit_host_redirection`.
losfair c9aa37f
Cleanup.
losfair 93f096b
Fix lint errors when singlepass is disabled.
losfair d56fd96
Merge remote-tracking branch 'origin/master' into feature/singlepass-…
losfair 28ebe5f
Rustfmt
losfair 0c7545d
Tell dynasm we are generating x64 code in `emitter_x64`.
losfair ef1713d
Update install.sh
syrusakbary b77dffb
Merge branch 'master' into feature/singlepass-aarch64
syrusakbary b8aee87
Skip atomic tests for now in singlepass Aarch64
syrusakbary b3322a6
Move xxx.wat to the examples dir
syrusakbary cafad45
Added make wapm command
syrusakbary 27b1789
Move popcnt to examples
syrusakbary e5905c9
Added support for the aarch64/arm64 in the scripts
syrusakbary c531998
Try to generate an arm release on the travis script
syrusakbary 46f43bf
Fix travis config
syrusakbary a4b1b9e
Trying to improve Travis build script
syrusakbary 6a68ff7
Trying to fix sccache in arm
syrusakbary d0437db
Iterating on Travis
syrusakbary 1e886e2
Trying to make cargo happy
syrusakbary 605fdc9
Trying to fix installation
syrusakbary 43a99cd
Trying to upload artifact to GH releases
syrusakbary 10aa6c8
Allow deployment on branch
syrusakbary 4d973da
Don’t try to create a new tag
syrusakbary df43759
Merge remote-tracking branch 'origin/master' into feature/singlepass-…
losfair 5f26fcd
Make cranelift optional and enable singlepass by default on aarch64.
losfair d450761
Merge remote-tracking branch 'origin/feature/singlepass-aarch64' into…
losfair 73cc86d
Fix compilation errors with cranelift.
losfair d135255
Remove accidentally added test files.
losfair 15e3a03
Try fixing compilation on Windows.
losfair c0ff110
Merge remote-tracking branch 'origin/master' into feature/singlepass-…
losfair 6f3e6fa
Try fixing compilation on Windows.
losfair 4ec4fcf
Try fixing middleware failure.
losfair 8709708
Unwind if breakpoint handler returns error.
losfair 4dd810b
Ensure code version metadata is pushed properly.
losfair 7626957
Enable block_trace middleware only on unix.
losfair daee31f
Add changelog entry.
losfair 5da44c3
Add 'fault' placeholder for Windows.
losfair ee7b0d6
Skip push/pop code version on Windows.
losfair 87f4183
Merge remote-tracking branch 'origin/master' into feature/singlepass-…
losfair 0834ccf
Merge branch 'master' into feature/singlepass-aarch64
syrusakbary 21e6766
Try pinning Rust version for arm64 build.
losfair 80fb5b4
Merge remote-tracking branch 'origin/feature/singlepass-aarch64' into…
losfair a691d34
Skip serializing on singlepass
syrusakbary 183dd32
Make travis work only on test branches
syrusakbary 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
Large diffs are not rendered by default.
Oops, something went wrong.
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,20 @@ | ||
(module | ||
(func $main (result i32) | ||
(call $fib (i32.const 40)) | ||
) | ||
|
||
(func $fib (param $n i32) (result i32) | ||
(if (i32.eq (get_local $n) (i32.const 0)) | ||
(then (return (i32.const 1))) | ||
) | ||
(if (i32.eq (get_local $n) (i32.const 1)) | ||
(then (return (i32.const 1))) | ||
) | ||
(i32.add | ||
(call $fib (i32.sub (get_local $n) (i32.const 1))) | ||
(call $fib (i32.sub (get_local $n) (i32.const 2))) | ||
) | ||
) | ||
|
||
(export "main" (func $main)) | ||
) |
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,9 @@ | ||
[package] | ||
name = "hello_world" | ||
version = "0.1.0" | ||
authors = ["losfair <[email protected]>"] | ||
edition = "2018" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] |
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 @@ | ||
fn main() { | ||
for i in 0..8 { | ||
let s = format!("Hello, {}", i); | ||
println!("{}", s); | ||
} | ||
panic!("OK"); | ||
} |
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,153 @@ | ||
use wasmer_runtime_core::{ | ||
codegen::{Event, EventSink, FunctionMiddleware, InternalEvent}, | ||
module::ModuleInfo, | ||
wasmparser::Operator, | ||
}; | ||
|
||
pub struct BlockTrace { | ||
func_idx: usize, | ||
evt_idx: usize, | ||
} | ||
|
||
impl BlockTrace { | ||
pub fn new() -> BlockTrace { | ||
BlockTrace { | ||
func_idx: std::usize::MAX, | ||
evt_idx: 0, | ||
} | ||
} | ||
} | ||
|
||
impl FunctionMiddleware for BlockTrace { | ||
type Error = String; | ||
fn feed_event<'a, 'b: 'a>( | ||
&mut self, | ||
op: Event<'a, 'b>, | ||
_module_info: &ModuleInfo, | ||
sink: &mut EventSink<'a, 'b>, | ||
) -> Result<(), Self::Error> { | ||
match op { | ||
Event::Internal(InternalEvent::FunctionBegin(_)) => { | ||
self.func_idx = self.func_idx.wrapping_add(1); | ||
self.evt_idx = 0; | ||
let func_idx = self.func_idx; | ||
let evt_idx = self.evt_idx; | ||
sink.push(op); | ||
sink.push(Event::Internal(InternalEvent::Breakpoint(Box::new( | ||
move |info| { | ||
eprintln!( | ||
"[BlockTrace] ({}, {}) -> enter_func % {:?}", | ||
func_idx, | ||
evt_idx, | ||
info.fault | ||
.and_then(|x| unsafe { x.read_stack(Some(1)) }) | ||
.unwrap() | ||
.frames[0] | ||
); | ||
Ok(()) | ||
}, | ||
)))) | ||
} | ||
Event::Wasm(Operator::Call { .. }) => { | ||
let func_idx = self.func_idx; | ||
let evt_idx = self.evt_idx; | ||
sink.push(op); | ||
sink.push(Event::Internal(InternalEvent::Breakpoint(Box::new( | ||
move |info| { | ||
eprintln!( | ||
"[BlockTrace] ({}, {}) -> leave_call % {:?}", | ||
func_idx, | ||
evt_idx, | ||
info.fault | ||
.and_then(|x| unsafe { x.read_stack(Some(1)) }) | ||
.unwrap() | ||
.frames[0] | ||
); | ||
Ok(()) | ||
}, | ||
)))) | ||
} | ||
Event::Wasm(Operator::Block { .. }) => { | ||
let func_idx = self.func_idx; | ||
let evt_idx = self.evt_idx; | ||
sink.push(op); | ||
sink.push(Event::Internal(InternalEvent::Breakpoint(Box::new( | ||
move |info| { | ||
eprintln!( | ||
"[BlockTrace] ({}, {}) -> block % {:?}", | ||
func_idx, | ||
evt_idx, | ||
info.fault | ||
.and_then(|x| unsafe { x.read_stack(Some(1)) }) | ||
.unwrap() | ||
.frames[0] | ||
); | ||
Ok(()) | ||
}, | ||
)))) | ||
} | ||
Event::Wasm(Operator::Loop { .. }) => { | ||
let func_idx = self.func_idx; | ||
let evt_idx = self.evt_idx; | ||
sink.push(op); | ||
sink.push(Event::Internal(InternalEvent::Breakpoint(Box::new( | ||
move |info| { | ||
eprintln!( | ||
"[BlockTrace] ({}, {}) -> loop % {:?}", | ||
func_idx, | ||
evt_idx, | ||
info.fault | ||
.and_then(|x| unsafe { x.read_stack(Some(1)) }) | ||
.unwrap() | ||
.frames[0] | ||
); | ||
Ok(()) | ||
}, | ||
)))) | ||
} | ||
Event::Wasm(Operator::If { .. }) => { | ||
let func_idx = self.func_idx; | ||
let evt_idx = self.evt_idx; | ||
sink.push(op); | ||
sink.push(Event::Internal(InternalEvent::Breakpoint(Box::new( | ||
move |info| { | ||
eprintln!( | ||
"[BlockTrace] ({}, {}) -> if % {:?}", | ||
func_idx, | ||
evt_idx, | ||
info.fault | ||
.and_then(|x| unsafe { x.read_stack(Some(1)) }) | ||
.unwrap() | ||
.frames[0] | ||
); | ||
Ok(()) | ||
}, | ||
)))) | ||
} | ||
Event::Wasm(Operator::Else { .. }) => { | ||
let func_idx = self.func_idx; | ||
let evt_idx = self.evt_idx; | ||
sink.push(op); | ||
sink.push(Event::Internal(InternalEvent::Breakpoint(Box::new( | ||
move |info| { | ||
eprintln!( | ||
"[BlockTrace] ({}, {}) -> else % {:?}", | ||
func_idx, | ||
evt_idx, | ||
info.fault | ||
.and_then(|x| unsafe { x.read_stack(Some(1)) }) | ||
.unwrap() | ||
.frames[0] | ||
); | ||
Ok(()) | ||
}, | ||
)))) | ||
} | ||
_ => { | ||
sink.push(op); | ||
} | ||
} | ||
self.evt_idx += 1; | ||
Ok(()) | ||
} | ||
} |
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
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.
Every other directory uses hyphens to separate words. Please follow suit.