How to use AVX/pclmulqdq on Mac OS X

后端 未结 5 1539
耶瑟儿~
耶瑟儿~ 2020-12-03 05:09

I am trying to compile a program that uses the pclmulqdq instruction present in new Intel processors. I\'ve installed GCC 4.6 using macports but when I compile my program (w

5条回答
  •  無奈伤痛
    2020-12-03 05:30

    The GNU assembler (GAS) is not supported in Mac OS X.

    In order to use AVX, I had to:

    • Install GCC using MacPorts;
    • Replace the native OS X assembler (/usr/bin/as) by a script which calls the clang assembler.
    • Compile the program with the installed GCC (e.g. gcc-mp-4.7)

    The strange thing is that while the clang assembler supports AVX, the clang compiler does not recognize the AVX instrinsics, forcing the ugly workaround above.

提交回复
热议问题