All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: alex.bennee@linaro.org, richard.henderson@linaro.org,
	qemu-devel@nongnu.org
Subject: Re: [PATCH 1/1] tcg: convert tcg/README to rst
Date: Wed, 30 Nov 2022 09:23:04 +0000	[thread overview]
Message-ID: <9bb475e0-e048-3dac-c86f-ed2a3423ce8a@ilande.co.uk> (raw)
In-Reply-To: <CAFEAcA-3sfsCDA7O8y_fa=amKSCBO0CW6y4=ci_rrqkm=D8xaw@mail.gmail.com>

On 24/11/2022 13:21, Peter Maydell wrote:

> On Wed, 23 Nov 2022 at 09:54, Mark Cave-Ayland
> <mark.cave-ayland@ilande.co.uk> wrote:
>>
>> Convert tcg/README to rst and move it to docs/devel as a new "TCG Intermediate
>> Representation" page. There are a few minor changes to improve the aesthetic
>> of the final output which are as follows:
>>
>>    - Rename the title from "Tiny Code Generator - Fabrice Bellard" to "TCG
>>      Intermediate Representation"
>>
>>    - Remove the section numbering
>>
>>    - Add the missing parameters to the ssadd_vec operations in the "Host
>>      vector operations" section
>>
>>    - Change the path to the Atomic Operations document to use a proper
>>      reference
>>
>> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> 
> 
> 
>> +   * - ctpop_i32/i64 *t0*, *t1*
>> +
>> +     - .. line-block::
>> +          *t0* = number of bits set in *t1*
>> +
>> +          With *ctpop* short for "count population", matching
>> +          the function name used in ``include/qemu/host-utils.h``.
> 
> Because we're using line-block, any newline is a literal newline.
> This causes some odd looking linebreaks because you get a linebreak
> both where it is in the input (after "matching") and again when
> the browser auto-wraps long lines. I think it would be better
> to not use line-block at all. Instead, we can just put in a blank
> line when we want a line break, like this:
> 
> diff --git a/docs/devel/tcg-ops.rst b/docs/devel/tcg-ops.rst
> index 0d90f3f7a00..e8a51ed1459 100644
> --- a/docs/devel/tcg-ops.rst
> +++ b/docs/devel/tcg-ops.rst
> @@ -252,8 +252,9 @@ Arithmetic
> 
>      * - rem_i32/i64 *t0*, *t1*, *t2*
> 
> -     - .. line-block::
> +     -
>             *t0* = *t1* % *t2* (signed)
> +
>             Undefined behavior if division by zero or overflow.
> 
>      * - remu_i32/i64 *t0*, *t1*, *t2*
> @@ -339,8 +340,9 @@ Shifts/Rotates
> 
>      * - shl_i32/i64 *t0*, *t1*, *t2*
> 
> -     - .. line-block::
> +     -
>             *t0* = *t1* << *t2*
> +
>             Unspecified behavior if *t2* < 0 or *t2* >= 32 (resp 64)
> 
>      * - shr_i32/i64 *t0*, *t1*, *t2*
> 
> This will result in slightly more whitespace between lines
> in a few places, but I think it's nicer than the mis-wrapped
> paragraphs.

I tried this locally, however without the explicit line-block:: everything was still 
placed in a single line even with multiple blank lines. I think I read somewhere that 
all table content is forced into a single document by default, which explains why it 
was necessary for me to add the line-block:: to get multi-line table content.

> If you really want to keep the line-block formatting, I think
> you need to use the vertical-bar version, which lets you
> specify which lines of the source are really new lines
> (they have a '|' at the start), and which are just continuations
> of the same line (they start with a ' ' instead), like this:
> 
> @@ -325,11 +325,11 @@ Logical
> 
>      * - ctpop_i32/i64 *t0*, *t1*
> 
> -     - .. line-block::
> -          *t0* = number of bits set in *t1*
> -
> -          With *ctpop* short for "count population", matching
> -          the function name used in ``include/qemu/host-utils.h``.
> +     -
> +       |   *t0* = number of bits set in *t1*
> +       |
> +       |   With *ctpop* short for "count population", matching
> +           the function name used in ``include/qemu/host-utils.h``.
> 
> 
> But I'm not sure it's really worth the effort.

This approach seems to work well for me, certainly it feels easier to maintain 
compared to switching everything over to use grid tables. I've got a v2 update which 
I shall post shortly.

> Otherwise
> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
> 
> thanks
> -- PMM


ATB,

Mark.


  reply	other threads:[~2022-11-30  9:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-23  9:54 [PATCH 0/1] tcg: convert tcg/README to rst Mark Cave-Ayland
2022-11-23  9:54 ` [PATCH 1/1] " Mark Cave-Ayland
2022-11-24 13:21   ` Peter Maydell
2022-11-30  9:23     ` Mark Cave-Ayland [this message]
2022-11-23 11:06 ` [PATCH 0/1] " BALATON Zoltan
2022-11-23 12:51   ` Mark Cave-Ayland

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=9bb475e0-e048-3dac-c86f-ed2a3423ce8a@ilande.co.uk \
    --to=mark.cave-ayland@ilande.co.uk \
    --cc=alex.bennee@linaro.org \
    --cc=peter.maydell@linaro.org \
    --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.