Skip to content
This repository has been archived by the owner on May 11, 2020. It is now read-only.

Implement comparison Ops, fix bug with branch table target tracking, add benchmark. #119

Merged
merged 20 commits into from
Apr 5, 2019
Merged

Implement comparison Ops, fix bug with branch table target tracking, add benchmark. #119

merged 20 commits into from
Apr 5, 2019

Conversation

twitchyliquid64
Copy link
Contributor

  • Implements greater-than, less-than etc ops
  • Fixed a bug where branch table jump addresses were not being tracked, causing the scanner to emit invalid candidates
  • Created an ideal-case benchmark for Native vs Interpreted execution modes.

On my i7 2nd gen:

[xxx@xxx]:~/projects/wagon> go test -bench=BenchmarkU64Arithmetic github.com/go-interpreter/wagon/exec
goos: linux
goarch: amd64
pkg: github.com/go-interpreter/wagon/exec
BenchmarkU64Arithmetic10Interpreted-8   	  100000	     16611 ns/op
BenchmarkU64Arithmetic10Native-8        	  200000	      5781 ns/op
BenchmarkU64Arithmetic50Interpreted-8   	   20000	     76431 ns/op
BenchmarkU64Arithmetic50Native-8        	   50000	     25961 ns/op
PASS
ok  	github.com/go-interpreter/wagon/exec	7.565s

So currently 3x, but heaps of room for improvement (I think I can cut emitted assembly by 80%, and theres still heaps of opcodes we dont yet support). I'm expecting we should be able to hit 10-20x here.

@codecov-io
Copy link

codecov-io commented Apr 5, 2019

Codecov Report

Merging #119 into master will increase coverage by 0.37%.
The diff coverage is 73.59%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #119      +/-   ##
==========================================
+ Coverage   65.61%   65.98%   +0.37%     
==========================================
  Files          41       41              
  Lines        3949     4066     +117     
==========================================
+ Hits         2591     2683      +92     
- Misses       1091     1116      +25     
  Partials      267      267
Impacted Files Coverage Δ
exec/internal/compile/compile.go 0% <0%> (ø) ⬆️
exec/internal/compile/scanner.go 0% <0%> (ø) ⬆️
exec/internal/compile/backend_amd64.go 79.46% <81.41%> (+0.84%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 89a7df5...fcdae72. Read the comment docs.

exec/exec_test.go Show resolved Hide resolved
exec/exec_test.go Show resolved Hide resolved
exec/exec_test.go Show resolved Hide resolved
exec/exec_test.go Show resolved Hide resolved
exec/exec_test.go Outdated Show resolved Hide resolved
exec/exec_test.go Outdated Show resolved Hide resolved
exec/internal/compile/scanner.go Outdated Show resolved Hide resolved
exec/internal/compile/compile.go Show resolved Hide resolved
@twitchyliquid64
Copy link
Contributor Author

✈️ 🦄

@sbinet sbinet merged commit eda5438 into go-interpreter:master Apr 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants