From patchwork Wed Sep 9 00:16:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 249407 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp5016339ilg; Tue, 8 Sep 2020 17:24:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxctSbQtZtbSDdWst7cZ5Z+6Gr0qjYg8kR6Le2pb8WpiLVXbeArUq8pCU+KoEhON8RwDDYc X-Received: by 2002:a25:9845:: with SMTP id k5mr1885302ybo.209.1599611080149; Tue, 08 Sep 2020 17:24:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599611080; cv=none; d=google.com; s=arc-20160816; b=H1YhEIabT2FDyEeOB1ic8cTovNZr/r/EuNhaJBdlQyPbHKNUasGr4YE6IgcJEWIt7M nzoahfhPp8KBnjrSKooMIO0nzYdod4uHgPKfvz1Q/zSl50jjMG5wPvqGRZP/kSbRkt7c EuPJd7RewHISUm2jkrlU0Z4Yvxy0itWc7o1wCUaH1J95ZOi1UgVkTy4r2fWPqZVmjlIC b9hkb6C1ul1SkCaFZ+CKMWyCrvUcHszumcn9b69AaPVbajH2iWKnJGa+zYDbVS85RfMc g2hnKMjUGgTdNgY0CDORRQZNoUbKcBeCPB6nnolFwWqUivQxia1PyjI88IC18z4fvW5a Z/WA== 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=I1xMuU+jyGIHLu2WXBZSq6/5WNnpUQHvmSzi+XMFuiVU3EjkNVSPn9dBGWtMDSBjd0 n/BxGl4TXfMABKPUnmGtziQJePbdjVLurFkntpcrG2K63fkAhfy/DHuk/24okkRC1240 9RblTQkAtor7k/w5iXsSFItnVAzfYhiKn61hBH6dizZFTkFSy8jwPriGjgqOkQ9+gty8 QTHHBI7PXBsIuWbnePyNIO96adc029Ov/zojdZMVx1wSdLRDgnxdfoku5ojM6vtZEZ8t xhCpSXNTuxWtEvjMgdvmSLTQlpplTEgAQ6Stw7lMY8fSitelfVWZhQkJM+/EA6CIQj4y rfiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xoKMSKGB; 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 q126si1272277ybc.245.2020.09.08.17.24.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 08 Sep 2020 17:24:40 -0700 (PDT) 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=xoKMSKGB; 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]:36846 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kFnuh-000776-II for patch@linaro.org; Tue, 08 Sep 2020 20:24:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37712) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kFnnh-0000Bg-GV for qemu-devel@nongnu.org; Tue, 08 Sep 2020 20:17:25 -0400 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]:36389) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kFnne-0002H5-Ed for qemu-devel@nongnu.org; Tue, 08 Sep 2020 20:17:25 -0400 Received: by mail-pg1-x544.google.com with SMTP id m8so742300pgi.3 for ; Tue, 08 Sep 2020 17:17:21 -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=HakP3QzMMgoP+5PWHWKQnZl86G7xrmBYKlGdyeWSyq0=; b=xoKMSKGBBrzkocv2yaAhmwCE0q6iGgV8X8NY+ks19Y4gWDeLEgo+uZa6Hh7UPuU56x 0xdxFFgvlR/vgAe6FRijyA/EmqCmy0VfZ3N937GlSjzsk1FvGK3ZCQFae6bUoqdWWpYM DeDH/OIJ7JCGUARvE9KP9mWADfCwtb+ugNyq5RyE83dwcnhp1R2naNOn3OD8pThk0CXq zD0u1RHqvawY50fVKEGam6o6pDd3la5uj8fUgAz8XxJokdOVQr0N1umBGvqP9xRx+xmO NQSpWyz+0+4IMPmcLIfw9iqjhsgCmDscXZI2x/pn36DWcgj5nICQ8V7mk/eY3Mj8vINA w4ag== 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=oblKJoE/efxoUIM2hpRHJaksffXRB0Zo+Ki2cu9z6iMDrKe6nC2e4TMvK7T2lo7XRX +uCBRNZCAvoKvrwO89LQYmagjGdsn+aPzBuFZef/lDCnA0r1OW5DtXVcCd+jvNmBNyQf cEvRzCvHw0LJPztxf5tOwO1RSDD1OIreGLtp/dbmeAnblBF+V18lBX75H6F/8aGfv9bs xs61NGfUC+qxfzjtJ+iJXJwb5uKqGuUoP9H/VRR49L3CZ5ITMnLbw7fcsByLuJTtmpQj NYk2r5hHDo5sEYqmEbtEsBSnaye7FKQOEwlGo0AXRJ0WbPn1Lxncydt+I/TVUI5NECwP Mc8g== X-Gm-Message-State: AOAM531D0khTq6TVOWWc6n1Kp2xhE3pNSoc/BUYoUrrqA3V9D6OtYMdi P6NbBvoiFYoasvO78ezVHuhruDyKV9W0tQ== X-Received: by 2002:a63:413:: with SMTP id 19mr983735pge.310.1599610640740; Tue, 08 Sep 2020 17:17:20 -0700 (PDT) Received: from localhost.localdomain ([71.212.141.89]) by smtp.gmail.com with ESMTPSA id 137sm505437pfu.149.2020.09.08.17.17.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2020 17:17:20 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 25/43] tcg: Use tcg_constant_{i32,i64} with tcg plugins Date: Tue, 8 Sep 2020 17:16:29 -0700 Message-Id: <20200909001647.532249-26-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200909001647.532249-1-richard.henderson@linaro.org> References: <20200909001647.532249-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::544; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x544.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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);