This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: Enable Intel AES/CLMUL


Jakub Jelinek wrote:
On Fri, Apr 04, 2008 at 04:33:51PM +0200, Uros Bizjak wrote:
This will work just fine even without SSE (although a warning about
changed ABI will be issued). We can even add AES functionality to the
library this way (hint, hint ;)

And using intrinsic, the situation will be actually just reversed to
the situation you described below.

This doesn't make sense. The aes instructions use SSE2 registers,
so IMNSHO you really have to enable sse2 to be able to emit aes/pclmul
instructions. So it makes perfect sense for -maes to enable -msse2.

Indeed. I have reversed -msse/-mno-sse logic for -maes. This is an example I had in mind:


--cut here--
typedef long long __v2di __attribute__ ((vector_size (16)));
typedef long long __m128i __attribute__ ((vector_size (16)));

__v2di __X, __Y;

#ifndef __AES__

__v2di __builtin_ia32_aesenc128 (__v2di __X, __v2di __Y)
{
 /* Not really AES implementation */
 return __X + __Y;
}
#endif

void crypto_func (void)
{
 volatile __m128i AA;

 AA = (__m128i) __builtin_ia32_aesenc128 ((__v2di)__X, (__v2di)__Y);
}
--cut here--

We need -msse2 when -maes is enabled. We _can_ pass parameters to the fallback function through the stack, but -maes is _disabled_ at this time and we are free to have -msse/-mno-sse without -maes.

Today is just not my day.

Uros.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]