From patchwork Wed Sep 6 14:49: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: 111795 Delivered-To: patch@linaro.org Received: by 10.140.94.166 with SMTP id g35csp1007222qge; Wed, 6 Sep 2017 08:00:40 -0700 (PDT) X-Received: by 10.55.179.133 with SMTP id c127mr3807730qkf.24.1504710040436; Wed, 06 Sep 2017 08:00:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504710040; cv=none; d=google.com; s=arc-20160816; b=b//LWkOa3sfXXKN0ChB3XKFJ1dimiIK+FD9hUm54Xosp4BqoNUBvDfSKYFJKE0OtSH jBJNmQLEqJ4vqOLMfvnIfmUioqIfG41iM1tCf5CusRJ07myRPtGhnHbsKkj+AKw4LX+Z lDb3hunl0CsVMAhGafkHOeFA9CWDw9F977GA4uhuJ4CN0JlIFG3maMV10GCMQmRZUDrw lKZKkYyZePc7fQLTFx4pkD+CgdZ7TWt94+2zi5ERlVLZ3Kfl6TGrJ3948p0vLJRgqq/U CqZ0Ty8jk5qQy6/TDG7Sgtvfa2qnEZpZKOcBLBLjLyTc/hfbaA+C0SWZ1ZDyhk4kINP+ EH3g== 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=sDRqOgTcMnZU2Boh5HLQatvifS7VMtYpiEtzWIfOUGU=; b=Zlfi6k3Z5VviygskMExvWXdDyoYpzQC5/Gqm8ZArgJmK87PwmPkaxAUeaQhypdyGZQ WxkblADWq1hIpmj9FcCjMeZYAMN54fbtIDgWlM5GYoj0hVVMu4aJWg7Q2IJtofVgjBU9 radXyLYR2Q3kMbVopcphE/mlMnRM/qmviCvihuSthxydbXPK6+x02R5RGz4iO/rWcuJE 56tDyxaqNj3CxYungGBGVUtqSlsZUIrZL47A1and9O3zSmxLxYMFMQUJG7/pcocUSjqF OFZlyLXLShA3ze+5lIWE+vxtkjMDiO4504JgLQDdtYzwIoO0B7YqRLTNlpMXa4R3pNJS TCVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Sr5t0cU9; 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 c23si8902qke.469.2017.09.06.08.00.40 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 06 Sep 2017 08:00:40 -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=Sr5t0cU9; 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]:36566 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dpbok-000652-6e for patch@linaro.org; Wed, 06 Sep 2017 11:00:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40052) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dpbeT-0005Za-W2 for qemu-devel@nongnu.org; Wed, 06 Sep 2017 10:50:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dpbeP-0000N1-85 for qemu-devel@nongnu.org; Wed, 06 Sep 2017 10:50:02 -0400 Received: from mail-pg0-x22d.google.com ([2607:f8b0:400e:c05::22d]:38097) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dpbeP-0000Mk-2i for qemu-devel@nongnu.org; Wed, 06 Sep 2017 10:49:57 -0400 Received: by mail-pg0-x22d.google.com with SMTP id v66so15523204pgb.5 for ; Wed, 06 Sep 2017 07:49:56 -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=sDRqOgTcMnZU2Boh5HLQatvifS7VMtYpiEtzWIfOUGU=; b=Sr5t0cU9lBwD7y9IAzWjr4iGQSfq5gkXhelmUSPiY9rtSjKFTOFoQDvK92yyeLa8gY 37G3WMyCVI7qZEhCTZIwgtNCfu1RdEbYk3ccR4x1bkyQV1gcp+7wY50UjetY8i7FHVsp TulT6GgPbd8vqvsSR3xYhKPTLs0qd0KqxppXg= 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=sDRqOgTcMnZU2Boh5HLQatvifS7VMtYpiEtzWIfOUGU=; b=WE1LTYwrazH20eGqYHzkyNPau4CFTw9I4nYw4WEo9Gc0U8SY6h+5TS58NPVmML24Qv 6rPnL8G0C+qL3Rv7lDr3m0N27K87qLhV7AcpyiUe+a1Aitpva3XSgSNLXXgrJUQWSbLk iHcjrKtUvxkCVpT0nWlRuo1/Z0XTrABjbjDZ6oHqT8uEHOS7q80CwCDcuQVdlSNvZ4i8 tA1kALqC9tyoR3C3+3bx5ysS5hNMhTItJhOLvklzYe0PFHHEh8gR6YlgdudSABqdqrjU mNXb00wFtt4bTU5uZgb+ZeSqOnOXuqtH6CjjYwZ7TgZ3DCyshY9wVl4fmdw9aFv+XZuh SPlg== X-Gm-Message-State: AHPjjUhyBJWSWmJThnKvLRDuIj4bMh9NpGRyKUOQwhcjVYwjUUNxmrVn BB3grNISOvlYEG7OErEhWg== X-Google-Smtp-Source: ADKCNb7UdkWLIAQGhklYkrWUoB2kYo9ZwB7HVngNp7Gbd6z7OJVjsgtXLpLsyo+gpubOX6h5tF7GkQ== X-Received: by 10.98.137.203 with SMTP id n72mr7674931pfk.4.1504709395737; Wed, 06 Sep 2017 07:49:55 -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 h1sm3467646pfg.153.2017.09.06.07.49.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Sep 2017 07:49:54 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 6 Sep 2017 07:49:36 -0700 Message-Id: <20170906144940.30880-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170906144940.30880-1-richard.henderson@linaro.org> References: <20170906144940.30880-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:c05::22d Subject: [Qemu-devel] [PULL 10/14] tcg/s390: Merge add2i 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: peter.maydell@linaro.org, Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Acked-by: Cornelia Huck Signed-off-by: Richard Henderson --- tcg/s390/tcg-target.inc.c | 38 ++++++++++++++------------------------ 1 file changed, 14 insertions(+), 24 deletions(-) -- 2.13.5 diff --git a/tcg/s390/tcg-target.inc.c b/tcg/s390/tcg-target.inc.c index ff3f644f8e..6b08ccea6d 100644 --- a/tcg/s390/tcg-target.inc.c +++ b/tcg/s390/tcg-target.inc.c @@ -43,7 +43,7 @@ #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_S33 0x2000 #define TCG_CT_CONST_ZERO 0x4000 /* Several places within the instruction set 0 means "no register" @@ -387,7 +387,7 @@ static const char *target_parse_constraint(TCGArgConstraint *ct, tcg_regset_set_reg(ct->u.regs, TCG_REG_R3); break; case 'A': - ct->ct |= TCG_CT_CONST_ADLI; + ct->ct |= TCG_CT_CONST_S33; break; case 'I': ct->ct |= TCG_CT_CONST_S16; @@ -478,20 +478,6 @@ static int tcg_match_xori(TCGType type, tcg_target_long val) return 1; } -/* Immediates to be used with add2/sub2. */ - -static int tcg_match_add2i(TCGType type, tcg_target_long val) -{ - if (s390_facilities & FACILITY_EXT_IMM) { - if (type == TCG_TYPE_I32) { - return 1; - } else if (val >= -0xffffffffll && val <= 0xffffffffll) { - return 1; - } - } - return 0; -} - /* Test if a constant matches the constraint. */ static int tcg_target_const_match(tcg_target_long val, TCGType type, const TCGArgConstraint *arg_ct) @@ -511,8 +497,8 @@ static int tcg_target_const_match(tcg_target_long val, TCGType type, 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_S33) { + return val >= -0xffffffffll && val <= 0xffffffffll; } else if (ct & TCG_CT_CONST_ORI) { return tcg_match_ori(type, val); } else if (ct & TCG_CT_CONST_XORI) { @@ -2241,6 +2227,12 @@ static const TCGTargetOpDef *tcg_target_op_def(TCGOpcode op) 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" } }; + static const TCGTargetOpDef a2_r + = { .args_ct_str = { "r", "r", "0", "1", "r", "r" } }; + static const TCGTargetOpDef a2_ri + = { .args_ct_str = { "r", "r", "0", "1", "ri", "r" } }; + static const TCGTargetOpDef a2_rA + = { .args_ct_str = { "r", "r", "0", "1", "rA", "r" } }; switch (op) { case INDEX_op_goto_ptr: @@ -2389,15 +2381,13 @@ static const TCGTargetOpDef *tcg_target_op_def(TCGOpcode op) = { .args_ct_str = { "b", "a", "0", "r" } }; return &mul2; } + case INDEX_op_add2_i32: - case INDEX_op_add2_i64: case INDEX_op_sub2_i32: + return (s390_facilities & FACILITY_EXT_IMM ? &a2_ri : &a2_r); + case INDEX_op_add2_i64: case INDEX_op_sub2_i64: - { - static const TCGTargetOpDef arith2 - = { .args_ct_str = { "r", "r", "0", "1", "rA", "r" } }; - return &arith2; - } + return (s390_facilities & FACILITY_EXT_IMM ? &a2_rA : &a2_r); default: break;