From patchwork Thu Dec 17 14:52:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 344957 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp1271812jai; Thu, 17 Dec 2020 07:30:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJwd01OMkQlQ9pdobHPEj/If56j21dVeqJsr7O7jPmVBm0XRtrHtkXf/GzotXKQmPPmOEdgG X-Received: by 2002:a25:4b42:: with SMTP id y63mr53722372yba.10.1608219017396; Thu, 17 Dec 2020 07:30:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608219017; cv=none; d=google.com; s=arc-20160816; b=ltb51zGJEYVuk4+UfBsQuxblgBCVuNr4CO1ZuL+wfp05AV7bNtibHhrWZDHtUbffP+ V7U5Wek2dWDBlDjFfgsiN+kmWc1jUiQRD/uV8QY0n+dF5v9uOPQRy1QjLQTDUjWfYTkW 0uzgHLV4bmAuRIWaRwNI24SQ7ej/xA8HgEnQLsjNdZCMvekkPEDPiWh8bfGZWCuHCzdi n5DECR3PSHZPPrU545yD6kYgsE7TgUrHdY8qlY7z0GjqSa/f8Tx6QUspSOTlVsjCYlXg nAv64WJYYZt+hyiA8RpeSfLA2nquqZyuf7agr2CwVZm0V1O3LL4Zck2VcBDdl666Loqt nllw== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=HakP3QzMMgoP+5PWHWKQnZl86G7xrmBYKlGdyeWSyq0=; b=GMmaZNjebdFTWJBuX8D1O1g6gUmPIwzeIr8qW9g3RcQcOaXS7y0ClJS01/IB1H/JX/ kcCBGSCOde3HR6UmC3CYlc+XmJZbt91wR+4cyBnXSbGOLbCm5guTx7dBZ+8rU3Z8ry0d hi7CLrwyZzjo/GAMwJtkJFJtuQ6TjMPf2VRhjZeqrQ9uy1NBEwh1lOH4dy3yqYx4IKKj 3KdLypgl0t0J1AiBrEbKumvey2xj8CezaLNt4UJAK6t9r7JV4nO+pBKNVGk93Nj/teWg CJujmcqJFQrsIRonoOealIj++pwpp5zWZ6LGYvp4bUwfawI7ta0avkf4JXMagJhl7xrT S50Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IMZyzKq3; 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 a91si5535624ybi.318.2020.12.17.07.30.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 17 Dec 2020 07:30:17 -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=IMZyzKq3; 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]:40112 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kpvEO-0003dD-Rv for patch@linaro.org; Thu, 17 Dec 2020 10:30:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33334) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kpue4-0003Y4-5m for qemu-devel@nongnu.org; Thu, 17 Dec 2020 09:52:44 -0500 Received: from mail-ot1-x330.google.com ([2607:f8b0:4864:20::330]:39848) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kpudv-0004xE-O3 for qemu-devel@nongnu.org; Thu, 17 Dec 2020 09:52:42 -0500 Received: by mail-ot1-x330.google.com with SMTP id d8so27520803otq.6 for ; Thu, 17 Dec 2020 06:52:35 -0800 (PST) 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=HakP3QzMMgoP+5PWHWKQnZl86G7xrmBYKlGdyeWSyq0=; b=IMZyzKq3d8o3AyeSInAdPCruq1KpvShtpxG6Hbgo9XrqUBR0iy+ffTs51I9D7Kr8Tk Dtj11wFNmx/5FxPe/K1+S6RXpPImVcSNCqeinbPShOi2UJ5g2p6m6SYLMTzfCyCeGc5a FQP2jCXF2SIYuvtjYEVE7wHHfTKhLKSJpDXCdM5ZLXekyf3B2ea1Ql4uU1IWdcsGfv01 kYI9AyVxWLRdHoSESZdUP/2D6n3k6feQ9WOonEolEA7I38KlIWuA/GUpEuMGJuqa4Nul gWxPu6GimkJg7TqyQ9ASSB4EXBIMC23131lbPS4s6tcUPNyEQWjt5HnMtBrpSUtTh/Rx ycVg== 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=HakP3QzMMgoP+5PWHWKQnZl86G7xrmBYKlGdyeWSyq0=; b=IwxxBeTgLBh9UmO6buywBxB24YcscakvgDesJGtNmpIZxKrHEGfCNzKbJqKGivVRW2 rq/pTIh5Uj62fLpXJA/cSIUCnANgQ3nfZz/YtKhNSt3sfrpROSMNqUgWIhKlmp2T1GB8 Uu9VM5zXF8ZFu25BqmFd7BWkghqbP6yq3HwUpDP5s9k3G11M2+6zWyUPkTexc864aTtK +7ZdDvL412iLNXETDRqDswmF/r7BAMj5bA6MjdEZhT8PaA3kEJzuvE+tM3XbpvjtbHEj mw+EHXfjVctuVSNWlQ8Kp4o7H+F9WkfYiu/xVVyNMc7memGFxe50Ir5vaGCclApdnRG9 ljpw== X-Gm-Message-State: AOAM532yC95SNXigiDAH2ejKAXx4pcQF1R7g2fw0WgR1nb0MPiKKQICp XM1Wq5J+FvGDyiyJY+DGQrAAzdeMObCTACQj X-Received: by 2002:a05:6830:110b:: with SMTP id w11mr26695273otq.285.1608216754152; Thu, 17 Dec 2020 06:52:34 -0800 (PST) Received: from localhost.localdomain (fixed-187-189-51-144.totalplay.net. [187.189.51.144]) by smtp.gmail.com with ESMTPSA id x130sm1136342oif.3.2020.12.17.06.52.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Dec 2020 06:52:33 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v5 15/23] tcg: Use tcg_constant_{i32,i64} with tcg plugins Date: Thu, 17 Dec 2020 08:52:07 -0600 Message-Id: <20201217145215.534637-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201217145215.534637-1-richard.henderson@linaro.org> References: <20201217145215.534637-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::330; envelope-from=richard.henderson@linaro.org; helo=mail-ot1-x330.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: , Cc: =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- accel/tcg/plugin-gen.c | 49 +++++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 27 deletions(-) -- 2.25.1 diff --git a/accel/tcg/plugin-gen.c b/accel/tcg/plugin-gen.c index 51580d51a0..e5dc9d0ca9 100644 --- a/accel/tcg/plugin-gen.c +++ b/accel/tcg/plugin-gen.c @@ -284,8 +284,8 @@ static TCGOp *copy_extu_i32_i64(TCGOp **begin_op, TCGOp *op) if (TCG_TARGET_REG_BITS == 32) { /* mov_i32 */ op = copy_op(begin_op, op, INDEX_op_mov_i32); - /* movi_i32 */ - op = copy_op(begin_op, op, INDEX_op_movi_i32); + /* mov_i32 w/ $0 */ + op = copy_op(begin_op, op, INDEX_op_mov_i32); } else { /* extu_i32_i64 */ op = copy_op(begin_op, op, INDEX_op_extu_i32_i64); @@ -306,39 +306,34 @@ static TCGOp *copy_mov_i64(TCGOp **begin_op, TCGOp *op) return op; } -static TCGOp *copy_movi_i64(TCGOp **begin_op, TCGOp *op, uint64_t v) -{ - if (TCG_TARGET_REG_BITS == 32) { - /* 2x movi_i32 */ - op = copy_op(begin_op, op, INDEX_op_movi_i32); - op->args[1] = v; - - op = copy_op(begin_op, op, INDEX_op_movi_i32); - op->args[1] = v >> 32; - } else { - /* movi_i64 */ - op = copy_op(begin_op, op, INDEX_op_movi_i64); - op->args[1] = v; - } - return op; -} - static TCGOp *copy_const_ptr(TCGOp **begin_op, TCGOp *op, void *ptr) { if (UINTPTR_MAX == UINT32_MAX) { - /* movi_i32 */ - op = copy_op(begin_op, op, INDEX_op_movi_i32); - op->args[1] = (uintptr_t)ptr; + /* mov_i32 */ + op = copy_op(begin_op, op, INDEX_op_mov_i32); + op->args[1] = tcgv_i32_arg(tcg_constant_i32((uintptr_t)ptr)); } else { - /* movi_i64 */ - op = copy_movi_i64(begin_op, op, (uint64_t)(uintptr_t)ptr); + /* mov_i64 */ + op = copy_op(begin_op, op, INDEX_op_mov_i64); + op->args[1] = tcgv_i64_arg(tcg_constant_i64((uintptr_t)ptr)); } return op; } static TCGOp *copy_const_i64(TCGOp **begin_op, TCGOp *op, uint64_t v) { - return copy_movi_i64(begin_op, op, v); + if (TCG_TARGET_REG_BITS == 32) { + /* 2x mov_i32 */ + op = copy_op(begin_op, op, INDEX_op_mov_i32); + op->args[1] = tcgv_i32_arg(tcg_constant_i32(v)); + op = copy_op(begin_op, op, INDEX_op_mov_i32); + op->args[1] = tcgv_i32_arg(tcg_constant_i32(v >> 32)); + } else { + /* mov_i64 */ + op = copy_op(begin_op, op, INDEX_op_mov_i64); + op->args[1] = tcgv_i64_arg(tcg_constant_i64(v)); + } + return op; } static TCGOp *copy_extu_tl_i64(TCGOp **begin_op, TCGOp *op) @@ -486,8 +481,8 @@ static TCGOp *append_mem_cb(const struct qemu_plugin_dyn_cb *cb, tcg_debug_assert(type == PLUGIN_GEN_CB_MEM); - /* const_i32 == movi_i32 ("info", so it remains as is) */ - op = copy_op(&begin_op, op, INDEX_op_movi_i32); + /* const_i32 == mov_i32 ("info", so it remains as is) */ + op = copy_op(&begin_op, op, INDEX_op_mov_i32); /* const_ptr */ op = copy_const_ptr(&begin_op, op, cb->userp);