On Wed, Nov 07, 2018 at 06:08:33PM -0600, Segher Boessenkool wrote: > On Wed, Nov 07, 2018 at 04:07:15PM +1030, Alan Modra wrote: > > +extern const char *rs6000_output_call (rtx *, unsigned int, bool, const > > char *); > > Maybe have a separate rs6000_output_call and rs6000_output_sibcall? Bare > boolean function parameters aren't great. (They can of course both call > rs6000_output_call_1 or whatever, if that makes sense). > > > --- a/gcc/config/rs6000/rs6000.c > > +++ b/gcc/config/rs6000/rs6000.c > > @@ -21380,6 +21380,37 @@ rs6000_assemble_integer (rtx x, unsigned int size, > > int aligned_p) > > return default_assemble_integer (x, size, aligned_p); > > } > > > > +/* Return a template string for assembly to emit when making an > > + external call. FUN is the %z argument, ARG is either NULL or > > + a @TLSGD or @TLSLD __tls_get_addr argument specifier. */ > > + > > +const char * > > +rs6000_output_call (rtx *operands, unsigned int fun, bool sibcall, > > + const char *arg) > > +{ > > + /* -Wformat-overflow workaround, without which gcc thinks that %u > > + might produce 10 digits. FUN is 0 or 1 as of 2018-03. */ > > + gcc_assert (fun <= 6); > > So "fun" is the operand number. Rename it, and use MAX_RECOG_OPERANDS > instead of 6? And allow for it to take 2 or 3 chars to print :-)
Eh, so I can't have a little fun? funop then? (It's the index of the call operand that has the function symref or whatever to call.) > "operands" is unused here, compiling this will warn. Oops, I did bootstrap each patch individually at one stage.. Probably happened when I edited the patchset, to reduce the size of later changes. rs6000_output_call didn't have "operands" to start with. > "output" is a lie, this function doesn't output anything. Hardly the > only case of this in the rs6000 port, but it is annoying. What would be > a good name for this... "rs6000_template_for_call"? OK, I went with rs6000_call_template and rs6000_sibcall_template. Next patch also changed to use rs6000_indirect_call_template and rs6000_indirect_sibcall_template. Final patch uses rs6000_pltseq_template. > Are there some patterns that can be collapsed to one after this? No, I don't think so. Patch 5/6 does some of that for TLS calls. -- Alan Modra Australia Development Lab, IBM