qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [PATCH v6 02/12] target/hexagon: import README for idef-parser


From: Taylor Simpson
Subject: RE: [PATCH v6 02/12] target/hexagon: import README for idef-parser
Date: Tue, 7 Sep 2021 18:09:22 +0000


> -----Original Message-----
> From: Alessandro Di Federico <ale.qemu@rev.ng>
> Sent: Tuesday, July 20, 2021 7:30 AM
> To: qemu-devel@nongnu.org
> Cc: Taylor Simpson <tsimpson@quicinc.com>; Brian Cain
> <bcain@quicinc.com>; babush@rev.ng; nizzo@rev.ng;
> richard.henderson@linaro.org; Alessandro Di Federico <ale@rev.ng>
> Subject: [PATCH v6 02/12] target/hexagon: import README for idef-parser
> 
> From: Alessandro Di Federico <ale@rev.ng>
> 
> Signed-off-by: Alessandro Di Federico <ale@rev.ng>
> ---
>  target/hexagon/idef-parser/README.rst | 447

> +Now let's have a quick look at the generated code, line by line.
> +
> +::
> +
> +   tcg_gen_movi_i32(RdV, 0);
> +
> +This code starts by zero-initializing ``RdV``, since reading from that
> +register without initialization will cause a segmentation fault by
> +QEMU.  This is emitted since a declaration of the ``RdV`` register was
> +parsed, but we got no indication that the variable has been initialized by 
> the
> caller.

You should only need this for predicated instructions.  For non-predicated 
instructions, RdV will always be written.

> +Parser Structure
> +----------------

Before you describe the parser, you should describe what 
gen_idef_parser_funcs.py does and the contents of idef_parser_input.h.inc and 
idef_parser_input.preprocessed.h.inc.


> +Expressions
> +~~~~~~~~~~~

Rather than describing the grammar in detail here, it would be better to state 
that we are parsing C language statements
and describe what things need to be handled specially (e.g., macros, variables 
like RdV, etc).

> +Debugging
> +---------

In this section, you should describe how to narrow down to a specific 
instruction tag (e.g., A2_add) that is emitting incorrect TCG code
when a test failure is identified.  In other words, how do you switch back to 
the C helper function instead of the idef-parser generated version, and how can 
you binary search to the one emitting incorrect code?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]