2 ms·
You could also use SIMD instructions, and there are bitwise operator tricks that might be able to mostly avoid branching.
by dehrmann 7y ago
You could also use SIMD instructions, and there are bitwise operator tricks that might be able to mostly avoid branching.
- nkurz 7y agoI'll ask you an open question: do you need to use SIMD to get maximum speed on this problem? I think the answer is yes, but only because with a certain level of MLP you run out of architectural registers and your compiler starts swapping things to stack. Daniel thinks (hopes?) the answer is no, and that with sufficient finesse you can get the same speed without SIMD. The problem (well, at least very similar problems that we've thought about more) ends up running at very low IPC, with most of the time being spent waiting for data from RAM or L3. You can fit a lot of extra instructions in without seeing a slowdown. If there is a benefit to SIMD, both of us think it will be a fairly small effect, and only at very high levels of MLP. But we'd be excited to be proven wrong!