gcc and xgetbv

Vincent Habchi vince at macports.org
Fri Jan 25 07:31:23 PST 2013


Michael:

> Hi Vincent - Thanks for your reply; it seems like that thread from a
> while back said pretty much what you're now saying.  So, what I'm trying
> to do is create a configure-time test which first tries to compile a
> "xgetbv" instruction, and if that succeeds then it tries to execute the
> binary.  If the first fails then the compiler does not support AVX; if
> the first succeeds but the second fails then the CPU does not support
> AVX.  In this way, we can rule in our out using AVX during
> configuration, and set some variables accordingly to be used during
> building.  This seems like the most reliable way to go, instead of
> relying on the compiler version alone (which is what we were doing), or
> just compiling (which clang does OK). - MLD

Read the message I just posted: you can use AVX with Clang, provided you have the required hardware, but if your assembly is written in the GNU x86-64 dialect, then you’ll have to revamp some parts to make the Clang assembler (llvm-mc) happy.

Vincent




More information about the macports-dev mailing list