4 ms·
Seems like the type of thing that could be done with C++, expression templates and asm. Maybe even an expression JIT.
by BubRoss 7y ago
Seems like the type of thing that could be done with C++, expression templates and asm. Maybe even an expression JIT.
- unlinked_dll 7y agoDefinitely can be done with a little bit of impedance losses depending on what you care about. I once wrote it for block floating point on hardware that didn't support it. You can use custom literal suffixes too.
- MaxBarraclough 7y agomratsim is right that the solution is to just improve the code-generation for the existing intrinsics. Given that the intrinsics already exist in GCC, optimising the code is the right way to handle it. (Intrinsics still have their usual obvious downsides, mainly non-portability.) JIT seems a poor fit. JIT makes the most sense where the desired program behaviour is variable. Intrinsics fit perfectly here. Templates don't help solve the problem, but they might be a good way to expose the functionality to C++ programmers. Assembly is how you'd solve the problem efficiently in the absence of a compiler intrinsic. Intrinsics should be able to do an even better job.