Show HN: Proposal: Copy-and-Fuse Compilation
gist.github.com·6d·
Discuss: Hacker News
⚙️Modern Assembly
Preview
Report Post

One of the performance difficulties from interpreting a vector language is the accumulated temporaries. Consider:

y = 7 * x + 13

There are two different vector arithmetic operations here; an eager evaluation will perform the multiplication and then the addition. We can visualize this using the assembly language from Empirical’s Vector Virtual Machine:

mul_i64v_i64v  7 %1 %2      ; "x" is %1
add_i64v_i64v %2 13 %3      ; "y" is %3

The VVM interpreter will execute each instruction using the equivalent C++ code:

std::vector<int64_t> temp(x.size());
for (size_t i = 0; i < x.size(); i++) {
temp[i] = 7 * x[i];
}

y.resize(temp.size());
for (size_t i = 0; i...

Similar Posts

Loading similar posts...