From patchwork Sat Sep 22 00:18:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 185997 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4A0F22C008A for ; Sat, 22 Sep 2012 10:18:52 +1000 (EST) Received: from localhost ([::1]:36692 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TFDQo-0004ld-5M for incoming@patchwork.ozlabs.org; Fri, 21 Sep 2012 20:18:50 -0400 Received: from eggs.gnu.org ([208.118.235.92]:60294) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TFDQS-0004Vf-KT for qemu-devel@nongnu.org; Fri, 21 Sep 2012 20:18:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TFDQR-00015v-Es for qemu-devel@nongnu.org; Fri, 21 Sep 2012 20:18:28 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:62643) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TFDQR-00015R-8Y for qemu-devel@nongnu.org; Fri, 21 Sep 2012 20:18:27 -0400 Received: by mail-pa0-f45.google.com with SMTP id fb10so598759pad.4 for ; Fri, 21 Sep 2012 17:18:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=acakRo7wil+o+LYqVB1QHCU9us1PG0yXeOWYyU3V+Js=; b=B8NizhdMnOxXVXttqHPDaXuOi/nan3fwJbL/fZamWY+/mIJjltSzURpKk5LzVgfmxJ l1p646WyW/hb5bRS334AbJ1OTCO1fZv9ALwqIU2GBqSR0uPiO1OCHNHV1CzHeerfql8e 9UuOFFKE01aS+1ZuLTkupsVv9jBdX7mR6k7kkfulNRLXvCR5j7GiQcen9j8UiKCt1nS6 en91t1ytWhMnTHqbIiSopGz/lpRA1MeVvShnMgJD7tTV9+Mt9Py2qs/b/5x656ceHOVx uUkKkRa3ZIuQws5savyhUHbnZHhqk6XldfpLC/vuCYh13RQB+dDvtZR9LFcCWOkIsSrf sWqg== Received: by 10.66.79.195 with SMTP id l3mr16772488pax.33.1348273106966; Fri, 21 Sep 2012 17:18:26 -0700 (PDT) Received: from anchor.twiddle.home.com ([173.160.232.49]) by mx.google.com with ESMTPS id j9sm4837761pav.15.2012.09.21.17.18.25 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 21 Sep 2012 17:18:26 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 21 Sep 2012 17:18:11 -0700 Message-Id: <1348273096-1495-4-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 1.7.11.4 In-Reply-To: <1348273096-1495-1-git-send-email-rth@twiddle.net> References: <1348273096-1495-1-git-send-email-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.220.45 Cc: aurelien@aurel32.net Subject: [Qemu-devel] [PATCH 3/8] tcg: Optimize initial inputs for ori_i64 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Copy the same optimizations from ori_i32. Signed-off-by: Richard Henderson Reviewed-by: Aurelien Jarno --- tcg/tcg-op.h | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/tcg/tcg-op.h b/tcg/tcg-op.h index c8633ff..fd16499 100644 --- a/tcg/tcg-op.h +++ b/tcg/tcg-op.h @@ -559,9 +559,9 @@ static inline void tcg_gen_or_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2) static inline void tcg_gen_ori_i32(TCGv_i32 ret, TCGv_i32 arg1, int32_t arg2) { - /* some cases can be optimized here */ - if (arg2 == 0xffffffff) { - tcg_gen_movi_i32(ret, 0xffffffff); + /* Some cases can be optimized here. */ + if (arg2 == -1) { + tcg_gen_movi_i32(ret, -1); } else if (arg2 == 0) { tcg_gen_mov_i32(ret, arg1); } else { @@ -1183,9 +1183,16 @@ static inline void tcg_gen_or_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2) static inline void tcg_gen_ori_i64(TCGv_i64 ret, TCGv_i64 arg1, int64_t arg2) { - TCGv_i64 t0 = tcg_const_i64(arg2); - tcg_gen_or_i64(ret, arg1, t0); - tcg_temp_free_i64(t0); + /* Some cases can be optimized here. */ + if (arg2 == -1) { + tcg_gen_movi_i64(ret, -1); + } else if (arg2 == 0) { + tcg_gen_mov_i64(ret, arg1); + } else { + TCGv_i64 t0 = tcg_const_i64(arg2); + tcg_gen_or_i64(ret, arg1, t0); + tcg_temp_free_i64(t0); + } } static inline void tcg_gen_xor_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2)