This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: inline asm and multi-alternative constraints
- From: David Wohlferd <dw at LimeGreenSocks dot com>
- To: Jeff Law <law at redhat dot com>, Segher Boessenkool <segher at kernel dot crashing dot org>
- Cc: Sandra Loosemore <sandra at codesourcery dot com>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>, Richard dot Earnshaw at foss dot arm dot com
- Date: Wed, 11 Nov 2015 01:19:09 -0800
- Subject: Re: inline asm and multi-alternative constraints
- Authentication-results: sourceware.org; auth=none
- References: <562DA0E2 dot 1040405 at LimeGreenSocks dot com> <562FE71E dot 7010309 at redhat dot com> <563285D8 dot 6020001 at redhat dot com> <563430F8 dot 7020406 at LimeGreenSocks dot com> <5637EC6F dot 7020505 at redhat dot com> <5637F50A dot 1090002 at codesourcery dot com> <56385495 dot 1050507 at LimeGreenSocks dot com> <563D29D7 dot 9000707 at redhat dot com> <20151107004639 dot GA27264 at gate dot crashing dot org> <563DAD50 dot 1010701 at LimeGreenSocks dot com> <56411599 dot 1040507 at redhat dot com>
On 11/9/2015 1:52 PM, Jeff Law wrote:
On 11/07/2015 12:50 AM, David Wohlferd wrote:
- Starting with 'modifiers', "=+&" and (reluctantly) "%" seem reasonable
for inline asm. But both "#*" seem sketchy.
Right. =+& are no-brainer yes, as are the constants 0-9. % is
probably OK as well.
#* are similar to !? in that they are inherently tied into the
register class preferencing implementation and documenting them would
be inadvisable.
Actually, #* are already doc'ed in the user guide. Are you advising
they be removed?
If so, the attached patch does this. It also removes references to
define_peephole2 and define_splits from the user guide version of this
page. There are other parts of this page that are more md than ug, but
these are the ones that annoyed me the most.
dw
Original: https://gcc.gnu.org/onlinedocs/gcc/Modifiers.html
Proposed: http://limegreensocks.com/gcc/Modifiers.html
Index: md.texi
===================================================================
--- md.texi (revision 229910)
+++ md.texi (working copy)
@@ -1646,7 +1646,9 @@
GCC can only handle one commutative pair in an asm; if you use more,
the compiler may fail. Note that you need not use the modifier if
the two alternatives are strictly identical; this would only waste
-time in the reload pass. The modifier is not operational after
+time in the reload pass.
+@ifset INTERNALS
+The modifier is not operational after
register allocation, so the result of @code{define_peephole2}
and @code{define_split}s performed after reload cannot rely on
@samp{%} to make the intended insn match.
@@ -1665,7 +1667,6 @@
@samp{*} additionally disparages slightly the alternative if the
following character matches the operand.
-@ifset INTERNALS
Here is an example: the 68000 has an instruction to sign-extend a
halfword in a data register, and can also sign-extend a value by
copying it into an address register. While either kind of register is