This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
combination of read/write and earlyclobber constraint modifier
- From: Tom de Vries <Tom_deVries at mentor dot com>
- To: Vladimir Makarov <vmakarov at redhat dot com>
- Cc: <gcc at gcc dot gnu dot org>
- Date: Tue, 1 Jul 2014 21:27:18 +0200
- Subject: combination of read/write and earlyclobber constraint modifier
- Authentication-results: sourceware.org; auth=none
Vladimir,
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
gcc/config/aarch64/aarch64-simd.md:1
gcc/config/arc/arc.md:1
gcc/config/arm/ldmstm.md:30
gcc/config/rs6000/spe.md:8
...
F.i., this one in gcc/config/aarch64/aarch64-simd.md:
...
(define_insn "vec_pack_trunc_<mode>"
[(set (match_operand:<VNARROWQ2> 0 "register_operand" "+&w")
(vec_concat:<VNARROWQ2>
(truncate:<VNARROWQ> (match_operand:VQN 1 "register_operand" "w"))
(truncate:<VNARROWQ> (match_operand:VQN 2 "register_operand" "w"))))]
...
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 ?
Thanks,
- Tom