All of lore.kernel.org
 help / color / mirror / Atom feed
From: Taylor Simpson <tsimpson@quicinc.com>
To: Alessandro Di Federico <ale.qemu@rev.ng>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Cc: Alessandro Di Federico <ale@rev.ng>,
	Brian Cain <bcain@quicinc.com>,
	"richard.henderson@linaro.org" <richard.henderson@linaro.org>,
	"babush@rev.ng" <babush@rev.ng>, "nizzo@rev.ng" <nizzo@rev.ng>,
	"philmd@redhat.com" <philmd@redhat.com>
Subject: RE: [PATCH v4 11/12] target/hexagon: call idef-parser functions
Date: Thu, 29 Apr 2021 15:59:35 +0000	[thread overview]
Message-ID: <BYAPR02MB48867E82FB1F97AE36D0C76ADE5F9@BYAPR02MB4886.namprd02.prod.outlook.com> (raw)
In-Reply-To: <20210415163455.3839169-12-ale.qemu@rev.ng>



> -----Original Message-----
> From: Alessandro Di Federico <ale.qemu@rev.ng>
> Sent: Thursday, April 15, 2021 11:35 AM
> To: qemu-devel@nongnu.org
> Cc: Taylor Simpson <tsimpson@quicinc.com>; Brian Cain
> <bcain@quicinc.com>; babush@rev.ng; nizzo@rev.ng; philmd@redhat.com;
> richard.henderson@linaro.org; Alessandro Di Federico <ale@rev.ng>
> Subject: [PATCH v4 11/12] target/hexagon: call idef-parser functions
> 
> From: Alessandro Di Federico <ale@rev.ng>
> 
> Extend gen_tcg_funcs.py in order to emit calls to the functions emitted
> by the idef-parser, if available.
> 
> Signed-off-by: Alessandro Di Federico <ale@rev.ng>
> ---
>  target/hexagon/gen_tcg_funcs.py | 28 ++++++++++++++++++++++++++--
>  target/hexagon/hex_common.py    | 10 ++++++++++
>  target/hexagon/meson.build      | 22 +++++++++++++---------
>  3 files changed, 49 insertions(+), 11 deletions(-)
> 
> diff --git a/target/hexagon/gen_tcg_funcs.py
> b/target/hexagon/gen_tcg_funcs.py
> index db9f663a77..5980dab8ee 100755
> --- a/target/hexagon/gen_tcg_funcs.py
> +++ b/target/hexagon/gen_tcg_funcs.py
> @@ -394,7 +394,29 @@ def gen_tcg_func(f, tag, regs, imms):
>          if (hex_common.is_read(regid)):
>              genptr_src_read_opn(f,regtype,regid,tag)
> 
> -    if ( hex_common.skip_qemu_helper(tag) ):
> +    if hex_common.is_idef_parser_enabled(tag):
> +        declared = []
> +        ## Handle registers
> +        for regtype,regid,toss,numregs in regs:
> +            if (hex_common.is_pair(regid)
> +                or (hex_common.is_single(regid)
> +                    and hex_common.is_old_val(regtype, regid, tag))):
> +                declared.append("%s%sV" % (regtype, regid))
> +                if regtype == "M":
> +                    declared.append("%s%sN" % (regtype, regid))
> +            elif hex_common.is_new_val(regtype, regid, tag):
> +                declared.append("%s%sN" % (regtype,regid))
> +            else:
> +                print("Bad register parse: ",regtype,regid,toss,numregs)
> +
> +        ## Handle immediates
> +        for immlett,bits,immshift in imms:
> +            declared.append(hex_common.imm_name(immlett))
> +
> +        arguments = ", ".join(["ctx", "insn", "pkt"] + declared)
> +        f.write("    emit_%s(%s);\n" % (tag, arguments))
> +
> +    elif ( hex_common.skip_qemu_helper(tag) ):
>          f.write("    fGEN_TCG_%s(%s);\n" % (tag, hex_common.semdict[tag]))
>      else:
>          ## Generate the call to the helper

You should add the hex_common.is_idef_parser_enabled(tag) check to gen_helper_protos.py and gen_helper_funcs.py.

Look for these lines in each of those files
            if ( hex_common.skip_qemu_helper(tag) ):
                continue
If you add
            if ( hex_common.is_idef_parser_enabled(tag) ):
                continue
that will greatly reduce the size of helper_protos_generated.c.inc and helper_funcs.c.inc.  That will reduce the build time for the Hexagon target as well as the size of the qemu executable.

You'll also need to modify the main function in each of those files and the corresponding invocation in meson.build to do the setup so the check does what you expect.

Thanks,
Taylor



  reply	other threads:[~2021-04-29 16:03 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-15 16:34 [PATCH v4 00/12] target/hexagon: introduce idef-parser Alessandro Di Federico via
2021-04-15 16:34 ` [PATCH v4 01/12] tcg: expose TCGCond manipulation routines Alessandro Di Federico via
2021-04-18 20:57   ` Richard Henderson
2021-04-15 16:34 ` [PATCH v4 02/12] target/hexagon: update MAINTAINERS for idef-parser Alessandro Di Federico via
2021-04-18 20:58   ` Richard Henderson
2021-04-15 16:34 ` [PATCH v4 03/12] target/hexagon: import README " Alessandro Di Federico via
2021-04-15 16:34 ` [PATCH v4 04/12] target/hexagon: make slot number an unsigned Alessandro Di Federico via
2021-04-18 21:10   ` Richard Henderson
2021-04-15 16:34 ` [PATCH v4 05/12] target/hexagon: make helper functions non-static Alessandro Di Federico via
2021-04-18 21:11   ` Richard Henderson
2021-04-15 16:34 ` [PATCH v4 06/12] target/hexagon: introduce new helper functions Alessandro Di Federico via
2021-04-18 21:31   ` Richard Henderson
2021-04-19 15:00     ` Taylor Simpson
2021-04-20  6:39       ` Alessandro Di Federico via
2021-04-15 16:34 ` [PATCH v4 07/12] target/hexagon: expose next PC in DisasContext Alessandro Di Federico via
2021-04-18 21:34   ` Richard Henderson
2021-04-15 16:34 ` [PATCH v4 08/12] target/hexagon: prepare input for the idef-parser Alessandro Di Federico via
2021-04-18 21:43   ` Richard Henderson
2021-04-15 16:34 ` [PATCH v4 09/12] target/hexagon: import lexer for idef-parser Alessandro Di Federico via
2021-04-27  2:01   ` Taylor Simpson
2021-04-28 10:25     ` Paolo Montesel
2021-04-28 15:55       ` Taylor Simpson
2021-04-29 10:53         ` Paolo Montesel
2021-04-15 16:34 ` [PATCH v4 10/12] target/hexagon: import parser " Alessandro Di Federico via
2021-04-15 16:34 ` [PATCH v4 11/12] target/hexagon: call idef-parser functions Alessandro Di Federico via
2021-04-29 15:59   ` Taylor Simpson [this message]
2021-04-15 16:34 ` [PATCH v4 12/12] target/hexagon: import additional tests Alessandro Di Federico via

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BYAPR02MB48867E82FB1F97AE36D0C76ADE5F9@BYAPR02MB4886.namprd02.prod.outlook.com \
    --to=tsimpson@quicinc.com \
    --cc=ale.qemu@rev.ng \
    --cc=ale@rev.ng \
    --cc=babush@rev.ng \
    --cc=bcain@quicinc.com \
    --cc=nizzo@rev.ng \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.