3 ms·
mratsim is right that the solution is to just improve the code-generation for the existing intrinsics. Given that the intrinsics already exist in GCC, optimisin
by MaxBarraclough 7y ago
mratsim 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.