From patchwork Wed Dec 23 06:01:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 346967 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp5941597jai; Tue, 22 Dec 2020 22:06:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJxGh8qR7KAVigNuUBui/NJsUwVb45OrgHnxUqfmHDcIVdKg6XOJJzwRfSUGNdL5pKlkbnm0 X-Received: by 2002:a25:1e43:: with SMTP id e64mr34452579ybe.273.1608703572588; Tue, 22 Dec 2020 22:06:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608703572; cv=none; d=google.com; s=arc-20160816; b=RIwMdsTlSIgQHV6NBoVq85233UhYQzqDURphn7G+H1r0MkZtbyi+5xATjl/sOwH6qt HhVxM0y1kFbq0NbMqWtbMOyFWfpLY+akymVZm8d12nt1nKW4UoOzU3PdB/Hg3LagmdHh NVke4DqcMKL8r8woKLIs2FtyD2KvaxeGH1oRRNlLR3pTEsQ7rxjdK8T0PskTxoK1ksmQ cdxwU7GTNmly8oEF13CzAZn/a48AVB7IsxfWQ/1a+41AMVpZE2clWT5yKusv1+4EtSqq /PWkboD5cV0WBi9n9k2eAp38slp9f8xpRNHRbKGywK6yquANJ+bxQtX5f9nzySyTUm04 mwcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=7XC/DQ4TKJStS0mIx8J53BbElxWGv8f6A8Dnpnd7zCA=; b=JU4DbzrE2BsrXCqZqfHtaahFbHrcZWtHK1SEzvS9ekruoIufy1W5Yv7pcPovETZTDB FI1zXAbLh4YGmeCj9dgPJSc92HChaLRq0+j5MeT3Khm5t/sEEkvjQq7cJd2hw0pB1QEn zsX23c/nUZquRwAmVkNyl/+sFczcc6E8ApCqAIIsPwXAIDDXYyR1DLirFuFsiFGyDH90 9cjhEmqOZqXBGRdy21ysVtCIWqodaubQejaTAQorBmLmYsV48849TmDYZTFl+qxWvdnj TnvtOd04lfZAJdbhbvhW6EyypVouAYluWVjJYpbIMa2PMrRCv1UTh/zN8hSK3AQpKNfd Y2Cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hQiMlJZX; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id g14si20364376ybc.414.2020.12.22.22.06.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Dec 2020 22:06:12 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hQiMlJZX; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:58754 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1krxHo-0003bf-2H for patch@linaro.org; Wed, 23 Dec 2020 01:06:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39418) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1krxEG-0008RY-0S for qemu-devel@nongnu.org; Wed, 23 Dec 2020 01:02:34 -0500 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]:39002) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1krxE5-0000Np-En for qemu-devel@nongnu.org; Wed, 23 Dec 2020 01:02:29 -0500 Received: by mail-pl1-x62c.google.com with SMTP id x18so8605180pln.6 for ; Tue, 22 Dec 2020 22:02:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=7XC/DQ4TKJStS0mIx8J53BbElxWGv8f6A8Dnpnd7zCA=; b=hQiMlJZXhFSdWAIjHfUfg9GWRAX9klPZxJtqc774iHFxgtoL33f3YklwqgxOC45S6A UTtLMZcZ07ym9yaDmKCn5nWBUJjzqXpOGC8aEaHp+xdi6TwQQFVS8quDLVeKB7u/1HM0 4wMNUiUNg5kOz1DCM+NAjsHudsJ3BqPbnakXzEtXMY2bBbwu1SiLtm73DTbBEiQrOPo/ M6m1xjAAJEmek8vWKSjgKFy/fiVLjefYozcdO8VDFpB3A9i87senhHUP9az7JGLUdDXD 2g9fdDLOhpfzdrz5CZ0u9i6z/+t3WGzRIG+ekw8wTtc9aKZRxm67+6EiVGk9mM3W39Bs BJ3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7XC/DQ4TKJStS0mIx8J53BbElxWGv8f6A8Dnpnd7zCA=; b=kBc3N+MjnWoQ2nF75Z1nUijz1GPiriJqpKaQ9u/ASuS7OoQeOzXeoaa/an/6QpWmHY icw8u7CX4NPW5VFcJuSgxoBftcgI85jwY4rOInlR4f77L4JqxfKZWz3gUro7w1eeG8ZD 8uYYD0vjlR5vKZuZnoq7LXCGdl8wPmjluYD6mT99Fu4lipqzrRFDjwHMAWXTiLS9T1kb fC9rgp7pC5yhKu4p8p4rpmXaYPfHfppI21EqaJJqFCremzpkgbfQqF5eA3POkELuGmNk qtv6DtjGDpRRAxaNILAhXMtue33gzLkZVSt5DkN5JntEMIjZ9eIn6RyREW6c49jPaU88 EQPg== X-Gm-Message-State: AOAM530ZV9ARHTNbje+ALG+lwtUc6a6U0VGxljCftnXBjuyp/vuLRrPg zyGB7GyLefehm9AhL728mPHQm+gpDL997Q== X-Received: by 2002:a17:90a:1bc7:: with SMTP id r7mr25893779pjr.33.1608703339458; Tue, 22 Dec 2020 22:02:19 -0800 (PST) Received: from localhost.localdomain (174-21-139-177.tukw.qwest.net. [174.21.139.177]) by smtp.gmail.com with ESMTPSA id s1sm21943620pfb.103.2020.12.22.22.02.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Dec 2020 22:02:18 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 11/22] tcg/sparc: Convert to tcg-target-constr.h Date: Tue, 22 Dec 2020 22:01:53 -0800 Message-Id: <20201223060204.576856-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201223060204.576856-1-richard.henderson@linaro.org> References: <20201223060204.576856-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62c; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- tcg/sparc/tcg-target-constr.h | 16 ++++++++++++++ tcg/sparc/tcg-target.h | 1 + tcg/sparc/tcg-target.c.inc | 39 ----------------------------------- 3 files changed, 17 insertions(+), 39 deletions(-) create mode 100644 tcg/sparc/tcg-target-constr.h -- 2.25.1 diff --git a/tcg/sparc/tcg-target-constr.h b/tcg/sparc/tcg-target-constr.h new file mode 100644 index 0000000000..379eb83ca4 --- /dev/null +++ b/tcg/sparc/tcg-target-constr.h @@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: MIT */ +/* + * Sparc target-specific operand constaints. + * Copyright (c) 2020 Linaro + */ + +#define RESERVE_QLDST (7u << TCG_REG_O0) /* O0, O1, O2 */ + +REGS('r', 0xffffffff) +REGS('R', ALL_64) +REGS('s', 0xffffffff & ~RESERVE_QLDST) +REGS('S', ALL_64 & ~RESERVE_QLDST) + +CONST('I', TCG_CT_CONST_S11) +CONST('J', TCG_CT_CONST_S13) +CONST('Z', TCG_CT_CONST_ZERO) diff --git a/tcg/sparc/tcg-target.h b/tcg/sparc/tcg-target.h index 633841ebf2..bfee6191b3 100644 --- a/tcg/sparc/tcg-target.h +++ b/tcg/sparc/tcg-target.h @@ -179,5 +179,6 @@ static inline void flush_icache_range(uintptr_t start, uintptr_t stop) void tb_target_set_jmp_target(uintptr_t, uintptr_t, uintptr_t); #define TCG_TARGET_NEED_POOL_LABELS +#define TCG_TARGET_CONSTR_H #endif diff --git a/tcg/sparc/tcg-target.c.inc b/tcg/sparc/tcg-target.c.inc index 6775bd30fc..c92742aaec 100644 --- a/tcg/sparc/tcg-target.c.inc +++ b/tcg/sparc/tcg-target.c.inc @@ -319,45 +319,6 @@ static bool patch_reloc(tcg_insn_unit *code_ptr, int type, return true; } -/* parse target specific constraints */ -static const char *target_parse_constraint(TCGArgConstraint *ct, - const char *ct_str, TCGType type) -{ - switch (*ct_str++) { - case 'r': - ct->regs = 0xffffffff; - break; - case 'R': - ct->regs = ALL_64; - break; - case 'A': /* qemu_ld/st address constraint */ - ct->regs = TARGET_LONG_BITS == 64 ? ALL_64 : 0xffffffff; - reserve_helpers: - tcg_regset_reset_reg(ct->regs, TCG_REG_O0); - tcg_regset_reset_reg(ct->regs, TCG_REG_O1); - tcg_regset_reset_reg(ct->regs, TCG_REG_O2); - break; - case 's': /* qemu_st data 32-bit constraint */ - ct->regs = 0xffffffff; - goto reserve_helpers; - case 'S': /* qemu_st data 64-bit constraint */ - ct->regs = ALL_64; - goto reserve_helpers; - case 'I': - ct->ct |= TCG_CT_CONST_S11; - break; - case 'J': - ct->ct |= TCG_CT_CONST_S13; - break; - case 'Z': - ct->ct |= TCG_CT_CONST_ZERO; - break; - default: - return NULL; - } - return ct_str; -} - /* test if a constant matches the constraint */ static inline int tcg_target_const_match(tcg_target_long val, TCGType type, const TCGArgConstraint *arg_ct)