On 9/17/26 18:06, Yonggang Luo wrote:
> (1) Put the comment before the implementation, not the header.
> That avoids whatever you're concerned about vs patch 2.
Indeed I tried, and I found basically all tcg's gen_ function have no
comment(detect by the auto-tools),
and it's parameter arg0 arg1 arg2 that can not understand at all; and
can not link to the impl
helper_* that defined as HELPEP(X) that makes me reading the tcg code
very hard.
Ah, new-fangled tooling. Something I don't use.
To me, the only thing that's interesting is the implementation.
That is, helper_foo. The wrapper, gen_helper_foo is not interesting.
Since I don't use it, I'm not sure what to suggest. Putting big block
comments in what are essentially templates does not make much sense.
Is there something the tooling can use to cross-reference the "real" code?
> (2) Don't pass an extra argument that changes behavior like this.
> Better to have two separate functions, each doing one thing.
how about gen_helper_raise_excp and gen_helper_raise_excp_restore
Sure.
> (3) Maybe better to place the functions in cpu-exec-common.c, so that
> the compiler can see all the definitions at once.
Do you mean do not use DEF_HELPER_FLAGS_3 at all?
Absolutely not. I meant put helper_raise_excp* in cpu-exec-common.c
instead of tcg-runtime.c.
r~