This is the mail archive of the 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: combination of read/write and earlyclobber constraint modifier

On 07/01/14 13:27, Tom de Vries wrote:

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/
(define_insn "vec_pack_trunc_<mode>"
  [(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 ( ) 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 ?
I don't think we can define any reasonable semantics for &+. My recommendation would be for this to be considered a hard error.


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