This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH, i386] Add prefixes avoidance tuning for silvermont target
- From: Andi Kleen <andi at firstfloor dot org>
- To: Mike Stump <mikestump at comcast dot net>
- Cc: Jakub Jelinek <jakub at redhat dot com>, Ilya Enkovich <enkovich dot gnu at gmail dot com>, gcc-patches at gcc dot gnu dot org, hubicka at ucw dot cz
- Date: Wed, 02 Jul 2014 11:30:14 -0700
- Subject: Re: [PATCH, i386] Add prefixes avoidance tuning for silvermont target
- Authentication-results: sourceware.org; auth=none
- References: <20140702103536 dot GA1827 at msticlxl57 dot ims dot intel dot com> <87r423u3y2 dot fsf at tassilo dot jf dot intel dot com> <20140702162700 dot GX31640 at tucnak dot redhat dot com> <3B1ED475-9DDA-44D6-8DEF-EE4287A4BF44 at comcast dot net>
Mike Stump <firstname.lastname@example.org> writes:
>>>> Silvermont processors have penalty for instructions having 4+ bytes of
>>>> prefixes (including escape bytes in opcode). This situation happens
>>>> when REX prefix is used in SSE4 instructions. This patch tries to
>>>> avoid such situation by preferring xmm0-xmm7 usage over xmm8-xmm15 in
>>>> those instructions. I achieved it by adding new tuning flag and new
>>>> alternatives affected by tuning.
>>> Why make it a tuning flag? Shouldn't this help unconditionally for code
>>> size everywhere? Or is there some drawback?
>> I don't think it will make code smaller, if you already have some value in
>> xmm8..xmm15 register, then by not allowing those registers directly on SSE4
>> insns just means it reloading and larger code.
> I canât help but think a better way to do this is to explain the costs
> of the REX registers as being more expensive, then let the register
> allocator prefer the cheaper registers. You then leave them all as
> valid, which I think is better than disappearing 1/2 of the registers.
Yes that would sound like a much better strategy.
BTW I thought gcc already did that for the integer registers to
avoid unnecessary prefixes, but maybe I misremember. Copying Honza.
email@example.com -- Speaking for myself only