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, i386, AVX, AVX-512] Extend ADDITION_REGISTER_NAMES to XMMs and YMMs.


On Mon, Mar 17, 2014 at 4:12 PM, H.J. Lu <hjl.tools@gmail.com> wrote:

>> Patch in the bottom allows to use ymmXX and zmmXX
>> register names in inline asm statements as well as
>> in `register` variables definitions.
>>
>> New tests pass.
>> Bootstrap pass.
>>
>> Is it ok for trunk?
>> Do we need to backport it to 4.8?
>>
>> gcc/
>>         * config/i386/i386.h (ADDITIONAL_REGISTER_NAMES): Add
>>         ymm and zmm register names.
>>
>> testsuite/
>>         * gcc.target/i386/avx-additional-reg-names.c: New.
>>         * gcc.target/i386/avx512f-additional-reg-names.c: Ditto.

> Doesn't GCC generate the same code with xmm?
>
>> diff --git a/gcc/testsuite/gcc.target/i386/avx512f-additional-reg-names.c b/gcc/testsuite/gcc.target/i386/avx512f-additional-reg-names.c
>> new file mode 100644
>> index 0000000..1bd428a
>> --- /dev/null
>> +++ b/gcc/testsuite/gcc.target/i386/avx512f-additional-reg-names.c
>> @@ -0,0 +1,9 @@
>> +/* { dg-do compile } */
>> +/* { dg-options "-mavx512f" } */
>> +
>> +void foo ()
>> +{
>> +  register int zmm_var asm ("zmm9");
>> +
>> +  __asm__ __volatile__("vxorpd %%zmm0, %%zmm0, %%zmm7\n" : : : "zmm7" );
>> +}
>
> Doesn't GCC generate the same code with xmm?

It does, but the situation is the same as with %eax vs. %rax names.
So, I think the patch is OK for mainline, and similar patch involving
only %ymm names for AVX-enabled branches.

Uros.


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