gcc and xgetbv

vincent habchi vince at macports.org
Fri Jan 25 06:54:49 PST 2013


On 25 janv. 2013, at 15:07, Rainer Müller <raimue at macports.org> wrote:

> To make this more clear, a C compiler does not touch the assembler
> instructions in the __asm__() statement. Rather, these are passed down in raw form to the assembler.

Thanks Rainer for elaborating. I was in a suburb train and had to be somewhat terse.

> In Michael's case, clang passes this down to the the integrated
> assembler in LLVM, but at runtime the CPU fails to execute as this
> instruction is unknown.
> 
> When compiling the code with gcc-mp-4.7, it calls the assembler
> /opt/local/bin/as (which is the same or even a newer version than
> /usr/bin/as),

There is no such file as /opt/local/bin/as. Vanilla GCC Binutils does not compile on MacOS. Wherefore the need to rely on the archaic system as. 

> Use the following sysctl commands to retrieve information about
> instruction sets supported by the current CPU:
> 
>
I think there is a sysctl with avx, so sysctl -a | grep avx should do the trick too.

Vincent



More information about the macports-dev mailing list