gcc and xgetbv

Michael Dickens michaelld at macports.org
Fri Jan 25 07:13:27 PST 2013


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

On Jan 25, 2013, at 8:15 AM, vincent habchi <vince at macports.org> wrote:
> 1. You’ll never get any AVX instruction out of GCC compilers, because they all rely on the Apple provided /usr/bin/as which is hoary and do not know about new opposes like AVX;
> 2. AVX means Sandy Bridge processors. I am not sure, but I’d bet your MacBook has a Core 2 Duo Penryn which is one generation older.


More information about the macports-dev mailing list