From patchwork Sun Sep 17 15:05:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 112857 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp2748734qgf; Sun, 17 Sep 2017 08:15:34 -0700 (PDT) X-Received: by 10.200.33.186 with SMTP id 55mr36791991qty.300.1505661334102; Sun, 17 Sep 2017 08:15:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505661334; cv=none; d=google.com; s=arc-20160816; b=VdEI9C6NaWzHnS3eI1ZRP81Kwxq+6ZhetX/YmQEcqE1EgrE8JPkTjxy6tRAzjvpiE7 5aklk3Dg0wmvjls7HiQ6CoJwS2cU/EsAKRIVMReSdkcSY7uV5YEJYj6hEeKXkzQCvGw3 V7YmGAeCl4tBxHsGtzoaNDPpkh0V4q6g250s2I9CdhyEwiX1hIWkpz5wEDeNg7jT6oT6 aUSiMZlMzpj5CHii4fQx7p5OVqZxxD3/DIEhZWlL1tRqwisGjv9FBOkxOmHtiSMCagnE LGdbfeY/UcyxDJ0Lp/28+oeJfnFZxatc2wg6NcVRzrqjt+yChQIxY0ktDdJ7AfCT9uZ+ 6TNw== 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 :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=44CGflEyoqKCNj+sQLdDI3BoRRqpPcf6b3WMmfhqIio=; b=jqcBWJBSF/gnrE1xcSha1qPXGKLp64Elpoi+jOmqXpWNgHzo6V0hbTvZH2y5n6NGAB jKCzes24cceBg8vPiD1yyUiJFQNcj1uQr7OWUfMrdxGvxXWCrFX3xconZoEZ+k9ixQ+4 90GsJSHwWKJ5wfHF/YiFTNSTqQj76I3eOdZSdjArZDjqIPtkd4Ep0olTBugoIe7BIdcU BaZilX1aI+O2m3opzu2SJ/47dSLi5gYsOVjPkMIrED2jZ5oywjtdwafD028sdVwsabOS 0LdzyyeeWh1BKMhhVzfd+JAIxSwb3wJa4czd+jtuH8kNfdOzdB8hRzlYIE+O0l5Q8YrF DiZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ZKaGIHLo; 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 15si732281qtt.156.2017.09.17.08.15.33 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 17 Sep 2017 08:15:34 -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=ZKaGIHLo; 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]:60943 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dtbIB-0007QR-RN for patch@linaro.org; Sun, 17 Sep 2017 11:15:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52551) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dtb8z-00082B-AQ for qemu-devel@nongnu.org; Sun, 17 Sep 2017 11:06:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dtb8v-0008DI-UP for qemu-devel@nongnu.org; Sun, 17 Sep 2017 11:06:01 -0400 Received: from mail-oi0-x230.google.com ([2607:f8b0:4003:c06::230]:45116) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dtb8v-0008CY-Mw for qemu-devel@nongnu.org; Sun, 17 Sep 2017 11:05:57 -0400 Received: by mail-oi0-x230.google.com with SMTP id z73so3685527oia.2 for ; Sun, 17 Sep 2017 08:05:57 -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 :mime-version:content-transfer-encoding; bh=44CGflEyoqKCNj+sQLdDI3BoRRqpPcf6b3WMmfhqIio=; b=ZKaGIHLob0IsYylWyDBqLwG6hlu6NtTfniHVKp+JPVpfrxbvNX9u3xZpd4QeO78alE 5wU6PvpWZ+yhtrK4IFTBF5B24lS0B4WE9/kqu6ZLNhL2v2S9LBgqrH85QpeeFP+4vVhS 8B3VgIphB+qgqOxDhbzTRZlT4EClGknGUacp4= 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:mime-version:content-transfer-encoding; bh=44CGflEyoqKCNj+sQLdDI3BoRRqpPcf6b3WMmfhqIio=; b=Qa9brsItr9PImtsA2xi3iL7oHTPdnTdfFUG+KXlXr9qAb3FJrFK5vv89uVpvbHjyBr 1An6PWOW6641B33tOfn4sY1hVdUzE87Atj5kM96heR93IBWP0TYtqF3gYCmCaaB0HQkQ kxBd4ngY4Hl7EQdatTgXzjiXBF/+kZ5U/NdpFZuiEwjRFnA/geVnDqptmHtD3nwFFBcl j+tXaYYD6DS7ctxREbKTKcL6tRCQ0HZ0eCLLzqQMa9p+Wynz1hW6rmWF9J4QCnoro+L2 VXbR7gET+hfmUYmNiSEybOK2J332ysrWdzN1tWKIWPRt9GLAiaOBQZcNMNHXZ+15msKH Q7Qg== X-Gm-Message-State: AHPjjUiMT7tOcKGd0gi+PvpKFhYHv+MfkEUBb94JICYED7KUjZC9LfX1 D48/EJRqx8auBITNqxr3Zg== X-Google-Smtp-Source: AOwi7QAG7E4cy+S4eH7T1KbC3YmSAhGKtXqMaarz+qmY37WX3FcPrEONqQNOqwvjN3H+S/qSKa084A== X-Received: by 10.202.196.197 with SMTP id u188mr30680992oif.228.1505660756750; Sun, 17 Sep 2017 08:05:56 -0700 (PDT) Received: from bigtime.twiddle.net (162.189-204-159.bestel.com.mx. [189.204.159.162]) by smtp.gmail.com with ESMTPSA id j2sm5348789oia.20.2017.09.17.08.05.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 17 Sep 2017 08:05:56 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sun, 17 Sep 2017 08:05:27 -0700 Message-Id: <20170917150535.8284-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170917150535.8284-1-richard.henderson@linaro.org> References: <20170917150535.8284-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c06::230 Subject: [Qemu-devel] [PULL 09/17] tcg: Remove tcg_regset_set 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 Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/tcg.h | 1 - tcg/mips/tcg-target.inc.c | 47 ++++++++++++++++++++++++----------------------- tcg/tcg.c | 8 ++++---- 3 files changed, 28 insertions(+), 28 deletions(-) -- 2.13.5 diff --git a/tcg/tcg.h b/tcg/tcg.h index 6525e51c21..5bf67678d5 100644 --- a/tcg/tcg.h +++ b/tcg/tcg.h @@ -186,7 +186,6 @@ typedef enum TCGOpcode { NB_OPS, } TCGOpcode; -#define tcg_regset_set(d, s) (d) = (s) #define tcg_regset_set32(d, reg, val32) (d) |= (val32) << (reg) #define tcg_regset_set_reg(d, r) (d) |= 1L << (r) #define tcg_regset_reset_reg(d, r) (d) &= ~(1L << (r)) diff --git a/tcg/mips/tcg-target.inc.c b/tcg/mips/tcg-target.inc.c index 85c1abd14b..1c09ec7d5b 100644 --- a/tcg/mips/tcg-target.inc.c +++ b/tcg/mips/tcg-target.inc.c @@ -195,11 +195,11 @@ static const char *target_parse_constraint(TCGArgConstraint *ct, switch(*ct_str++) { case 'r': ct->ct |= TCG_CT_REG; - tcg_regset_set(ct->u.regs, 0xffffffff); + ct->u.regs = 0xffffffff; break; case 'L': /* qemu_ld input arg constraint */ ct->ct |= TCG_CT_REG; - tcg_regset_set(ct->u.regs, 0xffffffff); + ct->u.regs = 0xffffffff; tcg_regset_reset_reg(ct->u.regs, TCG_REG_A0); #if defined(CONFIG_SOFTMMU) if (TCG_TARGET_REG_BITS < TARGET_LONG_BITS) { @@ -209,7 +209,7 @@ static const char *target_parse_constraint(TCGArgConstraint *ct, break; case 'S': /* qemu_st constraint */ ct->ct |= TCG_CT_REG; - tcg_regset_set(ct->u.regs, 0xffffffff); + ct->u.regs = 0xffffffff; tcg_regset_reset_reg(ct->u.regs, TCG_REG_A0); #if defined(CONFIG_SOFTMMU) if (TCG_TARGET_REG_BITS < TARGET_LONG_BITS) { @@ -2607,27 +2607,28 @@ static void tcg_target_qemu_prologue(TCGContext *s) static void tcg_target_init(TCGContext *s) { tcg_target_detect_isa(); - tcg_regset_set(tcg_target_available_regs[TCG_TYPE_I32], 0xffffffff); + tcg_target_available_regs[TCG_TYPE_I32] = 0xffffffff; if (TCG_TARGET_REG_BITS == 64) { - tcg_regset_set(tcg_target_available_regs[TCG_TYPE_I64], 0xffffffff); - } - tcg_regset_set(tcg_target_call_clobber_regs, - (1 << TCG_REG_V0) | - (1 << TCG_REG_V1) | - (1 << TCG_REG_A0) | - (1 << TCG_REG_A1) | - (1 << TCG_REG_A2) | - (1 << TCG_REG_A3) | - (1 << TCG_REG_T0) | - (1 << TCG_REG_T1) | - (1 << TCG_REG_T2) | - (1 << TCG_REG_T3) | - (1 << TCG_REG_T4) | - (1 << TCG_REG_T5) | - (1 << TCG_REG_T6) | - (1 << TCG_REG_T7) | - (1 << TCG_REG_T8) | - (1 << TCG_REG_T9)); + tcg_target_available_regs[TCG_TYPE_I64] = 0xffffffff; + } + + tcg_target_call_clobber_regs = 0; + tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_V0); + tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_V1); + tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_A0); + tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_A1); + tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_A2); + tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_A3); + tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_T0); + tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_T1); + tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_T2); + tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_T3); + tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_T4); + tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_T5); + tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_T6); + tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_T7); + tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_T8); + tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_T9); s->reserved_regs = 0; tcg_regset_set_reg(s->reserved_regs, TCG_REG_ZERO); /* zero register */ diff --git a/tcg/tcg.c b/tcg/tcg.c index 9eeaba9529..a4badcc85f 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -2362,7 +2362,7 @@ static void tcg_reg_alloc_mov(TCGContext *s, const TCGOpDef *def, TCGTemp *ts, *ots; TCGType otype, itype; - tcg_regset_set(allocated_regs, s->reserved_regs); + allocated_regs = s->reserved_regs; ots = &s->temps[args[0]]; ts = &s->temps[args[1]]; @@ -2450,8 +2450,8 @@ static void tcg_reg_alloc_op(TCGContext *s, args + nb_oargs + nb_iargs, sizeof(TCGArg) * def->nb_cargs); - tcg_regset_set(i_allocated_regs, s->reserved_regs); - tcg_regset_set(o_allocated_regs, s->reserved_regs); + i_allocated_regs = s->reserved_regs; + o_allocated_regs = s->reserved_regs; /* satisfy input constraints */ for(k = 0; k < nb_iargs; k++) { @@ -2651,7 +2651,7 @@ static void tcg_reg_alloc_call(TCGContext *s, int nb_oargs, int nb_iargs, } /* assign input registers */ - tcg_regset_set(allocated_regs, s->reserved_regs); + allocated_regs = s->reserved_regs; for(i = 0; i < nb_regs; i++) { arg = args[nb_oargs + i]; if (arg != TCG_CALL_DUMMY_ARG) {