[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: What is this mean of the comment?
From: |
Peter Maydell |
Subject: |
Re: What is this mean of the comment? |
Date: |
Mon, 20 Jul 2020 14:36:29 +0100 |
On Mon, 20 Jul 2020 at 12:52, tugouxp <13824125580@163.com> wrote:
> in flollowing comment of tcg.h, it says every helper max need 6
> input argument and 1 output argument,
> but why here both multiply by 2 in here?
Because arguments might be 64 bits, and on a 32-bit host
a 64-bit argument has to be passed as 2 separate operands.
> what is the 14 mean?
It's the maximum possible number of operands in the
worst case: six 64-bit input arguments which need to
be passed as 2 32-bit operands each, and a 64-bit
return value which also needs to be passed as 2
32-bit operands. (6 * 2) + 2 == 14.
The reason we care is described in the next part
of the comment: we keep one bit of information (liveness)
about the operands of each TCGop, and because 14 < 16
we can fit this information into a single 16-bit integer
per TCG op.
> 520 /* While we limit helpers to 6 arguments, for 32-bit hosts, with padding,
> 521 this imples a max of 6*2 (64-bit in) + 2 (64-bit out) = 14 operands.
> 522 There are never more than 2 outputs, which means that we can store all
> 523 dead + sync data within 16 bits. */
thanks
-- PMM