All of lore.kernel.org
 help / color / mirror / Atom feed
From: Taylor Simpson <tsimpson@quicinc.com>
To: Anton Johansson <anjo@rev.ng>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Cc: "ale@rev.ng" <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>,
	Michael Lambert <mlambert@quicinc.com>
Subject: RE: [PATCH v8 10/12] target/hexagon: import parser for idef-parser
Date: Mon, 11 Apr 2022 15:20:09 +0000	[thread overview]
Message-ID: <SN4PR0201MB8808765107E51ACC51D89DECDEEA9@SN4PR0201MB8808.namprd02.prod.outlook.com> (raw)
In-Reply-To: <20220209170312.30662-11-anjo@rev.ng>



> -----Original Message-----
> From: Anton Johansson <anjo@rev.ng>
> Sent: Wednesday, February 9, 2022 11:03 AM
> To: qemu-devel@nongnu.org
> Cc: ale@rev.ng; Taylor Simpson <tsimpson@quicinc.com>; Brian Cain
> <bcain@quicinc.com>; Michael Lambert <mlambert@quicinc.com>;
> babush@rev.ng; nizzo@rev.ng; richard.henderson@linaro.org
> Subject: [PATCH v8 10/12] target/hexagon: import parser for idef-parser
> 
> Signed-off-by: Alessandro Di Federico <ale@rev.ng>
> Signed-off-by: Paolo Montesel <babush@rev.ng>
> Signed-off-by: Anton Johansson <anjo@rev.ng>


> diff --git a/target/hexagon/idef-parser/parser-helpers.c
> b/target/hexagon/idef-parser/parser-helpers.c
> new file mode 100644



> +void gen_set_overflow(Context *c, YYLTYPE *locp, HexValue *value)
> +{
> +    HexValue value_m = *value;
> +
> +    if (is_inside_ternary(c)) {
> +        /* Inside ternary operator, need to take care of the side-effect */
> +        HexValue cond = get_ternary_cond(c, locp);
> +        HexValue zero = gen_constant(c, locp, "0", cond.bit_width,
> UNSIGNED);
> +        bool is_64bit = cond.bit_width == 64;
> +        unsigned bit_width = cond.bit_width;
> +        value_m = rvalue_materialize(c, locp, &value_m);
> +        if (is_64bit) {
> +            value_m = gen_rvalue_extend(c, locp, &value_m);
> +        }
> +        OUT(c, locp, "tcg_gen_movcond_i", &bit_width,
> +                     "(TCG_COND_NE, ", &value_m, ", ", &cond);
> +        OUT(c, locp, ", ", &zero, ", ", &value_m, ", ", &zero, ");\n");

You shouldn't write zero when the condition is false - you should do nothing.  Try a test where OVF is already set.  You can't overwrite the bit with zero when the current instruction doesn't overflow.



> +        if (is_64bit) {
> +            value_m = gen_rvalue_truncate(c, locp, &value_m);
> +        }
> +        gen_rvalue_free(c, locp, &cond);
> +    }
> +
> +    OUT(c, locp, "SET_USR_FIELD(USR_OVF, ", &value_m, ");\n");
> +    gen_rvalue_free(c, locp, &value_m);
> +}


  reply	other threads:[~2022-04-11 15:37 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-09 17:03 [PATCH v8 00/12] target/hexagon: introduce idef-parser Anton Johansson via
2022-02-09 17:03 ` [PATCH v8 01/12] target/hexagon: update MAINTAINERS for idef-parser Anton Johansson via
2022-02-09 17:03 ` [PATCH v8 02/12] target/hexagon: import README " Anton Johansson via
2022-02-09 17:03 ` [PATCH v8 03/12] target/hexagon: make slot number an unsigned Anton Johansson via
2022-02-09 17:03 ` [PATCH v8 04/12] target/hexagon: make helper functions non-static Anton Johansson via
2022-02-09 17:03 ` [PATCH v8 05/12] target/hexagon: introduce new helper functions Anton Johansson via
2022-03-21 18:28   ` Taylor Simpson
2022-02-09 17:03 ` [PATCH v8 06/12] target/hexagon: expose next PC in DisasContext Anton Johansson via
2022-02-09 17:03 ` [PATCH v8 07/12] target/hexagon: prepare input for the idef-parser Anton Johansson via
2022-03-21 18:33   ` Taylor Simpson
2022-02-09 17:03 ` [PATCH v8 08/12] target/hexagon: import flex/bison to docker files Anton Johansson via
2022-02-09 17:03 ` [PATCH v8 09/12] target/hexagon: import lexer for idef-parser Anton Johansson via
2022-03-21 18:40   ` Taylor Simpson
2022-02-09 17:03 ` [PATCH v8 10/12] target/hexagon: import parser " Anton Johansson via
2022-04-11 15:20   ` Taylor Simpson [this message]
2022-04-12 15:10     ` Anton Johansson via
2022-04-12 18:41       ` Taylor Simpson
2022-04-21 11:50         ` Anton Johansson via
2022-04-21 14:22           ` Taylor Simpson
2022-04-21 16:38             ` Anton Johansson via
2022-02-09 17:03 ` [PATCH v8 11/12] target/hexagon: call idef-parser functions Anton Johansson via
2022-02-09 17:03 ` [PATCH v8 12/12] target/hexagon: import additional tests Anton Johansson via
2022-03-21 18:58   ` Taylor Simpson

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=SN4PR0201MB8808765107E51ACC51D89DECDEEA9@SN4PR0201MB8808.namprd02.prod.outlook.com \
    --to=tsimpson@quicinc.com \
    --cc=ale@rev.ng \
    --cc=anjo@rev.ng \
    --cc=babush@rev.ng \
    --cc=bcain@quicinc.com \
    --cc=mlambert@quicinc.com \
    --cc=nizzo@rev.ng \
    --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.