This is the mail archive of the
mailing list for the GCC project.
Re: combination of read/write and earlyclobber constraint modifier
- From: Jeff Law <law at redhat dot com>
- To: Tom de Vries <Tom_deVries at mentor dot com>, Vladimir Makarov <vmakarov at redhat dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 01 Jul 2014 13:47:13 -0600
- Subject: Re: combination of read/write and earlyclobber constraint modifier
- Authentication-results: sourceware.org; auth=none
- References: <53B30B96 dot 2000603 at mentor dot com>
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 ?