This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 1/6] [RS6000] rs6000_output_call for external call insn assembly output
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 :-)
"operands" is unused here, compiling this will warn.
"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"?
Are there some patterns that can be collapsed to one after this?
Segher