bspaans / jit-compiler Goto Github PK
View Code? Open in Web Editor NEWJIT compiler in Go
License: MIT License
JIT compiler in Go
License: MIT License
All the classics: <<, >>, &, |, ^
Implement <, <=, > and >= for floating point numbers.
On Linux / AMD 2950X / go1.17-c14ecaca81:
--- FAIL: Test_Execute (0.00s)
assembler_test.go:297: Expecting 5 got 140256821354496 in [mov u32$5, 0x8(%rsp) return]
48 c7 44 24 08 05 00 00
00 c3
FAIL
FAIL github.com/bspaans/jit-compiler/asm/x86_64 0.003s
ok github.com/bspaans/jit-compiler/asm/x86_64/encoding (cached)
ok github.com/bspaans/jit-compiler/asm/x86_64/opcodes (cached)
ok github.com/bspaans/jit-compiler/elf (cached)
.rodata
.data
.text
_start:
:: __ssa_1 = 25 * 2 ; f = 3 + __ssa_1 ; return f
0x2-0x9 0x24: mov u32$25, %rax
48 c7 c0 19 00 00 00
0x9-0x10 0x24: mov u32$2, %rcx
48 c7 c1 02 00 00 00
0x10-0x13 0x24: imul %rcx
48 f7 e9
0x13-0x16 0x24: mov %rax, %rax
48 8b c0
0x16-0x1d 0x24: mov u32$3, %rcx
48 c7 c1 03 00 00 00
0x1d-0x20 0x24: add %rax, %rcx
48 03 c8
0x20-0x25 0x24: mov %rcx, 0x8(%rsp)
48 89 4c 24 08
0x25-0x26 0x24: return
c3
--- FAIL: Test_ParseExecute_Happy (0.00s)
ir_test.go:308: Expecting 53 got 50 in f = 3 + 25 * 2 after SSA transform
__ssa_1 = 25 * 2 ; f = 3 + __ssa_1 ; return f
--- FAIL: Test_Execute_Result (0.00s)
ir_test.go:397: Expecting 53 got 139858457112576 in [if true { f = 53 } else { f = 54 }]
b2 01 40 80 fa 01 75 09
48 c7 c1 35 00 00 00 eb
07 48 c7 c1 36 00 00 00
48 89 4c 24 08 c3
FAIL
FAIL github.com/bspaans/jit-compiler/ir 0.042s
FAIL
Support SSA transform in the IR
Expressions:
Statements:
Includes support for +, -, *, /, ==, <, <=, >, >=
arm support
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.