Speedup a short to float cast?

后端 未结 7 2042
孤独总比滥情好
孤独总比滥情好 2020-12-17 01:39

I have a short to float cast in C++ that is bottlenecking my code.

The code translates from a hardware device buffer which is natively shorts, this represents the in

7条回答
  •  悲&欢浪女
    2020-12-17 01:47

    This is not a valid answer, don't take it as it, but I'm actually wondering how would the code behave by using a 256k look-up table. (basically a 'short to float' table with 65536 entries).

    A CoreI7 has about 8 megabytes of cache I believe, so the look-up table would fit in the data cache.

    I really wonder how that would impact the performance :)

提交回复
热议问题