From patchwork Thu Jan 14 02:16:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 362797 Delivered-To: patch@linaro.org Received: by 2002:a02:ccad:0:0:0:0:0 with SMTP id t13csp67532jap; Wed, 13 Jan 2021 18:23:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJxUe5U5jj5F1f7J5GhRSmDbtLYaT4thFrWhOR/4mib6ElckMj/VaDo1CXyK+u8mSIk/uAJf X-Received: by 2002:a25:3d47:: with SMTP id k68mr7532449yba.415.1610590982159; Wed, 13 Jan 2021 18:23:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610590982; cv=none; d=google.com; s=arc-20160816; b=yV/Rixk+Df8RTwB0udYo4RJ1h+NZgbJkz0aN5LZnXXlH1U2Q4R6unuPDVRDuNYCHQk DRgBIwvoZ+THZuPL54VG/KPtLZ/g54141WRAbaRTEW3rtz5SJlcdjLuDKfI7fKThuEVY MeB88SdEXkNW80DuHNjibtOy2oKmOy6hcmzfBIam6xNOuefAtXlRa8Lt5hEqvZC0GqPN 492wKHRVpWGD8e3PnC7O8oc7ZgFmdzl74hrnEPAGq6pM0XEv3wbxMy6sGqaO0KvRXq/4 EqAzkcu1tyhog5s2/IwGnryRpfoudkg10vdveNoPE24FKNw7ihvGusNt0dxvJBclER7T YT2Q== 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=NcfXB1KpyPW81k5Drrc3MlgB+jERmBBdhEAK9IMymZ1PDppIDUaKXt81BTsI/05URw /3siIkPKP6+KVTWtMRalti+L92LUiJV2FqJKhw5F0m0JYd8yd6y/MD+KQ1LKeKHoNRVA t/zlyn2hOcsPGaDCMF3CiBn1VeTBiP7ykBCJ1duwoZMvPJdwSEdLuVeTbGhCdUCBsWha rJ1jAiWF5ATbFRKS9oO0mPEGvIMxLJbedPHDWSqHB639DoXgjrZeNS9bjMaV5QrDzB7u UIP6uiofC5P3jQ7/yv/b6BLLnAZ0IxBUqaUDnniTNKNvQZk/A+Sa+pk5i2fa/9i+8c4g ssoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KolioF77; 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 n1si2264208ybj.138.2021.01.13.18.23.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 13 Jan 2021 18:23:02 -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=KolioF77; 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]:50412 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kzsHt-0001vm-Jz for patch@linaro.org; Wed, 13 Jan 2021 21:23:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60410) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kzsCd-0003hV-Nk for qemu-devel@nongnu.org; Wed, 13 Jan 2021 21:17:35 -0500 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]:36862) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kzsCT-0003Uj-HR for qemu-devel@nongnu.org; Wed, 13 Jan 2021 21:17:35 -0500 Received: by mail-pf1-x434.google.com with SMTP id b3so2468729pft.3 for ; Wed, 13 Jan 2021 18:17:24 -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=KolioF7780csIbpfhsCxUusJR/cGC2brujTGh0VUrBCPvA7rmhIBEjPKbxQXm+/Le6 8ZzlowHMpbaLL2EV1gag5f0CGwxAc94lMb8v+QGDKbYo5aCs6FkPOUX3Ec8jlELHcdt8 NHdHTVW3Ih9o0wLQiJmwz0lcZswgnguJrJh8sDj8V75R0eHfAUOen1EtJ4jVOVu8CEJn IIbuYel4a7lRs6LHqzTNkqjgByCxEUw0saHK7koUnMi+XK63GHXPwtPOQroKS3M9mxnP pa5eJRdnWs7uWSj3B//lXe7QS5TovHgLTt58Vu47d/ANLsod6XzPX6lBwSaESP2zujvX MoAQ== 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=Y2gXSbNeCzrgVIfzC1CwUPCovHnsrHIKc+XFLDM95k1G1z6MFbeWPq3r+G2NCXkdsg 0ORyRoPVoENqFCCLe+jnLC5ov4i3SMnSoz4NBdA6xKHr0r0Nbz9IhFPDpb1sGyDVO9L1 rpr0kZaDlambvxEEPEV1vSo1ffxIsLk4BR4coIUjHE2vngRbK5rbxdqN40BW+4p4AEY+ jqQQH69rHPCT9kQoD3KM6espv6np8/ovoNZXA3OsNOj/BxhcJZJ3o+xyBXsmjmbf0uTp rfMpHO/D0t4WjZjfDkDxWeKt9L0Du9zHICRcmjmDzhImGBp7Wqdiv9Xy6alPIU0DymWz fOGg== X-Gm-Message-State: AOAM533cRqvAuSCBMVbaSof6DieTfezIzAGfeLVwJIsJGTxy84o8e8j6 9XAcFaDYCRNfiRO+0XJ4TBvQSmDZv2qmiQ== X-Received: by 2002:a63:5309:: with SMTP id h9mr5049051pgb.19.1610590643511; Wed, 13 Jan 2021 18:17:23 -0800 (PST) Received: from localhost.localdomain (rrcs-173-197-107-21.west.biz.rr.com. [173.197.107.21]) by smtp.gmail.com with ESMTPSA id i7sm3771687pfc.50.2021.01.13.18.17.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Jan 2021 18:17:22 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 15/24] tcg: Use tcg_constant_{i32,i64} with tcg plugins Date: Wed, 13 Jan 2021 16:16:45 -1000 Message-Id: <20210114021654.647242-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210114021654.647242-1-richard.henderson@linaro.org> References: <20210114021654.647242-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::434; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x434.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: peter.maydell@linaro.org, =?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);