All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Alexander Graf <agraf@suse.de>
Cc: "qemu-devel Developers" <qemu-devel@nongnu.org>,
	"Kirill Batuzov" <batuzovk@ispras.ru>,
	"Blue Swirl" <blauwirbel@gmail.com>,
	"Andreas Färber" <andreas.faerber@web.de>,
	"David Gibson" <david@gibson.dropbear.id.au>
Subject: Re: [Qemu-devel] [PATCH] TCG: Add preprocessor guards for optional tcg ops
Date: Thu, 11 Aug 2011 15:28:25 +0300	[thread overview]
Message-ID: <4E43CAE9.3080209@redhat.com> (raw)
In-Reply-To: <F4757B4A-4D57-4796-BC3C-AED2C376A59E@suse.de>

On 08/11/2011 02:40 PM, Alexander Graf wrote:
> On 11.08.2011, at 13:24, malc wrote:
>
> >  On Thu, 11 Aug 2011, Alexander Graf wrote:
> >
> >>  While compiling current HEAD on a ppc64 box, I was confronted with the
> >>  following compile errors:
> >>
> >>   tcg/optimize.c: In function ?tcg_constant_folding?:
> >>   tcg/optimize.c:546: error: ?INDEX_op_not_i32? undeclared (first use in this function)
> >>   tcg/optimize.c:546: error: (Each undeclared identifier is reported only once
> >>   tcg/optimize.c:546: error: for each function it appears in.)
> >>   tcg/optimize.c:546: error: ?INDEX_op_not_i64? undeclared (first use in this function)
> >>   tcg/optimize.c:573: error: ?INDEX_op_ext32u_i64? undeclared (first use in this function)
> >>   make[1]: *** [tcg/optimize.o] Error 1
> >>
> >>  Obviously, the optimize.c tries to use TCG opcode constants that are optional
> >>  and thus not defined in some targets, such as ppc64.
> >>
> >>  This patch guards them with the proper #ifdefs, so compilation works again.
> >>
> >>  Signed-off-by: Alexander Graf<agraf@suse.de>
> >>  ---
> >>  tcg/optimize.c |    8 +++++++-
> >>  1 files changed, 7 insertions(+), 1 deletions(-)
> >>
> >>  diff --git a/tcg/optimize.c b/tcg/optimize.c
> >>  index 7eb5eb1..7b4954c 100644
> >>  --- a/tcg/optimize.c
> >>  +++ b/tcg/optimize.c
> >>  @@ -543,7 +543,11 @@ static TCGArg *tcg_constant_folding(TCGContext *s, uint16_t *tcg_opc_ptr,
> >>              gen_args += 2;
> >>              args += 2;
> >>              break;
> >>  +#if ((TCG_TARGET_REG_BITS == 32)&&  defined(TCG_TARGET_HAS_not_i32)) || \
> >>  +    ((TCG_TARGET_REG_BITS == 64)&&  defined(TCG_TARGET_HAS_not_i32)&&  \
> >>  +     defined(TCG_TARGET_HAS_not_i64))
> >>          CASE_OP_32_64(not):
> >>  +#endif
> >>  #ifdef TCG_TARGET_HAS_ext8s_i32
> >>          case INDEX_op_ext8s_i32:
> >>  #endif
> >>  @@ -568,8 +572,10 @@ static TCGArg *tcg_constant_folding(TCGContext *s, uint16_t *tcg_opc_ptr,
> >>  #ifdef TCG_TARGET_HAS_ext16u_i64
> >>          case INDEX_op_ext16u_i64:
> >>  #endif
> >>  -#if TCG_TARGET_REG_BITS == 64
> >>  +#if (TCG_TARGET_REG_BITS == 64)&&  defined(TCG_TARGET_HAS_ext32s_i64)
> >>          case INDEX_op_ext32s_i64:
> >>  +#endif
> >>  +#if (TCG_TARGET_REG_BITS == 64)&&  defined(TCG_TARGET_HAS_ext32u_i64)
> >>          case INDEX_op_ext32u_i64:
> >>  #endif
> >>              if (temps[args[1]].state == TCG_TEMP_CONST) {
> >>
> >
> >  Or (not even compile tested):
>
> Sure, but then the next target would pop up with optionals not implemented. The real alternative would be to make these ops non-optional :)
>

Or to have automatic generation of the optionals based on the 
primitives, if the optionals are not present.

-- 
error compiling committee.c: too many arguments to function

  reply	other threads:[~2011-08-11 12:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-11 10:50 [Qemu-devel] [PATCH] TCG: Add preprocessor guards for optional tcg ops Alexander Graf
2011-08-11 11:24 ` malc
2011-08-11 11:40   ` Alexander Graf
2011-08-11 12:28     ` Avi Kivity [this message]
2011-08-11 12:36       ` Alexander Graf
2011-08-11 12:58         ` Avi Kivity
2011-08-11 16:38           ` Blue Swirl
2011-08-11 18:14             ` Richard Henderson
2011-08-21 20:22               ` Alexander Graf

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=4E43CAE9.3080209@redhat.com \
    --to=avi@redhat.com \
    --cc=agraf@suse.de \
    --cc=andreas.faerber@web.de \
    --cc=batuzovk@ispras.ru \
    --cc=blauwirbel@gmail.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=qemu-devel@nongnu.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.