From patchwork Thu Sep 7 22:40:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 111981 Delivered-To: patch@linaro.org Received: by 10.140.94.239 with SMTP id g102csp726284qge; Thu, 7 Sep 2017 15:48:49 -0700 (PDT) X-Received: by 10.200.25.124 with SMTP id g57mr1377783qtk.60.1504824529803; Thu, 07 Sep 2017 15:48:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504824529; cv=none; d=google.com; s=arc-20160816; b=Y0NEveSboiHvbSs3ellml/bWvNXZWGl9lEGHrzL2n493EtjLOk8VZ7LcIhcSQ+W9UO CFMeLj1/bQlebdJg0QQJvUsl6HvDNBxhXwyTMnysbVlBJ1wa/H/g99P8SAnhGJGYuGPT UDX6VMp9i1KRX7S9NuHXa20YBWOKCznJMGCrVjZ4tdDa9WoF264+SSOtoyj669YMCo1L /qqeqb4msL00ZUUvFbtIrEzxOUedz3SsaSC6jZoiZN65P+h1VjWRu0lFUf948qXsyDU6 I20eU2TileQrqOzjUVlwIEorfspdEdGDjvsQaHwskiebz0wrdewVdD3UMW/Dy+G3eqB3 D9FQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=rGbRrj0jmlEL38dOoU7mQ92x2mbFZxz0QiK0pcfEGz0=; b=iQUkm7ck+bfbHTgNdlmXxqS/2Rc4zvZg3v2B/IjU4VWZdhXjC9LpaULZ2mWpoqoNrk gIPGEyD/vlT8EqDeCoIIgpcr1/0BKoEzzQmA1ZQ3rG2Frm67xLZoJezKu24teW9kIv3V Tj5WuAUihi3TQvSvMsLgdhBaNXTfM8HOtB9uKayl5DhxwoE2BkbCJnuurD0ZJ7XM+X07 ZqLWEekPGO7inAWTwr29dGXZ7ZqvDZAax7+zb3558xHxee+8ok/diUdoZP27c0u5Bybp 81BJZnpIvewyXYfuR67Dq4cMwI6esmqSqDyWE2zQSOEf8BKddT+RIYhYuZAme3cSfg9v AycA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=jBYkufR6; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id r9si359197qkh.90.2017.09.07.15.48.49 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 07 Sep 2017 15:48:49 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=jBYkufR6; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:42543 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dq5bL-0000r2-PX for patch@linaro.org; Thu, 07 Sep 2017 18:48:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52075) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dq5Tz-00032B-NE for qemu-devel@nongnu.org; Thu, 07 Sep 2017 18:41:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dq5Tu-00088V-TC for qemu-devel@nongnu.org; Thu, 07 Sep 2017 18:41:11 -0400 Received: from mail-pf0-x229.google.com ([2607:f8b0:400e:c00::229]:32922) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dq5Tu-00087n-NS for qemu-devel@nongnu.org; Thu, 07 Sep 2017 18:41:06 -0400 Received: by mail-pf0-x229.google.com with SMTP id y29so859862pff.0 for ; Thu, 07 Sep 2017 15:41:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rGbRrj0jmlEL38dOoU7mQ92x2mbFZxz0QiK0pcfEGz0=; b=jBYkufR60avJ+5wm8Zgr7Asm/1ifTFL8S73nIP2HAcABj0mGwEr4oaICgFlhMAcEq4 eCY22ysDa02W7FPM5j4cey4Wp4nS8PT8T5gEVT59Xs+K2mCPFRiivpNmVJNpxYzFeMZ9 r8tf13lItEqzVZBOAgW7ZsJ9iOz3/ls61rkbU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=rGbRrj0jmlEL38dOoU7mQ92x2mbFZxz0QiK0pcfEGz0=; b=kz0CZloXi/iOs5DsREi84gnoDNJELGBH8w0+WzWuo1bo37/X50Cj2bPOrvhkigPvQC EDynH7ON1F+PtbS3XmDEfZmqOwrzXYJCVhGDpB0KjPWuQd/IIzTnoIw4J0Zo1GVsEZyU TiRYxzeMx0k7yr/prYI6NCP3kRwPZOFFdSbNaA9OFVEKQMOofXYesekjaFf5QypyrHU7 M1+VD77sBrdpsrG/FzyQv4e2txiUyGnvrSqQxm1/Bo3i0QwOGQSBW84Np/Lb5HRRcWd4 COkqtViRAiRQUmk5VthZASBrps+SqGHlzbdWOSI8Bo9m0RMqt9QUzImGxu6qL6c5MueB cJlA== X-Gm-Message-State: AHPjjUgVBxDUHRh3A06jTpWWahyquiIGupWi1WFU8D1hgu5OPyy53+r9 Yb4ITuAFhX3dZX1rKExKuA== X-Google-Smtp-Source: ADKCNb6F7621rB8eAoZKsClcOtWl13/2AUhAvW1V1aSKadjC8ed4lXDBBmovcFZJtxUfaqmJIepk9w== X-Received: by 10.99.130.198 with SMTP id w189mr918235pgd.175.1504824065457; Thu, 07 Sep 2017 15:41:05 -0700 (PDT) Received: from bigtime.twiddle.net (97-126-108-236.tukw.qwest.net. [97.126.108.236]) by smtp.gmail.com with ESMTPSA id h19sm770678pfh.142.2017.09.07.15.41.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Sep 2017 15:41:04 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 7 Sep 2017 15:40:36 -0700 Message-Id: <20170907224051.21518-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170907224051.21518-1-richard.henderson@linaro.org> References: <20170907224051.21518-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::229 Subject: [Qemu-devel] [PULL 08/23] tcg/s390: Use constant pool for andi X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Signed-off-by: Richard Henderson --- tcg/s390/tcg-target.inc.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) -- 2.13.5 diff --git a/tcg/s390/tcg-target.inc.c b/tcg/s390/tcg-target.inc.c index 29b77ff67f..4be57c5765 100644 --- a/tcg/s390/tcg-target.inc.c +++ b/tcg/s390/tcg-target.inc.c @@ -224,6 +224,7 @@ typedef enum S390Opcode { RXY_LRVG = 0xe30f, RXY_LRVH = 0xe31f, RXY_LY = 0xe358, + RXY_NG = 0xe380, RXY_STCY = 0xe372, RXY_STG = 0xe324, RXY_STHY = 0xe370, @@ -985,8 +986,17 @@ static void tgen_andi(TCGContext *s, TCGType type, TCGReg dest, uint64_t val) return; } - /* Fall back to loading the constant. */ - tcg_out_movi(s, type, TCG_TMP0, val); + /* Use the constant pool if USE_REG_TB, but not for small constants. */ + if (USE_REG_TB) { + if (!maybe_out_small_movi(s, type, TCG_TMP0, val)) { + tcg_out_insn(s, RXY, NG, dest, TCG_REG_TB, TCG_REG_NONE, 0); + new_pool_label(s, val & valid, R_390_20, s->code_ptr - 2, + -(intptr_t)s->code_gen_ptr); + return; + } + } else { + tcg_out_movi(s, type, TCG_TMP0, val); + } if (type == TCG_TYPE_I32) { tcg_out_insn(s, RR, NR, dest, TCG_TMP0); } else { @@ -2341,6 +2351,8 @@ static const TCGTargetOpDef *tcg_target_op_def(TCGOpcode op) return &r_r_ri; case INDEX_op_sub_i32: case INDEX_op_sub_i64: + case INDEX_op_and_i32: + case INDEX_op_and_i64: return (s390_facilities & FACILITY_DISTINCT_OPS ? &r_r_ri : &r_0_ri); case INDEX_op_mul_i32: @@ -2375,10 +2387,6 @@ static const TCGTargetOpDef *tcg_target_op_def(TCGOpcode op) ? (s390_facilities & FACILITY_DISTINCT_OPS ? &r_r_rM : &r_0_rM) : &r_0_r); - case INDEX_op_and_i32: - case INDEX_op_and_i64: - return (s390_facilities & FACILITY_DISTINCT_OPS ? &r_r_ri : &r_0_ri); - case INDEX_op_shl_i32: case INDEX_op_shr_i32: case INDEX_op_sar_i32: