如何使用AVX / pclmulqdq在Mac OS X [英] How to use AVX/pclmulqdq on Mac OS X

查看:694
本文介绍了如何使用AVX / pclmulqdq在Mac OS X的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图编译使用pclmulqdq指令present在新的英特尔处理器的计划。我已经安装了GCC 4.6使用MacPorts的,但是当我编译我的程序(它使用固有_mm_clmulep​​i64_si128),我得到

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 (which uses the intrinsic _mm_clmulepi64_si128), I get

/var/folders/ps/sfjmtgx5771_qbqnh4c9xclr0000gn/T//ccEAWWhd.s:16:no such
instruction: `pclmulqdq $0, %xmm0,%xmm1'

看来,GCC能够产生从禀正确的程序集code,但汇编器无法识别的指令。

It seems that GCC is able to generate the correct assembly code from the instrinsic, but the assembler does not recognize the instruction.

我已经使用的MacPorts安装binutils的,但问题仍然存在。我怎么知道哪个汇编gcc的使用?在X code和汇编可能不支持它,但binutils的汇编应该。

I've installed binutils using macports, but the problem persists. How do I know which assembler gcc is using? The XCode assembler probably does not support it, but the binutils assembler should.

推荐答案

一个简单的解决方案,解决了这个问题对我来说是添加 -Wa,-q 来的编译器标志。从手册页(1.38版):

A simpler solution that fixed this problem for me was adding -Wa,-q to the compiler flags. From the man pages for as (version 1.38):

-q搜索结果
      使用铛(1)综合汇编程序,而不是基于GNU系统汇编。

-q

     Use the clang(1) integrated assembler instead of the GNU based system assembler.

-Wa 部分从编译器驱动程序来汇编通过它,就像 -Wl 将参数传递给连接器。

The -Wa part passes it from the compiler driver to the assembler, much like -Wl passes arguments to the linker.

这篇关于如何使用AVX / pclmulqdq在Mac OS X的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆