2016/05/07

11:02

One thing I would like is a single pass parsing of code which generates the basic blocks as required. An idea with this is that I have NRProgramBuilder. When the input operations of the instructions are read they are passed to the program builder. The builder then creates an internal stream of bytes which represents the program in register form with temporaries and such. Basic blocks are determined on the fly for the most part. Since at the end of every basic block, all temporaries that may need to be calculated are calculated if they have not been. However a sequence of operation bytes might not be as strong. NRProgram could be immutable, however that would complicate how it is implemented at the cost of speed (and interpreted execution speed). The other alternative is straight code generation. Determine the jump targets and such for all operations and where they are placed (to determine basic block boundaries). Just go through all the bytes and perform computations as they are needed. The computations would be linked to a native code generator.

11:08

This would not be strictly SSA however, but it should be able to remove pointless operations such as register moving. Also, a straight and simple pass that goes straight to the compiler would consume the least amount of memory and execution time figuring things out. So I suppose the first thing would be to figure out the logical operation positions and basic block boundaries. Then run through that with a code generator. At the end of a basic block, operations are performed and temporaries are recorded. The state machine for specific CPUs and such can store which variables are where within basic blocks. It should be noted that for simplicity, variables that are allocated should only be mapped to single registers as much as possible so that exception handling and other things are not complicated as much. For temporary values on the stack they can just remain in registers, if an exception is called then those values are destroyed anyway. Only when the end of a basic block is reached will they actually be stored somewhere, be it in registers or on the stack. I would suppose that a generic code generator can work also.

13:30

SquirrelJME now has a mascot! yay! She did quite a nice job on it.

16:01

I need to devise a somewhat slow downscale method which can keep borders of an image. That is, it downscale intelligently rather than using an average kind of means when doing so. Current downscalers pretty much treat all pixels as alike. Nearest is rather even when it comes to pixels by just choosing one at a given position, while linear and such average the colors out. I suppose for extremley low resolutions, I can just drop to pixel art. For example 8x8 would be pixel art drawn myself while high resolution images would be the drawn mascot. Not sure it would be possible for the algorithm I am thinking about writing would be able to scale the image down so much.

16:20

The image utilities could actually be called extra-util-image and such then the downscaler could use those utilities.

16:27

One thing though that I have not completely worked on is the native compiler, I kind of just keep avoiding it.