qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] tcg/arm: Remove unused tcg_out_addi()


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH] tcg/arm: Remove unused tcg_out_addi()
Date: Mon, 12 Sep 2011 18:30:46 +0100

On 12 September 2011 18:04, Stefan Weil <address@hidden> wrote:
> Am 12.09.2011 12:03, schrieb Peter Maydell:
>> Remove the unused function tcg_out_addi() from the ARM TCG backend;
>> this fixes a compilation failure on ARM hosts with newer gcc.

> Are you sure that those functions will never be needed again?
> If yes, your solution is ok. I was not sure - that's the reason
> why I had sent a patch using inline. #if 0 ... #endif and
> a comment might also be a solution for possible
> future usage.

Well, if we do need it again we'll have to resurrect the ppc version.
I dislike #if 0...#endif code.

I think the underlying problem here is that we don't have a well
defined API which the tcg backends have to provide to the generic
tcg code. So we can't really say whether tcg_out_addi() ought to
be part of it or not. (Ideally all the functions provided by the
backend ought to have a consistent naming scheme, eg tcg_target_*,
but sadly this isn't the case. And the way tcg.c #includes the
backend means you can't use presence/absence of 'static' to
identify the exposed API either... Does that really gain us much,
or should we just build tcg-target.c as a separate translation unit?)

I think I would argue that tcg.c ought to do addition via tcg_out_op,
since the target has to provide addition via that route anyway.
That would be cleaner than requiring backends to implement an extra
interface for "emit code to add things together". If you buy this
line of reasoning then deleting the current tcg_out_addi() on
platforms that don't need it internally anyhow is clearly the
Right Thing :-)

-- PMM



reply via email to

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