From patchwork Fri Feb 19 18:24:13 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jay Foad X-Patchwork-Id: 45910 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 04419B7CC1 for ; Sat, 20 Feb 2010 15:59:42 +1100 (EST) Received: from localhost ([127.0.0.1]:41614 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NihMD-00070h-R9 for incoming@patchwork.ozlabs.org; Fri, 19 Feb 2010 23:54:21 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NiXzm-0007OW-HK for qemu-devel@nongnu.org; Fri, 19 Feb 2010 13:54:34 -0500 Received: from [199.232.76.173] (port=58621 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NiXzm-0007Ni-2C for qemu-devel@nongnu.org; Fri, 19 Feb 2010 13:54:34 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NiXzl-0007cv-Fg for qemu-devel@nongnu.org; Fri, 19 Feb 2010 13:54:33 -0500 Received: from mail-bw0-f218.google.com ([209.85.218.218]:39305) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NiXzk-0007c9-LL for qemu-devel@nongnu.org; Fri, 19 Feb 2010 13:54:32 -0500 Received: by bwz10 with SMTP id 10so352371bwz.2 for ; Fri, 19 Feb 2010 10:54:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=GVNXeKxoNSFjT4bkvMdcTn1H0Lp4rojLeQQ3e6SKALo=; b=DAb5XI2URWuyUMTlh93+HAI0YKdx6Pl7k/k5dEKs8V73cXWAp6cVu5RWcXAZyOHOHC p/AelSsnA1FLpY7UzKnQXVpcsU+XhXIABQpy1GqlvaBLoc5+XR+jRvO3IIRoO+yyEF0M o7cjIm2Ejis9lQpdTrW/DVHYKQrnN1+t9int0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=dd50I7bmjpi8LXN7Tpks6D0dnQCX1XO9ajRzMgQJsPcd3EPMwXgGPfVlMDFp5tGIpt jAsWZfOc5kP4NgA3LZG20NwBShCRNw6yLkfE09ZuVON/3VfE0mWKASJGQGWfrtFRKjyZ apsgB1vSztfpTF6SAhS828B5UURrYikkqywhM= MIME-Version: 1.0 Received: by 10.204.143.78 with SMTP id t14mr5367171bku.10.1266603853673; Fri, 19 Feb 2010 10:24:13 -0800 (PST) Date: Fri, 19 Feb 2010 18:24:13 +0000 Message-ID: From: Jay Foad To: qemu-devel@nongnu.org X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-Greylist: delayed 1816 seconds by postgrey-1.27 at monty-python; Fri, 19 Feb 2010 13:54:31 EST X-Mailman-Approved-At: Fri, 19 Feb 2010 23:49:25 -0500 Subject: [Qemu-devel] [PATCH] target-sparc: fix --enable-debug build X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org On Linux/x86, configuring with --enable-debug, I get:  CC    sparc64-linux-user/translate.o /home/foad/git/qemu/target-sparc/translate.c: In function ‘gen_load_trap_state_at_tl’: /home/foad/git/qemu/target-sparc/translate.c:1684: error: incompatible type for argument 3 of ‘tcg_gen_add_i32’ /home/foad/git/qemu/tcg/tcg-op.h:422: note: expected ‘TCGv_i32’ but argument is of type ‘TCGv_i64’ make[1]: *** [translate.o] Error 1 Does this look like a reasonable fix? Signed-off-by: Jay Foad diff --git a/target-sparc/translate.c b/target-sparc/translate.c index 7e9f0cf..b7d2a32 100644 --- a/target-sparc/translate.c +++ b/target-sparc/translate.c @@ -1663,27 +1663,27 @@ static inline TCGv get_src2(unsigned int insn, TCGv def) #ifdef TARGET_SPARC64 static inline void gen_load_trap_state_at_tl(TCGv_ptr r_tsptr, TCGv_ptr cpu_env) { - TCGv r_tl = tcg_temp_new(); + TCGv_i32 r_tl = tcg_temp_new_i32(); /* load env->tl into r_tl */ - { - TCGv_i32 r_tl_tmp = tcg_temp_new_i32(); - tcg_gen_ld_i32(r_tl_tmp, cpu_env, offsetof(CPUSPARCState, tl)); - tcg_gen_ext_i32_tl(r_tl, r_tl_tmp); - tcg_temp_free_i32(r_tl_tmp); - } + tcg_gen_ld_i32(r_tl, cpu_env, offsetof(CPUSPARCState, tl)); /* tl = [0 ... MAXTL_MASK] where MAXTL_MASK must be power of 2 */ - tcg_gen_andi_tl(r_tl, r_tl, MAXTL_MASK); + tcg_gen_andi_i32(r_tl, r_tl, MAXTL_MASK); /* calculate offset to current trap state from env->ts, reuse r_tl */ - tcg_gen_muli_tl(r_tl, r_tl, sizeof (trap_state)); + tcg_gen_muli_i32(r_tl, r_tl, sizeof (trap_state)); tcg_gen_addi_ptr(r_tsptr, cpu_env, offsetof(CPUState, ts)); /* tsptr = env->ts[env->tl & MAXTL_MASK] */ - tcg_gen_add_ptr(r_tsptr, r_tsptr, r_tl); + { + TCGv_ptr r_tl_tmp = tcg_temp_new_ptr(); + tcg_gen_ext_i32_ptr(r_tl_tmp, r_tl); + tcg_gen_add_ptr(r_tsptr, r_tsptr, r_tl_tmp); + tcg_temp_free_i32(r_tl_tmp); + } - tcg_temp_free(r_tl); + tcg_temp_free_i32(r_tl); } #endif