mu-impl-fast issueshttps://gitlab.anu.edu.au/mu/mu-impl-fast/-/issues2017-07-12T10:49:36+10:00https://gitlab.anu.edu.au/mu/mu-impl-fast/-/issues/23[x86_64] shift operations may return wrong result if 2nd operand is larger th...2017-07-12T10:49:36+10:00Yi Lin[x86_64] shift operations may return wrong result if 2nd operand is larger than int8Shifting instructions in Mu require two operands of the same size, e.g. `Shl <int64> a b`, in which `a` and `b` are both `int64`.
However `shl`, `shr`, `sar` in x86_64 either takes a second operand in the `CL` register (8 bits), or a...Shifting instructions in Mu require two operands of the same size, e.g. `Shl <int64> a b`, in which `a` and `b` are both `int64`.
However `shl`, `shr`, `sar` in x86_64 either takes a second operand in the `CL` register (8 bits), or as a 8bits immediate. Current the instruction selector simply moves lower 8bits of `b` into `CL`, which may result in incorrect result. https://gitlab.anu.edu.au/mu/mu-impl-fast/-/issues/14Tune instruction selection for mu code from RPython2017-07-12T10:49:36+10:00Yi LinTune instruction selection for mu code from RPythonThis issue tracks common instruction patterns that the RPython compiler generates.
We will need to tune instruction selector to generate efficient code for these patterns.
* [x] Conditional branch
`cmpres = CMP_OP a b`
`v1 = ZE...This issue tracks common instruction patterns that the RPython compiler generates.
We will need to tune instruction selector to generate efficient code for these patterns.
* [x] Conditional branch
`cmpres = CMP_OP a b`
`v1 = ZEXT <int1 int8> cmpres`
`v2 = CMP_EQ v1 1`
`BRANCH2 v2 ... ...`Yi LinYi Linhttps://gitlab.anu.edu.au/mu/mu-impl-fast/-/issues/12Use sidemap for GC object metadata2017-11-21T13:48:32+11:00Yi LinUse sidemap for GC object metadataZebu intends to side maps to seperate objects from their metadata.
However, currently as a compromise, I am using a 64-bit object header along with `GCType` for the metadata. We will go back to using side maps.
This issue describ...Zebu intends to side maps to seperate objects from their metadata.
However, currently as a compromise, I am using a 64-bit object header along with `GCType` for the metadata. We will go back to using side maps.
This issue describes the design of sidemap scheme.
* we will assume a minimal object size `MIN_SIZE`, and a minimal alignment `MIN_ALIGN`. The larger the minimal size/align is, the less memory is required for metadata (see below). However, it wastes memory in the heap. MIN_SIZE of 16/24/32<del>bits</del> bytes, MIN_ALIGN of 128bits are reasonable.
* object metadata includes:
* 1bit/MIN_ALIGN: object start (and end - so we can decide size) (size is required for copying/dumping object)
* 1bit/64bits: reference locations
* 8bits/MIN_SIZE: gc state (mark bit, reference count, etc)
* small objects have less space to encode metadata, but large objects have plenty. We can use different schemes to encode small/large objects.
* side maps should be stored in the metadata part of a page/memory chunk.
More concrete design will be updated here once we discuss more. Yi LinYi Linhttps://gitlab.anu.edu.au/mu/mu-impl-fast/-/issues/11VMOptions2017-07-12T10:49:36+10:00Yi LinVMOptionsWe need to allow Zebu to take options during initialisation.
* The initialisation function starts from `mu_fastimpl_new()` in `vm/api/api_impl/muvm.rs`.
* Arguments as a formatted string would suffice.
* Consider using Rust crates ...We need to allow Zebu to take options during initialisation.
* The initialisation function starts from `mu_fastimpl_new()` in `vm/api/api_impl/muvm.rs`.
* Arguments as a formatted string would suffice.
* Consider using Rust crates to manage command line options, such as [clap](https://crates.io/crates/clap).RPython benchmarksYi LinYi Linhttps://gitlab.anu.edu.au/mu/mu-impl-fast/-/issues/9Bug: hybrid layout2017-07-12T10:49:36+10:00John ZhangBug: hybrid layoutHybrid may contain empty fixed part, in which case `backend::layout_struct` fails because `struct_align = 0`.Hybrid may contain empty fixed part, in which case `backend::layout_struct` fails because `struct_align = 0`.Yi LinYi Linhttps://gitlab.anu.edu.au/mu/mu-impl-fast/-/issues/8IR validation pass2017-08-25T09:36:31+10:00Yi LinIR validation passCurrently if the input IR is incorrect, one of the following may happen:
1. some assertion in the compiler may fail
1. Rust safety finds it and panics (such as index out of bounds)
1. the compiler generates correct or incorrect code e...Currently if the input IR is incorrect, one of the following may happen:
1. some assertion in the compiler may fail
1. Rust safety finds it and panics (such as index out of bounds)
1. the compiler generates correct or incorrect code even if input IR is incorrect
We will want a IR validation pass to check the input IR. It includes:
* check if types and numbers of operands and results of each instructions match
* check if function signatures matches parameters and return values
* check if branch arguments matches parameters, and if branch destination is valid
* check if the last instruction for each block is terminating instruction (`BRNACH`, `CALL`, `RET`, etc)
...
(this list will grow when I think up more)Yi LinYi Linhttps://gitlab.anu.edu.au/mu/mu-impl-fast/-/issues/7Insert intermediate blocks for removing phi-node values2017-07-12T10:49:36+10:00Yi LinInsert intermediate blocks for removing phi-node valuesThe current implementation insert moves before branching. Instead, we should insert intermediate blocks between source and destination blocks, and put moves there. The current implementation insert moves before branching. Instead, we should insert intermediate blocks between source and destination blocks, and put moves there. RPython benchmarksYi LinYi Linhttps://gitlab.anu.edu.au/mu/mu-impl-fast/-/issues/5JIT Tests2017-07-12T10:49:36+10:00John ZhangJIT TestsA list of tests to do for the JIT.
## Milestone Tests
- [x] constant function
- [x] fibonacci
- [x] two functions (compiling multiple functions)
- [x] RPython SHA1 test
- [ ] RPython GC benchmark
- [x] RPython Richards benchmark
- [x] ...A list of tests to do for the JIT.
## Milestone Tests
- [x] constant function
- [x] fibonacci
- [x] two functions (compiling multiple functions)
- [x] RPython SHA1 test
- [ ] RPython GC benchmark
- [x] RPython Richards benchmark
- [x] RPython NBody benchmark
- [x] RPython SOM interpreter
- [ ] PyPy interpreter with minimum modules
- [ ] PyPy interpreter with compilable modules
## Binary operation tests
- [x] `ADD`
- [x] `SUB`
- [x] `MUL`
- [x] `SDIV`
- [x] `UREM`
- [x] `SHL`
- [x] `LSHR`
- [x] `AND`
- [x] `XOR`
## Compare operation tests
- [x] `EQ`
- [x] `NE`
- [x] `SGE`
- [x] `SGT`
- [x] `SLE`
- [x] `SLT`
## Conversion operation tests
- [x] `TRUNC`
- [x] `ZEXT`
- [x] `SEXT`
- [x] `REFCAST`
- [x] `PTRCAST`
## Control flow operation tests
- [x] `BRANCH`
- [x] `BRANCH2`
- [x] `CALL`
- [x] `RET`
- [x] `SWITCH`
- [x] `CCALL`
- [x] `THROW`
## Memory operation tests
- [x] `NEW`
- [x] `NEWHYBRID`
- [x] `GETIREF`
- [x] `GETFIELDIREF`
- [x] `SHIFTIREF`
- [x] `GETVARPARTIREF`
- [x] `LOAD`
- [x] `STORE`
## `COMMINST` tests
- [x] `COMMINST @uvm.thread_exit`
- [x] `COMMINST @uvm.native.pin`
- [x] `COMMINST @uvm.native.unpin`
- [x] `COMMINST @uvm.get_threadlocal`
- [x] `COMMINST @uvm.set_threadlocal`John ZhangJohn Zhanghttps://gitlab.anu.edu.au/mu/mu-impl-fast/-/issues/4IR Instruction Implementation2017-07-12T10:49:36+10:00John ZhangIR Instruction ImplementationA list of IR Instruction needed progressively.
Tick them off as you go, and watch for updates.
## IR Instructions
- [x] `ADD`
- [x] `SUB`
- [x] `MUL`
- [x] `SDIV`
- [x] `UDIV`
- [x] `SREM`
- [x] `UREM`
- [x] `SHL`
- [x] `ASHR`
- [x] `L...A list of IR Instruction needed progressively.
Tick them off as you go, and watch for updates.
## IR Instructions
- [x] `ADD`
- [x] `SUB`
- [x] `MUL`
- [x] `SDIV`
- [x] `UDIV`
- [x] `SREM`
- [x] `UREM`
- [x] `SHL`
- [x] `ASHR`
- [x] `LSHR`
- [x] `FADD`
- [x] `FSUB`
- [x] `FDIV`
- [x] `FMUL`
- [x] `AND`
- [x] `OR`
- [x] `XOR`
- [x] `EQ`
- [x] `NE`
- [x] `SGE`
- [x] `SGT`
- [x] `SLE`
- [x] `SLT`
- [x] `ULE`
- [x] `ULT`
- [x] `FOEQ`
- [x] `FOGT`
- [x] `FOLE`
- [x] `FOLT`
- [x] `FONE`
- [x] `TRUNC`
- [x] `ZEXT`
- [x] `SEXT`
- [x] `REFCAST`
- [x] `PTRCAST`
- [x] `FPTOSI`
- [x] `SITOFP`
- [x] `UITOFP`
- [x] `SELECT`
- [x] `BRANCH`
- [x] `BRANCH2`
- [x] `SWITCH`
- [x] `CALL`
- [x] `RET`
- [x] `NEW`
- [x] `NEWHYBRID`
- [x] `GETIREF`
- [x] `GETFIELDIREF`
- [x] `GETELEMIREF`
- [x] `SHIFTIREF`
- [x] `GETVARPARTIREF`
- [x] `LOAD`
- [x] `STORE`
- [x] `CCALL`
- [x] `NEWTHREAD`
- [x] `COMMINST @uvm.thread_exit`
- [x] `THROW`
- [x] `COMMINST @uvm.native.pin`
- [x] `COMMINST @uvm.native.unpin`
- [ ] `COMMINST @uvm.get_threadlocal`
- [x] `COMMINST @uvm.set_threadlocal`
Yi LinYi Linhttps://gitlab.anu.edu.au/mu/mu-impl-fast/-/issues/3API Implementation2017-07-12T10:49:36+10:00John ZhangAPI ImplementationBelow is the list of API calls to implement, ordered by priority derived from requirements from test cases.
Please tick them off as you go, and watch for updates.
## `MuIRBuilder`
- [x] `load`
- [x] `gen_sym`
- [x] `new_bb`
- [x] `new_...Below is the list of API calls to implement, ordered by priority derived from requirements from test cases.
Please tick them off as you go, and watch for updates.
## `MuIRBuilder`
- [x] `load`
- [x] `gen_sym`
- [x] `new_bb`
- [x] `new_binop`
- [x] `new_branch`
- [x] `new_branch2`
- [x] `new_call`
- [x] `new_ccall`
- [x] `new_cmp`
- [x] `new_comminst`
- [x] `new_const_double`
- [x] `new_const_extern`
- [x] `new_const_int`
- [x] `new_const_int_ex`
- [x] `new_const_null`
- [x] `new_conv`
- [x] `new_dest_clause`
- [x] `new_exc_clause`
- [x] `new_func`
- [x] `new_func_ver`
- [x] `new_funcsig`
- [x] `new_getfieldiref`
- [x] `new_getiref`
- [x] `new_getvarpartiref`
- [x] `new_global_cell`
- [x] `new_load`
- [x] `new_new`
- [x] `new_newhybrid`
- [x] `new_ret`
- [x] `new_select`
- [x] `new_shiftiref`
- [x] `new_store`
- [x] `new_switch`
- [x] `new_throw`
- [x] `new_type_double`
- [x] `new_type_float`
- [x] `new_type_funcref`
- [x] `new_type_hybrid`
- [x] `new_type_int`
- [x] `new_type_iref`
- [x] `new_type_ref`
- [x] `new_type_struct`
- [x] `new_type_ufuncptr`
- [x] `new_type_uptr`
- [x] `new_type_void`
## MuCtx
- [x] `store`
- [x] `get_field_iref`
- [x] `get_iref`
- [x] `get_var_part_iref`
- [x] `handle_from_const`
- [x] `handle_from_func`
- [x] `handle_from_global`
- [x] `handle_from_sint64`
- [x] `handle_from_uint64`
- [x] `handle_from_uint8`
- [x] `id_of`
- [x] `new_fixed`
- [x] `new_hybrid`
- [x] `new_ir_builder`
- [x] `refcast`
- [x] `shift_iref`Kunshan WangKunshan Wang