What's the proper way to use different versions of SSE intrinsics in GCC?

后端 未结 4 1390
旧巷少年郎
旧巷少年郎 2020-12-29 09:12

I will ask my question by giving an example. Now I have a function called do_something().

It has three versions: do_something(), do_s

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-29 09:49

    Here is an example of compiling a separate object file for each optimization setting: http://notabs.org/lfsr/software/index.htm

    But even this method fails when gcc link time optimization (-flto) is used. So how can a single executable be built with full optimization for different processors? The only solution I can find is to use include directives to make the C files behave as a single compilation unit so that -flto is not needed. Here is an example using that method: http://notabs.org/blcutil/index.htm

提交回复
热议问题