mirror of
https://github.com/irmen/prog8.git
synced 2025-01-11 13:29:45 +00:00
preparing version 9.0
This commit is contained in:
parent
380f557c45
commit
7ee162d98b
@ -1 +1 @@
|
||||
9.0-dev
|
||||
9.0
|
||||
|
@ -26,6 +26,7 @@ Compiler:
|
||||
global initialization values are simply a list of LOAD instructions.
|
||||
Variables replaced include all subroutine parameters! So the only variables that remain as variables are arrays and strings.
|
||||
- ir: add more optimizations in IRPeepholeOptimizer
|
||||
- ir: the @split arrays are also split in _lsb/_msb arrays in the IR, and operations take multiple (byte) instructions that may lead to verbose and slow operation and machine code generation down the line.
|
||||
- ir: for expressions with array indexes that occur multiple times, can we avoid loading them into new virtualregs everytime and just reuse a single virtualreg as indexer? (simple form of common subexpression elimination)
|
||||
- PtAst/IR: more complex common subexpression eliminations
|
||||
- generate WASM to eventually run prog8 on a browser canvas? Use binaryen toolkit or my binaryen kotlin library?
|
||||
@ -35,7 +36,7 @@ Compiler:
|
||||
But all library code written in asm uses .proc already..... (textual search/replace when writing the actual asm?)
|
||||
Once new codegen is written that is based on the IR, this point is mostly moot anyway as that will have its own dead code removal on the IR level.
|
||||
- Zig-like try-based error handling where the V flag could indicate error condition? and/or BRK to jump into monitor on failure? (has to set BRK vector for that) But the V flag is also set on certain normal instructions
|
||||
- For c128 target; put floating point variables in bank 1 to make the FP routines work (is this even worth it? very few people will use fp)
|
||||
|
||||
|
||||
Libraries:
|
||||
|
||||
|
@ -126,7 +126,7 @@ class IRFileWriter(private val irProgram: IRProgram, outfileOverride: Path?) {
|
||||
private fun writeCodeChunk(chunk: IRCodeChunk) {
|
||||
xml.writeStartElement("CODE")
|
||||
chunk.label?.let { xml.writeAttribute("LABEL", chunk.label) }
|
||||
xml.writeAttribute("used-registers", chunk.usedRegisters().toString())
|
||||
// xml.writeAttribute("used-registers", chunk.usedRegisters().toString())
|
||||
xml.writeCharacters("\n")
|
||||
chunk.instructions.forEach { instr ->
|
||||
numInstr++
|
||||
|
@ -97,18 +97,18 @@ bgesr reg1, reg2, address - jump to location in program given by l
|
||||
ble reg1, value, address - jump to location in program given by location, if reg1 <= immediate value (unsigned)
|
||||
bles reg1, value, address - jump to location in program given by location, if reg1 <= immediate value (signed)
|
||||
( NOTE: there are no bltr/bler instructions because these are equivalent to bgtr/bger with the register operands swapped around.)
|
||||
sz reg1, reg2 - set reg1=1.b if reg2==0, otherwise set reg1=0.b
|
||||
snz reg1, reg2 - set reg1=1.b if reg2!=0, otherwise set reg1=0.b
|
||||
seq reg1, reg2 - set reg1=1.b if reg1 == reg2, otherwise set reg1=0.b
|
||||
sne reg1, reg2 - set reg1=1.b if reg1 != reg2, otherwise set reg1=0.b
|
||||
slt reg1, reg2 - set reg1=1.b if reg1 < reg2 (unsigned), otherwise set reg1=0.b
|
||||
slts reg1, reg2 - set reg1=1.b if reg1 < reg2 (signed), otherwise set reg1=0.b
|
||||
sle reg1, reg2 - set reg1=1.b if reg1 <= reg2 (unsigned), otherwise set reg1=0.b
|
||||
sles reg1, reg2 - set reg1=1.b if reg1 <= reg2 (signed), otherwise set reg1=0.b
|
||||
sgt reg1, reg2 - set reg1=1.b if reg1 > reg2 (unsigned), otherwise set reg1=0.b
|
||||
sgts reg1, reg2 - set reg1=1.b if reg1 > reg2 (signed), otherwise set reg1=0.b
|
||||
sge reg1, reg2 - set reg1=1.b if reg1 >= reg2 (unsigned), otherwise set reg1=0.b
|
||||
sges reg1, reg2 - set reg1=1.b if reg1 >= reg2 (signed), otherwise set reg1=0.b
|
||||
sz reg1, reg2 - set reg1=1.b if reg2==0, else 0.b
|
||||
snz reg1, reg2 - set reg1=1.b if reg2!=0, else 0.b
|
||||
seq reg1, reg2 - set reg1=1.b if reg1 == reg2, else 0.b
|
||||
sne reg1, reg2 - set reg1=1.b if reg1 != reg2, else 0.b
|
||||
slt reg1, reg2 - set reg1=1.b if reg1 < reg2 (unsigned), else 0.b
|
||||
slts reg1, reg2 - set reg1=1.b if reg1 < reg2 (signed), else 0.b
|
||||
sle reg1, reg2 - set reg1=1.b if reg1 <= reg2 (unsigned), else 0.b
|
||||
sles reg1, reg2 - set reg1=1.b if reg1 <= reg2 (signed), else 0.b
|
||||
sgt reg1, reg2 - set reg1=1.b if reg1 > reg2 (unsigned), else 0.b
|
||||
sgts reg1, reg2 - set reg1=1.b if reg1 > reg2 (signed), else 0.b
|
||||
sge reg1, reg2 - set reg1=1.b if reg1 >= reg2 (unsigned), else 0.b
|
||||
sges reg1, reg2 - set reg1=1.b if reg1 >= reg2 (signed), else 0.b
|
||||
|
||||
|
||||
ARITHMETIC
|
||||
|
Loading…
x
Reference in New Issue
Block a user