On May 6, 2011, at 00:13, Jeffrey Walton wrote:
> On May 5, 9:31 am, MMoadeli <[email protected]> wrote:
>> Hi Jeffery,
>> 
>> Many thanks for the reply.
>> With your advised compiler directives I got similar errors. I tried
>> both gcc-4.4 and gcc-4.6.
>> Actually, the errors are the result of compiling gcm.cpp. Following
>> are the errors generated as the result of using different compiler
>> directives.
> OK. I had a little more time to look at this.
> 
> According to Intel (perhaps GCC would be a better source???),
> pclmulqdq is part of AVX and available in GCC 4.6, not GCC 4.4. See
> http://software.intel.com/en-us/avx/ and
> http://software.intel.com/en-us/articles/intel-software-development-emulator/.
> Intel's Software Development Emulator page has a Q and A that makes it
> clear.
> 
> GCC 4.6 begs the question, why "no such instruction"? That could be
> either a header problem, or a cross-compile issue. I believe the
> correct header is included, so I'm leaning towards a cross-compile
> issue. I suspect the AVX test on the Core2 is failing (Core2 does not
> have AVX), so the instruction is left undefined. See
> http://old.nabble.com/PATCH:-Support-Intel-AVX-Programming-Reference-(January,-2009)-td21833586.html.

Line 53 of cpu.h uses an explicit asm statement.  This means GCC only knows 
that you've got certain parameters that have to be in certain kinds of 
registers, and then it fills in some fields in the template describing where 
those parameters are, and spits out the string for the assembler to process.  
So this has nothing to do with whether GCC understands these instructions; it's 
whether Apple's assembler does.  Upgrading GCC won't change this.  Maybe the 
latest and greatest XCode would, but probably only if Apple is shipping 
machines that have these instructions.

That some versions of GCC "understand" these instructions probably only means 
that they provide some built-in function that expands to the right asm code, 
much like the inline function defined in cpu.h.  It'll still be dependent on 
the assembler to understand those opcode names.

If current versions of the Mac assembler don't handle those instructions, then 
their use should be disabled, probably with something like your patch to the 
conditional tests in config.h.  (Unfortunately there's no compiler macro to 
indicate the assembler version.  But maybe the OS version or something could be 
tested instead.)

Ken

-- 
You received this message because you are subscribed to the "Crypto++ Users" 
Google Group.
To unsubscribe, send an email to [email protected].
More information about Crypto++ and this group is available at 
http://www.cryptopp.com.

Reply via email to