This is the mail archive of the
mailing list for the GCC project.
Re: combination of read/write and earlyclobber constraint modifier
- From: Marc Glisse <marc dot glisse at inria dot fr>
- To: Jeff Law <law at redhat dot com>
- Cc: Tom de Vries <Tom_deVries at mentor dot com>, Vladimir Makarov <vmakarov at redhat dot com>, gcc at gcc dot gnu dot org
- Date: Tue, 1 Jul 2014 21:58:47 +0200 (CEST)
- Subject: Re: combination of read/write and earlyclobber constraint modifier
- Authentication-results: sourceware.org; auth=none
- References: <53B30B96 dot 2000603 at mentor dot com> <53B31041 dot 8060608 at redhat dot com>
- Reply-to: gcc at gcc dot gnu dot org
On Tue, 1 Jul 2014, Jeff Law wrote:
On 07/01/14 13:27, Tom de Vries wrote:
I don't think we can define any reasonable semantics for &+. My
recommendation would be for this to be considered a hard error.
There are a few patterns which use both the read/write constraint
modifier (+) and the earlyclobber constraint modifier (&):
$ grep -c 'match_operand.*+.*&' gcc/config/*/* | grep -v :0
F.i., this one in gcc/config/aarch64/aarch64-simd.md:
[(set (match_operand:<VNARROWQ2> 0 "register_operand" "+&w")
(truncate:<VNARROWQ> (match_operand:VQN 1 "register_operand"
(truncate:<VNARROWQ> (match_operand:VQN 2 "register_operand"
The documentation (
https://gcc.gnu.org/onlinedocs/gccint/Modifiers.html#Modifiers ) states:
'‘&’ does not obviate the need to write ‘=’.
which seems to state that '&' implies '='.
An earlyclobber operand is defined as 'modified before the instruction
is finished using the input operands'. AFAIU that would indeed exclude
the possibility that the earlyclobber operand is an input/output operand
it self, but perhaps I misunderstand.
So my question is: is the combination of '&' and '+' supported ? If so,
what is the exact semantics ? If not, should we warn or give an error ?
Uh? The doc explicitly says "An input operand can be tied to an
earlyclobber operand" and goes on to explain why that is useful. It avoids
using the same register for other input when they are identical.