Hi Andy,

For the Athlon64 system, I get the following:

$ gcc -o cpuid cpuid.c
$ ./cpuid   
00000001:68747541:444d4163:69746e65
00020f32:01020800:00000001:178bfbff

I also see similar behaviour on an Intel Xeon system also using the
linux-x86_64 target. Using the 8192 byte column from the speed output for
aes-128-cbc, I get the following:

0.9.8k:                 209117.18k
1.0.0 beta2:             98832.30k
1.0.0 beta2 (no-asm):   185606.83k

For that system, the cpuid output is:

$ ~/cpuid
0000000a:756e6547:6c65746e:49656e69
00010676:03040800:000ce3bd:bfebfbff
0c000121:01c0003f:0000003f:00000001


On Wed, May 06, 2009 at 15:13:32 -0500, Andy Polyakov wrote:
> > I'm not sure if this topic has been brought up previously, but I've
> > noticed that the AES performance with the linux-x86_64 target  seems to
> > have dropped relative to 0.9.8k. This is on an AMD Athlon64 X2 with GCC
> > 4.1.2.
> 
> Could you compile attached problem and submit its output? This is for
> reference and to double-check that everything is detected correctly.
> 
> > I'm curious as to the cause of this and whether it is intentional (to
> > mitigate a timing attack, perhaps)
> 
> Bullseye. For further information see crypto/aes/asm/aes-596.pl, second
> half of commentary section.
> 
> > or whether it is an accidental side-effect.
> 
> No.
> 
> > Strangely, the AES performance is actaully _better_ with the no-asm flag,
> > although not as good as 0.9.8k.
> 
> But it would still be faster is C would implement equivalent code. A.
> 
> 

Content-Description: cpuid.c
> #include <stdio.h>
> 
> main()
> { unsigned int eax,ebx,ecx,edx,max;
>     max=0;
>     __asm volatile ("cpuid" : 
> "=a"(max),"=b"(ebx),"=c"(ecx),"=d"(edx):"0"(max));
>     printf("%08x:%08x:%08x:%08x\n",max,ebx,ecx,edx);
>     eax=1;
>     __asm volatile ("cpuid" : 
> "=a"(eax),"=b"(ebx),"=c"(ecx),"=d"(edx):"0"(eax));
>     printf("%08x:%08x:%08x:%08x\n",eax,ebx,ecx,edx);
>     if (max<4) return 0;
>     eax=4; ecx=0;
>     __asm volatile ("cpuid" : 
> "=a"(eax),"=b"(ebx),"=c"(ecx),"=d"(edx):"0"(eax),"2"(ecx));
>     printf("%08x:%08x:%08x:%08x\n",eax,ebx,ecx,edx);
> }


-- 
Iain Morgan
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [email protected]
Automated List Manager                           [email protected]

Reply via email to