From patchwork Tue Aug 29 20:47:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 111255 Delivered-To: patch@linaro.org Received: by 10.140.95.112 with SMTP id h103csp1929271qge; Tue, 29 Aug 2017 13:52:50 -0700 (PDT) X-Received: by 10.55.204.137 with SMTP id n9mr7388495qkl.125.1504039970134; Tue, 29 Aug 2017 13:52:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504039970; cv=none; d=google.com; s=arc-20160816; b=zcztZ8Xp/03TE2U543E3ARlv117BM7SbttJ3bJjl2TsrjzLb+f2bUEAuaCkPG7e4p0 lUM8kvUH614J0n/KOKBIW2+T57iahZqFDAicBG4hHLQv/JvS0m6nRmOa3t/9iWoa1XZs Im/eQLK1aunzkBMU3MB61EOSK1EDsVPLEzBQNUdCxgEy8YHiR+d0cA6SRXvRO/y+nEfQ 084DOSIGkYAIDPx5yWiiKzsXBti20e8nbZuxhradc19UAbY+sWZk75/ld5yTdy6foMj/ b05+fCUr3c6qKUKcM06ODsbXw8YaX1Jg3GRqXH4TXmxHWAY3qIsp7a+ydQQtyPNdSVq7 kapA== 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=0RJY26L+wluBLiCwy06P1bcCFRjSUiVl+17C88pqpyA=; b=jyeOwNvcjl9ismnnooYBalezz7b2lbGKl2NUFTx9x3Lr7R/4ldDMDuhwJXmrhmOSI/ 4bVUcz8CzeFEdTalxny2VaxEyY20TN/9UmCUHvWmNhZL0A3Qqum7+YzLBXERBonIhLXB 4EoMm6+qGNE66FG3D1Xx1IPLKNYt/G2ArbYln7x7I2EGUJ9gJYkFPiC/95+QvhjgwDpk umOuwVu8sCc0cMucQjKjFIs1m/2kop2WQfdzHXk/CvAv2kr47f1o1RoInb80yBHrJIeU mh/WNV7US0rSCUJ/yyRL/jvM1DyWMAncQ1OsMK58FkMSA53whQkEDzgD6VZY8thxCH+7 SDZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=a/x906Qp; 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 j12si3582648qtj.536.2017.08.29.13.52.49 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 29 Aug 2017 13:52:50 -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=a/x906Qp; 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]:46909 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmnV9-0005x2-Pk for patch@linaro.org; Tue, 29 Aug 2017 16:52:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49478) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmnQf-0002Qq-K8 for qemu-devel@nongnu.org; Tue, 29 Aug 2017 16:48:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dmnQe-0001UN-NQ for qemu-devel@nongnu.org; Tue, 29 Aug 2017 16:48:09 -0400 Received: from mail-pf0-x231.google.com ([2607:f8b0:400e:c00::231]:36810) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dmnQe-0001U3-HS for qemu-devel@nongnu.org; Tue, 29 Aug 2017 16:48:08 -0400 Received: by mail-pf0-x231.google.com with SMTP id z87so13387420pfi.3 for ; Tue, 29 Aug 2017 13:48:08 -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=0RJY26L+wluBLiCwy06P1bcCFRjSUiVl+17C88pqpyA=; b=a/x906QphU6HJBjjrSVfTSlMgTMyWNm9VBxZptmPwjJe/51dtMdkjD8xhkGAsGkME6 JLGpM5EhR5nHIrMJbCfXnecq73WPLskqYCb6Yn0xWcE32gECqJRwmA9Wu3SCNTI/FBTj FYShmTgrNwffSx9Dr+WW3OJ57FKPNjdf/zdPw= 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=0RJY26L+wluBLiCwy06P1bcCFRjSUiVl+17C88pqpyA=; b=EEV9i6bsVdZPrP9jeHVPHbFCi82ERdyDqkLWehs4ku0NPvDmMG2NfuR97xRaN/5FaM JpktTW7o3P3f7kZuAKMorGrbTZVGgApJ/wra2NJIGmPj87KgrO41MFvwERqxlzM4lRwm AEhNy5Fo1X6lE/dwlw8mia5jHcwFH8MkUEnu+JHtYoc3UVOuJf5MXy5Gu71CjxbG7ygq 48dL/D+nv16/13aqQBpuGKAiG74vsmP9JRP410nZrpoMXjs0uuLxPZFLTevPi7R9IX14 AvjrdiVyxoEvc6M5NmZwOKubkHenlg4smnm4fCB2jmWV/Jgcwg3N0BHovHqrrWAHhj9o zzCg== X-Gm-Message-State: AHYfb5gdc8yLt7LTtpLDLKu5t7Xr0A0aavDszr2uVL1tTB7BG2IoWx09 gA9zlNRQpCsrVt9VK+tioQ== X-Received: by 10.98.59.194 with SMTP id w63mr1665905pfj.44.1504039687194; Tue, 29 Aug 2017 13:48:07 -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 i84sm6633646pfj.139.2017.08.29.13.48.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 Aug 2017 13:48:06 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 29 Aug 2017 13:47:54 -0700 Message-Id: <20170829204759.6853-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170829204759.6853-1-richard.henderson@linaro.org> References: <20170829204759.6853-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::231 Subject: [Qemu-devel] [PATCH 3/8] tcg/s390: Merge muli facilities check to tcg_target_op_def 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: borntraeger@de.ibm.com, cohuck@redhat.com, agraf@suse.de, 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 | 45 +++++++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 20 deletions(-) -- 2.13.5 diff --git a/tcg/s390/tcg-target.inc.c b/tcg/s390/tcg-target.inc.c index e075b4844a..ff3f644f8e 100644 --- a/tcg/s390/tcg-target.inc.c +++ b/tcg/s390/tcg-target.inc.c @@ -38,12 +38,13 @@ a 32-bit displacement here Just In Case. */ #define USE_LONG_BRANCHES 0 -#define TCG_CT_CONST_MULI 0x100 -#define TCG_CT_CONST_ORI 0x200 -#define TCG_CT_CONST_XORI 0x400 -#define TCG_CT_CONST_U31 0x800 -#define TCG_CT_CONST_ADLI 0x1000 -#define TCG_CT_CONST_ZERO 0x2000 +#define TCG_CT_CONST_S16 0x100 +#define TCG_CT_CONST_S32 0x200 +#define TCG_CT_CONST_ORI 0x400 +#define TCG_CT_CONST_XORI 0x800 +#define TCG_CT_CONST_U31 0x1000 +#define TCG_CT_CONST_ADLI 0x2000 +#define TCG_CT_CONST_ZERO 0x4000 /* Several places within the instruction set 0 means "no register" rather than TCG_REG_R0. */ @@ -388,8 +389,11 @@ static const char *target_parse_constraint(TCGArgConstraint *ct, case 'A': ct->ct |= TCG_CT_CONST_ADLI; break; - case 'K': - ct->ct |= TCG_CT_CONST_MULI; + case 'I': + ct->ct |= TCG_CT_CONST_S16; + break; + case 'J': + ct->ct |= TCG_CT_CONST_S32; break; case 'O': ct->ct |= TCG_CT_CONST_ORI; @@ -503,16 +507,10 @@ static int tcg_target_const_match(tcg_target_long val, TCGType type, } /* The following are mutually exclusive. */ - if (ct & TCG_CT_CONST_MULI) { - /* Immediates that may be used with multiply. If we have the - general-instruction-extensions, then we have MULTIPLY SINGLE - IMMEDIATE with a signed 32-bit, otherwise we have only - MULTIPLY HALFWORD IMMEDIATE, with a signed 16-bit. */ - if (s390_facilities & FACILITY_GEN_INST_EXT) { - return val == (int32_t)val; - } else { - return val == (int16_t)val; - } + if (ct & TCG_CT_CONST_S16) { + return val == (int16_t)val; + } else if (ct & TCG_CT_CONST_S32) { + return val == (int32_t)val; } else if (ct & TCG_CT_CONST_ADLI) { return tcg_match_add2i(type, val); } else if (ct & TCG_CT_CONST_ORI) { @@ -2239,7 +2237,8 @@ static const TCGTargetOpDef *tcg_target_op_def(TCGOpcode op) static const TCGTargetOpDef r_rZ = { .args_ct_str = { "r", "rZ" } }; static const TCGTargetOpDef r_r_ri = { .args_ct_str = { "r", "r", "ri" } }; static const TCGTargetOpDef r_0_ri = { .args_ct_str = { "r", "0", "ri" } }; - static const TCGTargetOpDef r_0_rK = { .args_ct_str = { "r", "0", "rK" } }; + static const TCGTargetOpDef r_0_rI = { .args_ct_str = { "r", "0", "rI" } }; + static const TCGTargetOpDef r_0_rJ = { .args_ct_str = { "r", "0", "rJ" } }; static const TCGTargetOpDef r_0_rO = { .args_ct_str = { "r", "0", "rO" } }; static const TCGTargetOpDef r_0_rX = { .args_ct_str = { "r", "0", "rX" } }; @@ -2274,9 +2273,15 @@ static const TCGTargetOpDef *tcg_target_op_def(TCGOpcode op) case INDEX_op_sub_i32: case INDEX_op_sub_i64: return &r_0_ri; + case INDEX_op_mul_i32: + /* If we have the general-instruction-extensions, then we have + MULTIPLY SINGLE IMMEDIATE with a signed 32-bit, otherwise we + have only MULTIPLY HALFWORD IMMEDIATE, with a signed 16-bit. */ + return (s390_facilities & FACILITY_GEN_INST_EXT ? &r_0_ri : &r_0_rI); case INDEX_op_mul_i64: - return &r_0_rK; + return (s390_facilities & FACILITY_GEN_INST_EXT ? &r_0_rJ : &r_0_rI); + case INDEX_op_or_i32: case INDEX_op_or_i64: return &r_0_rO;