Quote: Int emitMul(Int a, Int b) { return a * b; }This function does not compute a * b, it generates the code for a multiplication. So for a script compiler, you can just write what the code has to do in C++, and SoftWire takes care of all the rest. This new feature also allows to quickly turn static C++ code into dynamically compiled and optimized C++ code. Conditional execution becomes conditional compilation. Enjoy!
New SoftWire release
Download: SoftWire 4.5.0.
SoftWire is a run-time code generator. It is written in C++ and creates x86 functions. It can be used for a script compiler or to optimize inner loops. An introduction can be found here: Tutorial. It is also the key technology behind swShader, my DirectX 9-like software renderer.
The new feature for this release is to allow code to be created from a C++ expression. Operator overloading makes the calls to the SoftWire run-time intrinsics to generate the corresponding code. The optimizer makes sure that most redundant operations are eliminated. For example:
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement