On Tue, Jun 16, 2020 at 11:02 AM Werner LEMBERG <[email protected]> wrote:
> > > For SIMD, I studied what's available last year for HarfBuzz. I > > documented what I found here: > > > > https://github.com/harfbuzz/harfbuzz/blob/simd/src/hb-simd.hh > > Thanks for the link, it's an interesting read. > > > If you use floats internally and fill in the distances, then you can > > do SIMD passes at the end to do sqrt, clamping, and other things to > > generate the output. But even solving computing roots or the > > Newton-Raphson can be done in SIMD for up to 8 samples at a time. > > IMHO, in FreeType, SIMD support is something to be done in addition, > not as a replacement. Absolutely. It's implied and I agree that we must support non-SIMD. All projects I know have the same requirements. > Since Anuj makes quick progress I suggest that > he first concentrates on the fixed-float route. If there is some time > left we should check how to SIMD can be implemented. > Agreed. I pointed out in case it can inform how to organize the operations such that SIMD benefit can be achieved later. I think such organization also produces faster code without SIMD. Eg. doing a tight loop of just sqrt()ing every pixel in the end allows the compiler to unroll the loop, which also enables better use of the multiple pipelines in the CPU because there's no data dependency. -- behdad http://behdad.org/
