Tilde Requests
I will add to this as I go along when I see things which may be missing.
API
- [x] Any function that takes a
const char*also take a length where possible- Maybe using your convention of when
ptrdiff_tis -1, it's NUL terminated
- Maybe using your convention of when
- [x] Function Signature ABI handling
- Documentation
- Better Abstraction that handles it for you, maybe?
- [ ]
f16type- Even if it is just
u16internally or whatever
- Even if it is just
- [x] Range bounds on values to improve generation of bounds checks
- If a pointer-like array has a specific range to it, and an integer is know to have a specific range, then a bounds check may be omitted
- [x] Minimum alignment of a
TB_Node*(useful in some instructions that require an explicit alignment)
Instructions
- [ ]
allocaequivalent - [x]
tb_inst_ptris missing - [ ]
tb_inst_sint/tb_inst_uintfor types >64 bits (e.g. 128-bits) - [ ]
tb_inst_memmove- High Priority
- [ ]
TB_(SHL|SHR|SAR) with slightly different to C semantics- Instead of C-like, I want Odin-like which is defined to have
x<<2==(x<<1)<<1
- Instead of C-like, I want Odin-like which is defined to have
- [ ]
TB_BSWAPwork with floats- useful for endian specific types and file formats
- [ ] add/sub/mul with overflow check
- Low priority, and for mul it can be done with
TB_MULPAIR
- Low priority, and for mul it can be done with
- [ ] add/sub/mul with saturation
- Extension to
TB_ArithmeticBehaviormaybe? - Very low priority
- Extension to
- [ ] fused multiply add (fma)
- Very low priority
- [ ] nontemporal stores and loads
- Low priority
- [ ] Fixed point arithmetic? (I'm not sure about this one)
- Very low priority
- [x] Prefetch (read/write data/instruction)
- Very low priority
- [ ] WASM intrinsics (when WASM is needed)
wasm.memory.growwasm.memory.sizewasm.memory.atomic.wait32wasm.memory.atomic.notify
- [x]
tb_inst_memzerohelper?- Is this even a needed?
TB_API void tb_inst_memzero(TB_Function* f, TB_Node* dst, TB_Node* val, TB_Node* count, TB_CharUnits align, bool is_volatile) {
tb_inst_memset(f, dst, tb_inst_uint(f, TB_TYPE_I8, 0), count, align, is_volatile);
}
"Intrinsics"
- [ ]
cpu_relaxpauseon amd64isbon arm64
- [ ]
x86_cpuid - [ ]
x86_xgetbv - [ ] Valgrind client request
- It's just a weird set of instructions that does nothing but Valgrind et al looks for
IR Debugging
- [x] Linearized Textual IR Printer (not GraphViz)
Debug Information
- [x] Set column information along with file and line information
- [ ] Ability to set scopes
- [ ] Enum Types
- [x] Named types
Questions
- Does
tb_inst_set_region_namerequire that the name passed is in unique to that function or does Tilde handle this? - How to get the previous instruction?—i.e. of a region
For the questions, currently tb_inst_set_region_name does not require unique names but it will bite you once i make the flattened IR form if you reuse the same name.
If you wanna know the previous "instructions" to a region, you can check the inputs list and it'll tell you all the predecessors, you can do tb_get_parent_region(region->inputs[i]) if you want the top of that predecessor, but the actual inputs[i] is almost always a projection (TB_PROJ) stemming from a branch, you can reach the branch with another ->inputs[0].
There we go, linearized IR printing. It uses the TB_FuncOpt which is usually is preserved for optimizations but i might rename it because it's really just for analysis/transformations and flattening the IR is a form of analysis.
Feature Request:
- Debug type for functions
- From debug type, it can produce the function prototype type for the specified ABI.
@gingerBill @RealNeGate I have a crazy off-topic idea/question for you guys. Odin is "done". So why not write a C compiler(or at least compiler backend) in Odin?
I imagine Odin will provide great productivity gains and correctness as well.
(I am currently playing with Odin and I love it, and I heard that GB wants to replace LLVM with Tilde)