From patchwork Thu Feb 4 01:43:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376145 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp833348jah; Wed, 3 Feb 2021 17:52:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJy3o3esqzRCLQuuaPe9QWkZy53UgLOISgNRpMJzBUkmbaA73p9BevSzLXnJWR6bTZ+bO0J2 X-Received: by 2002:a25:31c2:: with SMTP id x185mr8465849ybx.93.1612403536610; Wed, 03 Feb 2021 17:52:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612403536; cv=none; d=google.com; s=arc-20160816; b=bMcnFgCRKNWS3jCmdfH/Q+ctC4CYvlIskhVhQM4eumN9sYx3eYo6DvrLxgAGoZj4m0 7dTmJ5OX6KR8sWAUS2nLpHjKTzJmRXOFgv7pF/pYByExDBgk09yOWi2TyVEiKRVw64Dq RRxkhz4NrNktyqaSkkOHCHn/QEEQQAOW+xPNC0Gz42W+qyAS3XB8JFnW2+6MX/hp0t70 BIU7gVCPql64ShdU/d29+p6g7NDwFt65joHwDrJeQyd6ofT7DPwjiRYtTAmWFAaTXJ8d WWkpkFO/75gyALKYw8l4SIn+H5+884XBdMuAMGainfcvlcIjQNv80Oop5Dsa44AI1Yal MKqA== 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=06H8W/q0v8WI5yMb4Dgc4NhHzAw8roTrWJkM0Lw1UXA=; b=pOyEY+pxeP15fM1QGgcpq321SJaMiyP/OhTmhvkgoKPG5w3iK9mmo/oImFF6QfdWnn EaRTvci1lK3qgfwRpXwp8eR8LFmshnyZJXS7XtSIqwpGTHUD8aWPwPZcjYG7MxHaiVcC 0bhgipURHVXoAA9nppOXQHyu4KQbum/geN+E8zZXsjw7HLrqFLaDpDCCHybrWqPBccEr hZObAEeKHpKmdNmAcnoJf+n2hMdNEP6hJPy4ZR0GGbaXJ7OHFBV1eDPBk9rTORV2pi1D m9qGFh46H7BID+qJg0ZwkLWHK+WaZWNBAgZUgEI6UJOVBqFdF4O/5OMoX6NvdT/ltj/r 49HA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DuqrYvMw; 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 y14si2728328ybm.194.2021.02.03.17.52.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 17:52:16 -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=DuqrYvMw; 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]:46802 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7Toe-0003hb-1y for patch@linaro.org; Wed, 03 Feb 2021 20:52:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44108) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Thv-0004Uz-Mq for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:45:19 -0500 Received: from mail-pg1-x52f.google.com ([2607:f8b0:4864:20::52f]:35017) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Tht-0003WL-B7 for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:45:19 -0500 Received: by mail-pg1-x52f.google.com with SMTP id t25so1048727pga.2 for ; Wed, 03 Feb 2021 17:45:16 -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=06H8W/q0v8WI5yMb4Dgc4NhHzAw8roTrWJkM0Lw1UXA=; b=DuqrYvMwhBsc+qfGK1FRo0OYd+ObwZJjKbK91T39gCwuU3LrSqkOrErS6AAw+3ogQ6 HoP1IYIAMqYv5yLwGI4i2ICtFICfW4Yn6b9HJKauwAOmh+ImpeoP/yWcmGDB8KD/Vukh RAHahpVMWLMGXPu5RRoAji87XBIvYRoG1hRU5YZohGnZdzL7sdPibIKBbyfEDhJFufLc /9waZnEeTskxdNC89DYgkQkNv4bHNW1KksxoG9MEyCTVYYsXeixEZE1Q91DMVWsRRpOQ ytJj5HWx2iydLXfoebTvT4p4e8ufAMr3OUYCOIqIdJiRh+Ac65sJEnmdayAYtpsl9qaK 9FcQ== 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=06H8W/q0v8WI5yMb4Dgc4NhHzAw8roTrWJkM0Lw1UXA=; b=YA74PkgLDnOauqAENe5lUoG9rrmVhJ7KS2laoFVz5cYyBYv/R6kLQm2JXnuuftQM9o Gh5W9pQNU5ikT4DaSRXaocZY1HgP04wkY/rvFBzeG/PrnYBdhFb4vKF8RUayg2BphV32 rlvD9UY+NyiTwuKOzCgl69PFf7OMnr8pCf6DKtPTzeth9CjTS1Q3qREGufp052sX/NJg +4E3tohXdIdaz6jpOBT0D+k8yQYHo/+6RXTfesj7zm3bFBTPz2prTlg8mENWetpI9Saw HvCAHIoKW0FMYUSxsJANe7Dkg1VsFMGrzyPGavAeZO4hjpY6mQ+QYEdxpOVOFz7IkAev 0HCg== X-Gm-Message-State: AOAM532/EnrQPac/WpUyAVPZ6BPgNamVt3BjGI4zbj1C80cXbJYkKHSp UN1TMkuNVsCxXH9lQhA4+iqBmTl1hoMFSZVR X-Received: by 2002:a62:f243:0:b029:1c2:8424:2495 with SMTP id y3-20020a62f2430000b02901c284242495mr5827298pfl.32.1612403115921; Wed, 03 Feb 2021 17:45:15 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.45.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:45:15 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 01/93] gdbstub: Fix handle_query_xfer_auxv Date: Wed, 3 Feb 2021 15:43:37 -1000 Message-Id: <20210204014509.882821-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52f; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52f.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The main problem was that we were treating a guest address as a host address with a mere cast. Use the correct interface for accessing guest memory. Do not allow offset == auxv_len, which would result in an empty packet. Fixes: 51c623b0de1 ("gdbstub: add support to Xfer:auxv:read: packet") Signed-off-by: Richard Henderson --- gdbstub.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) -- 2.25.1 diff --git a/gdbstub.c b/gdbstub.c index c7ca7e9f88..759bb00bcf 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -2245,7 +2245,6 @@ static void handle_query_xfer_auxv(GdbCmdContext *gdb_ctx, void *user_ctx) { TaskState *ts; unsigned long offset, len, saved_auxv, auxv_len; - const char *mem; if (gdb_ctx->num_params < 2) { put_packet("E22"); @@ -2257,8 +2256,8 @@ static void handle_query_xfer_auxv(GdbCmdContext *gdb_ctx, void *user_ctx) ts = gdbserver_state.c_cpu->opaque; saved_auxv = ts->info->saved_auxv; auxv_len = ts->info->auxv_len; - mem = (const char *)(saved_auxv + offset); - if (offset > auxv_len) { + + if (offset >= auxv_len) { put_packet("E00"); return; } @@ -2269,12 +2268,20 @@ static void handle_query_xfer_auxv(GdbCmdContext *gdb_ctx, void *user_ctx) if (len < auxv_len - offset) { g_string_assign(gdbserver_state.str_buf, "m"); - memtox(gdbserver_state.str_buf, mem, len); } else { g_string_assign(gdbserver_state.str_buf, "l"); - memtox(gdbserver_state.str_buf, mem, auxv_len - offset); + len = auxv_len - offset; } + g_byte_array_set_size(gdbserver_state.mem_buf, len); + if (target_memory_rw_debug(gdbserver_state.g_cpu, saved_auxv + offset, + gdbserver_state.mem_buf->data, len, false)) { + put_packet("E14"); + return; + } + + memtox(gdbserver_state.str_buf, + (const char *)gdbserver_state.mem_buf->data, len); put_packet_binary(gdbserver_state.str_buf->str, gdbserver_state.str_buf->len, true); } From patchwork Thu Feb 4 01:43:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376141 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp830132jah; Wed, 3 Feb 2021 17:46:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJznV80KeRdbevBnObJjtcsU4n/G4b9647+VwFqLDO65ESrnQ6nVDxLV7zV5dTtYR8W4TnL4 X-Received: by 2002:a25:3b46:: with SMTP id i67mr8282468yba.4.1612403201451; Wed, 03 Feb 2021 17:46:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612403201; cv=none; d=google.com; s=arc-20160816; b=QU1jAMxFZUOFcAD4V969XvwkkEW5L2469PJ6YXH0vcq+gL/P7qBMOXJzpPWf41k4eq XIW8RhmX3SCeLiGcRlBBdQ5sVV2z/FHMxluxC2AeOlONk5qL5q489p8ut4ZIe78fwRBp iPR8Ub1OEK9F4xLI9JMq9wSmUC7QblLooleIanJVf8pMoICv93lKIbPK38ApTDzAUSsm /tRwJJa4M/tTgP/O4l8d4Wh/Mk346Dnz0DJwTkycQ0e0XXOdPhs+VsXkckvTdyCdrGq1 M7OkdsDzoUFGv/75+uxLVxJCs4JwUQyO7GeEYGckJp7npfYNBVNkKcBp0ueNdUDLlmwF Jmug== 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=rTk7Zu1K9am+nHTK4Qgzw1qdbWz4Og49PpMunTWLZww=; b=dg7sWTg3tnIrQ+sAHAsTLxMXal6NAvsgb/lo48kgiELeLeshjHr95U123wf+M7AchV TcNI3hvUqLJM2VNzDKVdKurcdIlq1wh1Q9df+bsT8qhQyy7rCcaimHwFGmbIU3v4AMMQ wcQDOWGMozlST7KrW7FsAQqXY2b1qo8DBRPKZyBwqngz7FwdiRJPf48YBOSu8rrZEPBN 70KbB8VnOypBvYdS5cmEoY3X7AsrR9azli4he2htwRJRu40rPj3DrZcSmutwSWa7Ntyl BzPRsX0mHhZnVlfS6MPH08MtY/DycG4Bu+OLuUtmAoVRy/BDHO8syoVvC9sx0/ECQeBV PJCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=L+vMsTdH; 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 i14si3654270ybe.71.2021.02.03.17.46.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 17:46:41 -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=L+vMsTdH; 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]:58302 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7TjB-0004Wl-CM for patch@linaro.org; Wed, 03 Feb 2021 20:46:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44116) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Thw-0004VD-PY for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:45:20 -0500 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]:39190) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Thv-0003WU-6H for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:45:20 -0500 Received: by mail-pj1-x102e.google.com with SMTP id d2so818468pjs.4 for ; Wed, 03 Feb 2021 17:45:18 -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=rTk7Zu1K9am+nHTK4Qgzw1qdbWz4Og49PpMunTWLZww=; b=L+vMsTdHO+F+rWu2A8IcnDBW63zUfluuYsThUOtUy1nn1H/N21XLlrqEk6Hfdcn2K0 UH5iIBiHBNkXe4Uhd5JUuRKx5GDWIA5qUFSnRNGmxXsVHQOOghVYMsHDiZC0XacpWjWB PbB8y9/38/Bwl5DNpYyPHgk8xsgMULnpG5PwvU0ilUNOyZm5HYG6OQL2jB0aNpXmkrqV +SdeQ2zPytUBoyArIB2y2tWaL8Y1cwmdk3FMhQ9+TegaUQH5GHh6u4DMb3+iXr+EhQvt sWwM6mcsAb/rlCS1pDCDWcqkPQ1wPVk2NNIc74619CXvZ0FjZzl1dKZPhCa+LsOKVz96 UuDw== 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=rTk7Zu1K9am+nHTK4Qgzw1qdbWz4Og49PpMunTWLZww=; b=iAFJVYFkrRqKLukr5jU7lWt3k+qkz9slZ4Wx41NV3ZWv8cRfIH/0Vbmnu07lZSMHZg WwvSFSjnW/hpKDltGkqB5umtcWh2wVzHtAmSIDoFtHcsiiqoTC1sMKyh5oEgXBXD+Nct gOOnaMeZQnwVKmqvBDbRwNMZ+IhoDZcFqF5O511hy5P7eIjmFkVplN39olzLS4UdxTe7 jikNeRBGMg3YCmtttvhvZt1SrITpEmNf3cPRq1XHnEx0IiZTT0BAQqHowPHlJbgdxc6a tXqAwyc1OHj7UoqwYR9zlhH3BpvKN/On6eY6ARBdV04xJ4KmNTZiSfVurO2l+WDH6E5T 8Ejg== X-Gm-Message-State: AOAM532w3zY5uWWJIRFb6olxh8xF0hUbT/vedWT3EfldRUD20dEe8ci6 N4qlmRwFrYILgZx+hynRhg68QIglfT1fhw39 X-Received: by 2002:a17:90b:1996:: with SMTP id mv22mr5867676pjb.121.1612403117725; Wed, 03 Feb 2021 17:45:17 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.45.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:45:16 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 02/93] tcg: Split out tcg_raise_tb_overflow Date: Wed, 3 Feb 2021 15:43:38 -1000 Message-Id: <20210204014509.882821-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102e; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102e.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Allow other places in tcg to restart with a smaller tb. Signed-off-by: Richard Henderson --- tcg/tcg.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) -- 2.25.1 diff --git a/tcg/tcg.c b/tcg/tcg.c index 63a12b197b..bbe3dcee03 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -346,6 +346,12 @@ static void set_jmp_reset_offset(TCGContext *s, int which) s->tb_jmp_reset_offset[which] = tcg_current_code_size(s); } +/* Signal overflow, starting over with fewer guest insns. */ +static void QEMU_NORETURN tcg_raise_tb_overflow(TCGContext *s) +{ + siglongjmp(s->jmp_trans, -2); +} + #define C_PFX1(P, A) P##A #define C_PFX2(P, A, B) P##A##_##B #define C_PFX3(P, A, B, C) P##A##_##B##_##C @@ -1310,8 +1316,7 @@ static TCGTemp *tcg_temp_alloc(TCGContext *s) int n = s->nb_temps++; if (n >= TCG_MAX_TEMPS) { - /* Signal overflow, starting over with fewer guest insns. */ - siglongjmp(s->jmp_trans, -2); + tcg_raise_tb_overflow(s); } return memset(&s->temps[n], 0, sizeof(TCGTemp)); } From patchwork Thu Feb 4 01:43:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376149 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp834721jah; Wed, 3 Feb 2021 17:54:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJwqLoByR9Sl9fHauOmnWSI2yXQK4q7e6GyDEWV5c9GI2BZGVJ6WHjcATx+w22QUEB5dy0eV X-Received: by 2002:a25:bb12:: with SMTP id z18mr8201859ybg.488.1612403683120; Wed, 03 Feb 2021 17:54:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612403683; cv=none; d=google.com; s=arc-20160816; b=Nn1tJvo9cz4vw1NKF5cJ19tPuUPmynes8N8Z8y/ZbWyMwvOEPFe2x2u9axUJgCqdsm sFvIWeMPmb0BywyoyCCQYCAhsEWG/kBEUlTexLXFWbqvz4sZf7Cgcxp+m8v4FeP6wqOP dwzyT0ckrtu1QYopQgJl7cSg+WTohFpH0pvhejFoEe1+FfBPLzXbJOtf/tT6DmGajOrI yGuso7DJKu7tRkqaq6JdoXBcjeIvETnid+wjQtgabRklQmwSy7RTmh/kQccW8scCGBKr 5jGb2bZ1DU8jBjnhL/3RBPXLPlwc3jd+kuFAoBCbF3OoJWIUyRU9QfV/dC/eEtPw8YsO 1byg== 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=C3tpiU3zelsjFSQQuB1ZzEawshUyJREYmvhF2hEYIiM=; b=L+BJMWapM0N+5Hwzhj4AJA1o7JnnIDlgZeuveDSFBlp/gOo9CU6j6Te1Sv9jL5mA7l aa2Wze7URAYI657G0DFc6kIvprk+ar+TonUzFHjl7OtADb7aZwjk+5WKVPb3YuXtDwm5 R1ApLZQhGP+002haiIc6TeT4zXbM/kIwml1YWaEk3uJt7qzCJ4wFQ5mEvfTvazkNLcjB sfbQIbzWldBKPGYzyPcz33URevjwZzFj8/lgSczfsADcEHotOaSSQMNqso6McLLEnDh9 nzatjVXDwTi1q1fOrTILDRfK+mF6bWeiVGbSCuJfxNhGAqKRBHWN9k/EBoBxQEumZHMG lEeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Lsga50J3; 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=fail (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 s4si3737877ybm.126.2021.02.03.17.54.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 17:54:43 -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=fail header.i=@linaro.org header.s=google header.b=Lsga50J3; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:55392 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7Tr0-0007CM-Es for patch@linaro.org; Wed, 03 Feb 2021 20:54:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44130) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Thz-0004XO-11 for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:45:23 -0500 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]:33127) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Thx-0003XU-At for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:45:22 -0500 Received: by mail-pl1-x62b.google.com with SMTP id d13so905261plg.0 for ; Wed, 03 Feb 2021 17:45:20 -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=C3tpiU3zelsjFSQQuB1ZzEawshUyJREYmvhF2hEYIiM=; b=Lsga50J3Bb6Bfy1Df6O/QA443/VfrkhBkUx5unmEi8UJ2M5fyC2q25127EGJLvz3IL gQzeuPmCIkLadfLPEOpq8dyZXAcP6+FmAu0LXjl1Il0wFy3WQ4x99T7YPs+BCUiqLeRM /45K8Zq9T+V5VNjNwTWfWbYnNmqbZoHzfobqrgWl2OIi6tR+f4IbYTgHfdcyHQYlfQZ5 XygnzwpQuYMJmjkRGRbpJ4IX2G4VX2+aKuM35Jwf80Pw5VExqWOdLxFTqznBvbzewxSw rsu9ZkqIQGOJhycftrchSEx8m8Y3Qx2K60+g1K9negiar9b/cImflr4zEQfuITjVAPcm t5mw== 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=C3tpiU3zelsjFSQQuB1ZzEawshUyJREYmvhF2hEYIiM=; b=s9sanZXPNiCoAKkax5MB+OCYHrSsOtKD+TgQ+CGvlXYYtYa8HUFjFHMhdBx3JkEqS6 776Zam6U9ci62wqGxjmU52Fn3lEoQ8TURKhkgIKS5thDh744og17YJyU+xZAPv29yDOs A7hyFgpQBnCHUaVPJsa1as5LTwIGzL/jRE2Y2cOu3pxvZ4obfL3fueJE9uCuZV1IBK3O FGfw6ef6pHvQUMkcWZ11n3EtzceJzKhN+FCRS8yHR8onHZTk4rOhto+u2tSr82ZtOLSR KSGKl5To39kpR2W/v5OHvJXIeijcNVkwsVtLFAixwavhlIT95KOpzWN2uNiZQTz67//G ZZTA== X-Gm-Message-State: AOAM532vwfClNlo8xCJiiaa6mqvDJsQTmw8iX2gD1Y9IAzcrJKdBRHsd 5FE3OxXy59P8+UcMSOIP32F4TyPvmE+XgZ9W X-Received: by 2002:a17:902:e211:b029:e2:843c:426e with SMTP id u17-20020a170902e211b02900e2843c426emr5543556plb.16.1612403120092; Wed, 03 Feb 2021 17:45:20 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.45.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:45:19 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 03/93] configure: Fix --enable-tcg-interpreter Date: Wed, 3 Feb 2021 15:43:39 -1000 Message-Id: <20210204014509.882821-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.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: sw@weilnetz.de, =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The configure option was backward, and we failed to pass the value on to meson. Fixes: 23a77b2d18b ("build-system: clean up TCG/TCI configury") Tested-by: Stefan Weil Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Daniel P. Berrangé Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- configure | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.25.1 diff --git a/configure b/configure index e85d6baf8f..a34f91171d 100755 --- a/configure +++ b/configure @@ -1110,9 +1110,9 @@ for opt do ;; --enable-whpx) whpx="enabled" ;; - --disable-tcg-interpreter) tcg_interpreter="true" + --disable-tcg-interpreter) tcg_interpreter="false" ;; - --enable-tcg-interpreter) tcg_interpreter="false" + --enable-tcg-interpreter) tcg_interpreter="true" ;; --disable-cap-ng) cap_ng="disabled" ;; @@ -6417,6 +6417,7 @@ NINJA=$ninja $meson setup \ -Dvhost_user_blk_server=$vhost_user_blk_server \ -Dfuse=$fuse -Dfuse_lseek=$fuse_lseek -Dguest_agent_msi=$guest_agent_msi \ $(if test "$default_features" = no; then echo "-Dauto_features=disabled"; fi) \ + -Dtcg_interpreter=$tcg_interpreter \ $cross_arg \ "$PWD" "$source_path" From patchwork Thu Feb 4 01:43:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376142 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp831723jah; Wed, 3 Feb 2021 17:49:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJx4epIYTrNANNhGiACmirEvQBA/abpdZ8helzOEQgcbie6/ylZVucKK8U2PPydPhGKeAwPV X-Received: by 2002:a25:2fcf:: with SMTP id v198mr9273355ybv.149.1612403368879; Wed, 03 Feb 2021 17:49:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612403368; cv=none; d=google.com; s=arc-20160816; b=HiLrIb5dDDNY+ZhFV5RUh82Tp+8LX4BqXLiuKJ0ZQcaiyQAkl+J/wNjBxCdB36KoCI jVERjIrPTn98Tbvek5r+vWe4x+oeRm2AVBhu3WdsBVnmahBBI2AWb0iXLMZH+RjQ6gvV Qch9ieMVT0Eyslsygu2K4EgmzWG2mJR32rboYqHy+oFJi4wh6R3chL35Det+xihicc7L lEeSLgSm2u9DaC4Q/Yo1ZUs/RwfTGrYGvoxrnaIt/PQssYwHXzArYYF9HmHOQd3J6Iw0 PohPetlfR2i8FccHrwYN+5jiSwYgcrW36r3c03FnJpDsWAEN4wTPLRh1UmwRkpk7MyUY N0Rg== 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=xzKpOz1dnkvT+2F/uu8BRDtdRIBrUsrfNHwaFpPfXw4=; b=giW+ksyccCfStoBgwMqPLYHM/OHXMEd8N6ZckCdqwscHPLQPXaGgx2Lfn072I80/7K WduiWfBBHiSM2tyTb+ltUbfwD1oj9t1aPc4uV2bOEt6ph1y+WvQGT2nVN5ngaUfDLMTt fskTELQDzbrLHlO+Uo4nlab7LPm42Gny65uOzHGRXMcHQ6yaX6+49ERgpFXkd4gTCpGA ko+vmBiV4hv6t7oTKabVnh7QPmkxfKnfUXI3nA8/h9FzIsHJ/JvOTjv2v2SZEoyjfimq Pg4IRgP9P0Tg54Q+zoAe55EGAszNUgHrgye9zkMU7J7V/oeMql+0Tz6VtgVaTjuDBP+G Sxhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IhdIKzEl; 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 x6si4129147ybm.239.2021.02.03.17.49.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 17:49:28 -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=IhdIKzEl; 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]:38482 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7Tlw-0000Aq-Bk for patch@linaro.org; Wed, 03 Feb 2021 20:49:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44144) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Ti1-0004YA-AC for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:45:25 -0500 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]:42751) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Thz-0003YX-Ie for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:45:24 -0500 Received: by mail-pf1-x436.google.com with SMTP id w18so1063748pfu.9 for ; Wed, 03 Feb 2021 17:45:23 -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=xzKpOz1dnkvT+2F/uu8BRDtdRIBrUsrfNHwaFpPfXw4=; b=IhdIKzElpOv0lQMryl8M6dS4hOA9665UbHINzDX6dQgUWFLXpvS5GD+tAehApDxpQO CU5f5DpxEYOrUr+TePx40CTXMKbyN4Kkpk1O0toxJ8g7ivMjCb7GHUHjdkb6tJ4KZ3Te leb9UmzXh6XkwrJD3cTrKHYGCBxqTr4oyt5UwZGQw7ZFa3e8GH/gOk5C8B+hhjm0Y17A ijVWPoeZQYRYwY7zp/j9gVoLm5lfDLIQMZ3FicrGKW2LUub35SYTvQ96I1ikh0ddKq38 C8wdnppL2Nat+o2d44N0kLjbREAQ+MqNqUqBX39iEuTcsTDlPfqzDbynnzZyvvjLu6ag SHzw== 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=xzKpOz1dnkvT+2F/uu8BRDtdRIBrUsrfNHwaFpPfXw4=; b=EuEJAi2TaO6qxUUU45yVzIsernznU02KRw+o1PIdqvkWkyOtYWykduHwllQ2nVm/IV Wq+/k/V2lemab072q9kDD3usj7O2qRgBIqduH1eq6dsnQ9ebDtWimrcA6D04VXwN4FCe g//evMsRQDZOn6tUCYgyYWev8k0EpQJZfJufTUaubA2OGIe79OwKKuP7B3ufrj0WU3kn cgExEpDS9SU9i+yhx7wE4lBs0WGjoY++H/CQId3d5mLF+KZS4SLrkNmYKjt1hzyerR2H 2X7nnB4CaGgRjsnbUTZvyGvtBPSBJrM+fli+K3Yge/JvmAJZqx8RnrVx6jg356q63x7U ffvA== X-Gm-Message-State: AOAM5318ijGpNbuJpDm4OdFtHcp8TjKVWI+QgKuYLc2y3wA6Vi7pntuU P7Tufk5wwczq53Q1TXuU7mJRGTkbtBRldHnH X-Received: by 2002:a05:6a00:1385:b029:1be:ac19:3a9d with SMTP id t5-20020a056a001385b02901beac193a9dmr5727605pfg.65.1612403122266; Wed, 03 Feb 2021 17:45:22 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.45.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:45:21 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 04/93] tcg: Manage splitwx in tc_ptr_to_region_tree by hand Date: Wed, 3 Feb 2021 15:43:40 -1000 Message-Id: <20210204014509.882821-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::436; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x436.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The use in tcg_tb_lookup is given a random pc that comes from the pc of a signal handler. Do not assert that the pointer is already within the code gen buffer at all, much less the writable mirror of it. Fixes: db0c51a3803 Signed-off-by: Richard Henderson --- For TCI, this indicates a bug in handle_cpu_signal, in that we are taking PC from the host signal frame. Which is, nearly, unrelated to TCI at all. The TCI "pc" is tci_tb_ptr (fixed in the next patch to at least be thread-local). We update this only on calls, since we don't expect SEGV during the interpretation loop. Which works ok for softmmu, in which we pass down pc by hand to the helpers, but is not ok for user-only, where we simply perform the raw memory operation. I don't know how to fix this, exactly. Probably by storing to tci_tb_ptr before each qemu_ld/qemu_st operation, with barriers. Then Doing the Right Thing in handle_cpu_signal. And perhaps by clearing tci_tb_ptr whenever we're not expecting a SEGV on behalf of the guest (and thus anything left is a qemu host bug). --- v2: Retain full struct initialization --- tcg/tcg.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) -- 2.25.1 diff --git a/tcg/tcg.c b/tcg/tcg.c index bbe3dcee03..2991112829 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -513,11 +513,21 @@ static void tcg_region_trees_init(void) } } -static struct tcg_region_tree *tc_ptr_to_region_tree(const void *cp) +static struct tcg_region_tree *tc_ptr_to_region_tree(const void *p) { - void *p = tcg_splitwx_to_rw(cp); size_t region_idx; + /* + * Like tcg_splitwx_to_rw, with no assert. The pc may come from + * a signal handler over which the caller has no control. + */ + if (!in_code_gen_buffer(p)) { + p -= tcg_splitwx_diff; + if (!in_code_gen_buffer(p)) { + return NULL; + } + } + if (p < region.start_aligned) { region_idx = 0; } else { @@ -536,6 +546,7 @@ void tcg_tb_insert(TranslationBlock *tb) { struct tcg_region_tree *rt = tc_ptr_to_region_tree(tb->tc.ptr); + g_assert(rt != NULL); qemu_mutex_lock(&rt->lock); g_tree_insert(rt->tree, &tb->tc, tb); qemu_mutex_unlock(&rt->lock); @@ -545,6 +556,7 @@ void tcg_tb_remove(TranslationBlock *tb) { struct tcg_region_tree *rt = tc_ptr_to_region_tree(tb->tc.ptr); + g_assert(rt != NULL); qemu_mutex_lock(&rt->lock); g_tree_remove(rt->tree, &tb->tc); qemu_mutex_unlock(&rt->lock); @@ -561,6 +573,10 @@ TranslationBlock *tcg_tb_lookup(uintptr_t tc_ptr) TranslationBlock *tb; struct tb_tc s = { .ptr = (void *)tc_ptr }; + if (rt == NULL) { + return NULL; + } + qemu_mutex_lock(&rt->lock); tb = g_tree_lookup(rt->tree, &s); qemu_mutex_unlock(&rt->lock); From patchwork Thu Feb 4 01:43:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376143 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp831727jah; Wed, 3 Feb 2021 17:49:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJwA1sy1t8kDFOyS4zoN/KE/UMvb9lDSDMQHHuUBkSlzsDc70OoQWLn7q0J/M70mQafZ6T8o X-Received: by 2002:a5b:108:: with SMTP id 8mr9016607ybx.398.1612403369099; Wed, 03 Feb 2021 17:49:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612403369; cv=none; d=google.com; s=arc-20160816; b=YOB65SSscSTZw1O2PPN2BjPJLf46HAxaZdirbdAoDgRwiIVdwjfoT1zduuHToqtBI0 Mkzc+mTGM1xM+wBhQlxk8mvwQwdND1uRbsZruPXYHmFXTfDN7CYkEInF4nYCQ98df5IY 7PTBo3vM2/ORZFEAAc82vLZ8EpKTpN2iG+PmxA4oeZWDF2H/Rqi/dJhIWUOZFWLciAEt uxfC23Xe87JWrGWF0j4LKh1sBoN2ckgXyylCv528qE/PSIWMlPJE9rM3RuIElmvsO3CM 1Xfe0FneqIEvTQZIBpffQM836mwFInF23czKexwvS69N+5/nyMjt+BepNVk91+nF7kVZ +ztQ== 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=V9K6psPZgkSjeT0TMBnqZlPYxPfyJCvKViKqKJxu0LY=; b=eWGerD0koPXZx/HBjqCs1e5LL3mGu2sTTzxY83VQokxcsPsf2zeMU4T4LkxRH2fhMf 2sM/9YsyIv2OBZ82VCNIcocNdAN2SskugjCsM4NmvRGEHEIpZrtSyev0qqHhWKiCGUqg up/zFBJ1BQvJ+OedASCxukdQfTODmLXKeVut/w8NE+n3Yd9YoyVNYGD5WKnloBnBDGYZ wOFMNV9smVFvbSkTqQBHAI7naHSB16ehaRbXQTE/eZVYURjjYwzPSrU4HVvpjmSXRpjv tCj9AzV+2oc+V5M6wbDFPLRWQQj3e6ZMiOvBjHi70wEe3CB0oGYH09C5ghZTFlAgkB1h XMvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uuIVQvvv; 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 k13si3904212ybj.5.2021.02.03.17.49.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 17:49:29 -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=uuIVQvvv; 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]:38510 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7Tlw-0000BU-He for patch@linaro.org; Wed, 03 Feb 2021 20:49:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44184) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Ti6-0004cS-BS for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:45:35 -0500 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]:35656) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Ti1-0003Ym-EO for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:45:30 -0500 Received: by mail-pj1-x102c.google.com with SMTP id e9so829693pjj.0 for ; Wed, 03 Feb 2021 17:45: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=V9K6psPZgkSjeT0TMBnqZlPYxPfyJCvKViKqKJxu0LY=; b=uuIVQvvvSb6f8yb+XbcoE1ez4bzg77o2R+bPOvOsPZFrd8xitgjQ/eaWytDgX6R/55 2uTY/fPh/rdTdr8ajzUGWCcb90Ad5nRk5s7usl3RFG8DAZGJgWBdYWBArEEwAWdAdMOw 0X+7ThiJbQEe7SzMAtL0G4a/c+NuSRQtJ8oLWz3JHMyM9T+DmULo+ppdh10O6W5uVB9s 5hPrQHEM+VTjrLnmsMaVVUbjd7WP6ED9J+Rr3BhXvt0nLP37/GqYzU6WThepyrkKp/+f Iqxzh7ZhGC11M8yRns9LwzdA3S9py/T7dZPezyRmQu5SMdYFRifzEzmVSct51eT+xLSH CmvA== 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=V9K6psPZgkSjeT0TMBnqZlPYxPfyJCvKViKqKJxu0LY=; b=rEX6kfkyrC6D9H9N+4MRB5QBZ+OJiFS1NUHAX/3U8rgEAwKWh62UvHwWZGi9lIrTqJ kXnpRYwsuBCA15hUm41iU8SeuXy1YhtNr/vi2pwzn8hPB0ixNdVKTX+k7GUmQSW5bWcC gTdaAy7cNJBR/pomV6SLTDdSL0UoSmvatLvw5Lr83XPWuXOuHtFNL3P0KpMiRBc3JG+b LCaYOPmeN6hv1aXEO3CjUM7Slg0xsnSki5Iht/t3jFaRPKpB1+H1KvTx4Ymr7/IKIKjK dqqmyO8/ObqCaA18F1O6s/HFJFEiYiRzhdn74/PoMGbM8xPi64fi3neR1PhCVaDekUEB FN5Q== X-Gm-Message-State: AOAM531lFp5D8LvYHRcLGHwJ+GayVlhkfF0Ss/gjXRFJLUNq6Ip+ZSLa Mq4N72aUF3maLhJH/35Fn3efSWddmC7FtH3K X-Received: by 2002:a17:903:1c3:b029:de:6b19:e72e with SMTP id e3-20020a17090301c3b02900de6b19e72emr5785243plh.63.1612403124015; Wed, 03 Feb 2021 17:45:24 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.45.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:45:23 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 05/93] tcg/tci: Make tci_tb_ptr thread-local Date: Wed, 3 Feb 2021 15:43:41 -1000 Message-Id: <20210204014509.882821-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102c; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102c.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Each thread must have its own pc, even under TCI. Remove the GETPC ifdef, because GETPC is always available for helpers, and thus is always required. Move the assignment under INDEX_op_call, because the value is only visible when we make a call to a helper function. Signed-off-by: Richard Henderson --- include/exec/exec-all.h | 2 +- tcg/tcg-common.c | 4 ---- tcg/tci.c | 7 +++---- 3 files changed, 4 insertions(+), 9 deletions(-) -- 2.25.1 Reviewed-by: Alex Bennée diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 125000bcf7..f933c74c44 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -544,7 +544,7 @@ void tb_set_jmp_target(TranslationBlock *tb, int n, uintptr_t addr); /* GETPC is the true target of the return instruction that we'll execute. */ #if defined(CONFIG_TCG_INTERPRETER) -extern uintptr_t tci_tb_ptr; +extern __thread uintptr_t tci_tb_ptr; # define GETPC() tci_tb_ptr #else # define GETPC() \ diff --git a/tcg/tcg-common.c b/tcg/tcg-common.c index 7e1992e79e..aa0c4f60c9 100644 --- a/tcg/tcg-common.c +++ b/tcg/tcg-common.c @@ -25,10 +25,6 @@ #include "qemu/osdep.h" #include "tcg/tcg.h" -#if defined(CONFIG_TCG_INTERPRETER) -uintptr_t tci_tb_ptr; -#endif - TCGOpDef tcg_op_defs[] = { #define DEF(s, oargs, iargs, cargs, flags) \ { #s, oargs, iargs, cargs, iargs + oargs + cargs, flags }, diff --git a/tcg/tci.c b/tcg/tci.c index 3fc82d3c79..b3f9531a73 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -57,6 +57,8 @@ typedef uint64_t (*helper_function)(tcg_target_ulong, tcg_target_ulong, tcg_target_ulong, tcg_target_ulong); #endif +__thread uintptr_t tci_tb_ptr; + static tcg_target_ulong tci_read_reg(const tcg_target_ulong *regs, TCGReg index) { tci_assert(index < TCG_TARGET_NB_REGS); @@ -526,16 +528,13 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, #endif TCGMemOpIdx oi; -#if defined(GETPC) - tci_tb_ptr = (uintptr_t)tb_ptr; -#endif - /* Skip opcode and size entry. */ tb_ptr += 2; switch (opc) { case INDEX_op_call: t0 = tci_read_ri(regs, &tb_ptr); + tci_tb_ptr = (uintptr_t)tb_ptr; #if TCG_TARGET_REG_BITS == 32 tmp64 = ((helper_function)t0)(tci_read_reg(regs, TCG_REG_R0), tci_read_reg(regs, TCG_REG_R1), From patchwork Thu Feb 4 01:43:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376146 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp833350jah; Wed, 3 Feb 2021 17:52:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJxtRWQAYWwFSBdROFkKS2GqYfGTHEH3vXuQZafFvku8jJR4n7asbCM5S2IxcO7aEveHEqWB X-Received: by 2002:a25:6985:: with SMTP id e127mr9104607ybc.50.1612403536865; Wed, 03 Feb 2021 17:52:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612403536; cv=none; d=google.com; s=arc-20160816; b=YWP/szbEb+DFjpup+Gufh4C7tvbxDIXbvgEPpa6SqJukE7iJJmvbx8/O7NjNS+Goj8 ZzPpMoBE8xx8Arb+wo70CRQBQruJwQ79YfMQ+OMXJX6tS1pRBxJTlQ5nxOw3dhzQBGKz qRuzS4/foaq8QxB7nI3pHN0s23tRpJq8phlE/+M9heSgEi9C6aM5yBlrlY3aQgsDxx0m vEVd1a7j/QWiJmxKWFNf15flMFxtAwIsh5mZgpGRr9pN1ymvEgTZUnCh2AlDp17SuKxu /Z04BCHXu2X9FnGBOneBSm36OKY5LKCTXA06dBnVdgCYJLy2RtlrcS0qI7PHLUNxicaP hFkw== 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=onZUWhtxKDVzYiKYm4mcVALF5M4RSZvicSg1zN9qm0A=; b=F8zwQHjV2UjREDZLrKUfvwTmjorSoXS2dI5xl56yW1CyaS3Ig6rW/WZrSbdXftMlcN JDt81fBJlKRIylGHBR1PM1nV5gSuW/TQa/3x8Vg7aNhH7u4RPnpAFL6LlKk9O4PV5CHB roIDGuGaGulRYp/PnlQnLIRAgiNUCBKTx8ZWa+CWdr7DV+LfZ9a7NMSkoj95zmx+MkCK 0pUrN4Bugxnh69ZLBwfISaUUK2vrPoVdZRct/SDa5Lw7wJfy9R8Lp/miht8+3uBx8yYW heDCYZgo/LATim1IUOhGPf6aDGM2Ao/HBfHVedffjSWWdkKhugigmDLavlS/JcdRoj67 WkXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hBRwnBjJ; 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 g16si3830345ybc.382.2021.02.03.17.52.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 17:52:16 -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=hBRwnBjJ; 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]:46858 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7Toe-0003ij-D7 for patch@linaro.org; Wed, 03 Feb 2021 20:52:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44222) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7TiA-0004cl-15 for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:45:37 -0500 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]:41211) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Ti4-0003Zs-7a for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:45:33 -0500 Received: by mail-pf1-x433.google.com with SMTP id q20so1061354pfu.8 for ; Wed, 03 Feb 2021 17:45:27 -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=onZUWhtxKDVzYiKYm4mcVALF5M4RSZvicSg1zN9qm0A=; b=hBRwnBjJOGd90+PlG3cx3eV94tCTthP6l6BAbCd6MkTYms3dLPFhe3ZeeWzwboJXdM C06ztdWAeeXl5rVM0JZaxUrq/eg70N6hwcDQJ5JrUlDGqnuedca/rSIgvhwTQ9Rch2jU xDvyH651hvdCulacf7xtk3nqYqNd01xvhsQiNk9Dc8fK3bITPg5EwmE+vP4ywN+f45Ew ok9t8Clf6dOysDCZK4eb6RtSsbaJ18W8XN+5QxRn21ekaAVSOQwJFh/tBYvWTGZLAi/U ji7Ny6C53NbgJI/p7q03SEcbt79m2BKyLOXA5sNt6XOHJZZUbpU8//8A7u9D3Jkyr9Rd vSPA== 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=onZUWhtxKDVzYiKYm4mcVALF5M4RSZvicSg1zN9qm0A=; b=Ts5UmPxALkmbewLbCCpRBWhKMhyDG8q3VsXyiKrd0C0V6KacY0ZNzFQBNpDESF6o6v BAmRSjZgEeiSTCUvVIloRXj/6XkbgJVaMDQ033Q95YaXh5k8ydgRvQTKLIStJBJpyefi z3Gyph+NoNf36SdA4v1AaXhB/2+bqO8/38a5j0RIvZbpoe9W4NLiDku8Nk7NBzUdVXEB L19XeWGG4AwTp3wHF+AgomgJkQEG3/nI6rAH0AxFwkqDnQDLOX3W7XlMqKpU3obQ4MaX ezGH1HNxFDrmZU1CAQy9YLhtCSkQTT0JjA6NBEM55/ZVNjijFFsBOsJ5yU7BE6n52q3W VMVw== X-Gm-Message-State: AOAM532SC+Bo04lZbG2qlz7PkC3/cTeNRGr27LqcoKxPUgbi8Pjt5Ud1 kWfG78/JufAztw8XbbIp3Uq3GC9FeqLhOeAb X-Received: by 2002:a62:401:0:b029:1c3:fb36:8f55 with SMTP id 1-20020a6204010000b02901c3fb368f55mr5737251pfe.52.1612403126215; Wed, 03 Feb 2021 17:45:26 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.45.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:45:25 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 06/93] tcg/tci: Implement INDEX_op_ld16s_i32 Date: Wed, 3 Feb 2021 15:43:42 -1000 Message-Id: <20210204014509.882821-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::433; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x433.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: sw@weilnetz.de, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Stefan Weil That TCG opcode is used by debian-buster (arm64) running ffmpeg: qemu-aarch64 /usr/bin/ffmpeg -i theora.mkv theora.webm Tested-by: Alex Bennée Reviewed-by: Alex Bennée Reported-by: Alex Bennée Signed-off-by: Stefan Weil Message-Id: <20210128024814.2056958-1-sw@weilnetz.de> Signed-off-by: Richard Henderson --- tcg/tci.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index b3f9531a73..2ba97da189 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -615,7 +615,10 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, TODO(); break; case INDEX_op_ld16s_i32: - TODO(); + t0 = *tb_ptr++; + t1 = tci_read_r(regs, &tb_ptr); + t2 = tci_read_s32(&tb_ptr); + tci_write_reg(regs, t0, *(int16_t *)(t1 + t2)); break; case INDEX_op_ld_i32: t0 = *tb_ptr++; From patchwork Thu Feb 4 01:43:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376148 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp833749jah; Wed, 3 Feb 2021 17:53:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJz5O2pKYGFvORq2MjSbYR5gdURZuWUBdR1nTmKvd+sMouk7NSLijyYi+18M8zC5bZCpJbA8 X-Received: by 2002:a25:f07:: with SMTP id 7mr8746756ybp.399.1612403581887; Wed, 03 Feb 2021 17:53:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612403581; cv=none; d=google.com; s=arc-20160816; b=vOJOyUfeg9AKrU9xIMkVJCS4Qu834rSSqDJp6stFblia6IXstbGv8cFbpbNxT+Gur1 a+HpgA4eJFH6+uAjfYAX94ZnP3B7JqJ77IHEdFQwU1dCR4jsQ/qOA+Cl4Lzba4wO3hYI LrCgJiXCVlojnm0apeOlSvY+kwSLUpMi0ZsrFDA8RM+H9eJd7kPLMyZHpsx0UUE3+q1d O7WhsFEWZP9OePqlL0q/Xqdc3x0wfdYgvB901qKaDcqpWjq0OSLSARwwml1wD9BSCffs dpcZ8vYKYOP6iHyvQnMLUwnwQfKPExz4CCNZxJEf9njvSXZxoCPBci6PT8lqzSFPHELj E56w== 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=tnzvFG8Gmy7YN7i7Jw+CtzTgCAPtOrT7NLuSzhM8paA=; b=Rb9rBqQyQW6lzvsBDugdMlV5doX3QjUffUkgzDWEW6Vps7B/q//GtXPl+e7e+6X5i9 tUuqsin39DSBJGGMoxxFsgCIzuDzbJT16/dl+YX3iyDUw44yZDzTgyEdxbVN6tOuezts p4Eq43P+yf0Cnp2lB6GHEn7G478f1+pHZZnBAmV1KBMy//LgXnKvHTlxm5B/itjwkr2o Z7lDKGtfEvwGC1rcuNQPa/9eNiiQI8i1zbS9uke6qE1Wj2jzgBdpOUtVt/ZyzlQg1OBa s7anuOmJgQtNNj2CxzTPZqi5aASuxf8OKtlSTJhCRHqthNDl0OlKdkIUGK14pF4rCIzu Kd9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SQxCuMS0; 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 e65si4542651ybh.476.2021.02.03.17.53.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 17:53:01 -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=SQxCuMS0; 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]:47382 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7TpN-0003w4-Dd for patch@linaro.org; Wed, 03 Feb 2021 20:53:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44206) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Ti8-0004cb-7Q for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:45:35 -0500 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]:41213) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Ti6-0003ao-2b for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:45:31 -0500 Received: by mail-pf1-x435.google.com with SMTP id q20so1061410pfu.8 for ; Wed, 03 Feb 2021 17:45:28 -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=tnzvFG8Gmy7YN7i7Jw+CtzTgCAPtOrT7NLuSzhM8paA=; b=SQxCuMS0LF4ER8qQ5oRHJTfQUI1Cy4UYlY1W6qUVQUhQS8nG3TS+zJg8BaZtPv6xTu iWR0Q+DMzbPPdp55xFxnA3WNJablkmj4T9XdxdHutzeelq2vznmG7wLl1HE6xpug5XDZ pZi21GDypetOyKTA6+3OO6KlaCSw/nxDEr0/jmMgwy1M64reuD29JeNqme3fbBSMM3Ic zu8MaMYlzcyAPm90uCXCdl+hElkGyePAWbIYV8ZNAnJW4MCotTE2gf6R89hFqmHaZEuA ktu6733i5oXHs2N2KIMyqzhaTpHA2ji8YyDb1zsXTQhIKGIeyQTfHzMFzGj777DE4zQm 5C0A== 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=tnzvFG8Gmy7YN7i7Jw+CtzTgCAPtOrT7NLuSzhM8paA=; b=t1TBNyH57TH1Js/LAFerUbpWV4IMM3+yJPnMfBQXLxGpu4PhJFrBtgmoZUoSlrR+2y jhB1i8R/Bb27EHatdzlqVOA5Uq5DW1jwC7YZkxLQoMsycNsksfhf/PFg3cefxaJ27ApS w5qWdhHvtgJIkpapCcNlA/D9YFDu0oAxB7AQicPMY8qw2D6PZCfwSRK3034Rcq/Tt64y kAv2VtYRN2jAWJ2Z5vIhCAZBZeuwWsqdMkbTRzb2H+RmLGp3l73PnwKqnkY4LDQLlprt Tp7ndsKO0FZRI4tVoIy0vgJxge+xLXizUjNcFCF7BS8zZL7pJwXfiS9A2jo340l9VdOX VbOQ== X-Gm-Message-State: AOAM533yxaLtKR6CoO29zDicBqz913VuGlc+vpXPsBNcUii4E/n6Sjok stenhlq0Xetjt6d+9xIee67Zr2TlzORbByd1 X-Received: by 2002:a62:ac06:0:b029:1cb:35bc:5e2c with SMTP id v6-20020a62ac060000b02901cb35bc5e2cmr5690416pfe.42.1612403128026; Wed, 03 Feb 2021 17:45:28 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.45.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:45:27 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 07/93] tcg/tci: Implement INDEX_op_ld8s_i64 Date: Wed, 3 Feb 2021 15:43:43 -1000 Message-Id: <20210204014509.882821-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::435; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x435.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: sw@weilnetz.de, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Stefan Weil That TCG opcode is used by debian-buster (arm64) running ffmpeg: qemu-aarch64 /usr/bin/ffmpeg -i theora.mkv theora.webm Tested-by: Alex Bennée Reviewed-by: Alex Bennée Reported-by: Alex Bennée Signed-off-by: Stefan Weil Message-Id: <20210128020425.2055454-1-sw@weilnetz.de> Signed-off-by: Richard Henderson --- tcg/tci.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index 2ba97da189..c3a8511dfe 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -883,7 +883,10 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, tci_write_reg8(regs, t0, *(uint8_t *)(t1 + t2)); break; case INDEX_op_ld8s_i64: - TODO(); + t0 = *tb_ptr++; + t1 = tci_read_r(regs, &tb_ptr); + t2 = tci_read_s32(&tb_ptr); + tci_write_reg(regs, t0, *(int8_t *)(t1 + t2)); break; case INDEX_op_ld16u_i64: t0 = *tb_ptr++; From patchwork Thu Feb 4 01:43:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376154 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp835919jah; Wed, 3 Feb 2021 17:56:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJy1RqQpUBMY2IghzHzAvVnffnUkAad5fgNcuGPWf9HAiENpidzflABvrEuL/loCcbO4lYxU X-Received: by 2002:a25:3d81:: with SMTP id k123mr8139407yba.430.1612403798659; Wed, 03 Feb 2021 17:56:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612403798; cv=none; d=google.com; s=arc-20160816; b=mvCuFLJsI3RhQq60eyeNMuK7gK+ZG4Y2l+y2LJ/hIq5FLTYxMDIWlM2//glskSdeV5 h2DFy0aC+sf2+lXf8XDNLwML06YzmUnFEkbV+j+V10RzIUWK1+nmrB7mF2Te5psQ2s7m f+/GQRuJtduxtS59bIXd4e41DJUWLnwSajpMHH7anYnoNnYHUlXQ2BdHRT6xBCAhxRIN 6oBk6xg7TCMgxGLj0uWb66CzKXHe4XCvwm6EHA9EM3rM5mT/g2tAg0LzI7TblAlPeM9b e4E2ckrh+KQNSjADI3Ej6iahtDZbcPlpJxm8mlkUnq7M6nsFt/LZP7CDQzbA2wXJn/gY t3kw== 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=Tquh43lruzGWRcmOiBMYX1Wiqh+FHEpp7zn+YOCAYms=; b=NGVVwjVnVwQwU0PM6K4UjNjKVSjZhgrKxGxaNsByDXA5o3qPeHVCzz/Zpr68geeu3S beo0uVkOrdQIAk0F7JAdG278HnEwZhAN/7zBkzb6i9m3rh5LoQ3IdbZmL187wQFVcV2P 0ncxMwaB3HGQl34eknVZ6GD45ep78tizikPwGJOVGGsSWQMNs6eeCKlkuoo6SmXOUyVV 1v7JS+1XB0SZyImtJbouzP83JF5Ceh/L+b/4rA/TNbSBgrDFgyswpJVRCHutVUh9IsWH e3iYcMedDGo11pU9Bkp2x+u57yUoUv8dpEI9B/ChxvPSch734ftTxYE1xLjKh5Ywp723 XL0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Q7YCG5gB; 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 g205si3479405ybg.317.2021.02.03.17.56.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 17:56:38 -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=Q7YCG5gB; 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]:58936 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7Tsq-0000LX-AJ for patch@linaro.org; Wed, 03 Feb 2021 20:56:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44212) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Ti9-0004cf-ED for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:45:35 -0500 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]:40778) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Ti7-0003bR-8Z for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:45:33 -0500 Received: by mail-pf1-x435.google.com with SMTP id i63so1067624pfg.7 for ; Wed, 03 Feb 2021 17:45:30 -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=Tquh43lruzGWRcmOiBMYX1Wiqh+FHEpp7zn+YOCAYms=; b=Q7YCG5gBBR5dAENACZmZOp7ONIuHDlbayAnxtx6eFqMp9PaKBu+A9BpZuWWD4tm5Xk 6Oesllt3amJOwSlKjvXYL8mGBv/rKLqW/M12ovQxJ8dVtmwPCBqVzbDBet95y3t1i0mT wgW9QDIfAYPZI9pODbb/WPo1B5A3m900957ncFYf7a5+M7/tR6MCv7pmyMswuGzpI2V3 NwO4HLimCcKZ5ofNGmol34hNiv/nHtKxNvesjWylOm2zyIjQda/imjtDnNEWkyXcoMC0 e658QHjiPlBBrTLQiwaRe704aNr/7n9VJ+oqEcXARSalP3TaqU/6xzpa+t2mJx931NZO T73A== 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=Tquh43lruzGWRcmOiBMYX1Wiqh+FHEpp7zn+YOCAYms=; b=VkLJetjMdO4+upL8F0pA79jrB/WDwTvRBxt/xfr4Z16EkuI43TdbhvmRKgXNuw9irB ArBuWuNSFAn4ebq+Te1Q6kJ+PVBgPVrlOIk85gY1lr5/TG6gLXu2jaZ5TlKsg5eIjcDM xKGgWyx5cBMMb1i4vz2AlOZmUdJ1kw0hnnwb3VE70zLKeV6sz9bRIkgpK4xvhqWvA2T1 nUqtXNKRNH5A4zZgYaeq3FAlG6V0zlCBSy0GdWqlmB0w0X/FUNZNgR0cv261aphUWzVp ES81TeaOy8e0vrc3cOLznUduZI+FuK6jyjq/11I5/FE81CktyKwaPp+ZdXhBCX7xz0jf rIAA== X-Gm-Message-State: AOAM533QDbyk+ZXKhIrzLobxczlqjLAMzu/4hko9kJWKHR2pVzljzvZr 4ntB7/35HN5orP8GYCrHCaI1e5s+b4qxz2x3 X-Received: by 2002:aa7:8bc3:0:b029:1ba:7a2:7720 with SMTP id s3-20020aa78bc30000b02901ba07a27720mr5798186pfd.3.1612403129958; Wed, 03 Feb 2021 17:45:29 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.45.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:45:29 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 08/93] tcg/tci: Inline tci_write_reg32s into the only caller Date: Wed, 3 Feb 2021 15:43:44 -1000 Message-Id: <20210204014509.882821-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::435; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x435.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: sw@weilnetz.de, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Tested-by: Alex Bennée Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/tci.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index c3a8511dfe..e8023b5384 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -117,14 +117,6 @@ tci_write_reg(tcg_target_ulong *regs, TCGReg index, tcg_target_ulong value) regs[index] = value; } -#if TCG_TARGET_REG_BITS == 64 -static void -tci_write_reg32s(tcg_target_ulong *regs, TCGReg index, int32_t value) -{ - tci_write_reg(regs, index, value); -} -#endif - static void tci_write_reg8(tcg_target_ulong *regs, TCGReg index, uint8_t value) { tci_write_reg(regs, index, value); @@ -907,7 +899,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t0 = *tb_ptr++; t1 = tci_read_r(regs, &tb_ptr); t2 = tci_read_s32(&tb_ptr); - tci_write_reg32s(regs, t0, *(int32_t *)(t1 + t2)); + tci_write_reg(regs, t0, *(int32_t *)(t1 + t2)); break; case INDEX_op_ld_i64: t0 = *tb_ptr++; From patchwork Thu Feb 4 01:43: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: 376153 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp834901jah; Wed, 3 Feb 2021 17:54:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJyelc/7LoByh/q968ZfTkKW+TrJfSzK+zaxNM9V62Csvf+gBMonPxenMBBBHXdAEIngDNJF X-Received: by 2002:a25:2693:: with SMTP id m141mr8863810ybm.104.1612403696788; Wed, 03 Feb 2021 17:54:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612403696; cv=none; d=google.com; s=arc-20160816; b=GJ7fP1r+c+eNDy0sVnb6SQ1EqvH+gTAWdBueTX3Qjn1IYymSXST+gcyVwo2cFRh+Zn I5GAkKReq5Cc7tovofLt9sZwA7LeSIKgZ7wH18KWEALSFjTLnObRYHg08i/6m0+19lfb /1VTr2aZmlVmKJuCXujIHxA8Hk9K8sPMfyGcvC3qZkDi2Q0XzKAICqmwpmU0grFMQwvq a28Ye3U45iBK0EKckPqUEjSvdttD0oDjwMLYH4npBZzsEbx1gTjQQ1QyqVF+PBRWp4gy aCyeN97CAu0JQAjO+WDqfhLWsl1sd9qkOMvDbyFa0lJPycL2sDoysefufqz1A9UugRN9 rujQ== 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=Md45LaRHqD6ZCRI/YVUcF8sf7nVG5D4Ru9kLS7nSJTY=; b=mowHGWeGMiY1DZ+oWn89y8/4xPy4tOTTR10QzkOcy0AjxNXoklohuF6NqWMx6CQa6X Rk+0FxdFIuFmyeVyNU0E29mTYCTrCrp0Zmrx0R9gbydfpkHKvsg/v6dL9pi6fI8FPmts AwZuk0gI0xam4L5q6s1hGuDwCwrRpO9fCKroqctLNDUaor6qU4oUoSug+zcy+dot3hbm NGYo7TqfBh+1JrNeD7RRBkhAMZFJAzQscsKtvCh4Jc+NbSYMo++yLN8YyzrliqS/oxQW 51g1s5FKr7hCBoCf3Xhn4vWKmOeNF2csz3tS9wl32q6skoSVIvfPMF2fRP3hBZcWJUEC c5kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aXD9l4pg; 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 e128si3711612ybe.422.2021.02.03.17.54.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 17:54:56 -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=aXD9l4pg; 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]:55902 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7TrE-0007Oq-8I for patch@linaro.org; Wed, 03 Feb 2021 20:54:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44240) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7TiD-0004eG-RZ for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:45:41 -0500 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]:37449) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Ti9-0003cr-5y for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:45:37 -0500 Received: by mail-pj1-x102f.google.com with SMTP id g15so826703pjd.2 for ; Wed, 03 Feb 2021 17:45:32 -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=Md45LaRHqD6ZCRI/YVUcF8sf7nVG5D4Ru9kLS7nSJTY=; b=aXD9l4pgMwIO/k7i+7Ytk+UunDqxo/ZQ8zY9fAtkgD8DJamUS3gp6xMsY0fwL2ePI1 ZMOJUmYzQ3pzn/JPAvpNpIaIAzZ54zRisoss6tgQ7BL+lktGhLpZRQ8vpC+2Pc2/JjqK dC/S/ai0VI3UV8iOWMCzDMcwFv7DcLPQKXljpWB6fQqtUQWo/aDh42jPbWDlSrJtqqvq ZmHtwE2srZ/TDkLvT/nw8ok1mHl5uUGQPd9/G46bAHeDytJfy9u1yLiJVwDt83nSpnRv duMM9Odckdi8ATYFARV9bmzKS2+S4Mi4I53cd+vcaqOfw2RN4nDf4/2k8tlWpB8/JjyC kznA== 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=Md45LaRHqD6ZCRI/YVUcF8sf7nVG5D4Ru9kLS7nSJTY=; b=DmsfCEoZXVv7fNWdT8VQJg3IF2xBsLavONLjIO56SaIw2YKBEoDgDFcbT3f/AbcKHX KRR66YtgytD7HShBJQAjwN6tUiipkMKCE99EHT6LQGSEgltxQ/7btM/BzW796TEmp0yq xXdPHw1qNG6wlfujm+peWuTUjBY9K6HKbvgKa2LfPZQ2QXm9ICg7aZFIfo8yC2qIsv0L 3EEmC7hNlWNMQRgnx1wXz9DYjB26fN8xyfypq+gZAQZYt0R6smW1GKWN70Oz8oEp2Dj7 89OxHhanhY+it0rUq5N+JkM8iOeQJ97oVWbxNF2+Z4xQJXxnm/vn6dIb+fasbAJLLA/m 0f7Q== X-Gm-Message-State: AOAM530bcFNSIJqVpOsgakGkdCGkkkfORslW2v9FunnHTPSj+H+847SW /eGedQmdvguLuoCZFoRVuZe2Mh0iPh30dN2R X-Received: by 2002:a17:903:31d1:b029:de:8361:739b with SMTP id v17-20020a17090331d1b02900de8361739bmr5733316ple.85.1612403131584; Wed, 03 Feb 2021 17:45:31 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.45.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:45:30 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 09/93] tcg/tci: Inline tci_write_reg8 into its callers Date: Wed, 3 Feb 2021 15:43:45 -1000 Message-Id: <20210204014509.882821-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102f; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102f.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: sw@weilnetz.de, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Tested-by: Alex Bennée Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/tci.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index e8023b5384..740244cc54 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -117,11 +117,6 @@ tci_write_reg(tcg_target_ulong *regs, TCGReg index, tcg_target_ulong value) regs[index] = value; } -static void tci_write_reg8(tcg_target_ulong *regs, TCGReg index, uint8_t value) -{ - tci_write_reg(regs, index, value); -} - #if TCG_TARGET_REG_BITS == 64 static void tci_write_reg16(tcg_target_ulong *regs, TCGReg index, uint16_t value) @@ -598,7 +593,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t0 = *tb_ptr++; t1 = tci_read_r(regs, &tb_ptr); t2 = tci_read_s32(&tb_ptr); - tci_write_reg8(regs, t0, *(uint8_t *)(t1 + t2)); + tci_write_reg(regs, t0, *(uint8_t *)(t1 + t2)); break; case INDEX_op_ld8s_i32: TODO(); @@ -872,7 +867,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t0 = *tb_ptr++; t1 = tci_read_r(regs, &tb_ptr); t2 = tci_read_s32(&tb_ptr); - tci_write_reg8(regs, t0, *(uint8_t *)(t1 + t2)); + tci_write_reg(regs, t0, *(uint8_t *)(t1 + t2)); break; case INDEX_op_ld8s_i64: t0 = *tb_ptr++; From patchwork Thu Feb 4 01:43:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376147 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp833460jah; Wed, 3 Feb 2021 17:52:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJxg4BEp3w4zaV2TJMsZ3YouzxPjyue856OOVE6Rftkr4oqpf/PaT7wbeVRf1vYDf/VwyxFp X-Received: by 2002:a25:1182:: with SMTP id 124mr8140358ybr.154.1612403548235; Wed, 03 Feb 2021 17:52:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612403548; cv=none; d=google.com; s=arc-20160816; b=O01iICd+w7sEPZ30cLicjhrOnv3XPNW+y26RVJV+crmgWUjw527yIHQ5whGCRiz//v zsc3ROADJfnPbQAJLuOe1gNZCexf7jcYOy9bVhPJ+ITSe8ja4i3CsBzf7Zo+Kaa0JprY J76/QaoAOO6qIwtFwGBG8/vrE5iaXstQCKs8xDlhxl2HkyHL7qelUa7+g043Ml/3wouP glOg+wcFMCbUMXxanxtMx4KxaaIE0Jh2kpRs7j+4amgXe00/r0htG4G8CKg0FA5er0em nHOoznv6lVPMuTBKTOMZEJm4AVJ3y2JzGxef1RMssMXczc+1ass9mkyHTdBvc1rsbFjt yXJg== 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=nVyouWDBw9IpYjnxIdxk6Lk2rEB7Cry5s6L8ndOAdHg=; b=lUcwjS9LjUcN8xncvJLb9qC1D6WfDMI0tf6Lrw0nKb9cztTHgbbwbaBVLOhcaGMzcf UnahPgiZttT2JKJxULzoa6+S1qzRWiYj4YkcBDG0dl3FwD76OBKU3jLytEwMQBH/T/PE gjpsRs4MtzXcnC8xLf4VbunbTichBoprei4WAFfyXFKG6kK9sBSO5JlG/Zs/M7GWfynB ZLbJGDOkW2G/ywofpCvErVFU0hysr1PZ3MgMQYgfKYt9m8lhSiZzxqzoFPN0HrpA3L/H aO+zLU1d7vsAeFvnySiTJkQ0jn9rvpacz/D1WD0L9Y34EsNTI6cKtzHp6WTldMoT/EzE AkVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NdoYMnjH; 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 f7si3667812ybb.37.2021.02.03.17.52.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 17:52:28 -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=NdoYMnjH; 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]:47020 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7Top-0003mY-Nr for patch@linaro.org; Wed, 03 Feb 2021 20:52:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44270) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7TiF-0004fg-RL for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:45:45 -0500 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]:42495) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7TiB-0003f7-Jh for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:45:39 -0500 Received: by mail-pl1-x634.google.com with SMTP id s15so877782plr.9 for ; Wed, 03 Feb 2021 17:45:34 -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=nVyouWDBw9IpYjnxIdxk6Lk2rEB7Cry5s6L8ndOAdHg=; b=NdoYMnjHmyQvM+j4L13WrO6BPZBj853ioYhDZGgZwFbt2clZ1HfMQQJ34JLljDJdJP 0CVJq83vxIS1kxftApmKxnkpxgobCc6FO1DKygYaELvcNrIy3cKyX42st+AgZGAmHnub JsYmBDshCn29rBwvRklehCBP5kSYJMmWaAXOq/1gc6Lxm+t/IB0eX64X0hEkmNL0Y9MJ wv531LFWGgZtBAr2fpvCxCLr7/8rvMbtcjj2n3fahcrPd8GvuaUUdM3rg3UMFN1GqSSf E8WYapmRc6qduRWQ/ux+f13XeYZXYqBMqdGctMQNn9B+XCcylzP1h+ECOopPzVc101NI C9OQ== 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=nVyouWDBw9IpYjnxIdxk6Lk2rEB7Cry5s6L8ndOAdHg=; b=NWJjHSlDmL4a0heDeMxhq9v+jW5Xbz/6nW1WGn8TOrsoVdWrd0kQ+HLpqp/aI27ul8 ovfg/gYMUFknXbyk0DrqI/npS5RPSVVtaLG44s/A6tIUgT3RPblIP4IMDKrVVdv5E62/ B3yGCFIPma8auLcfa9EHnOZRAJS9ufE20/ICjDV0UskIA0vR3Iw98yTibLTygMo6+VdA qNNaLbm4+4pVQn7EaKxMlGpH9hiXElaJcVTBoUCe/LuqohB2zG+RPj2+GVcqnPs8OvsH 0DnP9yknVthiIEf9pWaA9F+A9iUUnoOO7PuJA7NteCUgJn7RF6pTao/yomhrwTZw5sz1 qsVA== X-Gm-Message-State: AOAM5337r5lQy4T4VIa7OdaVCSnLvK8tJei46cRG1VDUQ3f4TA6bw7d5 wYEKfPOKZQoOejGVA2NQV+eAW5/LsXUjzeti X-Received: by 2002:a17:902:70c3:b029:de:af88:f17e with SMTP id l3-20020a17090270c3b02900deaf88f17emr5771636plt.3.1612403133363; Wed, 03 Feb 2021 17:45:33 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.45.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:45:32 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 10/93] tcg/tci: Inline tci_write_reg16 into the only caller Date: Wed, 3 Feb 2021 15:43:46 -1000 Message-Id: <20210204014509.882821-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x634.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: sw@weilnetz.de, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Tested-by: Alex Bennée Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/tci.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index 740244cc54..005d2946c4 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -117,14 +117,6 @@ tci_write_reg(tcg_target_ulong *regs, TCGReg index, tcg_target_ulong value) regs[index] = value; } -#if TCG_TARGET_REG_BITS == 64 -static void -tci_write_reg16(tcg_target_ulong *regs, TCGReg index, uint16_t value) -{ - tci_write_reg(regs, index, value); -} -#endif - static void tci_write_reg32(tcg_target_ulong *regs, TCGReg index, uint32_t value) { @@ -879,7 +871,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t0 = *tb_ptr++; t1 = tci_read_r(regs, &tb_ptr); t2 = tci_read_s32(&tb_ptr); - tci_write_reg16(regs, t0, *(uint16_t *)(t1 + t2)); + tci_write_reg(regs, t0, *(uint16_t *)(t1 + t2)); break; case INDEX_op_ld16s_i64: TODO(); From patchwork Thu Feb 4 01:43:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376150 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp834747jah; Wed, 3 Feb 2021 17:54:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJxWFsIRwMz1TB5Cxa4Z/N53mFD3wfeeBKi6sXemWCKLCE/UajIiEbR5gbmPyvNzYXKF08tK X-Received: by 2002:a05:6902:102d:: with SMTP id x13mr8456830ybt.264.1612403685233; Wed, 03 Feb 2021 17:54:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612403685; cv=none; d=google.com; s=arc-20160816; b=WUAWnFi0mKWt1MWcQAOXzSLWE/NsSarCm5iuQmPM8BjSRxF9jZc/id6z3xsEaKGQm3 mOSvaELHvCl4dr+iC77jfxnVEYmYatyOH0J5wxI/kUBxeTS4yR0Z9n+5BRqAF/yl3vfP aBt8lCQYtsuoF1mKuZXmzpNeTG/wTdNzT3nzgGIUCGoP7IbImziKhMwZGSp2FBTEMfyC 4odS4ePwAtXLXgjgorMZGlYQ4VgB2DM24HjggHRxyuY4jtKQnrh4Bq+Eu7apPMe5U3/y chKzRs6aZOUnIqVW1lEMAn4yUOto7ZDQfgAZ5JqTLWkbvMQJc1/ggvOpHCW+s6HOF0+7 tU4A== 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=WvF+amzq1Ily9oj+9g5vZaVj1S2ujChoxYC/fno/cGA=; b=TZ42nHod0+PwB2Hx93E3xaUCvhT8zaGLTA/V/0eVebtM45pNXw1SHgwiTf7uO8Bh8/ C17TUAzDk8nyJgQoSldiqQnxVlRsLC0+NoHUB7tGh7bliq+SxtkNpkuEslmpULxj7EFB jdZ59lGdvZ/B5um+uG3IbPeMqa56R6YkqzTovrRoyIR72YIFAL8ioh1BFH10BKYSqYs+ Hq0ABiYqVhSD6+pVhXGEOq+xRxLxzvHCBfsLICEULRHrzq8iEGF2fDXKqyf/pzWtgWpm Qv6z6qp3LEABHa6evA7zZWnJq81zyPcBaNcVytiCQtwGNZ/+PVgrdvN0i/FYVOtPpTAS dbBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VefMLW0R; 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 f8si4681119ybm.306.2021.02.03.17.54.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 17:54:45 -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=VefMLW0R; 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]:55622 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7Tr2-0007Hv-Nq for patch@linaro.org; Wed, 03 Feb 2021 20:54:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44284) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7TiH-0004g6-Et for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:45:45 -0500 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]:34559) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7TiC-0003gN-Sw for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:45:41 -0500 Received: by mail-pl1-x62c.google.com with SMTP id u15so903537plf.1 for ; Wed, 03 Feb 2021 17:45:36 -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=WvF+amzq1Ily9oj+9g5vZaVj1S2ujChoxYC/fno/cGA=; b=VefMLW0RzdlXgxXLhstmgppJN7lToGqgdjD63svg2OleeE7WJWwYht90Yqm36wPqbC FkI/GGW8DPAtGW/r3bfeN2XupMmB9aQr/p6zv9KtD9uPp/2fd20//IwsOnJZ3dgi7oMx HFkiYaumOLRpBvZAt9YaXnTYsH9dlSE9a3oO+GldDKtxlV3lAQyUEA0ktdFhH3V9KOmM 4KxPYK/A5MAJ/DQNerYzkw0m36S6HJ5B06TZ0kYfb6/egRXywBaayUpfIav0vIkdufYX 7l1r93N8AIvkf3fnMIVadNUzCLeE9XSjZVcpLsIjTsdx7OzWc8Iff+Ci/VP24bZXuUw0 ubrA== 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=WvF+amzq1Ily9oj+9g5vZaVj1S2ujChoxYC/fno/cGA=; b=BdJpI/jqx6aJWKT0KCublf1mc8EBpCsFi8FebmDuKbR8ogTzLtVSoGbEvbOdynEksu x1yijUljtp40CqJh406PF9oMmJw5/PGV1gCOKH3fS4T0LBxczxuUjRCvztc6mJKf9i2t VlTUld6Tipt99GPhTAqbgax2RdnTYLUg761QUFDxAs16ko68bDmuDXw5kZ9JoE4+RR+e 34SKbVbjFpMNb8HonM1jedrbCIIII6NQV7EM0y4tq+am62w0M1tAX/FqKzkepLuFpzqL PUQ/ef/6kmmNYnU+b5yc1N854O0DoZZ61my4Tg5n/XihXY5ghMgAzfKbIxXX7Ze7++hn Ysgw== X-Gm-Message-State: AOAM533AWbp6ocIOJb7v1InrYQva3BdBfM6Tq/nKP550TtmwgRvQyIdd vR5hnVTvFyCR6beP92WowSJDtb8my/dzgv/B X-Received: by 2002:a17:902:ce8b:b029:e2:9905:db5a with SMTP id f11-20020a170902ce8bb02900e29905db5amr2598380plg.77.1612403135156; Wed, 03 Feb 2021 17:45:35 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.45.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:45:34 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 11/93] tcg/tci: Inline tci_write_reg32 into all callers Date: Wed, 3 Feb 2021 15:43:47 -1000 Message-Id: <20210204014509.882821-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-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: , Cc: sw@weilnetz.de, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" For a 64-bit TCI, the upper bits of a 32-bit operation are undefined (much like a native ppc64 32-bit operation). It simplifies everything if we don't force-extend the result. Tested-by: Alex Bennée Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/tci.c | 66 +++++++++++++++++++++++++------------------------------ 1 file changed, 30 insertions(+), 36 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index 005d2946c4..39ad00663f 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -117,12 +117,6 @@ tci_write_reg(tcg_target_ulong *regs, TCGReg index, tcg_target_ulong value) regs[index] = value; } -static void -tci_write_reg32(tcg_target_ulong *regs, TCGReg index, uint32_t value) -{ - tci_write_reg(regs, index, value); -} - #if TCG_TARGET_REG_BITS == 32 static void tci_write_reg64(tcg_target_ulong *regs, uint32_t high_index, uint32_t low_index, uint64_t value) @@ -549,7 +543,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t1 = tci_read_r32(regs, &tb_ptr); t2 = tci_read_ri32(regs, &tb_ptr); condition = *tb_ptr++; - tci_write_reg32(regs, t0, tci_compare32(t1, t2, condition)); + tci_write_reg(regs, t0, tci_compare32(t1, t2, condition)); break; #if TCG_TARGET_REG_BITS == 32 case INDEX_op_setcond2_i32: @@ -557,7 +551,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, tmp64 = tci_read_r64(regs, &tb_ptr); v64 = tci_read_ri64(regs, &tb_ptr); condition = *tb_ptr++; - tci_write_reg32(regs, t0, tci_compare64(tmp64, v64, condition)); + tci_write_reg(regs, t0, tci_compare64(tmp64, v64, condition)); break; #elif TCG_TARGET_REG_BITS == 64 case INDEX_op_setcond_i64: @@ -571,12 +565,12 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_mov_i32: t0 = *tb_ptr++; t1 = tci_read_r32(regs, &tb_ptr); - tci_write_reg32(regs, t0, t1); + tci_write_reg(regs, t0, t1); break; case INDEX_op_tci_movi_i32: t0 = *tb_ptr++; t1 = tci_read_i32(&tb_ptr); - tci_write_reg32(regs, t0, t1); + tci_write_reg(regs, t0, t1); break; /* Load/store operations (32 bit). */ @@ -603,7 +597,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t0 = *tb_ptr++; t1 = tci_read_r(regs, &tb_ptr); t2 = tci_read_s32(&tb_ptr); - tci_write_reg32(regs, t0, *(uint32_t *)(t1 + t2)); + tci_write_reg(regs, t0, *(uint32_t *)(t1 + t2)); break; case INDEX_op_st8_i32: t0 = tci_read_r8(regs, &tb_ptr); @@ -631,44 +625,44 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t0 = *tb_ptr++; t1 = tci_read_ri32(regs, &tb_ptr); t2 = tci_read_ri32(regs, &tb_ptr); - tci_write_reg32(regs, t0, t1 + t2); + tci_write_reg(regs, t0, t1 + t2); break; case INDEX_op_sub_i32: t0 = *tb_ptr++; t1 = tci_read_ri32(regs, &tb_ptr); t2 = tci_read_ri32(regs, &tb_ptr); - tci_write_reg32(regs, t0, t1 - t2); + tci_write_reg(regs, t0, t1 - t2); break; case INDEX_op_mul_i32: t0 = *tb_ptr++; t1 = tci_read_ri32(regs, &tb_ptr); t2 = tci_read_ri32(regs, &tb_ptr); - tci_write_reg32(regs, t0, t1 * t2); + tci_write_reg(regs, t0, t1 * t2); break; #if TCG_TARGET_HAS_div_i32 case INDEX_op_div_i32: t0 = *tb_ptr++; t1 = tci_read_ri32(regs, &tb_ptr); t2 = tci_read_ri32(regs, &tb_ptr); - tci_write_reg32(regs, t0, (int32_t)t1 / (int32_t)t2); + tci_write_reg(regs, t0, (int32_t)t1 / (int32_t)t2); break; case INDEX_op_divu_i32: t0 = *tb_ptr++; t1 = tci_read_ri32(regs, &tb_ptr); t2 = tci_read_ri32(regs, &tb_ptr); - tci_write_reg32(regs, t0, t1 / t2); + tci_write_reg(regs, t0, t1 / t2); break; case INDEX_op_rem_i32: t0 = *tb_ptr++; t1 = tci_read_ri32(regs, &tb_ptr); t2 = tci_read_ri32(regs, &tb_ptr); - tci_write_reg32(regs, t0, (int32_t)t1 % (int32_t)t2); + tci_write_reg(regs, t0, (int32_t)t1 % (int32_t)t2); break; case INDEX_op_remu_i32: t0 = *tb_ptr++; t1 = tci_read_ri32(regs, &tb_ptr); t2 = tci_read_ri32(regs, &tb_ptr); - tci_write_reg32(regs, t0, t1 % t2); + tci_write_reg(regs, t0, t1 % t2); break; #elif TCG_TARGET_HAS_div2_i32 case INDEX_op_div2_i32: @@ -680,19 +674,19 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t0 = *tb_ptr++; t1 = tci_read_ri32(regs, &tb_ptr); t2 = tci_read_ri32(regs, &tb_ptr); - tci_write_reg32(regs, t0, t1 & t2); + tci_write_reg(regs, t0, t1 & t2); break; case INDEX_op_or_i32: t0 = *tb_ptr++; t1 = tci_read_ri32(regs, &tb_ptr); t2 = tci_read_ri32(regs, &tb_ptr); - tci_write_reg32(regs, t0, t1 | t2); + tci_write_reg(regs, t0, t1 | t2); break; case INDEX_op_xor_i32: t0 = *tb_ptr++; t1 = tci_read_ri32(regs, &tb_ptr); t2 = tci_read_ri32(regs, &tb_ptr); - tci_write_reg32(regs, t0, t1 ^ t2); + tci_write_reg(regs, t0, t1 ^ t2); break; /* Shift/rotate operations (32 bit). */ @@ -701,32 +695,32 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t0 = *tb_ptr++; t1 = tci_read_ri32(regs, &tb_ptr); t2 = tci_read_ri32(regs, &tb_ptr); - tci_write_reg32(regs, t0, t1 << (t2 & 31)); + tci_write_reg(regs, t0, t1 << (t2 & 31)); break; case INDEX_op_shr_i32: t0 = *tb_ptr++; t1 = tci_read_ri32(regs, &tb_ptr); t2 = tci_read_ri32(regs, &tb_ptr); - tci_write_reg32(regs, t0, t1 >> (t2 & 31)); + tci_write_reg(regs, t0, t1 >> (t2 & 31)); break; case INDEX_op_sar_i32: t0 = *tb_ptr++; t1 = tci_read_ri32(regs, &tb_ptr); t2 = tci_read_ri32(regs, &tb_ptr); - tci_write_reg32(regs, t0, ((int32_t)t1 >> (t2 & 31))); + tci_write_reg(regs, t0, ((int32_t)t1 >> (t2 & 31))); break; #if TCG_TARGET_HAS_rot_i32 case INDEX_op_rotl_i32: t0 = *tb_ptr++; t1 = tci_read_ri32(regs, &tb_ptr); t2 = tci_read_ri32(regs, &tb_ptr); - tci_write_reg32(regs, t0, rol32(t1, t2 & 31)); + tci_write_reg(regs, t0, rol32(t1, t2 & 31)); break; case INDEX_op_rotr_i32: t0 = *tb_ptr++; t1 = tci_read_ri32(regs, &tb_ptr); t2 = tci_read_ri32(regs, &tb_ptr); - tci_write_reg32(regs, t0, ror32(t1, t2 & 31)); + tci_write_reg(regs, t0, ror32(t1, t2 & 31)); break; #endif #if TCG_TARGET_HAS_deposit_i32 @@ -737,7 +731,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, tmp16 = *tb_ptr++; tmp8 = *tb_ptr++; tmp32 = (((1 << tmp8) - 1) << tmp16); - tci_write_reg32(regs, t0, (t1 & ~tmp32) | ((t2 << tmp16) & tmp32)); + tci_write_reg(regs, t0, (t1 & ~tmp32) | ((t2 << tmp16) & tmp32)); break; #endif case INDEX_op_brcond_i32: @@ -789,56 +783,56 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_ext8s_i32: t0 = *tb_ptr++; t1 = tci_read_r8s(regs, &tb_ptr); - tci_write_reg32(regs, t0, t1); + tci_write_reg(regs, t0, t1); break; #endif #if TCG_TARGET_HAS_ext16s_i32 case INDEX_op_ext16s_i32: t0 = *tb_ptr++; t1 = tci_read_r16s(regs, &tb_ptr); - tci_write_reg32(regs, t0, t1); + tci_write_reg(regs, t0, t1); break; #endif #if TCG_TARGET_HAS_ext8u_i32 case INDEX_op_ext8u_i32: t0 = *tb_ptr++; t1 = tci_read_r8(regs, &tb_ptr); - tci_write_reg32(regs, t0, t1); + tci_write_reg(regs, t0, t1); break; #endif #if TCG_TARGET_HAS_ext16u_i32 case INDEX_op_ext16u_i32: t0 = *tb_ptr++; t1 = tci_read_r16(regs, &tb_ptr); - tci_write_reg32(regs, t0, t1); + tci_write_reg(regs, t0, t1); break; #endif #if TCG_TARGET_HAS_bswap16_i32 case INDEX_op_bswap16_i32: t0 = *tb_ptr++; t1 = tci_read_r16(regs, &tb_ptr); - tci_write_reg32(regs, t0, bswap16(t1)); + tci_write_reg(regs, t0, bswap16(t1)); break; #endif #if TCG_TARGET_HAS_bswap32_i32 case INDEX_op_bswap32_i32: t0 = *tb_ptr++; t1 = tci_read_r32(regs, &tb_ptr); - tci_write_reg32(regs, t0, bswap32(t1)); + tci_write_reg(regs, t0, bswap32(t1)); break; #endif #if TCG_TARGET_HAS_not_i32 case INDEX_op_not_i32: t0 = *tb_ptr++; t1 = tci_read_r32(regs, &tb_ptr); - tci_write_reg32(regs, t0, ~t1); + tci_write_reg(regs, t0, ~t1); break; #endif #if TCG_TARGET_HAS_neg_i32 case INDEX_op_neg_i32: t0 = *tb_ptr++; t1 = tci_read_r32(regs, &tb_ptr); - tci_write_reg32(regs, t0, -t1); + tci_write_reg(regs, t0, -t1); break; #endif #if TCG_TARGET_REG_BITS == 64 @@ -880,7 +874,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t0 = *tb_ptr++; t1 = tci_read_r(regs, &tb_ptr); t2 = tci_read_s32(&tb_ptr); - tci_write_reg32(regs, t0, *(uint32_t *)(t1 + t2)); + tci_write_reg(regs, t0, *(uint32_t *)(t1 + t2)); break; case INDEX_op_ld32s_i64: t0 = *tb_ptr++; From patchwork Thu Feb 4 01:43:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376144 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp832078jah; Wed, 3 Feb 2021 17:50:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJynhMR2id3u8zuhMCtMFte+HZ5JWN+iNFSkAy+EH18tnPjQZkyeMSx8pKrRkJjY74jT/Tet X-Received: by 2002:a25:244:: with SMTP id 65mr9085620ybc.511.1612403404506; Wed, 03 Feb 2021 17:50:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612403404; cv=none; d=google.com; s=arc-20160816; b=LbaatpCjmoeskg2xOZLk4Rcuct7djsaU5VYXh4JILDdp4pm+LdsHvDDiH8O1tY5J/y bqYGgLq8aq+6NlXJ2exGGu8XYCVrCiqpHFG6Tf+Kmb3JUh1Q6o3VKbwoog3EK+hzuAxI 3VtV6CBHn7EvQ6KftKXlfFNGOKmLrEK6+rlYQ0W2VZcOh4itG1XkRdkutBAHR8FHm/13 oFXOsKYcUzj4KTZW92t43iHGV93LCi1DjQtgIGVqIxbaUNNkEH8dJNOgNXKEmSRkiMLJ kjHNQXrT1CweNcjfvqXUZUGhOJY0I+Zh0R0C3j8/bT3DWhfnSXUDpzkxshZhE4TxwgsG qmkw== 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=3gzoTh/DnzHssC7cCFW1QEczWz5vWhlHn8h/Weu1Sj0=; b=cTbFHoGJUas/2rkOw8anfN55rlX2unFSkF41WqTeYOLygPU3FRbFM/ZX3+TW7vHbpm 5ySZOrqxThkHRP/yBvkjcC8AuUQe5SH438oaYypuu4x3uBH3XuH777wzkWiIOK2GlJGN q8f1LquarLDGCiOH6lZT5Pim5qGhZpitYBFp9VS9NUBDrXn0HxPKyezhEiTrIONnPTAF 6gjE+aV+40orw445qXLBUGyIxLrJkBRp1BJu4LFCiXP/m3o+ZYQLyb5XZaPwVS+kynWH hTp9Vp1Tz62EbGneSh/o5z0+RSJnGgJEQiDmjlqCq2VqTIeXx2Rliq+bUptYttQIZJi8 ps7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WXWBfUmP; 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 a3si4416519ybp.221.2021.02.03.17.50.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 17:50:04 -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=WXWBfUmP; 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]:39160 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7TmV-0000SL-V5 for patch@linaro.org; Wed, 03 Feb 2021 20:50:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44330) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7TiM-0004iJ-EK for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:45:46 -0500 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]:33832) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7TiF-0003hE-DG for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:45:46 -0500 Received: by mail-pf1-x42d.google.com with SMTP id m6so1087235pfk.1 for ; Wed, 03 Feb 2021 17:45:38 -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=3gzoTh/DnzHssC7cCFW1QEczWz5vWhlHn8h/Weu1Sj0=; b=WXWBfUmPVVByWsLl+iNeHXF0Cdpw08A7JRafkgQdq14yBdkrvSwiLHdQ5SrhKMEKfp JN/XlFJcqzynKJr49xnZpQAjkxPdUFJxzWa8qekz8J/ML+9AZOw1I0dCmCwpeqcSIlWL QVZSU4HVkmQ1OVcJjEnEGqmbJMyhY/0quWV4wDGCaQHeuz63IQnINF+SkCI9LmpQwmMj F72TAn+N4+lK020etKDkH73RU5Ia9E1WPc+3YJ+x7XzZmZV57dChUbgfD09GqR2xu8ts 7AsuehLgc2+Pntr/tWdtZe3mEzjx6xhkhevzrx8JIAAcnvMth2UXfCCX25GUjROj+144 TLSw== 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=3gzoTh/DnzHssC7cCFW1QEczWz5vWhlHn8h/Weu1Sj0=; b=J6pJTriFX0K/GaWMg4eLmU4fd5+rYa6d220ipTaGRi0Q+veOdX4ApYHCtaPyh07+st tpXDjGSss+jJQgE/9DrE1fHXk7YM6z9W4amZmQ6cWTZxOj/YLALXlxDNzWWwzXtzTaXf 8+nsnAIJZXs8dBOJi/gP81kdZVcW9/S6w+CBafZ/jV8MWbHwtmXSIfZJnBJvvHwXZxPc N4TqnuHjH5/aZcaT4y1sb+T3wTUrFVzNf+GWxnPUHY0Ssr1JQuhXaYRjtljhkoMPiRta 6vP4lAxkVN8xzCkqgwbQ7j4x8uWhxv8PfCe+XJzkK8vlO+2HXLC5kDrAQksPZVG6/ljA 8W5Q== X-Gm-Message-State: AOAM530+pxo6+SEMq4P9W/n0gRZZtLWCSFPWco01s2uXMcHqq5vhgnnY 5FPoAsIIieIon9Vu8cONHbAPx3QsBGSB5qA5 X-Received: by 2002:a62:190d:0:b029:1bd:e11c:4eff with SMTP id 13-20020a62190d0000b02901bde11c4effmr5932336pfz.22.1612403137321; Wed, 03 Feb 2021 17:45:37 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.45.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:45:36 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 12/93] tcg/tci: Inline tci_write_reg64 into 64-bit callers Date: Wed, 3 Feb 2021 15:43:48 -1000 Message-Id: <20210204014509.882821-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42d; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42d.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: sw@weilnetz.de, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Note that we had two functions of the same name: a 32-bit version which took two register numbers and a 64-bit version which was a no-op wrapper for tcg_write_reg. After this, we are left with only the 32-bit version. Tested-by: Alex Bennée Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/tci.c | 60 +++++++++++++++++++++++++------------------------------ 1 file changed, 27 insertions(+), 33 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index 39ad00663f..0f56702b93 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -124,12 +124,6 @@ static void tci_write_reg64(tcg_target_ulong *regs, uint32_t high_index, tci_write_reg(regs, low_index, value); tci_write_reg(regs, high_index, value >> 32); } -#elif TCG_TARGET_REG_BITS == 64 -static void -tci_write_reg64(tcg_target_ulong *regs, TCGReg index, uint64_t value) -{ - tci_write_reg(regs, index, value); -} #endif #if TCG_TARGET_REG_BITS == 32 @@ -559,7 +553,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t1 = tci_read_r64(regs, &tb_ptr); t2 = tci_read_ri64(regs, &tb_ptr); condition = *tb_ptr++; - tci_write_reg64(regs, t0, tci_compare64(t1, t2, condition)); + tci_write_reg(regs, t0, tci_compare64(t1, t2, condition)); break; #endif case INDEX_op_mov_i32: @@ -839,12 +833,12 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_mov_i64: t0 = *tb_ptr++; t1 = tci_read_r64(regs, &tb_ptr); - tci_write_reg64(regs, t0, t1); + tci_write_reg(regs, t0, t1); break; case INDEX_op_tci_movi_i64: t0 = *tb_ptr++; t1 = tci_read_i64(&tb_ptr); - tci_write_reg64(regs, t0, t1); + tci_write_reg(regs, t0, t1); break; /* Load/store operations (64 bit). */ @@ -886,7 +880,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t0 = *tb_ptr++; t1 = tci_read_r(regs, &tb_ptr); t2 = tci_read_s32(&tb_ptr); - tci_write_reg64(regs, t0, *(uint64_t *)(t1 + t2)); + tci_write_reg(regs, t0, *(uint64_t *)(t1 + t2)); break; case INDEX_op_st8_i64: t0 = tci_read_r8(regs, &tb_ptr); @@ -920,19 +914,19 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t0 = *tb_ptr++; t1 = tci_read_ri64(regs, &tb_ptr); t2 = tci_read_ri64(regs, &tb_ptr); - tci_write_reg64(regs, t0, t1 + t2); + tci_write_reg(regs, t0, t1 + t2); break; case INDEX_op_sub_i64: t0 = *tb_ptr++; t1 = tci_read_ri64(regs, &tb_ptr); t2 = tci_read_ri64(regs, &tb_ptr); - tci_write_reg64(regs, t0, t1 - t2); + tci_write_reg(regs, t0, t1 - t2); break; case INDEX_op_mul_i64: t0 = *tb_ptr++; t1 = tci_read_ri64(regs, &tb_ptr); t2 = tci_read_ri64(regs, &tb_ptr); - tci_write_reg64(regs, t0, t1 * t2); + tci_write_reg(regs, t0, t1 * t2); break; #if TCG_TARGET_HAS_div_i64 case INDEX_op_div_i64: @@ -951,19 +945,19 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t0 = *tb_ptr++; t1 = tci_read_ri64(regs, &tb_ptr); t2 = tci_read_ri64(regs, &tb_ptr); - tci_write_reg64(regs, t0, t1 & t2); + tci_write_reg(regs, t0, t1 & t2); break; case INDEX_op_or_i64: t0 = *tb_ptr++; t1 = tci_read_ri64(regs, &tb_ptr); t2 = tci_read_ri64(regs, &tb_ptr); - tci_write_reg64(regs, t0, t1 | t2); + tci_write_reg(regs, t0, t1 | t2); break; case INDEX_op_xor_i64: t0 = *tb_ptr++; t1 = tci_read_ri64(regs, &tb_ptr); t2 = tci_read_ri64(regs, &tb_ptr); - tci_write_reg64(regs, t0, t1 ^ t2); + tci_write_reg(regs, t0, t1 ^ t2); break; /* Shift/rotate operations (64 bit). */ @@ -972,32 +966,32 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t0 = *tb_ptr++; t1 = tci_read_ri64(regs, &tb_ptr); t2 = tci_read_ri64(regs, &tb_ptr); - tci_write_reg64(regs, t0, t1 << (t2 & 63)); + tci_write_reg(regs, t0, t1 << (t2 & 63)); break; case INDEX_op_shr_i64: t0 = *tb_ptr++; t1 = tci_read_ri64(regs, &tb_ptr); t2 = tci_read_ri64(regs, &tb_ptr); - tci_write_reg64(regs, t0, t1 >> (t2 & 63)); + tci_write_reg(regs, t0, t1 >> (t2 & 63)); break; case INDEX_op_sar_i64: t0 = *tb_ptr++; t1 = tci_read_ri64(regs, &tb_ptr); t2 = tci_read_ri64(regs, &tb_ptr); - tci_write_reg64(regs, t0, ((int64_t)t1 >> (t2 & 63))); + tci_write_reg(regs, t0, ((int64_t)t1 >> (t2 & 63))); break; #if TCG_TARGET_HAS_rot_i64 case INDEX_op_rotl_i64: t0 = *tb_ptr++; t1 = tci_read_ri64(regs, &tb_ptr); t2 = tci_read_ri64(regs, &tb_ptr); - tci_write_reg64(regs, t0, rol64(t1, t2 & 63)); + tci_write_reg(regs, t0, rol64(t1, t2 & 63)); break; case INDEX_op_rotr_i64: t0 = *tb_ptr++; t1 = tci_read_ri64(regs, &tb_ptr); t2 = tci_read_ri64(regs, &tb_ptr); - tci_write_reg64(regs, t0, ror64(t1, t2 & 63)); + tci_write_reg(regs, t0, ror64(t1, t2 & 63)); break; #endif #if TCG_TARGET_HAS_deposit_i64 @@ -1008,7 +1002,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, tmp16 = *tb_ptr++; tmp8 = *tb_ptr++; tmp64 = (((1ULL << tmp8) - 1) << tmp16); - tci_write_reg64(regs, t0, (t1 & ~tmp64) | ((t2 << tmp16) & tmp64)); + tci_write_reg(regs, t0, (t1 & ~tmp64) | ((t2 << tmp16) & tmp64)); break; #endif case INDEX_op_brcond_i64: @@ -1026,28 +1020,28 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_ext8u_i64: t0 = *tb_ptr++; t1 = tci_read_r8(regs, &tb_ptr); - tci_write_reg64(regs, t0, t1); + tci_write_reg(regs, t0, t1); break; #endif #if TCG_TARGET_HAS_ext8s_i64 case INDEX_op_ext8s_i64: t0 = *tb_ptr++; t1 = tci_read_r8s(regs, &tb_ptr); - tci_write_reg64(regs, t0, t1); + tci_write_reg(regs, t0, t1); break; #endif #if TCG_TARGET_HAS_ext16s_i64 case INDEX_op_ext16s_i64: t0 = *tb_ptr++; t1 = tci_read_r16s(regs, &tb_ptr); - tci_write_reg64(regs, t0, t1); + tci_write_reg(regs, t0, t1); break; #endif #if TCG_TARGET_HAS_ext16u_i64 case INDEX_op_ext16u_i64: t0 = *tb_ptr++; t1 = tci_read_r16(regs, &tb_ptr); - tci_write_reg64(regs, t0, t1); + tci_write_reg(regs, t0, t1); break; #endif #if TCG_TARGET_HAS_ext32s_i64 @@ -1056,7 +1050,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_ext_i32_i64: t0 = *tb_ptr++; t1 = tci_read_r32s(regs, &tb_ptr); - tci_write_reg64(regs, t0, t1); + tci_write_reg(regs, t0, t1); break; #if TCG_TARGET_HAS_ext32u_i64 case INDEX_op_ext32u_i64: @@ -1064,41 +1058,41 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_extu_i32_i64: t0 = *tb_ptr++; t1 = tci_read_r32(regs, &tb_ptr); - tci_write_reg64(regs, t0, t1); + tci_write_reg(regs, t0, t1); break; #if TCG_TARGET_HAS_bswap16_i64 case INDEX_op_bswap16_i64: t0 = *tb_ptr++; t1 = tci_read_r16(regs, &tb_ptr); - tci_write_reg64(regs, t0, bswap16(t1)); + tci_write_reg(regs, t0, bswap16(t1)); break; #endif #if TCG_TARGET_HAS_bswap32_i64 case INDEX_op_bswap32_i64: t0 = *tb_ptr++; t1 = tci_read_r32(regs, &tb_ptr); - tci_write_reg64(regs, t0, bswap32(t1)); + tci_write_reg(regs, t0, bswap32(t1)); break; #endif #if TCG_TARGET_HAS_bswap64_i64 case INDEX_op_bswap64_i64: t0 = *tb_ptr++; t1 = tci_read_r64(regs, &tb_ptr); - tci_write_reg64(regs, t0, bswap64(t1)); + tci_write_reg(regs, t0, bswap64(t1)); break; #endif #if TCG_TARGET_HAS_not_i64 case INDEX_op_not_i64: t0 = *tb_ptr++; t1 = tci_read_r64(regs, &tb_ptr); - tci_write_reg64(regs, t0, ~t1); + tci_write_reg(regs, t0, ~t1); break; #endif #if TCG_TARGET_HAS_neg_i64 case INDEX_op_neg_i64: t0 = *tb_ptr++; t1 = tci_read_r64(regs, &tb_ptr); - tci_write_reg64(regs, t0, -t1); + tci_write_reg(regs, t0, -t1); break; #endif #endif /* TCG_TARGET_REG_BITS == 64 */ From patchwork Thu Feb 4 01:43:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376156 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp836611jah; Wed, 3 Feb 2021 17:58:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJwiwWHDKxZu1Rke2Bd4haFZaWZ9Cg9c6u4tmhHPNP4E0/GuCqkqBk5TvroPIGVDQ/NJLpse X-Received: by 2002:a25:ab4e:: with SMTP id u72mr8773441ybi.417.1612403882245; Wed, 03 Feb 2021 17:58:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612403882; cv=none; d=google.com; s=arc-20160816; b=YTU2Qd2d1FHORTuCGRphzL0llF/bEbw/vDU36kclWCwbjzjiJhfM9PXZ2D7n6+WLH/ VoqOWvnpK7TT+JjebJybMd0Bf32dy6UHYyPN5NJItJVOOk5CeJJo5xBKM3dZxbxwK4Ep qlqW5gPsty+VySleMG2DA/et08lAago7ASPDPdHR/El9r5Q5ESa0RtEAExXSd7tIYahK K29lHOM8Rv1lH4FNOTUXAaa25PDyYkUoKzFu3doi0sYy3wsFPXC5dtupqZlti1YjHMgy lGJSAuVJ8dakm2hHYs6F1FzjB0Vos+gTxS7eDDrHfIes8UPo2VwQYrM4DQNfsP97OVcR Ji3A== 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=G2sd+rMiFVhWCMHNvyHgxhZmWKXrzCkUbxixI9tGVCY=; b=qiO1SYiLia9NiAby6lYdfDVa1lDvD4Xo2DZ8R8i4oiuL8KzukZmNUZsblhz5xZRE31 YEEOtpSuO3x1QzJg/h1kOB/ehGgMZvO6VYcZpVnakVdW0XUB7BESxloYff6cIZE+cAex fIsLaUDNWDgp8BaawaP6txbieb7fm7HpM3Uo8Qwbs9Pg85yZGohvlIpe2QR+lxm0aKiS xIlbRpzK9s/nHe0DUc4WSMjMLAgbvdeI6r9cVV0IQJF9uRaP1SVE6sZmRXTyhkhYO/I1 4x+Cd8ifdZGszD19GGxnl+VspcVhOvnzwVpTACP178XgTLon4Dui873V8XDlSh44zPn3 aJZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PQJIOao2; 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 p203si3645190yba.19.2021.02.03.17.58.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 17:58: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=PQJIOao2; 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]:36084 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7TuD-0002XH-N7 for patch@linaro.org; Wed, 03 Feb 2021 20:58:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44346) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7TiN-0004kJ-9j for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:45:47 -0500 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]:34179) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7TiH-0003hY-6J for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:45:46 -0500 Received: by mail-pg1-x52a.google.com with SMTP id o7so1052178pgl.1 for ; Wed, 03 Feb 2021 17:45:39 -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=G2sd+rMiFVhWCMHNvyHgxhZmWKXrzCkUbxixI9tGVCY=; b=PQJIOao2XsFp0QdFrRr3TabzEzJjYRZ8p96yXC4PwANz2S7OByxKXuG65V1RbNog1a nP33i/SVgvSQj9/E04HJNZpbr49/SFcxkhgF1NpAu+bBHKH5xUDKuoUqZo534NO/DFrS BP5iE10oNevH+RJ8NF4o0TXz5TRmiS7UmIY13r5ptemajZSNN4EfbZWujaAszL3cN644 zd3O0o7acRJB/8eHSxST7u7LY6rw16kc3w2DG3QQ2K1jLK2UD+0YXrgOjTgpFTLIQQ3B xSul+ZY6xHTffuzBFCw5bt8V335JGbTspkBIKRC/f1EIyY1vh15dNKuo0RxTwJ+tJiMt j1Cg== 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=G2sd+rMiFVhWCMHNvyHgxhZmWKXrzCkUbxixI9tGVCY=; b=H/75U8ApxFwBuVZSfrBKYb6+yfrCqx7HHyBMjX6+CdZwtMAUyo8jyG7d4LF5RazjGh /xPbc1gPuGzy9zP/T+o1aD6k/pMdb8Lr7lSeKudkA+3XzpEw69nVcfsQvkaOMmsp1sVC 5+wp+IJppqGJLzTu9PT+zFoPXo0MT3QT7UghOGajLdrYJ6MYAStbP6M2F8mGfEpt6Y+x c5RAtGm2+ZuhlWahvbRkBnXDypFU/IDh1w7qU2nV37DS6JmiOoDCYzsIzvmQXct9Zmsn 7aYpV66jfaEhhu46c7TpnO6nyUbANITlKz6MXAbBEEtmmUW0Y+uDumEpCHrxuApmeYQS D5dA== X-Gm-Message-State: AOAM53341lQNCO1bOGfRrXekzBohDEKoiP8QZXSVT4688PwC2ps4KfaQ z+q58GLd3mb61ieL/HuKa5gdNwrehvjqnUqQ X-Received: by 2002:a62:3503:0:b029:1aa:6f15:b9fe with SMTP id c3-20020a6235030000b02901aa6f15b9femr5735488pfa.65.1612403138970; Wed, 03 Feb 2021 17:45:38 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.45.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:45:38 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 13/93] tcg/tci: Merge INDEX_op_ld8u_{i32,i64} Date: Wed, 3 Feb 2021 15:43:49 -1000 Message-Id: <20210204014509.882821-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52a; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52a.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: sw@weilnetz.de, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Tested-by: Alex Bennée Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/tci.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index 0f56702b93..7e108bcbb3 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -455,6 +455,18 @@ static bool tci_compare64(uint64_t u0, uint64_t u1, TCGCond condition) # define qemu_st_beq(X) stq_be_p(g2h(taddr), X) #endif +#if TCG_TARGET_REG_BITS == 64 +# define CASE_32_64(x) \ + case glue(glue(INDEX_op_, x), _i64): \ + case glue(glue(INDEX_op_, x), _i32): +# define CASE_64(x) \ + case glue(glue(INDEX_op_, x), _i64): +#else +# define CASE_32_64(x) \ + case glue(glue(INDEX_op_, x), _i32): +# define CASE_64(x) +#endif + /* Interpret pseudo code in tb. */ /* * Disable CFI checks. @@ -569,7 +581,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, /* Load/store operations (32 bit). */ - case INDEX_op_ld8u_i32: + CASE_32_64(ld8u) t0 = *tb_ptr++; t1 = tci_read_r(regs, &tb_ptr); t2 = tci_read_s32(&tb_ptr); @@ -843,12 +855,6 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, /* Load/store operations (64 bit). */ - case INDEX_op_ld8u_i64: - t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_s32(&tb_ptr); - tci_write_reg(regs, t0, *(uint8_t *)(t1 + t2)); - break; case INDEX_op_ld8s_i64: t0 = *tb_ptr++; t1 = tci_read_r(regs, &tb_ptr); From patchwork Thu Feb 4 01:43:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376161 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp839310jah; Wed, 3 Feb 2021 18:02:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJz4bhh0jXAWijIxG572hmWhXrr3MFUaM4hLfiiMfHZt6CrWwTP/oJtdAgh64XUN0g+TOQV4 X-Received: by 2002:a25:ca55:: with SMTP id a82mr8357199ybg.235.1612404129364; Wed, 03 Feb 2021 18:02:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612404129; cv=none; d=google.com; s=arc-20160816; b=PSQXyjesh5K3xe59hwAY5tv/5CZ50h0laeL7xYrKli2BhBcGK4s0O1SQHWo9AceIgr CwR+gH6fskyb1VIp2yGyfZ/VXl4eZv84ndf7G30Z4IREoddrEyUZhSPydDb11YUuIBdC 4CTBYFzXuBZFVwBTk1x/pfKkJ8+o0pC59GBdvI5rMsqNf0JDQ7hxQLhjFITKcGoZdN9U M+m2TJnlKHoGFb5c9qLbMYltEJYCxKjV0zWtjnVnXnFpYOZ//xGQFuw6iDmZZ3ETOOVc VQOlVQ9IJhrEEU6s/th2vh4geiB2lfsihmdUnaxhqyYmqUg5ld869JjWA7LFRtJcRK8f 9qUA== 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=ivQ6CdRm/OXUCJL48bE6dU1klkzWgC1aTXX7CV1kiyA=; b=s9l+n2kT58S3e1V1MwSMWe4z+8Ol/Hhm1UwYyrtS8lURJHKtiDUiQpm/CXMBg/MUDF eAH1IQxvxFBRUfsfVhTQFzAAdJDZTothRrwDlRK6vVOmdSoBoAtMZXsk3n1Qdaz4mlmo 2DHi+9lSd4MJc6+x9Ezm55oclmSp6/7mu6dg7gEmbtnbCv79iaqDjl1aFcurzyJ9n9Hr LCaJzcZGVyN8W3GS+GubaQX9dVisT/Xk4zYCL8kKp3mSlO7mMc9R169jUoh0e5Er/LF5 72qv1khdF9DnrQ5ZyefY0bvVP7aF0d3Sdn3/300ThZEMi6/FA0XJ2XLSip7fK8rRZQye PO9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UfBjul+b; 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 f95si4519697ybi.236.2021.02.03.18.02.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:02:09 -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=UfBjul+b; 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]:47170 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7TyC-0007F4-R0 for patch@linaro.org; Wed, 03 Feb 2021 21:02:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44366) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7TiO-0004lf-Be for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:45:49 -0500 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]:55433) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7TiJ-0003ie-2P for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:45:47 -0500 Received: by mail-pj1-x102f.google.com with SMTP id s24so767280pjp.5 for ; Wed, 03 Feb 2021 17:45:41 -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=ivQ6CdRm/OXUCJL48bE6dU1klkzWgC1aTXX7CV1kiyA=; b=UfBjul+bPBIcX1icEoskim/EySeIf6QRnYqdF0wZkPkYOsYrd/H5PrhNdAeDC9QwBH +/cDEenkgymVPJPn1S31zK/tMJBMALlkMCnEfQPEyMips5daxoNNOKR+lDgU5wNJCXyE TnJkWexxAB2xALsASLcDM87TbhGEqsqQXndP9OpEu8JM1RHlV2Ln9BzXZdGoMpzuR12R 0G5s7P3SIXFjLn8V35gpsOnEypZ5Zvcsl08Ltt/JZuIUB8IoV3yyz1UolqIMbWQl/FPe WK9y5UYMrx1L+xk6dAF0A8tRYuVr0OlrzObEVt4uYx2/AZ6DGIQhmHvzt0Pe50UVWsff xeOw== 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=ivQ6CdRm/OXUCJL48bE6dU1klkzWgC1aTXX7CV1kiyA=; b=bdrKMm2mMjN3+dPh+Opup97yh4qS0dssEZ3lk+LLHBQF14K/HeLaVCDEHTy0+NXOGI agTCRL1fKigltLk+E7Z1DW+w9DdFopUDlY1ffBCVkMytl3KgPw7UO8l7YRo2jYE/VlTn oPXG3hwGnHbzBYd/3/S3Ojq39HiFbbSNkxgTtgcsz+GNDQf2uh6zvj0qWqJBBJOtv1uR 4OttojLYPshAomlCx7ncLSk2RRmYzHZ/IE71Pc9VqPHpesoq+SnCYn2AJcQypw25NIl7 PZ58zvlS2lUQuk9yWmpknIO/nJCePaOvzxI861w3dvObTsGPEr/W7nWCTPWdDUF0mebk hZ2g== X-Gm-Message-State: AOAM5317nAOXMtH5QdrT3LZC5twYs/Cs336fOPQzKsFTo2mvyLV+BlJ0 sr4HpUSN/CpS+qyDni0hZrrP9SCC6uzqMAZe X-Received: by 2002:a17:902:724c:b029:e1:4aae:c72 with SMTP id c12-20020a170902724cb02900e14aae0c72mr5743828pll.81.1612403140657; Wed, 03 Feb 2021 17:45:40 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.45.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:45:40 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 14/93] tcg/tci: Merge INDEX_op_ld8s_{i32,i64} Date: Wed, 3 Feb 2021 15:43:50 -1000 Message-Id: <20210204014509.882821-15-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102f; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102f.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: sw@weilnetz.de, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Eliminating a TODO for ld8s_i32. Tested-by: Alex Bennée Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/tci.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index 7e108bcbb3..c31be1a1f4 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -587,8 +587,11 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t2 = tci_read_s32(&tb_ptr); tci_write_reg(regs, t0, *(uint8_t *)(t1 + t2)); break; - case INDEX_op_ld8s_i32: - TODO(); + CASE_32_64(ld8s) + t0 = *tb_ptr++; + t1 = tci_read_r(regs, &tb_ptr); + t2 = tci_read_s32(&tb_ptr); + tci_write_reg(regs, t0, *(int8_t *)(t1 + t2)); break; case INDEX_op_ld16u_i32: TODO(); @@ -855,12 +858,6 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, /* Load/store operations (64 bit). */ - case INDEX_op_ld8s_i64: - t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_s32(&tb_ptr); - tci_write_reg(regs, t0, *(int8_t *)(t1 + t2)); - break; case INDEX_op_ld16u_i64: t0 = *tb_ptr++; t1 = tci_read_r(regs, &tb_ptr); From patchwork Thu Feb 4 01:43:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376152 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp834765jah; Wed, 3 Feb 2021 17:54:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJwcVBzpjKZVWkApZS2gkyVMIn9nOn1998B+zEAYW3SMEQz6Ncio6MixxEdYtOqgtnTH8NYS X-Received: by 2002:a25:1e86:: with SMTP id e128mr8911585ybe.326.1612403687474; Wed, 03 Feb 2021 17:54:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612403687; cv=none; d=google.com; s=arc-20160816; b=nNEPFuMqpMFn6CIsxZ5jDspc1y67qDvb1MV7KogdDA+rKsGiUZgxBxFF3Ou3v7b/nV MuaAWPKZhZ5lKkEQRti3GrhSAY/iQG2T3zvyMwjk9cOKhSgiMI0EoLUgypLN8wC7uvf8 ngrmEZzsDWhyyoInHe5BZh+KMllbwOC9Gv1wc3Ik735fiJfuCq/o61qrswsuyIV92wNA cKYReB4PnMuRRoTNYGeLtvYdhPQid7jEDj4PpaIy3YwGEDAc0aaTDHUxX+WaUaeDvrl4 2usDLOyyAJfDAOggqcO2G+kV9Khozgc534GqEsnwzkLb9c+VBXUnBddCupACQKbgnYgf OxxQ== 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=SP+dSNoCSW/u6ABPE/2oquCEK8adb2mItiXQWA/oP48=; b=XF18ozQT3wBLqZ19WOzgrYMxe4pqGN3bm3bBRyG+1LZCesuAKh2HwAATjdYQvd90Ow Bj2qYSF9OyGFZhWcdFlnD/D2C1YELgL+SngzY9KPQXxN5+m/SdVfZ1MgGApMCfU8Oomo gEb8R5uGEriPUfhUvQti7KDWy1BQUs4BmmAxUK7hAsuCwvhQYj1HpZbFQCs/j2S8vEZt KFRFYl3AQUb93YifVvBAjCGP+A3X3FKnlu7zrmUMCzUuIHlCnPDH1WXobrFK77D4XX28 TQLL33chnTRZYI7qdGJmcagV7h4+M483XNUUccOh+vJpV7WmfXk00ZyRIQ8vOC/cHEsb orJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rIVz8A2Q; 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 c2si4402636ybe.400.2021.02.03.17.54.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 17:54:47 -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=rIVz8A2Q; 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]:55858 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7Tr5-0007Nr-0J for patch@linaro.org; Wed, 03 Feb 2021 20:54:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44344) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7TiN-0004k4-7K for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:45:47 -0500 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]:45516) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7TiL-0003jB-BL for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:45:46 -0500 Received: by mail-pl1-x633.google.com with SMTP id b8so869457plh.12 for ; Wed, 03 Feb 2021 17:45:43 -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=SP+dSNoCSW/u6ABPE/2oquCEK8adb2mItiXQWA/oP48=; b=rIVz8A2Q3OkvbEYRbfC5vbM4owPmPE7eX6sTZfu5/YAExfsSh5qfcqNWcyNi2VFU6h dyvjOUTYsNO9LMnkwbTygoww44tpkqXnQZC4l3sLGrk8giD2C9tzG/eKZNGV9SlnD/rB bvjsd1mbmoetK2dK+KO6HGEgGHA5/pmJvPVGQVAo9cW5P8wBg28gHu+YP8OFNcmW4ipq 3kHJfrNT/iVZlLv5Q9X2ByKOWU016YhGRmjIGWwlw+HL/FfFDOdoskKZ8kgbsbr4kqRL Ke0TtIjA65dPHOK/Y9KH42YVSn0f+qqboqGweU2KOJcCY+OY52b3hzlhTGpTx7MRjZLB HCPg== 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=SP+dSNoCSW/u6ABPE/2oquCEK8adb2mItiXQWA/oP48=; b=qCuf2priFhq18tiNleo2r4YV2LRl2yJrOSnmp8IHYbZSjuSq0LUlYoxTxx6fvNTvJC dYcm5UkIXmTfkqm+deWsZLB2ug82J7O35VYo2+9wJoZaNGKkj/XKP/DNydG81P5RECh5 rnfJwA8Sk+2xYlQJ4cTjGlEzhXgUTKFJmX5Flj2t5nNVPSKTutC9Vr9hub3aYbIr6Aeh Bwkzll6aMfAJ0rccqzbZP4Q8c1InOGw246ORpM+366CjAMxcwUTtyoOQYXBsxXeFacm6 +B3zJK81IvLIsnZ3iMny6NYsr+2rCPk4KMuAGDKCbRScTzjZGHjYSPrsROClNxKeHsPW pM0g== X-Gm-Message-State: AOAM530PnrU/gzqe9lEAMBqfv5thmA8lEoCaG8wIMsF97NqvR5lR9QBR bMJH4YE9kAojiK3hdbB5aflJ70zRT4PZUfRM X-Received: by 2002:a17:90a:4dc5:: with SMTP id r5mr5846098pjl.114.1612403142387; Wed, 03 Feb 2021 17:45:42 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.45.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:45:41 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 15/93] tcg/tci: Merge INDEX_op_ld16u_{i32,i64} Date: Wed, 3 Feb 2021 15:43:51 -1000 Message-Id: <20210204014509.882821-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::633; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x633.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: sw@weilnetz.de, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Eliminating a TODO for ld16u_i32. Tested-by: Alex Bennée Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/tci.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index c31be1a1f4..b64d611ec9 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -593,8 +593,11 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t2 = tci_read_s32(&tb_ptr); tci_write_reg(regs, t0, *(int8_t *)(t1 + t2)); break; - case INDEX_op_ld16u_i32: - TODO(); + CASE_32_64(ld16u) + t0 = *tb_ptr++; + t1 = tci_read_r(regs, &tb_ptr); + t2 = tci_read_s32(&tb_ptr); + tci_write_reg(regs, t0, *(uint16_t *)(t1 + t2)); break; case INDEX_op_ld16s_i32: t0 = *tb_ptr++; @@ -858,12 +861,6 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, /* Load/store operations (64 bit). */ - case INDEX_op_ld16u_i64: - t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_s32(&tb_ptr); - tci_write_reg(regs, t0, *(uint16_t *)(t1 + t2)); - break; case INDEX_op_ld16s_i64: TODO(); break; From patchwork Thu Feb 4 01:43:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376158 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp836897jah; Wed, 3 Feb 2021 17:58:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJzD1l/a3ABCCylMt+2U7+qitD5RGH3OYIHlVZifkZPlIjwm4c42KfuOHZENjuh4GPeS9Hc1 X-Received: by 2002:a25:1188:: with SMTP id 130mr8642050ybr.138.1612403918678; Wed, 03 Feb 2021 17:58:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612403918; cv=none; d=google.com; s=arc-20160816; b=paEutKPY8PxG/fIfdM4CYHvUSi7Nl4zzKQdKsQO8BsxMaCyUIyjtviaiPKEQISeM8k BWCFDjHoCDdhMhj0GTWcpqHwtMW5eERHi02PEW5B4PeF10nXnp/ngPEmr+jku0Kxxq8w Ag92+XDSbREy93NfuSqkHU9XB2kHHYTxIrKdUCQ6+az0PpU2QYxOGXZNwDze1kLsLjg6 EeAUve+QLUdD69uBZl3xuBQOddzKI1YfS/krwXl49a7XpfVzgp/7fWZHTmeig1H/h7Rn EuFG+yl9xfd8qdGVArnNJ9/UyGPqBAcmtps0A7b+m5vpOBmFiJ8hhHQu73QvDFMYLmHU dqqA== 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=ILdwR5pcSGw7723xZ1U2bA9/JhsnvGlthCTDNdPrhhQ=; b=nSwr08UBgDblg+3wogXkh3FAgESHcs3k5bQrBCZkHazBc/UDCBGobmm9TMsiHIECVI l3dA+Z9dSuC4XdzgW6yEprU3CDvFLljqvMtUVyRDlG5hmawaZzunnR/fVyW5NQccQ6lm i+5ABqAm0U0VXQKdOY3b4oIA2fc55tdF6m8NwFCMnUZ1vnOkOruUAk7L6NTyxUJU6zTr 4wd5ybGcIdvndUALrP2mHaO+oC0VwVStvM3fGGV8otGmFCpRf+OOooYREGIpd9nLzUWm Ljrn1k5Scd1YM6hRKR0qEXPHEGHCVupMd7DP4Nx0+96wOU1VLhQa2t5mxovheCSXX7dG HWlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oozajDP2; 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 v136si3545392ybe.291.2021.02.03.17.58.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 17:58:38 -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=oozajDP2; 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]:36608 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7Tuo-0002l7-51 for patch@linaro.org; Wed, 03 Feb 2021 20:58:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44352) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7TiN-0004l2-Me for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:45:49 -0500 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]:42495) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7TiL-0003k8-Ct for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:45:47 -0500 Received: by mail-pl1-x633.google.com with SMTP id s15so878014plr.9 for ; Wed, 03 Feb 2021 17:45:44 -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=ILdwR5pcSGw7723xZ1U2bA9/JhsnvGlthCTDNdPrhhQ=; b=oozajDP2aARzt/Jp5h4z5+b4IwyfwMOpvRz0yvq61ZmHFhVhMydHUYUghXwINtwm6k 8Fc+zwIie81G7+2UoiXV8EX0oex++Z0ZsL2yB1CxOjHKNa3ePrYYzVdLHgQ1ShoOKaaP DyQXELBkLSIl9jXj36mVDiDxAwMI9epeiEUzROcEabSWX+bee2zyAIzBEee9oyWvlDnC z+1Dj4/FzC56DXDnksW4WebP6tGQgxxh9atPT8r3XPJkWU2BocOd3/A58wMdsApmvcPR 17rwR6a36fUAMLKp0YL2ioBOAx7fiSwYE3C2n6MAPFJjesTpoa9bwiFNVioTKDBbzXlD n2jQ== 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=ILdwR5pcSGw7723xZ1U2bA9/JhsnvGlthCTDNdPrhhQ=; b=n6Ibav+Jnxn5/zFkU1yLFT1T1jzIW8xJzxwJE7gV8jSXqOReP/kKfCHqT5Q9G7Upv7 wg7mt1bvagSzq1F0Oyr1CpEMA27k/t+ch9hjNMxrWi6PrSQHR67hHEXmojPmk6zOkHWC DyvbalFR/A+Os1OM1uD3fvBSz5p+HdIjuA2LQ9rsnK0MsoHt1QaBkT2omX0OpGWIgAKx sx8AVdCX9fVZ/5HF7i2xqiD/ktv0Fnc0zN+ZYt161PPrk8xAEb4fyxULj7eEjphMttK8 VLtB8YXIMbXga4ThC7Q/nDSlaoOKLyoBiyOXNnydKreI8c6/8TEVxMdA/cZ85LtYp5q/ VKGg== X-Gm-Message-State: AOAM533sMRVCCh+tgrPuhW3kKT31MUmMmgZPI9LdMpSgZA8PfC4mMRGY iD9kiSyIPwlOo0eAYMgdL0J+kin0m0AfBDtO X-Received: by 2002:a17:90b:23c2:: with SMTP id md2mr5842366pjb.222.1612403143889; Wed, 03 Feb 2021 17:45:43 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.45.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:45:43 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 16/93] tcg/tci: Merge INDEX_op_ld16s_{i32,i64} Date: Wed, 3 Feb 2021 15:43:52 -1000 Message-Id: <20210204014509.882821-17-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::633; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x633.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: sw@weilnetz.de, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Eliminating a TODO for ld16s_i64. Tested-by: Alex Bennée Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/tci.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index b64d611ec9..259a8538bf 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -599,7 +599,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t2 = tci_read_s32(&tb_ptr); tci_write_reg(regs, t0, *(uint16_t *)(t1 + t2)); break; - case INDEX_op_ld16s_i32: + CASE_32_64(ld16s) t0 = *tb_ptr++; t1 = tci_read_r(regs, &tb_ptr); t2 = tci_read_s32(&tb_ptr); @@ -861,9 +861,6 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, /* Load/store operations (64 bit). */ - case INDEX_op_ld16s_i64: - TODO(); - break; case INDEX_op_ld32u_i64: t0 = *tb_ptr++; t1 = tci_read_r(regs, &tb_ptr); From patchwork Thu Feb 4 01:43:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376160 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp839159jah; Wed, 3 Feb 2021 18:01:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJxOzuC+Se1av5TQRTsHjZ+zRjRuNgdG8z9Cx2VNDQ31ASRfKw6heIlY19cZ79PgAKugbuiF X-Received: by 2002:a25:58c4:: with SMTP id m187mr8012527ybb.300.1612404118929; Wed, 03 Feb 2021 18:01:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612404118; cv=none; d=google.com; s=arc-20160816; b=nbpbXJCwIbGBv0c8aKh1RgZe986dZRhTA8yjBmb3D/Licbtc0IqO5QoKs+oKdzaL+S gk754Ha1jFJ90tdceICXsSmHIHB19MTD7Z9nGPDuKliyG6N3KOOXcd87uWWV6NVYiHVo c45W3SVRsymohAthHpW5gcZ/r7lGL2dexf5DdG1p2/QJPMFRK/saagL5/5w0DLw/9ijA SQcQqO4R5in4nrOcR6Kkszn2ClNHFa83Tfyuq6p5uwAPdiHTlfpuBa9CXYkCjb+XVkWf YDqSxbZJnOKrtgc/zZSb1QFmw28EJY2lv8RD00oxKEJQ0hR24aizW6Ucrx6e05Ddffss E67Q== 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=iY5vh2fyihhpXHBTL1OAa7t0Sts/YD95jy25p+z4l7A=; b=JGfRx9NI9A69q3Oh81/1HNOjLk/mDOPaSo1GN9zu8FAJgB1//Qk47ZdCs+9WT2ZcKI WShZyLr80VvDZs3jRQq2xjba+cFwPsL/dP14tLMsk5C/DKHAW2O5CI775Bo3xs30+oXa vvnv5auCRFf7ABPYTR4XV4QQPs2bo9UffYmc/ECNqp3nOL+GPYWxuAs5h4lD+gaKsLee I9Ia+sowhgxD5g09oAiHIQe3OcK5RB1X5PThKvWaTZTqc+PZRlEOYV2ihqBf3Uk8FHBe sPMvcvHQNoE6Z9utunQhiBp7/4AhdwPBJfr3sZSGjVxFRA6f7WaZraJbWv1OsHLsHI2Y Ezug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PFci3iCV; 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 x18si3825557ybj.403.2021.02.03.18.01.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:01:58 -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=PFci3iCV; 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]:45248 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7Ty2-0006Mb-Dj for patch@linaro.org; Wed, 03 Feb 2021 21:01:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44372) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7TiO-0004li-H1 for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:45:49 -0500 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]:41599) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7TiM-0003ly-TR for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:45:48 -0500 Received: by mail-pg1-x536.google.com with SMTP id i7so1022761pgc.8 for ; Wed, 03 Feb 2021 17:45:46 -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=iY5vh2fyihhpXHBTL1OAa7t0Sts/YD95jy25p+z4l7A=; b=PFci3iCVCZfar2NBhb3BCxINMV+x11a2Zg020BkxAI/SenMJ45nxB8NnPha86GpSIX qHguMFrblwLTbXFSKZeaIfebi1OEC+v6sIcVnFv6jmDe1XuuajjOo5AawBwMaE31/ZIH sV+rUd7zyu+od4glZHb3z49NSx4GYJqqL8kCg1slS/YDRSzNlsZ/4i5jvcB0XaV4Bpzy dTI+ZhYvMTqmvvE5favsrzSpB8gu5EkFBML7QnUvwSvbBiFzcW5fbJ8WcCEWojOP2o8h 2284xgxwotO+X7ZBMhh8Ig3WoH/Bsnci+sYSrBnr+14ffdmYtCdcyjf8c5RxwgJGOTHO MiEg== 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=iY5vh2fyihhpXHBTL1OAa7t0Sts/YD95jy25p+z4l7A=; b=jKHIPWwSKWJTUD9m9RvMGzzqQUdW3Iy6dYLDyfbSzo+FdaXPkkhpv7vzEyDMc9R6n0 NHhAF2dzuqAKJ239wRSzQWAa3P2mK+DT3EAzV652JVt5M3CCG+ZZIdlKt2wrZD/0Hv3Y nwje1au1wIY/KtmjrKFGZzyjSdCw5J6MnxG7pwGz/5atYVdeYEchbtU4DT90ZwqFdK57 wICS2it/d7F2WEs6fw+cV2ilW0onvYi37y6FrIDBRDb2ljEfJR5lckfduyrftHZ4Zmeb noGPI6MVG/BA+s9F1x7c2T41LxT/XT28r74C4QI/ji6IomSKLqnIyJuFlLw8fwDL8R8z a3uw== X-Gm-Message-State: AOAM530FOvGq8jMjiIhalkuzYglZTiLtShTGnCYkagqcFhLzaM7vh/PH QbtVA97mPwYhYcv7pST44UxXK23a+1hMdFza X-Received: by 2002:a62:5e44:0:b029:1a4:daae:e765 with SMTP id s65-20020a625e440000b02901a4daaee765mr5872629pfb.8.1612403145522; Wed, 03 Feb 2021 17:45:45 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.45.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:45:44 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 17/93] tcg/tci: Merge INDEX_op_{ld_i32,ld32u_i64} Date: Wed, 3 Feb 2021 15:43:53 -1000 Message-Id: <20210204014509.882821-18-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::536; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x536.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: sw@weilnetz.de, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Tested-by: Alex Bennée Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/tci.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index 259a8538bf..55863f76a7 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -606,6 +606,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, tci_write_reg(regs, t0, *(int16_t *)(t1 + t2)); break; case INDEX_op_ld_i32: + CASE_64(ld32u) t0 = *tb_ptr++; t1 = tci_read_r(regs, &tb_ptr); t2 = tci_read_s32(&tb_ptr); @@ -861,12 +862,6 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, /* Load/store operations (64 bit). */ - case INDEX_op_ld32u_i64: - t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_s32(&tb_ptr); - tci_write_reg(regs, t0, *(uint32_t *)(t1 + t2)); - break; case INDEX_op_ld32s_i64: t0 = *tb_ptr++; t1 = tci_read_r(regs, &tb_ptr); From patchwork Thu Feb 4 01:43:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376164 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp840315jah; Wed, 3 Feb 2021 18:03:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJzUtgfdqrKD6X7UTI6G8c2HKHsvEkbri5H9Z2NpIbypXF7Um6uXNPQeLjm/QgtWXLNQG9Nx X-Received: by 2002:a25:34d6:: with SMTP id b205mr8354838yba.322.1612404229751; Wed, 03 Feb 2021 18:03:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612404229; cv=none; d=google.com; s=arc-20160816; b=iFy62njYypv4PshQxFi/LlIpGT1EWeQBi8VU4gaJkflFaL5SrsVvRW+zeX+hmRggRr 68NxDBdds1QBYb4MXRyPUxdy2Uw881nfPi5xgRklNdUQ3G7dyUySgSDsvnNtdqxEXDwO 8t79D4loioqrjl4eTcglqKvqUP+gWpDiz5cTYIWy+IebI74ikpQm3bqqgtxY5J1ftyHh WTJ1l/OlONVrbeqj2voIyI2GUlkPwboZRAr9kLNtYt/l2B8FJgsl0kRndNg9Zs1tJqM+ YHjWyUO+XLSBCCvJKwhrfnIpHh+MrTP/jZwmw+BW1y1URbl04bN3kj/a7C0P9Ufn7iPF 4jAw== 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=06+ir6ny4Ln0oN97wv1SB2Wg0mLnpqdVB1qEhcqxE0Q=; b=OIZf2u3QHgbKQsMnikoaXKm9tSO0uBspWt2uQv0tBSo0ME1qE+v7yDgjgG4s1JruV1 /NdHUjG4idbEj0EnWFOryDBvuQJW+MYEm72TkBS7sxoKuOB/IWA7+eT3vIieyYeQhh1p su66ajj+406RrycMpaMA25Lp5egk8VUlRC/zSKkwYuc9nG1D9Q+/RB0m0xqtOoOSuEHz UDkHoknzbDuyFlhQHtuGsJgwDmDsYUH6Hkkws5LNTIqW9vejeLxYRaM7x/++s2aCdHtK QXPelb759UcG9OjXxGpjOq5XTiWFBYaKZMkjr1qi5KBUADENMu/LW8/hFOwAbNMPo/Eu ANLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CIJ6L2za; 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 l128si3764182ybc.8.2021.02.03.18.03.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:03:49 -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=CIJ6L2za; 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]:53892 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7Tzp-0001aQ-7o for patch@linaro.org; Wed, 03 Feb 2021 21:03:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44382) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7TiP-0004nr-Ts for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:45:49 -0500 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]:33702) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7TiO-0003o5-BY for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:45:49 -0500 Received: by mail-pg1-x52b.google.com with SMTP id j2so1057658pgl.0 for ; Wed, 03 Feb 2021 17:45:47 -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=06+ir6ny4Ln0oN97wv1SB2Wg0mLnpqdVB1qEhcqxE0Q=; b=CIJ6L2za/Ld2FKI+1PRjFlC2hbXMicLJz9qeHkuxjjF0Uts1UCo0YiKkR5GuGRzO0h eeM6A4goor7ZF8P/Eg/uEoN8VlhPHQOHEGZOdBDB1gjnqatgB8IvGZJY9cg36QS2/TTq qqKjFIk7+PSFfHBOKmwt0jY3F9/8sRKUG29U2pzB3/Ln38j1Z8Nl4UuglMM4gSfJah65 oiVF+9fIZNqZDZfcb1yWJbPjIwxSg2Mfg8b9S6wd8yXSOXkLXkanLvqUrkyLxe+5nc0Q /gru/GEEWOFIGKV7FnmiY7us7Z+PuvEwxA6uVht0Y99h+tddW9gJLSsDcKqsYUZhWjEl cZPw== 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=06+ir6ny4Ln0oN97wv1SB2Wg0mLnpqdVB1qEhcqxE0Q=; b=IEzYJyN0G1A/HE6lQ6dxyKz8xAhEJIIYcWuLwNpQS3c25BsFUzy4Fst6DtUUQrFn7p pCnOBeCk7qui0rT2IO4cCkHGV2rYU/Tcm4j5ogH96DKUU3Pb9xYuoGIo6MGfTi2y2ZRy afNWeXbvRhvOFJ5HYmobbq9Yz3v0toR6Kx257mWf13ZhXRl2Rf36Q6wkHtEPWS4ZvYAS DnWhgT5al5qod/FFTgx77t8AIPsaydwTzqrKkN+UWWwRBA2Gk6oaIHeM3pmH1OEQehpg ju2OU26/zu5/eFkMu0RqXHyXa5jHLjqQyVAdqfLwom8OamzdWdq8/KwXihqmiUYTz2A8 sZHw== X-Gm-Message-State: AOAM533hE7xqkT9tQT7tflNCKpBrEeHmBcAcvUl727to/9dOBRzhLgyz qMNYLL2fbICCyM98RtvhthwgXC/sFk2v11Xj X-Received: by 2002:a65:408c:: with SMTP id t12mr6563037pgp.157.1612403147125; Wed, 03 Feb 2021 17:45:47 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.45.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:45:46 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 18/93] tcg/tci: Merge INDEX_op_st8_{i32,i64} Date: Wed, 3 Feb 2021 15:43:54 -1000 Message-Id: <20210204014509.882821-19-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52b; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52b.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: sw@weilnetz.de, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Tested-by: Alex Bennée Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/tci.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index 55863f76a7..6819c97792 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -612,7 +612,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t2 = tci_read_s32(&tb_ptr); tci_write_reg(regs, t0, *(uint32_t *)(t1 + t2)); break; - case INDEX_op_st8_i32: + CASE_32_64(st8) t0 = tci_read_r8(regs, &tb_ptr); t1 = tci_read_r(regs, &tb_ptr); t2 = tci_read_s32(&tb_ptr); @@ -874,12 +874,6 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t2 = tci_read_s32(&tb_ptr); tci_write_reg(regs, t0, *(uint64_t *)(t1 + t2)); break; - case INDEX_op_st8_i64: - t0 = tci_read_r8(regs, &tb_ptr); - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_s32(&tb_ptr); - *(uint8_t *)(t1 + t2) = t0; - break; case INDEX_op_st16_i64: t0 = tci_read_r16(regs, &tb_ptr); t1 = tci_read_r(regs, &tb_ptr); From patchwork Thu Feb 4 01:43:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376167 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp905869ejt; Wed, 3 Feb 2021 18:06:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJxCk04P7La+E1eed4rR2CbX1ZVJPkpzBiXqSK4z0kXSSGF0JdcmHbwuySZiHOR9VnD5WiM4 X-Received: by 2002:a25:55c5:: with SMTP id j188mr8276125ybb.455.1612404406426; Wed, 03 Feb 2021 18:06:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612404406; cv=none; d=google.com; s=arc-20160816; b=gukzeKLeP95lOCn9Ga/0AniiB8r6a5QKTMgKo+NCVn/tabwAB5wyRq03ZGEG+f7K9R PiD8SL4qMkje9UHJZSY/xlpzIIo/nElV9GiY33dN+MEPhnRJk0BrV99bcHzHNAQrc9zV jN25i993lU4jW7FEKZSKFNa6B9bNX3EST9049Ai2hIPxIZgr/FPz9sK56ai/Mx4AZSxP eCXejPTkpQ70+k1ImPlg3UmN5QUBNSbcQ83LDXX0KxtxtQWGX/08TsKCX/yDGhtGst9P FtAdXrLCApjfqym8puZfA5FDLN4kc2TaCZotIKgJhujSTJ5SVChY/TYG0XMwh9bBKGWg stSw== 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=acbBM9pC8e1A/bvx5nB4UsPCm3LAoSp/wHIVXG+hEzA=; b=H5uzGSHsYd3M3KcZTe3JVLVBgWhLddqYewCMs4fVimi2OpF7VdKmgvOlj4+3MiaSoX 2XT4mG6ICZ9gqDQ/NQl+erTCXh5cljqcnRLLZoPksjLj7AZCdfqcjQKtQO33qc6LOlaF nnnIxcpO2TOodtz8A0MNVVEj2tbK6mqT310a+3rcmqn8LBrfvGJD9pkarC0NohJK9Sks ev81oM3RWu9JG8i5vZvz8BWTGimK83BwuAlXwsS1FGnfY58ZioAteZdZf9gkrsdlpmJx DDGAOSy9Z4KWBBrDSo8ZpB28Txz1MjIWaucObtpXYwgV74LzecHcg1wLlFRkDvYeb9Sw CgBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wMuzlzxb; 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 x11si2486979ybs.49.2021.02.03.18.06.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:06:46 -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=wMuzlzxb; 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]:34142 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7U2f-0005Bn-P6 for patch@linaro.org; Wed, 03 Feb 2021 21:06:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44396) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7TiR-0004rz-LY for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:45:51 -0500 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]:46437) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7TiP-0003oJ-Vp for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:45:51 -0500 Received: by mail-pg1-x52a.google.com with SMTP id r38so1002111pgk.13 for ; Wed, 03 Feb 2021 17:45:49 -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=acbBM9pC8e1A/bvx5nB4UsPCm3LAoSp/wHIVXG+hEzA=; b=wMuzlzxb/KNISWtkhg14HHUfc1qQUIFCO+/mSl8xNUmhLq3lOJpKl+da5olT93LABi XC2mvbSjzwo+rfdcg5Lj/FSj2m8ruoEbDsXjPCl6C+bGtuSIiijXHeEbwycVv/Ng30y/ QJKpB+GvOfMZe009/QZPMMJhH4ISnfZiRySnQpLYq+4Wk8SJYJnLanvzJmMkEzGnO4nG RroqCR1oTHx3FL3zq8CTV4Wom/pqGP7y/Rj3FSkWYNtUdWqjm3Jo6qaKTjog626lV1c7 bGH51l+11VQCRAZLFJfPIHYNipjFfooxiBWYjyjBXWCofgdD+N8c/WdQa+bq18eIOUeL bgtg== 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=acbBM9pC8e1A/bvx5nB4UsPCm3LAoSp/wHIVXG+hEzA=; b=KEKjK5jh47lHi1I3poFe7OBpwCso0Df6xJP1DlSKHxcxkbDIbp0Ny2ZeiorJm4j2pu t1Ny/ED111gXPBC/fzEYIXE4pTmB48ed+W87Py+F/bztr2C89xc/6wsncjDPM5Mal56e 4jff5i2qsXaAjmbW/wNjEe067zanCGdF3v6hepqhz1UTyyJdDU50BlqC5E7wiGXcsPCY Ky2069WhmSx3u7qZ3jgUrZ81/GA8VAJh/HOAnKSJ10g8AGUK+0FUnPphwmfawC/pjgYE P94tgeXS8gU101vzXr7LhQoabi7FR6gLMJwIMTH4uRm5kMq2JpTyfgMCM9BYAgyO8rk0 0XSA== X-Gm-Message-State: AOAM531xnZFxrzrMfZ5GzebOBT+CvxNXar35yl88oFysz1P6/bpr4zcg SykvB0a7zxLs8DrFn9CMN++mC/tZmVjG17Kv X-Received: by 2002:a62:ddcf:0:b029:1b7:baca:6c71 with SMTP id w198-20020a62ddcf0000b02901b7baca6c71mr5859469pff.43.1612403148773; Wed, 03 Feb 2021 17:45:48 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.45.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:45:48 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 19/93] tcg/tci: Merge INDEX_op_st16_{i32,i64} Date: Wed, 3 Feb 2021 15:43:55 -1000 Message-Id: <20210204014509.882821-20-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52a; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52a.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: sw@weilnetz.de, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Tested-by: Alex Bennée Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/tci.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index 6819c97792..fe935e71a3 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -618,7 +618,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t2 = tci_read_s32(&tb_ptr); *(uint8_t *)(t1 + t2) = t0; break; - case INDEX_op_st16_i32: + CASE_32_64(st16) t0 = tci_read_r16(regs, &tb_ptr); t1 = tci_read_r(regs, &tb_ptr); t2 = tci_read_s32(&tb_ptr); @@ -874,12 +874,6 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t2 = tci_read_s32(&tb_ptr); tci_write_reg(regs, t0, *(uint64_t *)(t1 + t2)); break; - case INDEX_op_st16_i64: - t0 = tci_read_r16(regs, &tb_ptr); - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_s32(&tb_ptr); - *(uint16_t *)(t1 + t2) = t0; - break; case INDEX_op_st32_i64: t0 = tci_read_r32(regs, &tb_ptr); t1 = tci_read_r(regs, &tb_ptr); From patchwork Thu Feb 4 01:43:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376175 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp909175ejt; Wed, 3 Feb 2021 18:13:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJxyHOq/SaSob2jt7b0QrGvjCAw1hTsvluVVrefUz/Jlr4HVHb023uQw/lqCjJKLIFiuzorF X-Received: by 2002:a25:680a:: with SMTP id d10mr8293243ybc.397.1612404785619; Wed, 03 Feb 2021 18:13:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612404785; cv=none; d=google.com; s=arc-20160816; b=057FuPyDWXzS45rrP/J8DnVIKp6lTwoSPgTJY0mGvOZEAaulGhV16nWntufXfMq5+5 HrSB7J4G1YonstvvHysU/j2EFzZ3J8Q5ZEBUzPXKyNxKeQ+FKuc+Ax09YVve7zaA0n/A IieiZxmaZjnbA1pugSDJrrjvZaCVG4LGW5m0Btd7TO7sYPTQB0aAwwScfoy9aOD2r27/ RtJKE/Azqrrm8wUqRZQJohKTM7SyQK/1T+C747q1itDnV0r4AyHfQI1eVvEsOYg2oOe3 EdNkUql9WxNrjwBXvPv3nJXISbBTxKSMzT8vuyww0PbgnV4Z4eBNisTNDp7naWACAG7W OR9Q== 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=aEJQJ28aTfFYwWXCrc4/tQ7PstJpDur23rDVFAChQBo=; b=SiiCehqfQVBBkauCVxaMy1qUA5TPRBK3XyxW1FrwOZEC/Vh/xgsasIv3EuhDrr2L+w BU7dFTLMnGqRyzTq5xcC3v+x4xD1GG3mYi53MSryHhIjBJdtzlCb0PcrVdwITtY3627R E26SVn25/+mKOBYIdiIQLjcjjPEQi34fScK1xQCNxPNEZoeMtOw9Gg1yKXPUWNJKjRR2 iov4xwFVu8tKV+5cLkttZrrbtjEwI2530vZSXvIh2+5wgk3ydYRWA+7I0qEIlPyfb7Zp BpbI0uBu7Z2NTES1qfG/Vqp3A3FK3QL/S2897Zi2DYgn5dEoQ7JQbZ2S1KUQ8C4t91Qf 2ZrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RixZ2tfG; 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 125si5042795ybh.279.2021.02.03.18.13.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:13:05 -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=RixZ2tfG; 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]:50548 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7U8n-0003nO-1w for patch@linaro.org; Wed, 03 Feb 2021 21:13:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44410) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7TiT-0004x7-JM for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:45:53 -0500 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]:46777) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7TiR-0003pH-SA for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:45:53 -0500 Received: by mail-pf1-x42f.google.com with SMTP id f63so1046685pfa.13 for ; Wed, 03 Feb 2021 17:45:51 -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=aEJQJ28aTfFYwWXCrc4/tQ7PstJpDur23rDVFAChQBo=; b=RixZ2tfG4LIRL+V3EXWjLFxaErEiHAkX62uedpc/7udtA6rqMVPDJP36G6hDNwBK6G tfsst1+7V2O8zecmXnWirr8AtTxdNQmcgNExM0tb//8vX62CsdS2ZrJQUf1e41PsfabG pz65jsZYndxld7EQIqJ4RzZs1LS7M36oR5d+nJipqV+6hL2I1SqU5EGGFni3gUQid11V GRmrIsodM00q7mAZD5vkoj3wOQfJRrS4YfUk1r9lKGiSfdmlH+H0LEs6QW6eMYJTZb4l OSdDUaaHceEW4HQE1DmZMytffHm1GRqdyYY7iLZBvSJecGaF1feeccJ2UslQ7Kc02BWT mtlA== 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=aEJQJ28aTfFYwWXCrc4/tQ7PstJpDur23rDVFAChQBo=; b=WNEv5FI/6ibUsqLrh5ojbCLOmy9LOQiFQ6YxRqikfHAsUJXA4bhlP911NuejO0h30N 8Ux+j4sPdnPL3PSe4I77gzeBe1vqLcZMuXovrjZY3bpDEMdzhhtVuZWiXHYv6n1gxSG7 UND0pCNORovIFNFjWCLophLWNHd5kouNUPgMTldBuZld7DodN2ErUB9yhOb4sE54iEb8 gKRaQnfDGqdXJylCNooI0BkeNEtLC+t4RpHzvBkI3KmLztBZjvT6TADTUHzXXkuNOArj FPT5VuTEXasufPm1VpR9JJufBLCI9Kkzr7oY7QzJN9fkgtBt1vjtwI2ULPgohUyBpvWW uZtw== X-Gm-Message-State: AOAM530mH4pNPjHWxQHLi+94jvGXzbJDuh5rsA+EyMjgX10px0bbLNHZ ytUSawj1eW+otSJD4Ll7zky22ssxkSet0m+S X-Received: by 2002:a65:4983:: with SMTP id r3mr6716986pgs.288.1612403150550; Wed, 03 Feb 2021 17:45:50 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.45.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:45:49 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 20/93] tcg/tci: Move stack bounds check to compile-time Date: Wed, 3 Feb 2021 15:43:56 -1000 Message-Id: <20210204014509.882821-21-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42f; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42f.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: sw@weilnetz.de, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The existing check was incomplete: (1) Only applied to two of the 7 stores, and not to the loads at all. (2) Only checked the upper, but not the lower bound of the stack. Doing this at compile time means that we don't need to do it at runtime as well. Tested-by: Alex Bennée Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/tci.c | 2 -- tcg/tci/tcg-target.c.inc | 13 +++++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index fe935e71a3..ee2cd7dfa2 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -628,7 +628,6 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t0 = tci_read_r32(regs, &tb_ptr); t1 = tci_read_r(regs, &tb_ptr); t2 = tci_read_s32(&tb_ptr); - tci_assert(t1 != sp_value || (int32_t)t2 < 0); *(uint32_t *)(t1 + t2) = t0; break; @@ -884,7 +883,6 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t0 = tci_read_r64(regs, &tb_ptr); t1 = tci_read_r(regs, &tb_ptr); t2 = tci_read_s32(&tb_ptr); - tci_assert(t1 != sp_value || (int32_t)t2 < 0); *(uint64_t *)(t1 + t2) = t0; break; diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index f0f6b13112..82efb9af60 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -375,10 +375,20 @@ static void tci_out_label(TCGContext *s, TCGLabel *label) } } +static void stack_bounds_check(TCGReg base, target_long offset) +{ + if (base == TCG_REG_CALL_STACK) { + tcg_debug_assert(offset < 0); + tcg_debug_assert(offset >= -(CPU_TEMP_BUF_NLONGS * sizeof(long))); + } +} + static void tcg_out_ld(TCGContext *s, TCGType type, TCGReg ret, TCGReg arg1, intptr_t arg2) { uint8_t *old_code_ptr = s->code_ptr; + + stack_bounds_check(arg1, arg2); if (type == TCG_TYPE_I32) { tcg_out_op_t(s, INDEX_op_ld_i32); tcg_out_r(s, ret); @@ -514,6 +524,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, case INDEX_op_st16_i64: case INDEX_op_st32_i64: case INDEX_op_st_i64: + stack_bounds_check(args[1], args[2]); tcg_out_r(s, args[0]); tcg_out_r(s, args[1]); tcg_debug_assert(args[2] == (int32_t)args[2]); @@ -716,6 +727,8 @@ static void tcg_out_st(TCGContext *s, TCGType type, TCGReg arg, TCGReg arg1, intptr_t arg2) { uint8_t *old_code_ptr = s->code_ptr; + + stack_bounds_check(arg1, arg2); if (type == TCG_TYPE_I32) { tcg_out_op_t(s, INDEX_op_st_i32); tcg_out_r(s, arg); From patchwork Thu Feb 4 01:43:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376165 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp840430jah; Wed, 3 Feb 2021 18:04:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJyfLJAYdg3nWjjcgHzdXD0TFZ/bC5rHFXYBrFyF483LtzG/k6egMxKCcBTJx2NhmWiiz+gW X-Received: by 2002:a25:bdc2:: with SMTP id g2mr8923088ybk.193.1612404240354; Wed, 03 Feb 2021 18:04:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612404240; cv=none; d=google.com; s=arc-20160816; b=qxIoAb0FddoyNTlP5X02Nwtom7odIrZXURXK+AY5B5AFOpeLjBb3MAmgWJtREe+zxh 9ntBvuYyhiKGcPPk/lJAi+1RFqGESAAumUYyvk9A27KAqj2HfdBV3ibegW9Wu7BS6/uO /uKGJEZcElBlyn5tMVkxrUZL5pW5nFwogL7rbLsHYZQX6wlZ48kYbnbMwFmoZXJ0YV0l ZPiz/nhQ372IBudRHwUNTgq8isc6AaajZJslegHIvnrkXOICLmZr9taTukhQpX0nW+Ak o1SNVUhegqtjcu0UFgpWLS/RsVGytlz9VeqmbDLl4bTKMl/8zjPcm5Uu0rkiyU0WcTC4 la4Q== 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=pMV4BySeK8KuIUlVV1lxW3l1A4MrToushLk684ASlQM=; b=MtRUKIEnuQ1GYJN9KeqlZmo6EqaH05QvSTJI3qnhD6dMmaYQHcfC24mJEb36CJK5kd J6DwK/N4FLsQv89dmH/f3Yd/0dgCirpqLdGGZb5xiJPiig83mtyvyUjyJOmYNa1+hgTi 0A3ptsKDHWbbtXbsuVw+KYPALeTvcLWezPJF2Dc7KZfzESwruHVzo9s1aNxfWClqAlBM qNAgkVYJNZQ37yBAmi07KZYbixk7t1/W0qSb6kiiJwaUHgQr8q/wYeWVKT4Gsj30Rj4u ZnBeukPvBXfzqSnXsKO3/N56njWSZjFaD2O2Yulfx4swMEFUxGm8TJpXWE78VpAJ4DQj LAww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qKoRnNM1; 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 g16si3852863ybc.382.2021.02.03.18.04.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:04:00 -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=qKoRnNM1; 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]:55748 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7Tzz-0002K7-T7 for patch@linaro.org; Wed, 03 Feb 2021 21:03:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44428) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7TiW-0004zh-CI for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:45:57 -0500 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]:35655) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7TiT-0003pO-HC for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:45:56 -0500 Received: by mail-pj1-x1029.google.com with SMTP id e9so830340pjj.0 for ; Wed, 03 Feb 2021 17:45:53 -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=pMV4BySeK8KuIUlVV1lxW3l1A4MrToushLk684ASlQM=; b=qKoRnNM1V0rKUajNMEYrupKr1+Gxq4lBoSBpOzjwIwrWH2fFvl10/2P0IVCTcgnMWD /SvdNztn2tBMUiPhoEmgaHkzf3SYIxt9M6y/KvwiAMV+CEnuPzZ8HlAa6ik7g73eIvlJ 7ynCPjkOdcAp3ILeW9Bk1pzKYycixP1mtKwLQTkVKSDRwioj6KfcS3AhUJyZxfv86xcU fkUfSERsSX6W1E6MPBY8s4eU3Tb0SUkjaK8XimlnnAk8QmAtocSDLv1O/i8ZA+XixAz3 pMJKMpo2H1t9pwGhNhzN2Z0AJ2u6Aa8aYusrH8oDhWdIF6KW5Ir8lXU9TSrWsfkXTIrn nC3w== 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=pMV4BySeK8KuIUlVV1lxW3l1A4MrToushLk684ASlQM=; b=htnXhKIQ58OKDw2tKHnJO7NDkyo7Yb1m/v2G98OJdOAtirUE7+3z8yraffxNBxcfgi FmvA8WBsX+ZYutGVQsQP7r7GlX+6BrGmA6wVyxH42NSAEH9h5PsvEZfWSFhpMjDn1Too UGBWwYXUE0i80V/YeLg66CSPkXFRBe7N9F3NHumfx2uaRj7LRBvyjOsT/PoPNJwKFKXA amMLcT4O7vbq5ZPVDjGS6guBOSE33JsIzL1uVaIZCufL653v+WdtCxh82F+l5/4JiTF/ +sNotcn20Y4Z/mZgKGYKXp/wpC00I00dN8BiOLWzzsju01pYuxJaFCNAnhnhhQjRnUPU 0MSw== X-Gm-Message-State: AOAM53141D22GhV71aYK+CXQK/KxWB/0wJlwkMAUCkGGens/LrkOwqtK MJA54WhctadjQPGGAq/jNLjZko3w1oe2qpc2 X-Received: by 2002:a17:903:181:b029:df:c7e5:8e39 with SMTP id z1-20020a1709030181b02900dfc7e58e39mr5921269plg.25.1612403152244; Wed, 03 Feb 2021 17:45:52 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.45.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:45:51 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 21/93] tcg/tci: Merge INDEX_op_{st_i32,st32_i64} Date: Wed, 3 Feb 2021 15:43:57 -1000 Message-Id: <20210204014509.882821-22-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1029; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1029.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: sw@weilnetz.de, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Tested-by: Alex Bennée Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/tci.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index ee2cd7dfa2..eb70672efb 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -625,6 +625,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, *(uint16_t *)(t1 + t2) = t0; break; case INDEX_op_st_i32: + CASE_64(st32) t0 = tci_read_r32(regs, &tb_ptr); t1 = tci_read_r(regs, &tb_ptr); t2 = tci_read_s32(&tb_ptr); @@ -873,12 +874,6 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t2 = tci_read_s32(&tb_ptr); tci_write_reg(regs, t0, *(uint64_t *)(t1 + t2)); break; - case INDEX_op_st32_i64: - t0 = tci_read_r32(regs, &tb_ptr); - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_s32(&tb_ptr); - *(uint32_t *)(t1 + t2) = t0; - break; case INDEX_op_st_i64: t0 = tci_read_r64(regs, &tb_ptr); t1 = tci_read_r(regs, &tb_ptr); From patchwork Thu Feb 4 01:43:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376177 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp909267ejt; Wed, 3 Feb 2021 18:13:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJwcsWT+HjcvePAcOTn1nUTYjlgjdybXODqxJj8GRuP/D0ENN+QjLFX6hk4tbQHw0vHp8nYF X-Received: by 2002:a25:df94:: with SMTP id w142mr8770415ybg.14.1612404799947; Wed, 03 Feb 2021 18:13:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612404799; cv=none; d=google.com; s=arc-20160816; b=o4CYNMzqihz1fRae1g2pHeFbYfIpPeVOnM+U+9gaJfxaIjAmJqsqs+6LaK944h/ALx 8ZrjILRdXONo19VW9BnrWhrop6BZY2BgNOE78i6wL0jnlkEAfI74r/hZwGWulvBTGyVK EzXsr9hcq7WFOS98btljvHx1zpsmPmI6afOVvzg9DA8WIxf6cn0tl1u6XxTFeIcAbc6q YZjc1mvWrrfO/PmDjYn38de8Zpfu14FcdExPOfqCTFqXvhurv/MynzgsM4SnCNwQwfWF Q7CNjIpVjyVgOm6qB131YqidyYOdSqeeCwEUYEmgkyE0RlWrKqyOc9HjgbWEywRHre9J rJSg== 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=PJmFss8croBP2fe7sUR8rqNmFHSeMIecdaY2so4F4z0=; b=ZnVxU2esdVvwMlEyz8dV8+26C0+A8FspJkx6YpZJyXaiGN3GBrYrNevSjTmwqhfwCn X6+R3ZGz5NctytjO+ViiNx84fXR2LTPmBJtnmKptnjfKYhVuajk2h7nc5De4uSuXGZbj 45jViQmoxtXZvbp7YeFx5JHgw2eRKXgyU7g0krLXYHRhsCvqNAqeUOhRu2hYGvlYzkI9 AxslCwk8UaheOxcsUcucGkGkfTlWjWxK2BS6iuV4+eRqXB4WZo6xRZ4kVjfxdP4IbD/j 9cC/Az+Hu7LaH0S8/0i/R/fbLv+oCjV9iRw1Nd/3bfE5F99pAU9FGOz/gJVEjTxm1Y+w BeJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=p21AHYlE; 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 d193si3906617ybf.298.2021.02.03.18.13.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:13:19 -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=p21AHYlE; 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]:51062 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7U91-00041J-Aq for patch@linaro.org; Wed, 03 Feb 2021 21:13:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44466) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Tia-00051e-4l for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:01 -0500 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]:34696) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7TiW-0003pe-43 for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:45:59 -0500 Received: by mail-pj1-x1033.google.com with SMTP id my11so4243776pjb.1 for ; Wed, 03 Feb 2021 17:45:55 -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=PJmFss8croBP2fe7sUR8rqNmFHSeMIecdaY2so4F4z0=; b=p21AHYlEF2ucBz1JosZKGCJ6+4A/Xf83NilSNFh2f0bXJj/DfNQzzJLTYRTW0j1WX9 riI9pbCXpS4geJoBhP+4PAzBxE7EZTrnp8TXkCR7VodDbatXOnEeJZid2b89QezcNYnf 7B3VV3H0L1apGQEyQIAmFWRywXs41TFdUKCG9ULJU4TCTaR16iUz3h1NNZtrWDH5KNAT AWG0tFdNYVYtkbsrgd8xwhZ3iPlj3Inz4A3aJuUVaIVDQdje/+N5tpDTn5CZ9AVSwXsN psbfxoSaHNoVG+KpQCBtr0C1bvyaUDEX2kvkKpiRY22Y+IrnisQbdv7GrLQosFNjaG+f TvxA== 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=PJmFss8croBP2fe7sUR8rqNmFHSeMIecdaY2so4F4z0=; b=NFC4yzaP1uHR07487mTaG8fEGkdhX4mtDrtEgQ3wDvtl5vrn8FApO/WhUPAAMjwAd/ 1Aand+dg3e8zXHjADqYa8oEQl0BscyDQtX1Y1EPpTgTr6ez1IDhHLRxTUweH6Th4tmBQ H6Qy7O7I87WfIcsFkzcpcVRFIxV2eqmj22zTvUqFzKivJAFBtpuOySn3C3ves8Th0ncx 6CUB5n5di5ZaGoL/byK4jfz5iHMQIzwYmgFVHJfIRAZbFEqraXM0jgnE18J3HyONKQgQ 20OcicDwfBniCgAARxoHj+WkbFCh2PlQxDPzqMWCafvb/KhQAlnPwGMLlYBcJPcbjnDV dSOQ== X-Gm-Message-State: AOAM531QItVBOuL96Qz8M9hlemjp2vEY+ZdrmnkTrG13Gh8a23tzwVhI ylbrEC0wgl4alXOQ1Yzenu83ckFcxyZbYar5 X-Received: by 2002:a17:902:9a4a:b029:dc:435c:70ad with SMTP id x10-20020a1709029a4ab02900dc435c70admr5676762plv.77.1612403154013; Wed, 03 Feb 2021 17:45:54 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.45.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:45:53 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 22/93] tcg/tci: Use g_assert_not_reached Date: Wed, 3 Feb 2021 15:43:58 -1000 Message-Id: <20210204014509.882821-23-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1033.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: sw@weilnetz.de, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Three TODO instances are never happen cases. Other uses of tcg_abort are also indicating unreachable cases. Tested-by: Alex Bennée Reviewed-by: Stefan Weil Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/tci.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index eb70672efb..36d594672f 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -362,7 +362,7 @@ static bool tci_compare32(uint32_t u0, uint32_t u1, TCGCond condition) result = (u0 > u1); break; default: - TODO(); + g_assert_not_reached(); } return result; } @@ -404,7 +404,7 @@ static bool tci_compare64(uint64_t u0, uint64_t u1, TCGCond condition) result = (u0 > u1); break; default: - TODO(); + g_assert_not_reached(); } return result; } @@ -1114,7 +1114,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, tmp32 = qemu_ld_beul; break; default: - tcg_abort(); + g_assert_not_reached(); } tci_write_reg(regs, t0, tmp32); break; @@ -1163,7 +1163,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, tmp64 = qemu_ld_beq; break; default: - tcg_abort(); + g_assert_not_reached(); } tci_write_reg(regs, t0, tmp64); if (TCG_TARGET_REG_BITS == 32) { @@ -1191,7 +1191,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, qemu_st_bel(t0); break; default: - tcg_abort(); + g_assert_not_reached(); } break; case INDEX_op_qemu_st_i64: @@ -1221,7 +1221,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, qemu_st_beq(tmp64); break; default: - tcg_abort(); + g_assert_not_reached(); } break; case INDEX_op_mb: @@ -1229,8 +1229,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, smp_mb(); break; default: - TODO(); - break; + g_assert_not_reached(); } tci_assert(tb_ptr == old_code_ptr + op_size); } From patchwork Thu Feb 4 01:43:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376157 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp836855jah; Wed, 3 Feb 2021 17:58:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJxu81URlrln6LT0PwAKqDuXed+Swa8+QCFVMx4Rwi0Z4Sl4F6LPtzIi36jIzVTrV5JYYx3h X-Received: by 2002:a25:ea49:: with SMTP id o9mr8061301ybe.39.1612403914585; Wed, 03 Feb 2021 17:58:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612403914; cv=none; d=google.com; s=arc-20160816; b=0K3+LwlEVXRw8vupA2uB7dDWM7Vx1u9Abkyc+M/FCTgctTMoZ8LMbPZojl1llvBkQT aAVia9aMVvclzuqrv5T0NAoqmuADEyuZLz5ykpeaNQ0pXV7T7LgEdf4ZMLTVScw/Ta5X Vz1XBW4n84GFpPN8ycHNG1kCD5cqB5Np12mDpsh7aSFFVyUdLvH8YGlyk3uOFZnRkYoA b2mgLRY+xJd1xPHlWvWw8PSSijmk5cqnRLgEQ+1UWqQrCuiXwE4qFd1xOyGdiDWH3Ig9 D58Z2PHuVKZeBK3WvJ/KyF+A5aV0VsRXo0Xb9+x9OT3ByrCo6St7qcXNaM6QZq4uTehL ntBA== 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=rzqE8qXvCMMaAx4wVWdxYTRZ0dwbqGtPGHyjXMn8W48=; b=D4g3AMH1riR9Q8N329ehymV0xvbHZdOclhQl5VSZ3p8P0ZspSlo5BUOfpwWG29c2Td ZhXNALmb9gR+gJw59U2H0FpK43B16Is5BPZ0HD2JkAH2N00uRShG2XyLKCTeK3CP0MU6 YyIXgeZGjkhwg7S4Q0yag/WIV+wD5uOFbSJLM2uolt8QVUBDdMK6JO8OhH6uGFaasHHx X6FYtJHgzIBiB+hyaYv7urmhDWChr/Iy5cgG6/QiX9OVgH26uUVP7E9iKFIU77Ujfihw lW9xNvINi9Dtb05HJJv9Fsrh3I6AxNNk3u7sySK0GuF0DvHE9ZcEx9RK5nm4SnHNxiWl oOQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lZJQyPOO; 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 g11si3643243ybe.457.2021.02.03.17.58.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 17:58:34 -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=lZJQyPOO; 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]:36232 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7Tuk-0002ao-3S for patch@linaro.org; Wed, 03 Feb 2021 20:58:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44464) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7TiZ-00051I-VN for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:45:59 -0500 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]:38322) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7TiX-0003qU-0v for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:45:59 -0500 Received: by mail-pf1-x42b.google.com with SMTP id y205so1074765pfc.5 for ; Wed, 03 Feb 2021 17:45:56 -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=rzqE8qXvCMMaAx4wVWdxYTRZ0dwbqGtPGHyjXMn8W48=; b=lZJQyPOO1KRBaGJWUaxPtMbyv5ZnjpvVgchjfLMlgsJdrzobET4BPO1b0pwD6C8RzD ZMBrPcGfdgpK992RRyi57neonIkdb3J9WhzhqKSntZj7Wtoa40oN+hytYuNl06o/4ifj M0FWJjuAMMWU72G9kog9LrIZqM/a65o5uAP1Da9/8Xg+sgk+EB6NCaREiOzuUG7eYKkc popXNDg4UKZ5pUPs9vmn4eewx60rYi2xtt7BGd9dZCDrwC6z6kt2Kb/hN1D2U2VJEmi4 c1pzjE/VnFRfaEDnAByTlkcy5J7JEQiVprpvV6S62g3/O85zmHGlanAKxvAAcyNh9s4f YFOw== 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=rzqE8qXvCMMaAx4wVWdxYTRZ0dwbqGtPGHyjXMn8W48=; b=mxezS9+9UHSPheQSjivWonwHShUayNIct6enY3M34lqQ0LQ9Vfwb9vNDaiYqUtRISi HUu4YHflwiYWaZkRE/w+EWONEbYZAW8Zkq8+sUQb/v3nu/pCkO9wXIZwmzsL//imTjz2 ZB5IdI6HUuJW64d0W7WgA+r8oAEmNLBeS/pKbioUNOOS5OtSAaQyfncvIAxrNSj6VYlN VslpTSPi4YeP7j70Jns85vY8StzjHymiPbm/A/LFLAIoxBiFAN66iVpcdQU2Rx0kAmvg dApLHNJQjdmW6lUoWL6fkE2i19WbZQLvJw/XBFJF+N40q3x50h6DHxTolhCDXSGW06S5 Y7rQ== X-Gm-Message-State: AOAM5330jc+Dp1okB9QtS5D9kGJvmZQTODg8tktnxmFTVX2AKCV5g/Ea hpcJyeNJQIs9XCA+FHHJzn0GAFjesvafMUIa X-Received: by 2002:a63:4507:: with SMTP id s7mr6512529pga.390.1612403155898; Wed, 03 Feb 2021 17:45:55 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.45.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:45:55 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 23/93] tcg/tci: Remove dead code for TCG_TARGET_HAS_div2_* Date: Wed, 3 Feb 2021 15:43:59 -1000 Message-Id: <20210204014509.882821-24-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42b; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42b.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: sw@weilnetz.de, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We do not simultaneously support div and div2 -- it's one or the other. TCI is already using div, so remove div2. Tested-by: Alex Bennée Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/tci.c | 12 ------------ tcg/tci/tcg-target.c.inc | 8 -------- 2 files changed, 20 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index 36d594672f..25329345cf 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -652,7 +652,6 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t2 = tci_read_ri32(regs, &tb_ptr); tci_write_reg(regs, t0, t1 * t2); break; -#if TCG_TARGET_HAS_div_i32 case INDEX_op_div_i32: t0 = *tb_ptr++; t1 = tci_read_ri32(regs, &tb_ptr); @@ -677,12 +676,6 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t2 = tci_read_ri32(regs, &tb_ptr); tci_write_reg(regs, t0, t1 % t2); break; -#elif TCG_TARGET_HAS_div2_i32 - case INDEX_op_div2_i32: - case INDEX_op_divu2_i32: - TODO(); - break; -#endif case INDEX_op_and_i32: t0 = *tb_ptr++; t1 = tci_read_ri32(regs, &tb_ptr); @@ -908,11 +901,6 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_remu_i64: TODO(); break; -#elif TCG_TARGET_HAS_div2_i64 - case INDEX_op_div2_i64: - case INDEX_op_divu2_i64: - TODO(); - break; #endif case INDEX_op_and_i64: t0 = *tb_ptr++; diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index 82efb9af60..6dc5bac2f3 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -596,10 +596,6 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, case INDEX_op_remu_i64: /* Optional (TCG_TARGET_HAS_div_i64). */ TODO(); break; - case INDEX_op_div2_i64: /* Optional (TCG_TARGET_HAS_div2_i64). */ - case INDEX_op_divu2_i64: /* Optional (TCG_TARGET_HAS_div2_i64). */ - TODO(); - break; case INDEX_op_brcond_i64: tcg_out_r(s, args[0]); tcg_out_ri64(s, const_args[1], args[1]); @@ -639,10 +635,6 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, tcg_out_ri32(s, const_args[1], args[1]); tcg_out_ri32(s, const_args[2], args[2]); break; - case INDEX_op_div2_i32: /* Optional (TCG_TARGET_HAS_div2_i32). */ - case INDEX_op_divu2_i32: /* Optional (TCG_TARGET_HAS_div2_i32). */ - TODO(); - break; #if TCG_TARGET_REG_BITS == 32 case INDEX_op_add2_i32: case INDEX_op_sub2_i32: From patchwork Thu Feb 4 01:44:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376155 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp835972jah; Wed, 3 Feb 2021 17:56:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJymbQDjy+K14dpiJ2Jbwk2jaNzpirmki6tESVJlUbCK2Er+mWwOaoUQUoAe2ICXt7Ko+cv+ X-Received: by 2002:a25:384e:: with SMTP id f75mr8642324yba.358.1612403806355; Wed, 03 Feb 2021 17:56:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612403806; cv=none; d=google.com; s=arc-20160816; b=A9OvcI6Ch1pxr1fSmEPHmMNDNtYeS4sdbjyiExJrmbeLy1OD8uDsPCDZ2PRm7q+G+e LjpgGHBNs0Av+8A0MxQa5Gq39QZuEnxZ3tjSode11OBgCTTSSmZiUkpG3SJDzmrzQipJ YrqrIMC5pPZ6cjk0IvpS0mPwHyZIud0w5L0YlRJfkPg2L/+yS5st7DwxbyB4VKTK+t7G 8B4jBcgR/gI8kBQRauT4IPkwiNUMr0eIk0+yFcpCqwX96gcrJxJ3/zJGEFSaWuVPZUy9 z/Ls1bO9vG2HkwCGfDM0XIPeTTJi8wOcH4F9T3/wi11xx72saUfLXpR+FgdPHRaAiHct jH1w== 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=nPG7Xcmlwk2vyC0De6Qy+WTUFdq1vGPN65ZNzO4h0N8=; b=npmCi0gJtF+wWo4qgZQI4V60pSwpyeOTokWT/y7Aex2neJcdQB83KI7/1CPZSG5bv8 ltTt+0UpWOugA5AdSYWKgGbggpVJnXE7XqMMUGxswgI1fKdCM24IZlP2wEwgbvldAU2r oh2xtti92XXU8I5f7H1tPrj2nm0oXAgVrxvo2NyGcHEOs4i07FY8DlADSgiSDCz9Wkdq GR2P4DagIoj5luNvAHTds1zDrHuCE4PTaei/SIuu67cjfLoCJq1EfGhBqvBZRnpbHStW 1/XNymuhlw8IBWQ28qM7lTGvTe/SsiME7glT3IwFWHBV2MbNO+RJ5naLku0fph4hH0zO dVrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=e22Jbndu; 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 s6si4147963ybc.233.2021.02.03.17.56.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 17:56:46 -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=e22Jbndu; 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]:59346 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7Tsz-0000Vt-Qj for patch@linaro.org; Wed, 03 Feb 2021 20:56:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44568) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Tij-00059z-Ka for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:11 -0500 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]:35044) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7TiZ-0003qb-LL for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:07 -0500 Received: by mail-pf1-x434.google.com with SMTP id w14so1083861pfi.2 for ; Wed, 03 Feb 2021 17:45:58 -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=nPG7Xcmlwk2vyC0De6Qy+WTUFdq1vGPN65ZNzO4h0N8=; b=e22JbnducbnrgrRCACzwQIkeItCT0UJ7+xsgYFcc+vBheGLKBNa4rEok3A0svO/XZS m9Ud3MqcDsGKdcOZog+LE1YLkjojxk9tJkvsz030bLgDfdH7klFgDen4URedo6WSTVhv 3Hl/Qy0o7XMJcJAvtInwJh54Hc8TgYvff5TIOtfxPWKgEixA9zHn6oWidXgnVtjmNB3o +eHe40D/XE6dmFU2CcTYFCL0+JqS0ErglNc0+kIYsdhPe767HrTDnzDzGkMT3YI41RUy ytdnSnQJ4R+H0T0ZZFbGG7G83BmJ2T868SuNgGnUdP9+SIDgZDW2nuzVxOhlqw0f2jKj P/SQ== 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=nPG7Xcmlwk2vyC0De6Qy+WTUFdq1vGPN65ZNzO4h0N8=; b=BW1Wb3QDF8RyEhYWSPiG2ZLykFbJK/9dKuY+m7qfkRwZCgzW3XCvmRzcOVeFvQKswA H/TDV0t7kKZEHbNundBBwVui2Cv5a1LlFWkSrQYUar+VCKip3hrk76SwRtm2Sd9rucSt zaDAcsyokzCgmlcKROHoAIV4a8qgJ5PE320XYbA7OQygFpq1IpfpPAVnrFrbnh5B8pb1 XKoWESLsrTEffcFGOdABvCUaNkCbKQj32srpkZi7VrWKoZYwzTvcn7GPLa3gnws0vlR7 Kwb4fEyk4SmGgl/srAUg+rpb73elk8YRYREzBPO2zcnIVrYJAhyPMBdv+G/v4tGiM4Ww 6dfw== X-Gm-Message-State: AOAM5323cS5dNI0pn9EGPtWlrqavk+z8en6MXrJ9sTcIjAvq2vvc8ZCw akLhD9NqTgf7IAhxCo0yxDrp+sSgFwVSl3Fk X-Received: by 2002:a63:d855:: with SMTP id k21mr6414313pgj.399.1612403157494; Wed, 03 Feb 2021 17:45:57 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.45.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:45:56 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 24/93] tcg/tci: Implement 64-bit division Date: Wed, 3 Feb 2021 15:44:00 -1000 Message-Id: <20210204014509.882821-25-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-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: sw@weilnetz.de, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Trivially implemented like other arithmetic. Tested via check-tcg and the ppc64 target. Tested-by: Alex Bennée Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/tci/tcg-target.h | 4 ++-- tcg/tci.c | 28 ++++++++++++++++++++++------ tcg/tci/tcg-target.c.inc | 10 ++++------ 3 files changed, 28 insertions(+), 14 deletions(-) -- 2.25.1 diff --git a/tcg/tci/tcg-target.h b/tcg/tci/tcg-target.h index bb784e018e..7fc349a3de 100644 --- a/tcg/tci/tcg-target.h +++ b/tcg/tci/tcg-target.h @@ -100,8 +100,8 @@ #define TCG_TARGET_HAS_extract_i64 0 #define TCG_TARGET_HAS_sextract_i64 0 #define TCG_TARGET_HAS_extract2_i64 0 -#define TCG_TARGET_HAS_div_i64 0 -#define TCG_TARGET_HAS_rem_i64 0 +#define TCG_TARGET_HAS_div_i64 1 +#define TCG_TARGET_HAS_rem_i64 1 #define TCG_TARGET_HAS_ext8s_i64 1 #define TCG_TARGET_HAS_ext16s_i64 1 #define TCG_TARGET_HAS_ext32s_i64 1 diff --git a/tcg/tci.c b/tcg/tci.c index 25329345cf..5c84a1c979 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -894,14 +894,30 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t2 = tci_read_ri64(regs, &tb_ptr); tci_write_reg(regs, t0, t1 * t2); break; -#if TCG_TARGET_HAS_div_i64 case INDEX_op_div_i64: - case INDEX_op_divu_i64: - case INDEX_op_rem_i64: - case INDEX_op_remu_i64: - TODO(); + t0 = *tb_ptr++; + t1 = tci_read_ri64(regs, &tb_ptr); + t2 = tci_read_ri64(regs, &tb_ptr); + tci_write_reg(regs, t0, (int64_t)t1 / (int64_t)t2); + break; + case INDEX_op_divu_i64: + t0 = *tb_ptr++; + t1 = tci_read_ri64(regs, &tb_ptr); + t2 = tci_read_ri64(regs, &tb_ptr); + tci_write_reg(regs, t0, (uint64_t)t1 / (uint64_t)t2); + break; + case INDEX_op_rem_i64: + t0 = *tb_ptr++; + t1 = tci_read_ri64(regs, &tb_ptr); + t2 = tci_read_ri64(regs, &tb_ptr); + tci_write_reg(regs, t0, (int64_t)t1 % (int64_t)t2); + break; + case INDEX_op_remu_i64: + t0 = *tb_ptr++; + t1 = tci_read_ri64(regs, &tb_ptr); + t2 = tci_read_ri64(regs, &tb_ptr); + tci_write_reg(regs, t0, (uint64_t)t1 % (uint64_t)t2); break; -#endif case INDEX_op_and_i64: t0 = *tb_ptr++; t1 = tci_read_ri64(regs, &tb_ptr); diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index 6dc5bac2f3..3327ce3072 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -577,6 +577,10 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, case INDEX_op_sar_i64: case INDEX_op_rotl_i64: /* Optional (TCG_TARGET_HAS_rot_i64). */ case INDEX_op_rotr_i64: /* Optional (TCG_TARGET_HAS_rot_i64). */ + case INDEX_op_div_i64: /* Optional (TCG_TARGET_HAS_div_i64). */ + case INDEX_op_divu_i64: /* Optional (TCG_TARGET_HAS_div_i64). */ + case INDEX_op_rem_i64: /* Optional (TCG_TARGET_HAS_div_i64). */ + case INDEX_op_remu_i64: /* Optional (TCG_TARGET_HAS_div_i64). */ tcg_out_r(s, args[0]); tcg_out_ri64(s, const_args[1], args[1]); tcg_out_ri64(s, const_args[2], args[2]); @@ -590,12 +594,6 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, tcg_debug_assert(args[4] <= UINT8_MAX); tcg_out8(s, args[4]); break; - case INDEX_op_div_i64: /* Optional (TCG_TARGET_HAS_div_i64). */ - case INDEX_op_divu_i64: /* Optional (TCG_TARGET_HAS_div_i64). */ - case INDEX_op_rem_i64: /* Optional (TCG_TARGET_HAS_div_i64). */ - case INDEX_op_remu_i64: /* Optional (TCG_TARGET_HAS_div_i64). */ - TODO(); - break; case INDEX_op_brcond_i64: tcg_out_r(s, args[0]); tcg_out_ri64(s, const_args[1], args[1]); From patchwork Thu Feb 4 01:44:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376163 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp840162jah; Wed, 3 Feb 2021 18:03:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJwF/eMe9jk7st3Z0OJdEqUucICegQMPB6YDYZw0yxKKF6vsKRK9Em62Ch6Me+jixhPKXw64 X-Received: by 2002:a25:e606:: with SMTP id d6mr9192286ybh.187.1612404210390; Wed, 03 Feb 2021 18:03:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612404210; cv=none; d=google.com; s=arc-20160816; b=cdNomOkubS7jsvx+M0r1Pu9yr8eeQiQ5lLtDTQ2WEQrsEGqBm1mOcK9TSZtmY354uW DFipMhLet94Joq7DhFpdoQ0fKH9zCDT/qt1IdRQpcJmF6Rx3U6SE0K+4Itna0iN/aiEh n1ny4new4bktpgyxDRw2LS9bfJ41QP0OV6mV1vyObiRfxnS4kdraM7npHQJ9rlhPS7h3 l+IIpq691vaxvluq1fCvj6e8IDho+98S9t1RqDAzM7eHXVFQKFCgL442ask6W2lN1IDT DduInTEXJBWXNR4/fEsAB98kZPZgmzPjv9koUwAJogdeIl9JiWNmiK/I8KSOk/uXDkYq d3tQ== 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=5oMkWTFAvkbENXCd9UcZlqUmvtysI4E37yjhcZ4CH7A=; b=uEQqqfBQLqhuLDYEyMIaCLqCUdBXwvV8csLqJzLXJher+O/TclgKGsh5UE1a2GEbTv cl+8tqYUoVCXiU9+C8HpR+WPJ9VZY6FGBqun2QPOuuoMogRqdKuXZUKxkh7LBkBwx4gX hVRR5bnmz7r+K6ZMPedu+5e2M+sl8V+Q6ZMIc7Fxfd4rLuZO6ViYw1a+qTAi+UvczVQx wGLPxY/QLxEAL4QW62/qfy6Kk48I+5EgnYidcxl1PguQJRIhOPXAbsKeNRgZ7NL+5tuK hjHV11HL0uT0FkqGxdvFp8ZyCUZ5fhmjGj1BNTX0fOP0o9ffBVNxk1w1+P0u1Jzb7D4v 3kIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xle5V4a4; 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 k13si3935168ybj.5.2021.02.03.18.03.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:03:30 -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=xle5V4a4; 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]:52754 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7TzV-00018a-Rt for patch@linaro.org; Wed, 03 Feb 2021 21:03:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44518) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Tid-00055o-OZ for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:04 -0500 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]:35046) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Tib-0003rU-Fc for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:03 -0500 Received: by mail-pf1-x436.google.com with SMTP id w14so1083911pfi.2 for ; Wed, 03 Feb 2021 17:46:00 -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=5oMkWTFAvkbENXCd9UcZlqUmvtysI4E37yjhcZ4CH7A=; b=xle5V4a4kqCv2nbTnmDL1F5pLKB1kQsToVwsq+57vmouygcUOMz0DRYxoFk66YLJMS 2I/OyMbguKM637Ll58JPW5VNV14Ked7Ei4Xu0PTH5jvByAMLTCu/7TmnL8LCR847qPL0 yXy2P9F7Fb5cy/vRaj5/jv+vfD8HJQwtqXd4HvYQkNHHLHhCOTllppVRwPRtXr6ecysa g5g3ZsDMJUkNGYYulquvsOsl/6fdXwTYXLJSvRS2QcNp5AC2xjOg1JnN+LzH+RDBa1l8 unmxyCA2k/tTBeC2x3xGUvfgm3pm8lQKo5vcyBlDDMuhacfWF0PmKVDmbywz5ZvFEGCL Q4/A== 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=5oMkWTFAvkbENXCd9UcZlqUmvtysI4E37yjhcZ4CH7A=; b=dHa6J6aZTntZ5y3FLXeIIoVS3tPuKg1GJ2kDTT1z33OQBtnJskHM0yzt6IoePipntT SEhbsaKssAHT9pfG8wCQhY+UBPYHmWXiPk2NdNSwgcTWpTa58jD9FVbH5uQ6GXNBIKcu ffFKqFH2ZLgZ8dh6dIoY7IAfPm6zqAGQ5Bf5BgSZDliSXlmFEyFQnoDmPQT4mwyIQ4ol +qXt6icTDi1HddqyJE4c/0vQQnRNrlIkl95JRXCsx1CzLkoHNQu0kKuTfjYZiEulgyQn 7Y0JpTX23i9TtFVxDWhSY072A+qcdQv//7o4LaGKzZR1RNECE0yOK8m5H8NCL6DrJiAY szmQ== X-Gm-Message-State: AOAM532GgPNz9+PCNpBVoFaI4yjQ/Ciy5VEdWXtAUbu5UbR3jgaCw6S2 i/VuzzmfPparTbx4B2WWnttrCyypgqrHcJrz X-Received: by 2002:a63:c1d:: with SMTP id b29mr6618739pgl.9.1612403159413; Wed, 03 Feb 2021 17:45:59 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.45.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:45:58 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 25/93] tcg/tci: Remove TODO as unused Date: Wed, 3 Feb 2021 15:44:01 -1000 Message-Id: <20210204014509.882821-26-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::436; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x436.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: sw@weilnetz.de, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Tested-by: Alex Bennée Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/tci.c | 8 -------- 1 file changed, 8 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index 5c84a1c979..e0d815e4b2 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -33,14 +33,6 @@ #include "tcg/tcg-op.h" #include "qemu/compiler.h" -/* Marker for missing code. */ -#define TODO() \ - do { \ - fprintf(stderr, "TODO %s:%u: %s()\n", \ - __FILE__, __LINE__, __func__); \ - tcg_abort(); \ - } while (0) - #if MAX_OPC_PARAM_IARGS != 6 # error Fix needed, number of supported input arguments changed! #endif From patchwork Thu Feb 4 01:44:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376166 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp905682ejt; Wed, 3 Feb 2021 18:06:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJwTFKF/jPqLhQUSPjBkXMf1OxsOfqaJMLms9hK/3QSucZrKsRwrqI5RDDEjK/p/XhjXtgJX X-Received: by 2002:a25:f309:: with SMTP id c9mr8410474ybs.379.1612404386930; Wed, 03 Feb 2021 18:06:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612404386; cv=none; d=google.com; s=arc-20160816; b=0sCQlLPs4+fLOoR9w6N3I/FbnY4lCQEKcQMVO59yY4wZacW8CCDY1x1H1gf+cgkLPF lpbEpEnFWqF8UtJLY5oyh91/aIk55QfEs5wDQBwN0v6y577nMz5OthPqyN9MSeeOoBdq 1oIyzjUz0nDklwPRUsbEzuSp+B33bfAc7FI3V3+M5n2yBbONzc9hwgjiCbnXM+hHhCMH Av4/za4vbISsiC9TuhHQSjgWQMgT6mOBWRDyRYkrAs0RVtNJB0zu4j7+dqQbuNU2RshI aT43GDhwOldAzjRDbIs+Dqr+0oQ8G6fRf7lSdgva1YeGwZM0gL7cD6KdFsqOjL3k7xl2 czbw== 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=16lbvRerppaZSdDTN+VtWDIyr6a+gIglS3gZgOzl7iY=; b=tG1+UNacnFDhd9eH1m0kJ6QcfqYfyS4gNizboDSt2mF8ggiSLZ2/M+3HH2LHUxDVeO irbWP3pUCIMcwna/sBfn+rEwASKtVvQT7aPxRFxit99Rtpe+G1ygcWunHY5JftGPTQ6l Qg3Vmr8OlLJMylXHtV7fbfbBgws4jV+A/TNzaL3N3LbAcF4yv+Cfx7NhU0Mf3JmkkmFj +h4Zvc083v00QXJ3CgCTJPve3eR3bSyjhn+KtaHab+M+ylA82GTdsMtDYWKCokDL9/r2 YGKv/zZ4iU0A/vjP2NtODGxx9MaAp7vXtNjQBHVj89XZDVFobUwT580lxAh9rvMTCx04 O+3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=R4NvyATn; 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 y14si2760732ybm.194.2021.02.03.18.06.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:06:26 -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=R4NvyATn; 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]:33120 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7U2M-0004mV-8J for patch@linaro.org; Wed, 03 Feb 2021 21:06:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44570) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Tij-0005AB-LN for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:11 -0500 Received: from mail-pg1-x531.google.com ([2607:f8b0:4864:20::531]:36959) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Tic-0003rj-KM for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:09 -0500 Received: by mail-pg1-x531.google.com with SMTP id z21so1039295pgj.4 for ; Wed, 03 Feb 2021 17:46:02 -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=16lbvRerppaZSdDTN+VtWDIyr6a+gIglS3gZgOzl7iY=; b=R4NvyATnmW0tH/hLoTG1oouQSwlPgDOlAYfc57Mub4FXMUqG45m86M3eHaTp395kWu lOoRLPs7CXXYFA0V1XqcdxadaQDwpMjc9gwsf8jryta3GFK+M8BWfJYbv1Dv5WDjH4RU 8qG8t8ee71QcJ0wEJdADqCwMOCwUTHHvBXFAK3w2fmpC2UPV+CjcOtTYK4lC3BTpcn/n olC77t8Cx9+xgK0iFTqsb4ysqtqKA/b9K1EDQMZ0GksDt5Xa6QooYHEh+VBMtQ+JFyRR uQeaVpvFD+J0Ulul4PCxko9/uCagWb1N4emJbx8h58PNhfLicgglduBL9iMGjaOPsCb/ qiWQ== 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=16lbvRerppaZSdDTN+VtWDIyr6a+gIglS3gZgOzl7iY=; b=KyeJQZVTaNORYsjinR88eFoKZhDeLDUWTeGZJ8ILxhX36o+a5oSCFUF6DlJy8Dytm0 0UkVHgv/wKbW2XSd/Xsttl+f7Zqr50GDWrjiQh0cB0jG900n+EbCp0aDF76SMuW2aJjt thwbQqaCgKAn+DbH4Wu/oHgyQJnlggd/o2Qw9QJiRxU4DYXiyOLSKEzQcADNCZerstRh qXQkEBUxyct5SfuVsAgtpoNCMfkSEembI/kJaZNmm5hWIo+Z7EeH08OYhyWBL4n5SgOP WHcN0N6X4VC3KA0bjo25BKNQL3HV/XupoHoR+lGvfRoNnr6hmbDXVi1qsBGD4eRMJGJw pXeA== X-Gm-Message-State: AOAM532+nBaX5JSsdr2IzwNTY2NPhCj9Bn8/uF5uggx9P7G0sQIWH18q CiUC3jBFPIODvpOQG0SqqzIEXNwOJPmCVaV6 X-Received: by 2002:a62:80d3:0:b029:1c0:c5de:ff68 with SMTP id j202-20020a6280d30000b02901c0c5deff68mr5690901pfd.79.1612403161213; Wed, 03 Feb 2021 17:46:01 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.45.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:46:00 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 26/93] tcg/tci: Restrict TCG_TARGET_NB_REGS to 16 Date: Wed, 3 Feb 2021 15:44:02 -1000 Message-Id: <20210204014509.882821-27-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::531; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x531.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" As noted in several comments, 8 regs is not enough for 32-bit to perform calls, as currently implemented. Shortly, we will rearrange the encoding which will make 32 regs impossible. Signed-off-by: Richard Henderson --- tcg/tci/tcg-target.h | 32 +++++--------------------------- tcg/tci/tcg-target.c.inc | 26 -------------------------- 2 files changed, 5 insertions(+), 53 deletions(-) -- 2.25.1 Reviewed-by: Alex Bennée diff --git a/tcg/tci/tcg-target.h b/tcg/tci/tcg-target.h index 7fc349a3de..8f7ed676fc 100644 --- a/tcg/tci/tcg-target.h +++ b/tcg/tci/tcg-target.h @@ -133,11 +133,8 @@ #define TCG_TARGET_HAS_mulu2_i32 1 #endif /* TCG_TARGET_REG_BITS == 64 */ -/* Number of registers available. - For 32 bit hosts, we need more than 8 registers (call arguments). */ -/* #define TCG_TARGET_NB_REGS 8 */ +/* Number of registers available. */ #define TCG_TARGET_NB_REGS 16 -/* #define TCG_TARGET_NB_REGS 32 */ /* List of registers which are used by TCG. */ typedef enum { @@ -149,7 +146,6 @@ typedef enum { TCG_REG_R5, TCG_REG_R6, TCG_REG_R7, -#if TCG_TARGET_NB_REGS >= 16 TCG_REG_R8, TCG_REG_R9, TCG_REG_R10, @@ -158,33 +154,15 @@ typedef enum { TCG_REG_R13, TCG_REG_R14, TCG_REG_R15, -#if TCG_TARGET_NB_REGS >= 32 - TCG_REG_R16, - TCG_REG_R17, - TCG_REG_R18, - TCG_REG_R19, - TCG_REG_R20, - TCG_REG_R21, - TCG_REG_R22, - TCG_REG_R23, - TCG_REG_R24, - TCG_REG_R25, - TCG_REG_R26, - TCG_REG_R27, - TCG_REG_R28, - TCG_REG_R29, - TCG_REG_R30, - TCG_REG_R31, -#endif -#endif + + TCG_AREG0 = TCG_REG_R14, + TCG_REG_CALL_STACK = TCG_REG_R15, + /* Special value UINT8_MAX is used by TCI to encode constant values. */ TCG_CONST = UINT8_MAX } TCGReg; -#define TCG_AREG0 (TCG_TARGET_NB_REGS - 2) - /* Used for function call generation. */ -#define TCG_REG_CALL_STACK (TCG_TARGET_NB_REGS - 1) #define TCG_TARGET_CALL_STACK_OFFSET 0 #define TCG_TARGET_STACK_ALIGN 16 diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index 3327ce3072..7e3bed811e 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -187,7 +187,6 @@ static const int tcg_target_reg_alloc_order[] = { TCG_REG_R5, TCG_REG_R6, TCG_REG_R7, -#if TCG_TARGET_NB_REGS >= 16 TCG_REG_R8, TCG_REG_R9, TCG_REG_R10, @@ -196,7 +195,6 @@ static const int tcg_target_reg_alloc_order[] = { TCG_REG_R13, TCG_REG_R14, TCG_REG_R15, -#endif }; #if MAX_OPC_PARAM_IARGS != 6 @@ -216,15 +214,11 @@ static const int tcg_target_call_iarg_regs[] = { #if TCG_TARGET_REG_BITS == 32 /* 32 bit hosts need 2 * MAX_OPC_PARAM_IARGS registers. */ TCG_REG_R7, -#if TCG_TARGET_NB_REGS >= 16 TCG_REG_R8, TCG_REG_R9, TCG_REG_R10, TCG_REG_R11, TCG_REG_R12, -#else -# error Too few input registers available -#endif #endif }; @@ -245,7 +239,6 @@ static const char *const tcg_target_reg_names[TCG_TARGET_NB_REGS] = { "r05", "r06", "r07", -#if TCG_TARGET_NB_REGS >= 16 "r08", "r09", "r10", @@ -254,25 +247,6 @@ static const char *const tcg_target_reg_names[TCG_TARGET_NB_REGS] = { "r13", "r14", "r15", -#if TCG_TARGET_NB_REGS >= 32 - "r16", - "r17", - "r18", - "r19", - "r20", - "r21", - "r22", - "r23", - "r24", - "r25", - "r26", - "r27", - "r28", - "r29", - "r30", - "r31" -#endif -#endif }; #endif From patchwork Thu Feb 4 01:44:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376183 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp912658ejt; Wed, 3 Feb 2021 18:19:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJybugeLOIEmYC0oDIkYRNjV+DaellRV8p/EzVbHW+agL00VwJoLywHKQdUrGKy8HdV/U10X X-Received: by 2002:a25:7009:: with SMTP id l9mr9440796ybc.118.1612405173834; Wed, 03 Feb 2021 18:19:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612405173; cv=none; d=google.com; s=arc-20160816; b=ERU4PFpuj71HbHnYyx6qkh9pGoNKPkOqT3TLueC7e0ijZug3f2U15SpKZ9zBGmy/QG 8NUuM/irAPrbf9Xv7hJGeF31FYc+yWe2t0vBBJfGLWEcIqtWZUQT83koUcmVVrQga+al G+QCGoZKQSyX9t1AMnbeH4yb7j9Qe6kD1PXnfIhEOlguYBr2RuoV+f8HnKc3aEmlfjJC v4BmSS20Frb9IjUBTNPY6IVExadkus6VMgSmvT4nHpFlJUgTKMIJDmC/D7DdHOV8YOHb f9QUAVLrTZDWa+kamcSA92n49kNUoA237CjF+FP7AoUxCC2yydP9v64C/GuTgn86llrr AlLg== 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=jQllLPStMSpXHN7NTbXqzAr+6+LQfKhn+prBrsPItko=; b=lA2yx28olWOV8x/1/S7ukkCGUGOcWYJTmZzMnpOLuVVFP1nSO9WNj/yCbhuoUUFxhE Xfl6IPECFMYI2OnxOUjxbmcqNU7CftfKjtWVrSbNKo0DSIKDOkFTrjNPG1PMpH3G3yWl +bO/JGvtcdpnyf/IL4fUC19xnsv0YVVGR6lZtCQb52F1QXyna1CnNJngZrMf4Cbi8xVE r//OdbLhoDNxLlM1drZpnhEIjB2V6GZl2BUphpXbbG6KCHQnD7Y/TmTXo000A9I8Lewq YwvlGkb9fGur5ZvEwj8xrm2OSmcuyJIyWHp74agHtn6sjzoppbrPox4AcN/IyMw6jifG ooZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=T7gx58sf; 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 j126si3544564ybb.41.2021.02.03.18.19.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:19:33 -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=T7gx58sf; 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]:39268 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7UF2-0002kB-VX for patch@linaro.org; Wed, 03 Feb 2021 21:19:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44618) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Tin-0005B9-BM for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:15 -0500 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]:34560) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Tid-0003sM-Sp for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:13 -0500 Received: by mail-pl1-x62c.google.com with SMTP id u15so904047plf.1 for ; Wed, 03 Feb 2021 17:46:03 -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=jQllLPStMSpXHN7NTbXqzAr+6+LQfKhn+prBrsPItko=; b=T7gx58sfcOcVq3/jelk2LUWq3qrkCIfnRtVKOXZMyibprPGKIvN5uVRVt9A3vdnonF i+SKczPklN2tuolzwPWwgzGJ49sbRoK2W515hMKauRkGOrp60A6CHZLKPJvoPExdIh9T NyYzVRoMEt27boiANqqY8pbGv822rGEQLv2t61YvwF+78YqqdaUs96hiEQfxnueVzl9E Bb3Fonaw34qt086HoGjfp7Q+ZTMmb/49rxnjwH27HSzAI2dWTqUiHe12OhOGIJI/ZubE io+5N/I7TKJUhzE68/bhdVuJ4QqYghVLr22x8mJCNK6YgrDcG1XDV4nsVIcusTRsMvxt QBuw== 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=jQllLPStMSpXHN7NTbXqzAr+6+LQfKhn+prBrsPItko=; b=PWMw3eC26PsN7mBhiNoryUjkf17OC9EKFQt4Oif5Qh8NLivUWiHYJNrDjatE0Mc4Xx uWhTO+sKyJ+bCKqvIZ0Hpq9rPCrgqfRlMpTmU7yVxtoshR7Ca22VwJ/L5896Beuyl0C0 yJ0nr5TzNq43wRCmmE0pWPNAaHK+0YuIXORD8E9NfDKr5IQsaTwe+QuTJ5t153i4HU2c MoCcoS+X+kro1JD3qwWXxApHBUVt8XXfM7rNnGr7e4tuR+qShoQMsGpeaULZmtyvbmug bV6EDPOVkxjiEjWCnoTU6PO5OooT4fGkqUv0L+donrSPL4sdUt4G+XFdO11nhI7zRQhx NkjA== X-Gm-Message-State: AOAM531z560PejwkgqYkLxaAntpvoaIGO4MAG5CLmb5obTThpH8kwhZb ehaJXqHdNFwURtrYBWpSKkrwKo1oNRfTDXBA X-Received: by 2002:a17:90a:ce89:: with SMTP id g9mr5786744pju.42.1612403162730; Wed, 03 Feb 2021 17:46:02 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.46.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:46:02 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 27/93] tcg/tci: Fix TCG_REG_R4 misusage Date: Wed, 3 Feb 2021 15:44:03 -1000 Message-Id: <20210204014509.882821-28-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-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: , Cc: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This was removed from tcg_target_reg_alloc_order and tcg_target_call_iarg_regs on the assumption that it was the stack. This was incorrectly copied from i386. For tci, the stack is R15. By adding R4 back to tcg_target_call_iarg_regs, adjust the other entries so that 6 (or 12) entries are still present in the array, and adjust the numbers in the interpreter. Signed-off-by: Richard Henderson --- tcg/tci.c | 8 ++++---- tcg/tci/tcg-target.c.inc | 7 +------ 2 files changed, 5 insertions(+), 10 deletions(-) -- 2.25.1 Reviewed-by: Alex Bennée diff --git a/tcg/tci.c b/tcg/tci.c index e0d815e4b2..935eb87330 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -511,14 +511,14 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, tci_read_reg(regs, TCG_REG_R1), tci_read_reg(regs, TCG_REG_R2), tci_read_reg(regs, TCG_REG_R3), + tci_read_reg(regs, TCG_REG_R4), tci_read_reg(regs, TCG_REG_R5), tci_read_reg(regs, TCG_REG_R6), tci_read_reg(regs, TCG_REG_R7), tci_read_reg(regs, TCG_REG_R8), tci_read_reg(regs, TCG_REG_R9), tci_read_reg(regs, TCG_REG_R10), - tci_read_reg(regs, TCG_REG_R11), - tci_read_reg(regs, TCG_REG_R12)); + tci_read_reg(regs, TCG_REG_R11)); tci_write_reg(regs, TCG_REG_R0, tmp64); tci_write_reg(regs, TCG_REG_R1, tmp64 >> 32); #else @@ -526,8 +526,8 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, tci_read_reg(regs, TCG_REG_R1), tci_read_reg(regs, TCG_REG_R2), tci_read_reg(regs, TCG_REG_R3), - tci_read_reg(regs, TCG_REG_R5), - tci_read_reg(regs, TCG_REG_R6)); + tci_read_reg(regs, TCG_REG_R4), + tci_read_reg(regs, TCG_REG_R5)); tci_write_reg(regs, TCG_REG_R0, tmp64); #endif break; diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index 7e3bed811e..aba7f75ad1 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -181,9 +181,7 @@ static const int tcg_target_reg_alloc_order[] = { TCG_REG_R1, TCG_REG_R2, TCG_REG_R3, -#if 0 /* used for TCG_REG_CALL_STACK */ TCG_REG_R4, -#endif TCG_REG_R5, TCG_REG_R6, TCG_REG_R7, @@ -206,19 +204,16 @@ static const int tcg_target_call_iarg_regs[] = { TCG_REG_R1, TCG_REG_R2, TCG_REG_R3, -#if 0 /* used for TCG_REG_CALL_STACK */ TCG_REG_R4, -#endif TCG_REG_R5, - TCG_REG_R6, #if TCG_TARGET_REG_BITS == 32 /* 32 bit hosts need 2 * MAX_OPC_PARAM_IARGS registers. */ + TCG_REG_R6, TCG_REG_R7, TCG_REG_R8, TCG_REG_R9, TCG_REG_R10, TCG_REG_R11, - TCG_REG_R12, #endif }; From patchwork Thu Feb 4 01:44:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376168 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp905958ejt; Wed, 3 Feb 2021 18:06:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJxxvo0ovowfkh+p9nltn0p5vy9m0vWXvC6uwK0YaNtM2g5ExV/Xg3GAbClvhVcF4cofU9Fi X-Received: by 2002:a25:5582:: with SMTP id j124mr8653664ybb.309.1612404418403; Wed, 03 Feb 2021 18:06:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612404418; cv=none; d=google.com; s=arc-20160816; b=dcE+96F+W3cUZbrvRL2VYYpIKZ9kt/YwyEyribkAkEaCuHqvw7+8ts02GpJkD6WOQR 1UhIEik8WCHfrYKwkPsWBTc9R38GZrsvoqKfjaAMkqHxJ4gSdUPA3UXZUrBEx4an6kt4 NPvG1msshff4XZR/iKHkHkIcb9p+RadZPCnnrbwkRfK/cwOo+xgcK3G6xTOwyAkeC5hn 2Vc1ZAHVwXtyfdlrSu6qEWmzmqKaGX5M41s3XCPrEuTWYi7nVxi+fTZc7zyI3fZX4v9T aDjcw1LInPvoerf79fCWDgK8uFJaxdUT3RzapxWSUSJ7zCGBhLX0EEYhpyhLjiAXskz5 eh5Q== 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=LkYGLsnE5odHBLHKRYujD0SaJ6+i8O1fF0r+gNXotZQ=; b=ex1crNYeOoGp91TzSfgsKm+TjEtsRGLfU2qxRb4IUPvWKtZcM6KA2y/IXtlYW0nuDO ZrMBG6qwQARmaok2TovWqb4AHjTMo6XELe7RVTz4dIznaxz3lvfwT34pJPXy6YVW/koz VdN7UYAHD5r1cy6rOmKW6vZbmXx/EURfZwMvasNKvAsXQAqjt75Diw+LetEdonFORoFL WGft0Z9hqKxZKwaQkjZjPLuuXN4ZPeh6eYgjYGel1U4J+Y0Yk6i378g0Eg4DMEVIAQRo JklvBBfqH5MR457TvWziS+rTz1yImnQlb9S62mHgiAxshVzCfNjcff9iWmJetyZGkvWc zR3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eZsQKtec; 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 t12si3975097ybc.276.2021.02.03.18.06.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:06:58 -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=eZsQKtec; 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]:36062 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7U2q-0005xY-AU for patch@linaro.org; Wed, 03 Feb 2021 21:06:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44664) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Tiq-0005C3-2o for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:19 -0500 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]:46282) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Tif-0003tu-DK for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:15 -0500 Received: by mail-pl1-x634.google.com with SMTP id u11so864851plg.13 for ; Wed, 03 Feb 2021 17:46:04 -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=LkYGLsnE5odHBLHKRYujD0SaJ6+i8O1fF0r+gNXotZQ=; b=eZsQKtecqisRl1xpSbVWYv80cWI/zD78JCH1ptNNjh2+TC8Fc+Ja6NzYWeK+ZRnzaZ Q/PzfWCgMdQlmJcDKwyxIIxpDRPtaud1B4Vu/bxujwbdXvTVa1cc/LKHHVTKxF/JGyqu 6as0fNPk94jAdE/BMUok5nzGN6KV7QvEdyvEtKnMOA5T/8wRf3MNMGt1dOvQ9xLmLhxI a4LbpVvw5xTTCZ5ogHPpZqbovD1MyTvvqoPjSzs9irbvfbbucN9QRGpC9A3ihvunaxIH gGmNQz9U5wJqgwSPOP2sGnddPIE68hzk984hqcv2d/74Ry8k5QUa1ORUvWG6IFdI1/zt OxQQ== 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=LkYGLsnE5odHBLHKRYujD0SaJ6+i8O1fF0r+gNXotZQ=; b=o0YSqnxc9SfLU+TeTNNHbncqhqFg5QCRuaSN0SRqvcAomsd/DoVG2+MiZlYfF/9dT2 A7JLGrJ6HJPeuM2g9L8CYc/2pIOPaTCwjyACQ+OnbkGn5fvmFEEDK+AWPB+8vDxDki0U DM/PUJO++C5ntlJIG78nJwRKNtbF6HOGqa2diDj/l59YrRjjil9hmdKQE3krlu0kD6lA 7Fx80LFUPkbeztUqfduP2uv1fvWC4nI9CyBCDa3KiXWq9PmDmRSZlhFA3JFOpzXEXnpg RtpeTYLz1OUxPr7fcjTnhUwKcC5s1Bm3P3LphYeL9Vv8+yY94iQoHM4Ke1dDoBDryCnZ Jl1Q== X-Gm-Message-State: AOAM533n1Nd3WIn2b2CsNix4vy2Nrl4wcjXu5tYgHbZMCH9eBILjC8T2 WxM8ufa9jR9bwnaAMwVpMak6AZzjLMSgiugd X-Received: by 2002:a17:90a:43a7:: with SMTP id r36mr6029354pjg.189.1612403164202; Wed, 03 Feb 2021 17:46:04 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.46.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:46:03 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 28/93] tcg/tci: Use bool in tcg_out_ri* Date: Wed, 3 Feb 2021 15:44:04 -1000 Message-Id: <20210204014509.882821-29-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x634.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This is the intended behavior. Remove the assert on the specific value passed, which can now never be anything besides false/true (0/1). Signed-off-by: Richard Henderson --- tcg/tci/tcg-target.c.inc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) -- 2.25.1 Reviewed-by: Alex Bennée Reviewed-by: Alex Bennée diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index aba7f75ad1..1b66368c94 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -295,10 +295,9 @@ static void tcg_out_r(TCGContext *s, TCGArg t0) } /* Write register or constant (native size). */ -static void tcg_out_ri(TCGContext *s, int const_arg, TCGArg arg) +static void tcg_out_ri(TCGContext *s, bool const_arg, TCGArg arg) { if (const_arg) { - tcg_debug_assert(const_arg == 1); tcg_out8(s, TCG_CONST); tcg_out_i(s, arg); } else { @@ -307,10 +306,9 @@ static void tcg_out_ri(TCGContext *s, int const_arg, TCGArg arg) } /* Write register or constant (32 bit). */ -static void tcg_out_ri32(TCGContext *s, int const_arg, TCGArg arg) +static void tcg_out_ri32(TCGContext *s, bool const_arg, TCGArg arg) { if (const_arg) { - tcg_debug_assert(const_arg == 1); tcg_out8(s, TCG_CONST); tcg_out32(s, arg); } else { @@ -320,10 +318,9 @@ static void tcg_out_ri32(TCGContext *s, int const_arg, TCGArg arg) #if TCG_TARGET_REG_BITS == 64 /* Write register or constant (64 bit). */ -static void tcg_out_ri64(TCGContext *s, int const_arg, TCGArg arg) +static void tcg_out_ri64(TCGContext *s, bool const_arg, TCGArg arg) { if (const_arg) { - tcg_debug_assert(const_arg == 1); tcg_out8(s, TCG_CONST); tcg_out64(s, arg); } else { From patchwork Thu Feb 4 01:44:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376173 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp908058ejt; Wed, 3 Feb 2021 18:10:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJwn93yUyQc7HWYkFGnTcBg86u8ZW7Mi6lZXwDMzBAjqzFrN39rmGWJXN0VWFQWHzssbegM5 X-Received: by 2002:a25:d717:: with SMTP id o23mr8878877ybg.261.1612404651297; Wed, 03 Feb 2021 18:10:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612404651; cv=none; d=google.com; s=arc-20160816; b=nZksMONdahgdw7K1ZulgTDMdzbna9vnyC7EX2wj67cRAOKC456TIkSc7mcQ2M/07h+ h3rrz/5s2DjEVsdDxxzMn4YlPrDpbRTl6jhol3emPiGLE+mT6aPeZAniPiRSnc/XtTnz RLPDRe3Ef0wAbrwEKiWFkELQksff7Lio1Z1Vy8h/zMKqK+F8hg6Rb4a+MYkI7Karm7f4 f1Bq3mKqrBbsNZ0/N9LGkmBZM9AmShaTfPQpjOY908tDf0FoojZh5+JDKHRTzIajdZ+K tUNvMzb309+jgBnamkDNn9wYn9dQtZFLA9U15KABHrCHy1NMRGxFHN9w7L3ODMzrOxRX ageQ== 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=yS0gR/bmpwa/O4hUImsRvwlOE8hTboZh4LibIY9+LNE=; b=0mDAsiMjo1qSVIeJvJ7vY2Y2Ifmnb4bl34nFOlKdDCDql+yTvrtSKv5Ux2sxGMAN2r NHrjRqpK6L2yh5qmRV+WncFFdjZNuMWuR+6XzUou/qukZ8gD4TTe3Ws4/W1PQYylMtnr SovO2xdApxKwNYY0/XipOYOc68Z5NGvOr/zYEZ4dmzKEFbjGu+PYDyIc4ApdYwOMRJxn U2inRa+ZlFlwRYUni09whmClkholcjv8ru244B2mvsdRzIxGDXVi3yVwlw3DzhXyUT02 AanN5KnGQoMbQfkEthoG25tI+qXddfezXPdwQRwKKuPdPpy8L3UIXTSwoyKX8vCNqeI5 cy5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=twoeh6Re; 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 w13si162294ybp.234.2021.02.03.18.10.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:10:51 -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=twoeh6Re; 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]:45198 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7U6c-0001OA-JV for patch@linaro.org; Wed, 03 Feb 2021 21:10:50 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44742) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Tiz-0005Hk-Ds for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:25 -0500 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]:42488) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Tih-0003u3-Iq for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:23 -0500 Received: by mail-pl1-x62a.google.com with SMTP id s15so878413plr.9 for ; Wed, 03 Feb 2021 17:46:06 -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=yS0gR/bmpwa/O4hUImsRvwlOE8hTboZh4LibIY9+LNE=; b=twoeh6Ref1+fBXfIf4gfW2QqhB3T69Yc+QE+/gmUf47fVkKCKDd4Zbc3/NgqpfHCwg UTLhgFjCDEUVFbzJENYdje+lf98DIqmU0RQZOx8l7BFqyp8q2JJjhe60mb010L5ZjA/e cCzQRiU/IeC1vqrc2KX1Ar+8XQW4rubH9MPKgU+mrgqzYOx6HyNf/6y/gr8nLVDQ9TcP Gu8v2RJ2HaXKtd+ih0GhzyKVjkx4ftJvXuOSyZWD/aEvmZSV4bh/ou+Vjr0hYHv3CIga svssWftPyfUSzwmj8kc8TjsyBRo/DUfmXwxI49dfePn//BKHnOpTlT6J5v+pO25eVDF7 pv5w== 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=yS0gR/bmpwa/O4hUImsRvwlOE8hTboZh4LibIY9+LNE=; b=P1rk95JT2h0zRT34sPH5EF0+2lIlpEHwv7Sw2L1kkP/N2xuMcpyVdB3lOpQsTpA2F2 qI20QNbtcz4QZUZSw9/vzwrA0HHZzSDTMemTZ3zUGFEg1BvdGmzLFuaJ5LAI/H4qPWsP Vibbk2ZzqEuVcIBom/kkI2Wxcz37oCSYtGIVXc3qLP2biSZT6GBg+LTCuiwmht/kgBQn 9n9ozaMmlRZ8iyd/kqKwvWswcENIm/ar4Yi+hHtJLIGpeHZqwqLYr+nz11KtikI03yRE Bw2IpdPrTZpwp7RJZEQlAwg4TMY6gp25yVxWWoZBCqmFCfwOiEYTiPG9QhbPjdmT7esq 9o+A== X-Gm-Message-State: AOAM530Z7uf94eU+OIlH3HmGparrIapQ30kId6chCK6YP8OyqgpRhXkZ 6Cl3fWgs85YdxmF01SpgxXO78DcxYOp1MsRl X-Received: by 2002:a17:902:9a49:b029:df:fab8:384 with SMTP id x9-20020a1709029a49b02900dffab80384mr5826517plv.37.1612403165705; Wed, 03 Feb 2021 17:46:05 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.46.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:46:05 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 29/93] tcg/tci: Remove TCG_CONST Date: Wed, 3 Feb 2021 15:44:05 -1000 Message-Id: <20210204014509.882821-30-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62a; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62a.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=unavailable 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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Only allow registers or constants, but not both, in any given position. Removing this difference in input will allow more code to be shared between 32-bit and 64-bit. Signed-off-by: Richard Henderson --- tcg/tci/tcg-target-con-set.h | 6 +- tcg/tci/tcg-target.h | 3 - tcg/tci.c | 189 +++++++++++++---------------------- tcg/tci/tcg-target.c.inc | 82 ++++----------- 4 files changed, 89 insertions(+), 191 deletions(-) -- 2.25.1 Reviewed-by: Alex Bennée diff --git a/tcg/tci/tcg-target-con-set.h b/tcg/tci/tcg-target-con-set.h index 38e82f7535..f51b7bcb13 100644 --- a/tcg/tci/tcg-target-con-set.h +++ b/tcg/tci/tcg-target-con-set.h @@ -10,16 +10,12 @@ * tcg-target-con-str.h; the constraint combination is inclusive or. */ C_O0_I2(r, r) -C_O0_I2(r, ri) C_O0_I3(r, r, r) -C_O0_I4(r, r, ri, ri) C_O0_I4(r, r, r, r) C_O1_I1(r, r) C_O1_I2(r, 0, r) -C_O1_I2(r, ri, ri) C_O1_I2(r, r, r) -C_O1_I2(r, r, ri) -C_O1_I4(r, r, r, ri, ri) +C_O1_I4(r, r, r, r, r) C_O2_I1(r, r, r) C_O2_I2(r, r, r, r) C_O2_I4(r, r, r, r, r, r) diff --git a/tcg/tci/tcg-target.h b/tcg/tci/tcg-target.h index 8f7ed676fc..9c0021a26f 100644 --- a/tcg/tci/tcg-target.h +++ b/tcg/tci/tcg-target.h @@ -157,9 +157,6 @@ typedef enum { TCG_AREG0 = TCG_REG_R14, TCG_REG_CALL_STACK = TCG_REG_R15, - - /* Special value UINT8_MAX is used by TCI to encode constant values. */ - TCG_CONST = UINT8_MAX } TCGReg; /* Used for function call generation. */ diff --git a/tcg/tci.c b/tcg/tci.c index 935eb87330..fb3c97aaf1 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -255,61 +255,6 @@ tci_read_ulong(const tcg_target_ulong *regs, const uint8_t **tb_ptr) return taddr; } -/* Read indexed register or constant (native size) from bytecode. */ -static tcg_target_ulong -tci_read_ri(const tcg_target_ulong *regs, const uint8_t **tb_ptr) -{ - tcg_target_ulong value; - TCGReg r = **tb_ptr; - *tb_ptr += 1; - if (r == TCG_CONST) { - value = tci_read_i(tb_ptr); - } else { - value = tci_read_reg(regs, r); - } - return value; -} - -/* Read indexed register or constant (32 bit) from bytecode. */ -static uint32_t tci_read_ri32(const tcg_target_ulong *regs, - const uint8_t **tb_ptr) -{ - uint32_t value; - TCGReg r = **tb_ptr; - *tb_ptr += 1; - if (r == TCG_CONST) { - value = tci_read_i32(tb_ptr); - } else { - value = tci_read_reg32(regs, r); - } - return value; -} - -#if TCG_TARGET_REG_BITS == 32 -/* Read two indexed registers or constants (2 * 32 bit) from bytecode. */ -static uint64_t tci_read_ri64(const tcg_target_ulong *regs, - const uint8_t **tb_ptr) -{ - uint32_t low = tci_read_ri32(regs, tb_ptr); - return tci_uint64(tci_read_ri32(regs, tb_ptr), low); -} -#elif TCG_TARGET_REG_BITS == 64 -/* Read indexed register or constant (64 bit) from bytecode. */ -static uint64_t tci_read_ri64(const tcg_target_ulong *regs, - const uint8_t **tb_ptr) -{ - uint64_t value; - TCGReg r = **tb_ptr; - *tb_ptr += 1; - if (r == TCG_CONST) { - value = tci_read_i64(tb_ptr); - } else { - value = tci_read_reg64(regs, r); - } - return value; -} -#endif - static tcg_target_ulong tci_read_label(const uint8_t **tb_ptr) { tcg_target_ulong label = tci_read_i(tb_ptr); @@ -504,7 +449,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, switch (opc) { case INDEX_op_call: - t0 = tci_read_ri(regs, &tb_ptr); + t0 = tci_read_i(&tb_ptr); tci_tb_ptr = (uintptr_t)tb_ptr; #if TCG_TARGET_REG_BITS == 32 tmp64 = ((helper_function)t0)(tci_read_reg(regs, TCG_REG_R0), @@ -539,7 +484,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_setcond_i32: t0 = *tb_ptr++; t1 = tci_read_r32(regs, &tb_ptr); - t2 = tci_read_ri32(regs, &tb_ptr); + t2 = tci_read_r32(regs, &tb_ptr); condition = *tb_ptr++; tci_write_reg(regs, t0, tci_compare32(t1, t2, condition)); break; @@ -547,7 +492,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_setcond2_i32: t0 = *tb_ptr++; tmp64 = tci_read_r64(regs, &tb_ptr); - v64 = tci_read_ri64(regs, &tb_ptr); + v64 = tci_read_r64(regs, &tb_ptr); condition = *tb_ptr++; tci_write_reg(regs, t0, tci_compare64(tmp64, v64, condition)); break; @@ -555,7 +500,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_setcond_i64: t0 = *tb_ptr++; t1 = tci_read_r64(regs, &tb_ptr); - t2 = tci_read_ri64(regs, &tb_ptr); + t2 = tci_read_r64(regs, &tb_ptr); condition = *tb_ptr++; tci_write_reg(regs, t0, tci_compare64(t1, t2, condition)); break; @@ -628,62 +573,62 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_add_i32: t0 = *tb_ptr++; - t1 = tci_read_ri32(regs, &tb_ptr); - t2 = tci_read_ri32(regs, &tb_ptr); + t1 = tci_read_r32(regs, &tb_ptr); + t2 = tci_read_r32(regs, &tb_ptr); tci_write_reg(regs, t0, t1 + t2); break; case INDEX_op_sub_i32: t0 = *tb_ptr++; - t1 = tci_read_ri32(regs, &tb_ptr); - t2 = tci_read_ri32(regs, &tb_ptr); + t1 = tci_read_r32(regs, &tb_ptr); + t2 = tci_read_r32(regs, &tb_ptr); tci_write_reg(regs, t0, t1 - t2); break; case INDEX_op_mul_i32: t0 = *tb_ptr++; - t1 = tci_read_ri32(regs, &tb_ptr); - t2 = tci_read_ri32(regs, &tb_ptr); + t1 = tci_read_r32(regs, &tb_ptr); + t2 = tci_read_r32(regs, &tb_ptr); tci_write_reg(regs, t0, t1 * t2); break; case INDEX_op_div_i32: t0 = *tb_ptr++; - t1 = tci_read_ri32(regs, &tb_ptr); - t2 = tci_read_ri32(regs, &tb_ptr); + t1 = tci_read_r32(regs, &tb_ptr); + t2 = tci_read_r32(regs, &tb_ptr); tci_write_reg(regs, t0, (int32_t)t1 / (int32_t)t2); break; case INDEX_op_divu_i32: t0 = *tb_ptr++; - t1 = tci_read_ri32(regs, &tb_ptr); - t2 = tci_read_ri32(regs, &tb_ptr); + t1 = tci_read_r32(regs, &tb_ptr); + t2 = tci_read_r32(regs, &tb_ptr); tci_write_reg(regs, t0, t1 / t2); break; case INDEX_op_rem_i32: t0 = *tb_ptr++; - t1 = tci_read_ri32(regs, &tb_ptr); - t2 = tci_read_ri32(regs, &tb_ptr); + t1 = tci_read_r32(regs, &tb_ptr); + t2 = tci_read_r32(regs, &tb_ptr); tci_write_reg(regs, t0, (int32_t)t1 % (int32_t)t2); break; case INDEX_op_remu_i32: t0 = *tb_ptr++; - t1 = tci_read_ri32(regs, &tb_ptr); - t2 = tci_read_ri32(regs, &tb_ptr); + t1 = tci_read_r32(regs, &tb_ptr); + t2 = tci_read_r32(regs, &tb_ptr); tci_write_reg(regs, t0, t1 % t2); break; case INDEX_op_and_i32: t0 = *tb_ptr++; - t1 = tci_read_ri32(regs, &tb_ptr); - t2 = tci_read_ri32(regs, &tb_ptr); + t1 = tci_read_r32(regs, &tb_ptr); + t2 = tci_read_r32(regs, &tb_ptr); tci_write_reg(regs, t0, t1 & t2); break; case INDEX_op_or_i32: t0 = *tb_ptr++; - t1 = tci_read_ri32(regs, &tb_ptr); - t2 = tci_read_ri32(regs, &tb_ptr); + t1 = tci_read_r32(regs, &tb_ptr); + t2 = tci_read_r32(regs, &tb_ptr); tci_write_reg(regs, t0, t1 | t2); break; case INDEX_op_xor_i32: t0 = *tb_ptr++; - t1 = tci_read_ri32(regs, &tb_ptr); - t2 = tci_read_ri32(regs, &tb_ptr); + t1 = tci_read_r32(regs, &tb_ptr); + t2 = tci_read_r32(regs, &tb_ptr); tci_write_reg(regs, t0, t1 ^ t2); break; @@ -691,33 +636,33 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_shl_i32: t0 = *tb_ptr++; - t1 = tci_read_ri32(regs, &tb_ptr); - t2 = tci_read_ri32(regs, &tb_ptr); + t1 = tci_read_r32(regs, &tb_ptr); + t2 = tci_read_r32(regs, &tb_ptr); tci_write_reg(regs, t0, t1 << (t2 & 31)); break; case INDEX_op_shr_i32: t0 = *tb_ptr++; - t1 = tci_read_ri32(regs, &tb_ptr); - t2 = tci_read_ri32(regs, &tb_ptr); + t1 = tci_read_r32(regs, &tb_ptr); + t2 = tci_read_r32(regs, &tb_ptr); tci_write_reg(regs, t0, t1 >> (t2 & 31)); break; case INDEX_op_sar_i32: t0 = *tb_ptr++; - t1 = tci_read_ri32(regs, &tb_ptr); - t2 = tci_read_ri32(regs, &tb_ptr); + t1 = tci_read_r32(regs, &tb_ptr); + t2 = tci_read_r32(regs, &tb_ptr); tci_write_reg(regs, t0, ((int32_t)t1 >> (t2 & 31))); break; #if TCG_TARGET_HAS_rot_i32 case INDEX_op_rotl_i32: t0 = *tb_ptr++; - t1 = tci_read_ri32(regs, &tb_ptr); - t2 = tci_read_ri32(regs, &tb_ptr); + t1 = tci_read_r32(regs, &tb_ptr); + t2 = tci_read_r32(regs, &tb_ptr); tci_write_reg(regs, t0, rol32(t1, t2 & 31)); break; case INDEX_op_rotr_i32: t0 = *tb_ptr++; - t1 = tci_read_ri32(regs, &tb_ptr); - t2 = tci_read_ri32(regs, &tb_ptr); + t1 = tci_read_r32(regs, &tb_ptr); + t2 = tci_read_r32(regs, &tb_ptr); tci_write_reg(regs, t0, ror32(t1, t2 & 31)); break; #endif @@ -734,7 +679,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, #endif case INDEX_op_brcond_i32: t0 = tci_read_r32(regs, &tb_ptr); - t1 = tci_read_ri32(regs, &tb_ptr); + t1 = tci_read_r32(regs, &tb_ptr); condition = *tb_ptr++; label = tci_read_label(&tb_ptr); if (tci_compare32(t0, t1, condition)) { @@ -760,7 +705,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, break; case INDEX_op_brcond2_i32: tmp64 = tci_read_r64(regs, &tb_ptr); - v64 = tci_read_ri64(regs, &tb_ptr); + v64 = tci_read_r64(regs, &tb_ptr); condition = *tb_ptr++; label = tci_read_label(&tb_ptr); if (tci_compare64(tmp64, v64, condition)) { @@ -870,62 +815,62 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_add_i64: t0 = *tb_ptr++; - t1 = tci_read_ri64(regs, &tb_ptr); - t2 = tci_read_ri64(regs, &tb_ptr); + t1 = tci_read_r64(regs, &tb_ptr); + t2 = tci_read_r64(regs, &tb_ptr); tci_write_reg(regs, t0, t1 + t2); break; case INDEX_op_sub_i64: t0 = *tb_ptr++; - t1 = tci_read_ri64(regs, &tb_ptr); - t2 = tci_read_ri64(regs, &tb_ptr); + t1 = tci_read_r64(regs, &tb_ptr); + t2 = tci_read_r64(regs, &tb_ptr); tci_write_reg(regs, t0, t1 - t2); break; case INDEX_op_mul_i64: t0 = *tb_ptr++; - t1 = tci_read_ri64(regs, &tb_ptr); - t2 = tci_read_ri64(regs, &tb_ptr); + t1 = tci_read_r64(regs, &tb_ptr); + t2 = tci_read_r64(regs, &tb_ptr); tci_write_reg(regs, t0, t1 * t2); break; case INDEX_op_div_i64: t0 = *tb_ptr++; - t1 = tci_read_ri64(regs, &tb_ptr); - t2 = tci_read_ri64(regs, &tb_ptr); + t1 = tci_read_r64(regs, &tb_ptr); + t2 = tci_read_r64(regs, &tb_ptr); tci_write_reg(regs, t0, (int64_t)t1 / (int64_t)t2); break; case INDEX_op_divu_i64: t0 = *tb_ptr++; - t1 = tci_read_ri64(regs, &tb_ptr); - t2 = tci_read_ri64(regs, &tb_ptr); + t1 = tci_read_r64(regs, &tb_ptr); + t2 = tci_read_r64(regs, &tb_ptr); tci_write_reg(regs, t0, (uint64_t)t1 / (uint64_t)t2); break; case INDEX_op_rem_i64: t0 = *tb_ptr++; - t1 = tci_read_ri64(regs, &tb_ptr); - t2 = tci_read_ri64(regs, &tb_ptr); + t1 = tci_read_r64(regs, &tb_ptr); + t2 = tci_read_r64(regs, &tb_ptr); tci_write_reg(regs, t0, (int64_t)t1 % (int64_t)t2); break; case INDEX_op_remu_i64: t0 = *tb_ptr++; - t1 = tci_read_ri64(regs, &tb_ptr); - t2 = tci_read_ri64(regs, &tb_ptr); + t1 = tci_read_r64(regs, &tb_ptr); + t2 = tci_read_r64(regs, &tb_ptr); tci_write_reg(regs, t0, (uint64_t)t1 % (uint64_t)t2); break; case INDEX_op_and_i64: t0 = *tb_ptr++; - t1 = tci_read_ri64(regs, &tb_ptr); - t2 = tci_read_ri64(regs, &tb_ptr); + t1 = tci_read_r64(regs, &tb_ptr); + t2 = tci_read_r64(regs, &tb_ptr); tci_write_reg(regs, t0, t1 & t2); break; case INDEX_op_or_i64: t0 = *tb_ptr++; - t1 = tci_read_ri64(regs, &tb_ptr); - t2 = tci_read_ri64(regs, &tb_ptr); + t1 = tci_read_r64(regs, &tb_ptr); + t2 = tci_read_r64(regs, &tb_ptr); tci_write_reg(regs, t0, t1 | t2); break; case INDEX_op_xor_i64: t0 = *tb_ptr++; - t1 = tci_read_ri64(regs, &tb_ptr); - t2 = tci_read_ri64(regs, &tb_ptr); + t1 = tci_read_r64(regs, &tb_ptr); + t2 = tci_read_r64(regs, &tb_ptr); tci_write_reg(regs, t0, t1 ^ t2); break; @@ -933,33 +878,33 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_shl_i64: t0 = *tb_ptr++; - t1 = tci_read_ri64(regs, &tb_ptr); - t2 = tci_read_ri64(regs, &tb_ptr); + t1 = tci_read_r64(regs, &tb_ptr); + t2 = tci_read_r64(regs, &tb_ptr); tci_write_reg(regs, t0, t1 << (t2 & 63)); break; case INDEX_op_shr_i64: t0 = *tb_ptr++; - t1 = tci_read_ri64(regs, &tb_ptr); - t2 = tci_read_ri64(regs, &tb_ptr); + t1 = tci_read_r64(regs, &tb_ptr); + t2 = tci_read_r64(regs, &tb_ptr); tci_write_reg(regs, t0, t1 >> (t2 & 63)); break; case INDEX_op_sar_i64: t0 = *tb_ptr++; - t1 = tci_read_ri64(regs, &tb_ptr); - t2 = tci_read_ri64(regs, &tb_ptr); + t1 = tci_read_r64(regs, &tb_ptr); + t2 = tci_read_r64(regs, &tb_ptr); tci_write_reg(regs, t0, ((int64_t)t1 >> (t2 & 63))); break; #if TCG_TARGET_HAS_rot_i64 case INDEX_op_rotl_i64: t0 = *tb_ptr++; - t1 = tci_read_ri64(regs, &tb_ptr); - t2 = tci_read_ri64(regs, &tb_ptr); + t1 = tci_read_r64(regs, &tb_ptr); + t2 = tci_read_r64(regs, &tb_ptr); tci_write_reg(regs, t0, rol64(t1, t2 & 63)); break; case INDEX_op_rotr_i64: t0 = *tb_ptr++; - t1 = tci_read_ri64(regs, &tb_ptr); - t2 = tci_read_ri64(regs, &tb_ptr); + t1 = tci_read_r64(regs, &tb_ptr); + t2 = tci_read_r64(regs, &tb_ptr); tci_write_reg(regs, t0, ror64(t1, t2 & 63)); break; #endif @@ -976,7 +921,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, #endif case INDEX_op_brcond_i64: t0 = tci_read_r64(regs, &tb_ptr); - t1 = tci_read_ri64(regs, &tb_ptr); + t1 = tci_read_r64(regs, &tb_ptr); condition = *tb_ptr++; label = tci_read_label(&tb_ptr); if (tci_compare64(t0, t1, condition)) { diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index 1b66368c94..feac4659cc 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -92,8 +92,6 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) case INDEX_op_rem_i64: case INDEX_op_remu_i32: case INDEX_op_remu_i64: - return C_O1_I2(r, r, r); - case INDEX_op_add_i32: case INDEX_op_add_i64: case INDEX_op_sub_i32: @@ -126,8 +124,9 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) case INDEX_op_rotl_i64: case INDEX_op_rotr_i32: case INDEX_op_rotr_i64: - /* TODO: Does R, RI, RI result in faster code than R, R, RI? */ - return C_O1_I2(r, ri, ri); + case INDEX_op_setcond_i32: + case INDEX_op_setcond_i64: + return C_O1_I2(r, r, r); case INDEX_op_deposit_i32: case INDEX_op_deposit_i64: @@ -135,11 +134,7 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) case INDEX_op_brcond_i32: case INDEX_op_brcond_i64: - return C_O0_I2(r, ri); - - case INDEX_op_setcond_i32: - case INDEX_op_setcond_i64: - return C_O1_I2(r, r, ri); + return C_O0_I2(r, r); #if TCG_TARGET_REG_BITS == 32 /* TODO: Support R, R, R, R, RI, RI? Will it be faster? */ @@ -147,11 +142,11 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) case INDEX_op_sub2_i32: return C_O2_I4(r, r, r, r, r, r); case INDEX_op_brcond2_i32: - return C_O0_I4(r, r, ri, ri); + return C_O0_I4(r, r, r, r); case INDEX_op_mulu2_i32: return C_O2_I2(r, r, r, r); case INDEX_op_setcond2_i32: - return C_O1_I4(r, r, r, ri, ri); + return C_O1_I4(r, r, r, r, r); #endif case INDEX_op_qemu_ld_i32: @@ -294,41 +289,6 @@ static void tcg_out_r(TCGContext *s, TCGArg t0) tcg_out8(s, t0); } -/* Write register or constant (native size). */ -static void tcg_out_ri(TCGContext *s, bool const_arg, TCGArg arg) -{ - if (const_arg) { - tcg_out8(s, TCG_CONST); - tcg_out_i(s, arg); - } else { - tcg_out_r(s, arg); - } -} - -/* Write register or constant (32 bit). */ -static void tcg_out_ri32(TCGContext *s, bool const_arg, TCGArg arg) -{ - if (const_arg) { - tcg_out8(s, TCG_CONST); - tcg_out32(s, arg); - } else { - tcg_out_r(s, arg); - } -} - -#if TCG_TARGET_REG_BITS == 64 -/* Write register or constant (64 bit). */ -static void tcg_out_ri64(TCGContext *s, bool const_arg, TCGArg arg) -{ - if (const_arg) { - tcg_out8(s, TCG_CONST); - tcg_out64(s, arg); - } else { - tcg_out_r(s, arg); - } -} -#endif - /* Write label. */ static void tci_out_label(TCGContext *s, TCGLabel *label) { @@ -416,7 +376,7 @@ static inline void tcg_out_call(TCGContext *s, const tcg_insn_unit *arg) { uint8_t *old_code_ptr = s->code_ptr; tcg_out_op_t(s, INDEX_op_call); - tcg_out_ri(s, 1, (uintptr_t)arg); + tcg_out_i(s, (uintptr_t)arg); old_code_ptr[1] = s->code_ptr - old_code_ptr; } @@ -450,7 +410,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, case INDEX_op_setcond_i32: tcg_out_r(s, args[0]); tcg_out_r(s, args[1]); - tcg_out_ri32(s, const_args[2], args[2]); + tcg_out_r(s, args[2]); tcg_out8(s, args[3]); /* condition */ break; #if TCG_TARGET_REG_BITS == 32 @@ -459,15 +419,15 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, tcg_out_r(s, args[0]); tcg_out_r(s, args[1]); tcg_out_r(s, args[2]); - tcg_out_ri32(s, const_args[3], args[3]); - tcg_out_ri32(s, const_args[4], args[4]); + tcg_out_r(s, args[3]); + tcg_out_r(s, args[4]); tcg_out8(s, args[5]); /* condition */ break; #elif TCG_TARGET_REG_BITS == 64 case INDEX_op_setcond_i64: tcg_out_r(s, args[0]); tcg_out_r(s, args[1]); - tcg_out_ri64(s, const_args[2], args[2]); + tcg_out_r(s, args[2]); tcg_out8(s, args[3]); /* condition */ break; #endif @@ -513,8 +473,8 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, case INDEX_op_rotl_i32: /* Optional (TCG_TARGET_HAS_rot_i32). */ case INDEX_op_rotr_i32: /* Optional (TCG_TARGET_HAS_rot_i32). */ tcg_out_r(s, args[0]); - tcg_out_ri32(s, const_args[1], args[1]); - tcg_out_ri32(s, const_args[2], args[2]); + tcg_out_r(s, args[1]); + tcg_out_r(s, args[2]); break; case INDEX_op_deposit_i32: /* Optional (TCG_TARGET_HAS_deposit_i32). */ tcg_out_r(s, args[0]); @@ -548,8 +508,8 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, case INDEX_op_rem_i64: /* Optional (TCG_TARGET_HAS_div_i64). */ case INDEX_op_remu_i64: /* Optional (TCG_TARGET_HAS_div_i64). */ tcg_out_r(s, args[0]); - tcg_out_ri64(s, const_args[1], args[1]); - tcg_out_ri64(s, const_args[2], args[2]); + tcg_out_r(s, args[1]); + tcg_out_r(s, args[2]); break; case INDEX_op_deposit_i64: /* Optional (TCG_TARGET_HAS_deposit_i64). */ tcg_out_r(s, args[0]); @@ -562,7 +522,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, break; case INDEX_op_brcond_i64: tcg_out_r(s, args[0]); - tcg_out_ri64(s, const_args[1], args[1]); + tcg_out_r(s, args[1]); tcg_out8(s, args[2]); /* condition */ tci_out_label(s, arg_label(args[3])); break; @@ -596,8 +556,8 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, case INDEX_op_rem_i32: /* Optional (TCG_TARGET_HAS_div_i32). */ case INDEX_op_remu_i32: /* Optional (TCG_TARGET_HAS_div_i32). */ tcg_out_r(s, args[0]); - tcg_out_ri32(s, const_args[1], args[1]); - tcg_out_ri32(s, const_args[2], args[2]); + tcg_out_r(s, args[1]); + tcg_out_r(s, args[2]); break; #if TCG_TARGET_REG_BITS == 32 case INDEX_op_add2_i32: @@ -612,8 +572,8 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, case INDEX_op_brcond2_i32: tcg_out_r(s, args[0]); tcg_out_r(s, args[1]); - tcg_out_ri32(s, const_args[2], args[2]); - tcg_out_ri32(s, const_args[3], args[3]); + tcg_out_r(s, args[2]); + tcg_out_r(s, args[3]); tcg_out8(s, args[4]); /* condition */ tci_out_label(s, arg_label(args[5])); break; @@ -626,7 +586,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, #endif case INDEX_op_brcond_i32: tcg_out_r(s, args[0]); - tcg_out_ri32(s, const_args[1], args[1]); + tcg_out_r(s, args[1]); tcg_out8(s, args[2]); /* condition */ tci_out_label(s, arg_label(args[3])); break; From patchwork Thu Feb 4 01:44:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376159 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp837624jah; Wed, 3 Feb 2021 18:00:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJxfjeA2b/dhVMVvczd8zO/EWaXE/rnF6l4lu1D2vDqTrXkLy861/2yJhlUVObK+mAir9x1o X-Received: by 2002:a5b:7c2:: with SMTP id t2mr8561324ybq.415.1612404006659; Wed, 03 Feb 2021 18:00:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612404006; cv=none; d=google.com; s=arc-20160816; b=wSBk6UYvJI2fg5PDjrVYhIn5kHk3/mhXwh7IgmK+68ByeueXyFZdKOfYVrJGEK+CvL MGziNHiabZM/GgrR6j9FfAitcL5FSGZWCip5qvq4rlykUmgTf/1I4T43RSijCQHpQGGr FmyWfLTovcL4L5yEi72UlQtlI+pqWxXhTjLhRSLyxb5eOdMZF4hRgdW1OGy0M0027w9L fQPk5HR7USAFrCrl7Bz7iFN+30zvqpFOkWeFdIqDOI4RLBRbRymfviML/IqCP15o09AH Bahw6DVX8z4s/iBku1k7V/6BbJXVwSwxrdqcKI7q3IYYzWbDoxtyE2SgDk7RsVBkG9ep Gk5g== 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=VvjDH0d9yENa4ecfbUN1MGRyNECdD1MomwyxKEWSk7s=; b=RDAMn9cOCKzaVyBimZs0NtHntWAKfi4sok9FkaUjmeqNKF1BGvW20uIU1YeIpTklWA MXj5ItA+tfjYIco9xNwbt0l+ZC08LzFlat3AHI6n2V00Q/hH3PlQKLRyav/lXwXtX1Ey Xu+m0UtdcGKT+4d2tmmcj92R6VbGxVbgsbQbGVgfQJcT6fGoK3fOZ6+grvpyVCYL/EO3 ODs7UpXiD2GWB6p05M7WI+W+bGUR0CJVPv50ExxBXzcqW3WNWxo6xNMqwh+ympODfoOR ppsE1tbvM/Ay8LL0f1JA9+RkG+nDKSsAS8M7m4wB6Cm7rJDGMunqsadagF4gd0eChmQL /kQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kqnV9YjO; 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 n80si4585551yba.402.2021.02.03.18.00.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:00:06 -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=kqnV9YjO; 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]:39690 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7TwE-00041f-4n for patch@linaro.org; Wed, 03 Feb 2021 21:00:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44688) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Tis-0005CC-Jm for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:20 -0500 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]:45517) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Tij-0003ub-DJ for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:18 -0500 Received: by mail-pl1-x633.google.com with SMTP id b8so869915plh.12 for ; Wed, 03 Feb 2021 17:46:08 -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=VvjDH0d9yENa4ecfbUN1MGRyNECdD1MomwyxKEWSk7s=; b=kqnV9YjOYJgmVdcO4T69+y/u0xlnuLELHgVW2m+tzQ+FTKfuq6vHdNmxg1OyaY9EdY K317YvML7dpSXswW4TLV7qbxiqmq/wMWaohudkegdSNrBMaguJerU7j29cM75AyDEzGj HhX9VbkJF/V9PjHhnubty3zHtkWDAv/UDjmrUn36EntFo+sLeZG5t5G1P2W2Q4EAy4NG PPF6iZlhB6o7uni8+GjMN2fhaPk4LQOflA0iWYojd8EC3N+VlWfoDQmSigieOCH6P0bu p+OamfxsnNguUSHC73BzW3K5Yfe6eyWH/AYQfh+3WfqParhE+0htIbCyKcTVUh5+QMM6 9+Og== 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=VvjDH0d9yENa4ecfbUN1MGRyNECdD1MomwyxKEWSk7s=; b=F87HR8V+4flZOpft63E4n6OxVJX4zoYxFHKxG+EPd1Q/yKp9W0bB3somHM4zJRsrio KYopM0IuN+cakNYkMsCP0GG0R+Ity0C1IbizEoJZbV6G2HjN4wXAoUBRtucLekW41PiH PrshFHS0IB+Smvqqq2WvHkaBXSlKeP+dV6AVkdLOMQSjrPkqMPClcOWgR3bIlWcb0w0c MKcG8Dh7pB4BlfXdEmzTmrh3jHbRngpHGUr+GNGnuxTn1CfWGl58/XwVhCOCPHd+WvYq xz2BTcTbtbVA/JyKU7svJo1qURzr9qnDrHyNAUVzG2kELSIRHXKrmz2Dkn4znsNfBvMZ deag== X-Gm-Message-State: AOAM5317/DRB8fe0Mg5UT9f/vPHC2OFRsyrCUTekJw3EgJZD8iK/pXna 0JV+FRco67Jml2VLHQtEW9LoFVMK/GIIifj4 X-Received: by 2002:a17:903:3049:b029:e2:8af3:76ec with SMTP id u9-20020a1709033049b02900e28af376ecmr4797749pla.51.1612403167272; Wed, 03 Feb 2021 17:46:07 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.46.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:46:06 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 30/93] tcg/tci: Merge identical cases in generation Date: Wed, 3 Feb 2021 15:44:06 -1000 Message-Id: <20210204014509.882821-31-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::633; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x633.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Use CASE_32_64 and CASE_64 to reduce ifdefs and merge cases that are identical between 32-bit and 64-bit hosts. Signed-off-by: Richard Henderson --- tcg/tci/tcg-target.c.inc | 204 ++++++++++++++------------------------- 1 file changed, 73 insertions(+), 131 deletions(-) -- 2.25.1 diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index feac4659cc..c79f9c32d8 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -380,6 +380,18 @@ static inline void tcg_out_call(TCGContext *s, const tcg_insn_unit *arg) old_code_ptr[1] = s->code_ptr - old_code_ptr; } +#if TCG_TARGET_REG_BITS == 64 +# define CASE_32_64(x) \ + case glue(glue(INDEX_op_, x), _i64): \ + case glue(glue(INDEX_op_, x), _i32): +# define CASE_64(x) \ + case glue(glue(INDEX_op_, x), _i64): +#else +# define CASE_32_64(x) \ + case glue(glue(INDEX_op_, x), _i32): +# define CASE_64(x) +#endif + static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, const int *const_args) { @@ -391,6 +403,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, case INDEX_op_exit_tb: tcg_out64(s, args[0]); break; + case INDEX_op_goto_tb: if (s->tb_jmp_insn_offset) { /* Direct jump method. */ @@ -404,15 +417,18 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, } set_jmp_reset_offset(s, args[0]); break; + case INDEX_op_br: tci_out_label(s, arg_label(args[0])); break; - case INDEX_op_setcond_i32: + + CASE_32_64(setcond) tcg_out_r(s, args[0]); tcg_out_r(s, args[1]); tcg_out_r(s, args[2]); tcg_out8(s, args[3]); /* condition */ break; + #if TCG_TARGET_REG_BITS == 32 case INDEX_op_setcond2_i32: /* setcond2_i32 cond, t0, t1_low, t1_high, t2_low, t2_high */ @@ -423,60 +439,54 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, tcg_out_r(s, args[4]); tcg_out8(s, args[5]); /* condition */ break; -#elif TCG_TARGET_REG_BITS == 64 - case INDEX_op_setcond_i64: - tcg_out_r(s, args[0]); - tcg_out_r(s, args[1]); - tcg_out_r(s, args[2]); - tcg_out8(s, args[3]); /* condition */ - break; #endif - case INDEX_op_ld8u_i32: - case INDEX_op_ld8s_i32: - case INDEX_op_ld16u_i32: - case INDEX_op_ld16s_i32: + + CASE_32_64(ld8u) + CASE_32_64(ld8s) + CASE_32_64(ld16u) + CASE_32_64(ld16s) case INDEX_op_ld_i32: - case INDEX_op_st8_i32: - case INDEX_op_st16_i32: + CASE_64(ld32u) + CASE_64(ld32s) + CASE_64(ld) + CASE_32_64(st8) + CASE_32_64(st16) case INDEX_op_st_i32: - case INDEX_op_ld8u_i64: - case INDEX_op_ld8s_i64: - case INDEX_op_ld16u_i64: - case INDEX_op_ld16s_i64: - case INDEX_op_ld32u_i64: - case INDEX_op_ld32s_i64: - case INDEX_op_ld_i64: - case INDEX_op_st8_i64: - case INDEX_op_st16_i64: - case INDEX_op_st32_i64: - case INDEX_op_st_i64: + CASE_64(st32) + CASE_64(st) stack_bounds_check(args[1], args[2]); tcg_out_r(s, args[0]); tcg_out_r(s, args[1]); tcg_debug_assert(args[2] == (int32_t)args[2]); tcg_out32(s, args[2]); break; - case INDEX_op_add_i32: - case INDEX_op_sub_i32: - case INDEX_op_mul_i32: - case INDEX_op_and_i32: - case INDEX_op_andc_i32: /* Optional (TCG_TARGET_HAS_andc_i32). */ - case INDEX_op_eqv_i32: /* Optional (TCG_TARGET_HAS_eqv_i32). */ - case INDEX_op_nand_i32: /* Optional (TCG_TARGET_HAS_nand_i32). */ - case INDEX_op_nor_i32: /* Optional (TCG_TARGET_HAS_nor_i32). */ - case INDEX_op_or_i32: - case INDEX_op_orc_i32: /* Optional (TCG_TARGET_HAS_orc_i32). */ - case INDEX_op_xor_i32: - case INDEX_op_shl_i32: - case INDEX_op_shr_i32: - case INDEX_op_sar_i32: - case INDEX_op_rotl_i32: /* Optional (TCG_TARGET_HAS_rot_i32). */ - case INDEX_op_rotr_i32: /* Optional (TCG_TARGET_HAS_rot_i32). */ + + CASE_32_64(add) + CASE_32_64(sub) + CASE_32_64(mul) + CASE_32_64(and) + CASE_32_64(or) + CASE_32_64(xor) + CASE_32_64(andc) /* Optional (TCG_TARGET_HAS_andc_*). */ + CASE_32_64(orc) /* Optional (TCG_TARGET_HAS_orc_*). */ + CASE_32_64(eqv) /* Optional (TCG_TARGET_HAS_eqv_*). */ + CASE_32_64(nand) /* Optional (TCG_TARGET_HAS_nand_*). */ + CASE_32_64(nor) /* Optional (TCG_TARGET_HAS_nor_*). */ + CASE_32_64(shl) + CASE_32_64(shr) + CASE_32_64(sar) + CASE_32_64(rotl) /* Optional (TCG_TARGET_HAS_rot_*). */ + CASE_32_64(rotr) /* Optional (TCG_TARGET_HAS_rot_*). */ + CASE_32_64(div) /* Optional (TCG_TARGET_HAS_div_*). */ + CASE_32_64(divu) /* Optional (TCG_TARGET_HAS_div_*). */ + CASE_32_64(rem) /* Optional (TCG_TARGET_HAS_div_*). */ + CASE_32_64(remu) /* Optional (TCG_TARGET_HAS_div_*). */ tcg_out_r(s, args[0]); tcg_out_r(s, args[1]); tcg_out_r(s, args[2]); break; - case INDEX_op_deposit_i32: /* Optional (TCG_TARGET_HAS_deposit_i32). */ + + CASE_32_64(deposit) /* Optional (TCG_TARGET_HAS_deposit_*). */ tcg_out_r(s, args[0]); tcg_out_r(s, args[1]); tcg_out_r(s, args[2]); @@ -486,79 +496,30 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, tcg_out8(s, args[4]); break; -#if TCG_TARGET_REG_BITS == 64 - case INDEX_op_add_i64: - case INDEX_op_sub_i64: - case INDEX_op_mul_i64: - case INDEX_op_and_i64: - case INDEX_op_andc_i64: /* Optional (TCG_TARGET_HAS_andc_i64). */ - case INDEX_op_eqv_i64: /* Optional (TCG_TARGET_HAS_eqv_i64). */ - case INDEX_op_nand_i64: /* Optional (TCG_TARGET_HAS_nand_i64). */ - case INDEX_op_nor_i64: /* Optional (TCG_TARGET_HAS_nor_i64). */ - case INDEX_op_or_i64: - case INDEX_op_orc_i64: /* Optional (TCG_TARGET_HAS_orc_i64). */ - case INDEX_op_xor_i64: - case INDEX_op_shl_i64: - case INDEX_op_shr_i64: - case INDEX_op_sar_i64: - case INDEX_op_rotl_i64: /* Optional (TCG_TARGET_HAS_rot_i64). */ - case INDEX_op_rotr_i64: /* Optional (TCG_TARGET_HAS_rot_i64). */ - case INDEX_op_div_i64: /* Optional (TCG_TARGET_HAS_div_i64). */ - case INDEX_op_divu_i64: /* Optional (TCG_TARGET_HAS_div_i64). */ - case INDEX_op_rem_i64: /* Optional (TCG_TARGET_HAS_div_i64). */ - case INDEX_op_remu_i64: /* Optional (TCG_TARGET_HAS_div_i64). */ - tcg_out_r(s, args[0]); - tcg_out_r(s, args[1]); - tcg_out_r(s, args[2]); - break; - case INDEX_op_deposit_i64: /* Optional (TCG_TARGET_HAS_deposit_i64). */ - tcg_out_r(s, args[0]); - tcg_out_r(s, args[1]); - tcg_out_r(s, args[2]); - tcg_debug_assert(args[3] <= UINT8_MAX); - tcg_out8(s, args[3]); - tcg_debug_assert(args[4] <= UINT8_MAX); - tcg_out8(s, args[4]); - break; - case INDEX_op_brcond_i64: + CASE_32_64(brcond) tcg_out_r(s, args[0]); tcg_out_r(s, args[1]); tcg_out8(s, args[2]); /* condition */ tci_out_label(s, arg_label(args[3])); break; - case INDEX_op_bswap16_i64: /* Optional (TCG_TARGET_HAS_bswap16_i64). */ - case INDEX_op_bswap32_i64: /* Optional (TCG_TARGET_HAS_bswap32_i64). */ - case INDEX_op_bswap64_i64: /* Optional (TCG_TARGET_HAS_bswap64_i64). */ - case INDEX_op_not_i64: /* Optional (TCG_TARGET_HAS_not_i64). */ - case INDEX_op_neg_i64: /* Optional (TCG_TARGET_HAS_neg_i64). */ - case INDEX_op_ext8s_i64: /* Optional (TCG_TARGET_HAS_ext8s_i64). */ - case INDEX_op_ext8u_i64: /* Optional (TCG_TARGET_HAS_ext8u_i64). */ - case INDEX_op_ext16s_i64: /* Optional (TCG_TARGET_HAS_ext16s_i64). */ - case INDEX_op_ext16u_i64: /* Optional (TCG_TARGET_HAS_ext16u_i64). */ - case INDEX_op_ext32s_i64: /* Optional (TCG_TARGET_HAS_ext32s_i64). */ - case INDEX_op_ext32u_i64: /* Optional (TCG_TARGET_HAS_ext32u_i64). */ - case INDEX_op_ext_i32_i64: - case INDEX_op_extu_i32_i64: -#endif /* TCG_TARGET_REG_BITS == 64 */ - case INDEX_op_neg_i32: /* Optional (TCG_TARGET_HAS_neg_i32). */ - case INDEX_op_not_i32: /* Optional (TCG_TARGET_HAS_not_i32). */ - case INDEX_op_ext8s_i32: /* Optional (TCG_TARGET_HAS_ext8s_i32). */ - case INDEX_op_ext16s_i32: /* Optional (TCG_TARGET_HAS_ext16s_i32). */ - case INDEX_op_ext8u_i32: /* Optional (TCG_TARGET_HAS_ext8u_i32). */ - case INDEX_op_ext16u_i32: /* Optional (TCG_TARGET_HAS_ext16u_i32). */ - case INDEX_op_bswap16_i32: /* Optional (TCG_TARGET_HAS_bswap16_i32). */ - case INDEX_op_bswap32_i32: /* Optional (TCG_TARGET_HAS_bswap32_i32). */ + + CASE_32_64(neg) /* Optional (TCG_TARGET_HAS_neg_*). */ + CASE_32_64(not) /* Optional (TCG_TARGET_HAS_not_*). */ + CASE_32_64(ext8s) /* Optional (TCG_TARGET_HAS_ext8s_*). */ + CASE_32_64(ext8u) /* Optional (TCG_TARGET_HAS_ext8u_*). */ + CASE_32_64(ext16s) /* Optional (TCG_TARGET_HAS_ext16s_*). */ + CASE_32_64(ext16u) /* Optional (TCG_TARGET_HAS_ext16u_*). */ + CASE_64(ext32s) /* Optional (TCG_TARGET_HAS_ext32s_i64). */ + CASE_64(ext32u) /* Optional (TCG_TARGET_HAS_ext32u_i64). */ + CASE_64(ext_i32) + CASE_64(extu_i32) + CASE_32_64(bswap16) /* Optional (TCG_TARGET_HAS_bswap16_*). */ + CASE_32_64(bswap32) /* Optional (TCG_TARGET_HAS_bswap32_*). */ + CASE_64(bswap64) /* Optional (TCG_TARGET_HAS_bswap64_i64). */ tcg_out_r(s, args[0]); tcg_out_r(s, args[1]); break; - case INDEX_op_div_i32: /* Optional (TCG_TARGET_HAS_div_i32). */ - case INDEX_op_divu_i32: /* Optional (TCG_TARGET_HAS_div_i32). */ - case INDEX_op_rem_i32: /* Optional (TCG_TARGET_HAS_div_i32). */ - case INDEX_op_remu_i32: /* Optional (TCG_TARGET_HAS_div_i32). */ - tcg_out_r(s, args[0]); - tcg_out_r(s, args[1]); - tcg_out_r(s, args[2]); - break; + #if TCG_TARGET_REG_BITS == 32 case INDEX_op_add2_i32: case INDEX_op_sub2_i32: @@ -584,31 +545,8 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, tcg_out_r(s, args[3]); break; #endif - case INDEX_op_brcond_i32: - tcg_out_r(s, args[0]); - tcg_out_r(s, args[1]); - tcg_out8(s, args[2]); /* condition */ - tci_out_label(s, arg_label(args[3])); - break; + case INDEX_op_qemu_ld_i32: - tcg_out_r(s, *args++); - tcg_out_r(s, *args++); - if (TARGET_LONG_BITS > TCG_TARGET_REG_BITS) { - tcg_out_r(s, *args++); - } - tcg_out_i(s, *args++); - break; - case INDEX_op_qemu_ld_i64: - tcg_out_r(s, *args++); - if (TCG_TARGET_REG_BITS == 32) { - tcg_out_r(s, *args++); - } - tcg_out_r(s, *args++); - if (TARGET_LONG_BITS > TCG_TARGET_REG_BITS) { - tcg_out_r(s, *args++); - } - tcg_out_i(s, *args++); - break; case INDEX_op_qemu_st_i32: tcg_out_r(s, *args++); tcg_out_r(s, *args++); @@ -617,6 +555,8 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, } tcg_out_i(s, *args++); break; + + case INDEX_op_qemu_ld_i64: case INDEX_op_qemu_st_i64: tcg_out_r(s, *args++); if (TCG_TARGET_REG_BITS == 32) { @@ -628,8 +568,10 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, } tcg_out_i(s, *args++); break; + case INDEX_op_mb: break; + case INDEX_op_mov_i32: /* Always emitted via tcg_out_mov. */ case INDEX_op_mov_i64: case INDEX_op_call: /* Always emitted via tcg_out_call. */ From patchwork Thu Feb 4 01:44:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376172 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp906895ejt; Wed, 3 Feb 2021 18:08:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJxhOwWIRJWYAqESWdidcTSwXjQ0hzJsr7KN7elchi7igpq29rqrLrYDecPmbCtv0eLv7al9 X-Received: by 2002:a25:f309:: with SMTP id c9mr8420198ybs.379.1612404520419; Wed, 03 Feb 2021 18:08:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612404520; cv=none; d=google.com; s=arc-20160816; b=iO9LJlplyuO0EMEXQ/lKcOKXY6OA/pyuyaa5r/rjm21R4f1KyucClRx3M9Eh3+q3CX p2WY2Bf+H9M65214opC0wh7OfcqS/GEmhQtp4KWFD33xET7S+CxNhrxx18yqfxdMjZkR jvz05DbmYj/70JzK4Vf2X1uO+g5fpFrXUV02c7uzdNBzn4ecs63kkR7PoFbhUqfPGELY Kru7NLU9aS6qE7ceMScESQlk0I+PFRKZ7aB31U55f/AmejP6HHUfaGRTOF9vIVmSmMho CcKx0+vjbYGRDMSAHq8jZwJUsPcAW3j6ACYi42r4Ma1RfZh+i6bDzD/jVT2cfhIcykH0 qGjQ== 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=YWPrxfItN4c65pZ/52Q4dTydvUr4VWbYL6z0GHLhLqg=; b=iQ29ZwmKQyMUP4LAAVDczWx3BvCi9QJN8qAfsL9vymP3TUJsvxxLBjilqAvkUhFzt8 FV2Xc0DYvorU0udtaXv3+zzNHED4pg8a5k+B4vXygFr/7I2dAWGXKKx+0swFDZB/UVo5 GE3tq/C4mfTD3KkZGGJ0u3yrgIvUsyxJqrPy/f3jJdDXqWc3Wv60IFn5lxEHFTgaF91R VnqdIlQA0CTn8HpQ9PHtylJHMUAOulRX/GftHaCKeHhLzQQxDXsqCnj/DeHpOoHscLC0 odyIB/9uUR89ef9EkJM6OzSsixNKUtX7Chuny7Oy0HEwR1oMeeVzPZlUv4OVeCQoEdAc 2PdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UpeJHkCg; 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 i16si4044168ybq.31.2021.02.03.18.08.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:08:40 -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=UpeJHkCg; 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]:41648 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7U4V-0008HJ-FW for patch@linaro.org; Wed, 03 Feb 2021 21:08:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44706) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Tiv-0005EI-6W for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:24 -0500 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]:36111) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Til-0003uy-49 for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:20 -0500 Received: by mail-pg1-x52a.google.com with SMTP id c132so1041014pga.3 for ; Wed, 03 Feb 2021 17:46:09 -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=YWPrxfItN4c65pZ/52Q4dTydvUr4VWbYL6z0GHLhLqg=; b=UpeJHkCgV3/5jo1hf1cY8gdP8Ua+rSj+fkpc9e5QNzx1wwBMjQQ7UNCi0T0EM4Gjh3 o1UnlpZq8bOI7967lE3iRadQ+KXQnDS/MPgEX253JL1Digf7BdryWm3Uy13Tch4u4oac RTXaFiMJLx6Mp/EBdr1VxBqDHeISmG3kYjRBxPQol1kZd8Pr91ZkXuri6k/nNPNLhHBs 2xdlj8qmnens6tZvG1whtvx/UcdJNYX8hy0H7Ej72VsLOWVbr6fxyOdqEVUx38VevdFe yIkRlXNTlnE37M40cRIsvQpVCHQeeVLnl1zYqV4k//AYJ8u9J6UusXDEGfusxYwai8un XG1g== 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=YWPrxfItN4c65pZ/52Q4dTydvUr4VWbYL6z0GHLhLqg=; b=Lp67mZaWp/fTHSdV8CFHYb53ejwAnZy/c1saJ1m5PUFaiDPDQD1wfnd55qyQSJ2SPT Au8eZIJYzvgW6HPYzIljuGUqiWMXp8nWJGaRbDU06dVZ1sORAwlSKrpdVjAWu88XcNT8 MHDE5jUnBTlAf4r1p25Nc6nqY4IVw3+VesiAJTZfT5Ii6ZvpSGLezQdcy9+FrKpdcK9G 219KEdGKbph9gic6oOmn0PK5OCbRwKt7S9pluzTdozVsETB3i6F+8rh68pI73g95uG6O tdwomimwQWm0wOOcXfsWeUPZO6t56qfwn6NsdLnPYcomWYdo4BsF+sv37iMhH6ey2EJG gdxA== X-Gm-Message-State: AOAM532MF5EpaTUYuO2bVg10BKyMTv66kLbGTuduj1X26ZuFRpASwZuW NyqnrnbhhimxczsOJQMg5KbO4GB9Iz4cBn8b X-Received: by 2002:a62:7ac4:0:b029:1bc:309a:46d3 with SMTP id v187-20020a627ac40000b02901bc309a46d3mr5717481pfc.18.1612403168784; Wed, 03 Feb 2021 17:46:08 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.46.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:46:08 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 31/93] tcg/tci: Remove tci_read_r8 Date: Wed, 3 Feb 2021 15:44:07 -1000 Message-Id: <20210204014509.882821-32-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52a; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52a.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Use explicit casts for ext8u opcodes, and allow truncation to happen with the store for st8 opcodes. Signed-off-by: Richard Henderson --- tcg/tci.c | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index fb3c97aaf1..c44a4aec7b 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -78,11 +78,6 @@ static int32_t tci_read_reg32s(const tcg_target_ulong *regs, TCGReg index) } #endif -static uint8_t tci_read_reg8(const tcg_target_ulong *regs, TCGReg index) -{ - return (uint8_t)tci_read_reg(regs, index); -} - static uint16_t tci_read_reg16(const tcg_target_ulong *regs, TCGReg index) { return (uint16_t)tci_read_reg(regs, index); @@ -169,14 +164,6 @@ tci_read_r(const tcg_target_ulong *regs, const uint8_t **tb_ptr) return value; } -/* Read indexed register (8 bit) from bytecode. */ -static uint8_t tci_read_r8(const tcg_target_ulong *regs, const uint8_t **tb_ptr) -{ - uint8_t value = tci_read_reg8(regs, **tb_ptr); - *tb_ptr += 1; - return value; -} - #if TCG_TARGET_HAS_ext8s_i32 || TCG_TARGET_HAS_ext8s_i64 /* Read indexed register (8 bit signed) from bytecode. */ static int8_t tci_read_r8s(const tcg_target_ulong *regs, const uint8_t **tb_ptr) @@ -550,7 +537,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, tci_write_reg(regs, t0, *(uint32_t *)(t1 + t2)); break; CASE_32_64(st8) - t0 = tci_read_r8(regs, &tb_ptr); + t0 = tci_read_r(regs, &tb_ptr); t1 = tci_read_r(regs, &tb_ptr); t2 = tci_read_s32(&tb_ptr); *(uint8_t *)(t1 + t2) = t0; @@ -739,8 +726,8 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, #if TCG_TARGET_HAS_ext8u_i32 case INDEX_op_ext8u_i32: t0 = *tb_ptr++; - t1 = tci_read_r8(regs, &tb_ptr); - tci_write_reg(regs, t0, t1); + t1 = tci_read_r(regs, &tb_ptr); + tci_write_reg(regs, t0, (uint8_t)t1); break; #endif #if TCG_TARGET_HAS_ext16u_i32 @@ -933,8 +920,8 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, #if TCG_TARGET_HAS_ext8u_i64 case INDEX_op_ext8u_i64: t0 = *tb_ptr++; - t1 = tci_read_r8(regs, &tb_ptr); - tci_write_reg(regs, t0, t1); + t1 = tci_read_r(regs, &tb_ptr); + tci_write_reg(regs, t0, (uint8_t)t1); break; #endif #if TCG_TARGET_HAS_ext8s_i64 From patchwork Thu Feb 4 01:44:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376170 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp906220ejt; Wed, 3 Feb 2021 18:07:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJy0t9eZyw/gSlJ3bN3TtAjQWN4QDdCMJML8+Gwp9S+MkcM/vG6XT0xGSZ6jZR1f5nhSNdhP X-Received: by 2002:a25:7c01:: with SMTP id x1mr8648307ybc.413.1612404445479; Wed, 03 Feb 2021 18:07:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612404445; cv=none; d=google.com; s=arc-20160816; b=akoLQlVyakzWfXGMWBueyZg6ooirhbbMvxdZUv7Fjj/nBVRYxuqC4WdDLRtviaVuEE 8AORThhq36w3Ck5RQaQa0gQNcbkSDMXBPkO+uqtCBUhPUV93Lr+2Zm/IzTxVU/TK2rJV avKptqE0+rcCWJy59j6K0Ff/yIMqx87l7e4WtiapjTKY/nbm8YdE/2yIjAxFNbOUBB0x Ai+uPZ3Ov528zslmVK3MaNXUOnJZaDNEEd/W7aLiQEln2pT9wIT7nLqBp9VmJolTuQDx yvGEfb6wy5X2qsX0niLV0zhLDzOPWqDjprFCBK9d9tXmQ10w4CxsB0gW5ZsP6XQFRjIO mjsg== 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=r7Bqt7XeLpJxFziax4YcAvS468lSm4SfB1qZvFnNDEY=; b=SUAQJqZApBEJ2a9v/DV+N1p3aZJUVxLF/GoZcXwO1K8u1MB7OE2L5h0kzBXE1+WVqq vlFzDnIjmlnoRxYky+FZXrxi22btuTuRr0Xf/uD0USzTvn5zkpf0B4sOja74akLk7VBv OB8m1pjKg8IV1oYKHHAPWjaabPENi/E2FCZyo3Hi4ZzmUKYBXY1wbpFo8FujuBOqU4w5 4dDeOKGLyk/eAeH/jEgTKbY0m9eOis8pGj1qedFdNmtp7d2opMN1n+B2f1RTmuYWdPKR Zoho8RumrH9ZBAZWTXNCksv+uIi+w8k6DeGu/cFZxIc0E4ka2sA676GwyFP7bHg7/ioa I2DA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rEFA1nE0; 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 w6si3772924ybc.255.2021.02.03.18.07.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:07:25 -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=rEFA1nE0; 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]:36568 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7U3I-0006BB-DL for patch@linaro.org; Wed, 03 Feb 2021 21:07:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44716) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Tiw-0005F0-Fi for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:24 -0500 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]:55429) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Tin-0003vB-0S for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:22 -0500 Received: by mail-pj1-x1029.google.com with SMTP id s24so767912pjp.5 for ; Wed, 03 Feb 2021 17:46:11 -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=r7Bqt7XeLpJxFziax4YcAvS468lSm4SfB1qZvFnNDEY=; b=rEFA1nE061rSgny28wXa4XZZSe36PAPAl1om1bEleHfoX2Xqyzig/BnjvLI8i1KZ0b gre2WSHy+HJdGcV4c596nLFSTjgi2UA+eEFUumQwlQiycuhRsDYBEYUhoe3FUOBDYoOh 8T+BQlkJmaULIE0J4JikgXQiflEwvOGCUKgvfuNeJZDX1/peCxwyS9kAM7luK3tl5Wiu otl2NUH02t3Cy/n+YfqcXjVUfb1xOWgfaMX39bUQUDELaEa6L7Eh1ABX4GMbrPwUPqgj K284ywuXluhGN5rsQsozpOsllJpLmUZwvqQtF/5iTq/y4sm1odCYoqu4rlKZDflCTfEe DvHg== 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=r7Bqt7XeLpJxFziax4YcAvS468lSm4SfB1qZvFnNDEY=; b=mB5dxXsqsgT5j5tHWcakERDHRPwA0vqVgYDYnQU7l5ZBFYKkW4XKNgzQ7/Vep93E9b OBXM/gfY1BSEzLR9LlN18wyHb7yJlf4ZfBqGvKs8d+ipW453sKAfBeh5x25veaW/mLJ8 lDYu1PO3cfC+/lOKRYn1eaDhxPiEcujEgIWc4NhVXt8JqTVmTgoKOGWgjKS48nXxViYk wFEpyM3SLFBTq67wiSS/xRLDih7u5hdqT9HIG+0LDArY0i1239IiYtAkVr4a6JEjHUZ/ csWBMzR1xb1/qdYpvA2swH+dEYbHfPOa7JM1KiK+hJPtTq+z8iY184zw3Iu5o6S9bo/C igmg== X-Gm-Message-State: AOAM532jFsbcaundseiCJVb2cSyjK0b+Uk32RwXM/K/EBh/xhxFBL8KU DOewg/yHusaYKuw4MwRWW5NbN970YeqL6c77 X-Received: by 2002:a17:902:e211:b029:e2:843c:426e with SMTP id u17-20020a170902e211b02900e2843c426emr5546451plb.16.1612403170356; Wed, 03 Feb 2021 17:46:10 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.46.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:46:09 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 32/93] tcg/tci: Remove tci_read_r8s Date: Wed, 3 Feb 2021 15:44:08 -1000 Message-Id: <20210204014509.882821-33-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1029; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1029.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Use explicit casts for ext8s opcodes. Signed-off-by: Richard Henderson --- tcg/tci.c | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index c44a4aec7b..25db479e62 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -57,13 +57,6 @@ static tcg_target_ulong tci_read_reg(const tcg_target_ulong *regs, TCGReg index) return regs[index]; } -#if TCG_TARGET_HAS_ext8s_i32 || TCG_TARGET_HAS_ext8s_i64 -static int8_t tci_read_reg8s(const tcg_target_ulong *regs, TCGReg index) -{ - return (int8_t)tci_read_reg(regs, index); -} -#endif - #if TCG_TARGET_HAS_ext16s_i32 || TCG_TARGET_HAS_ext16s_i64 static int16_t tci_read_reg16s(const tcg_target_ulong *regs, TCGReg index) { @@ -164,16 +157,6 @@ tci_read_r(const tcg_target_ulong *regs, const uint8_t **tb_ptr) return value; } -#if TCG_TARGET_HAS_ext8s_i32 || TCG_TARGET_HAS_ext8s_i64 -/* Read indexed register (8 bit signed) from bytecode. */ -static int8_t tci_read_r8s(const tcg_target_ulong *regs, const uint8_t **tb_ptr) -{ - int8_t value = tci_read_reg8s(regs, **tb_ptr); - *tb_ptr += 1; - return value; -} -#endif - /* Read indexed register (16 bit) from bytecode. */ static uint16_t tci_read_r16(const tcg_target_ulong *regs, const uint8_t **tb_ptr) @@ -712,8 +695,8 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, #if TCG_TARGET_HAS_ext8s_i32 case INDEX_op_ext8s_i32: t0 = *tb_ptr++; - t1 = tci_read_r8s(regs, &tb_ptr); - tci_write_reg(regs, t0, t1); + t1 = tci_read_r(regs, &tb_ptr); + tci_write_reg(regs, t0, (int8_t)t1); break; #endif #if TCG_TARGET_HAS_ext16s_i32 @@ -927,8 +910,8 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, #if TCG_TARGET_HAS_ext8s_i64 case INDEX_op_ext8s_i64: t0 = *tb_ptr++; - t1 = tci_read_r8s(regs, &tb_ptr); - tci_write_reg(regs, t0, t1); + t1 = tci_read_r(regs, &tb_ptr); + tci_write_reg(regs, t0, (int8_t)t1); break; #endif #if TCG_TARGET_HAS_ext16s_i64 From patchwork Thu Feb 4 01:44:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376174 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp909146ejt; Wed, 3 Feb 2021 18:13:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJzGNz34Gzo8hAPjyiGXo18UoYL+K6SMYbCVmXMuFuB7L4Ej6pLfvBxN7tQYZ1yY9C3nKtX0 X-Received: by 2002:a25:d9d4:: with SMTP id q203mr8580811ybg.478.1612404782509; Wed, 03 Feb 2021 18:13:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612404782; cv=none; d=google.com; s=arc-20160816; b=baxjiF9wf8LaXFVUFDeLnr9+1futHKWswCuBtyXIXzUAuHUCszXCzoqLQUqHZZY9dG 2b4aAxqXCHQP0XvSjLgKLddPZUXWPXCtFETSifKW/w2+9DlXt27UGtt9EqzEPx0R+gv/ dE2Z8+Biu4TB2ZPfZTuHCISUI3ovejpT9L7R8jkJhGEWa06hlqMCbcr0egDCjoJuhX/U /pyty1ID513pu09/1ZhzAqFVYeQ9w7QaMl8Q/aWjzLtdpztl8GumWjGGOpHFhSshptCv jyicu6KZzDP6bLwsNCVtqxuZvEfUFh8t6Xfd7EG+SKPN59+07V2cGCjruTn9qfSHQHyg BQgQ== 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=WwtU4XN3I/7BQWEoh7IwoY3+ESrnoHkEE2Q1sU/eyYI=; b=IfYBcXiXWlQ6kJnFVa90EygeJMMZ+Z8H1lUeQy+buqmHlHzVkE1LG7urpJ+rQmFGMn uXRUAht5paa5m+BK5iATZQXogRdytBkYvZEEXWcWyyQtLVeaA5FkGqIkfLPiBw1tLOYe tqWO6ZT0KhfMpCpaWVEqv1UVpDnGWeXPwTXhOMTnRIogqW4pkkMcnCkmXGcVWxZuTHhO HYiqWtsGLIpa25HhlIFq6Di4fxGFw0WMRL5XpNdQovKzUpInSohzO/6BmDTKjYiWk2s4 KMi9ync//sQfMWvYSdpcfsJub0g9z04jSDtPFXVREZqkj6FfyKeHt9M21SENzcg6xYDt iqKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jUaSU7TB; 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 y5si4307751ybj.494.2021.02.03.18.13.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:13: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=jUaSU7TB; 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]:50214 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7U8j-0003de-Qx for patch@linaro.org; Wed, 03 Feb 2021 21:13:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44776) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Tj1-0005IY-RV for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:31 -0500 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]:38328) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Tin-0003vJ-5i for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:26 -0500 Received: by mail-pf1-x430.google.com with SMTP id y205so1075141pfc.5 for ; Wed, 03 Feb 2021 17:46:12 -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=WwtU4XN3I/7BQWEoh7IwoY3+ESrnoHkEE2Q1sU/eyYI=; b=jUaSU7TB1TnycY8zIj9HVapyoDHalm5npBGBVq6N50IDErN5Fcx9aKMXf5lrqKijDk m9VSBXhanqEQsClO7iwc47IlJgkuPKhhn3tAdFixoSAAMNOYysnvq0WmmwnY478HCMtG IwGHQwxGEtvrxvUfIUXSLO4HMTkn0hWF4DbbbslEDOD1UxWFlhLCXp4Fu83kmCbkzedB /C7GjvqqQxFa6KSHkwzDjArlIwKKZ2wrOsmr7alA/5pRZU5dART/ZNENQSzAHb9r3u6g /6XcaHMraHqdDW11ZXmFUrvK/tvTBrOXBM7akbsKhJKgyeyJ1eQaEXi1bzV9pC9ccWj4 Ye8w== 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=WwtU4XN3I/7BQWEoh7IwoY3+ESrnoHkEE2Q1sU/eyYI=; b=Xx/O2WA/wEgpBayIoZ8Q8whUDmJ0aZ9XmXC8434Ia4FdZ9GIxTeag2RM/RieavimH8 VY8jOhYf2QsqqPjoApCeeSigPag392KtX+NTdN0XRWNAmQxVrUlMAuFCurBTwkZj0qQy shv9r4fYPP9q7oTvft9QqD5sECafXpcZyfMuD/+QzOdGPjrc6QbCJRrQ2XEJwHf9Iovj t/MshE+KvIwt+wRpQtvu1CSXKCuLU8EIsPfND5bx0oedu7oMx4JxOiuQJQpXlwaH1qFX /pDrDx+J9ghVBlle1uMc6b7VL+L7jS47LjeR6yxirpWEoS2Ip2JWPhkFcoWOO49Vccht rCeg== X-Gm-Message-State: AOAM531JwC64HHzFIqoTZrLm45R3B/nd8TVgWCNOk8pUVF94pRpHrBYc 6+Xck8nhUPYyBeqDyLTv6XocaWNYPB1xi5iZ X-Received: by 2002:a63:43c6:: with SMTP id q189mr6565356pga.245.1612403171906; Wed, 03 Feb 2021 17:46:11 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.46.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:46:11 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 33/93] tcg/tci: Remove tci_read_r16 Date: Wed, 3 Feb 2021 15:44:09 -1000 Message-Id: <20210204014509.882821-34-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::430; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x430.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=unavailable 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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Use explicit casts for ext16u opcodes, and allow truncation to happen with the store for st8 opcodes, and with the call for bswap16 opcodes. Signed-off-by: Richard Henderson --- tcg/tci.c | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index 25db479e62..547be0c2f0 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -71,11 +71,6 @@ static int32_t tci_read_reg32s(const tcg_target_ulong *regs, TCGReg index) } #endif -static uint16_t tci_read_reg16(const tcg_target_ulong *regs, TCGReg index) -{ - return (uint16_t)tci_read_reg(regs, index); -} - static uint32_t tci_read_reg32(const tcg_target_ulong *regs, TCGReg index) { return (uint32_t)tci_read_reg(regs, index); @@ -157,15 +152,6 @@ tci_read_r(const tcg_target_ulong *regs, const uint8_t **tb_ptr) return value; } -/* Read indexed register (16 bit) from bytecode. */ -static uint16_t tci_read_r16(const tcg_target_ulong *regs, - const uint8_t **tb_ptr) -{ - uint16_t value = tci_read_reg16(regs, **tb_ptr); - *tb_ptr += 1; - return value; -} - #if TCG_TARGET_HAS_ext16s_i32 || TCG_TARGET_HAS_ext16s_i64 /* Read indexed register (16 bit signed) from bytecode. */ static int16_t tci_read_r16s(const tcg_target_ulong *regs, @@ -526,7 +512,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, *(uint8_t *)(t1 + t2) = t0; break; CASE_32_64(st16) - t0 = tci_read_r16(regs, &tb_ptr); + t0 = tci_read_r(regs, &tb_ptr); t1 = tci_read_r(regs, &tb_ptr); t2 = tci_read_s32(&tb_ptr); *(uint16_t *)(t1 + t2) = t0; @@ -716,14 +702,14 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, #if TCG_TARGET_HAS_ext16u_i32 case INDEX_op_ext16u_i32: t0 = *tb_ptr++; - t1 = tci_read_r16(regs, &tb_ptr); - tci_write_reg(regs, t0, t1); + t1 = tci_read_r(regs, &tb_ptr); + tci_write_reg(regs, t0, (uint16_t)t1); break; #endif #if TCG_TARGET_HAS_bswap16_i32 case INDEX_op_bswap16_i32: t0 = *tb_ptr++; - t1 = tci_read_r16(regs, &tb_ptr); + t1 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, bswap16(t1)); break; #endif @@ -924,8 +910,8 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, #if TCG_TARGET_HAS_ext16u_i64 case INDEX_op_ext16u_i64: t0 = *tb_ptr++; - t1 = tci_read_r16(regs, &tb_ptr); - tci_write_reg(regs, t0, t1); + t1 = tci_read_r(regs, &tb_ptr); + tci_write_reg(regs, t0, (uint16_t)t1); break; #endif #if TCG_TARGET_HAS_ext32s_i64 @@ -947,7 +933,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, #if TCG_TARGET_HAS_bswap16_i64 case INDEX_op_bswap16_i64: t0 = *tb_ptr++; - t1 = tci_read_r16(regs, &tb_ptr); + t1 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, bswap16(t1)); break; #endif From patchwork Thu Feb 4 01:44:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376169 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp906164ejt; Wed, 3 Feb 2021 18:07:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJwUoWH94apr7dIzUO9PaXSdAxzt8RZdzC/si07yjxPIWKUKNcKW0O/IY04NtKpxg33X0RmZ X-Received: by 2002:a25:d757:: with SMTP id o84mr8720270ybg.5.1612404438846; Wed, 03 Feb 2021 18:07:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612404438; cv=none; d=google.com; s=arc-20160816; b=Oo871DofwGXBW6x3PEDIRKcxJm2Wtiol4LwoeAOP90bt76u5XmFdwy9oF9rp3iU3f4 u11Ff2r00OzJ7zoYdVLdRwjFx/IPSPz5+DTUAFFs6xXtzmc78KmuX6/9hmGc9pWjEEYd e4QinYRXs9PDk2V+A7UKnBd2xeaDD/lgkT8R1mfJqk1lsLEj2iy8scJqv8kKr+g9T0TC gZuF7CPQnaykqDHsinxGGb+DZXyWYiNHuJrU+q1AYF30QBvi3kuicoaIy7J2gsxq2Tno mvYTy+LFUnSzouznMpDuGgylLUYKjgMPP95k79d1eMEg7HaVbqe0hn6LXPoq0M4niV4n 1c3A== 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=afvqbbQ97M3vRazhloBXxdPonlEgZwJG3R71ZxT6Uq4=; b=kWRY7dODjtIe4br/a1jaWb977aMbOsZA/1Y9VRBJp+0OgT2NVJMBRLr2AQ/Iu0LqtV s7R4SMtF/PZ3KgkwP9IFr50lLQs/cB0zzzwehSiWxgPU1+CuittZtywVPcWdfhWt+HVz orq5NG+GE5axJX7crs7jO70ikBlFqEzqSPCphaiex8MnrQBWEcjH0/e5p2hSblyAb9se +J+UZI3kUzKoz10RCrDFr12mFdoNldfONACcTwoQLMTOi7dfawZNI5KsFv2xJujF6tza TTHi+80I6fNNt2Gb+X1SRnSRaUnlOeLgFdV9KdsCw1yxDsLUZzlntg2JCNOt3UhI7Rfp rxVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pLHgDKqY; 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 4si3919850ybh.138.2021.02.03.18.07.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:07:18 -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=pLHgDKqY; 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]:36922 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7U3C-0006K4-5N for patch@linaro.org; Wed, 03 Feb 2021 21:07:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44788) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Tj3-0005Ix-Rt for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:31 -0500 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]:44897) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Tio-0003vT-Vj for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:29 -0500 Received: by mail-pl1-x634.google.com with SMTP id j11so872286plt.11 for ; Wed, 03 Feb 2021 17:46:14 -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=afvqbbQ97M3vRazhloBXxdPonlEgZwJG3R71ZxT6Uq4=; b=pLHgDKqYpMLN+RZsSBV72LtUuXEBRwSc2nmPs01ufYffbHacNCgtMob2g0yg7lg179 gsqsCY/rvCW3xHf2VsBhy5EO63oOJAiGsxw1RchlrPeGQwCKX7kJqzzysf2IH6uaM54Z 6NWbHuaDaYR4s44almgeBobBPJ9rwT33DJVf4MsIbfnNkqZ5RIFaUbwQYxU2q5nnvAOu 0yJD1rejHa5a/m29PaqO7RK3BJnNYqpArHrCXmbLnKZUZ8LskVBXEsgE8/QZIWyoOsSs dFldw72hZ0+CiSYjnM6iz7gTusyplacmlNtUn66HRQvhJzcW3Dmbse7tsiqDduF/ydcr MiPA== 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=afvqbbQ97M3vRazhloBXxdPonlEgZwJG3R71ZxT6Uq4=; b=cyTpbsRKlPfAMuzUg3ZVjl5+ZoSJrVmEf0mWHoKH+gbzm3I5u0nLxxsmp4N/g789YQ cWFs+tztPLXrO62tbJgGWDcpm60pUuvoS4v7pA19cMa9bWqGfrSReJbPCTi4zRbRBnrG qzvIsEVUZDqLRUDiT3mGecbU/MRbURWJSRtLKzJRdxQTpL7ECRX4xl1bj80PX6Q8UYwe yofW6FNrkQ1oa9GtdjCxM4W2EfwvMZApKEzT3KQRBVsHT4f5A9bOtBQ0rBIiqmYvPhM6 GjgTNTybWvEo1xx8yc5dkHZM+foEH+qns5IbLI7U3UBATHG76mE3DMxwgatU5Tj0cOTZ YuKQ== X-Gm-Message-State: AOAM530GMjq13GNWAMl+bnaDoQeDCWlnAW+Dn3UHruAkqVYYJHwHsRfZ 9ma1DBDRNyaQXT1V0LnKqPHc5TpNjP563734 X-Received: by 2002:a17:902:c284:b029:e1:8863:b3d6 with SMTP id i4-20020a170902c284b02900e18863b3d6mr5690198pld.64.1612403173732; Wed, 03 Feb 2021 17:46:13 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.46.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:46:13 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 34/93] tcg/tci: Remove tci_read_r16s Date: Wed, 3 Feb 2021 15:44:10 -1000 Message-Id: <20210204014509.882821-35-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x634.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Use explicit casts for ext16s opcodes. Signed-off-by: Richard Henderson --- tcg/tci.c | 148 +++++++++++++++++++++--------------------------------- 1 file changed, 58 insertions(+), 90 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index 547be0c2f0..72ec63e18e 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -57,13 +57,6 @@ static tcg_target_ulong tci_read_reg(const tcg_target_ulong *regs, TCGReg index) return regs[index]; } -#if TCG_TARGET_HAS_ext16s_i32 || TCG_TARGET_HAS_ext16s_i64 -static int16_t tci_read_reg16s(const tcg_target_ulong *regs, TCGReg index) -{ - return (int16_t)tci_read_reg(regs, index); -} -#endif - #if TCG_TARGET_REG_BITS == 64 static int32_t tci_read_reg32s(const tcg_target_ulong *regs, TCGReg index) { @@ -71,11 +64,6 @@ static int32_t tci_read_reg32s(const tcg_target_ulong *regs, TCGReg index) } #endif -static uint32_t tci_read_reg32(const tcg_target_ulong *regs, TCGReg index) -{ - return (uint32_t)tci_read_reg(regs, index); -} - #if TCG_TARGET_REG_BITS == 64 static uint64_t tci_read_reg64(const tcg_target_ulong *regs, TCGReg index) { @@ -152,33 +140,13 @@ tci_read_r(const tcg_target_ulong *regs, const uint8_t **tb_ptr) return value; } -#if TCG_TARGET_HAS_ext16s_i32 || TCG_TARGET_HAS_ext16s_i64 -/* Read indexed register (16 bit signed) from bytecode. */ -static int16_t tci_read_r16s(const tcg_target_ulong *regs, - const uint8_t **tb_ptr) -{ - int16_t value = tci_read_reg16s(regs, **tb_ptr); - *tb_ptr += 1; - return value; -} -#endif - -/* Read indexed register (32 bit) from bytecode. */ -static uint32_t tci_read_r32(const tcg_target_ulong *regs, - const uint8_t **tb_ptr) -{ - uint32_t value = tci_read_reg32(regs, **tb_ptr); - *tb_ptr += 1; - return value; -} - #if TCG_TARGET_REG_BITS == 32 /* Read two indexed registers (2 * 32 bit) from bytecode. */ static uint64_t tci_read_r64(const tcg_target_ulong *regs, const uint8_t **tb_ptr) { - uint32_t low = tci_read_r32(regs, tb_ptr); - return tci_uint64(tci_read_r32(regs, tb_ptr), low); + uint32_t low = tci_read_r(regs, tb_ptr); + return tci_uint64(tci_read_r(regs, tb_ptr), low); } #elif TCG_TARGET_REG_BITS == 64 /* Read indexed register (32 bit signed) from bytecode. */ @@ -439,8 +407,8 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, continue; case INDEX_op_setcond_i32: t0 = *tb_ptr++; - t1 = tci_read_r32(regs, &tb_ptr); - t2 = tci_read_r32(regs, &tb_ptr); + t1 = tci_read_r(regs, &tb_ptr); + t2 = tci_read_r(regs, &tb_ptr); condition = *tb_ptr++; tci_write_reg(regs, t0, tci_compare32(t1, t2, condition)); break; @@ -463,7 +431,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, #endif case INDEX_op_mov_i32: t0 = *tb_ptr++; - t1 = tci_read_r32(regs, &tb_ptr); + t1 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, t1); break; case INDEX_op_tci_movi_i32: @@ -519,7 +487,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, break; case INDEX_op_st_i32: CASE_64(st32) - t0 = tci_read_r32(regs, &tb_ptr); + t0 = tci_read_r(regs, &tb_ptr); t1 = tci_read_r(regs, &tb_ptr); t2 = tci_read_s32(&tb_ptr); *(uint32_t *)(t1 + t2) = t0; @@ -529,62 +497,62 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_add_i32: t0 = *tb_ptr++; - t1 = tci_read_r32(regs, &tb_ptr); - t2 = tci_read_r32(regs, &tb_ptr); + t1 = tci_read_r(regs, &tb_ptr); + t2 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, t1 + t2); break; case INDEX_op_sub_i32: t0 = *tb_ptr++; - t1 = tci_read_r32(regs, &tb_ptr); - t2 = tci_read_r32(regs, &tb_ptr); + t1 = tci_read_r(regs, &tb_ptr); + t2 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, t1 - t2); break; case INDEX_op_mul_i32: t0 = *tb_ptr++; - t1 = tci_read_r32(regs, &tb_ptr); - t2 = tci_read_r32(regs, &tb_ptr); + t1 = tci_read_r(regs, &tb_ptr); + t2 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, t1 * t2); break; case INDEX_op_div_i32: t0 = *tb_ptr++; - t1 = tci_read_r32(regs, &tb_ptr); - t2 = tci_read_r32(regs, &tb_ptr); + t1 = tci_read_r(regs, &tb_ptr); + t2 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, (int32_t)t1 / (int32_t)t2); break; case INDEX_op_divu_i32: t0 = *tb_ptr++; - t1 = tci_read_r32(regs, &tb_ptr); - t2 = tci_read_r32(regs, &tb_ptr); - tci_write_reg(regs, t0, t1 / t2); + t1 = tci_read_r(regs, &tb_ptr); + t2 = tci_read_r(regs, &tb_ptr); + tci_write_reg(regs, t0, (uint32_t)t1 / (uint32_t)t2); break; case INDEX_op_rem_i32: t0 = *tb_ptr++; - t1 = tci_read_r32(regs, &tb_ptr); - t2 = tci_read_r32(regs, &tb_ptr); + t1 = tci_read_r(regs, &tb_ptr); + t2 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, (int32_t)t1 % (int32_t)t2); break; case INDEX_op_remu_i32: t0 = *tb_ptr++; - t1 = tci_read_r32(regs, &tb_ptr); - t2 = tci_read_r32(regs, &tb_ptr); - tci_write_reg(regs, t0, t1 % t2); + t1 = tci_read_r(regs, &tb_ptr); + t2 = tci_read_r(regs, &tb_ptr); + tci_write_reg(regs, t0, (uint32_t)t1 % (uint32_t)t2); break; case INDEX_op_and_i32: t0 = *tb_ptr++; - t1 = tci_read_r32(regs, &tb_ptr); - t2 = tci_read_r32(regs, &tb_ptr); + t1 = tci_read_r(regs, &tb_ptr); + t2 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, t1 & t2); break; case INDEX_op_or_i32: t0 = *tb_ptr++; - t1 = tci_read_r32(regs, &tb_ptr); - t2 = tci_read_r32(regs, &tb_ptr); + t1 = tci_read_r(regs, &tb_ptr); + t2 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, t1 | t2); break; case INDEX_op_xor_i32: t0 = *tb_ptr++; - t1 = tci_read_r32(regs, &tb_ptr); - t2 = tci_read_r32(regs, &tb_ptr); + t1 = tci_read_r(regs, &tb_ptr); + t2 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, t1 ^ t2); break; @@ -592,41 +560,41 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_shl_i32: t0 = *tb_ptr++; - t1 = tci_read_r32(regs, &tb_ptr); - t2 = tci_read_r32(regs, &tb_ptr); - tci_write_reg(regs, t0, t1 << (t2 & 31)); + t1 = tci_read_r(regs, &tb_ptr); + t2 = tci_read_r(regs, &tb_ptr); + tci_write_reg(regs, t0, (uint32_t)t1 << (t2 & 31)); break; case INDEX_op_shr_i32: t0 = *tb_ptr++; - t1 = tci_read_r32(regs, &tb_ptr); - t2 = tci_read_r32(regs, &tb_ptr); - tci_write_reg(regs, t0, t1 >> (t2 & 31)); + t1 = tci_read_r(regs, &tb_ptr); + t2 = tci_read_r(regs, &tb_ptr); + tci_write_reg(regs, t0, (uint32_t)t1 >> (t2 & 31)); break; case INDEX_op_sar_i32: t0 = *tb_ptr++; - t1 = tci_read_r32(regs, &tb_ptr); - t2 = tci_read_r32(regs, &tb_ptr); - tci_write_reg(regs, t0, ((int32_t)t1 >> (t2 & 31))); + t1 = tci_read_r(regs, &tb_ptr); + t2 = tci_read_r(regs, &tb_ptr); + tci_write_reg(regs, t0, (int32_t)t1 >> (t2 & 31)); break; #if TCG_TARGET_HAS_rot_i32 case INDEX_op_rotl_i32: t0 = *tb_ptr++; - t1 = tci_read_r32(regs, &tb_ptr); - t2 = tci_read_r32(regs, &tb_ptr); + t1 = tci_read_r(regs, &tb_ptr); + t2 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, rol32(t1, t2 & 31)); break; case INDEX_op_rotr_i32: t0 = *tb_ptr++; - t1 = tci_read_r32(regs, &tb_ptr); - t2 = tci_read_r32(regs, &tb_ptr); + t1 = tci_read_r(regs, &tb_ptr); + t2 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, ror32(t1, t2 & 31)); break; #endif #if TCG_TARGET_HAS_deposit_i32 case INDEX_op_deposit_i32: t0 = *tb_ptr++; - t1 = tci_read_r32(regs, &tb_ptr); - t2 = tci_read_r32(regs, &tb_ptr); + t1 = tci_read_r(regs, &tb_ptr); + t2 = tci_read_r(regs, &tb_ptr); tmp16 = *tb_ptr++; tmp8 = *tb_ptr++; tmp32 = (((1 << tmp8) - 1) << tmp16); @@ -634,8 +602,8 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, break; #endif case INDEX_op_brcond_i32: - t0 = tci_read_r32(regs, &tb_ptr); - t1 = tci_read_r32(regs, &tb_ptr); + t0 = tci_read_r(regs, &tb_ptr); + t1 = tci_read_r(regs, &tb_ptr); condition = *tb_ptr++; label = tci_read_label(&tb_ptr); if (tci_compare32(t0, t1, condition)) { @@ -673,9 +641,9 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_mulu2_i32: t0 = *tb_ptr++; t1 = *tb_ptr++; - t2 = tci_read_r32(regs, &tb_ptr); - tmp64 = tci_read_r32(regs, &tb_ptr); - tci_write_reg64(regs, t1, t0, t2 * tmp64); + t2 = tci_read_r(regs, &tb_ptr); + tmp64 = (uint32_t)tci_read_r(regs, &tb_ptr); + tci_write_reg64(regs, t1, t0, (uint32_t)t2 * tmp64); break; #endif /* TCG_TARGET_REG_BITS == 32 */ #if TCG_TARGET_HAS_ext8s_i32 @@ -688,8 +656,8 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, #if TCG_TARGET_HAS_ext16s_i32 case INDEX_op_ext16s_i32: t0 = *tb_ptr++; - t1 = tci_read_r16s(regs, &tb_ptr); - tci_write_reg(regs, t0, t1); + t1 = tci_read_r(regs, &tb_ptr); + tci_write_reg(regs, t0, (int16_t)t1); break; #endif #if TCG_TARGET_HAS_ext8u_i32 @@ -716,21 +684,21 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, #if TCG_TARGET_HAS_bswap32_i32 case INDEX_op_bswap32_i32: t0 = *tb_ptr++; - t1 = tci_read_r32(regs, &tb_ptr); + t1 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, bswap32(t1)); break; #endif #if TCG_TARGET_HAS_not_i32 case INDEX_op_not_i32: t0 = *tb_ptr++; - t1 = tci_read_r32(regs, &tb_ptr); + t1 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, ~t1); break; #endif #if TCG_TARGET_HAS_neg_i32 case INDEX_op_neg_i32: t0 = *tb_ptr++; - t1 = tci_read_r32(regs, &tb_ptr); + t1 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, -t1); break; #endif @@ -903,8 +871,8 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, #if TCG_TARGET_HAS_ext16s_i64 case INDEX_op_ext16s_i64: t0 = *tb_ptr++; - t1 = tci_read_r16s(regs, &tb_ptr); - tci_write_reg(regs, t0, t1); + t1 = tci_read_r(regs, &tb_ptr); + tci_write_reg(regs, t0, (int16_t)t1); break; #endif #if TCG_TARGET_HAS_ext16u_i64 @@ -927,8 +895,8 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, #endif case INDEX_op_extu_i32_i64: t0 = *tb_ptr++; - t1 = tci_read_r32(regs, &tb_ptr); - tci_write_reg(regs, t0, t1); + t1 = tci_read_r(regs, &tb_ptr); + tci_write_reg(regs, t0, (uint32_t)t1); break; #if TCG_TARGET_HAS_bswap16_i64 case INDEX_op_bswap16_i64: @@ -940,7 +908,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, #if TCG_TARGET_HAS_bswap32_i64 case INDEX_op_bswap32_i64: t0 = *tb_ptr++; - t1 = tci_read_r32(regs, &tb_ptr); + t1 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, bswap32(t1)); break; #endif From patchwork Thu Feb 4 01:44:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376162 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp839594jah; Wed, 3 Feb 2021 18:02:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJyFZYH7XULXqggTBHXAUzSUoF3V/4/5C5uAsYzXfOc77grn1TWyFoPtUQYLaiTfRkECKDoE X-Received: by 2002:a25:55d7:: with SMTP id j206mr7886167ybb.6.1612404153504; Wed, 03 Feb 2021 18:02:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612404153; cv=none; d=google.com; s=arc-20160816; b=e7Y1xzqWOXdN4nksbazfxpaHV429Np0DZRspsRz/913XlVlwrHqCuvkDeFvZ01gZsH jvnYFPcWqQRA63cr1cvouB6B3xtm14AJGjKn4s05aO1U+z5JUfR5xVt/95lPPnJUXX8Y r+9XTmEAYEXehpfcZSSoyn6rOHI0LgRzkEBP/thO8kJxys93iRklalPYeZ41nqB/VAaN uyaAgqvYnr2tv1QzNnDFMkFml0Wu55uqd1MsYNFsKo8f2nuHLPDfZUB99LzxxWxTXtw+ diGAYcV+BLJFYpDwINCn/rVh+t4rdiTmtPsnIa2jukCIrNRCQV1k2hY39UaPAmaOWEII wfjA== 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=ybRVe+0cbcMgdImiuixof8hM4eoxKsh03sT+tgpyyEY=; b=KDSNaMMmAK8yFpWyVcF60dXkZWnAqLwLhvKqtUqbbYRvHFTmSX630sZAmyDhG4ATl6 uIj5EenIjglDXXRbql3bEqAbYqz4SMKM/Kzzgzy/hB/P6Ad55bINOCFjlSZmeNJ62UO5 vEcgEArOwcUhwwMyxDwHSmtczu4GhdyuQDB2X989DBrUYWy4uyQe4V0GGX+F4cr/doNo 3eGp2LPWf/w9Xe5QDT12rFChehjywdM4lFLDNKraWK59Vlza8w46E/ct+lBWxrYVVmE5 MEKJWPbvirjJkHAsXW9TCUzkljiwqjbVj0HeNP/EQvoNku/AYld0mKh3WWF0XO0/BCut oWIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GHN3icFQ; 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 b6si3736289ybk.485.2021.02.03.18.02.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:02:33 -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=GHN3icFQ; 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]:48370 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7Tya-0007jP-Uo for patch@linaro.org; Wed, 03 Feb 2021 21:02:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44744) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Tiz-0005Hr-Ew for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:25 -0500 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]:34694) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Tis-0003vf-8p for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:25 -0500 Received: by mail-pj1-x1030.google.com with SMTP id my11so4244205pjb.1 for ; Wed, 03 Feb 2021 17:46:16 -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=ybRVe+0cbcMgdImiuixof8hM4eoxKsh03sT+tgpyyEY=; b=GHN3icFQ6n/hCBrkLU111p16ZGoNy4IkqtDhhAhxbQ4VUvo0h7i1xVaTA8/P1JFqgk TObgtqagdhV6fvK5mm7HVMAkm8y5Hc5d0vzIRSqYama9vfdgYT5ncAwJ9M2ynPj9gOrw PFGrdlQlJipd8fjw9et4Hzu/pUsB8ja+2HzuFms7OMco2NUJ15Eh6SfQLrr22Ofrd11d z/vpESOUsbdCGob9a8g/ndbJjlG9yj43m0kOG/CzRmLxGEaHDek6o27Bj6bmj3CSR62c /WP/KFnDIhO1Mbfm5QvBU0WW5vdowqu8jCr49cRn44AsZPAO88DId3tgAFxgvuWIJdj9 Ga/A== 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=ybRVe+0cbcMgdImiuixof8hM4eoxKsh03sT+tgpyyEY=; b=SZu24ANiQaNtaRDcZbu02FSuT2Z7MO7X5vDvVG7DiE115UUPTFIz43kBaOMtRr2j5/ zV3JwY2fFJGhWBR99PsvECSyePFuojFSOUbTZp1D1IGvKUYd1W264WD2Bih2l3qojSW6 MQGI2ks8PItbAmQd8PnN/eLEps5YP1RXYCiRn/O1DUIOuD+rehDhxgBl66mB2XK1zVnQ 7LyyaRt6s3wmMDj9IeE0CZI6mSRFQIkORBXbBPjk7uzowbhAFDeH8bo+rNvkmoORiwso s2P3/Jc4xfODY8G51Pqo/g9gADU7rSBEoj9csV4/5J5T5hGUi2p0Txl4Trn91kMdA9iw bHBQ== X-Gm-Message-State: AOAM530zx9ocM5GeWL0KG1j7hgwi6syCAOR3f2qh8Q2R41YIBG397hFg Uhgo+dYqlwWxoJaoaXYNbYp0+8opETyrXQh0 X-Received: by 2002:a17:90b:8d7:: with SMTP id ds23mr5790883pjb.116.1612403175863; Wed, 03 Feb 2021 17:46:15 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.46.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:46:14 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 35/93] tcg/tci: Remove tci_read_r32s Date: Wed, 3 Feb 2021 15:44:11 -1000 Message-Id: <20210204014509.882821-36-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1030; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1030.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Use explicit casts for ext32s opcodes. Signed-off-by: Richard Henderson --- tcg/tci.c | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index 72ec63e18e..9c8395397a 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -57,13 +57,6 @@ static tcg_target_ulong tci_read_reg(const tcg_target_ulong *regs, TCGReg index) return regs[index]; } -#if TCG_TARGET_REG_BITS == 64 -static int32_t tci_read_reg32s(const tcg_target_ulong *regs, TCGReg index) -{ - return (int32_t)tci_read_reg(regs, index); -} -#endif - #if TCG_TARGET_REG_BITS == 64 static uint64_t tci_read_reg64(const tcg_target_ulong *regs, TCGReg index) { @@ -149,15 +142,6 @@ static uint64_t tci_read_r64(const tcg_target_ulong *regs, return tci_uint64(tci_read_r(regs, tb_ptr), low); } #elif TCG_TARGET_REG_BITS == 64 -/* Read indexed register (32 bit signed) from bytecode. */ -static int32_t tci_read_r32s(const tcg_target_ulong *regs, - const uint8_t **tb_ptr) -{ - int32_t value = tci_read_reg32s(regs, **tb_ptr); - *tb_ptr += 1; - return value; -} - /* Read indexed register (64 bit) from bytecode. */ static uint64_t tci_read_r64(const tcg_target_ulong *regs, const uint8_t **tb_ptr) @@ -887,8 +871,8 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, #endif case INDEX_op_ext_i32_i64: t0 = *tb_ptr++; - t1 = tci_read_r32s(regs, &tb_ptr); - tci_write_reg(regs, t0, t1); + t1 = tci_read_r(regs, &tb_ptr); + tci_write_reg(regs, t0, (int32_t)t1); break; #if TCG_TARGET_HAS_ext32u_i64 case INDEX_op_ext32u_i64: From patchwork Thu Feb 4 01:44:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376184 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp913219ejt; Wed, 3 Feb 2021 18:20:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJykHhtz1mLGmzfD+EbKyfKZK9MITXtmBa2moklXfoHiy4ANG6XRW+xUrQvP9o8z/9Rzh6Ph X-Received: by 2002:a25:943:: with SMTP id u3mr9370184ybm.244.1612405244653; Wed, 03 Feb 2021 18:20:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612405244; cv=none; d=google.com; s=arc-20160816; b=LfQsLd/jPxo9NEfikmhuDJ6K7OuBVhK6xlN8VmutM0alW9udDtpDcu4TSq2pICac35 0/pmAHG/UrV6vO4V0IpMJDnfflsvGTl9pycdyIM0yr90xSVWTw1VFBFb6SoLXPwNl2eL I91laZ3zPU0DVmdJvtVUNUjY75epoP/mTX/8RBW8RSEkHH1CWlA8WJUJ+SYraZ0D1KF1 OHM11vdo/UfWG9yutrhs4X61zzSqe/cXpgVP3Z/RRs8aJkRqptqvmMW7NtmvKV9QoC04 7wUIpKw7TT6EQdP2nNive2uHK/BF9dnTNQ2KGZ/S0j6oQtdfmcC01YSM6go9eYfOUanV j3iw== 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=rPMFB2Q7bqmshseEZXdi4DH7vz7QmPfw5K/IzP922xY=; b=QNdhSlbGnm1457WtSp6JnxoNbESTIRcGLsGzF0P7cF2TaFAxEVpDTTR1dTXvz+fKjo 95GAxLSY/OiHKrSjcLLN8s8Dz6ikypj0klZ+/Z4ON7ZxgY++RmbCrIJUhOH2Xe1w9YTy PTEOLjYSchmLd8vXYRmVY2IlOC7LmuoOlGJNUazxWEflmpcYWP3/IpxU7COJn7CsGozo RiETlijxD2ul3OAa/tZMAySpuY6Z4ELr2kVrYAy/64hIgnyKJ/RS/mebzxHbD9UvFUOq Dxe6YY/BwStcX/vojlVHb3HsgIkgfnvgSToTwgxFnw+WJWNP4ZyTzjQSG4GBeQSNNMyM tg4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fnsTU3vl; 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 d203si4781774ybh.441.2021.02.03.18.20.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:20:44 -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=fnsTU3vl; 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]:39778 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7UGC-0002xH-0V for patch@linaro.org; Wed, 03 Feb 2021 21:20:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44818) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Tj7-0005LA-KK for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:34 -0500 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]:40255) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Tis-0003vo-U0 for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:33 -0500 Received: by mail-pj1-x102f.google.com with SMTP id z9so817703pjl.5 for ; Wed, 03 Feb 2021 17:46:18 -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=rPMFB2Q7bqmshseEZXdi4DH7vz7QmPfw5K/IzP922xY=; b=fnsTU3vlxjWSLIbztOkICaZPN3fThTs6i6j+MDQlHxNb8A/vSpRTqQWoNN+TGuN96q nYVCv6ofxi6o4Ce4tyJ5s4fMJxM3l+3ks4utECwcrlrgNmXSp/PXNwvKpcI8LCcM0+UT jplLWDZDtQQr7POlxL7r1CMRufZMBcpIfX/7Uf3q4N7qL2s0i3tIy+WAy5y3Gn41kryV BMtRhGNFdbow9nqcu0vWi4JIJ8VSZKsmnAwSiYgtzjXAqOIuhGRlnGU8bYIeQzp62sAd n5cNghADkCMEFZ9Mahdc74DNdKjTHJVIqBzlUshKF3r8roHOTK3A54I1VLl6Ah0m7/A0 rzkg== 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=rPMFB2Q7bqmshseEZXdi4DH7vz7QmPfw5K/IzP922xY=; b=j7P2tc+ev4+Wc5mgVGRD4w5er74FkNwYzuZaYe8Yy6NJXbDN/FLD7XQQaQPIFN4+td rPP4XMSOspKZ9WPzcTu3jMMjWAAyshGhx+U1QVmd09cCwbKVEuC5Xcu0qqrrKCLOAgpq iUiMAkdLqX5bm2M4OaYyTM1RmcCPf7Z+DFIhDiRBbyUBJzPGp6OSc7Q16/hSCKA2+I6t RU7MCyVgiy0GEg3GfEFnrjCBKEpbQWzbY1CkkyOQdUKxScdiTYZClh9Fp7+t1WnHCkUL YJLHEjUXsQSMEC8MqtwizCW3Qo0I9D19G5wW4VwaOixC7HXVzwVPR827LtVDVfPDeDFy /ddA== X-Gm-Message-State: AOAM533ZBWVHC50XJiVleiP4XUEdTOAXc0pzXHspvKQKHgT9wUEDsu/G tL//ayLRm4T50iZhTshIpbsEvfHvbxlz0/Po X-Received: by 2002:a17:90a:1503:: with SMTP id l3mr5776066pja.41.1612403177531; Wed, 03 Feb 2021 17:46:17 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.46.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:46:16 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 36/93] tcg/tci: Reduce use of tci_read_r64 Date: Wed, 3 Feb 2021 15:44:12 -1000 Message-Id: <20210204014509.882821-37-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102f; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102f.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" In all cases restricted to 64-bit hosts, tcg_read_r is identical. We retain the 64-bit symbol for the single case of INDEX_op_qemu_st_i64. Signed-off-by: Richard Henderson --- tcg/tci.c | 93 +++++++++++++++++++++++++------------------------------ 1 file changed, 42 insertions(+), 51 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index 9c8395397a..0246e663a3 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -57,13 +57,6 @@ static tcg_target_ulong tci_read_reg(const tcg_target_ulong *regs, TCGReg index) return regs[index]; } -#if TCG_TARGET_REG_BITS == 64 -static uint64_t tci_read_reg64(const tcg_target_ulong *regs, TCGReg index) -{ - return tci_read_reg(regs, index); -} -#endif - static void tci_write_reg(tcg_target_ulong *regs, TCGReg index, tcg_target_ulong value) { @@ -146,9 +139,7 @@ static uint64_t tci_read_r64(const tcg_target_ulong *regs, static uint64_t tci_read_r64(const tcg_target_ulong *regs, const uint8_t **tb_ptr) { - uint64_t value = tci_read_reg64(regs, **tb_ptr); - *tb_ptr += 1; - return value; + return tci_read_r(regs, tb_ptr); } #endif @@ -407,8 +398,8 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, #elif TCG_TARGET_REG_BITS == 64 case INDEX_op_setcond_i64: t0 = *tb_ptr++; - t1 = tci_read_r64(regs, &tb_ptr); - t2 = tci_read_r64(regs, &tb_ptr); + t1 = tci_read_r(regs, &tb_ptr); + t2 = tci_read_r(regs, &tb_ptr); condition = *tb_ptr++; tci_write_reg(regs, t0, tci_compare64(t1, t2, condition)); break; @@ -689,7 +680,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, #if TCG_TARGET_REG_BITS == 64 case INDEX_op_mov_i64: t0 = *tb_ptr++; - t1 = tci_read_r64(regs, &tb_ptr); + t1 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, t1); break; case INDEX_op_tci_movi_i64: @@ -713,7 +704,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, tci_write_reg(regs, t0, *(uint64_t *)(t1 + t2)); break; case INDEX_op_st_i64: - t0 = tci_read_r64(regs, &tb_ptr); + t0 = tci_read_r(regs, &tb_ptr); t1 = tci_read_r(regs, &tb_ptr); t2 = tci_read_s32(&tb_ptr); *(uint64_t *)(t1 + t2) = t0; @@ -723,62 +714,62 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_add_i64: t0 = *tb_ptr++; - t1 = tci_read_r64(regs, &tb_ptr); - t2 = tci_read_r64(regs, &tb_ptr); + t1 = tci_read_r(regs, &tb_ptr); + t2 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, t1 + t2); break; case INDEX_op_sub_i64: t0 = *tb_ptr++; - t1 = tci_read_r64(regs, &tb_ptr); - t2 = tci_read_r64(regs, &tb_ptr); + t1 = tci_read_r(regs, &tb_ptr); + t2 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, t1 - t2); break; case INDEX_op_mul_i64: t0 = *tb_ptr++; - t1 = tci_read_r64(regs, &tb_ptr); - t2 = tci_read_r64(regs, &tb_ptr); + t1 = tci_read_r(regs, &tb_ptr); + t2 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, t1 * t2); break; case INDEX_op_div_i64: t0 = *tb_ptr++; - t1 = tci_read_r64(regs, &tb_ptr); - t2 = tci_read_r64(regs, &tb_ptr); + t1 = tci_read_r(regs, &tb_ptr); + t2 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, (int64_t)t1 / (int64_t)t2); break; case INDEX_op_divu_i64: t0 = *tb_ptr++; - t1 = tci_read_r64(regs, &tb_ptr); - t2 = tci_read_r64(regs, &tb_ptr); + t1 = tci_read_r(regs, &tb_ptr); + t2 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, (uint64_t)t1 / (uint64_t)t2); break; case INDEX_op_rem_i64: t0 = *tb_ptr++; - t1 = tci_read_r64(regs, &tb_ptr); - t2 = tci_read_r64(regs, &tb_ptr); + t1 = tci_read_r(regs, &tb_ptr); + t2 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, (int64_t)t1 % (int64_t)t2); break; case INDEX_op_remu_i64: t0 = *tb_ptr++; - t1 = tci_read_r64(regs, &tb_ptr); - t2 = tci_read_r64(regs, &tb_ptr); + t1 = tci_read_r(regs, &tb_ptr); + t2 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, (uint64_t)t1 % (uint64_t)t2); break; case INDEX_op_and_i64: t0 = *tb_ptr++; - t1 = tci_read_r64(regs, &tb_ptr); - t2 = tci_read_r64(regs, &tb_ptr); + t1 = tci_read_r(regs, &tb_ptr); + t2 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, t1 & t2); break; case INDEX_op_or_i64: t0 = *tb_ptr++; - t1 = tci_read_r64(regs, &tb_ptr); - t2 = tci_read_r64(regs, &tb_ptr); + t1 = tci_read_r(regs, &tb_ptr); + t2 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, t1 | t2); break; case INDEX_op_xor_i64: t0 = *tb_ptr++; - t1 = tci_read_r64(regs, &tb_ptr); - t2 = tci_read_r64(regs, &tb_ptr); + t1 = tci_read_r(regs, &tb_ptr); + t2 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, t1 ^ t2); break; @@ -786,41 +777,41 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_shl_i64: t0 = *tb_ptr++; - t1 = tci_read_r64(regs, &tb_ptr); - t2 = tci_read_r64(regs, &tb_ptr); + t1 = tci_read_r(regs, &tb_ptr); + t2 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, t1 << (t2 & 63)); break; case INDEX_op_shr_i64: t0 = *tb_ptr++; - t1 = tci_read_r64(regs, &tb_ptr); - t2 = tci_read_r64(regs, &tb_ptr); + t1 = tci_read_r(regs, &tb_ptr); + t2 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, t1 >> (t2 & 63)); break; case INDEX_op_sar_i64: t0 = *tb_ptr++; - t1 = tci_read_r64(regs, &tb_ptr); - t2 = tci_read_r64(regs, &tb_ptr); + t1 = tci_read_r(regs, &tb_ptr); + t2 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, ((int64_t)t1 >> (t2 & 63))); break; #if TCG_TARGET_HAS_rot_i64 case INDEX_op_rotl_i64: t0 = *tb_ptr++; - t1 = tci_read_r64(regs, &tb_ptr); - t2 = tci_read_r64(regs, &tb_ptr); + t1 = tci_read_r(regs, &tb_ptr); + t2 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, rol64(t1, t2 & 63)); break; case INDEX_op_rotr_i64: t0 = *tb_ptr++; - t1 = tci_read_r64(regs, &tb_ptr); - t2 = tci_read_r64(regs, &tb_ptr); + t1 = tci_read_r(regs, &tb_ptr); + t2 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, ror64(t1, t2 & 63)); break; #endif #if TCG_TARGET_HAS_deposit_i64 case INDEX_op_deposit_i64: t0 = *tb_ptr++; - t1 = tci_read_r64(regs, &tb_ptr); - t2 = tci_read_r64(regs, &tb_ptr); + t1 = tci_read_r(regs, &tb_ptr); + t2 = tci_read_r(regs, &tb_ptr); tmp16 = *tb_ptr++; tmp8 = *tb_ptr++; tmp64 = (((1ULL << tmp8) - 1) << tmp16); @@ -828,8 +819,8 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, break; #endif case INDEX_op_brcond_i64: - t0 = tci_read_r64(regs, &tb_ptr); - t1 = tci_read_r64(regs, &tb_ptr); + t0 = tci_read_r(regs, &tb_ptr); + t1 = tci_read_r(regs, &tb_ptr); condition = *tb_ptr++; label = tci_read_label(&tb_ptr); if (tci_compare64(t0, t1, condition)) { @@ -899,21 +890,21 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, #if TCG_TARGET_HAS_bswap64_i64 case INDEX_op_bswap64_i64: t0 = *tb_ptr++; - t1 = tci_read_r64(regs, &tb_ptr); + t1 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, bswap64(t1)); break; #endif #if TCG_TARGET_HAS_not_i64 case INDEX_op_not_i64: t0 = *tb_ptr++; - t1 = tci_read_r64(regs, &tb_ptr); + t1 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, ~t1); break; #endif #if TCG_TARGET_HAS_neg_i64 case INDEX_op_neg_i64: t0 = *tb_ptr++; - t1 = tci_read_r64(regs, &tb_ptr); + t1 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, -t1); break; #endif From patchwork Thu Feb 4 01:44:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376171 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp906314ejt; Wed, 3 Feb 2021 18:07:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJyKeUR456qLPRErluoBpEX8t2DC/pUVH39c9eXxgGTkvndLTgpUDIVmc05DfkJqhUNWkpxZ X-Received: by 2002:a25:83d0:: with SMTP id v16mr9730341ybm.40.1612404453972; Wed, 03 Feb 2021 18:07:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612404453; cv=none; d=google.com; s=arc-20160816; b=sS4yp2rSc6TwN4NYZ0x1v4ZC5Rn5ig4a2qALDkoLHNtnpQN+2P7c75GbnB1V6CIvRL hv7gRMstaV8UfRAbQIdptrIaqk8iJW/WFeh4JJH0+3Lwm4TG8yJHUPuMGVO7z8L/0R5D xZobFx9b/2F/LjpMjFZpQ/I7+YyimXffJWpn1JZzL+cJk/G0VkRYkL/R/etCZ3V5V/kJ 7YBu5S/tcCha+Z/PXztPzt24vnqNLX1rXFgo7X9SpFUvUqhQ10v0SM/x2MS1NnYRvhaU Xo63eSiudZxqIFvN0jNpQC4O7d9+qDLDXcxeCqtzvHa+PRbV2LtKstxKprVMTtjrTNJt zjAA== 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=DTK4SJ5LYtJuHvuHu8AwQw2u8TQxf0ZzT7dsGBYnc0Y=; b=KAyY0c7ceXaMwt1DLifFVaFwJ0+zaSI/xB7ArfJ31C4JbyRHyUfWaqxR1WVfaU6d21 r3aMDZIRxqO90WT4sSilGON1VWkx9Q73DTFcfYW2Uuv1wuWuxdF/qCFAP6m4fJYGzXqX ho6M4Y/XupJ0C66n1goLa8v07E0jfLR7zRWwSwf4R+2ZTjDKCF3sE5LF9GAVN8hzZbXl OOBtF/u0RmzxG9eJOtunb22TVJJ8CORH4uaBsrySyg9T9yL0mjVllBL2KgLBTummKhke LWXEs0rR9EN6BpBv9EwrxE9gTSY8LMn684qyc+mHllAj0/nW28N0bIhEi02bp8TN0P0m JUBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kePOshLb; 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 k5si4112465ybp.301.2021.02.03.18.07.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:07:33 -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=kePOshLb; 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]:37432 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7U3R-0006X6-1B for patch@linaro.org; Wed, 03 Feb 2021 21:07:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44816) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Tj7-0005Ks-Ii for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:34 -0500 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]:51734) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Tiu-0003wk-ST for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:31 -0500 Received: by mail-pj1-x1036.google.com with SMTP id fa16so337021pjb.1 for ; Wed, 03 Feb 2021 17:46:20 -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=DTK4SJ5LYtJuHvuHu8AwQw2u8TQxf0ZzT7dsGBYnc0Y=; b=kePOshLbYGH7DlnSrh6q2+BxLTkAzaVnUfnvBxbMu11rWZNnm2hVdev2GyPL4CiJV/ +Np8864tiZXPvGE3hTxK1qG8snvXhZltjWZ+Bzqnl2lVI7nCY0c3Xt6PqQsu44f8kGYB YEDg0mxtYrbiycHRm4lP/jE9IxzySecnxxwAkiSZAheF/IEcGDIj1idzMhh3hoilpIjm dfI+FKdSUacZcrRCwY5vgkQbJ7uFitV/zWlodcFPBYZ03tkHay6UYWppOEJJoqxstEuJ ClYCpFhY9ElVfKCQk1V+YEtZxBZeGjtrff+7oaldWVmatNXOoFrX+cnV4JW/ZA/XI624 EnFg== 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=DTK4SJ5LYtJuHvuHu8AwQw2u8TQxf0ZzT7dsGBYnc0Y=; b=EWuepmu8Dvv+Sg358OiQZQN4Ma5jpR0+KHlxMhwm70uANDJWjL6+TWll5RtveH+Ulu /3pg9GVBu8dba9dZOT/w2kjc/GTCwLCZC3DTCV0D00qvI3wADAt2PzvW3vOyclFgn7+W sv3d2q5e7XZANubWlad7tC9BFIkZPMfyBfxWs0ROgh9aVZHw7pKjFeOVhs39b9KkpjWq 5o4Tpo13rKAdDz9cG4ey+amvWUtUiayfRuovnfjt0tLm7CHVMvlETrut9ItIKmKWVf0u fmGbp+2ggS0GN3Pac3lukDZHyCOt3LBpNnRR1HP8RNGZMMfzbsDO2mL5nZn+rMhwrdkM 6mlA== X-Gm-Message-State: AOAM531rmWuPun1JFBTdbb2bq2SR8qsVvwoQrU64umaSPs6SfnrHrf48 87RxSmMthHnJoIneZPaJlszpO/uEj2hbNLxI X-Received: by 2002:a17:90a:4096:: with SMTP id l22mr4322871pjg.34.1612403179342; Wed, 03 Feb 2021 17:46:19 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.46.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:46:18 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 37/93] tcg/tci: Merge basic arithmetic operations Date: Wed, 3 Feb 2021 15:44:13 -1000 Message-Id: <20210204014509.882821-38-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1036; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1036.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This includes add, sub, mul, and, or, xor. Signed-off-by: Richard Henderson --- tcg/tci.c | 83 +++++++++++++++++-------------------------------------- 1 file changed, 25 insertions(+), 58 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index 0246e663a3..894e87e1b0 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -468,26 +468,47 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, *(uint32_t *)(t1 + t2) = t0; break; - /* Arithmetic operations (32 bit). */ + /* Arithmetic operations (mixed 32/64 bit). */ - case INDEX_op_add_i32: + CASE_32_64(add) t0 = *tb_ptr++; t1 = tci_read_r(regs, &tb_ptr); t2 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, t1 + t2); break; - case INDEX_op_sub_i32: + CASE_32_64(sub) t0 = *tb_ptr++; t1 = tci_read_r(regs, &tb_ptr); t2 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, t1 - t2); break; - case INDEX_op_mul_i32: + CASE_32_64(mul) t0 = *tb_ptr++; t1 = tci_read_r(regs, &tb_ptr); t2 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, t1 * t2); break; + CASE_32_64(and) + t0 = *tb_ptr++; + t1 = tci_read_r(regs, &tb_ptr); + t2 = tci_read_r(regs, &tb_ptr); + tci_write_reg(regs, t0, t1 & t2); + break; + CASE_32_64(or) + t0 = *tb_ptr++; + t1 = tci_read_r(regs, &tb_ptr); + t2 = tci_read_r(regs, &tb_ptr); + tci_write_reg(regs, t0, t1 | t2); + break; + CASE_32_64(xor) + t0 = *tb_ptr++; + t1 = tci_read_r(regs, &tb_ptr); + t2 = tci_read_r(regs, &tb_ptr); + tci_write_reg(regs, t0, t1 ^ t2); + break; + + /* Arithmetic operations (32 bit). */ + case INDEX_op_div_i32: t0 = *tb_ptr++; t1 = tci_read_r(regs, &tb_ptr); @@ -512,24 +533,6 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t2 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, (uint32_t)t1 % (uint32_t)t2); break; - case INDEX_op_and_i32: - t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_r(regs, &tb_ptr); - tci_write_reg(regs, t0, t1 & t2); - break; - case INDEX_op_or_i32: - t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_r(regs, &tb_ptr); - tci_write_reg(regs, t0, t1 | t2); - break; - case INDEX_op_xor_i32: - t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_r(regs, &tb_ptr); - tci_write_reg(regs, t0, t1 ^ t2); - break; /* Shift/rotate operations (32 bit). */ @@ -712,24 +715,6 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, /* Arithmetic operations (64 bit). */ - case INDEX_op_add_i64: - t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_r(regs, &tb_ptr); - tci_write_reg(regs, t0, t1 + t2); - break; - case INDEX_op_sub_i64: - t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_r(regs, &tb_ptr); - tci_write_reg(regs, t0, t1 - t2); - break; - case INDEX_op_mul_i64: - t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_r(regs, &tb_ptr); - tci_write_reg(regs, t0, t1 * t2); - break; case INDEX_op_div_i64: t0 = *tb_ptr++; t1 = tci_read_r(regs, &tb_ptr); @@ -754,24 +739,6 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t2 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, (uint64_t)t1 % (uint64_t)t2); break; - case INDEX_op_and_i64: - t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_r(regs, &tb_ptr); - tci_write_reg(regs, t0, t1 & t2); - break; - case INDEX_op_or_i64: - t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_r(regs, &tb_ptr); - tci_write_reg(regs, t0, t1 | t2); - break; - case INDEX_op_xor_i64: - t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_r(regs, &tb_ptr); - tci_write_reg(regs, t0, t1 ^ t2); - break; /* Shift/rotate operations (64 bit). */ From patchwork Thu Feb 4 01:44:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376178 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp909593ejt; Wed, 3 Feb 2021 18:13:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJzCPG0i4pM+m4eO0qKOyPzAFiR/mHGoS/xK5PT5opWrx/B8DN7sV96Sn5rkRbNOuEKHoFlH X-Received: by 2002:a05:6902:100a:: with SMTP id w10mr8488073ybt.474.1612404836984; Wed, 03 Feb 2021 18:13:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612404836; cv=none; d=google.com; s=arc-20160816; b=Y+6/vg4Z2kFoktj3lcfRr+wwhgm6emDCvuUNIZSu5YLfseLybdchAOev8av6bCuQ3g WkN0imNO4naoBhNelzEq3Xtk7gm4QC4qmLJegKB8HsAIs4Mphwpvp4pmEXftXz7ODTIs t0sFNcinAf2y/sXy0qPyth+qiNVfIa6NCDl9dezF2Sm0pMHdTh5K6XuqWCTsXtkVFiq7 afFPGYpPrCcfKJ0Kg+bMMHnVWbI8472fLRy1Ip25iYsQcbCOzCvC2MkmjroceDE17pPi Pac4XysBgsv2/pNaUxmDzRVwMtEgcJ/rKLlKU2hvPelkLw3KtOXWawiJdV7e4PNYeS8K mFpQ== 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=b0OZ8HZNEJw4TVjXNMfY9ukiBorqmrftQz6h6YJ1/P4=; b=jDJd9Nl25vtHZn1JjbR0Kg7/0OwmMWLOYIgBXMsRZinT6vtW7VC6VsslL7HYQF2d29 ib0h4LhUbsl+CAqICHOJ2xaJUgvEGoXnxZZhk4zdUu85lLPOA++T9ieS6JsZ/B4trn7M 3fcRiQruC3lmTPOFHy9qnBJRy2rGUwaiHk312uMILhINlP1TanVwN9T2SDvJAJO+u7U7 oIjYnXnsb8r+VlxBKWapRpQ8/ri682BFyky77JRXBl52UntHbpTC9n6roBQLLozqr0Sx QQJ5SyxWXfkxirZPTC2u3KuRazsfHZeMw4m9csTXHdlAFQyqScL7Itrl87aKLiLAZu2N odCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JJNu6sHI; 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 c131si4097185yba.383.2021.02.03.18.13.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:13:56 -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=JJNu6sHI; 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]:54006 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7U9c-0005Gb-Bj for patch@linaro.org; Wed, 03 Feb 2021 21:13:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44886) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7TjH-0005Ph-1K for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:43 -0500 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]:43291) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Tiy-0003wu-7d for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:36 -0500 Received: by mail-pg1-x52e.google.com with SMTP id n10so1016116pgl.10 for ; Wed, 03 Feb 2021 17:46:21 -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=b0OZ8HZNEJw4TVjXNMfY9ukiBorqmrftQz6h6YJ1/P4=; b=JJNu6sHIoxvJg2SQXw3I2nYZ/AS0Nqi/b727N1o+HDijO2xALKqZ5ocBx3E0bMJdHh xq3eYZcKr3Cz6ZKFudiLPWEhS+3tkn6g28RNUSuTiuJCgMxn7lvpiGuIIBQeIqM+VP/n FhWoUi9/sEyhGirknOLFWPBZE7GmWJ8BjiXSApQ+gcuQVNMRKKcy2sDSQHk04Tn3Phnx VKiFPsDM3sv+B27HLjdI98FoHVit1dctxGXwwjcj+aNGIxcld6/613cqKSDUTvGP9T9F Dv4XlhXDo0qSfRAeV7VpZtimytg37V3pNYeQrPZma54Ukcl605bbxiOK4zJ6GaRH5zjS 39Kw== 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=b0OZ8HZNEJw4TVjXNMfY9ukiBorqmrftQz6h6YJ1/P4=; b=NoZeSeTeUAe9ntedKeoaow+W0mTFq5r7Ra1nrgHuAzCicEddGAoJhwZIy2XPMPrtlY 5V+00lT7PgbJvI3vyukEfj7eOeVnGTMBYEJF7XFu45k3g1mg389a4SpUyG2mKikUqJVm IZrfnuxsRknrmIxun/4lGg55G7AxNAK5054GMa7YE3toJ6+jILBn7skKRCcxpeO38irq F97y6VxB3aSBLbSFPNAEs94JR115OgfQLGJdiiRsRSmL/lIrRB+yM6kWZT3fqmig1tCi n9Oej3iLs+yQ5cRUAY99PdkUMcllznbdVcDCnL3se3g2ApGAIMoUnR4vVeGxoCaWuxa4 DZ3w== X-Gm-Message-State: AOAM530iyz41hVvPzw81TcJdxrkA0OHR5r71r4PRdOOcb13j+NiG+XhA VSstcheAXLl0G36iVWX3IP9Wb3VUonEWPeuX X-Received: by 2002:a65:648e:: with SMTP id e14mr6492744pgv.453.1612403180967; Wed, 03 Feb 2021 17:46:20 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.46.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:46:20 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 38/93] tcg/tci: Merge extension operations Date: Wed, 3 Feb 2021 15:44:14 -1000 Message-Id: <20210204014509.882821-39-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52e; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52e.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=unavailable 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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This includes ext8s, ext8u, ext16s, ext16u. Signed-off-by: Richard Henderson --- tcg/tci.c | 44 ++++++++------------------------------------ 1 file changed, 8 insertions(+), 36 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index 894e87e1b0..cdfd9b7af8 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -624,29 +624,29 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, tci_write_reg64(regs, t1, t0, (uint32_t)t2 * tmp64); break; #endif /* TCG_TARGET_REG_BITS == 32 */ -#if TCG_TARGET_HAS_ext8s_i32 - case INDEX_op_ext8s_i32: +#if TCG_TARGET_HAS_ext8s_i32 || TCG_TARGET_HAS_ext8s_i64 + CASE_32_64(ext8s) t0 = *tb_ptr++; t1 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, (int8_t)t1); break; #endif -#if TCG_TARGET_HAS_ext16s_i32 - case INDEX_op_ext16s_i32: +#if TCG_TARGET_HAS_ext16s_i32 || TCG_TARGET_HAS_ext16s_i64 + CASE_32_64(ext16s) t0 = *tb_ptr++; t1 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, (int16_t)t1); break; #endif -#if TCG_TARGET_HAS_ext8u_i32 - case INDEX_op_ext8u_i32: +#if TCG_TARGET_HAS_ext8u_i32 || TCG_TARGET_HAS_ext8u_i64 + CASE_32_64(ext8u) t0 = *tb_ptr++; t1 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, (uint8_t)t1); break; #endif -#if TCG_TARGET_HAS_ext16u_i32 - case INDEX_op_ext16u_i32: +#if TCG_TARGET_HAS_ext16u_i32 || TCG_TARGET_HAS_ext16u_i64 + CASE_32_64(ext16u) t0 = *tb_ptr++; t1 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, (uint16_t)t1); @@ -796,34 +796,6 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, continue; } break; -#if TCG_TARGET_HAS_ext8u_i64 - case INDEX_op_ext8u_i64: - t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - tci_write_reg(regs, t0, (uint8_t)t1); - break; -#endif -#if TCG_TARGET_HAS_ext8s_i64 - case INDEX_op_ext8s_i64: - t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - tci_write_reg(regs, t0, (int8_t)t1); - break; -#endif -#if TCG_TARGET_HAS_ext16s_i64 - case INDEX_op_ext16s_i64: - t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - tci_write_reg(regs, t0, (int16_t)t1); - break; -#endif -#if TCG_TARGET_HAS_ext16u_i64 - case INDEX_op_ext16u_i64: - t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - tci_write_reg(regs, t0, (uint16_t)t1); - break; -#endif #if TCG_TARGET_HAS_ext32s_i64 case INDEX_op_ext32s_i64: #endif From patchwork Thu Feb 4 01:44:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376176 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp909244ejt; Wed, 3 Feb 2021 18:13:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJz0OiJoKvTyi9WBFtW/DoeDGpAMY7wvWUG3Nt0ACpM1F5BmHf+/Z+6v8NV1F6AT1/Izmw6g X-Received: by 2002:a5b:34e:: with SMTP id q14mr8868490ybp.291.1612404796236; Wed, 03 Feb 2021 18:13:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612404796; cv=none; d=google.com; s=arc-20160816; b=UeEG3D9bm/uHzeYtyjhuMRqXsP7i/9qkGUrV4OuTF+KRSc38N3ho3ig4UMji7hgHJX p+lZptPKsugroBS8mdmnFzkAn8DUMZ+wF1Gk1guKkSi2/jyWkplAgkkRHlQ9WHn2xJS9 9UGcaAhK8ytHSe/iV3VuWsnSEWlhhWcqHU3kUwdU3rqM9qxwlu8PK/4VNTeZIih9JLKF dgbC8k9wb037E5ZRsTWmrY5gag+2NQZFIbdOdcpu9/n1K8My3nQCGOWQNqvGtj2fQe+U Op2Hoy3qWTz75iJAztMJomif4J2CYslxzlOFRRvz9jfppFZquRfet2SARuP+qYS5kXiO NOxA== 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=MfW3tSMzNg4i1sVQnx6Ri1BGJD02W5/7jILfn3srnPM=; b=pmn04FCuHX7VN7yAVxOEs/nE8+XkUG1VNn6ywqV3NYMzozFh+FZxqKBbid+GpROMWF sG4cHQriwGXHKqZ4o2WIBNGYLJYkJEc3DNWzCO7kO05Np9oa8xsCEo5jmGEe7NVS/xw4 +5zgqkWMuL4JdORz3kni7m4ltlf9MHfu2PxJbQH25y6guG6nTbihtmKEp3MI2a7pS/ZC qdP7rqIM41DEWbqL/uCrxjJ/lOkSqxCQnNt4hl0PkVs2MU3ZsvqSPPd9CEKQjhRTO7K/ aL7BBx+L37uQR2jm3CrKz3yAyCzO1SiDp/uNsroeCVDgyMHkhCf2zi6lZpXk/e/i036Y rdKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=B1I0nlhu; 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 v18si2726617ybq.253.2021.02.03.18.13.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:13:16 -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=B1I0nlhu; 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]:50700 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7U8x-0003sI-I7 for patch@linaro.org; Wed, 03 Feb 2021 21:13:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44866) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7TjE-0005Nb-Bg for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:40 -0500 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]:34566) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Tiz-0003x8-60 for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:34 -0500 Received: by mail-pl1-x631.google.com with SMTP id u15so904465plf.1 for ; Wed, 03 Feb 2021 17:46: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=MfW3tSMzNg4i1sVQnx6Ri1BGJD02W5/7jILfn3srnPM=; b=B1I0nlhuH5exjTJ7ZCYHW25afTk+3ZZegud7dSIjUSBIWWWr+O/N0GN6yGzo02hTEN /brIxOsF1/IxtZ9fPS0Smk/8yACBXWKeIDzWyKon7dKugPy6CpkN6VxPEUQOu6iV7+k0 eaopuszqhdBmRY8MNpYyY3innNkRjQY34w5x8IBcHVmCCUCVFu27IImc7KbS+aiLV+Oj 16XAv0lMqrgkXmjvkMOz2U1k5nZZjf+2t8t6hEdNV4fDJo2dA8kGXZhOfyahYYyJm9VH 2gO8e2gtrb5wscZmA0e8bharEZpnhIdkuS1s/wjq6RsFZxrjS+6DnatefCXaKXJzfKVa WChQ== 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=MfW3tSMzNg4i1sVQnx6Ri1BGJD02W5/7jILfn3srnPM=; b=hClOV/Z9rONKMom5neOtRKE3C+CvsRiUFrWtoU15BzaXo2EMVzKE1RvOEMZg4sZVNf BpfGg3vJaZ6bSV0Td1cCSuwC1mRuCDC5KsE+mSyAje3W8H9I8+2252F7RP0LzB5dqggW whHeGw+QhCtAeEcPhGai9GGhKBD4js/dnNahYBXen/UPGDd2yihMxwpff4PykTutUjHL Ix6oH8Dm4bZcvmq04CHTG/5NUSnDOhFlvf9ReX/xoOfnUVHAQ1vw4+hWVpbZoZogDYUJ vmb8ULxmJAvmUTlVVmnwAZnS3RfGJjjhsro6SZtL9TDia7rPu8Fc4+dJ8fgEXDpYIlfi NQ9w== X-Gm-Message-State: AOAM530jPv8hhX6S3k7VFOvQbt3CPF9YM6sWsYE5EWNWOl89iw+h4zvX F/C2O0co0xbNHJ6O+b4AyqFUti3jufz/drnW X-Received: by 2002:a17:90b:1996:: with SMTP id mv22mr5871769pjb.121.1612403184024; Wed, 03 Feb 2021 17:46:24 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.46.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:46:23 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 39/93] tcg/tci: Remove ifdefs for TCG_TARGET_HAS_ext32[us]_i64 Date: Wed, 3 Feb 2021 15:44:15 -1000 Message-Id: <20210204014509.882821-40-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" These operations are always available under different names: INDEX_op_ext_i32_i64 and INDEX_op_extu_i32_i64, so we remove no code with the ifdef. Signed-off-by: Richard Henderson --- tcg/tci.c | 4 ---- 1 file changed, 4 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index cdfd9b7af8..1819652c5a 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -796,17 +796,13 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, continue; } break; -#if TCG_TARGET_HAS_ext32s_i64 case INDEX_op_ext32s_i64: -#endif case INDEX_op_ext_i32_i64: t0 = *tb_ptr++; t1 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, (int32_t)t1); break; -#if TCG_TARGET_HAS_ext32u_i64 case INDEX_op_ext32u_i64: -#endif case INDEX_op_extu_i32_i64: t0 = *tb_ptr++; t1 = tci_read_r(regs, &tb_ptr); From patchwork Thu Feb 4 01:44:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376181 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp911520ejt; Wed, 3 Feb 2021 18:17:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJwIGeE0fDybHrPeVs7ns3NUufjewsCBA07f4t+SI6tBTSEJ4tfkKSsandxbA74H/jY4tuzB X-Received: by 2002:a25:dad3:: with SMTP id n202mr8887398ybf.8.1612405058965; Wed, 03 Feb 2021 18:17:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612405058; cv=none; d=google.com; s=arc-20160816; b=yObP+0rGBliU1TUTmG83cc4kQg6hA6Cju84y9Juai//We2VgxwugfSMCPL3/iVSxAg KGACElGsadOnUAzwZuOqbCcerDwRGUEawr86AE0gpo9511KB5C3UjTyp2eLhS85dHD/0 qVnq35f74r6G1/jSQA6y+5pL22X1a8seVGNNPCOoRdRaiNmNLvipvc0lvs47QM7imvQu OhpA6bebEQpN6sqHPvFNDTnk6DzfE1gd7WivjtzwKBJzr5ixJrZeXVorQ/8lbaT21ExZ C7qdlV1yPX+09kDfvH7NCAwY0LYxAfALonfF6EA/YTsv3Tf47fNThtHXHW8tgUnZm89x DH6g== 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=KcXtBKnullZQYp/0sBEeRm33/576gXQq0HPnlvclX78=; b=ng4ELCj5pn5m/1mxb+TIrRWzY1ZDPZQ9xcgHEUcojcYnlxn41nD4EYCyh4deeaPRY6 bEls1tifgjhqM+7fRDkFTCt5CFbJAr/yGNPdccKPMeLXKFQVJtAY2ULy80Syo1Y/H+lL sKm2DrfDUChC5mp8pt208lyWu1pkN4MIAIzIJFlK3OJhv6g7k9O2tyO+n+JKkXb39TpI novk7XMjDEKIz69Gg2jHs9TBM5Cogg5xenAuKk6Z+Hclyps4y+lqmw28VZAZSwfCe63+ T1hPpBd4nwoqYrIOrNH4KD0tU7jsC5zWKm9B06EJk2QXOaG6QZ7JDTB0V0vknX5QO/1p D7bQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Z6iAJ/16"; 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 h66si3701211ybh.54.2021.02.03.18.17.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:17:38 -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="Z6iAJ/16"; 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]:34220 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7UDC-0000aA-9r for patch@linaro.org; Wed, 03 Feb 2021 21:17:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44888) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7TjH-0005Pi-2v for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:44 -0500 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]:46780) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Tj1-0003xI-J1 for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:40 -0500 Received: by mail-pf1-x430.google.com with SMTP id f63so1047502pfa.13 for ; Wed, 03 Feb 2021 17:46:26 -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=KcXtBKnullZQYp/0sBEeRm33/576gXQq0HPnlvclX78=; b=Z6iAJ/16muHmobNDvO6b/Z6Mv/iocvZZlRJMSCA1sgU5FO4RvtR2hegIDCYEewbFu8 aWnqNeX+WJFbLMCs4794znfXOtFBE0LgmOLv+YMpsblT3zFrC5Gw7sYVyx6DGSFuCljf I/7JJG8inEH2SeEbHwKHRR/4pGdquNgdV+Xa0Ggn64akzRnt7gMyFgH7hBXrDaM6sQgm +qfwmi7UqqmKjH/ofV91+FLiMAYMvSMH62cr9eJSCQwkC1ZUwEyQMgRlX0w15TI9NkkS mgSr2Zg5/6XuDsjQBQgtbTv08ElqIF2jlsZZsBAsHSKRxFf/doWVZCH2WI10PJOz8eHt pCbQ== 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=KcXtBKnullZQYp/0sBEeRm33/576gXQq0HPnlvclX78=; b=jb5VjqulXcxrGjHw2s/4P/R1Hr/St+o/7NP/ffW5eqT/2AOuDjpFBYB/N4hjEKThtb zbV5PXe030cIahrj8RtqXjvmpEAdKdC0clrYhmOfWSGjsLqw1R9u3VWvawJjS+5bBHVH 84A9iYRQhNdx/zXwMn73fNxF+BQxf88ax8BxRjUF/IMb53xs/HO7OSLVhVVRDBG1jNUw 69xs0/sTj4TBiD3KcW7MolFGclHGkZ/dF4ZWJ4zq5S3P8rGmrE2B3P+La/6xScjS0oUV 6j/TP1LABuyUnZjLbZjg3FF+i0djvyCQ/MmM28hCUAGsUae+TalGD24xLBTUrESn3wQj kRAg== X-Gm-Message-State: AOAM532NBp5rA6Sm05pk/M4Ondg5gTH/kPAWZk6GQA/uirvOqNZtbpUQ 8vIhRJ/u4qIjEXXu+naZHAdKBRnNsskIP32v X-Received: by 2002:a62:115:0:b029:1b4:c593:acd4 with SMTP id 21-20020a6201150000b02901b4c593acd4mr5771094pfb.2.1612403185497; Wed, 03 Feb 2021 17:46:25 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.46.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:46:24 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 40/93] tcg/tci: Merge bswap operations Date: Wed, 3 Feb 2021 15:44:16 -1000 Message-Id: <20210204014509.882821-41-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::430; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x430.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=unavailable 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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This includes bswap16 and bswap32. Signed-off-by: Richard Henderson --- tcg/tci.c | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index 1819652c5a..c979215332 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -652,15 +652,15 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, tci_write_reg(regs, t0, (uint16_t)t1); break; #endif -#if TCG_TARGET_HAS_bswap16_i32 - case INDEX_op_bswap16_i32: +#if TCG_TARGET_HAS_bswap16_i32 || TCG_TARGET_HAS_bswap16_i64 + CASE_32_64(bswap16) t0 = *tb_ptr++; t1 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, bswap16(t1)); break; #endif -#if TCG_TARGET_HAS_bswap32_i32 - case INDEX_op_bswap32_i32: +#if TCG_TARGET_HAS_bswap32_i32 || TCG_TARGET_HAS_bswap32_i64 + CASE_32_64(bswap32) t0 = *tb_ptr++; t1 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, bswap32(t1)); @@ -808,20 +808,6 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t1 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, (uint32_t)t1); break; -#if TCG_TARGET_HAS_bswap16_i64 - case INDEX_op_bswap16_i64: - t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - tci_write_reg(regs, t0, bswap16(t1)); - break; -#endif -#if TCG_TARGET_HAS_bswap32_i64 - case INDEX_op_bswap32_i64: - t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - tci_write_reg(regs, t0, bswap32(t1)); - break; -#endif #if TCG_TARGET_HAS_bswap64_i64 case INDEX_op_bswap64_i64: t0 = *tb_ptr++; From patchwork Thu Feb 4 01:44:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376180 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp911260ejt; Wed, 3 Feb 2021 18:17:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJwqD93UXNqT8tyw49V1HkfCgQqs3sqIqljkoJeSUXq04gMiFC7udeIq6CMuKaBJAkj2rc3J X-Received: by 2002:a25:2502:: with SMTP id l2mr9169458ybl.229.1612405029807; Wed, 03 Feb 2021 18:17:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612405029; cv=none; d=google.com; s=arc-20160816; b=sOjxhKCr3ZE/A6qjuiUWVdbaE/qnBoW1hREFRHCUaaqxFoFC3iycaAkfmWhjTt4i/W qflXnYnyIoljcunZykwEoNwLVLI1c9qVeqZ3G3OXJrxu33zi5q/QQXZ74sgHLSmdE+9v zcMWm8Mlee9LPyxKF46rNUQSGw0V8iYRz/1dzJowBrBVUaMmbQhXEHRTb2EPkR1DQluF Bo5O+Kt4y7UD5/LQz04Wu1vYkoJtLR2hs3v9r5lW2aADwZ3stdpk0h0T9tQVDutANoW4 7W4pN6kOJdcD0efFhWRaDnhg8BMBzXiGop/QpzS5LCiLMoaZVglTGs7UEuQhHwXpFHly asmQ== 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=v8YBF7O/DOHSCTIsDFGzgG9s+eMvXezLyegZpBv+3f8=; b=zAs83AD40WnHe8E0AgcvNowmht77mSLqhiHP+1u7SYBjvoc/8D2FtiYv5O+wxRDJ66 ddNgrOuWsRj9CiboyESiq5tiPEf+ufS7sHmYgwfwhfqOk74Y0fGXuGsLwyc7qhSGkQ1p MgQOxwhfN/FubiXCakxA1xyYlFiH/vO+P9icLnlCswY5IrEzBIZGVa6oZiA5y/sO7cYO XGJrUeRDEwHp+5U4MPEbltYT/6ASDglbvJ05eUGpFis7LajFEHgW68yZ8a4e31egugN7 zdy8BSDqDHYJ6Zje3XhdwXbQfwLqmOcZi2NkfOOdvWmVgx7kOTqMEtZKR1GVZz1TLP+E ae0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qQZFErvE; 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 f91si4851977ybi.414.2021.02.03.18.17.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:17:09 -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=qQZFErvE; 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]:33796 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7UCj-0000NM-53 for patch@linaro.org; Wed, 03 Feb 2021 21:17:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44884) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7TjH-0005Pg-2r for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:44 -0500 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]:33838) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Tj3-0003xR-7i for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:39 -0500 Received: by mail-pf1-x42e.google.com with SMTP id m6so1088396pfk.1 for ; Wed, 03 Feb 2021 17:46:27 -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=v8YBF7O/DOHSCTIsDFGzgG9s+eMvXezLyegZpBv+3f8=; b=qQZFErvEvSf3WKH4o5e+pLASjbWG6DDNiVUGxJ6/LOHzlX5RVfIjbODitvuERaU1+0 GMETioNuVvTsb5nJoNepZx9N+AJsueL0LGH2f1kZnqkGfuUEOcLf1kysPVmAT/5P+GkD knK1H2fXssiikOHSbMfUPxkkKb4pZlJenC2iL9MZWb3uFxObDWqG7GfRvIW3SSd8oi5G 1q+2PkXN0F656IfgV36vUuMaH/4KQiFYxH4KGSQ0HDPYv89HUNKQD+uqEgQpXs24xwlv ypdZqhnUap9ya+m5Au8as+mKWUmED9jqOcyvU/enIdBG2PDJbBArphYOglDw0WOHIIO/ 0SZA== 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=v8YBF7O/DOHSCTIsDFGzgG9s+eMvXezLyegZpBv+3f8=; b=jPNXSgLPTHyE5I+0HnSWwhfIFw1omN37sU0ezkTRjHvMipANxTH81Sq599QOcIStvx IpxuMY8glyVEtuGEwG5s7ByDH+UMxA9Kp1IkeInR6Vzknu5zPRQ3XoopnDdZDqb1yRPN l/xfzgkew+a8vURFhJfO9HWdZ/1574svYqUb7U4SQXiw7MTSTMGr4GnTX3usfjm1M0Df dAvKiNga6lvSTpcq3ew5eSCth7VsQid8Doh8B+7KiUfcz+tObHdeNK6O+FYRxVek7XgT Q2pX9Uf40YRiAeAZkEnywXgPAlwglHyUuQ6uRadnL5B4Xk+EKkWK5DLT3/jeIw3pwny3 BclQ== X-Gm-Message-State: AOAM532EwvZ5bNE6ykerJhwAooM3nbQDG0lLs9yHWGooUM53z3CSSzKd JYAD3a7gksK3BKzotOFdkNNWQED6LJR7Ekym X-Received: by 2002:aa7:848c:0:b029:1d0:68f1:d6f1 with SMTP id u12-20020aa7848c0000b02901d068f1d6f1mr5769502pfn.21.1612403187046; Wed, 03 Feb 2021 17:46:27 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.46.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:46:26 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 41/93] tcg/tci: Merge mov, not and neg operations Date: Wed, 3 Feb 2021 15:44:17 -1000 Message-Id: <20210204014509.882821-42-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42e.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- tcg/tci.c | 29 +++++------------------------ 1 file changed, 5 insertions(+), 24 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index c979215332..225cb698e8 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -404,7 +404,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, tci_write_reg(regs, t0, tci_compare64(t1, t2, condition)); break; #endif - case INDEX_op_mov_i32: + CASE_32_64(mov) t0 = *tb_ptr++; t1 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, t1); @@ -666,26 +666,21 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, tci_write_reg(regs, t0, bswap32(t1)); break; #endif -#if TCG_TARGET_HAS_not_i32 - case INDEX_op_not_i32: +#if TCG_TARGET_HAS_not_i32 || TCG_TARGET_HAS_not_i64 + CASE_32_64(not) t0 = *tb_ptr++; t1 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, ~t1); break; #endif -#if TCG_TARGET_HAS_neg_i32 - case INDEX_op_neg_i32: +#if TCG_TARGET_HAS_neg_i32 || TCG_TARGET_HAS_neg_i64 + CASE_32_64(neg) t0 = *tb_ptr++; t1 = tci_read_r(regs, &tb_ptr); tci_write_reg(regs, t0, -t1); break; #endif #if TCG_TARGET_REG_BITS == 64 - case INDEX_op_mov_i64: - t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - tci_write_reg(regs, t0, t1); - break; case INDEX_op_tci_movi_i64: t0 = *tb_ptr++; t1 = tci_read_i64(&tb_ptr); @@ -815,20 +810,6 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, tci_write_reg(regs, t0, bswap64(t1)); break; #endif -#if TCG_TARGET_HAS_not_i64 - case INDEX_op_not_i64: - t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - tci_write_reg(regs, t0, ~t1); - break; -#endif -#if TCG_TARGET_HAS_neg_i64 - case INDEX_op_neg_i64: - t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - tci_write_reg(regs, t0, -t1); - break; -#endif #endif /* TCG_TARGET_REG_BITS == 64 */ /* QEMU specific operations. */ From patchwork Thu Feb 4 01:44:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376185 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp913548ejt; Wed, 3 Feb 2021 18:21:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJzesDSiKkZBI0uqPAWL2PPWCDkKhqGrbPomh1a8CUURn16kW4FSnVs8hvxXjKGbYm8tZHBE X-Received: by 2002:a25:e645:: with SMTP id d66mr8076384ybh.509.1612405287941; Wed, 03 Feb 2021 18:21:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612405287; cv=none; d=google.com; s=arc-20160816; b=W2hl98EKaAjWfFiNJafoY8gGwguvP78sdZhWLnXZZ2iDK2CO7HwGkitmbxRn98JNj0 DyGPtrBLL+pyruBfi119kKshGFB0aHJveawypoOwp9zZGvKZ8VTZP0XTaKyTqGH/VxJ6 dPEOLGId/IbDVoICVOcRMx5Ba01P389PqjI557T1jTaR1Vgzg0bxPEYxqAXBLdlGGAyI edQ4EkeR9+MNWp4LhhnwB655qUsLqkjQpTuSv8pmYLTDNuNn3pd8ezvvhqmv90NC0aDR O3DCOm2LJtD5qYOi9BZN3QoNDIwcU0GYl5TSeKiDGEDEyq/bC2nY9kulrLk4xOnss855 PW9g== 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=rgDo7IsNPQk1k4dENPTgVxVYE0qud9+qjI7vIiyJakQ=; b=btlrYM3yr980hcXd+QMTdRPjYdL1m648LAXrIgoGabQN2MPo71uq32vX6nk1cIOIpu U1lkOVPXTeXT1nz5hSeSp/isYQ/jBxTdOKCH3valjscXxPy6Ruz76nzLTQ8eW9paB5Kb 7GnWaSfuTd8lLMJV4EP6fcDleGOeVmf6JRzlY/bLvCTS9MXTqZCfCTvSthAF3vAgKETf aCoRX/mNokonB5BkRh1bIb2KofQEbQTxmJTx1C5t1Ax+Q+XIcsF2wo38Bn9J8MSC/Y2q I8GxQS95FeejY2uwRmety4HIMrqE9AUToseRtLRMt1835y4Omrp21cztrvY/phKTkYZE GLQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OLvWh2M5; 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 d66si4744896ybi.187.2021.02.03.18.21.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:21:27 -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=OLvWh2M5; 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]:42718 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7UGt-0004H7-6x for patch@linaro.org; Wed, 03 Feb 2021 21:21:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44934) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7TjJ-0005Qc-BQ for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:45 -0500 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]:34559) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Tj5-0003yQ-DD for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:44 -0500 Received: by mail-pl1-x629.google.com with SMTP id u15so904558plf.1 for ; Wed, 03 Feb 2021 17:46:29 -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=rgDo7IsNPQk1k4dENPTgVxVYE0qud9+qjI7vIiyJakQ=; b=OLvWh2M51FN1fTJEHnUBq7c+kG30NmudEX8JHsvUnnr++9Yui650lD7t3RMJPyvGfz F0bN9TTE7mJfsBrF4b9Zb6MnK7XACr8wAajVY/zZL+l/97U4T061AcoL3GPW/lR3O6iE O+cDWOpAMbRaCR7vn1NaDfhCpaVX0+5KmRSdo4czyueR76kVcAGLAHFA/C6vrNVt4Up0 sostElpQBQOzlvlhq5XicT4u7+kBXk3Sjnx7XWF72ss49aAM0a1LIvhaPB5J1U+1bwR/ TURNz7LiLbsq69iBgJut7PoCbbTg2OgP69JFXDCjT9Qn+Iw9BY2tjiW9ntxuHW4YXbvS 2Itw== 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=rgDo7IsNPQk1k4dENPTgVxVYE0qud9+qjI7vIiyJakQ=; b=fExXYGOitYGBffqp0t9WFG9mnbGomzAQOovoP7kMAtdEPUYxSA1FzkRmwROVhoivs5 OylJgV8/bhl7Ny4bXD5pGxoy1I9xDRTeES8TGIyst5CzELJo2hERQSckBZq/4bsU3QKj aXKVkL3jIlEw4Nn8nuPUVtX+14ZooLFSERW7+jRKS/+DKKfb1YDJWM7ptdwk2MQvD46h 8Cif32ukRKO/PWe06Rfm34S0xBgUQJT7LyycWPzC29MwUnPxcwmTXukE5KYylkKGkJyh 7uUu3kMHEXOirg2Ehaz7px6Bi1dqNCAnkF8h7uOzGAGiiW4KMrOpCZjeffoqY5LBoDwe aoEg== X-Gm-Message-State: AOAM532HxOliOCwvLYU7gH9zjR1OWdQRXGEOO13dMIWcK0mSd9ji9a4e 4MRGIa4NQOLSUMt+ahyK/Tk+G87F0rWx2sfQ X-Received: by 2002:a17:90a:9310:: with SMTP id p16mr5913662pjo.211.1612403188818; Wed, 03 Feb 2021 17:46:28 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.46.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:46:28 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 42/93] tcg/tci: Rename tci_read_r to tci_read_rval Date: Wed, 3 Feb 2021 15:44:18 -1000 Message-Id: <20210204014509.882821-43-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::629; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x629.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=unavailable 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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" In the next patches, we want to use tci_read_r to return the raw register number. So rename the existing function, which returns the register value, to tci_read_rval. Signed-off-by: Richard Henderson --- tcg/tci.c | 192 +++++++++++++++++++++++++++--------------------------- 1 file changed, 96 insertions(+), 96 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index 225cb698e8..20aaaca959 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -119,7 +119,7 @@ static uint64_t tci_read_i64(const uint8_t **tb_ptr) /* Read indexed register (native size) from bytecode. */ static tcg_target_ulong -tci_read_r(const tcg_target_ulong *regs, const uint8_t **tb_ptr) +tci_read_rval(const tcg_target_ulong *regs, const uint8_t **tb_ptr) { tcg_target_ulong value = tci_read_reg(regs, **tb_ptr); *tb_ptr += 1; @@ -131,15 +131,15 @@ tci_read_r(const tcg_target_ulong *regs, const uint8_t **tb_ptr) static uint64_t tci_read_r64(const tcg_target_ulong *regs, const uint8_t **tb_ptr) { - uint32_t low = tci_read_r(regs, tb_ptr); - return tci_uint64(tci_read_r(regs, tb_ptr), low); + uint32_t low = tci_read_rval(regs, tb_ptr); + return tci_uint64(tci_read_rval(regs, tb_ptr), low); } #elif TCG_TARGET_REG_BITS == 64 /* Read indexed register (64 bit) from bytecode. */ static uint64_t tci_read_r64(const tcg_target_ulong *regs, const uint8_t **tb_ptr) { - return tci_read_r(regs, tb_ptr); + return tci_read_rval(regs, tb_ptr); } #endif @@ -147,9 +147,9 @@ static uint64_t tci_read_r64(const tcg_target_ulong *regs, static target_ulong tci_read_ulong(const tcg_target_ulong *regs, const uint8_t **tb_ptr) { - target_ulong taddr = tci_read_r(regs, tb_ptr); + target_ulong taddr = tci_read_rval(regs, tb_ptr); #if TARGET_LONG_BITS > TCG_TARGET_REG_BITS - taddr += (uint64_t)tci_read_r(regs, tb_ptr) << 32; + taddr += (uint64_t)tci_read_rval(regs, tb_ptr) << 32; #endif return taddr; } @@ -382,8 +382,8 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, continue; case INDEX_op_setcond_i32: t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_r(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); + t2 = tci_read_rval(regs, &tb_ptr); condition = *tb_ptr++; tci_write_reg(regs, t0, tci_compare32(t1, t2, condition)); break; @@ -398,15 +398,15 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, #elif TCG_TARGET_REG_BITS == 64 case INDEX_op_setcond_i64: t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_r(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); + t2 = tci_read_rval(regs, &tb_ptr); condition = *tb_ptr++; tci_write_reg(regs, t0, tci_compare64(t1, t2, condition)); break; #endif CASE_32_64(mov) t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); tci_write_reg(regs, t0, t1); break; case INDEX_op_tci_movi_i32: @@ -419,51 +419,51 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, CASE_32_64(ld8u) t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); t2 = tci_read_s32(&tb_ptr); tci_write_reg(regs, t0, *(uint8_t *)(t1 + t2)); break; CASE_32_64(ld8s) t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); t2 = tci_read_s32(&tb_ptr); tci_write_reg(regs, t0, *(int8_t *)(t1 + t2)); break; CASE_32_64(ld16u) t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); t2 = tci_read_s32(&tb_ptr); tci_write_reg(regs, t0, *(uint16_t *)(t1 + t2)); break; CASE_32_64(ld16s) t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); t2 = tci_read_s32(&tb_ptr); tci_write_reg(regs, t0, *(int16_t *)(t1 + t2)); break; case INDEX_op_ld_i32: CASE_64(ld32u) t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); t2 = tci_read_s32(&tb_ptr); tci_write_reg(regs, t0, *(uint32_t *)(t1 + t2)); break; CASE_32_64(st8) - t0 = tci_read_r(regs, &tb_ptr); - t1 = tci_read_r(regs, &tb_ptr); + t0 = tci_read_rval(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); t2 = tci_read_s32(&tb_ptr); *(uint8_t *)(t1 + t2) = t0; break; CASE_32_64(st16) - t0 = tci_read_r(regs, &tb_ptr); - t1 = tci_read_r(regs, &tb_ptr); + t0 = tci_read_rval(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); t2 = tci_read_s32(&tb_ptr); *(uint16_t *)(t1 + t2) = t0; break; case INDEX_op_st_i32: CASE_64(st32) - t0 = tci_read_r(regs, &tb_ptr); - t1 = tci_read_r(regs, &tb_ptr); + t0 = tci_read_rval(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); t2 = tci_read_s32(&tb_ptr); *(uint32_t *)(t1 + t2) = t0; break; @@ -472,38 +472,38 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, CASE_32_64(add) t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_r(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); + t2 = tci_read_rval(regs, &tb_ptr); tci_write_reg(regs, t0, t1 + t2); break; CASE_32_64(sub) t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_r(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); + t2 = tci_read_rval(regs, &tb_ptr); tci_write_reg(regs, t0, t1 - t2); break; CASE_32_64(mul) t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_r(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); + t2 = tci_read_rval(regs, &tb_ptr); tci_write_reg(regs, t0, t1 * t2); break; CASE_32_64(and) t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_r(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); + t2 = tci_read_rval(regs, &tb_ptr); tci_write_reg(regs, t0, t1 & t2); break; CASE_32_64(or) t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_r(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); + t2 = tci_read_rval(regs, &tb_ptr); tci_write_reg(regs, t0, t1 | t2); break; CASE_32_64(xor) t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_r(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); + t2 = tci_read_rval(regs, &tb_ptr); tci_write_reg(regs, t0, t1 ^ t2); break; @@ -511,26 +511,26 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_div_i32: t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_r(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); + t2 = tci_read_rval(regs, &tb_ptr); tci_write_reg(regs, t0, (int32_t)t1 / (int32_t)t2); break; case INDEX_op_divu_i32: t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_r(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); + t2 = tci_read_rval(regs, &tb_ptr); tci_write_reg(regs, t0, (uint32_t)t1 / (uint32_t)t2); break; case INDEX_op_rem_i32: t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_r(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); + t2 = tci_read_rval(regs, &tb_ptr); tci_write_reg(regs, t0, (int32_t)t1 % (int32_t)t2); break; case INDEX_op_remu_i32: t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_r(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); + t2 = tci_read_rval(regs, &tb_ptr); tci_write_reg(regs, t0, (uint32_t)t1 % (uint32_t)t2); break; @@ -538,41 +538,41 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_shl_i32: t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_r(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); + t2 = tci_read_rval(regs, &tb_ptr); tci_write_reg(regs, t0, (uint32_t)t1 << (t2 & 31)); break; case INDEX_op_shr_i32: t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_r(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); + t2 = tci_read_rval(regs, &tb_ptr); tci_write_reg(regs, t0, (uint32_t)t1 >> (t2 & 31)); break; case INDEX_op_sar_i32: t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_r(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); + t2 = tci_read_rval(regs, &tb_ptr); tci_write_reg(regs, t0, (int32_t)t1 >> (t2 & 31)); break; #if TCG_TARGET_HAS_rot_i32 case INDEX_op_rotl_i32: t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_r(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); + t2 = tci_read_rval(regs, &tb_ptr); tci_write_reg(regs, t0, rol32(t1, t2 & 31)); break; case INDEX_op_rotr_i32: t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_r(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); + t2 = tci_read_rval(regs, &tb_ptr); tci_write_reg(regs, t0, ror32(t1, t2 & 31)); break; #endif #if TCG_TARGET_HAS_deposit_i32 case INDEX_op_deposit_i32: t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_r(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); + t2 = tci_read_rval(regs, &tb_ptr); tmp16 = *tb_ptr++; tmp8 = *tb_ptr++; tmp32 = (((1 << tmp8) - 1) << tmp16); @@ -580,8 +580,8 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, break; #endif case INDEX_op_brcond_i32: - t0 = tci_read_r(regs, &tb_ptr); - t1 = tci_read_r(regs, &tb_ptr); + t0 = tci_read_rval(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); condition = *tb_ptr++; label = tci_read_label(&tb_ptr); if (tci_compare32(t0, t1, condition)) { @@ -619,64 +619,64 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_mulu2_i32: t0 = *tb_ptr++; t1 = *tb_ptr++; - t2 = tci_read_r(regs, &tb_ptr); - tmp64 = (uint32_t)tci_read_r(regs, &tb_ptr); + t2 = tci_read_rval(regs, &tb_ptr); + tmp64 = (uint32_t)tci_read_rval(regs, &tb_ptr); tci_write_reg64(regs, t1, t0, (uint32_t)t2 * tmp64); break; #endif /* TCG_TARGET_REG_BITS == 32 */ #if TCG_TARGET_HAS_ext8s_i32 || TCG_TARGET_HAS_ext8s_i64 CASE_32_64(ext8s) t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); tci_write_reg(regs, t0, (int8_t)t1); break; #endif #if TCG_TARGET_HAS_ext16s_i32 || TCG_TARGET_HAS_ext16s_i64 CASE_32_64(ext16s) t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); tci_write_reg(regs, t0, (int16_t)t1); break; #endif #if TCG_TARGET_HAS_ext8u_i32 || TCG_TARGET_HAS_ext8u_i64 CASE_32_64(ext8u) t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); tci_write_reg(regs, t0, (uint8_t)t1); break; #endif #if TCG_TARGET_HAS_ext16u_i32 || TCG_TARGET_HAS_ext16u_i64 CASE_32_64(ext16u) t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); tci_write_reg(regs, t0, (uint16_t)t1); break; #endif #if TCG_TARGET_HAS_bswap16_i32 || TCG_TARGET_HAS_bswap16_i64 CASE_32_64(bswap16) t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); tci_write_reg(regs, t0, bswap16(t1)); break; #endif #if TCG_TARGET_HAS_bswap32_i32 || TCG_TARGET_HAS_bswap32_i64 CASE_32_64(bswap32) t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); tci_write_reg(regs, t0, bswap32(t1)); break; #endif #if TCG_TARGET_HAS_not_i32 || TCG_TARGET_HAS_not_i64 CASE_32_64(not) t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); tci_write_reg(regs, t0, ~t1); break; #endif #if TCG_TARGET_HAS_neg_i32 || TCG_TARGET_HAS_neg_i64 CASE_32_64(neg) t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); tci_write_reg(regs, t0, -t1); break; #endif @@ -691,19 +691,19 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_ld32s_i64: t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); t2 = tci_read_s32(&tb_ptr); tci_write_reg(regs, t0, *(int32_t *)(t1 + t2)); break; case INDEX_op_ld_i64: t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); t2 = tci_read_s32(&tb_ptr); tci_write_reg(regs, t0, *(uint64_t *)(t1 + t2)); break; case INDEX_op_st_i64: - t0 = tci_read_r(regs, &tb_ptr); - t1 = tci_read_r(regs, &tb_ptr); + t0 = tci_read_rval(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); t2 = tci_read_s32(&tb_ptr); *(uint64_t *)(t1 + t2) = t0; break; @@ -712,26 +712,26 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_div_i64: t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_r(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); + t2 = tci_read_rval(regs, &tb_ptr); tci_write_reg(regs, t0, (int64_t)t1 / (int64_t)t2); break; case INDEX_op_divu_i64: t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_r(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); + t2 = tci_read_rval(regs, &tb_ptr); tci_write_reg(regs, t0, (uint64_t)t1 / (uint64_t)t2); break; case INDEX_op_rem_i64: t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_r(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); + t2 = tci_read_rval(regs, &tb_ptr); tci_write_reg(regs, t0, (int64_t)t1 % (int64_t)t2); break; case INDEX_op_remu_i64: t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_r(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); + t2 = tci_read_rval(regs, &tb_ptr); tci_write_reg(regs, t0, (uint64_t)t1 % (uint64_t)t2); break; @@ -739,41 +739,41 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_shl_i64: t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_r(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); + t2 = tci_read_rval(regs, &tb_ptr); tci_write_reg(regs, t0, t1 << (t2 & 63)); break; case INDEX_op_shr_i64: t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_r(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); + t2 = tci_read_rval(regs, &tb_ptr); tci_write_reg(regs, t0, t1 >> (t2 & 63)); break; case INDEX_op_sar_i64: t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_r(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); + t2 = tci_read_rval(regs, &tb_ptr); tci_write_reg(regs, t0, ((int64_t)t1 >> (t2 & 63))); break; #if TCG_TARGET_HAS_rot_i64 case INDEX_op_rotl_i64: t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_r(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); + t2 = tci_read_rval(regs, &tb_ptr); tci_write_reg(regs, t0, rol64(t1, t2 & 63)); break; case INDEX_op_rotr_i64: t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_r(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); + t2 = tci_read_rval(regs, &tb_ptr); tci_write_reg(regs, t0, ror64(t1, t2 & 63)); break; #endif #if TCG_TARGET_HAS_deposit_i64 case INDEX_op_deposit_i64: t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_r(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); + t2 = tci_read_rval(regs, &tb_ptr); tmp16 = *tb_ptr++; tmp8 = *tb_ptr++; tmp64 = (((1ULL << tmp8) - 1) << tmp16); @@ -781,8 +781,8 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, break; #endif case INDEX_op_brcond_i64: - t0 = tci_read_r(regs, &tb_ptr); - t1 = tci_read_r(regs, &tb_ptr); + t0 = tci_read_rval(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); condition = *tb_ptr++; label = tci_read_label(&tb_ptr); if (tci_compare64(t0, t1, condition)) { @@ -794,19 +794,19 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_ext32s_i64: case INDEX_op_ext_i32_i64: t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); tci_write_reg(regs, t0, (int32_t)t1); break; case INDEX_op_ext32u_i64: case INDEX_op_extu_i32_i64: t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); tci_write_reg(regs, t0, (uint32_t)t1); break; #if TCG_TARGET_HAS_bswap64_i64 case INDEX_op_bswap64_i64: t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); + t1 = tci_read_rval(regs, &tb_ptr); tci_write_reg(regs, t0, bswap64(t1)); break; #endif @@ -913,7 +913,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, } break; case INDEX_op_qemu_st_i32: - t0 = tci_read_r(regs, &tb_ptr); + t0 = tci_read_rval(regs, &tb_ptr); taddr = tci_read_ulong(regs, &tb_ptr); oi = tci_read_i(&tb_ptr); switch (get_memop(oi) & (MO_BSWAP | MO_SIZE)) { From patchwork Thu Feb 4 01:44:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376179 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp910889ejt; Wed, 3 Feb 2021 18:16:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJz2bVKplC3VW7RKtwP3eaS9f+x8BkjEKKJoKeL3lTJ5gjyBB+F6p8kceifWSWO+pNGvYEjO X-Received: by 2002:a25:bb8f:: with SMTP id y15mr8489349ybg.139.1612404985040; Wed, 03 Feb 2021 18:16:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612404985; cv=none; d=google.com; s=arc-20160816; b=y3Hswe5APNqsygheD7bOYKkMtEOsdKO6xdxlM7rIVk5WaCm/wIE1lyq5NhuFJlNnkT lw3Ozr/vJu/6P1dyc0qVvGolbUxVfcL6ENgJN3IfBiEvhahG14tlj42g2O6bfXjUTJL0 wgFpHvKBnGvz+y+L+H/LbhotqeMVHHajJrZs6mIEsv5a+umNDAiGdfUrHZIt4hFNvlhI mxGDa2UdjyldCClqvQ+8gUsfoB3FEUGjP7hA/MdG4CE2p2KPeMkEWoP7aAnH/djgOUX5 DDqv1B6oQffe9U2Mx96nllIViuwoYewlKUdXvWJZ0BtOXdeH07KbswjMttyDEN2gCm8W ddzg== 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=6L5nwfntHiBbAqZT7vmSHngxEhaJDXVbwdQCQHJ8TTo=; b=VOThfzMa8UxVIC5S9wc2Lj9ORS3hErh88hZETm9ii7DaQXg8003vLYxLmyNTni1H+n hY+iQORo5nPKpdyjN9wMLEjPQrmDbXG4714ezecCW8Hph6NDnOZinffjZfSIXxQ9LyDb AFhrxLu38rXZVzgr+EmaNvP9MLXifwlJVyURxO2nMn+azw66x/kpBKv8PaF6F/w2H7Rd ldhVRut4ZeozXPY09qKC/MFg9+KrehTL0JMlnsbZkNtBZb0KgceCf+QOTqU4Eqkn61tq DjmSbrSNxcj2mGo0cV2Lzc5k0vK+v6isG4Oa6ydO8wYg5LMFlwAYkUJHPWfK11akFpjr ABow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=q0mviukl; 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 u17si4117908ybj.429.2021.02.03.18.16.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:16:25 -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=q0mviukl; 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]:59244 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7UC0-0007SG-Cu for patch@linaro.org; Wed, 03 Feb 2021 21:16:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44908) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7TjI-0005Po-83 for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:44 -0500 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]:38192) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Tj7-0003yY-9p for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:42 -0500 Received: by mail-pl1-x636.google.com with SMTP id x9so892421plb.5 for ; Wed, 03 Feb 2021 17:46:31 -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=6L5nwfntHiBbAqZT7vmSHngxEhaJDXVbwdQCQHJ8TTo=; b=q0mviuklDICOKKUiCYmLMcXKKmSBCAwIEeFO56iRToxdzWm9BIKNlfJCnEhbRucMd6 QzoT94NJRyy5eZJn3xg1yTibmKv6K2ir2yzkSmXQ30XPmCAAgUBY6MUts198crEcb+/g Yx98nFwuVW21ugXjvR1ZSF6JRQNeUZk6iOomqDyDtQ3ByFNvMOXTI4HF+QIddd3XenrR 5A+hp8F0InVU45Mn7dKYlTuFfcQJoFwkOGtn7bILGNDEB9mRnnSjc/R7fydrV7hOjcqd TRB7YtfdRhsDIJMiQTpD9skBkB2VsqRDHYtNlBrWOhvdLQ//MQ444+rqRLf5bJQb3rZY 3PJA== 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=6L5nwfntHiBbAqZT7vmSHngxEhaJDXVbwdQCQHJ8TTo=; b=GDuy8ZCLiA+Lu0KI+aecrOgB31D+nva3zduKxDdF8TQeZ4ITB6jglAU+DUlf432cym SUwR+90IP/LZZw2k6HbPMvXHa24Yz5wStOEGQgBqIG67hr0ZjaPVZUSC1q9iLIFWc3AX NHOy9somldLJexyiazXoE0WqtEc9wivITwkUrx2cvM/vKMx+lLFC8ymkxgGoPxZhTfql OTYFJ0ls8whf4r+GBglyP2JaCp0bVcoB3Vc9KSvsZ9/Vhwhzt6oXH6yVj2x0HvxVNFSA MIjFIlpvl/YYbL5qnh6Ib45jF55GcZ8LHGR4G/5fHFGm4IpRTmHtG0LJbK/w7Dgg2hGl w76Q== X-Gm-Message-State: AOAM530JKve0ASND/o1yAu7O5VppZfQsufuaBX+v9DhaLeLgVz6dWkp2 6irjSXMqIBAPDQQ6f4EAQn2Vk4PXecTKkt0A X-Received: by 2002:a17:902:d64e:b029:df:e5b1:b7f7 with SMTP id y14-20020a170902d64eb02900dfe5b1b7f7mr5660811plh.10.1612403190499; Wed, 03 Feb 2021 17:46:30 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.46.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:46:29 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 43/93] tcg/tci: Split out tci_args_rrs Date: Wed, 3 Feb 2021 15:44:19 -1000 Message-Id: <20210204014509.882821-44-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::636; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x636.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Begin splitting out functions that do pure argument decode, without actually loading values from the register set. This means that decoding need not concern itself between input and output registers. We can assert that the register number is in range during decode, so that it is safe to simply dereference from regs[] later. Signed-off-by: Richard Henderson --- tcg/tci.c | 111 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 67 insertions(+), 44 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index 20aaaca959..be298ae39d 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -83,6 +83,20 @@ static uint64_t tci_uint64(uint32_t high, uint32_t low) } #endif +/* Read constant byte from bytecode. */ +static uint8_t tci_read_b(const uint8_t **tb_ptr) +{ + return *(tb_ptr[0]++); +} + +/* Read register number from bytecode. */ +static TCGReg tci_read_r(const uint8_t **tb_ptr) +{ + uint8_t regno = tci_read_b(tb_ptr); + tci_assert(regno < TCG_TARGET_NB_REGS); + return regno; +} + /* Read constant (native size) from bytecode. */ static tcg_target_ulong tci_read_i(const uint8_t **tb_ptr) { @@ -161,6 +175,23 @@ static tcg_target_ulong tci_read_label(const uint8_t **tb_ptr) return label; } +/* + * Load sets of arguments all at once. The naming convention is: + * tci_args_ + * where arguments is a sequence of + * + * r = register + * s = signed ldst offset + */ + +static void tci_args_rrs(const uint8_t **tb_ptr, + TCGReg *r0, TCGReg *r1, int32_t *i2) +{ + *r0 = tci_read_r(tb_ptr); + *r1 = tci_read_r(tb_ptr); + *i2 = tci_read_s32(tb_ptr); +} + static bool tci_compare32(uint32_t u0, uint32_t u1, TCGCond condition) { bool result = false; @@ -328,6 +359,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, uint8_t op_size = tb_ptr[1]; const uint8_t *old_code_ptr = tb_ptr; #endif + TCGReg r0, r1; tcg_target_ulong t0; tcg_target_ulong t1; tcg_target_ulong t2; @@ -342,6 +374,8 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, uint64_t v64; #endif TCGMemOpIdx oi; + int32_t ofs; + void *ptr; /* Skip opcode and size entry. */ tb_ptr += 2; @@ -418,54 +452,46 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, /* Load/store operations (32 bit). */ CASE_32_64(ld8u) - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - t2 = tci_read_s32(&tb_ptr); - tci_write_reg(regs, t0, *(uint8_t *)(t1 + t2)); + tci_args_rrs(&tb_ptr, &r0, &r1, &ofs); + ptr = (void *)(regs[r1] + ofs); + regs[r0] = *(uint8_t *)ptr; break; CASE_32_64(ld8s) - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - t2 = tci_read_s32(&tb_ptr); - tci_write_reg(regs, t0, *(int8_t *)(t1 + t2)); + tci_args_rrs(&tb_ptr, &r0, &r1, &ofs); + ptr = (void *)(regs[r1] + ofs); + regs[r0] = *(int8_t *)ptr; break; CASE_32_64(ld16u) - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - t2 = tci_read_s32(&tb_ptr); - tci_write_reg(regs, t0, *(uint16_t *)(t1 + t2)); + tci_args_rrs(&tb_ptr, &r0, &r1, &ofs); + ptr = (void *)(regs[r1] + ofs); + regs[r0] = *(uint16_t *)ptr; break; CASE_32_64(ld16s) - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - t2 = tci_read_s32(&tb_ptr); - tci_write_reg(regs, t0, *(int16_t *)(t1 + t2)); + tci_args_rrs(&tb_ptr, &r0, &r1, &ofs); + ptr = (void *)(regs[r1] + ofs); + regs[r0] = *(int16_t *)ptr; break; case INDEX_op_ld_i32: CASE_64(ld32u) - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - t2 = tci_read_s32(&tb_ptr); - tci_write_reg(regs, t0, *(uint32_t *)(t1 + t2)); + tci_args_rrs(&tb_ptr, &r0, &r1, &ofs); + ptr = (void *)(regs[r1] + ofs); + regs[r0] = *(uint32_t *)ptr; break; CASE_32_64(st8) - t0 = tci_read_rval(regs, &tb_ptr); - t1 = tci_read_rval(regs, &tb_ptr); - t2 = tci_read_s32(&tb_ptr); - *(uint8_t *)(t1 + t2) = t0; + tci_args_rrs(&tb_ptr, &r0, &r1, &ofs); + ptr = (void *)(regs[r1] + ofs); + *(uint8_t *)ptr = regs[r0]; break; CASE_32_64(st16) - t0 = tci_read_rval(regs, &tb_ptr); - t1 = tci_read_rval(regs, &tb_ptr); - t2 = tci_read_s32(&tb_ptr); - *(uint16_t *)(t1 + t2) = t0; + tci_args_rrs(&tb_ptr, &r0, &r1, &ofs); + ptr = (void *)(regs[r1] + ofs); + *(uint16_t *)ptr = regs[r0]; break; case INDEX_op_st_i32: CASE_64(st32) - t0 = tci_read_rval(regs, &tb_ptr); - t1 = tci_read_rval(regs, &tb_ptr); - t2 = tci_read_s32(&tb_ptr); - *(uint32_t *)(t1 + t2) = t0; + tci_args_rrs(&tb_ptr, &r0, &r1, &ofs); + ptr = (void *)(regs[r1] + ofs); + *(uint32_t *)ptr = regs[r0]; break; /* Arithmetic operations (mixed 32/64 bit). */ @@ -690,22 +716,19 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, /* Load/store operations (64 bit). */ case INDEX_op_ld32s_i64: - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - t2 = tci_read_s32(&tb_ptr); - tci_write_reg(regs, t0, *(int32_t *)(t1 + t2)); + tci_args_rrs(&tb_ptr, &r0, &r1, &ofs); + ptr = (void *)(regs[r1] + ofs); + regs[r0] = *(int32_t *)ptr; break; case INDEX_op_ld_i64: - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - t2 = tci_read_s32(&tb_ptr); - tci_write_reg(regs, t0, *(uint64_t *)(t1 + t2)); + tci_args_rrs(&tb_ptr, &r0, &r1, &ofs); + ptr = (void *)(regs[r1] + ofs); + regs[r0] = *(uint64_t *)ptr; break; case INDEX_op_st_i64: - t0 = tci_read_rval(regs, &tb_ptr); - t1 = tci_read_rval(regs, &tb_ptr); - t2 = tci_read_s32(&tb_ptr); - *(uint64_t *)(t1 + t2) = t0; + tci_args_rrs(&tb_ptr, &r0, &r1, &ofs); + ptr = (void *)(regs[r1] + ofs); + *(uint64_t *)ptr = regs[r0]; break; /* Arithmetic operations (64 bit). */ From patchwork Thu Feb 4 01:44:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376186 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp913657ejt; Wed, 3 Feb 2021 18:21:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJxEmoUvtySCmU84Cqr3Z298ffxbiaObLpQqi4abzFvzUdAu79ev54VX38ru9Yx79VfA473Y X-Received: by 2002:a25:34c3:: with SMTP id b186mr8371317yba.325.1612405301954; Wed, 03 Feb 2021 18:21:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612405301; cv=none; d=google.com; s=arc-20160816; b=QdjE1vOpgjisehEu6qwecRwiLNn7yhNHad2S+WkGfkH4xY7Nc8Ku9WYW6jCNIuP/Os yje+GJM9WXbenoeEOMJlA0MCMSlP+zqAaiIdZxo/XfbYTCa+ak78RlSVue0kzN/eQ7Tz GbOSpNuHC5okVIsZEimU1zjQ0JD90EDIH9Gblos57C42jFH1ltQIP+l0fNrb3qoX72oy s1mNmgwBrJOpxpsnZO0uuSE79oH6l3u0gTo8xVnnDr0hL3BgDNrzSsE5V3WfJ8+0EX5p bE1+waWD4NOUk4u+7XrGRr6YnRv9ObcDPhSIuVyUqQeCaAbJljDae6oVvpAwX4+CwpfF v2ZA== 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=SycMd2jWeSgxswrzk2jq/EmJnAdi6ZgvEeestJkdRLA=; b=ZUSADsxswAIECqB/PfVGNxjJd6K0DO3CiMULL9Q2MSzqCb8lwUvV8N/TDQkSc+7g8g 74KHQmiHqGMN5NlwfjTnaVy9XYtS4bzZWCt5ViKz4VCJJaUh4RY6+S3r/d2ZFrUYWmHV ao43qlcsQ+V4TvGsWsQgDMLrvqCFlGAL/QzvrMaMsae4dpPkmCxIShCQJE0pkTfkhDMi FbyXgKN1Y6FKKEmtFy33CBGf/xBlmj0xvW5oGyqwPUd+JRFIFZ8bM9GV94PgVD62Tdwa 4adB0osGzZVzJm70oj8u8AHKeaI0AMjuICIva8v338jgvkQkMoScH8nlrwnwWOpqZmQ7 cHFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LcynX8ps; 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 v9si3923883ybs.141.2021.02.03.18.21.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:21:41 -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=LcynX8ps; 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]:43216 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7UH7-0004Tw-A7 for patch@linaro.org; Wed, 03 Feb 2021 21:21:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44936) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7TjJ-0005Qf-Bs for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:45 -0500 Received: from mail-pg1-x52f.google.com ([2607:f8b0:4864:20::52f]:40616) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Tj8-0003yd-QB for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:44 -0500 Received: by mail-pg1-x52f.google.com with SMTP id b21so1028664pgk.7 for ; Wed, 03 Feb 2021 17:46:33 -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=SycMd2jWeSgxswrzk2jq/EmJnAdi6ZgvEeestJkdRLA=; b=LcynX8psXkzYNk3VoqoKQOagTyVjc12L4P6IvTI6/+BN3EwSwjgvHlydoGWzwE2KZ0 q4i5Z2FI5IiIsaIH0TUciUybrAAoPrCHSifCyxbMvzgwFN7qr4hHypUNVUHyDOILMXvX UYtre4vvp3Y3BO7VMFPu7IuZ0pno85Fz5nXLHM+E+NUh0iJYvKgvqNih5+mc2iOyPhSx EAfBJSddK0YCkx426ch7EJcAbONJZQhxAmLH1MrivIg3z4lErwNMXmjh+biZOuQHH5/o d/DT2FlzMf2xn55tgd7Mwvfv+WgzL6RdX/coIXfcVyPpqaskmMJpunOHAa1O1kg/Mcck si/g== 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=SycMd2jWeSgxswrzk2jq/EmJnAdi6ZgvEeestJkdRLA=; b=RSwhlJ3cVkxCEQ56KoblO7YtOGQMS4Eh8gMPuNDQqwqUsWTwHvrfKW6cdCOe1Nd5Yk I8AW/9Cw5vVCoJBiaNkDdpk09d+lKCVzVoyicHcHA7KCulrIJH20LpmhvwSCcHQDUc99 6AKvJNm6RNo6mnMCT6kk2TQdgqhV6ATcm+OfZN1C5yU1QPYmb001qEkxyv+j0U0ySYiy y3pNDcIRkKJtEqGj0Nr9fKhXKy4iTRoZxIljBpKmpQAUl/BU3Rg3crRFWdS8IAssbHOG LUT8sZSNzdV6ggrBiXZklt557CA+PLD7GZnCNilAlC5BsVWwG4yMO15v17q+hpql4yek eZ4A== X-Gm-Message-State: AOAM532T7WwciARFE0H3RDLKSgGH0d5Y/vnGjhO7l2Ongs6K30qCUJgq XZaDsIOEclCqAa/26COa2Y5/ZfKi/3Wppe/c X-Received: by 2002:a65:4083:: with SMTP id t3mr6562345pgp.150.1612403191984; Wed, 03 Feb 2021 17:46:31 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.46.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:46:31 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 44/93] tcg/tci: Split out tci_args_rr Date: Wed, 3 Feb 2021 15:44:20 -1000 Message-Id: <20210204014509.882821-45-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52f; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52f.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- tcg/tci.c | 67 +++++++++++++++++++++++++------------------------------ 1 file changed, 31 insertions(+), 36 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index be298ae39d..0bc5294e8b 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -184,6 +184,13 @@ static tcg_target_ulong tci_read_label(const uint8_t **tb_ptr) * s = signed ldst offset */ +static void tci_args_rr(const uint8_t **tb_ptr, + TCGReg *r0, TCGReg *r1) +{ + *r0 = tci_read_r(tb_ptr); + *r1 = tci_read_r(tb_ptr); +} + static void tci_args_rrs(const uint8_t **tb_ptr, TCGReg *r0, TCGReg *r1, int32_t *i2) { @@ -439,9 +446,8 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, break; #endif CASE_32_64(mov) - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - tci_write_reg(regs, t0, t1); + tci_args_rr(&tb_ptr, &r0, &r1); + regs[r0] = regs[r1]; break; case INDEX_op_tci_movi_i32: t0 = *tb_ptr++; @@ -652,58 +658,50 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, #endif /* TCG_TARGET_REG_BITS == 32 */ #if TCG_TARGET_HAS_ext8s_i32 || TCG_TARGET_HAS_ext8s_i64 CASE_32_64(ext8s) - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - tci_write_reg(regs, t0, (int8_t)t1); + tci_args_rr(&tb_ptr, &r0, &r1); + regs[r0] = (int8_t)regs[r1]; break; #endif #if TCG_TARGET_HAS_ext16s_i32 || TCG_TARGET_HAS_ext16s_i64 CASE_32_64(ext16s) - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - tci_write_reg(regs, t0, (int16_t)t1); + tci_args_rr(&tb_ptr, &r0, &r1); + regs[r0] = (int16_t)regs[r1]; break; #endif #if TCG_TARGET_HAS_ext8u_i32 || TCG_TARGET_HAS_ext8u_i64 CASE_32_64(ext8u) - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - tci_write_reg(regs, t0, (uint8_t)t1); + tci_args_rr(&tb_ptr, &r0, &r1); + regs[r0] = (uint8_t)regs[r1]; break; #endif #if TCG_TARGET_HAS_ext16u_i32 || TCG_TARGET_HAS_ext16u_i64 CASE_32_64(ext16u) - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - tci_write_reg(regs, t0, (uint16_t)t1); + tci_args_rr(&tb_ptr, &r0, &r1); + regs[r0] = (uint16_t)regs[r1]; break; #endif #if TCG_TARGET_HAS_bswap16_i32 || TCG_TARGET_HAS_bswap16_i64 CASE_32_64(bswap16) - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - tci_write_reg(regs, t0, bswap16(t1)); + tci_args_rr(&tb_ptr, &r0, &r1); + regs[r0] = bswap16(regs[r1]); break; #endif #if TCG_TARGET_HAS_bswap32_i32 || TCG_TARGET_HAS_bswap32_i64 CASE_32_64(bswap32) - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - tci_write_reg(regs, t0, bswap32(t1)); + tci_args_rr(&tb_ptr, &r0, &r1); + regs[r0] = bswap32(regs[r1]); break; #endif #if TCG_TARGET_HAS_not_i32 || TCG_TARGET_HAS_not_i64 CASE_32_64(not) - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - tci_write_reg(regs, t0, ~t1); + tci_args_rr(&tb_ptr, &r0, &r1); + regs[r0] = ~regs[r1]; break; #endif #if TCG_TARGET_HAS_neg_i32 || TCG_TARGET_HAS_neg_i64 CASE_32_64(neg) - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - tci_write_reg(regs, t0, -t1); + tci_args_rr(&tb_ptr, &r0, &r1); + regs[r0] = -regs[r1]; break; #endif #if TCG_TARGET_REG_BITS == 64 @@ -816,21 +814,18 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, break; case INDEX_op_ext32s_i64: case INDEX_op_ext_i32_i64: - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - tci_write_reg(regs, t0, (int32_t)t1); + tci_args_rr(&tb_ptr, &r0, &r1); + regs[r0] = (int32_t)regs[r1]; break; case INDEX_op_ext32u_i64: case INDEX_op_extu_i32_i64: - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - tci_write_reg(regs, t0, (uint32_t)t1); + tci_args_rr(&tb_ptr, &r0, &r1); + regs[r0] = (uint32_t)regs[r1]; break; #if TCG_TARGET_HAS_bswap64_i64 case INDEX_op_bswap64_i64: - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - tci_write_reg(regs, t0, bswap64(t1)); + tci_args_rr(&tb_ptr, &r0, &r1); + regs[r0] = bswap64(regs[r1]); break; #endif #endif /* TCG_TARGET_REG_BITS == 64 */ From patchwork Thu Feb 4 01:44:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376189 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp915241ejt; Wed, 3 Feb 2021 18:25:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJyCvJ14Dqx7tmUC4GQ2OaIZeZ9pNOvkVaLGhJ6R/vUj+zB+wzDw2obteOH1TL34SNaC/4cT X-Received: by 2002:a25:dc6:: with SMTP id 189mr9095286ybn.357.1612405500021; Wed, 03 Feb 2021 18:25:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612405500; cv=none; d=google.com; s=arc-20160816; b=yNlARk7ma9ViWtN1Ep74G3o+s6/03/I2vMM/YxtY2i+mMOIcX+PyqPpqovkJLjoqcS fGNMsAR50YiqamZuq/pZu9WHhqXkMAuhBxRBx3lsr8ijoiwCfDKUoeFtNEsQbe1pLkfX t3EFW+ek4+3c2qYb+EXB0ckgRxniC/PuJemTSCHTXuz3tRxC1wJctnuyL7uFg8hEGgCC g8kYs7qYATPiOF3UtgUMvXdjdMPc73wiW3UJSVQ+k0BI8Brlesul4FkbHHqf9faBUPrt nImwUf3tUNpRGWSQNmI53Nfo5gKfd/deed5yuj3Y4Gd/fNZpr/4MGuINyLOCsf7HKPBo gQAA== 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=0x6yAz9IWt//DqIhrZQq1lj8QzyPzdXLy5ti7im2Qlc=; b=qnijUrTnZrQmhXA09yVfi9fWtqAXX/Vuc2eCKVtiKsV342wkgxZLCp6YDz5EpQTItj 31XE7qRFps82JaGLMYMbWyiykqhmrV9VW0x6GC+AI4mMBxvSdpvCnrbQy7iS3v0yNYyG 68QZ8sHYKKrWXuQzDZeQp5AzUVApflCk3uCQgvTbEXyuosXPvWMCU5eTGkHxmGwgvyNS 9QHX7FmBG2kNJ0miqxofytsDVPQ6ADCD+vJPHTHOspBpN+JnyX/0yWPYSN82r98icos4 LQaZAMFmR4xcn2hQKuirmgKtmb+sQdrhYyedQ8drdOVxlM8v3zTCjjk+BOXjX0i2g2ec xp1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Pw+LKhAT; 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 u6si4812102ybc.379.2021.02.03.18.24.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:25:00 -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=Pw+LKhAT; 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]:51710 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7UKJ-00081y-Df for patch@linaro.org; Wed, 03 Feb 2021 21:24:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44974) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7TjL-0005Sm-92 for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:47 -0500 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]:37452) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7TjA-0003yn-Ks for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:47 -0500 Received: by mail-pf1-x42d.google.com with SMTP id b145so1075250pfb.4 for ; Wed, 03 Feb 2021 17:46:34 -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=0x6yAz9IWt//DqIhrZQq1lj8QzyPzdXLy5ti7im2Qlc=; b=Pw+LKhATN8abfwiodGH8gbss2d9L845LiCP0RgoE+0RRsq32cosA4YIUkE1dZJQ4+O 033feJD4JBgbN5/WM3kSjCvHFoBepk4/QNhdkG0GoFDwI+H78hKr9GwD+pKOOqKSJhKH iKfwTi2r2K0sPpvtj+6n2h4MEvQLduhUCdQbDX6kXV/COlyIpalED1lrXfyKBTk/Ejie Ef/BYV8+nJwmurEvIjmZifFAWCGRcW+PmFahJOJkxJHNpnHkarDjIhZ6utgdSRQ0qkUj 6lWJmliW2Bv61/OrDZjOljnpgRHH0JBmVTnpt9wbb0UaXuxzRy24HQxn1frc1S1uPckj nZAw== 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=0x6yAz9IWt//DqIhrZQq1lj8QzyPzdXLy5ti7im2Qlc=; b=Xpsb5Lbn9apqPlQ2/BlPAX1lux7QMClqDGZB1Rx17+uDe7KvyZZJwy/AhxhylAlte2 plvGByvsFLxg/gXEjCILVQQRFS7oT7UeQjg53Sl5JVh9KuLSSA34L6HPTWxkib00d/9R KmbQ4gAqt/XpifOw74b9nFXBvzWo2R+Wsel7pT8/NU+CbnZ0WVouqb94E5bUBHSXuaKS 7SFi8dNLn9+OT5UcTu/Q3lKz/vKUO8QuqbBzS2o4cfD7iNOVhhLwrVzhb4MxTo6Fm7ee 0UNBv0Wrh+qV9RdokovLUfTQD8FjeR7DnTNjQTDmJshe9u0w/RWcLAIWhN8c1I6+ofXp p0lA== X-Gm-Message-State: AOAM530swY2caEJgRzYEEeNfl0Gdjw2xUMGB3x8ahr+Tf+pwbGDX7LHg jJI4qjW722aXYbc4+/zzrhqfWJo0xaK/R4qO X-Received: by 2002:a63:4346:: with SMTP id q67mr6517372pga.223.1612403193691; Wed, 03 Feb 2021 17:46:33 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.46.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:46:32 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 45/93] tcg/tci: Split out tci_args_rrr Date: Wed, 3 Feb 2021 15:44:21 -1000 Message-Id: <20210204014509.882821-46-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42d; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42d.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- tcg/tci.c | 154 ++++++++++++++++++++---------------------------------- 1 file changed, 57 insertions(+), 97 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index 0bc5294e8b..1736234bfd 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -191,6 +191,14 @@ static void tci_args_rr(const uint8_t **tb_ptr, *r1 = tci_read_r(tb_ptr); } +static void tci_args_rrr(const uint8_t **tb_ptr, + TCGReg *r0, TCGReg *r1, TCGReg *r2) +{ + *r0 = tci_read_r(tb_ptr); + *r1 = tci_read_r(tb_ptr); + *r2 = tci_read_r(tb_ptr); +} + static void tci_args_rrs(const uint8_t **tb_ptr, TCGReg *r0, TCGReg *r1, int32_t *i2) { @@ -366,7 +374,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, uint8_t op_size = tb_ptr[1]; const uint8_t *old_code_ptr = tb_ptr; #endif - TCGReg r0, r1; + TCGReg r0, r1, r2; tcg_target_ulong t0; tcg_target_ulong t1; tcg_target_ulong t2; @@ -503,101 +511,71 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, /* Arithmetic operations (mixed 32/64 bit). */ CASE_32_64(add) - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - t2 = tci_read_rval(regs, &tb_ptr); - tci_write_reg(regs, t0, t1 + t2); + tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + regs[r0] = regs[r1] + regs[r2]; break; CASE_32_64(sub) - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - t2 = tci_read_rval(regs, &tb_ptr); - tci_write_reg(regs, t0, t1 - t2); + tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + regs[r0] = regs[r1] - regs[r2]; break; CASE_32_64(mul) - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - t2 = tci_read_rval(regs, &tb_ptr); - tci_write_reg(regs, t0, t1 * t2); + tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + regs[r0] = regs[r1] * regs[r2]; break; CASE_32_64(and) - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - t2 = tci_read_rval(regs, &tb_ptr); - tci_write_reg(regs, t0, t1 & t2); + tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + regs[r0] = regs[r1] & regs[r2]; break; CASE_32_64(or) - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - t2 = tci_read_rval(regs, &tb_ptr); - tci_write_reg(regs, t0, t1 | t2); + tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + regs[r0] = regs[r1] | regs[r2]; break; CASE_32_64(xor) - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - t2 = tci_read_rval(regs, &tb_ptr); - tci_write_reg(regs, t0, t1 ^ t2); + tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + regs[r0] = regs[r1] ^ regs[r2]; break; /* Arithmetic operations (32 bit). */ case INDEX_op_div_i32: - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - t2 = tci_read_rval(regs, &tb_ptr); - tci_write_reg(regs, t0, (int32_t)t1 / (int32_t)t2); + tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + regs[r0] = (int32_t)regs[r1] / (int32_t)regs[r2]; break; case INDEX_op_divu_i32: - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - t2 = tci_read_rval(regs, &tb_ptr); - tci_write_reg(regs, t0, (uint32_t)t1 / (uint32_t)t2); + tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + regs[r0] = (uint32_t)regs[r1] / (uint32_t)regs[r2]; break; case INDEX_op_rem_i32: - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - t2 = tci_read_rval(regs, &tb_ptr); - tci_write_reg(regs, t0, (int32_t)t1 % (int32_t)t2); + tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + regs[r0] = (int32_t)regs[r1] % (int32_t)regs[r2]; break; case INDEX_op_remu_i32: - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - t2 = tci_read_rval(regs, &tb_ptr); - tci_write_reg(regs, t0, (uint32_t)t1 % (uint32_t)t2); + tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + regs[r0] = (uint32_t)regs[r1] % (uint32_t)regs[r2]; break; /* Shift/rotate operations (32 bit). */ case INDEX_op_shl_i32: - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - t2 = tci_read_rval(regs, &tb_ptr); - tci_write_reg(regs, t0, (uint32_t)t1 << (t2 & 31)); + tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + regs[r0] = (uint32_t)regs[r1] << (regs[r2] & 31); break; case INDEX_op_shr_i32: - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - t2 = tci_read_rval(regs, &tb_ptr); - tci_write_reg(regs, t0, (uint32_t)t1 >> (t2 & 31)); + tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + regs[r0] = (uint32_t)regs[r1] >> (regs[r2] & 31); break; case INDEX_op_sar_i32: - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - t2 = tci_read_rval(regs, &tb_ptr); - tci_write_reg(regs, t0, (int32_t)t1 >> (t2 & 31)); + tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + regs[r0] = (int32_t)regs[r1] >> (regs[r2] & 31); break; #if TCG_TARGET_HAS_rot_i32 case INDEX_op_rotl_i32: - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - t2 = tci_read_rval(regs, &tb_ptr); - tci_write_reg(regs, t0, rol32(t1, t2 & 31)); + tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + regs[r0] = rol32(regs[r1], regs[r2] & 31); break; case INDEX_op_rotr_i32: - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - t2 = tci_read_rval(regs, &tb_ptr); - tci_write_reg(regs, t0, ror32(t1, t2 & 31)); + tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + regs[r0] = ror32(regs[r1], regs[r2] & 31); break; #endif #if TCG_TARGET_HAS_deposit_i32 @@ -732,62 +710,44 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, /* Arithmetic operations (64 bit). */ case INDEX_op_div_i64: - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - t2 = tci_read_rval(regs, &tb_ptr); - tci_write_reg(regs, t0, (int64_t)t1 / (int64_t)t2); + tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + regs[r0] = (int64_t)regs[r1] / (int64_t)regs[r2]; break; case INDEX_op_divu_i64: - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - t2 = tci_read_rval(regs, &tb_ptr); - tci_write_reg(regs, t0, (uint64_t)t1 / (uint64_t)t2); + tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + regs[r0] = (uint64_t)regs[r1] / (uint64_t)regs[r2]; break; case INDEX_op_rem_i64: - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - t2 = tci_read_rval(regs, &tb_ptr); - tci_write_reg(regs, t0, (int64_t)t1 % (int64_t)t2); + tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + regs[r0] = (int64_t)regs[r1] % (int64_t)regs[r2]; break; case INDEX_op_remu_i64: - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - t2 = tci_read_rval(regs, &tb_ptr); - tci_write_reg(regs, t0, (uint64_t)t1 % (uint64_t)t2); + tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + regs[r0] = (uint64_t)regs[r1] % (uint64_t)regs[r2]; break; /* Shift/rotate operations (64 bit). */ case INDEX_op_shl_i64: - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - t2 = tci_read_rval(regs, &tb_ptr); - tci_write_reg(regs, t0, t1 << (t2 & 63)); + tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + regs[r0] = regs[r1] << (regs[r2] & 63); break; case INDEX_op_shr_i64: - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - t2 = tci_read_rval(regs, &tb_ptr); - tci_write_reg(regs, t0, t1 >> (t2 & 63)); + tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + regs[r0] = regs[r1] >> (regs[r2] & 63); break; case INDEX_op_sar_i64: - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - t2 = tci_read_rval(regs, &tb_ptr); - tci_write_reg(regs, t0, ((int64_t)t1 >> (t2 & 63))); + tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + regs[r0] = (int64_t)regs[r1] >> (regs[r2] & 63); break; #if TCG_TARGET_HAS_rot_i64 case INDEX_op_rotl_i64: - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - t2 = tci_read_rval(regs, &tb_ptr); - tci_write_reg(regs, t0, rol64(t1, t2 & 63)); + tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + regs[r0] = rol64(regs[r1], regs[r2] & 63); break; case INDEX_op_rotr_i64: - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - t2 = tci_read_rval(regs, &tb_ptr); - tci_write_reg(regs, t0, ror64(t1, t2 & 63)); + tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + regs[r0] = ror64(regs[r1], regs[r2] & 63); break; #endif #if TCG_TARGET_HAS_deposit_i64 From patchwork Thu Feb 4 01:44:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376200 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp857818jah; Wed, 3 Feb 2021 18:33:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJxshlMzScVAiwyIu5B29wQ0XwX2I5mub/FcpgjjotEverQJkhR/QqcbEjbjrkMESxXWNuY7 X-Received: by 2002:a25:9981:: with SMTP id p1mr8933230ybo.28.1612405983659; Wed, 03 Feb 2021 18:33:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612405983; cv=none; d=google.com; s=arc-20160816; b=MDINem1f6dgvhqsuZNaibGm2FXsB4v/m1wQ1LeagsxSxX7J2MpFdIeEFUZpDDmszCj q3RB1so5MTYZNixFiSDzZc1mUohOgPwHQoy8rfCQ3WDQ0rIgIi0Dt+DGzovPbaOIFvAG OyDX04VGsIdaHwBWQEI3maYdQu70rZ1/cTilE33/xZyFkUslgZ1X9VI+8NeE3HiF9o8o DgEXG3+WzobdcnOTXKsSQtbMIgh6Tof4piHXCzxWCiuLIBuXTKzolHxDiNhYetbXQd9l HT5HLnDfC0PijMwvGa0VI1Oha3PjiBFbIVqINIq8SOutqHkZgNLzabHSwcdPFZ22LL2f fPmw== 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=MYKpHAJMq3pQVgdvIIf5gybikCrqAwnvbyA/L0Pt44U=; b=WsaqKcxrVQ8hFsciI087XPo1ySwM7No2j53NNebHcL89foMHD6VykvCMAPuds2K1tW G96PGA/LvPz98veYKwPqu2iYahn6sNSimxYeUW6nzo/nUVkRWy2wkTDGU/iWh7AB6GIG 1a529WMU1V9VJKBs/aO6mEV+3PoLVLznN7qJi0EIwo2MkE14Zm41srfMNSnlbndhqUSw 5dXFa6NhBappN/yO2oyycAv+jg3OYJaI+K261BLVL/8MY+zskcv5d2nktAXJ3z8IXAjC oQYl5TLN1e+iJ3umGeI1poOcH/msQ+nz/zaKwVK1ABH68k5OPxkvTXPU6K6VASIrsF1A 8Ptw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UyMRMwmC; 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 w10si4106841ybt.235.2021.02.03.18.33.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:33:03 -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=UyMRMwmC; 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]:44890 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7US7-0000PB-1D for patch@linaro.org; Wed, 03 Feb 2021 21:33:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44988) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7TjL-0005T6-NC for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:47 -0500 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]:35657) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7TjB-0003yt-Ag for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:47 -0500 Received: by mail-pj1-x1029.google.com with SMTP id e9so831283pjj.0 for ; Wed, 03 Feb 2021 17:46:36 -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=MYKpHAJMq3pQVgdvIIf5gybikCrqAwnvbyA/L0Pt44U=; b=UyMRMwmCyGcDa4iG4k5N4wkEpvciyi0+x9BMfS9h4V6DGUlTsBx/27Tda+lsuPVJia nj9BaEbWi4cFiYEOc/Q7NHI0jSNjV3P9jTL8m4dBA/2W3ryepx5Cmdu8oFzCvoR72SmW fZCeeAldy35o5ucZ2XJP5Ci5LMoyw/Mi5AtrcKEqHCxf0xKLSmqFuRWeo4zzr5ULPqrm CnA0iYzTMqB5qtgePizmZDTeA209PY7kioUPSwMUflO9Ow+eNVVR8e6Y347Fdo1OeFiv QF6atC99H7MMy3N01T1pAEV18f1dYOKVVLBZ0EQn2aV0kGd5LEbLBth/Wxi9JFpJPa5I ZXhw== 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=MYKpHAJMq3pQVgdvIIf5gybikCrqAwnvbyA/L0Pt44U=; b=EuRjDRbd/BV95RFZcHCky5MMeZMlgHonp6N8HQH6hkxapy96MmfZergaIZpRvLUSZA Rb1kriOwaS+jrBxm/DTuu/vBWuA8SMJQcxhpeQohaEqAtywlDoZ/cnDb9DmDEZLz16OK y6KKe0eOALJGShSXX4WTTj9Uwaz5anQS43E8b3WNtCunObb5dMXEGgMA3Tnsey6SG5NS 31BtSNaon8mZkskigNrVH6u+ahQxr8eULGkPq64giZ6rsOpZoYV08poXueGmu3DOL0Mf igcKT2Bm35VE1SJWdClYN/gtaBcj82sQWfwTw55QUwoClrdTUdgdh/TnAtd4LiXeM8FK 3jAA== X-Gm-Message-State: AOAM533T1FbBgtpIfnAFj7MeSe3VLp1VVOi55UaWwbVKprbAdRt8shMe OWztnsjThBU8oUVnwJw2vfoPkFoXTTq+M3+w X-Received: by 2002:a17:90a:4dc5:: with SMTP id r5mr5849368pjl.114.1612403195190; Wed, 03 Feb 2021 17:46:35 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.46.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:46:34 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 46/93] tcg/tci: Split out tci_args_rrrc Date: Wed, 3 Feb 2021 15:44:22 -1000 Message-Id: <20210204014509.882821-47-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1029; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1029.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- tcg/tci.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index 1736234bfd..86625061f1 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -207,6 +207,15 @@ static void tci_args_rrs(const uint8_t **tb_ptr, *i2 = tci_read_s32(tb_ptr); } +static void tci_args_rrrc(const uint8_t **tb_ptr, + TCGReg *r0, TCGReg *r1, TCGReg *r2, TCGCond *c3) +{ + *r0 = tci_read_r(tb_ptr); + *r1 = tci_read_r(tb_ptr); + *r2 = tci_read_r(tb_ptr); + *c3 = tci_read_b(tb_ptr); +} + static bool tci_compare32(uint32_t u0, uint32_t u1, TCGCond condition) { bool result = false; @@ -430,11 +439,8 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, tb_ptr = (uint8_t *)label; continue; case INDEX_op_setcond_i32: - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - t2 = tci_read_rval(regs, &tb_ptr); - condition = *tb_ptr++; - tci_write_reg(regs, t0, tci_compare32(t1, t2, condition)); + tci_args_rrrc(&tb_ptr, &r0, &r1, &r2, &condition); + regs[r0] = tci_compare32(regs[r1], regs[r2], condition); break; #if TCG_TARGET_REG_BITS == 32 case INDEX_op_setcond2_i32: @@ -446,11 +452,8 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, break; #elif TCG_TARGET_REG_BITS == 64 case INDEX_op_setcond_i64: - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - t2 = tci_read_rval(regs, &tb_ptr); - condition = *tb_ptr++; - tci_write_reg(regs, t0, tci_compare64(t1, t2, condition)); + tci_args_rrrc(&tb_ptr, &r0, &r1, &r2, &condition); + regs[r0] = tci_compare64(regs[r1], regs[r2], condition); break; #endif CASE_32_64(mov) From patchwork Thu Feb 4 01:44:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376192 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp915587ejt; Wed, 3 Feb 2021 18:25:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJztKJRaCXg5HVLccscx3LEMrGRCzr/IK+9LK10GGMrcL/EhjWoHbKC5d8JFPJyFeZOZanXq X-Received: by 2002:a25:ef0e:: with SMTP id g14mr8809785ybd.372.1612405542056; Wed, 03 Feb 2021 18:25:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612405542; cv=none; d=google.com; s=arc-20160816; b=Z2Vnd0h31WNs7jAs44fAE4YZQ4JBS1HDaTvSnEIjt2jv1RS9J843hMoiQI/p6H+THP G9RztG4VUPAAA2h2eGysWHD5iiXG70Gru+PWmaDihEPS0TeIh3B1oRkT+zvwD1SncKFi Js0HE42x00z+3/AWWQYHQHKymjxMItXj4qOmCSz3gmBV9MalePBFOmMPuXjkwYeJkQtk fo2yGrgZkwjIVQ6Gl28Nu+B9pJzROi1qFuEJC4OCZ9aByZlO2Ffvyc+4NKlHuKPX+jQa +in+HFBmuzKmXufP1rVOC9HtM0CwccElz1kFJdDfzm7MvuaSDFNxRtfTSNJjjocBzlfy yXMw== 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=v4sc5nm0f4c/U5WbNEJOfl++DRfDxzP3f+V/F9gDHfw=; b=Kg+zgnTSu8ZggJ7huwpDGdsYfkOP11lYFZbI+Vu/hr19mlXIF72C1HmcBDDw18pNei K3DPQUn5pbEhtG69bKQoEK2MQ6iQhJaxUKL0/HVIP1gxLTPmD7D5b5H9MAKvtb/XWEDX p49h/2jf+V1B3FJlyQfY4cBD9feLQHqMdOAdJxK3t0g7Km97giV3cAMm8rN9z5W8D/e9 a11GgyjMroiatGk+aITiRDDyPUE6ej+DqpGQgUXCk2wogRGcLuL/DfMUvKMvT3ImZxE6 lDIZyNqILc0NUWDGt7x9+ylEj0baKQIJB9AkEmYVHKV/A9tPKMU/nqubf+IlJ3UFprr+ KT7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=whrQNSZ7; 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 n2si3865543ybn.340.2021.02.03.18.25.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:25:42 -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=whrQNSZ7; 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]:56084 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7UKz-0001MG-E1 for patch@linaro.org; Wed, 03 Feb 2021 21:25:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44938) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7TjJ-0005Rg-Ly for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:47 -0500 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]:45514) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7TjG-0003z3-Nm for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:45 -0500 Received: by mail-pl1-x62e.google.com with SMTP id b8so870455plh.12 for ; Wed, 03 Feb 2021 17:46:37 -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=v4sc5nm0f4c/U5WbNEJOfl++DRfDxzP3f+V/F9gDHfw=; b=whrQNSZ7YOQk5yTbZlf4volSG8dr1SYfIVlzZkFxLJDz/gA1XgH+XEehaEmOYxFgAW 7wGbo7ZWzkHCIcoR9WWuTk5mSF75PqKuziUg6tuH96ui0DDpPwURTNimMFx6Y0HLHBvv J11N/0Q5+8zN6DVGCT4gA5IyaRW6+kLPoN3Q+JlveuwePWLjl6eFxEKzgldbeVZLHcMW xhkOP2n65YE6po1lR4k1IDlrspVizZ3u1lJ8J8dyv2Ke8JHmyRLh+KmVEwOiqc+z+uzp FARBmpxykw05pZMLpsbsJTYxc5MV5ruq/C/VgsGvUEECRabawr4Uhip1GfiIg2Fjb6DU JlhA== 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=v4sc5nm0f4c/U5WbNEJOfl++DRfDxzP3f+V/F9gDHfw=; b=BnhS8+c/jFUAw1YU3SPdcPYAU8q2a021bPQpD3r12cTVbs7iJhH3vd9qrxoAPQqz8E QUzT0sVhwCrqBh2CZns6kWGQ5Eq4THRyklJrBi8qlFSAFqdEbk07DU7A9kqHt18MXy0s /IKNwBxlNGWpuDN6D7JaWGIfHWOzaUcj9+AJhhA3EImsJv6O08tw5TBQyTpYnmtvSUil hfyY6mWNea7XZjDEpTR5fR+bYkNKqF+V3XnxQQ5RJ9laATk1dX7pDeAdu5h8x8fwZVR0 AKvOVdnuCT+DWgLIx7HTooWvrH974XgBn0cPqKFKQhYe7t4tq4d/KAmETflxdv+EVrK4 yLjw== X-Gm-Message-State: AOAM5308wrexCrDH4lEkUNRLBjDByYSVSBWEtTgGO3pp62vFAXKU5b5H LY5tey55Z9EX2K47niuS6IKknQCVieRYijEr X-Received: by 2002:a17:90b:23c2:: with SMTP id md2mr5845606pjb.222.1612403196885; Wed, 03 Feb 2021 17:46:36 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.46.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:46:36 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 47/93] tcg/tci: Split out tci_args_l Date: Wed, 3 Feb 2021 15:44:23 -1000 Message-Id: <20210204014509.882821-48-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62e; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62e.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- tcg/tci.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index 86625061f1..8bc9dd27b0 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -184,6 +184,11 @@ static tcg_target_ulong tci_read_label(const uint8_t **tb_ptr) * s = signed ldst offset */ +static void tci_args_l(const uint8_t **tb_ptr, void **l0) +{ + *l0 = (void *)tci_read_label(tb_ptr); +} + static void tci_args_rr(const uint8_t **tb_ptr, TCGReg *r0, TCGReg *r1) { @@ -434,9 +439,9 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, #endif break; case INDEX_op_br: - label = tci_read_label(&tb_ptr); + tci_args_l(&tb_ptr, &ptr); tci_assert(tb_ptr == old_code_ptr + op_size); - tb_ptr = (uint8_t *)label; + tb_ptr = ptr; continue; case INDEX_op_setcond_i32: tci_args_rrrc(&tb_ptr, &r0, &r1, &r2, &condition); From patchwork Thu Feb 4 01:44:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376188 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp914203ejt; Wed, 3 Feb 2021 18:22:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJxIa8NF1yxAzd4rVsP8oqrDFHSUXn56KPCGV90c71t51nE2VQfQaAe1pP7/oOJ8CdwP17sc X-Received: by 2002:a25:2483:: with SMTP id k125mr8874147ybk.190.1612405371171; Wed, 03 Feb 2021 18:22:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612405371; cv=none; d=google.com; s=arc-20160816; b=YPlM1BULptDOCEOBj3K5QmLrxccEc9l3HoPnLwwIGRj6ySKodyhAYBKoggGwHd45b0 KSq6peFVevvkV4kH0SQKE9fu5Tmjz1lW0YoV3wgbqPKoeDcN7YBkMUqnzmutj5TZqQqz RdBzrnr6EZWkv7pETVEO5H9iG4Sq6JgQIoEGGblBFtleTBmWLVu+wpyRqHgujWdiz6c8 gtb7bV+m/VCDVnanf04fqgS5x0zPHLx32A0jSIRYmf0O50Oygd41ft+xm6E0SyXFPRaz U0g/htCP1o762+Cisx1oAhgLURh3I1qvZcsg+9yJcZ5yXMbN74Lmt98QaVmniPDJQjjQ 2/9A== 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=EjI7Jfr8LIthM/+Hr8pg5fY2MZ87PA6SSlhcAVNxWvA=; b=z1qCrxx1pX8q0ecaGmqb0ik2ufDKabchu0ThPvzv5nGyjOjBpBqlHG8jHPr7kvs2pb 55Fpgdsanv2Pj8HWguN/ntTI2bbfYsVXSDuedTM45d7lCwueKgXg9kvhMGqtnK+hL0pu KJEI1HqbmB7wLyHT/mMSpJqlazNmyGZA9jYZp1YEf3Yo305wmc87CBVHwAPzd2b84XJZ RT8x8x4AEz2qK8aUZLZEITRpfE6UKpD2e/2Vvf52B4Cw/tatwLh2OGMf/DLBFOd/T4iP B/HpXs1H/LFDUKOFr6SfWpjpOYOCdUE7CEBmjZWNo+D4an3H8SPAwxPG/Po+hxHj3S8t FbIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="G4HqM0/m"; 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 c67si4648469yba.427.2021.02.03.18.22.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:22:51 -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="G4HqM0/m"; 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]:47142 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7UIE-00067h-IS for patch@linaro.org; Wed, 03 Feb 2021 21:22:50 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44948) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7TjK-0005Sg-CK for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:47 -0500 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]:55439) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7TjG-0003zB-Pd for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:46 -0500 Received: by mail-pj1-x1032.google.com with SMTP id s24so768508pjp.5 for ; Wed, 03 Feb 2021 17:46:39 -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=EjI7Jfr8LIthM/+Hr8pg5fY2MZ87PA6SSlhcAVNxWvA=; b=G4HqM0/mqxJNMm3fqDKPNJKEWL26cvA+6DWhVEsAnvZ7U1V5D0UDAsYgTW6j3pfQKJ AFdxcii/wAJPtx57GcTmqlsHWWhPnUnZbJ9xDz1MX1C63Br/tOg2GCsuYvV+d8k1PUvx dIRfEx1BHhQpTDTmRlXLhW/U+7gaWWJoUJH7iPAoTHNM065qKuH9iLV67zwQQo1iQulX LnOE4fmxpBwEHV0BacxOdVCpzx2txURrIyZt5lml3CWYGl4nI/y1w+Scxa+TG3oGwmgs 1oGs1Oe3/yS5p0o+mal6tDvCG36cLpJKMRNwOVvqIZ2mNb7G8mCOHan/4nW3icPtvvxX i4sw== 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=EjI7Jfr8LIthM/+Hr8pg5fY2MZ87PA6SSlhcAVNxWvA=; b=LS+dL3R6WV27o5CnLuPO94YUF3kPKq+WLfmG7P8j/oM9q2e0SLqfLUB/8cI75e0zJN ZNcJdYBZ4goVWMP2IbHyApmI+q9C8e/VPB7zqME52XvPk4hy4xEz2mkO7Q/SrDz+BlT6 kqEzSV8wfkpI2zyEiWpUpSm9nAxbWWi0xyV9Gr9GrNE/PrJt+w6LbXKIxYYqXa5pEx7I aFXufzjgYreNKtOyRb0wPGtVJxhy3urnHAT6cCCTVz8jPh3E8EZ+kB7qZNU4OcEozZhv MrOXHTFj66Tbr2mU3uM0QUTwzOZ34e1dgdd2DcYLmLrVD0Cvpbs1iTYh8c7647wBYnux QYYA== X-Gm-Message-State: AOAM531nGqRmiH+UakvCsKqgee7+MAheuZbxocAe8uYpbdpwdZOywNtx ews8m4jWyOlqVFu0RSrWuJeE+pGxDWHVn2CB X-Received: by 2002:a17:90a:d3d5:: with SMTP id d21mr5756924pjw.228.1612403198876; Wed, 03 Feb 2021 17:46:38 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.46.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:46:38 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 48/93] tcg/tci: Split out tci_args_rrrrrc Date: Wed, 3 Feb 2021 15:44:24 -1000 Message-Id: <20210204014509.882821-49-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1032.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- tcg/tci.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index 8bc9dd27b0..692b95b5c2 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -221,6 +221,19 @@ static void tci_args_rrrc(const uint8_t **tb_ptr, *c3 = tci_read_b(tb_ptr); } +#if TCG_TARGET_REG_BITS == 32 +static void tci_args_rrrrrc(const uint8_t **tb_ptr, TCGReg *r0, TCGReg *r1, + TCGReg *r2, TCGReg *r3, TCGReg *r4, TCGCond *c5) +{ + *r0 = tci_read_r(tb_ptr); + *r1 = tci_read_r(tb_ptr); + *r2 = tci_read_r(tb_ptr); + *r3 = tci_read_r(tb_ptr); + *r4 = tci_read_r(tb_ptr); + *c5 = tci_read_b(tb_ptr); +} +#endif + static bool tci_compare32(uint32_t u0, uint32_t u1, TCGCond condition) { bool result = false; @@ -400,7 +413,8 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, uint32_t tmp32; uint64_t tmp64; #if TCG_TARGET_REG_BITS == 32 - uint64_t v64; + TCGReg r3, r4; + uint64_t v64, T1, T2; #endif TCGMemOpIdx oi; int32_t ofs; @@ -449,11 +463,10 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, break; #if TCG_TARGET_REG_BITS == 32 case INDEX_op_setcond2_i32: - t0 = *tb_ptr++; - tmp64 = tci_read_r64(regs, &tb_ptr); - v64 = tci_read_r64(regs, &tb_ptr); - condition = *tb_ptr++; - tci_write_reg(regs, t0, tci_compare64(tmp64, v64, condition)); + tci_args_rrrrrc(&tb_ptr, &r0, &r1, &r2, &r3, &r4, &condition); + T1 = tci_uint64(regs[r2], regs[r1]); + T2 = tci_uint64(regs[r4], regs[r3]); + regs[r0] = tci_compare64(T1, T2, condition); break; #elif TCG_TARGET_REG_BITS == 64 case INDEX_op_setcond_i64: From patchwork Thu Feb 4 01:44:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376194 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp915826ejt; Wed, 3 Feb 2021 18:26:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJz0vz8pqXVmjr/utHR4ox1AR0dVLTKVC275rT+8gjPKGqiAQ2YZToNuYwzxg350xYtzUGLd X-Received: by 2002:a25:7783:: with SMTP id s125mr8611155ybc.111.1612405574425; Wed, 03 Feb 2021 18:26:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612405574; cv=none; d=google.com; s=arc-20160816; b=NnkLBNorYi+77TXh6w0mpAm04YM4Bk8C3u72e9Wqwl34THoBgXmGvY72gscBFPOpKE lLuvdA7YvsFWfuiHimgvzXiP3noK2pOXo0YvV2GX6HrZI3vF2f8ZTE/a00hk+nyS8snv uzq8NbqvaQkaiJs1PuxI9eo1UZ+2+awYIQQK8RZ5XjXCvvcV29+Zn4L+fpJ+SD5L3wiN mGl4InGhVd15zOLCrYOlpZbjvECmWuS6KqmnvErO4NYUsrF5+Y98D+sizFplYeH/paZo URxb413QnQCcy4qfrAFUhA0YHeU8agLok3puUgOKHHAI4b+/+LoeFzuUyb17mOcTBmHC fcKw== 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=KzQlyAD9k/hiBg8OA6mTnZcwGe7ZwxIZNF3j/mJP4ic=; b=Qohf2qfG64hkan+rUgbRMyvOOuNRF/LolrUFFgpWEcx6z+Tx+Cn3wEPcON+Q87bStf MAlfiTG9aH/rfv9n+EZzqllSHcp4u1onOLKdF6R5dBXSB0wcXQdeNBUkehv3YgDyM7EP jq+dgvGTG9SRoN61/ikdj7AA2hXMtI03iazYrGMjNgzYGImS1PrF5GIhEuNt38pmyE4e HeeQcVdYKXDFLDPqKiDD0UkQpywVGrbjTm0hX5JpVrUwb7LmCj1frfj32FsWSkUb0FE/ 8RPOKTQRCDcYKRsQkmaN7P/7DQlmc5xN/5oIAg/mMXxm4lqz3ZCRflOlqPgpmiCAfaea 64JA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oDT9BwJH; 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 f74si3816840ybg.327.2021.02.03.18.26.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:26:14 -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=oDT9BwJH; 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]:56626 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7ULV-0001ZB-Oz for patch@linaro.org; Wed, 03 Feb 2021 21:26:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44972) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7TjL-0005Sl-0Z for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:47 -0500 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]:38184) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7TjH-0003zR-4i for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:46 -0500 Received: by mail-pl1-x62d.google.com with SMTP id x9so892629plb.5 for ; Wed, 03 Feb 2021 17:46:41 -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=KzQlyAD9k/hiBg8OA6mTnZcwGe7ZwxIZNF3j/mJP4ic=; b=oDT9BwJHUoOFo6FUhXWZheJr1v8FWyXi9ePfou6O3jIpj0IpBRVfHC5oAelrucmNev 1692AiesT5eabfLFEdwKMKk9XcEOrBWvYBQcuEm6Xl+yLlCmH79wmWHhZoCwXdOVX+ad tVCbYOVJn3F4Fr1jUzGS7oxxQpSchvvfsDX9oC4w9LK04rBLWLrLmqq8lbjyBNU5dJ06 HFkzd9Q1FvvFJPrlkFMxqSgrZba7SfUBjc7TOuPAk7UfZ2aaPc9rcG6n2sKU6ZpUjTAt Rp2Q6JtNV76lFlchkFc2qdJZs4nrGVSxEn4H/k4PiCt+thPLnfkKnqeHuEg6anRjqOZ5 qUGg== 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=KzQlyAD9k/hiBg8OA6mTnZcwGe7ZwxIZNF3j/mJP4ic=; b=N8OONg9xVWlVqqP8nPi6IgublxJrc4NOGq7dYAMiStZ6PIDft5GFmfwteibVHywQar mBOqX258lxIJiQIuxi5A1z/8ZboYSRa+5W1df/BTI1N64oZTvQl4tjGzs6rugKTT/0Mo pXBWZW1n+wWifqcYMn/TTAfI0GK3muZJ2duB9VCaG2qgA0LO3zocN4oAdF2No/Kcjav3 cS1j83fiElEjklWZ5tJ7dAyB8BXTgsxVBfN68vIkZzDYXAKuYIllUIXM6sS8bARiQs10 88oYV/9/frK6NyMJaQu8e+F0TjIwwefFktFH3vN20GyXmTtOhUdfhPb57SuV54wIx2QQ WKiw== X-Gm-Message-State: AOAM532Bo1oEAcJ6hQLQsgNV/+Z4qqkB1RtC2Zl3M70mPNnE2fGpGcAi Mt0gQ4bXpVGe8Vwhdt7naPB5WA/pfRpnre/9 X-Received: by 2002:a17:90a:d98a:: with SMTP id d10mr5898664pjv.116.1612403200409; Wed, 03 Feb 2021 17:46:40 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.46.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:46:39 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 49/93] tcg/tci: Split out tci_args_rrcl and tci_args_rrrrcl Date: Wed, 3 Feb 2021 15:44:25 -1000 Message-Id: <20210204014509.882821-50-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62d.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- tcg/tci.c | 52 ++++++++++++++++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 20 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index 692b95b5c2..1e2f78a9f9 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -212,6 +212,15 @@ static void tci_args_rrs(const uint8_t **tb_ptr, *i2 = tci_read_s32(tb_ptr); } +static void tci_args_rrcl(const uint8_t **tb_ptr, + TCGReg *r0, TCGReg *r1, TCGCond *c2, void **l3) +{ + *r0 = tci_read_r(tb_ptr); + *r1 = tci_read_r(tb_ptr); + *c2 = tci_read_b(tb_ptr); + *l3 = (void *)tci_read_label(tb_ptr); +} + static void tci_args_rrrc(const uint8_t **tb_ptr, TCGReg *r0, TCGReg *r1, TCGReg *r2, TCGCond *c3) { @@ -222,6 +231,17 @@ static void tci_args_rrrc(const uint8_t **tb_ptr, } #if TCG_TARGET_REG_BITS == 32 +static void tci_args_rrrrcl(const uint8_t **tb_ptr, TCGReg *r0, TCGReg *r1, + TCGReg *r2, TCGReg *r3, TCGCond *c4, void **l5) +{ + *r0 = tci_read_r(tb_ptr); + *r1 = tci_read_r(tb_ptr); + *r2 = tci_read_r(tb_ptr); + *r3 = tci_read_r(tb_ptr); + *c4 = tci_read_b(tb_ptr); + *l5 = (void *)tci_read_label(tb_ptr); +} + static void tci_args_rrrrrc(const uint8_t **tb_ptr, TCGReg *r0, TCGReg *r1, TCGReg *r2, TCGReg *r3, TCGReg *r4, TCGCond *c5) { @@ -405,7 +425,6 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, tcg_target_ulong t0; tcg_target_ulong t1; tcg_target_ulong t2; - tcg_target_ulong label; TCGCond condition; target_ulong taddr; uint8_t tmp8; @@ -414,7 +433,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, uint64_t tmp64; #if TCG_TARGET_REG_BITS == 32 TCGReg r3, r4; - uint64_t v64, T1, T2; + uint64_t T1, T2; #endif TCGMemOpIdx oi; int32_t ofs; @@ -611,13 +630,10 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, break; #endif case INDEX_op_brcond_i32: - t0 = tci_read_rval(regs, &tb_ptr); - t1 = tci_read_rval(regs, &tb_ptr); - condition = *tb_ptr++; - label = tci_read_label(&tb_ptr); - if (tci_compare32(t0, t1, condition)) { + tci_args_rrcl(&tb_ptr, &r0, &r1, &condition, &ptr); + if (tci_compare32(regs[r0], regs[r1], condition)) { tci_assert(tb_ptr == old_code_ptr + op_size); - tb_ptr = (uint8_t *)label; + tb_ptr = ptr; continue; } break; @@ -637,13 +653,12 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, tci_write_reg64(regs, t1, t0, tmp64); break; case INDEX_op_brcond2_i32: - tmp64 = tci_read_r64(regs, &tb_ptr); - v64 = tci_read_r64(regs, &tb_ptr); - condition = *tb_ptr++; - label = tci_read_label(&tb_ptr); - if (tci_compare64(tmp64, v64, condition)) { + tci_args_rrrrcl(&tb_ptr, &r0, &r1, &r2, &r3, &condition, &ptr); + T1 = tci_uint64(regs[r1], regs[r0]); + T2 = tci_uint64(regs[r3], regs[r2]); + if (tci_compare64(T1, T2, condition)) { tci_assert(tb_ptr == old_code_ptr + op_size); - tb_ptr = (uint8_t *)label; + tb_ptr = ptr; continue; } break; @@ -783,13 +798,10 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, break; #endif case INDEX_op_brcond_i64: - t0 = tci_read_rval(regs, &tb_ptr); - t1 = tci_read_rval(regs, &tb_ptr); - condition = *tb_ptr++; - label = tci_read_label(&tb_ptr); - if (tci_compare64(t0, t1, condition)) { + tci_args_rrcl(&tb_ptr, &r0, &r1, &condition, &ptr); + if (tci_compare64(regs[r0], regs[r1], condition)) { tci_assert(tb_ptr == old_code_ptr + op_size); - tb_ptr = (uint8_t *)label; + tb_ptr = ptr; continue; } break; From patchwork Thu Feb 4 01:44:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376191 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp915551ejt; Wed, 3 Feb 2021 18:25:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJyKpsHBnt9NmouKYVPw9Uod48XqNMe0ERLfpRKCd53teZXc6RZ2NJ/mVgB4MFNp4M4MilPW X-Received: by 2002:a25:7658:: with SMTP id r85mr9271791ybc.271.1612405537254; Wed, 03 Feb 2021 18:25:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612405537; cv=none; d=google.com; s=arc-20160816; b=SRzArR/ON9v+VonAi66WNhAIoXFDfQg5cfUBl2SIsrlK6Oxoqi3D+cfVmzw/oXLdfS mEXL+0o8OipSXNTBcTwpE+QTmdn+J5Z9gGPsnGkxDk/tsbpXJhLTmjpJKrM5T+xkdazn 8brSoP1L5MeELUHLWgMPeIc97W2aCBkpKqBc/cAgarTTHzvmvhkBxuA0aEV0Q+g/MOjg /9BH+HTGnmvZfveV9ImxKi9oUaF1jHSqX+rz0+aIgqCYMjzhrmMg/0fkFi1MJlc/WNRk u1Yeq5OuzFFuQUje8i02q+vHUavJlgk+UgOcjCpg/TalijjR5MhJgwFkOlV5KApiSebj V0yw== 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=eSQe6U/PGZwTawoh3F37z3+OGlTxy4qNiRyYKdayrlc=; b=cclchSjSn8njMlDu550vNtscfFrRaPOTlqe4TW18nVFj0T6B5tmx8o3jUn1P+6zG/6 OPqEOMR2qi5YTwCd1WrQ8yKfSOYM+BC0ZMRKXhIa2gkwRKY+5q4T5R+GSG1MP34v49Cw /eCAqAyGfZWW/NPjUFbCKwuhjQXka21mzCBskTEyIGEeBsVPbe3M8pl26UHfDcUicrMk n4c2l+Vjwm/DV3O2gJwD2pursCjq3y1/dtrCYDfZZjzqJ4S9MCgciphFMCtOexPYPP3v eNl9QjEY2Oe88RR9qkUUvyWyiDNDABynfOpabB/IPz3cElGQ1j9ch356Jm6USvCEKsnn 9sJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YRgSjIFt; 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 t123si3990623ybf.107.2021.02.03.18.25.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:25:37 -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=YRgSjIFt; 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]:55642 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7UKu-0001BT-IE for patch@linaro.org; Wed, 03 Feb 2021 21:25:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45016) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7TjN-0005VN-J5 for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:49 -0500 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]:33431) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7TjI-00040L-VX for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:48 -0500 Received: by mail-pj1-x102b.google.com with SMTP id lw17so4251471pjb.0 for ; Wed, 03 Feb 2021 17:46:42 -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=eSQe6U/PGZwTawoh3F37z3+OGlTxy4qNiRyYKdayrlc=; b=YRgSjIFtqOYC9COao5LQz+NRV/bQHYsFyGVsElMFCX8WRlHoqeENVpeMgRB7HtrpGX 2H5VjZH9sDJRjvSsi5+Dk3LGXh++v70hitglIRtug4mvFitnCl02Xtj4ElxUECrOY/mw /y6aMX8Y1D8Ugzf42r+Ks43WsCqfBMcuz10fz5awsFci+f2TQhbTud2KU7jyk5yNjstt zLEHSH88ivBspTNanRfpuYyqPMBtNIEFXJXtucjEEtt/hNlZiltGXkzKtG9aaZLUIo/x 5FOsirPGkCDCnLYAWv7mkFFndDhpePO0HvybUMQsDtDcks4Aui+rdHo0TJ36Jz0I7qjI bC0w== 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=eSQe6U/PGZwTawoh3F37z3+OGlTxy4qNiRyYKdayrlc=; b=fleDV2OAKepqD6PDGAtAEl4yGo77U8y2hZe0/baCLT0oeaG0Lx9kOTHHzK7MALg8pl EUxWD1nPoj4ArgjfDlh0fIsLGFPxal5Z1Injyhz9qRSiWFMHoVsU1N4Z9rQxP5WsmI4l canuyvaw1S287s3/fYHgCxf9I+o1+WG409qdfIKGE8S25JDXqelHHLf13chRMeQ3e8+p HcZe2ALYgXOEfq312w8Ne7dF/X3qbhlSPTzCN8gUuGbgMTGh4bt3PARdPvCA2TCcpHyU FMr9EOEf7zMe7/6UZjEbt5csrfkReYtgohpG0yrsVMgiBAW2A9AzKVL8uqGBvhod44w+ aQMA== X-Gm-Message-State: AOAM532RM+BW7e+aypyGBIGk1TICmWrvMtV3k0XJzuygW0j5kfpv3cXv 68z5/ul9ft1mygdNgtRFzUlV1ujJrBN5LTA0 X-Received: by 2002:a17:90a:ce89:: with SMTP id g9mr5789092pju.42.1612403201943; Wed, 03 Feb 2021 17:46:41 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.46.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:46:41 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 50/93] tcg/tci: Split out tci_args_ri and tci_args_rI Date: Wed, 3 Feb 2021 15:44:26 -1000 Message-Id: <20210204014509.882821-51-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102b; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102b.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- tcg/tci.c | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index 1e2f78a9f9..5cc05fa554 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -121,16 +121,6 @@ static int32_t tci_read_s32(const uint8_t **tb_ptr) return value; } -#if TCG_TARGET_REG_BITS == 64 -/* Read constant (64 bit) from bytecode. */ -static uint64_t tci_read_i64(const uint8_t **tb_ptr) -{ - uint64_t value = *(const uint64_t *)(*tb_ptr); - *tb_ptr += sizeof(value); - return value; -} -#endif - /* Read indexed register (native size) from bytecode. */ static tcg_target_ulong tci_read_rval(const tcg_target_ulong *regs, const uint8_t **tb_ptr) @@ -180,6 +170,8 @@ static tcg_target_ulong tci_read_label(const uint8_t **tb_ptr) * tci_args_ * where arguments is a sequence of * + * i = immediate (uint32_t) + * I = immediate (tcg_target_ulong) * r = register * s = signed ldst offset */ @@ -196,6 +188,22 @@ static void tci_args_rr(const uint8_t **tb_ptr, *r1 = tci_read_r(tb_ptr); } +static void tci_args_ri(const uint8_t **tb_ptr, + TCGReg *r0, tcg_target_ulong *i1) +{ + *r0 = tci_read_r(tb_ptr); + *i1 = tci_read_i32(tb_ptr); +} + +#if TCG_TARGET_REG_BITS == 64 +static void tci_args_rI(const uint8_t **tb_ptr, + TCGReg *r0, tcg_target_ulong *i1) +{ + *r0 = tci_read_r(tb_ptr); + *i1 = tci_read_i(tb_ptr); +} +#endif + static void tci_args_rrr(const uint8_t **tb_ptr, TCGReg *r0, TCGReg *r1, TCGReg *r2) { @@ -498,9 +506,8 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, regs[r0] = regs[r1]; break; case INDEX_op_tci_movi_i32: - t0 = *tb_ptr++; - t1 = tci_read_i32(&tb_ptr); - tci_write_reg(regs, t0, t1); + tci_args_ri(&tb_ptr, &r0, &t1); + regs[r0] = t1; break; /* Load/store operations (32 bit). */ @@ -720,9 +727,8 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, #endif #if TCG_TARGET_REG_BITS == 64 case INDEX_op_tci_movi_i64: - t0 = *tb_ptr++; - t1 = tci_read_i64(&tb_ptr); - tci_write_reg(regs, t0, t1); + tci_args_rI(&tb_ptr, &r0, &t1); + regs[r0] = t1; break; /* Load/store operations (64 bit). */ From patchwork Thu Feb 4 01:44:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376193 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp915766ejt; Wed, 3 Feb 2021 18:26:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJxor7IVfRi0PvHfesO9kACaN2Drlhj7iHtHBaDnk05bTJXslftOp4ysId+UZlKfXQz3oQe9 X-Received: by 2002:a25:bfd2:: with SMTP id q18mr8762531ybm.116.1612405568688; Wed, 03 Feb 2021 18:26:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612405568; cv=none; d=google.com; s=arc-20160816; b=yhm+lHEbFC5dMwoVenNqj2vNaIno1RoEOGju7eTwbsJJP7duCI0iZ3y7TbungJ99Kj v/8SL5rLyjcwOZanJa9DxMbgMbnA3ScmW3cvP0fOdNrlVAR46xcNWGrJKkFwuMAQPDPP rmm8GYIl/vRNrnqX3fPuPv8oSbr+mcXR/bLEyTiuGAWKeOZ+iTVK33VRwn4u8RS1ycRG 8VYxa6jzaxUwrHXh7ih/niLWZba4R86/WV04mzYwKjZU6LuRfycPClSLMBsceUKdLI89 74tEYSB5adWiBaPQuIuxMK6kRNlcWJWGTGSobo6FXZlmMGrrBs6tDL/NJcrexUG8Tzaf bJ/w== 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=i+UfUeTWFJ5sSlDyvmwmN/rqHNhQrzPFRwjNfVSoaYw=; b=mqaeIQ4/XETnPfwA9OU8yuv0PHS8dFjunkfVGafJIHt0eGwlhdCW45f47PJFOQ/gbB NfGWx6L0dfPSuNBqV8OWbrQU8ZHEupDIMPGyjQ2GvNAg/8P1Ex8s+ZDNgn9PbniKq1s3 8HmbndwVKP2wArS6qNNcJSTeQSKXu01rh9164QHs86nNemjxmnozhWmFQl4/6aPKx227 ohD7Rhn2TEWdQC9KgQMDWaQRRjIav/zwI0nGl9J3Sbw6gbvzEBxUDl1zyosGPofgbgeL Kw22jxdgz2sAQDv3TBA8sojHfbiHFkUcFOHSF2jDTqnMz1TttMnBoLrUSuNhgwCLKXiz amjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Z1AJygRC; 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 m66si3610411ybb.375.2021.02.03.18.26.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:26:08 -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=Z1AJygRC; 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]:56134 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7ULQ-0001NS-3c for patch@linaro.org; Wed, 03 Feb 2021 21:26:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45026) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7TjN-0005WG-Tq for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:49 -0500 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]:34566) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7TjJ-00040b-1l for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:49 -0500 Received: by mail-pl1-x630.google.com with SMTP id u15so904873plf.1 for ; Wed, 03 Feb 2021 17:46:44 -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=i+UfUeTWFJ5sSlDyvmwmN/rqHNhQrzPFRwjNfVSoaYw=; b=Z1AJygRCzzkDiuFD91cuO5BeHc8sRMeodW0JJ/c1QgGL4er58kxwmGV8un6+A6w3bP FWJHs4LU0GCsubebVrvzik6QvADmpANJaj9HW6KJJPnWkXZaC/+AS6kvhSU1glf4rdX6 PhbPWCnwrE4miQNgPHpMrDGac2i2Ee2pQ7PEYYTXVgjFtl0vkT6GMbzW+Owz3y89orKI gtvjxOfN8N1ZyjUY5vl+gD8WAHT0g0x8ql2WeOYf0QkiM+O6RXIoOaVfMNzw6Mh8cKF4 DFLPoLd4hPYrMQ7JebUpoH/YnVq3a3xzPOIDuT8MJFx6Msuplh9Z36Z6OW/4Uu/9mMe9 2b2g== 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=i+UfUeTWFJ5sSlDyvmwmN/rqHNhQrzPFRwjNfVSoaYw=; b=CJgohCt/4MkmKtdFcbgZEKl8mZBeR+RyGvvvflW7YvqR/zrqigs6faQHx15uLTA4ft S+DVyGNZx8V+Y18kkGk4wbGK+70BL9tAXEFL7HZxK5oaAtJKTWm7qNoqUdijnxlMNhp+ 1AHaKCELGUHZDMCXrTDgeTSvHx6dibtn/qhPC1Rps6cElUY+8gE3KrupPqr69H+7rglf 2VcsxHbEitNoPn2uAyrZNAIdqFTB3LhEUBd0/G6JxBqtueDloIeo2GLKJX8qfqJl/g/T m700H+ykxKt7JlYGmBa0KhYisG1fwylSQhPdMvw1R3SRFcKohr4h1fLoq1mlO6DpBSb9 TW8Q== X-Gm-Message-State: AOAM530wJP8geeGK6hJ7Ku8CzxsgQdpAa+q/LRn0yyV6wUEzKPyZ5Mp+ XMi9zVAlNJejPTi9zrCidmPypGNLahSF64pJ X-Received: by 2002:a17:90a:43a7:: with SMTP id r36mr6031847pjg.189.1612403203505; Wed, 03 Feb 2021 17:46:43 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.46.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:46:42 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 51/93] tcg/tci: Reuse tci_args_l for calls. Date: Wed, 3 Feb 2021 15:44:27 -1000 Message-Id: <20210204014509.882821-52-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x630.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- tcg/tci.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index 5cc05fa554..92b13829c3 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -452,30 +452,30 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, switch (opc) { case INDEX_op_call: - t0 = tci_read_i(&tb_ptr); + tci_args_l(&tb_ptr, &ptr); tci_tb_ptr = (uintptr_t)tb_ptr; #if TCG_TARGET_REG_BITS == 32 - tmp64 = ((helper_function)t0)(tci_read_reg(regs, TCG_REG_R0), - tci_read_reg(regs, TCG_REG_R1), - tci_read_reg(regs, TCG_REG_R2), - tci_read_reg(regs, TCG_REG_R3), - tci_read_reg(regs, TCG_REG_R4), - tci_read_reg(regs, TCG_REG_R5), - tci_read_reg(regs, TCG_REG_R6), - tci_read_reg(regs, TCG_REG_R7), - tci_read_reg(regs, TCG_REG_R8), - tci_read_reg(regs, TCG_REG_R9), - tci_read_reg(regs, TCG_REG_R10), - tci_read_reg(regs, TCG_REG_R11)); + tmp64 = ((helper_function)ptr)(tci_read_reg(regs, TCG_REG_R0), + tci_read_reg(regs, TCG_REG_R1), + tci_read_reg(regs, TCG_REG_R2), + tci_read_reg(regs, TCG_REG_R3), + tci_read_reg(regs, TCG_REG_R4), + tci_read_reg(regs, TCG_REG_R5), + tci_read_reg(regs, TCG_REG_R6), + tci_read_reg(regs, TCG_REG_R7), + tci_read_reg(regs, TCG_REG_R8), + tci_read_reg(regs, TCG_REG_R9), + tci_read_reg(regs, TCG_REG_R10), + tci_read_reg(regs, TCG_REG_R11)); tci_write_reg(regs, TCG_REG_R0, tmp64); tci_write_reg(regs, TCG_REG_R1, tmp64 >> 32); #else - tmp64 = ((helper_function)t0)(tci_read_reg(regs, TCG_REG_R0), - tci_read_reg(regs, TCG_REG_R1), - tci_read_reg(regs, TCG_REG_R2), - tci_read_reg(regs, TCG_REG_R3), - tci_read_reg(regs, TCG_REG_R4), - tci_read_reg(regs, TCG_REG_R5)); + tmp64 = ((helper_function)ptr)(tci_read_reg(regs, TCG_REG_R0), + tci_read_reg(regs, TCG_REG_R1), + tci_read_reg(regs, TCG_REG_R2), + tci_read_reg(regs, TCG_REG_R3), + tci_read_reg(regs, TCG_REG_R4), + tci_read_reg(regs, TCG_REG_R5)); tci_write_reg(regs, TCG_REG_R0, tmp64); #endif break; From patchwork Thu Feb 4 01:44:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376195 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp916435ejt; Wed, 3 Feb 2021 18:27:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJzdnxyz5eiloAJZiqGffk4/tqSM7XVE4btQzlu9h/LS9ct2q8yqLtoDFved0IG4nHhZovHn X-Received: by 2002:a25:2693:: with SMTP id m141mr9009879ybm.104.1612405646891; Wed, 03 Feb 2021 18:27:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612405646; cv=none; d=google.com; s=arc-20160816; b=Ko1BXNmxW2bTDaC+j/ClvYHdTso/gvQml9u1qhRaHzgl8WTClYearnjYti2ipeVUEN o7bC49v1kkYIavbgf3XFlmAjglI8Sx6rLoTxLOLulxFaV2+LLl8gbwOGYwDjlbDQxWXH RyzSqVacvnYpzczRvblChlgfcOe6UbgHVgdPyB5Zk8qBDsyK8VWDSgLwU06eVIR3StEJ 84b/zPbn+PM8wd6B2fUcSOdDs0NTKYL8f1ivkQf87r7ZTFBrjrHwvrjzAkWvNaTooPfa SMxCMGSgXYOTfLGzS+AJQW31Ag22KluMLYiVg1ol6EqeSgxOed9eQBgbpdN+v3nVtTpA 2lnw== 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=SiXlz8iU8i8mL6XFtS7HcVMO8xC61iquHDNUAoO7sPU=; b=PokkCqtj/3BdJLHhAA9GX+eNGCtGnhBLvD4iZly60GqNeqfGIN574Wf9KctHunXGvu 6ditf2F4ix9ZrAsmDixiIeXE27yhq24hwJ6GkkYrRYqDTZt5P8EFmBlVo2tENXkn08aa GbYUG3qTjy2HpeZk6uQ9hf8FCFw2/MxvwFLVkZWWA+BCu6V8QdPkZ1HFxL3WSwc//rpU HyRoaht9Vu6KtgcCk8sLPyyE53rS7XIKG1ygRH+YCljVFcIps6azPzJ/WvL1nALkAD4v eonruNt3VRg6bcjeLG6P5596zAPZzlPkwQ6nVI/yttuLkTsUQusYrW0JpsGN/QtvHbdS DZ5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hiG+dztc; 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 l195si4145102ybf.109.2021.02.03.18.27.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:27:26 -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=hiG+dztc; 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]:60274 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7UMg-0003C4-9z for patch@linaro.org; Wed, 03 Feb 2021 21:27:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45038) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7TjO-0005Y4-Gb for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:50 -0500 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]:46449) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7TjK-00041S-OM for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:50 -0500 Received: by mail-pg1-x532.google.com with SMTP id r38so1003416pgk.13 for ; Wed, 03 Feb 2021 17:46:46 -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=SiXlz8iU8i8mL6XFtS7HcVMO8xC61iquHDNUAoO7sPU=; b=hiG+dztcIn9Nhpj83I3qjdwExxUgw9sdDINPStrgmg15gZtHqnfLIHnIm/QDm8Frir 6DpY82HCGtCXTomQ0lcn8hsjI6ut+cTgSqkByBHsUwi/TbYI22dK/HjcG8dOYnTmVjgU B0Unm/IYlhvTc+16DRGds0ZSfTUtUWXzlK4QLiPSy1mDdn+hf41oGX9ivtRftO1e+cjx Pp+iL7nhcnAXs7EPm/SEWSs3B9MJzk6o0Xl4BN5C1LsKZOem1pqgDAZIkwpgicB9RNcK nAzkPME/LMJDB3z6uXFSoSadXw+ZIvRrpx62tsF1jPYPCJPbdXwg9pApoRoCgbfiaZ9d 46Ow== 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=SiXlz8iU8i8mL6XFtS7HcVMO8xC61iquHDNUAoO7sPU=; b=UAEaKjtYIRLAy8lIzJOQ/K5BahiNoF5FLTmS5exY0TNds8e9jn+VJu8KmPkSDX6hDI 3ZPmAY5dZKnYiE5Xr0nXT/ZkUZOR1HuUQM45W8n/WydDs2PvG5llgmLZUpcKak9PIWac u/+l8M6eJMmQ0LqdL49t5nNR/guUAcS6v5VQNYTfzYY7oBbYTANsVFLt3tUSbBNEEajl 5KFqI+FCMQA63RfRypxawezSClNTTMXVeWwc4T+tAfmHZp1/9ZhUUetpfszGby5rPilY IeFiPTwGlgRYLl9MM+80LeK1cvV71S6XDv9rvl98UDDA0Xj/5hJy/XV09eEQdxWIdO64 7X1w== X-Gm-Message-State: AOAM530pLaSVkqtRpjFHIE8HYCyfJMgNJiGhu44dwHM5yM7ErdQUzZfN D2bksxfMscs18b6ueyoR9QjHEilKZ04EUIIX X-Received: by 2002:a65:44c5:: with SMTP id g5mr6641718pgs.295.1612403205478; Wed, 03 Feb 2021 17:46:45 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.46.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:46:44 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 52/93] tcg/tci: Reuse tci_args_l for exit_tb Date: Wed, 3 Feb 2021 15:44:28 -1000 Message-Id: <20210204014509.882821-53-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::532; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x532.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Do not emit a uint64_t, but a tcg_target_ulong, aka uintptr_t. This reduces the size of the constant on 32-bit hosts. The assert for label != NULL has to be removed because that is a valid value for exit_tb. Signed-off-by: Richard Henderson --- tcg/tci.c | 13 ++++--------- tcg/tci/tcg-target.c.inc | 2 +- 2 files changed, 5 insertions(+), 10 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index 92b13829c3..57b6defe09 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -160,9 +160,7 @@ tci_read_ulong(const tcg_target_ulong *regs, const uint8_t **tb_ptr) static tcg_target_ulong tci_read_label(const uint8_t **tb_ptr) { - tcg_target_ulong label = tci_read_i(tb_ptr); - tci_assert(label != 0); - return label; + return tci_read_i(tb_ptr); } /* @@ -417,7 +415,6 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, tcg_target_ulong regs[TCG_TARGET_NB_REGS]; long tcg_temps[CPU_TEMP_BUF_NLONGS]; uintptr_t sp_value = (uintptr_t)(tcg_temps + CPU_TEMP_BUF_NLONGS); - uintptr_t ret = 0; regs[TCG_AREG0] = (tcg_target_ulong)env; regs[TCG_REG_CALL_STACK] = sp_value; @@ -832,9 +829,9 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, /* QEMU specific operations. */ case INDEX_op_exit_tb: - ret = *(uint64_t *)tb_ptr; - goto exit; - break; + tci_args_l(&tb_ptr, &ptr); + return (uintptr_t)ptr; + case INDEX_op_goto_tb: /* Jump address is aligned */ tb_ptr = QEMU_ALIGN_PTR_UP(tb_ptr, 4); @@ -992,6 +989,4 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, } tci_assert(tb_ptr == old_code_ptr + op_size); } -exit: - return ret; } diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index c79f9c32d8..ff8040510f 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -401,7 +401,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, switch (opc) { case INDEX_op_exit_tb: - tcg_out64(s, args[0]); + tcg_out_i(s, args[0]); break; case INDEX_op_goto_tb: From patchwork Thu Feb 4 01:44:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376197 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp857009jah; Wed, 3 Feb 2021 18:31:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJy9W2DGul1T6a1RN60gpKssuVv9ucQ5bAWPgUNjnMnteGv0N4zGhiiZQk7indoTc8BGwvz3 X-Received: by 2002:a25:ba08:: with SMTP id t8mr8782938ybg.316.1612405881350; Wed, 03 Feb 2021 18:31:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612405881; cv=none; d=google.com; s=arc-20160816; b=k56TL5a/v9XfQVR/evF37uTgFoy0UpjIU/zwhzh2ZNCp6Ho1XWtL4txXj9w7an3JEc Z0m2gsxekogcLT3ZD1fNGxOYdMiPM7HL/7TvE2G3FDgkUuqOf9wWokQ0rAhpfEB9o+tT KLwhx1gU94sr8AGEhMec5EQKPKCt9R+zszUTGJZGJoC/pKiIgnEhQAupyllvVcCJjjcH iRDi4bHPwo4oAaAmpGNN/2lxfZUZAnazjUfyJqRP0H3gnNiUEiatbmL4IrnqwFlMTpML 3CDIDB/tv/yO+tzocdmml/bbpajV68TRu3m7Z3IZCODX1Ek+QzOBNff0/sFkio9u6Wxg TYrA== 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=1LT2MbDB8DSsnJ6nk4ZYA0KuSI+0ipd9FJnZcTxjPRQ=; b=sZv0CwZ9iNsX04EZH4Sqd2xxn+oTWmRulxGvGtt8hmHjeo+rdZ8DLHRTGDvIp8v1V7 MaWmUG6vSeak5P3MgPC4xLgLC96OtEO/EgMeesPU1KojjuYM5A2AGGdD9ytiAWuHjGzl 73CpJZiV/btC2BWg9dFK1Mxt1saeDHST4Lz5xju/bWOBAGoErk8wjeL4oRqIPNXt2n8p j6QQtnAo+3DuCRjmlwyGrjw8joU//ScvzTU4yjhMBE2FpzpdBg4jKJyfZG5NufRqpWrQ YX4oWTzDAmUmQa/d7z4KpaBvBXjpGQDAYcA3gNloQ2pWpOgOOkwjWn1dbnWnJJxc4Inh yqEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="HbGV/3iK"; 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 t11si3998708ybp.365.2021.02.03.18.31.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:31:21 -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="HbGV/3iK"; 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]:40416 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7UQS-0006v2-P1 for patch@linaro.org; Wed, 03 Feb 2021 21:31:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45044) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7TjO-0005YZ-OV for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:50 -0500 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]:46286) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7TjM-00041z-4L for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:50 -0500 Received: by mail-pl1-x636.google.com with SMTP id u11so865709plg.13 for ; Wed, 03 Feb 2021 17:46:47 -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=1LT2MbDB8DSsnJ6nk4ZYA0KuSI+0ipd9FJnZcTxjPRQ=; b=HbGV/3iKFDtFAmLUS7tlS7c69oaaLBT8pIaNn1nBNJL0beoC+AVcadAEgHwKl3pfjt wE3I8W0A9FscBLk8Zx61TVnOHXTI70gE4aWcax7OfWZzzJjgGlVmELkCGTV89NWQ5VYR NyCc8M0o6Wmqxctr/JyNaI3h7RJuch3CJT31bc0IkLsEcRGdSU7Gvq4yH6g238FV2Ajs 6mm+nOIjFo0GLqmGkThq92xFnkgzf1m+o5SmxbMPfq0XN4YOyj7r03SuDg55Ltz74sZA vQOT29h3lOsxGGJvdUG24zplL18P6oWycd1t9sKyLqwR8VmpgEvcZhc+mKDJ2Yin/uZr 4Gfg== 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=1LT2MbDB8DSsnJ6nk4ZYA0KuSI+0ipd9FJnZcTxjPRQ=; b=hKw42rs64W0Zs1XY5RX3TTATTVJ0ngw1xXsrhEQJN+AHos1Z888dkzGdS/95D9QQx2 g7bFVISF9UMF1mlmWR3YUXByBlEBFaLVbB0EtFsZ6nR0qN8yL9kj2kJmludZXQCa1OSi ipxW1RAarvZlMKlIPgxdQZDnffD3x+SUTFHVAU4hORDcPGh7++skGvRZlnPfRUW0u6Qr mrIqOf2LAfSkbakq1ZQhMehMdNEbVwDltDatz1hA2bOGlrlViwvY6K7yE63gLP+TA8YA oY6aPRcg1KRZaiN/pVggwjjnUSzV3P+ZEHDm8jM4SO3smArhjixPcES3SER7V3UCnglt 048A== X-Gm-Message-State: AOAM530FjkCwuAjK9aZdGverxOFzFpGJW5+0+Nqnq7fueGXgNO3KXwk3 rzgjmRiDFuBvWKkXcU9ZNi5yHZHi14c+NAb7 X-Received: by 2002:a17:902:c942:b029:de:abac:f9c4 with SMTP id i2-20020a170902c942b02900deabacf9c4mr5582718pla.30.1612403206915; Wed, 03 Feb 2021 17:46:46 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.46.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:46:46 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 53/93] tcg/tci: Reuse tci_args_l for goto_tb Date: Wed, 3 Feb 2021 15:44:29 -1000 Message-Id: <20210204014509.882821-54-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::636; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x636.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Convert to indirect jumps, as it's less complicated. Then we just have a pointer to the tb address at which the chain is stored, from which we read. Signed-off-by: Richard Henderson --- tcg/tci/tcg-target.h | 11 +++-------- tcg/tci.c | 8 +++----- tcg/tci/tcg-target.c.inc | 13 +++---------- 3 files changed, 9 insertions(+), 23 deletions(-) -- 2.25.1 diff --git a/tcg/tci/tcg-target.h b/tcg/tci/tcg-target.h index 9c0021a26f..9285c930a2 100644 --- a/tcg/tci/tcg-target.h +++ b/tcg/tci/tcg-target.h @@ -87,7 +87,7 @@ #define TCG_TARGET_HAS_muluh_i32 0 #define TCG_TARGET_HAS_mulsh_i32 0 #define TCG_TARGET_HAS_goto_ptr 0 -#define TCG_TARGET_HAS_direct_jump 1 +#define TCG_TARGET_HAS_direct_jump 0 #define TCG_TARGET_HAS_qemu_st8_i32 0 #if TCG_TARGET_REG_BITS == 64 @@ -174,12 +174,7 @@ void tci_disas(uint8_t opc); #define TCG_TARGET_HAS_MEMORY_BSWAP 1 -static inline void tb_target_set_jmp_target(uintptr_t tc_ptr, uintptr_t jmp_rx, - uintptr_t jmp_rw, uintptr_t addr) -{ - /* patch the branch destination */ - qatomic_set((int32_t *)jmp_rw, addr - (jmp_rx + 4)); - /* no need to flush icache explicitly */ -} +/* not defined -- call should be eliminated at compile time */ +void tb_target_set_jmp_target(uintptr_t, uintptr_t, uintptr_t, uintptr_t); #endif /* TCG_TARGET_H */ diff --git a/tcg/tci.c b/tcg/tci.c index 57b6defe09..0301ee63a7 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -833,13 +833,11 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, return (uintptr_t)ptr; case INDEX_op_goto_tb: - /* Jump address is aligned */ - tb_ptr = QEMU_ALIGN_PTR_UP(tb_ptr, 4); - t0 = qatomic_read((int32_t *)tb_ptr); - tb_ptr += sizeof(int32_t); + tci_args_l(&tb_ptr, &ptr); tci_assert(tb_ptr == old_code_ptr + op_size); - tb_ptr += (int32_t)t0; + tb_ptr = *(void **)ptr; continue; + case INDEX_op_qemu_ld_i32: t0 = *tb_ptr++; taddr = tci_read_ulong(regs, &tb_ptr); diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index ff8040510f..2c64b4f617 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -405,16 +405,9 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, break; case INDEX_op_goto_tb: - if (s->tb_jmp_insn_offset) { - /* Direct jump method. */ - /* Align for atomic patching and thread safety */ - s->code_ptr = QEMU_ALIGN_PTR_UP(s->code_ptr, 4); - s->tb_jmp_insn_offset[args[0]] = tcg_current_code_size(s); - tcg_out32(s, 0); - } else { - /* Indirect jump method. */ - TODO(); - } + tcg_debug_assert(s->tb_jmp_insn_offset == 0); + /* indirect jump method. */ + tcg_out_i(s, (uintptr_t)(s->tb_jmp_target_addr + args[0])); set_jmp_reset_offset(s, args[0]); break; From patchwork Thu Feb 4 01:44:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376196 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp856137jah; Wed, 3 Feb 2021 18:29:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJwroEwxH2+M09u3axmKYrTUckdHhZdQCJjOWDguRXd5NGwPQ5dbpiMu0PnZrMtxXsxMVEer X-Received: by 2002:a25:ab2b:: with SMTP id u40mr7562684ybi.336.1612405775218; Wed, 03 Feb 2021 18:29:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612405775; cv=none; d=google.com; s=arc-20160816; b=AGA351Ryf9UJuNbu/F3OmiEqLTwC9CBlZAvPb+avBf1gAXXl69pdYkUy0aAwD/13BH iyv8vol9Og9dQBiEhahnT3vp7t8dMSc6MaYBJ5G3e0VN0U5tEIhOvADKWOw7GFSoib+3 hacCkJsBQgi9r2IwPs/icqxIbs5fqwutmhXi+aqukFupHwuB4PgVag5IBfuuLSvW0NUi 2Scj4KNMiw7DyGoupzID+JesDcNDmmToS+S80DxVnPy4V5jsSdKmzEOO+UPRB6c0Zy17 qSUgjA7wPx8iIlxn4v/tCuOL7AQ07Gfp6XxHIdSosHpRC2pVenkU962HPI95Yzpt6nel wG+g== 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=CAFEcBhH5Bm/1S+hn6Be2S25m9MyX50Fw2Tvsr0CL7s=; b=TZrVMki7+Eo43tFmjclgxXp9tV9/tdMLzHV7DbWviC+Z/SP+TyzCXjXIvfmRUAnoVj lPdoDniznRNfAB28eWcENluGx7PDf3YM5lwchJMT2LKAsy8VEYbew3DGrmC9VYdN9UBk bGch5MhJzfIHM8kl8Gp4IvqpCqcnuZCLx18L1VkVQmpdGO1lIH1aWQ7ZjjG7WXILbks3 PvJ8iKBAdMbDuNjwk5P+WbWqM73uyJeTD1ZrCqcg9vQZYSIHCfbVjFz0yNen2IgoXLvA kGnOUkMW1//TlN1YJiNOfn7q04pUGs71FRr9GS6anXqjJw4F5ZmjoXae7WLMA0nmRUc3 jBHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vRfRRsIU; 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 q4si4459313ybc.225.2021.02.03.18.29.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:29:35 -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=vRfRRsIU; 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]:36266 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7UOk-00053x-1u for patch@linaro.org; Wed, 03 Feb 2021 21:29:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45048) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7TjP-0005aA-H7 for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:52 -0500 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]:43882) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7TjN-00042D-P7 for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:51 -0500 Received: by mail-pl1-x632.google.com with SMTP id 8so873960plc.10 for ; Wed, 03 Feb 2021 17:46:49 -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=CAFEcBhH5Bm/1S+hn6Be2S25m9MyX50Fw2Tvsr0CL7s=; b=vRfRRsIUon+0UU2dXlgzfAEjFgukXsHoKg4a+hTih4VUa3QM7Fdx2xhumbcbVXJ/9B 5nFiJjEjgVjp+4UwCnebniGWuDT4DT7TG+eDUYATrIfrmo18KiK3oVouddt9z93DzVzN SfIZQ40GLlS31cl8cIF3fs3kEw3ari/tbCoN7oZbvkjcS9Ifo280g7S1MxwKDm+s5JMT +jRK33h58hWb3Cjaliztvnjhc/g6Oor0A4txb8rSTIRsJLQy8arOEnp9now1uFhDqGF0 u3wlist0uix5z7wNJv/VwvNvhWrJoZo9/38eyEWKj0GUcxyX2t7/T31mPg575n69XxkE J9YA== 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=CAFEcBhH5Bm/1S+hn6Be2S25m9MyX50Fw2Tvsr0CL7s=; b=pCzJ1upqPCwcBFY/yv67OZ34HhO/iaTbm3vXM9ydxn3F/H8/ZSH1NrgNXrXTOz3ArH MpLtVVCyUolhn9kfYwPbzBw34dQxkHX5IsMJj81v8qsCb9wLhzxKhP3DX+UCGgmBSvoL w8pcBluNABi5TA9TIdS6AvfV5eKDodRZE93xKB6EbvqDqtUqc2KYRkVXDCSWbHGa1Trq UImpDk4K3aTvC/OgQoK+k86H3wqWI8Lfa5xhg3F4YjPxlSXwl8W3Iy6QR0vlNDaDDMt7 sZKi4+RvX6y3yCWru9lvMew0C9gXDyCQ5fWynTWGzYZDBQ7IOzeXmBc3oLdvFFshi2N3 sBxw== X-Gm-Message-State: AOAM5318WDbsCCY5pDkGDig8ZwfSO0tJgfYd7m29xxKU3mGUmR4LJf4s q/HF1UbbGvn30mFdKS6HDXfkyvv9vAoQlfNU X-Received: by 2002:a17:90a:8d13:: with SMTP id c19mr6080617pjo.179.1612403208515; Wed, 03 Feb 2021 17:46:48 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.46.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:46:47 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 54/93] tcg/tci: Split out tci_args_rrrrrr Date: Wed, 3 Feb 2021 15:44:30 -1000 Message-Id: <20210204014509.882821-55-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x632.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- tcg/tci.c | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index 0301ee63a7..84d77855ee 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -258,6 +258,17 @@ static void tci_args_rrrrrc(const uint8_t **tb_ptr, TCGReg *r0, TCGReg *r1, *r4 = tci_read_r(tb_ptr); *c5 = tci_read_b(tb_ptr); } + +static void tci_args_rrrrrr(const uint8_t **tb_ptr, TCGReg *r0, TCGReg *r1, + TCGReg *r2, TCGReg *r3, TCGReg *r4, TCGReg *r5) +{ + *r0 = tci_read_r(tb_ptr); + *r1 = tci_read_r(tb_ptr); + *r2 = tci_read_r(tb_ptr); + *r3 = tci_read_r(tb_ptr); + *r4 = tci_read_r(tb_ptr); + *r5 = tci_read_r(tb_ptr); +} #endif static bool tci_compare32(uint32_t u0, uint32_t u1, TCGCond condition) @@ -437,7 +448,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, uint32_t tmp32; uint64_t tmp64; #if TCG_TARGET_REG_BITS == 32 - TCGReg r3, r4; + TCGReg r3, r4, r5; uint64_t T1, T2; #endif TCGMemOpIdx oi; @@ -643,18 +654,16 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, break; #if TCG_TARGET_REG_BITS == 32 case INDEX_op_add2_i32: - t0 = *tb_ptr++; - t1 = *tb_ptr++; - tmp64 = tci_read_r64(regs, &tb_ptr); - tmp64 += tci_read_r64(regs, &tb_ptr); - tci_write_reg64(regs, t1, t0, tmp64); + tci_args_rrrrrr(&tb_ptr, &r0, &r1, &r2, &r3, &r4, &r5); + T1 = tci_uint64(regs[r3], regs[r2]); + T2 = tci_uint64(regs[r5], regs[r4]); + tci_write_reg64(regs, r1, r0, T1 + T2); break; case INDEX_op_sub2_i32: - t0 = *tb_ptr++; - t1 = *tb_ptr++; - tmp64 = tci_read_r64(regs, &tb_ptr); - tmp64 -= tci_read_r64(regs, &tb_ptr); - tci_write_reg64(regs, t1, t0, tmp64); + tci_args_rrrrrr(&tb_ptr, &r0, &r1, &r2, &r3, &r4, &r5); + T1 = tci_uint64(regs[r3], regs[r2]); + T2 = tci_uint64(regs[r5], regs[r4]); + tci_write_reg64(regs, r1, r0, T1 - T2); break; case INDEX_op_brcond2_i32: tci_args_rrrrcl(&tb_ptr, &r0, &r1, &r2, &r3, &condition, &ptr); From patchwork Thu Feb 4 01:44:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376202 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp858609jah; Wed, 3 Feb 2021 18:34:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJxWUCxPiNS0iWB3W2Lq9Q8E5N4wcD0OdgR5xBaLqx1ipjLyRhIhCU6KEX6lgh1E8mhlIl+6 X-Received: by 2002:a25:83d0:: with SMTP id v16mr9863099ybm.40.1612406088260; Wed, 03 Feb 2021 18:34:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612406088; cv=none; d=google.com; s=arc-20160816; b=ZPZ8wVsfckvO5Je6m51E+eo+mlqJ8+hur4OgWGlv0N8S7OvYhzejQm8+mavLOyChmE /Gb+r36uXmPTjvbU0Z7iak+u5HO7lnLMAiXx6bZrXgCrYDMReZqxZWOD5Yy2uu52GhsD TL4DIOBUVa1rDrnz7bioyzXH+rOFAECni4tOhqULbZa7SELeRGWHonfbhc/taUfbj1bN JGjsa5/tvGjhRMpO0T6pzt4/fgJ0Z4EYjip8I+PztaEZyzTDQdKnsgX/CDiA5qOwXCrc pAdyn5kB1vQ0bRrq5LRXsN3pSA3bN55C2lCxJVPUQ8dDI+kqt6hyh1M7dG8jt0Ihs9wx l6uQ== 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=nLwOsyO0LIePZbanFLMg77EMdmZd3QPy/SBwJ8JDkus=; b=faQEOWkrexwmyQSBuLUQhn1Lzwu8VN30wFMSaYFn3prSyA2OdTGOaB9cnDgwwMJWCL raDOGEPp2oVqxdFBtoSQ54J6gUBVQCR0hEa5yOMVkVHgeUZM+GjFwkgZl5zdyfn91i9C +FOM4lhTuooAMiko+UQjPFVtq1M7FOODgOweCk2RZmLXnJLo1aqZm44QMTS95V/vM+pO dzgbOnET1H2KYHU1j/mg+ATO0Sg4iVfvkTvUMueMHN8lUZKtEnvWf0OL/fJkArI5PWVP D49cSHbNWibQsWDczkLwh8aiHcX6qm6b+d1YMFMoFwVSrZj4dXujFIAvHvKM81JcbBCp BQNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=l9WN+zAT; 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 b71si3589139yba.35.2021.02.03.18.34.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:34:48 -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=l9WN+zAT; 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]:52648 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7UTn-0003Ze-Mk for patch@linaro.org; Wed, 03 Feb 2021 21:34:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45064) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7TjR-0005be-10 for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:53 -0500 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]:34193) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7TjP-00043J-Ei for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:52 -0500 Received: by mail-pg1-x533.google.com with SMTP id o7so1053830pgl.1 for ; Wed, 03 Feb 2021 17:46:50 -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=nLwOsyO0LIePZbanFLMg77EMdmZd3QPy/SBwJ8JDkus=; b=l9WN+zATzNqEXOczx5DUp3oVFvdvWDLnJi276EF1NJO2nJmCpj5wsybeSFLv3r31hD 9MJBobsz9Hk1c71/tZHqXwHpM6hESMQkk33MWtOfMj6M15T0fl+TzQfnGMY9P9JbK5D+ 1v3GYzIM6YB19lfotDykflEnNyPToqK1x/F8y3G7Pp/fXvzPWGrTwPIGjI7aPmWrphPY VO0uMlNuUte91xhNiXFtCZsz1Y3Xy+pEMevjEca2e91lyfVNtoS/TOdtHLwr7ayhBjgc TytFi+ul2p4kZlo5NTnL50733l+tsjX5uJLqH8oXC1uRyQbHjJDNemAOJqSLiGAVBT2z xNDg== 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=nLwOsyO0LIePZbanFLMg77EMdmZd3QPy/SBwJ8JDkus=; b=VCkXe38gO/O5DiO6CJGnqVH2zdsrxPklkZm7iC4MQKQHTbxUF77pz9Q9N7CfknZAq0 ZXzDuw3NH6rQaaoLcYShaedmJ6IqUn3qPSF351Cb7yD23tuxaXZtLS2eZm/7C2i6tZnZ M6StohsIzd7XfVuNZjGoagGliMgfBhl2cPYdvfLyNXlJVNlAgO/TkpZTKur70FL4oAQm w8uwvu2WJS1A2tiSxoMvf+TWwQ66twPbkVBOFly3BbtbKNBC2kJX91X22gQ8Onjp+c9k WenvP0R6THbKzuOcutvmd8IPL+wb9hLbv+/gkvMGkif0izNAgrzizE9FkYwNjbCgo0lb fBMQ== X-Gm-Message-State: AOAM5331/Ttjf+CF3dAhNH9S+WbfQvkdmbj7+TUWYGhqHWyRKiibYWlw TwOK9SkcHA4ezv2UsHi93lzzpdpYK+ECfOXl X-Received: by 2002:a62:484:0:b029:1b7:878b:c170 with SMTP id 126-20020a6204840000b02901b7878bc170mr5701593pfe.28.1612403210161; Wed, 03 Feb 2021 17:46:50 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.46.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:46:49 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 55/93] tcg/tci: Split out tci_args_rrrr Date: Wed, 3 Feb 2021 15:44:31 -1000 Message-Id: <20210204014509.882821-56-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::533; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x533.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- tcg/tci.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index 84d77855ee..cb24295cd9 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -237,6 +237,15 @@ static void tci_args_rrrc(const uint8_t **tb_ptr, } #if TCG_TARGET_REG_BITS == 32 +static void tci_args_rrrr(const uint8_t **tb_ptr, + TCGReg *r0, TCGReg *r1, TCGReg *r2, TCGReg *r3) +{ + *r0 = tci_read_r(tb_ptr); + *r1 = tci_read_r(tb_ptr); + *r2 = tci_read_r(tb_ptr); + *r3 = tci_read_r(tb_ptr); +} + static void tci_args_rrrrcl(const uint8_t **tb_ptr, TCGReg *r0, TCGReg *r1, TCGReg *r2, TCGReg *r3, TCGCond *c4, void **l5) { @@ -676,11 +685,8 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, } break; case INDEX_op_mulu2_i32: - t0 = *tb_ptr++; - t1 = *tb_ptr++; - t2 = tci_read_rval(regs, &tb_ptr); - tmp64 = (uint32_t)tci_read_rval(regs, &tb_ptr); - tci_write_reg64(regs, t1, t0, (uint32_t)t2 * tmp64); + tci_args_rrrr(&tb_ptr, &r0, &r1, &r2, &r3); + tci_write_reg64(regs, r1, r0, (uint64_t)regs[r2] * regs[r3]); break; #endif /* TCG_TARGET_REG_BITS == 32 */ #if TCG_TARGET_HAS_ext8s_i32 || TCG_TARGET_HAS_ext8s_i64 From patchwork Thu Feb 4 01:44:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376203 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp859425jah; Wed, 3 Feb 2021 18:36:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJyiB6SmpiAqGW5iNAIRO12soAux3iQ9SUloxbvXOXEaFvc1sb9xWo/m0vxGwHg+aziyrgcZ X-Received: by 2002:a25:b048:: with SMTP id e8mr8516692ybj.0.1612406187230; Wed, 03 Feb 2021 18:36:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612406187; cv=none; d=google.com; s=arc-20160816; b=O7JX3dAy6p+00Wiy0XqHlcN83RrLXUKKoqO45Dec3MfqKcpdITVFEpj19lbh58K3Mv b2Rx3oKTRhr8KGGKgoC44Ojb+ExDQ6ymXGNmxlPaoywLjJBwEVNKDHtJq1xetBiut2fM 0QXAGw1keBvPp7UFuqPePpXuaSpSXbHLgX9fRt89bBCU15+IXR5WDGBu91XMILYb19W7 RigiWzRqewmoSFENRryhGkiPgdgDLFgpTKw5m4kwKyZMXDWInGzmrzR3ewkiMU3HM+On p0dNkHLkyp4ylNaLJjJI/K4YUGb14ois3tN3zxy7+MWTlcNaEuXOFPOEnevI7eipM7NL rQJQ== 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=wOvkZ0sAbeq0kMMHx/GBq6hm2tymswKeRwzIJ0G9jzI=; b=fFfbAJnn9SgFtQzktsIlJLqDz6BTIvtBD6th+okHTSFe7xJjZt80B6HDV+nfyBx8Xt 2EkwzmnDltFf29tcpdx29SCwNrKHk+wc+x4q+Qa6D8PcgNL8FU+J9z1k73lIHMDJpYyn VPlt4brrAbF9ibNwIaJNHtVoeMGVISo+/VmtokHi1RuVGhdy3hw0UTrIuNIfaV0lBp6i f2AFUWB0Ah6Xf7C8wC4VnKUvh/xjg/F/BeDKe0Yv5YX5zCQsgY7Z9za7QQnf1OJPDgQ/ rvsoA36wvAECqZzTmqgP75xe4ktPAEE1RUeDyq8ZhsTIn5QMo7kAJbPYvYRJnaSw+t+R jEQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=D+WNkqjA; 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 l6si2761256ybk.492.2021.02.03.18.36.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:36:27 -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=D+WNkqjA; 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]:56722 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7UVO-0005NU-I7 for patch@linaro.org; Wed, 03 Feb 2021 21:36:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45082) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7TjS-0005gZ-Ss for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:54 -0500 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]:38328) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7TjQ-00043Z-UM for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:54 -0500 Received: by mail-pf1-x42d.google.com with SMTP id y205so1076050pfc.5 for ; Wed, 03 Feb 2021 17:46:52 -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=wOvkZ0sAbeq0kMMHx/GBq6hm2tymswKeRwzIJ0G9jzI=; b=D+WNkqjAdin8oWFhpTBepHLSSnPH+QAFj3X8tEoS4dFbup/c5O9E3kygGkX40u/Msu cK34j2gbriB3VJ9Q7hiQ/4MOjDIgoihXcIVoitFHhW82Ll/AGvP4ID/Mt9y7/glhrnIA 6JRa9fPas5iUqbutKWJrhM9MjRUP7a1y/1WbUaLqo7O1gRSae7MuuQ9L7azGoE6+JnOL CDcUtALWUH/ujZM7yPz9eO9vK/JBbQWrgTsDI70gJs7+ACFCfrlck5Wu/xv2FwJjdcjR qnLR29aye2h1+1cRHp9aITiEppGDCLxaKuhQZplU+vl/Ja6mdKhVbRndnj5AwTTEjHek ZlqA== 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=wOvkZ0sAbeq0kMMHx/GBq6hm2tymswKeRwzIJ0G9jzI=; b=CNOlB4z7fVKyBauTpnYdhiSFdbng16C61pe4y5ESWHpJ3O8vNq1TCQ1IsaSBcIONpK bPc3mSU9u1pMUkO2oNGc54oBA2haDiZszivnNvgBHfQCuPnWg56i4bsRDm2MgHPfp6X0 vCA5pJ25dicIq1nFR39X6TSOMcgqBpmPMNHwCVwLyDJss6Rdcs9/Y2asR2oqRIaoSoBH aIP5hcSBZ7c38fGij4zD0Wga5Kt1O7622IlxZyNOZwoingEQ39fHA0MXV5tusNay0J8J Pn7ivZWIqNVdFvNfR0rlND7+5bONSySJe7VZJIF43YVFCK3YE4Xui7g3KbuG9hfZgij/ aGvQ== X-Gm-Message-State: AOAM531sqvuF9FE9N6jMbrZXO1h9hPH5AvB/t8q27D3e5CyCQwkUGTN1 nTPwBPRABAEBmMp4OuTkwPEWkRrbDZUqmJIO X-Received: by 2002:a63:d855:: with SMTP id k21mr6417323pgj.399.1612403211710; Wed, 03 Feb 2021 17:46:51 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.46.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:46:51 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 56/93] tcg/tci: Clean up deposit operations Date: Wed, 3 Feb 2021 15:44:32 -1000 Message-Id: <20210204014509.882821-57-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42d; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42d.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Use the correct set of asserts during code generation. We do not require the first input to overlap the output; the existing interpreter already supported that. Split out tci_args_rrrbb in the translator. Use the deposit32/64 functions rather than inline expansion. Signed-off-by: Richard Henderson --- tcg/tci/tcg-target-con-set.h | 1 - tcg/tci.c | 33 ++++++++++++++++----------------- tcg/tci/tcg-target.c.inc | 24 ++++++++++++++---------- 3 files changed, 30 insertions(+), 28 deletions(-) -- 2.25.1 diff --git a/tcg/tci/tcg-target-con-set.h b/tcg/tci/tcg-target-con-set.h index f51b7bcb13..316730f32c 100644 --- a/tcg/tci/tcg-target-con-set.h +++ b/tcg/tci/tcg-target-con-set.h @@ -13,7 +13,6 @@ C_O0_I2(r, r) C_O0_I3(r, r, r) C_O0_I4(r, r, r, r) C_O1_I1(r, r) -C_O1_I2(r, 0, r) C_O1_I2(r, r, r) C_O1_I4(r, r, r, r, r) C_O2_I1(r, r, r) diff --git a/tcg/tci.c b/tcg/tci.c index cb24295cd9..e10ccfc344 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -168,6 +168,7 @@ static tcg_target_ulong tci_read_label(const uint8_t **tb_ptr) * tci_args_ * where arguments is a sequence of * + * b = immediate (bit position) * i = immediate (uint32_t) * I = immediate (tcg_target_ulong) * r = register @@ -236,6 +237,16 @@ static void tci_args_rrrc(const uint8_t **tb_ptr, *c3 = tci_read_b(tb_ptr); } +static void tci_args_rrrbb(const uint8_t **tb_ptr, TCGReg *r0, TCGReg *r1, + TCGReg *r2, uint8_t *i3, uint8_t *i4) +{ + *r0 = tci_read_r(tb_ptr); + *r1 = tci_read_r(tb_ptr); + *r2 = tci_read_r(tb_ptr); + *i3 = tci_read_b(tb_ptr); + *i4 = tci_read_b(tb_ptr); +} + #if TCG_TARGET_REG_BITS == 32 static void tci_args_rrrr(const uint8_t **tb_ptr, TCGReg *r0, TCGReg *r1, TCGReg *r2, TCGReg *r3) @@ -449,11 +460,9 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, TCGReg r0, r1, r2; tcg_target_ulong t0; tcg_target_ulong t1; - tcg_target_ulong t2; TCGCond condition; target_ulong taddr; - uint8_t tmp8; - uint16_t tmp16; + uint8_t pos, len; uint32_t tmp32; uint64_t tmp64; #if TCG_TARGET_REG_BITS == 32 @@ -644,13 +653,8 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, #endif #if TCG_TARGET_HAS_deposit_i32 case INDEX_op_deposit_i32: - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - t2 = tci_read_rval(regs, &tb_ptr); - tmp16 = *tb_ptr++; - tmp8 = *tb_ptr++; - tmp32 = (((1 << tmp8) - 1) << tmp16); - tci_write_reg(regs, t0, (t1 & ~tmp32) | ((t2 << tmp16) & tmp32)); + tci_args_rrrbb(&tb_ptr, &r0, &r1, &r2, &pos, &len); + regs[r0] = deposit32(regs[r1], pos, len, regs[r2]); break; #endif case INDEX_op_brcond_i32: @@ -806,13 +810,8 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, #endif #if TCG_TARGET_HAS_deposit_i64 case INDEX_op_deposit_i64: - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - t2 = tci_read_rval(regs, &tb_ptr); - tmp16 = *tb_ptr++; - tmp8 = *tb_ptr++; - tmp64 = (((1ULL << tmp8) - 1) << tmp16); - tci_write_reg(regs, t0, (t1 & ~tmp64) | ((t2 << tmp16) & tmp64)); + tci_args_rrrbb(&tb_ptr, &r0, &r1, &r2, &pos, &len); + regs[r0] = deposit64(regs[r1], pos, len, regs[r2]); break; #endif case INDEX_op_brcond_i64: diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index 2c64b4f617..640407b4a8 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -126,11 +126,9 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) case INDEX_op_rotr_i64: case INDEX_op_setcond_i32: case INDEX_op_setcond_i64: - return C_O1_I2(r, r, r); - case INDEX_op_deposit_i32: case INDEX_op_deposit_i64: - return C_O1_I2(r, 0, r); + return C_O1_I2(r, r, r); case INDEX_op_brcond_i32: case INDEX_op_brcond_i64: @@ -480,13 +478,19 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, break; CASE_32_64(deposit) /* Optional (TCG_TARGET_HAS_deposit_*). */ - tcg_out_r(s, args[0]); - tcg_out_r(s, args[1]); - tcg_out_r(s, args[2]); - tcg_debug_assert(args[3] <= UINT8_MAX); - tcg_out8(s, args[3]); - tcg_debug_assert(args[4] <= UINT8_MAX); - tcg_out8(s, args[4]); + { + TCGArg pos = args[3], len = args[4]; + TCGArg max = opc == INDEX_op_deposit_i32 ? 32 : 64; + + tcg_debug_assert(pos < max); + tcg_debug_assert(pos + len <= max); + + tcg_out_r(s, args[0]); + tcg_out_r(s, args[1]); + tcg_out_r(s, args[2]); + tcg_out8(s, pos); + tcg_out8(s, len); + } break; CASE_32_64(brcond) From patchwork Thu Feb 4 01:44:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376182 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp912393ejt; Wed, 3 Feb 2021 18:18:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJw7rOeylmQIxLdwVR/VnWYvhOQ82ccJQ7Lm3UrI7h7O3ZyeAoFA1maouvbjMnBAPg2lxN4I X-Received: by 2002:a25:8748:: with SMTP id e8mr8086366ybn.120.1612405138520; Wed, 03 Feb 2021 18:18:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612405138; cv=none; d=google.com; s=arc-20160816; b=dBwFwfTVbzUH7UM/Y5hz6HXXfzpbsUIEZilYSY9LF+XRNC7MyXN1mjS0RzeDjfdffe 3W6A5ocKt+3DuXoBeB1LNPTscwjO0cFVTsChFq2tglVwsQp2eYXUWMGzRcT4rBMHfOPl HYuZRw/eddfcD4dNRdOjSLzygIDbGoyToLvbQtADMY1qw5uw9W4wFyt3O9jvE7XNbJJd /ywqXcFpC/GxuqsoMKjg/heNo4gC5HqdL4ojqbppA25/satlWULpr3aZl/ty8slc26Rk 2Pok6Nen7JHEq2l6Bf6t/mZtyDlWjLZcZRbRSWRjQ3UmR7QEVeKV9x8KZt38ST+dsc4h Ayww== 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=fkXespGLacfat/Oc2ATzIf/ZqfIgEJ0vqqLFj00td/k=; b=Jxoy5XbvG0ydNiCTLze7cmr1Iypiok8hHkKPMfMMauPsADpf30Gm+2kWh1NKUx31XZ D5ZYV8tWlLWIcCeYy91sDtx115iQAozwmtcqa9TAqP4E08KqMR3KJL/f65ucelzU7Zn0 HPGjmytBKqn7UbOWEw/phT8ezSnX1BtPHTWoX8dyPQ+Bpuf8U008EXTw31NzqchgIotH gHFkK0/YZY7tRbOyxW1RYoyX0JcCcCmHVa3+iRLb6VIw/F9H/5mB+8fo8B9GyOeE7mcE SGCDx3RSLW5MYdaQ09giNxEONmXmjEdxKcZvFrcZFyY9DDzz+SERfpVQwC24Si0rguMH 6FNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=r6PYrn0O; 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 x129si4120321ybg.408.2021.02.03.18.18.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:18:58 -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=r6PYrn0O; 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]:37218 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7UET-0001st-SY for patch@linaro.org; Wed, 03 Feb 2021 21:18:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45104) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7TjV-0005lV-1D for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:57 -0500 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]:43360) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7TjS-00044d-K1 for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:56 -0500 Received: by mail-pf1-x431.google.com with SMTP id q131so1057881pfq.10 for ; Wed, 03 Feb 2021 17:46:54 -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=fkXespGLacfat/Oc2ATzIf/ZqfIgEJ0vqqLFj00td/k=; b=r6PYrn0ObFOVP9x9l/TTdhUh+ugROYzSwwYIrTiIG9RgyWimodhIkxi9o13hyFfyYj 4iNAsz1Vrdfn2SUPwBKHh8sVG8v41ioLWTAuo3NgNRdM4DVZseJoFzgDeqxBl7s/ddCp ypTmoSCg2yvUdhoHrLe8QKUPC0neeYzcwXM1+no7t8KlHr77+ZY+mbHGPkRZT0zQpwkM qoQfrsXX6xqfmmcYpQLvX31KgFj3mPtJlL19UtvElvD8lalpLfLtb4pD1uwGuYI9Sv5z yua84T0A2l+3dM30WG9EFx0dZj3xTLsnqsbEbVzud9WPJOGCHgErXcAVWxCZuWloh/5u N1eA== 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=fkXespGLacfat/Oc2ATzIf/ZqfIgEJ0vqqLFj00td/k=; b=X2F5mGOMRkDMQUPyExoiADoFmQGcvT0rcV/2vODYHzsg3NhitWWHf6ePb8Da0aa8cp 7yiIsEY+Cr+PbkBs7nIEJaoCSrZgabO28BKzNCyQeN5GQtmAi06pJQ+1j+8XKFeumMLH Ktd6lbPc5GVKbLq1x2HI3NIqhOhbbwMN9Dfm3uTfu0fUH1mGXgtR1vwg9Wa3U2aiGRUi aNTWHZCAiBuMH/w/Dj3xUo0nUyurO+DVpjpl4QZMfCM+ZshB2j38ZIUYJEoKZE0Td+WO eP5TKaveYXnDE6nRyyEBe/cYj8ZgHI2/bpGAycDBDmCaXTgUxfzFlJco+LAcXH/RyVlT InJQ== X-Gm-Message-State: AOAM532750lEhz3qD5aQm1CQQmkXaoxxhzTNYbLklvJjLfsGm5qxkZ4O sG1f4oIMMl0I90pVIKyUaHMGVf7hhWOrMKLe X-Received: by 2002:a63:c1d:: with SMTP id b29mr6621757pgl.9.1612403213294; Wed, 03 Feb 2021 17:46:53 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.46.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:46:52 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 57/93] tcg/tci: Reduce qemu_ld/st TCGMemOpIdx operand to 32-bits Date: Wed, 3 Feb 2021 15:44:33 -1000 Message-Id: <20210204014509.882821-58-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::431; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x431.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We are currently using the "natural" size routine, which uses 64-bits on a 64-bit host. The TCGMemOpIdx operand has 11 bits, so we can safely reduce to 32-bits. Signed-off-by: Richard Henderson --- tcg/tci.c | 8 ++++---- tcg/tci/tcg-target.c.inc | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index e10ccfc344..ddc138359b 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -855,7 +855,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_qemu_ld_i32: t0 = *tb_ptr++; taddr = tci_read_ulong(regs, &tb_ptr); - oi = tci_read_i(&tb_ptr); + oi = tci_read_i32(&tb_ptr); switch (get_memop(oi) & (MO_BSWAP | MO_SSIZE)) { case MO_UB: tmp32 = qemu_ld_ub; @@ -892,7 +892,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t1 = *tb_ptr++; } taddr = tci_read_ulong(regs, &tb_ptr); - oi = tci_read_i(&tb_ptr); + oi = tci_read_i32(&tb_ptr); switch (get_memop(oi) & (MO_BSWAP | MO_SSIZE)) { case MO_UB: tmp64 = qemu_ld_ub; @@ -941,7 +941,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_qemu_st_i32: t0 = tci_read_rval(regs, &tb_ptr); taddr = tci_read_ulong(regs, &tb_ptr); - oi = tci_read_i(&tb_ptr); + oi = tci_read_i32(&tb_ptr); switch (get_memop(oi) & (MO_BSWAP | MO_SIZE)) { case MO_UB: qemu_st_b(t0); @@ -965,7 +965,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_qemu_st_i64: tmp64 = tci_read_r64(regs, &tb_ptr); taddr = tci_read_ulong(regs, &tb_ptr); - oi = tci_read_i(&tb_ptr); + oi = tci_read_i32(&tb_ptr); switch (get_memop(oi) & (MO_BSWAP | MO_SIZE)) { case MO_UB: qemu_st_b(tmp64); diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index 640407b4a8..6c187a25cc 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -550,7 +550,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, if (TARGET_LONG_BITS > TCG_TARGET_REG_BITS) { tcg_out_r(s, *args++); } - tcg_out_i(s, *args++); + tcg_out32(s, *args++); break; case INDEX_op_qemu_ld_i64: @@ -563,7 +563,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, if (TARGET_LONG_BITS > TCG_TARGET_REG_BITS) { tcg_out_r(s, *args++); } - tcg_out_i(s, *args++); + tcg_out32(s, *args++); break; case INDEX_op_mb: From patchwork Thu Feb 4 01:44:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376201 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp858400jah; Wed, 3 Feb 2021 18:34:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJw5n1BOl/rqYYUFXuu2cQsEIM/y+a8mSW/r1aSM8cH5lfBVBEk73xpWr3Jsbc6PW16caDmr X-Received: by 2002:a25:db4b:: with SMTP id g72mr8810779ybf.90.1612406060942; Wed, 03 Feb 2021 18:34:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612406060; cv=none; d=google.com; s=arc-20160816; b=A1wOCZ+kPgaOYGluonCUxm1gBY0a5A2+dMb05Zeit1lZ84M/8NVBSWrvr5Y6RzMtXR zjSrgOmfJ9nd2ARKXycq0CM4pognoCtlKb+OlP47mo13l/sBQND1uRmCFHepRurh+J1w DG+uq4bsuibjHDyhhbQ3/VEM9FAs2HhAjbKLvAzDSAr8U/LC6k+ddXHpgsaJJWm5ldMk bsdIHKTvb/g47PXpAeFx4xsu3uHGAnKbClgrZDucH0Hi0OD5vrPxF5cXZ1YCSkvpiM4s 7lJhOOlnlF4ajNTTXfdNdGirJkLc/52jrjJhcz0UvoG5Apc42dQg5ypQ+W+bTLfXkX4b ofkA== 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=Q08wWJmkpMRbD1uCLvdIthjIJ7wpxGIx6PIRtX9sdqE=; b=CmZV05HQQAOB/VK6kkjd3MMEkVmhpm9gD7+nUq5uB0+xSY/kXv7cGc5cMGsiBvJJr3 rVfZQM06by+V+cMj0ZPjpPndS0ayOD+EpTYVtb4oHRYTDKoBNas+3mJj3nqEhNjNcYD6 Jvh6J+3JCufCGCzCWwfAh1E6T7F9+pbibk6oLc8BJDE14aBdITxvDxGbsNZDuBc85G1E KhKwlvd9EHjCyRBQQlQn+Eo0lvISA/1PTR/q4tcfSYmwJp4G250j9FZ3FsXOCS9DGTqC EAPr4K9S0kcJBfYnWV5czyVvwGA/AVNZ5qbhRY907Mv/UGycYEeGzjiL9vEZ/33/Fvn0 2B/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="UoScL4/E"; 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 h15si4215414ybj.96.2021.02.03.18.34.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:34:20 -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="UoScL4/E"; 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]:49246 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7UTM-0002De-DZ for patch@linaro.org; Wed, 03 Feb 2021 21:34:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45118) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7TjW-0005pQ-HU for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:58 -0500 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]:55432) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7TjU-00044r-A2 for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:58 -0500 Received: by mail-pj1-x1029.google.com with SMTP id s24so768877pjp.5 for ; Wed, 03 Feb 2021 17:46:55 -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=Q08wWJmkpMRbD1uCLvdIthjIJ7wpxGIx6PIRtX9sdqE=; b=UoScL4/EubfEzn4wQWCcvgvivy3iJVWDhQQ9tI9yZQCaI7a5gCDKKPnY90qV9rw9sh BG1GZPyd/X9NVdB3PEWZZxQpqRoPDzd1twwQzJirZP/kBJzhauUE4RKYPwAIaE/te5tX YvQ9q7Dlw61+2qqw4lUJCh7qBn1ZX4kgqhJ4a+ygBBNU9OP+gZ4sZv8BLg3cXdd/iGM1 Z0R3YoUWZTNpSGGVZwyPKb3+sTl9oJk/sL22uVeivOkFDaingxeO5GBUzqYuKLNA8UES qOPfEgy8CVoIRNASXIboR+it3TdzLC/BdO9LDCiOgvPuJqGGD7pDza2lzyBpaPY11jOo Y2iw== 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=Q08wWJmkpMRbD1uCLvdIthjIJ7wpxGIx6PIRtX9sdqE=; b=TwqtBLjc5Gcuz4LdSxahqhAXOpPZ8rNSroGwaIcE+vxQMT2pE7IBkpra0XHf2DiJLs t7OjiGKgO9hccfAJgSPn4fdd8S7KHHyZ3D4YSG2q3hadSeciWTw8OyhhhuRYWKQE6G6/ n6ubXU0mQ5MRdysPn0lO0pxKU4lFUQ/lAV7DLre9BGYOJAaPl8mN3k3rXbtr+CrfHTFX 1GqULFd3LQSQ/YD0sfp+4MRpnNAZ6ZkuvbJH18IMxu11Izq+0csYOB4D+quW9XZT+92J cSN+sS2OYtupio8gx0XWzDEwNoQ30kT0e8SqPs+nMZPZeDLv99ovC4mlyjD29BeQElXo fMwA== X-Gm-Message-State: AOAM531BomWdJJQFRdorvUxA/P0Qxt6TBaOa4vbq4jwYnZK7vt10xl4R rETyjKwnI8YphrWIpiyzagOzIlngXvhefJt+ X-Received: by 2002:a17:902:9a4a:b029:dc:435c:70ad with SMTP id x10-20020a1709029a4ab02900dc435c70admr5680329plv.77.1612403214899; Wed, 03 Feb 2021 17:46:54 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.46.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:46:54 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 58/93] tcg/tci: Split out tci_args_{rrm,rrrm,rrrrm} Date: Wed, 3 Feb 2021 15:44:34 -1000 Message-Id: <20210204014509.882821-59-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1029; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1029.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- tcg/tci.c | 147 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 81 insertions(+), 66 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index ddc138359b..a1846825ea 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -66,22 +66,18 @@ tci_write_reg(tcg_target_ulong *regs, TCGReg index, tcg_target_ulong value) regs[index] = value; } -#if TCG_TARGET_REG_BITS == 32 static void tci_write_reg64(tcg_target_ulong *regs, uint32_t high_index, uint32_t low_index, uint64_t value) { tci_write_reg(regs, low_index, value); tci_write_reg(regs, high_index, value >> 32); } -#endif -#if TCG_TARGET_REG_BITS == 32 /* Create a 64 bit value from two 32 bit values. */ static uint64_t tci_uint64(uint32_t high, uint32_t low) { return ((uint64_t)high << 32) + low; } -#endif /* Read constant byte from bytecode. */ static uint8_t tci_read_b(const uint8_t **tb_ptr) @@ -121,43 +117,6 @@ static int32_t tci_read_s32(const uint8_t **tb_ptr) return value; } -/* Read indexed register (native size) from bytecode. */ -static tcg_target_ulong -tci_read_rval(const tcg_target_ulong *regs, const uint8_t **tb_ptr) -{ - tcg_target_ulong value = tci_read_reg(regs, **tb_ptr); - *tb_ptr += 1; - return value; -} - -#if TCG_TARGET_REG_BITS == 32 -/* Read two indexed registers (2 * 32 bit) from bytecode. */ -static uint64_t tci_read_r64(const tcg_target_ulong *regs, - const uint8_t **tb_ptr) -{ - uint32_t low = tci_read_rval(regs, tb_ptr); - return tci_uint64(tci_read_rval(regs, tb_ptr), low); -} -#elif TCG_TARGET_REG_BITS == 64 -/* Read indexed register (64 bit) from bytecode. */ -static uint64_t tci_read_r64(const tcg_target_ulong *regs, - const uint8_t **tb_ptr) -{ - return tci_read_rval(regs, tb_ptr); -} -#endif - -/* Read indexed register(s) with target address from bytecode. */ -static target_ulong -tci_read_ulong(const tcg_target_ulong *regs, const uint8_t **tb_ptr) -{ - target_ulong taddr = tci_read_rval(regs, tb_ptr); -#if TARGET_LONG_BITS > TCG_TARGET_REG_BITS - taddr += (uint64_t)tci_read_rval(regs, tb_ptr) << 32; -#endif - return taddr; -} - static tcg_target_ulong tci_read_label(const uint8_t **tb_ptr) { return tci_read_i(tb_ptr); @@ -171,6 +130,7 @@ static tcg_target_ulong tci_read_label(const uint8_t **tb_ptr) * b = immediate (bit position) * i = immediate (uint32_t) * I = immediate (tcg_target_ulong) + * m = immediate (TCGMemOpIdx) * r = register * s = signed ldst offset */ @@ -203,6 +163,14 @@ static void tci_args_rI(const uint8_t **tb_ptr, } #endif +static void tci_args_rrm(const uint8_t **tb_ptr, + TCGReg *r0, TCGReg *r1, TCGMemOpIdx *m2) +{ + *r0 = tci_read_r(tb_ptr); + *r1 = tci_read_r(tb_ptr); + *m2 = tci_read_i32(tb_ptr); +} + static void tci_args_rrr(const uint8_t **tb_ptr, TCGReg *r0, TCGReg *r1, TCGReg *r2) { @@ -237,6 +205,15 @@ static void tci_args_rrrc(const uint8_t **tb_ptr, *c3 = tci_read_b(tb_ptr); } +static void tci_args_rrrm(const uint8_t **tb_ptr, + TCGReg *r0, TCGReg *r1, TCGReg *r2, TCGMemOpIdx *m3) +{ + *r0 = tci_read_r(tb_ptr); + *r1 = tci_read_r(tb_ptr); + *r2 = tci_read_r(tb_ptr); + *m3 = tci_read_i32(tb_ptr); +} + static void tci_args_rrrbb(const uint8_t **tb_ptr, TCGReg *r0, TCGReg *r1, TCGReg *r2, uint8_t *i3, uint8_t *i4) { @@ -247,6 +224,16 @@ static void tci_args_rrrbb(const uint8_t **tb_ptr, TCGReg *r0, TCGReg *r1, *i4 = tci_read_b(tb_ptr); } +static void tci_args_rrrrm(const uint8_t **tb_ptr, TCGReg *r0, TCGReg *r1, + TCGReg *r2, TCGReg *r3, TCGMemOpIdx *m4) +{ + *r0 = tci_read_r(tb_ptr); + *r1 = tci_read_r(tb_ptr); + *r2 = tci_read_r(tb_ptr); + *r3 = tci_read_r(tb_ptr); + *m4 = tci_read_i32(tb_ptr); +} + #if TCG_TARGET_REG_BITS == 32 static void tci_args_rrrr(const uint8_t **tb_ptr, TCGReg *r0, TCGReg *r1, TCGReg *r2, TCGReg *r3) @@ -457,8 +444,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, uint8_t op_size = tb_ptr[1]; const uint8_t *old_code_ptr = tb_ptr; #endif - TCGReg r0, r1, r2; - tcg_target_ulong t0; + TCGReg r0, r1, r2, r3; tcg_target_ulong t1; TCGCond condition; target_ulong taddr; @@ -466,7 +452,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, uint32_t tmp32; uint64_t tmp64; #if TCG_TARGET_REG_BITS == 32 - TCGReg r3, r4, r5; + TCGReg r4, r5; uint64_t T1, T2; #endif TCGMemOpIdx oi; @@ -853,9 +839,13 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, continue; case INDEX_op_qemu_ld_i32: - t0 = *tb_ptr++; - taddr = tci_read_ulong(regs, &tb_ptr); - oi = tci_read_i32(&tb_ptr); + if (TARGET_LONG_BITS <= TCG_TARGET_REG_BITS) { + tci_args_rrm(&tb_ptr, &r0, &r1, &oi); + taddr = regs[r1]; + } else { + tci_args_rrrm(&tb_ptr, &r0, &r1, &r2, &oi); + taddr = tci_uint64(regs[r2], regs[r1]); + } switch (get_memop(oi) & (MO_BSWAP | MO_SSIZE)) { case MO_UB: tmp32 = qemu_ld_ub; @@ -884,15 +874,20 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, default: g_assert_not_reached(); } - tci_write_reg(regs, t0, tmp32); + regs[r0] = tmp32; break; + case INDEX_op_qemu_ld_i64: - t0 = *tb_ptr++; - if (TCG_TARGET_REG_BITS == 32) { - t1 = *tb_ptr++; + if (TCG_TARGET_REG_BITS == 64) { + tci_args_rrm(&tb_ptr, &r0, &r1, &oi); + taddr = regs[r1]; + } else if (TARGET_LONG_BITS <= TCG_TARGET_REG_BITS) { + tci_args_rrrm(&tb_ptr, &r0, &r1, &r2, &oi); + taddr = regs[r2]; + } else { + tci_args_rrrrm(&tb_ptr, &r0, &r1, &r2, &r3, &oi); + taddr = tci_uint64(regs[r3], regs[r2]); } - taddr = tci_read_ulong(regs, &tb_ptr); - oi = tci_read_i32(&tb_ptr); switch (get_memop(oi) & (MO_BSWAP | MO_SSIZE)) { case MO_UB: tmp64 = qemu_ld_ub; @@ -933,39 +928,58 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, default: g_assert_not_reached(); } - tci_write_reg(regs, t0, tmp64); if (TCG_TARGET_REG_BITS == 32) { - tci_write_reg(regs, t1, tmp64 >> 32); + tci_write_reg64(regs, r1, r0, tmp64); + } else { + regs[r0] = tmp64; } break; + case INDEX_op_qemu_st_i32: - t0 = tci_read_rval(regs, &tb_ptr); - taddr = tci_read_ulong(regs, &tb_ptr); - oi = tci_read_i32(&tb_ptr); + if (TARGET_LONG_BITS <= TCG_TARGET_REG_BITS) { + tci_args_rrm(&tb_ptr, &r0, &r1, &oi); + taddr = regs[r1]; + } else { + tci_args_rrrm(&tb_ptr, &r0, &r1, &r2, &oi); + taddr = tci_uint64(regs[r2], regs[r1]); + } + tmp32 = regs[r0]; switch (get_memop(oi) & (MO_BSWAP | MO_SIZE)) { case MO_UB: - qemu_st_b(t0); + qemu_st_b(tmp32); break; case MO_LEUW: - qemu_st_lew(t0); + qemu_st_lew(tmp32); break; case MO_LEUL: - qemu_st_lel(t0); + qemu_st_lel(tmp32); break; case MO_BEUW: - qemu_st_bew(t0); + qemu_st_bew(tmp32); break; case MO_BEUL: - qemu_st_bel(t0); + qemu_st_bel(tmp32); break; default: g_assert_not_reached(); } break; + case INDEX_op_qemu_st_i64: - tmp64 = tci_read_r64(regs, &tb_ptr); - taddr = tci_read_ulong(regs, &tb_ptr); - oi = tci_read_i32(&tb_ptr); + if (TCG_TARGET_REG_BITS == 64) { + tci_args_rrm(&tb_ptr, &r0, &r1, &oi); + taddr = regs[r1]; + tmp64 = regs[r0]; + } else { + if (TARGET_LONG_BITS <= TCG_TARGET_REG_BITS) { + tci_args_rrrm(&tb_ptr, &r0, &r1, &r2, &oi); + taddr = regs[r2]; + } else { + tci_args_rrrrm(&tb_ptr, &r0, &r1, &r2, &r3, &oi); + taddr = tci_uint64(regs[r3], regs[r2]); + } + tmp64 = tci_uint64(regs[r1], regs[r0]); + } switch (get_memop(oi) & (MO_BSWAP | MO_SIZE)) { case MO_UB: qemu_st_b(tmp64); @@ -992,6 +1006,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, g_assert_not_reached(); } break; + case INDEX_op_mb: /* Ensure ordering for all kinds */ smp_mb(); From patchwork Thu Feb 4 01:44:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376208 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp861831jah; Wed, 3 Feb 2021 18:41:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJw1LOwo/XreylLvxqTz2F6EQknHrKz5yQkCjUdt02PeJI9wJys8RHN7XIwbOGKbvPDN1ux8 X-Received: by 2002:a25:4015:: with SMTP id n21mr9657132yba.180.1612406469425; Wed, 03 Feb 2021 18:41:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612406469; cv=none; d=google.com; s=arc-20160816; b=ht1kE2PULcSxg90qRx9IXEeoHBlkggDktmKIcifLzzM2TBMqPzk305HsmT6DEj7Bn8 P3kcOoNGCZvKaYKEXzi0DjK5N+Nt2QZMPgRbULxys+rqpinRqzoJ+5GS8XcnrEanHHXt vT4IZKBbtu9nC/y6QgAY5Zp0NvO6ayKyJ9vMzmLy/mcgeN1px+NnDegdsyZUOX8+pc7f mgkf4D2rx03asoBsjOC8m7sgCyBFDE0CLiKUpcZTu4hZ53uiUPdEOSVbxMu5XkufoRqd E0uY+HTzvf0CV6D6fqoEOxocDN1o0WyxIOwJp09cRvi12mFqb9oH/B+q3g5H8D476yxQ +KxA== 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=hRHyPEsiO/sbh2eomZAl+YTq7kTrdOg7LphtzyHDt9Q=; b=KBpChLhrCDSjX4XhmcWf4tPFZksLSr+xGU2e8L6+iKS15t8haR0vwVUUzK6IVvPit4 j9EgYIvJ1VdEPl10/I7iXA0P6CfZYlVIV/uxFBMK7RzvAIMwFYwe6Bwr3ObL6RICH+Yz IhFBlphVsPLITQ70eLlUUec6I+SHqlAYIDrXr1w9nl4hX/P1xW2s/8GuPjrBb5SkCRPL 1b7ykHCc2lHpj8QkkV42if9H3YSPYRFjtxsA29mjUA+Zes5Ww9fTmWtJGQGfHbDhgy3w BjogxOxpdY/n5nm6p/qqcK+2r6gPUSxbhPzky4H4l7acCZdZno/MVs99iD7Wc3goGQFY u/UQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yzc4UVef; 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 l193si4012394ybf.82.2021.02.03.18.41.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:41:09 -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=yzc4UVef; 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]:37600 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7UZv-0001Gx-2k for patch@linaro.org; Wed, 03 Feb 2021 21:41:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45134) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7TjY-0005uO-FM for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:47:00 -0500 Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]:39491) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7TjW-00045o-Af for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:47:00 -0500 Received: by mail-pg1-x529.google.com with SMTP id o63so1032807pgo.6 for ; Wed, 03 Feb 2021 17:46:57 -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=hRHyPEsiO/sbh2eomZAl+YTq7kTrdOg7LphtzyHDt9Q=; b=yzc4UVefamkKi+ZzdmNdqpcq9Psk5AuBGV8oyF07TIyPmTBuvP0E9uft+IAI5BZ/Ni ZST3rOYH4qikDDiRmyNvny4Er8BDDapl6qHoSyGtAgwtBmqS164YJ8hJV1YGXZnShceN 5l6naum+iOLLA8KERYnYQ1/N4RiStVZCbNPgUV0GV/NCoN87tQVHhmT8qPzVNWdTZHGY DHX4m3LeJJVz1V4c5AQHNL7MX+IWCmbQ8QexlhFufO4qnjYnAbXDmf3jwKaoorURNHZA LPUrxsD+gewVuQf1294oSYb3T33MELH4Glzerc8Wg+dTNJXv+xw9Qr0naWqqv5uAnA6n H8jw== 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=hRHyPEsiO/sbh2eomZAl+YTq7kTrdOg7LphtzyHDt9Q=; b=Qk7zehllhru8acLUZdVj08BxEMooUZr4k3JIqnRm9BT4l4tcWpuMRwwaOlJ723Rw78 OfFOfR8M/ri0o46Ga4R1oCOJz7losOuxqGRx32ihBLryKWVsnuxBLsx6YlQnD1O5bsXR IEg86a6UOihq0PhUjPbGqWTaseqEtlL1dMluDJtTgH2zCVSJxEom7z8REUmHMYxlDVZs 3Bdx36rLWtg1XQtHvxCvo5AutxV7M7bDo7oDfpQs+391oIyF/g68DZUA6V/ttPIseZvy 1+2ZdMmsFzYU5OwqFW4UoirZRqjKkEmZg4ONhDHLIefCt+brI0j8yhJbJs867EIeu/ri enLA== X-Gm-Message-State: AOAM531d7skKxWpBiB99z1K+7XBJ6QZkYwWndWc9+IB3r6StIaFe5yzq xGh4VReqfXb+NaeVaCoYImmF1JdVb/pkb4Tg X-Received: by 2002:a62:3503:0:b029:1aa:6f15:b9fe with SMTP id c3-20020a6235030000b02901aa6f15b9femr5740085pfa.65.1612403216691; Wed, 03 Feb 2021 17:46:56 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.46.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:46:55 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 59/93] tcg/tci: Hoist op_size checking into tci_args_* Date: Wed, 3 Feb 2021 15:44:35 -1000 Message-Id: <20210204014509.882821-60-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::529; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x529.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This performs the size check while reading the arguments, which means that we don't have to arrange for it to be done after the operation. Which tidies all of the branches. Signed-off-by: Richard Henderson --- tcg/tci.c | 87 ++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 73 insertions(+), 14 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index a1846825ea..3dc89ed829 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -24,7 +24,7 @@ #if defined(CONFIG_DEBUG_TCG) # define tci_assert(cond) assert(cond) #else -# define tci_assert(cond) ((void)0) +# define tci_assert(cond) ((void)(cond)) #endif #include "qemu-common.h" @@ -135,146 +135,217 @@ static tcg_target_ulong tci_read_label(const uint8_t **tb_ptr) * s = signed ldst offset */ +static void check_size(const uint8_t *start, const uint8_t **tb_ptr) +{ + const uint8_t *old_code_ptr = start - 2; + uint8_t op_size = old_code_ptr[1]; + tci_assert(*tb_ptr == old_code_ptr + op_size); +} + static void tci_args_l(const uint8_t **tb_ptr, void **l0) { + const uint8_t *start = *tb_ptr; + *l0 = (void *)tci_read_label(tb_ptr); + + check_size(start, tb_ptr); } static void tci_args_rr(const uint8_t **tb_ptr, TCGReg *r0, TCGReg *r1) { + const uint8_t *start = *tb_ptr; + *r0 = tci_read_r(tb_ptr); *r1 = tci_read_r(tb_ptr); + + check_size(start, tb_ptr); } static void tci_args_ri(const uint8_t **tb_ptr, TCGReg *r0, tcg_target_ulong *i1) { + const uint8_t *start = *tb_ptr; + *r0 = tci_read_r(tb_ptr); *i1 = tci_read_i32(tb_ptr); + + check_size(start, tb_ptr); } #if TCG_TARGET_REG_BITS == 64 static void tci_args_rI(const uint8_t **tb_ptr, TCGReg *r0, tcg_target_ulong *i1) { + const uint8_t *start = *tb_ptr; + *r0 = tci_read_r(tb_ptr); *i1 = tci_read_i(tb_ptr); + + check_size(start, tb_ptr); } #endif static void tci_args_rrm(const uint8_t **tb_ptr, TCGReg *r0, TCGReg *r1, TCGMemOpIdx *m2) { + const uint8_t *start = *tb_ptr; + *r0 = tci_read_r(tb_ptr); *r1 = tci_read_r(tb_ptr); *m2 = tci_read_i32(tb_ptr); + + check_size(start, tb_ptr); } static void tci_args_rrr(const uint8_t **tb_ptr, TCGReg *r0, TCGReg *r1, TCGReg *r2) { + const uint8_t *start = *tb_ptr; + *r0 = tci_read_r(tb_ptr); *r1 = tci_read_r(tb_ptr); *r2 = tci_read_r(tb_ptr); + + check_size(start, tb_ptr); } static void tci_args_rrs(const uint8_t **tb_ptr, TCGReg *r0, TCGReg *r1, int32_t *i2) { + const uint8_t *start = *tb_ptr; + *r0 = tci_read_r(tb_ptr); *r1 = tci_read_r(tb_ptr); *i2 = tci_read_s32(tb_ptr); + + check_size(start, tb_ptr); } static void tci_args_rrcl(const uint8_t **tb_ptr, TCGReg *r0, TCGReg *r1, TCGCond *c2, void **l3) { + const uint8_t *start = *tb_ptr; + *r0 = tci_read_r(tb_ptr); *r1 = tci_read_r(tb_ptr); *c2 = tci_read_b(tb_ptr); *l3 = (void *)tci_read_label(tb_ptr); + + check_size(start, tb_ptr); } static void tci_args_rrrc(const uint8_t **tb_ptr, TCGReg *r0, TCGReg *r1, TCGReg *r2, TCGCond *c3) { + const uint8_t *start = *tb_ptr; + *r0 = tci_read_r(tb_ptr); *r1 = tci_read_r(tb_ptr); *r2 = tci_read_r(tb_ptr); *c3 = tci_read_b(tb_ptr); + + check_size(start, tb_ptr); } static void tci_args_rrrm(const uint8_t **tb_ptr, TCGReg *r0, TCGReg *r1, TCGReg *r2, TCGMemOpIdx *m3) { + const uint8_t *start = *tb_ptr; + *r0 = tci_read_r(tb_ptr); *r1 = tci_read_r(tb_ptr); *r2 = tci_read_r(tb_ptr); *m3 = tci_read_i32(tb_ptr); + + check_size(start, tb_ptr); } static void tci_args_rrrbb(const uint8_t **tb_ptr, TCGReg *r0, TCGReg *r1, TCGReg *r2, uint8_t *i3, uint8_t *i4) { + const uint8_t *start = *tb_ptr; + *r0 = tci_read_r(tb_ptr); *r1 = tci_read_r(tb_ptr); *r2 = tci_read_r(tb_ptr); *i3 = tci_read_b(tb_ptr); *i4 = tci_read_b(tb_ptr); + + check_size(start, tb_ptr); } static void tci_args_rrrrm(const uint8_t **tb_ptr, TCGReg *r0, TCGReg *r1, TCGReg *r2, TCGReg *r3, TCGMemOpIdx *m4) { + const uint8_t *start = *tb_ptr; + *r0 = tci_read_r(tb_ptr); *r1 = tci_read_r(tb_ptr); *r2 = tci_read_r(tb_ptr); *r3 = tci_read_r(tb_ptr); *m4 = tci_read_i32(tb_ptr); + + check_size(start, tb_ptr); } #if TCG_TARGET_REG_BITS == 32 static void tci_args_rrrr(const uint8_t **tb_ptr, TCGReg *r0, TCGReg *r1, TCGReg *r2, TCGReg *r3) { + const uint8_t *start = *tb_ptr; + *r0 = tci_read_r(tb_ptr); *r1 = tci_read_r(tb_ptr); *r2 = tci_read_r(tb_ptr); *r3 = tci_read_r(tb_ptr); + + check_size(start, tb_ptr); } static void tci_args_rrrrcl(const uint8_t **tb_ptr, TCGReg *r0, TCGReg *r1, TCGReg *r2, TCGReg *r3, TCGCond *c4, void **l5) { + const uint8_t *start = *tb_ptr; + *r0 = tci_read_r(tb_ptr); *r1 = tci_read_r(tb_ptr); *r2 = tci_read_r(tb_ptr); *r3 = tci_read_r(tb_ptr); *c4 = tci_read_b(tb_ptr); *l5 = (void *)tci_read_label(tb_ptr); + + check_size(start, tb_ptr); } static void tci_args_rrrrrc(const uint8_t **tb_ptr, TCGReg *r0, TCGReg *r1, TCGReg *r2, TCGReg *r3, TCGReg *r4, TCGCond *c5) { + const uint8_t *start = *tb_ptr; + *r0 = tci_read_r(tb_ptr); *r1 = tci_read_r(tb_ptr); *r2 = tci_read_r(tb_ptr); *r3 = tci_read_r(tb_ptr); *r4 = tci_read_r(tb_ptr); *c5 = tci_read_b(tb_ptr); + + check_size(start, tb_ptr); } static void tci_args_rrrrrr(const uint8_t **tb_ptr, TCGReg *r0, TCGReg *r1, TCGReg *r2, TCGReg *r3, TCGReg *r4, TCGReg *r5) { + const uint8_t *start = *tb_ptr; + *r0 = tci_read_r(tb_ptr); *r1 = tci_read_r(tb_ptr); *r2 = tci_read_r(tb_ptr); *r3 = tci_read_r(tb_ptr); *r4 = tci_read_r(tb_ptr); *r5 = tci_read_r(tb_ptr); + + check_size(start, tb_ptr); } #endif @@ -440,10 +511,6 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, for (;;) { TCGOpcode opc = tb_ptr[0]; -#if defined(CONFIG_DEBUG_TCG) && !defined(NDEBUG) - uint8_t op_size = tb_ptr[1]; - const uint8_t *old_code_ptr = tb_ptr; -#endif TCGReg r0, r1, r2, r3; tcg_target_ulong t1; TCGCond condition; @@ -493,7 +560,6 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, break; case INDEX_op_br: tci_args_l(&tb_ptr, &ptr); - tci_assert(tb_ptr == old_code_ptr + op_size); tb_ptr = ptr; continue; case INDEX_op_setcond_i32: @@ -646,9 +712,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_brcond_i32: tci_args_rrcl(&tb_ptr, &r0, &r1, &condition, &ptr); if (tci_compare32(regs[r0], regs[r1], condition)) { - tci_assert(tb_ptr == old_code_ptr + op_size); tb_ptr = ptr; - continue; } break; #if TCG_TARGET_REG_BITS == 32 @@ -669,7 +733,6 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, T1 = tci_uint64(regs[r1], regs[r0]); T2 = tci_uint64(regs[r3], regs[r2]); if (tci_compare64(T1, T2, condition)) { - tci_assert(tb_ptr == old_code_ptr + op_size); tb_ptr = ptr; continue; } @@ -803,9 +866,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_brcond_i64: tci_args_rrcl(&tb_ptr, &r0, &r1, &condition, &ptr); if (tci_compare64(regs[r0], regs[r1], condition)) { - tci_assert(tb_ptr == old_code_ptr + op_size); tb_ptr = ptr; - continue; } break; case INDEX_op_ext32s_i64: @@ -834,9 +895,8 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_goto_tb: tci_args_l(&tb_ptr, &ptr); - tci_assert(tb_ptr == old_code_ptr + op_size); tb_ptr = *(void **)ptr; - continue; + break; case INDEX_op_qemu_ld_i32: if (TARGET_LONG_BITS <= TCG_TARGET_REG_BITS) { @@ -1014,6 +1074,5 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, default: g_assert_not_reached(); } - tci_assert(tb_ptr == old_code_ptr + op_size); } } From patchwork Thu Feb 4 01:44:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376187 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp914146ejt; Wed, 3 Feb 2021 18:22:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJzaR904z576V4Nm0+GFIseKO+dOumpaShi6xYm/VyeUVyFWTPfrfNX7y4BOrkbS6fyluuP3 X-Received: by 2002:a25:428e:: with SMTP id p136mr8812176yba.107.1612405363491; Wed, 03 Feb 2021 18:22:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612405363; cv=none; d=google.com; s=arc-20160816; b=CZADnU32SEcikZqavywOJljwQgx5wzG8t5teZFQITXzi4cQL0HGoerzqGG7SzArGcG Zvnfhh0FYuUIxd34FnC1NIea4FIs1BBcggmzGhgtov1/G6w7EpgwgLvHOJ9rIizwOFt6 +2fRiKt3XDEmpuILhn0vNZcdjX6k0Eg9DrXQuk5bug3tLneY+/5tGZ113Yms4fxcr6B3 gxIzRrQPOYE7KBeV67XOnwjuoBhremXEr2UA1ptFu51xvDgGp4UfG05U0WPHGymKJLea foP0YNZ0aNEpiKuEScBvEcAq6KLtOinRp7/UTvpXU/DP1YFNDWdWIG/rohUMuapqUK9g qXYQ== 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=7AU7AuzkprD1DzoX758oP/Mpq/Dm/wXzaoKexxvkWBk=; b=XgJI3bXcgBC4M9gFakCmitNTb3F3AidfyjDKNPknPLyw3u5CLEcVddOn5ebHfCjWx1 cry2bfY6Kr7Jr0IFJ9jKkyl8SNZ+pO9QBBcLHqs5rkNhETdO+CtPX2wXYLLHGGOoNj5y ICjtsShGz+SSt4BBiqox2I+4c0DyJ5CUSDVrl2ds5eUNP9NpAq1eer1JHyAJ4EHhJpuE ABeVjCSyArKk4eyEspBsOBcaXdZpwnFlp5w1Nc3TLWbTU2B0rsmwrjw0e2g8rjvblU78 4+SsFtl1mDSMPn0unUKvZZbZuN+wLg+nqAilHR0q895C0aNDpQWr7do2ZKC/mXfuWos1 mOeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=er7akT1n; 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 r26si4571524ybd.216.2021.02.03.18.22.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:22:43 -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=er7akT1n; 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]:45564 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7UI6-0005Tx-Us for patch@linaro.org; Wed, 03 Feb 2021 21:22:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45146) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7TjZ-0005wy-GR for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:47:01 -0500 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]:38869) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7TjX-00045z-Q6 for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:47:01 -0500 Received: by mail-pj1-x102a.google.com with SMTP id l18so824947pji.3 for ; Wed, 03 Feb 2021 17:46:59 -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=7AU7AuzkprD1DzoX758oP/Mpq/Dm/wXzaoKexxvkWBk=; b=er7akT1nwqQmv9gBfhPzwA2Qz2X1af1C8ChA5dliWRYIEb3EgF+tE7QwpDr2MVV+xa atdQ01XyDp6MtdOvorUfVt1WStdfs71x2SrNabmdyl9UN75aJOKFPMVm9r/3162lfPCB 8IvS/ciutaD0bJIoXyKo8CW2tA+egMUv7vNDxp2snaxYPwprn2w1ETvt7kAbnALbcSb7 Y9tuOcOG951gi18ZSRdtd8JKqcbU3fag6TepWk4mTNEA6GXLud26C8WFdCRoDul7JTPW lgItfaGAfjtQHLtXw4vJBcSAgyq5dQIyCgZXpkMYFd85HM/vZRg/QMZ5MjYOtxRYajB0 8MSQ== 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=7AU7AuzkprD1DzoX758oP/Mpq/Dm/wXzaoKexxvkWBk=; b=owCqR0YHJ/yl2RcR4PdPHzNDvd4FpIMjGg0uE8ZckOEH72jsehDEFBljUdPXlJZ/cy 5SV0/T24w7Ot3Hf8kPjyE4nMFCSqHjJJbab43nK9FvcSfcnt+w26fMcHRi2yPUCS1g5X eLYpc6pfSQ6s9KxmcUzAir5pcLrOeTIb9GDpBXOkooPwNpV6C5PTikNodxOWtJDfoYVq Y6OGDX6Am34MTB2xtQB96nQRwkDfXmL4jDJlVBSHhT9EZL002g3sG1ex4FJZPbHkLPDz 63TX4JuxYRvQyz3mXuZ5VMn0+x46xN0lGfbisjnIfRr0+WFvLDgbp9PutYsUu7uETjpF fG0g== X-Gm-Message-State: AOAM532kZ2ceoDxR/4BGPZa+ysDwRJhaxqQQbtP4wdrMLSVwmx1caDIk xtSn97G2oVnvDi0aH97HcF9WmV998gBW8l0I X-Received: by 2002:a17:902:9b95:b029:df:d859:42bb with SMTP id y21-20020a1709029b95b02900dfd85942bbmr5952535plp.2.1612403218185; Wed, 03 Feb 2021 17:46:58 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.46.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:46:57 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 60/93] tcg/tci: Remove tci_disas Date: Wed, 3 Feb 2021 15:44:36 -1000 Message-Id: <20210204014509.882821-61-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102a; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102a.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This function is unused. It's not even the disassembler, which is print_insn_tci, located in disas/tci.c. Signed-off-by: Richard Henderson --- tcg/tci/tcg-target.h | 2 -- tcg/tci/tcg-target.c.inc | 10 ---------- 2 files changed, 12 deletions(-) -- 2.25.1 diff --git a/tcg/tci/tcg-target.h b/tcg/tci/tcg-target.h index 9285c930a2..52af6d8bc5 100644 --- a/tcg/tci/tcg-target.h +++ b/tcg/tci/tcg-target.h @@ -163,8 +163,6 @@ typedef enum { #define TCG_TARGET_CALL_STACK_OFFSET 0 #define TCG_TARGET_STACK_ALIGN 16 -void tci_disas(uint8_t opc); - #define HAVE_TCG_QEMU_TB_EXEC /* We could notice __i386__ or __s390x__ and reduce the barriers depending diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index 6c187a25cc..7fb3b04eaf 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -253,16 +253,6 @@ static bool patch_reloc(tcg_insn_unit *code_ptr, int type, return true; } -#if defined(CONFIG_DEBUG_TCG_INTERPRETER) -/* Show current bytecode. Used by tcg interpreter. */ -void tci_disas(uint8_t opc) -{ - const TCGOpDef *def = &tcg_op_defs[opc]; - fprintf(stderr, "TCG %s %u, %u, %u\n", - def->name, def->nb_oargs, def->nb_iargs, def->nb_cargs); -} -#endif - /* Write value (native size). */ static void tcg_out_i(TCGContext *s, tcg_target_ulong v) { From patchwork Thu Feb 4 01:44:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376207 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp861732jah; Wed, 3 Feb 2021 18:40:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJwybbnVKGSDjKIGHc1VFLpR0ZDkilcRyhm5auoh0059BXuhe/qtHS40dRcB4IZ4xs/Wv/qo X-Received: by 2002:a25:7716:: with SMTP id s22mr8929864ybc.25.1612406458053; Wed, 03 Feb 2021 18:40:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612406458; cv=none; d=google.com; s=arc-20160816; b=dBBUGuCeHYe7fb2bdWqaEdVQMz48hS9HiiQoxOZ1uk95dj038c58n4N/Pb0FP+RvMU /d3M81lLi9D/ajW4fi/RQR1M1IYCQ/vK1uzkmZe0ApFUmZHxyNbstA0mWnMzxp1+r2rb 5wetfAYj7Fzk2dzRPMlwAKoone6arId/sm/QLJsRwSorZx+RDJ+zwi+9jf2cM74rhUf7 vlmei3UCAkzlkKTnGw6cnUQllQRxmi1RZAcGpKt/YDEnUhL/PlJWOQ3tvcFS7D1bE1FH YweJ6YmshuLFI6WM3Dm2DS8Y9FTs+ovdYCD3HS3JwfcJv1PM9lD4+tMWfZCM0H5YQ2OT Ld0g== 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=iToOwgtlkbg5FQ3YOPz2xSqBMcKCFQNo9DwZ3Jeszk0=; b=nXj5yfBrjiM4ma9HhRtLbw3WcRrvfDkK5qoDeHe7isAvNc14DaJsm9naJp/Zq1LfUv AUukahIoS32/UDi2j/rCp8jlXnUDqn8LOQ1XYiIqb3t4hEee+zf1lpk9c3zJXPtWwuZM 4jfI85c/wcxs+sBMCMAkbqJWyjylyum2t3HsZeSHDcxRM4f6JloMlR2UHMpk25Zagyyx qtQsKhPhppalJuQOrBI5ld9Rhh6LAq75IB6xhaYBldc4YBebaRuLlvp0NQRjfLA+cW7I PjBorQ1f4ZeoKYEu91uUJyE8uv0EEjsPwLbt3gBGFkHdQYkAkKTQTLiqKQnkPPr+41uu jN1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="qg/NBCg0"; 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 h11si4750033ybj.321.2021.02.03.18.40.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:40:58 -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="qg/NBCg0"; 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]:37178 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7UZl-00015M-Gn for patch@linaro.org; Wed, 03 Feb 2021 21:40:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45160) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Tjb-00062a-Gu for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:47:03 -0500 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]:33431) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7TjZ-000467-0f for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:47:03 -0500 Received: by mail-pj1-x102a.google.com with SMTP id lw17so4251806pjb.0 for ; Wed, 03 Feb 2021 17:47:00 -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=iToOwgtlkbg5FQ3YOPz2xSqBMcKCFQNo9DwZ3Jeszk0=; b=qg/NBCg03rxs2KhJpO61ZGIfk5GMtJYF976nK9Y/5NjYPk4K8QzQTdiL3PxgxtugtN udn6k54wNIi61G6qcW5vB51gT6LLZeZ8c2IQWdWOr/9wnM1nSXlz8/JrHtx6+q/E0ywM W+dm5KOCCHvj1Ic1Iq0DspiOyFS4RVsLu4/hYaL5Tt+b7cKbJEIGNxJQC7DO31GMwy6A QjFqVvk2+ZpB8G8yXEmJJnqdCdiVGKMTSVHKepvfEwfXATtA9+yryFCx9CD7xG5dxdKe 3DK6P/a7djnHom18FwWDrLlrcNKyqZVnvK9tqODYv6l2rBtqkPDwD8o8Iw73l+RprNCe wfUA== 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=iToOwgtlkbg5FQ3YOPz2xSqBMcKCFQNo9DwZ3Jeszk0=; b=EOvK4xVrtUTmQ4IGG/A0Q83oagovgO/L95eoniRQg1Cr4G1WhHKevncOG0/aFBlQ6e EjWvuhk7euwltr1oYmSOM9jk+1Chlfuo7k0/ycVLvQwhfZRzyU8fSemFhN+/HIMis+Tf ijNC8nljE+PWPZl9ROYY525JkS41PL4xVnN//lb+c2nTqA37jIO14uzTYe5Cv/71z8iC WF7b+Hq1izZdWUbQltY4Ds14szhlsAiUEL6a9UiQOSkL24WF+s0MXX1SleX+sOqpbYb5 ZUtKr4LBotSDItmPsBQ1pAx354772QR8Cg+vTRXZRE1zOUjJnQnYdIjtMU/1lhVAVg6E NBPw== X-Gm-Message-State: AOAM531wzEOtJuOx1c7eDfjPplOq0FTJE60MUpDmaIAAMCxPITKG1DBD E5dhO+n14GAwD32/AJ5O1401dYTaQMZFc4aw X-Received: by 2002:a17:902:ac8b:b029:e0:e42:dc26 with SMTP id h11-20020a170902ac8bb02900e00e42dc26mr5755987plr.44.1612403219553; Wed, 03 Feb 2021 17:46:59 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.46.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:46:59 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 61/93] tcg/tci: Implement the disassembler properly Date: Wed, 3 Feb 2021 15:44:37 -1000 Message-Id: <20210204014509.882821-62-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102a; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102a.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Actually print arguments as opposed to simply the opcodes and, uselessly, the argument counts. Reuse all of the helpers developed as part of the interpreter. Signed-off-by: Richard Henderson --- meson.build | 2 +- include/tcg/tcg-opc.h | 2 - disas/tci.c | 61 --------- tcg/tci.c | 283 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 284 insertions(+), 64 deletions(-) delete mode 100644 disas/tci.c -- 2.25.1 diff --git a/meson.build b/meson.build index 2d8b433ff0..475d8a94ea 100644 --- a/meson.build +++ b/meson.build @@ -1901,7 +1901,7 @@ specific_ss.add(when: 'CONFIG_TCG', if_true: files( 'tcg/tcg-op.c', 'tcg/tcg.c', )) -specific_ss.add(when: 'CONFIG_TCG_INTERPRETER', if_true: files('disas/tci.c', 'tcg/tci.c')) +specific_ss.add(when: 'CONFIG_TCG_INTERPRETER', if_true: files('tcg/tci.c')) subdir('backends') subdir('disas') diff --git a/include/tcg/tcg-opc.h b/include/tcg/tcg-opc.h index 900984c005..bbb0884af8 100644 --- a/include/tcg/tcg-opc.h +++ b/include/tcg/tcg-opc.h @@ -278,10 +278,8 @@ DEF(last_generic, 0, 0, 0, TCG_OPF_NOT_PRESENT) #ifdef TCG_TARGET_INTERPRETER /* These opcodes are only for use between the tci generator and interpreter. */ DEF(tci_movi_i32, 1, 0, 1, TCG_OPF_NOT_PRESENT) -#if TCG_TARGET_REG_BITS == 64 DEF(tci_movi_i64, 1, 0, 1, TCG_OPF_64BIT | TCG_OPF_NOT_PRESENT) #endif -#endif #undef TLADDR_ARGS #undef DATA64_ARGS diff --git a/disas/tci.c b/disas/tci.c deleted file mode 100644 index f1d6c6b469..0000000000 --- a/disas/tci.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Tiny Code Interpreter for QEMU - disassembler - * - * Copyright (c) 2011 Stefan Weil - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "qemu/osdep.h" -#include "qemu-common.h" -#include "disas/dis-asm.h" -#include "tcg/tcg.h" - -/* Disassemble TCI bytecode. */ -int print_insn_tci(bfd_vma addr, disassemble_info *info) -{ - int length; - uint8_t byte; - int status; - TCGOpcode op; - - status = info->read_memory_func(addr, &byte, 1, info); - if (status != 0) { - info->memory_error_func(status, addr, info); - return -1; - } - op = byte; - - addr++; - status = info->read_memory_func(addr, &byte, 1, info); - if (status != 0) { - info->memory_error_func(status, addr, info); - return -1; - } - length = byte; - - if (op >= tcg_op_defs_max) { - info->fprintf_func(info->stream, "illegal opcode %d", op); - } else { - const TCGOpDef *def = &tcg_op_defs[op]; - int nb_oargs = def->nb_oargs; - int nb_iargs = def->nb_iargs; - int nb_cargs = def->nb_cargs; - /* TODO: Improve disassembler output. */ - info->fprintf_func(info->stream, "%s\to=%d i=%d c=%d", - def->name, nb_oargs, nb_iargs, nb_cargs); - } - - return length; -} diff --git a/tcg/tci.c b/tcg/tci.c index 3dc89ed829..6843e837ae 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -1076,3 +1076,286 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, } } } + +/* + * Disassembler that matches the interpreter + */ + +static const char *str_r(TCGReg r) +{ + static const char regs[TCG_TARGET_NB_REGS][4] = { + "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", + "r8", "r9", "r10", "r11", "r12", "r13", "env", "sp" + }; + + QEMU_BUILD_BUG_ON(TCG_AREG0 != TCG_REG_R14); + QEMU_BUILD_BUG_ON(TCG_REG_CALL_STACK != TCG_REG_R15); + + assert((unsigned)r < TCG_TARGET_NB_REGS); + return regs[r]; +} + +static const char *str_c(TCGCond c) +{ + static const char cond[16][8] = { + [TCG_COND_NEVER] = "never", + [TCG_COND_ALWAYS] = "always", + [TCG_COND_EQ] = "eq", + [TCG_COND_NE] = "ne", + [TCG_COND_LT] = "lt", + [TCG_COND_GE] = "ge", + [TCG_COND_LE] = "le", + [TCG_COND_GT] = "gt", + [TCG_COND_LTU] = "ltu", + [TCG_COND_GEU] = "geu", + [TCG_COND_LEU] = "leu", + [TCG_COND_GTU] = "gtu", + }; + + assert((unsigned)c < ARRAY_SIZE(cond)); + assert(cond[c][0] != 0); + return cond[c]; +} + +/* Disassemble TCI bytecode. */ +int print_insn_tci(bfd_vma addr, disassemble_info *info) +{ + uint8_t buf[256]; + int length, status; + const TCGOpDef *def; + const char *op_name; + TCGOpcode op; + TCGReg r0, r1, r2, r3; +#if TCG_TARGET_REG_BITS == 32 + TCGReg r4, r5; +#endif + tcg_target_ulong i1; + int32_t s2; + TCGCond c; + TCGMemOpIdx oi; + uint8_t pos, len; + void *ptr; + const uint8_t *tb_ptr; + + status = info->read_memory_func(addr, buf, 2, info); + if (status != 0) { + info->memory_error_func(status, addr, info); + return -1; + } + op = buf[0]; + length = buf[1]; + + if (length < 2) { + info->fprintf_func(info->stream, "invalid length %d", length); + return 1; + } + + status = info->read_memory_func(addr + 2, buf + 2, length - 2, info); + if (status != 0) { + info->memory_error_func(status, addr + 2, info); + return -1; + } + + def = &tcg_op_defs[op]; + op_name = def->name; + tb_ptr = buf + 2; + + switch (op) { + case INDEX_op_br: + case INDEX_op_call: + case INDEX_op_exit_tb: + case INDEX_op_goto_tb: + tci_args_l(&tb_ptr, &ptr); + info->fprintf_func(info->stream, "%-12s %p", op_name, ptr); + break; + + case INDEX_op_brcond_i32: + case INDEX_op_brcond_i64: + tci_args_rrcl(&tb_ptr, &r0, &r1, &c, &ptr); + info->fprintf_func(info->stream, "%-12s %s,%s,%s,%p", + op_name, str_r(r0), str_r(r1), str_c(c), ptr); + break; + + case INDEX_op_setcond_i32: + case INDEX_op_setcond_i64: + tci_args_rrrc(&tb_ptr, &r0, &r1, &r2, &c); + info->fprintf_func(info->stream, "%-12s %s,%s,%s,%s", + op_name, str_r(r0), str_r(r1), str_r(r2), str_c(c)); + break; + + case INDEX_op_tci_movi_i32: + tci_args_ri(&tb_ptr, &r0, &i1); + info->fprintf_func(info->stream, "%-12s %s,0x%" TCG_PRIlx "", + op_name, str_r(r0), i1); + break; + +#if TCG_TARGET_REG_BITS == 64 + case INDEX_op_tci_movi_i64: + tci_args_rI(&tb_ptr, &r0, &i1); + info->fprintf_func(info->stream, "%-12s %s,0x%" TCG_PRIlx "", + op_name, str_r(r0), i1); + break; +#endif + + case INDEX_op_ld8u_i32: + case INDEX_op_ld8u_i64: + case INDEX_op_ld8s_i32: + case INDEX_op_ld8s_i64: + case INDEX_op_ld16u_i32: + case INDEX_op_ld16u_i64: + case INDEX_op_ld16s_i32: + case INDEX_op_ld16s_i64: + case INDEX_op_ld32u_i64: + case INDEX_op_ld32s_i64: + case INDEX_op_ld_i32: + case INDEX_op_ld_i64: + case INDEX_op_st8_i32: + case INDEX_op_st8_i64: + case INDEX_op_st16_i32: + case INDEX_op_st16_i64: + case INDEX_op_st32_i64: + case INDEX_op_st_i32: + case INDEX_op_st_i64: + tci_args_rrs(&tb_ptr, &r0, &r1, &s2); + info->fprintf_func(info->stream, "%-12s %s,%s,%d", + op_name, str_r(r0), str_r(r1), s2); + break; + + case INDEX_op_mov_i32: + case INDEX_op_mov_i64: + case INDEX_op_ext8s_i32: + case INDEX_op_ext8s_i64: + case INDEX_op_ext8u_i32: + case INDEX_op_ext8u_i64: + case INDEX_op_ext16s_i32: + case INDEX_op_ext16s_i64: + case INDEX_op_ext16u_i32: + case INDEX_op_ext32s_i64: + case INDEX_op_ext32u_i64: + case INDEX_op_ext_i32_i64: + case INDEX_op_extu_i32_i64: + case INDEX_op_bswap16_i32: + case INDEX_op_bswap16_i64: + case INDEX_op_bswap32_i32: + case INDEX_op_bswap32_i64: + case INDEX_op_bswap64_i64: + case INDEX_op_not_i32: + case INDEX_op_not_i64: + case INDEX_op_neg_i32: + case INDEX_op_neg_i64: + tci_args_rr(&tb_ptr, &r0, &r1); + info->fprintf_func(info->stream, "%-12s %s,%s", + op_name, str_r(r0), str_r(r1)); + break; + + case INDEX_op_add_i32: + case INDEX_op_add_i64: + case INDEX_op_sub_i32: + case INDEX_op_sub_i64: + case INDEX_op_mul_i32: + case INDEX_op_mul_i64: + case INDEX_op_and_i32: + case INDEX_op_and_i64: + case INDEX_op_or_i32: + case INDEX_op_or_i64: + case INDEX_op_xor_i32: + case INDEX_op_xor_i64: + case INDEX_op_div_i32: + case INDEX_op_div_i64: + case INDEX_op_rem_i32: + case INDEX_op_rem_i64: + case INDEX_op_divu_i32: + case INDEX_op_divu_i64: + case INDEX_op_remu_i32: + case INDEX_op_remu_i64: + case INDEX_op_shl_i32: + case INDEX_op_shl_i64: + case INDEX_op_shr_i32: + case INDEX_op_shr_i64: + case INDEX_op_sar_i32: + case INDEX_op_sar_i64: + case INDEX_op_rotl_i32: + case INDEX_op_rotl_i64: + case INDEX_op_rotr_i32: + case INDEX_op_rotr_i64: + tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + info->fprintf_func(info->stream, "%-12s %s,%s,%s", + op_name, str_r(r0), str_r(r1), str_r(r2)); + break; + + case INDEX_op_deposit_i32: + case INDEX_op_deposit_i64: + tci_args_rrrbb(&tb_ptr, &r0, &r1, &r2, &pos, &len); + info->fprintf_func(info->stream, "%-12s %s,%s,%s,%d,%d", + op_name, str_r(r0), str_r(r1), str_r(r2), pos, len); + break; + +#if TCG_TARGET_REG_BITS == 32 + case INDEX_op_setcond2_i32: + tci_args_rrrrrc(&tb_ptr, &r0, &r1, &r2, &r3, &r4, &c); + info->fprintf_func(info->stream, "%-12s %s,%s,%s,%s,%s,%s", + op_name, str_r(r0), str_r(r1), str_r(r2), + str_r(r3), str_r(r4), str_c(c)); + break; + + case INDEX_op_brcond2_i32: + tci_args_rrrrcl(&tb_ptr, &r0, &r1, &r2, &r3, &c, &ptr); + info->fprintf_func(info->stream, "%-12s %s,%s,%s,%s,%s,%p", + op_name, str_r(r0), str_r(r1), + str_r(r2), str_r(r3), str_c(c), ptr); + break; + + case INDEX_op_mulu2_i32: + tci_args_rrrr(&tb_ptr, &r0, &r1, &r2, &r3); + info->fprintf_func(info->stream, "%-12s %s,%s,%s,%s", + op_name, str_r(r0), str_r(r1), + str_r(r2), str_r(r3)); + break; + + case INDEX_op_add2_i32: + case INDEX_op_sub2_i32: + tci_args_rrrrrr(&tb_ptr, &r0, &r1, &r2, &r3, &r4, &r5); + info->fprintf_func(info->stream, "%-12s %s,%s,%s,%s,%s,%s", + op_name, str_r(r0), str_r(r1), str_r(r2), + str_r(r3), str_r(r4), str_r(r5)); + break; +#endif + + case INDEX_op_qemu_ld_i64: + case INDEX_op_qemu_st_i64: + len = DIV_ROUND_UP(64, TCG_TARGET_REG_BITS); + goto do_qemu_ldst; + case INDEX_op_qemu_ld_i32: + case INDEX_op_qemu_st_i32: + len = 1; + do_qemu_ldst: + len += DIV_ROUND_UP(TARGET_LONG_BITS, TCG_TARGET_REG_BITS); + switch (len) { + case 2: + tci_args_rrm(&tb_ptr, &r0, &r1, &oi); + info->fprintf_func(info->stream, "%-12s %s,%s,%x", + op_name, str_r(r0), str_r(r1), oi); + break; + case 3: + tci_args_rrrm(&tb_ptr, &r0, &r1, &r2, &oi); + info->fprintf_func(info->stream, "%-12s %s,%s,%s,%x", + op_name, str_r(r0), str_r(r1), str_r(r2), oi); + break; + case 4: + tci_args_rrrrm(&tb_ptr, &r0, &r1, &r2, &r3, &oi); + info->fprintf_func(info->stream, "%-12s %s,%s,%s,%s,%x", + op_name, str_r(r0), str_r(r1), + str_r(r2), str_r(r3), oi); + break; + default: + g_assert_not_reached(); + } + break; + + default: + info->fprintf_func(info->stream, "illegal opcode %d", op); + break; + } + + return length; +} From patchwork Thu Feb 4 01:44:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376190 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp915479ejt; Wed, 3 Feb 2021 18:25:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJymTWVHWueWRV9oKB2AdkmoMd1VGoBLErNTgJ8iUKZpMgeBRWMGJh3Y2v0T8YFrepJJIL40 X-Received: by 2002:a25:b8c7:: with SMTP id g7mr9210546ybm.432.1612405528128; Wed, 03 Feb 2021 18:25:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612405528; cv=none; d=google.com; s=arc-20160816; b=DQnZoKpgoBSZqghWEaX67UC5XzK/n3SvhPp5rJADkLdwyee0qp7bCbLH0ORpO+N4+d rUjFZLQvUiKJJ/5CeR/JFqYlvkFZ0ENm/1uT8nCK7ihbAU45cfJz68L4uh6lEh9/leVH OVy0PDo9Ggd+Y5YBBCxAZ4XOmCMM+ZYc2KgCqvf9TbTGtrfvbqB1W86gl/lwlRmM6AC8 Axitpj0Dj31M3ye3omijukAvj5zjXX/Jrm8bXvcAYhj5mPbYfT/52inyt2iFjNTOL5Bw NAT3sIcoF/aQy14xyocRzZ/4LzAj85EeUp2forlwgmOLWT55bOxgPmQdpcULOMIF2N/h 0LoQ== 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=grvYIe5/Gge3fEjJZ+Bf2tCoajmCwbWXSaPGURmUcZ8=; b=QzmthRH9ha1pjSN/HyqjcXvrnDG/zq48V1bIqMYELxlk0GHuDW8DzjIILZ71II7uHt njEQWo1oXTh0IGJDwsbUKs9ZbWu0qO/hvqCFMe7UblvbuRNXNiEOn6ZDiPo8VWeQ27kp N79CFD9DgHy3k8rJhwzPwQgbLlq+guDFkOB9slD0G6jDu8Jl07rwOM5DmGFqx+PcZj+2 1HsUujQFlJkumadliWun16hAImeLy5qFbctbPgdl6VapFZdo7UUw/sAnN8XGkqQCwsf+ url1kY+I97TCpMjqv376kazj5ds0eN23eIrPx6m6hMPDKFnyhFlbzo0se/WuwtfCLy1N lcQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=q7iaJi3g; 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 r141si4617290ybc.469.2021.02.03.18.25.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:25:28 -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=q7iaJi3g; 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]:53968 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7UKl-0000WB-G8 for patch@linaro.org; Wed, 03 Feb 2021 21:25:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45182) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Tjc-00066J-VH for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:47:05 -0500 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]:33138) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Tja-000474-Gi for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:47:04 -0500 Received: by mail-pl1-x631.google.com with SMTP id d13so907191plg.0 for ; Wed, 03 Feb 2021 17:47:02 -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=grvYIe5/Gge3fEjJZ+Bf2tCoajmCwbWXSaPGURmUcZ8=; b=q7iaJi3gYygMtaRXPTvu6GtaXPRfBgl+/el9DE2WQKzTmRVCfrnTvJO3gqEL2fcYt+ Uq/2EDWAPkhVEAW1TO3PuFit54Vo0r6Zvt4zHKZXrw/h1ifd1xIwXSoskarGpTId1cul iPOlCKJGzLCuFbBh91NKOt3fZ9o1CiNAGvfmn3GEjAp63nwnWKlswS4mBY4FwUWN5Hit QKp/NMr4fApV3TiD1Sn+FVD/jHA1pYJuPk8NmPLZnLluTobKwqUh8XD8ofDJokJXxkMv eiazsUMOa7kq8ofTVic/zyxUyGwTTAXjiQh4SX8zM1muipEAghrXczvy99rbLwul1MA/ hgBQ== 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=grvYIe5/Gge3fEjJZ+Bf2tCoajmCwbWXSaPGURmUcZ8=; b=JmpBzFrCVzUNmMXrNYQXMKtAAB7t34c9j50RbEVYUJ398PLyFiZnAeywkYLca5R/vo sXOyqZprDwiX6C/A0vB/92grwJnwGxn+GP5lFlNehSoC68/1HB+iz8BlgoLV0Nf/DWA2 40KTIykNWyLOpk9O9G4tJBRrba0knMGoU8zeZV+ktUxFUPbpzTj6v31ssMOYRGOqf1Iz gFFw1kKsSQLtLUVMXnXbIxFIul+2xj/NDn/cfNhGyw0OSuY7KzTTmiIq3zWNRNPRRxTp q8NO1zIxumUf9JW3gWFw8FzF42ncNXzNgleJ1E/RoHtcmUc3qybqVvuyj0U5IWBwqZXb HOaQ== X-Gm-Message-State: AOAM531aq+HgA2iXvEeZ0i7lA/WtI+148ElhcmM+kudP7mZ54W3nbMwk gEor8OBVvDWt4GO7BNL14I5sp08HW9j3S7Rl X-Received: by 2002:a17:903:1c3:b029:de:6b19:e72e with SMTP id e3-20020a17090301c3b02900de6b19e72emr5791099plh.63.1612403221043; Wed, 03 Feb 2021 17:47:01 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.46.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:47:00 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 62/93] tcg: Build ffi data structures for helpers Date: Wed, 3 Feb 2021 15:44:38 -1000 Message-Id: <20210204014509.882821-63-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We will shortly use libffi for tci, as that is the only portable way of calling arbitrary functions. Signed-off-by: Richard Henderson --- meson.build | 9 +- include/exec/helper-ffi.h | 115 +++++++++++++++++++++++++ include/exec/helper-tcg.h | 24 ++++-- target/hppa/helper.h | 2 + target/i386/ops_sse_header.h | 6 ++ target/m68k/helper.h | 1 + target/ppc/helper.h | 3 + tcg/tcg.c | 20 +++++ tests/docker/dockerfiles/fedora.docker | 1 + 9 files changed, 172 insertions(+), 9 deletions(-) create mode 100644 include/exec/helper-ffi.h -- 2.25.1 diff --git a/meson.build b/meson.build index 475d8a94ea..fc08f15a00 100644 --- a/meson.build +++ b/meson.build @@ -1901,7 +1901,14 @@ specific_ss.add(when: 'CONFIG_TCG', if_true: files( 'tcg/tcg-op.c', 'tcg/tcg.c', )) -specific_ss.add(when: 'CONFIG_TCG_INTERPRETER', if_true: files('tcg/tci.c')) + +if get_option('tcg_interpreter') + libffi = dependency('libffi', version: '>=3.0', + static: enable_static, method: 'pkg-config', + required: true) + specific_ss.add(libffi) + specific_ss.add(files('tcg/tci.c')) +endif subdir('backends') subdir('disas') diff --git a/include/exec/helper-ffi.h b/include/exec/helper-ffi.h new file mode 100644 index 0000000000..3af1065af3 --- /dev/null +++ b/include/exec/helper-ffi.h @@ -0,0 +1,115 @@ +/* + * Helper file for declaring TCG helper functions. + * This one defines data structures private to tcg.c. + */ + +#ifndef HELPER_FFI_H +#define HELPER_FFI_H 1 + +#include "exec/helper-head.h" + +#define dh_ffitype_i32 &ffi_type_uint32 +#define dh_ffitype_s32 &ffi_type_sint32 +#define dh_ffitype_int &ffi_type_sint +#define dh_ffitype_i64 &ffi_type_uint64 +#define dh_ffitype_s64 &ffi_type_sint64 +#define dh_ffitype_f16 &ffi_type_uint32 +#define dh_ffitype_f32 &ffi_type_uint32 +#define dh_ffitype_f64 &ffi_type_uint64 +#ifdef TARGET_LONG_BITS +# if TARGET_LONG_BITS == 32 +# define dh_ffitype_tl &ffi_type_uint32 +# else +# define dh_ffitype_tl &ffi_type_uint64 +# endif +#endif +#define dh_ffitype_ptr &ffi_type_pointer +#define dh_ffitype_cptr &ffi_type_pointer +#define dh_ffitype_void &ffi_type_void +#define dh_ffitype_noreturn &ffi_type_void +#define dh_ffitype_env &ffi_type_pointer +#define dh_ffitype(t) glue(dh_ffitype_, t) + +#define DEF_HELPER_FLAGS_0(NAME, FLAGS, ret) \ + static ffi_cif glue(cif_,NAME) = { \ + .rtype = dh_ffitype(ret), .nargs = 0, \ + }; + +#define DEF_HELPER_FLAGS_1(NAME, FLAGS, ret, t1) \ + static ffi_type *glue(cif_args_,NAME)[1] = { dh_ffitype(t1) }; \ + static ffi_cif glue(cif_,NAME) = { \ + .rtype = dh_ffitype(ret), .nargs = 1, \ + .arg_types = glue(cif_args_,NAME), \ + }; + +#define DEF_HELPER_FLAGS_2(NAME, FLAGS, ret, t1, t2) \ + static ffi_type *glue(cif_args_,NAME)[2] = { \ + dh_ffitype(t1), dh_ffitype(t2) \ + }; \ + static ffi_cif glue(cif_,NAME) = { \ + .rtype = dh_ffitype(ret), .nargs = 2, \ + .arg_types = glue(cif_args_,NAME), \ + }; + +#define DEF_HELPER_FLAGS_3(NAME, FLAGS, ret, t1, t2, t3) \ + static ffi_type *glue(cif_args_,NAME)[3] = { \ + dh_ffitype(t1), dh_ffitype(t2), dh_ffitype(t3) \ + }; \ + static ffi_cif glue(cif_,NAME) = { \ + .rtype = dh_ffitype(ret), .nargs = 3, \ + .arg_types = glue(cif_args_,NAME), \ + }; + +#define DEF_HELPER_FLAGS_4(NAME, FLAGS, ret, t1, t2, t3, t4) \ + static ffi_type *glue(cif_args_,NAME)[4] = { \ + dh_ffitype(t1), dh_ffitype(t2), dh_ffitype(t3), dh_ffitype(t4) \ + }; \ + static ffi_cif glue(cif_,NAME) = { \ + .rtype = dh_ffitype(ret), .nargs = 4, \ + .arg_types = glue(cif_args_,NAME), \ + }; + +#define DEF_HELPER_FLAGS_5(NAME, FLAGS, ret, t1, t2, t3, t4, t5) \ + static ffi_type *glue(cif_args_,NAME)[5] = { \ + dh_ffitype(t1), dh_ffitype(t2), dh_ffitype(t3), \ + dh_ffitype(t4), dh_ffitype(t5) \ + }; \ + static ffi_cif glue(cif_,NAME) = { \ + .rtype = dh_ffitype(ret), .nargs = 5, \ + .arg_types = glue(cif_args_,NAME), \ + }; + +#define DEF_HELPER_FLAGS_6(NAME, FLAGS, ret, t1, t2, t3, t4, t5, t6) \ + static ffi_type *glue(cif_args_,NAME)[6] = { \ + dh_ffitype(t1), dh_ffitype(t2), dh_ffitype(t3), \ + dh_ffitype(t4), dh_ffitype(t5), dh_ffitype(t6) \ + }; \ + static ffi_cif glue(cif_,NAME) = { \ + .rtype = dh_ffitype(ret), .nargs = 6, \ + .arg_types = glue(cif_args_,NAME), \ + }; + +#define DEF_HELPER_FLAGS_7(NAME, FLAGS, ret, t1, t2, t3, t4, t5, t6, t7) \ + static ffi_type *glue(cif_args_,NAME)[7] = { \ + dh_ffitype(t1), dh_ffitype(t2), dh_ffitype(t3), \ + dh_ffitype(t4), dh_ffitype(t5), dh_ffitype(t6), dh_ffitype(t7) \ + }; \ + static ffi_cif glue(cif_,NAME) = { \ + .rtype = dh_ffitype(ret), .nargs = 7, \ + .arg_types = glue(cif_args_,NAME), \ + }; + +#include "helper.h" +#include "trace/generated-helpers.h" +#include "tcg-runtime.h" + +#undef DEF_HELPER_FLAGS_0 +#undef DEF_HELPER_FLAGS_1 +#undef DEF_HELPER_FLAGS_2 +#undef DEF_HELPER_FLAGS_3 +#undef DEF_HELPER_FLAGS_4 +#undef DEF_HELPER_FLAGS_5 +#undef DEF_HELPER_FLAGS_6 +#undef DEF_HELPER_FLAGS_7 + +#endif /* HELPER_FFI_H */ diff --git a/include/exec/helper-tcg.h b/include/exec/helper-tcg.h index 27870509a2..a71b848576 100644 --- a/include/exec/helper-tcg.h +++ b/include/exec/helper-tcg.h @@ -10,50 +10,57 @@ to get all the macros expanded first. */ #define str(s) #s +#ifdef CONFIG_TCG_INTERPRETER +# define DO_CIF(NAME) .cif = &cif_##NAME, +#else +# define DO_CIF(NAME) +#endif + #define DEF_HELPER_FLAGS_0(NAME, FLAGS, ret) \ - { .func = HELPER(NAME), .name = str(NAME), \ + { .func = HELPER(NAME), DO_CIF(NAME) .name = str(NAME), \ .flags = FLAGS | dh_callflag(ret), \ .sizemask = dh_sizemask(ret, 0) }, #define DEF_HELPER_FLAGS_1(NAME, FLAGS, ret, t1) \ - { .func = HELPER(NAME), .name = str(NAME), \ + { .func = HELPER(NAME), DO_CIF(NAME) .name = str(NAME), \ .flags = FLAGS | dh_callflag(ret), \ .sizemask = dh_sizemask(ret, 0) | dh_sizemask(t1, 1) }, #define DEF_HELPER_FLAGS_2(NAME, FLAGS, ret, t1, t2) \ - { .func = HELPER(NAME), .name = str(NAME), \ + { .func = HELPER(NAME), DO_CIF(NAME) .name = str(NAME), \ .flags = FLAGS | dh_callflag(ret), \ .sizemask = dh_sizemask(ret, 0) | dh_sizemask(t1, 1) \ | dh_sizemask(t2, 2) }, #define DEF_HELPER_FLAGS_3(NAME, FLAGS, ret, t1, t2, t3) \ - { .func = HELPER(NAME), .name = str(NAME), \ + { .func = HELPER(NAME), DO_CIF(NAME) .name = str(NAME), \ .flags = FLAGS | dh_callflag(ret), \ .sizemask = dh_sizemask(ret, 0) | dh_sizemask(t1, 1) \ | dh_sizemask(t2, 2) | dh_sizemask(t3, 3) }, #define DEF_HELPER_FLAGS_4(NAME, FLAGS, ret, t1, t2, t3, t4) \ - { .func = HELPER(NAME), .name = str(NAME), \ + { .func = HELPER(NAME), DO_CIF(NAME) .name = str(NAME), \ .flags = FLAGS | dh_callflag(ret), \ .sizemask = dh_sizemask(ret, 0) | dh_sizemask(t1, 1) \ | dh_sizemask(t2, 2) | dh_sizemask(t3, 3) | dh_sizemask(t4, 4) }, #define DEF_HELPER_FLAGS_5(NAME, FLAGS, ret, t1, t2, t3, t4, t5) \ - { .func = HELPER(NAME), .name = str(NAME), \ + { .func = HELPER(NAME), DO_CIF(NAME) .name = str(NAME), \ .flags = FLAGS | dh_callflag(ret), \ .sizemask = dh_sizemask(ret, 0) | dh_sizemask(t1, 1) \ | dh_sizemask(t2, 2) | dh_sizemask(t3, 3) | dh_sizemask(t4, 4) \ | dh_sizemask(t5, 5) }, #define DEF_HELPER_FLAGS_6(NAME, FLAGS, ret, t1, t2, t3, t4, t5, t6) \ - { .func = HELPER(NAME), .name = str(NAME), \ + { .func = HELPER(NAME), DO_CIF(NAME) .name = str(NAME), \ .flags = FLAGS | dh_callflag(ret), \ .sizemask = dh_sizemask(ret, 0) | dh_sizemask(t1, 1) \ | dh_sizemask(t2, 2) | dh_sizemask(t3, 3) | dh_sizemask(t4, 4) \ | dh_sizemask(t5, 5) | dh_sizemask(t6, 6) }, #define DEF_HELPER_FLAGS_7(NAME, FLAGS, ret, t1, t2, t3, t4, t5, t6, t7) \ - { .func = HELPER(NAME), .name = str(NAME), .flags = FLAGS, \ + { .func = HELPER(NAME), DO_CIF(NAME) .name = str(NAME), \ + .flags = FLAGS | dh_callflag(ret), \ .sizemask = dh_sizemask(ret, 0) | dh_sizemask(t1, 1) \ | dh_sizemask(t2, 2) | dh_sizemask(t3, 3) | dh_sizemask(t4, 4) \ | dh_sizemask(t5, 5) | dh_sizemask(t6, 6) | dh_sizemask(t7, 7) }, @@ -64,6 +71,7 @@ #include "plugin-helpers.h" #undef str +#undef DO_CIF #undef DEF_HELPER_FLAGS_0 #undef DEF_HELPER_FLAGS_1 #undef DEF_HELPER_FLAGS_2 diff --git a/target/hppa/helper.h b/target/hppa/helper.h index 2d483aab58..35c612f09d 100644 --- a/target/hppa/helper.h +++ b/target/hppa/helper.h @@ -1,9 +1,11 @@ #if TARGET_REGISTER_BITS == 64 # define dh_alias_tr i64 # define dh_is_64bit_tr 1 +# define dh_ffitype_tr dh_ffitype_i64 #else # define dh_alias_tr i32 # define dh_is_64bit_tr 0 +# define dh_ffitype_tr dh_ffitype_i32 #endif #define dh_ctype_tr target_ureg #define dh_is_signed_tr 0 diff --git a/target/i386/ops_sse_header.h b/target/i386/ops_sse_header.h index 6c0c849347..cae50f77eb 100644 --- a/target/i386/ops_sse_header.h +++ b/target/i386/ops_sse_header.h @@ -27,13 +27,19 @@ #define dh_alias_Reg ptr #define dh_alias_ZMMReg ptr #define dh_alias_MMXReg ptr + #define dh_ctype_Reg Reg * #define dh_ctype_ZMMReg ZMMReg * #define dh_ctype_MMXReg MMXReg * + #define dh_is_signed_Reg dh_is_signed_ptr #define dh_is_signed_ZMMReg dh_is_signed_ptr #define dh_is_signed_MMXReg dh_is_signed_ptr +#define dh_ffitype_Reg dh_ffitype_ptr +#define dh_ffitype_ZMMReg dh_ffitype_ptr +#define dh_ffitype_MMXReg dh_ffitype_ptr + DEF_HELPER_3(glue(psrlw, SUFFIX), void, env, Reg, Reg) DEF_HELPER_3(glue(psraw, SUFFIX), void, env, Reg, Reg) DEF_HELPER_3(glue(psllw, SUFFIX), void, env, Reg, Reg) diff --git a/target/m68k/helper.h b/target/m68k/helper.h index 77808497a9..672c99d5de 100644 --- a/target/m68k/helper.h +++ b/target/m68k/helper.h @@ -18,6 +18,7 @@ DEF_HELPER_4(cas2l_parallel, void, env, i32, i32, i32) #define dh_alias_fp ptr #define dh_ctype_fp FPReg * #define dh_is_signed_fp dh_is_signed_ptr +#define dh_ffitype_fp dh_ffitype_ptr DEF_HELPER_3(exts32, void, env, fp, s32) DEF_HELPER_3(extf32, void, env, fp, f32) diff --git a/target/ppc/helper.h b/target/ppc/helper.h index 6a4dccf70c..bbd4700064 100644 --- a/target/ppc/helper.h +++ b/target/ppc/helper.h @@ -108,10 +108,12 @@ DEF_HELPER_FLAGS_1(ftsqrt, TCG_CALL_NO_RWG_SE, i32, i64) #define dh_alias_avr ptr #define dh_ctype_avr ppc_avr_t * #define dh_is_signed_avr dh_is_signed_ptr +#define dh_ffitype_avr dh_ffitype_ptr #define dh_alias_vsr ptr #define dh_ctype_vsr ppc_vsr_t * #define dh_is_signed_vsr dh_is_signed_ptr +#define dh_ffitype_vsr dh_ffitype_ptr DEF_HELPER_3(vavgub, void, avr, avr, avr) DEF_HELPER_3(vavguh, void, avr, avr, avr) @@ -696,6 +698,7 @@ DEF_HELPER_3(store_601_batu, void, env, i32, tl) #define dh_alias_fprp ptr #define dh_ctype_fprp ppc_fprp_t * #define dh_is_signed_fprp dh_is_signed_ptr +#define dh_ffitype_fprp dh_ffitype_ptr DEF_HELPER_4(dadd, void, env, fprp, fprp, fprp) DEF_HELPER_4(daddq, void, env, fprp, fprp, fprp) diff --git a/tcg/tcg.c b/tcg/tcg.c index 2991112829..6382112215 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -66,6 +66,10 @@ #include "exec/log.h" #include "sysemu/sysemu.h" +#ifdef CONFIG_TCG_INTERPRETER +#include +#endif + /* Forward declarations for functions declared in tcg-target.c.inc and used here. */ static void tcg_target_init(TCGContext *s); @@ -1082,6 +1086,9 @@ void tcg_pool_reset(TCGContext *s) typedef struct TCGHelperInfo { void *func; +#ifdef CONFIG_TCG_INTERPRETER + ffi_cif *cif; +#endif const char *name; unsigned flags; unsigned sizemask; @@ -1089,6 +1096,10 @@ typedef struct TCGHelperInfo { #include "exec/helper-proto.h" +#ifdef CONFIG_TCG_INTERPRETER +#include "exec/helper-ffi.h" +#endif + static const TCGHelperInfo all_helpers[] = { #include "exec/helper-tcg.h" }; @@ -1136,6 +1147,15 @@ void tcg_context_init(TCGContext *s) (gpointer)&all_helpers[i]); } +#ifdef CONFIG_TCG_INTERPRETER + for (i = 0; i < ARRAY_SIZE(all_helpers); ++i) { + ffi_cif *cif = all_helpers[i].cif; + ffi_status ok = ffi_prep_cif(cif, FFI_DEFAULT_ABI, cif->nargs, + cif->rtype, cif->arg_types); + tcg_debug_assert(ok == FFI_OK); + } +#endif + tcg_target_init(s); process_op_defs(s); diff --git a/tests/docker/dockerfiles/fedora.docker b/tests/docker/dockerfiles/fedora.docker index 0d7602abbe..45fc1a77bd 100644 --- a/tests/docker/dockerfiles/fedora.docker +++ b/tests/docker/dockerfiles/fedora.docker @@ -32,6 +32,7 @@ ENV PACKAGES \ libcurl-devel \ libepoxy-devel \ libfdt-devel \ + libffi-devel \ libiscsi-devel \ libjpeg-devel \ libpmem-devel \ From patchwork Thu Feb 4 01:44:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376212 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp862953jah; Wed, 3 Feb 2021 18:43:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJyIPiUsrPddnt4S2eqTtKh0KCwFB88dJ7wWTtuxuDegeAHZ3O86jcHmiWkYrt8uDQHELo0h X-Received: by 2002:a25:d910:: with SMTP id q16mr8800596ybg.199.1612406619615; Wed, 03 Feb 2021 18:43:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612406619; cv=none; d=google.com; s=arc-20160816; b=Of8hqV0jHg1kuDdmMZQjskzu4D8yImCiRiIGQ5cfffvne+ZSUrbz3dE99ELhJX53ZB 8y0HPf5Ean2OGAfb7s7svsWEewMY3V75WpOKk07iXwJts9Fon6IxJSYFdGpb0OEp+H1F AyglHrw2AFS4/nlE+flwiQXH0sHz7kOfg1U93fkwUP28kNW1r5F6PUG0dnwIjQXgPKKl 8b5KFTdJenhJXNuWhHbbfmqYVvVeJraMkTsWo8jvumTYn1vO+60PaHASDuOTtloByrY6 AK4VfJgxVHKkCM89m5EUhrx2oYdmM2hMxtlxU3wODZx+K+Ytt8tTimWkjWhq22BToenI idjQ== 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=vBr7vhN4PGwbH1KaQVzNdMhftTOwE1A/EapiaKgFiUE=; b=X7AdsDH39o3rNFZc4g6XM62F0Wvpi/zz//TCsc2jmpfqHAYds2m5jmUpUBcbW6ORUl n37Zj2TfkOAvO+qeX9+aWrX1R7N60DhpyHoIJ7/Y8b3YSFOwD3B4NA2vYoIv/Trp+Nnd wHvpDgOYO1KAL7NbafPJQdh+LLxd5rUbfIXC6aI+lxEo3w4AKu4CsDzqslrCWUg1+vRz kmQmgaO8lTmnc0D/rOfuHty2iHUPdBOqQ5KLfEjBYFmOCrDneGNLzI7NIOROlCZ3t8Db 7Gq1Ppi/O20kfaPOrbe0ZLocH+jigZuLEP4s+13d29nzKvWPvVZyKWuD+os2JeUZqdX4 VEhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CO9J7dL7; 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 t11si4028719ybp.365.2021.02.03.18.43.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:43:39 -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=CO9J7dL7; 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]:46268 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7UcN-0004s1-1M for patch@linaro.org; Wed, 03 Feb 2021 21:43:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45216) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Tjf-0006Bn-Bf for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:47:07 -0500 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]:35669) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Tjc-00047i-DS for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:47:07 -0500 Received: by mail-pj1-x1034.google.com with SMTP id e9so831867pjj.0 for ; Wed, 03 Feb 2021 17:47:03 -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=vBr7vhN4PGwbH1KaQVzNdMhftTOwE1A/EapiaKgFiUE=; b=CO9J7dL7EWXW/OBV9snxEJgzSf/GIUx2LVvCTNBerfGYfq7AKev9x8K1/6J2U25fBo 7EvCGMBEl+BY+5RjjH2tie4ct03kphd74zCxe2O9nb3pZGSRMpoBiw0tetfIaJzVH2Gb pmJMRhGOTMrUbKjBabGjwojOjRGpNsTCxGrSfb5u/YN5BhQA1yuf75uWX9HpN4IM58gk mniAHjszYrvxKMFxR1Kg4tMaQAAHqY+VXIVmx8aC9vSx3trAMW57kWS4aRJZ+lu6s5bH YHAHC05gtZR7KF96YLyGsu64mdxtqwKOOFqITGpMPwruqRtFPzxM0qiuhysZLai4dIrA ancg== 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=vBr7vhN4PGwbH1KaQVzNdMhftTOwE1A/EapiaKgFiUE=; b=tyXDHK3uqNDrNFhM4Z9PD5IBFlUsEkKQxDS3M9FGdpJActmeExuvPwNfLbd0fxuOh1 XKpBdD7me5PI+qMSuOVGkrE4Qa+2Ajdn7CNyoN+Doqnvy1HmK7HQyo45iPs/6RGcrryJ PvYHmHsRWPWP2FZhzu6CsapVsWLUxj7AEzZ6yxW3lrO3Pw67uI/9zkAvnQxQNCtx+lBu EVBCUb9rZ01p7fFLmJRFQxbzEkPA1QZKN4/FK8gKYtWZ1RPS+fiBBOUVAY1G2oJo11X4 aWcyqyiGppBX5ryAGG9GgKlHqE6mA/tnHBWdum8PH4P7ugVSoZ0Q7XOVJZfqiUbbMpvk Yjmg== X-Gm-Message-State: AOAM532bBq/gAVp9HbWiEt+e1kAPfzhojx5uIPYagoWr1oajiAmHyDTO zwQO4h3c2aiNT9svj2oRMSrGhHEjAdGrJ2lh X-Received: by 2002:a17:902:be0e:b029:e0:5b2:659e with SMTP id r14-20020a170902be0eb02900e005b2659emr5693999pls.74.1612403222675; Wed, 03 Feb 2021 17:47:02 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.47.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:47:02 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 63/93] tcg/tci: Use ffi for calls Date: Wed, 3 Feb 2021 15:44:39 -1000 Message-Id: <20210204014509.882821-64-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1034; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1034.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This requires adjusting where arguments are stored. Place them on the stack at left-aligned positions. Adjust the stack frame to be at entirely positive offsets. Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 1 + tcg/tci/tcg-target.h | 2 +- tcg/tcg.c | 72 ++++++++++++--------- tcg/tci.c | 131 ++++++++++++++++++++++----------------- tcg/tci/tcg-target.c.inc | 50 +++++++-------- 5 files changed, 143 insertions(+), 113 deletions(-) -- 2.25.1 diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index 0f0695e90d..e5573a9877 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -53,6 +53,7 @@ #define MAX_OPC_PARAM (4 + (MAX_OPC_PARAM_PER_ARG * MAX_OPC_PARAM_ARGS)) #define CPU_TEMP_BUF_NLONGS 128 +#define TCG_STATIC_FRAME_SIZE (CPU_TEMP_BUF_NLONGS * sizeof(long)) /* Default target word size to pointer size. */ #ifndef TCG_TARGET_REG_BITS diff --git a/tcg/tci/tcg-target.h b/tcg/tci/tcg-target.h index 52af6d8bc5..4df10e2e83 100644 --- a/tcg/tci/tcg-target.h +++ b/tcg/tci/tcg-target.h @@ -161,7 +161,7 @@ typedef enum { /* Used for function call generation. */ #define TCG_TARGET_CALL_STACK_OFFSET 0 -#define TCG_TARGET_STACK_ALIGN 16 +#define TCG_TARGET_STACK_ALIGN 8 #define HAVE_TCG_QEMU_TB_EXEC diff --git a/tcg/tcg.c b/tcg/tcg.c index 6382112215..92aec0d238 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -208,6 +208,18 @@ static size_t tree_size; static TCGRegSet tcg_target_available_regs[TCG_TYPE_COUNT]; static TCGRegSet tcg_target_call_clobber_regs; +typedef struct TCGHelperInfo { + void *func; +#ifdef CONFIG_TCG_INTERPRETER + ffi_cif *cif; +#endif + const char *name; + unsigned flags; + unsigned sizemask; +} TCGHelperInfo; + +static GHashTable *helper_table; + #if TCG_TARGET_INSN_UNIT_SIZE == 1 static __attribute__((unused)) inline void tcg_out8(TCGContext *s, uint8_t v) { @@ -1084,16 +1096,6 @@ void tcg_pool_reset(TCGContext *s) s->pool_current = NULL; } -typedef struct TCGHelperInfo { - void *func; -#ifdef CONFIG_TCG_INTERPRETER - ffi_cif *cif; -#endif - const char *name; - unsigned flags; - unsigned sizemask; -} TCGHelperInfo; - #include "exec/helper-proto.h" #ifdef CONFIG_TCG_INTERPRETER @@ -1103,7 +1105,6 @@ typedef struct TCGHelperInfo { static const TCGHelperInfo all_helpers[] = { #include "exec/helper-tcg.h" }; -static GHashTable *helper_table; static int indirect_reg_alloc_order[ARRAY_SIZE(tcg_target_reg_alloc_order)]; static void process_op_defs(TCGContext *s); @@ -2081,25 +2082,38 @@ void tcg_gen_callN(void *func, TCGTemp *ret, int nargs, TCGTemp **args) real_args = 0; for (i = 0; i < nargs; i++) { - int is_64bit = sizemask & (1 << (i+1)*2); - if (TCG_TARGET_REG_BITS < 64 && is_64bit) { -#ifdef TCG_TARGET_CALL_ALIGN_ARGS - /* some targets want aligned 64 bit args */ - if (real_args & 1) { - op->args[pi++] = TCG_CALL_DUMMY_ARG; - real_args++; - } + bool is_64bit = sizemask & (1 << (i+1)*2); + bool want_align = false; + +#if defined(CONFIG_TCG_INTERPRETER) + /* + * Align all arguments, so that they land in predictable places + * for passing off to ffi_call. + */ + want_align = true; +#elif defined(TCG_TARGET_CALL_ALIGN_ARGS) + /* Some targets want aligned 64 bit args */ + want_align = is_64bit; #endif - /* If stack grows up, then we will be placing successive - arguments at lower addresses, which means we need to - reverse the order compared to how we would normally - treat either big or little-endian. For those arguments - that will wind up in registers, this still works for - HPPA (the only current STACK_GROWSUP target) since the - argument registers are *also* allocated in decreasing - order. If another such target is added, this logic may - have to get more complicated to differentiate between - stack arguments and register arguments. */ + + if (TCG_TARGET_REG_BITS < 64 && want_align && (real_args & 1)) { + op->args[pi++] = TCG_CALL_DUMMY_ARG; + real_args++; + } + + if (TCG_TARGET_REG_BITS < 64 && is_64bit) { + /* + * If stack grows up, then we will be placing successive + * arguments at lower addresses, which means we need to + * reverse the order compared to how we would normally + * treat either big or little-endian. For those arguments + * that will wind up in registers, this still works for + * HPPA (the only current STACK_GROWSUP target) since the + * argument registers are *also* allocated in decreasing + * order. If another such target is added, this logic may + * have to get more complicated to differentiate between + * stack arguments and register arguments. + */ #if defined(HOST_WORDS_BIGENDIAN) != defined(TCG_TARGET_STACK_GROWSUP) op->args[pi++] = temp_arg(args[i] + 1); op->args[pi++] = temp_arg(args[i]); diff --git a/tcg/tci.c b/tcg/tci.c index 6843e837ae..d27db9f720 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -18,6 +18,13 @@ */ #include "qemu/osdep.h" +#include "qemu-common.h" +#include "tcg/tcg.h" /* MAX_OPC_PARAM_IARGS */ +#include "exec/cpu_ldst.h" +#include "tcg/tcg-op.h" +#include "qemu/compiler.h" +#include + /* Enable TCI assertions only when debugging TCG (and without NDEBUG defined). * Without assertions, the interpreter runs much faster. */ @@ -27,36 +34,8 @@ # define tci_assert(cond) ((void)(cond)) #endif -#include "qemu-common.h" -#include "tcg/tcg.h" /* MAX_OPC_PARAM_IARGS */ -#include "exec/cpu_ldst.h" -#include "tcg/tcg-op.h" -#include "qemu/compiler.h" - -#if MAX_OPC_PARAM_IARGS != 6 -# error Fix needed, number of supported input arguments changed! -#endif -#if TCG_TARGET_REG_BITS == 32 -typedef uint64_t (*helper_function)(tcg_target_ulong, tcg_target_ulong, - tcg_target_ulong, tcg_target_ulong, - tcg_target_ulong, tcg_target_ulong, - tcg_target_ulong, tcg_target_ulong, - tcg_target_ulong, tcg_target_ulong, - tcg_target_ulong, tcg_target_ulong); -#else -typedef uint64_t (*helper_function)(tcg_target_ulong, tcg_target_ulong, - tcg_target_ulong, tcg_target_ulong, - tcg_target_ulong, tcg_target_ulong); -#endif - __thread uintptr_t tci_tb_ptr; -static tcg_target_ulong tci_read_reg(const tcg_target_ulong *regs, TCGReg index) -{ - tci_assert(index < TCG_TARGET_NB_REGS); - return regs[index]; -} - static void tci_write_reg(tcg_target_ulong *regs, TCGReg index, tcg_target_ulong value) { @@ -131,6 +110,7 @@ static tcg_target_ulong tci_read_label(const uint8_t **tb_ptr) * i = immediate (uint32_t) * I = immediate (tcg_target_ulong) * m = immediate (TCGMemOpIdx) + * n = immediate (call return length) * r = register * s = signed ldst offset */ @@ -151,6 +131,16 @@ static void tci_args_l(const uint8_t **tb_ptr, void **l0) check_size(start, tb_ptr); } +static void tci_args_nl(const uint8_t **tb_ptr, uint8_t *n0, void **l1) +{ + const uint8_t *start = *tb_ptr; + + *n0 = tci_read_b(tb_ptr); + *l1 = (void *)tci_read_label(tb_ptr); + + check_size(start, tb_ptr); +} + static void tci_args_rr(const uint8_t **tb_ptr, TCGReg *r0, TCGReg *r1) { @@ -491,6 +481,7 @@ static bool tci_compare64(uint64_t u0, uint64_t u1, TCGCond condition) # define CASE_64(x) #endif + /* Interpret pseudo code in tb. */ /* * Disable CFI checks. @@ -502,11 +493,13 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, { const uint8_t *tb_ptr = v_tb_ptr; tcg_target_ulong regs[TCG_TARGET_NB_REGS]; - long tcg_temps[CPU_TEMP_BUF_NLONGS]; - uintptr_t sp_value = (uintptr_t)(tcg_temps + CPU_TEMP_BUF_NLONGS); + uint64_t stack[(TCG_STATIC_CALL_ARGS_SIZE + TCG_STATIC_FRAME_SIZE) + / sizeof(uint64_t)]; + void *call_slots[TCG_STATIC_CALL_ARGS_SIZE / sizeof(uint64_t)]; regs[TCG_AREG0] = (tcg_target_ulong)env; - regs[TCG_REG_CALL_STACK] = sp_value; + regs[TCG_REG_CALL_STACK] = (uintptr_t)stack; + call_slots[0] = NULL; tci_assert(tb_ptr); for (;;) { @@ -531,33 +524,53 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, switch (opc) { case INDEX_op_call: - tci_args_l(&tb_ptr, &ptr); + /* + * We are passed a pointer to the TCGHelperInfo, which contains + * the function pointer followed by the ffi_cif pointer. + */ + tci_args_nl(&tb_ptr, &len, &ptr); + + /* Helper functions may need to access the "return address" */ tci_tb_ptr = (uintptr_t)tb_ptr; -#if TCG_TARGET_REG_BITS == 32 - tmp64 = ((helper_function)ptr)(tci_read_reg(regs, TCG_REG_R0), - tci_read_reg(regs, TCG_REG_R1), - tci_read_reg(regs, TCG_REG_R2), - tci_read_reg(regs, TCG_REG_R3), - tci_read_reg(regs, TCG_REG_R4), - tci_read_reg(regs, TCG_REG_R5), - tci_read_reg(regs, TCG_REG_R6), - tci_read_reg(regs, TCG_REG_R7), - tci_read_reg(regs, TCG_REG_R8), - tci_read_reg(regs, TCG_REG_R9), - tci_read_reg(regs, TCG_REG_R10), - tci_read_reg(regs, TCG_REG_R11)); - tci_write_reg(regs, TCG_REG_R0, tmp64); - tci_write_reg(regs, TCG_REG_R1, tmp64 >> 32); -#else - tmp64 = ((helper_function)ptr)(tci_read_reg(regs, TCG_REG_R0), - tci_read_reg(regs, TCG_REG_R1), - tci_read_reg(regs, TCG_REG_R2), - tci_read_reg(regs, TCG_REG_R3), - tci_read_reg(regs, TCG_REG_R4), - tci_read_reg(regs, TCG_REG_R5)); - tci_write_reg(regs, TCG_REG_R0, tmp64); -#endif + + /* + * Set up the ffi_avalue array once, delayed until now + * because many TB's do not make any calls. In tcg_gen_callN, + * we arranged for every real argument to be "left-aligned" + * in each 64-bit slot. + */ + if (call_slots[0] == NULL) { + for (int i = 0; i < ARRAY_SIZE(call_slots); ++i) { + call_slots[i] = &stack[i]; + } + } + + /* + * Call the helper function. Any result winds up + * "left-aligned" in the stack[0] slot. + */ + { + void **pptr = ptr; + ffi_call(pptr[1], pptr[0], stack, call_slots); + } + switch (len) { + case 0: /* void */ + break; + case 1: /* uint32_t */ + regs[TCG_REG_R0] = *(uint32_t *)stack; + break; + case 2: /* uint64_t */ + if (TCG_TARGET_REG_BITS == 32) { + tci_write_reg64(regs, TCG_REG_R1, TCG_REG_R0, stack[0]); + } else { + regs[TCG_REG_R0] = stack[0]; + } + break; + default: + g_assert_not_reached(); + } break; + case INDEX_op_br: tci_args_l(&tb_ptr, &ptr); tb_ptr = ptr; @@ -1162,13 +1175,17 @@ int print_insn_tci(bfd_vma addr, disassemble_info *info) switch (op) { case INDEX_op_br: - case INDEX_op_call: case INDEX_op_exit_tb: case INDEX_op_goto_tb: tci_args_l(&tb_ptr, &ptr); info->fprintf_func(info->stream, "%-12s %p", op_name, ptr); break; + case INDEX_op_call: + tci_args_nl(&tb_ptr, &len, &ptr); + info->fprintf_func(info->stream, "%-12s %d,%p", op_name, len, ptr); + break; + case INDEX_op_brcond_i32: case INDEX_op_brcond_i64: tci_args_rrcl(&tb_ptr, &r0, &r1, &c, &ptr); diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index 7fb3b04eaf..8d75482546 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -192,23 +192,8 @@ static const int tcg_target_reg_alloc_order[] = { # error Fix needed, number of supported input arguments changed! #endif -static const int tcg_target_call_iarg_regs[] = { - TCG_REG_R0, - TCG_REG_R1, - TCG_REG_R2, - TCG_REG_R3, - TCG_REG_R4, - TCG_REG_R5, -#if TCG_TARGET_REG_BITS == 32 - /* 32 bit hosts need 2 * MAX_OPC_PARAM_IARGS registers. */ - TCG_REG_R6, - TCG_REG_R7, - TCG_REG_R8, - TCG_REG_R9, - TCG_REG_R10, - TCG_REG_R11, -#endif -}; +/* No call arguments via registers. All will be stored on the "stack". */ +static const int tcg_target_call_iarg_regs[] = { }; static const int tcg_target_call_oarg_regs[] = { TCG_REG_R0, @@ -292,8 +277,9 @@ static void tci_out_label(TCGContext *s, TCGLabel *label) static void stack_bounds_check(TCGReg base, target_long offset) { if (base == TCG_REG_CALL_STACK) { - tcg_debug_assert(offset < 0); - tcg_debug_assert(offset >= -(CPU_TEMP_BUF_NLONGS * sizeof(long))); + tcg_debug_assert(offset >= 0); + tcg_debug_assert(offset < (TCG_STATIC_CALL_ARGS_SIZE + + TCG_STATIC_FRAME_SIZE)); } } @@ -360,11 +346,25 @@ static void tcg_out_movi(TCGContext *s, TCGType type, old_code_ptr[1] = s->code_ptr - old_code_ptr; } -static inline void tcg_out_call(TCGContext *s, const tcg_insn_unit *arg) +static void tcg_out_call(TCGContext *s, const tcg_insn_unit *arg) { uint8_t *old_code_ptr = s->code_ptr; + const TCGHelperInfo *info; + uint8_t which; + + info = g_hash_table_lookup(helper_table, (gpointer)arg); + if (info->cif->rtype == &ffi_type_void) { + which = 0; + } else if (info->cif->rtype->size == 4) { + which = 1; + } else { + tcg_debug_assert(info->cif->rtype->size == 8); + which = 2; + } tcg_out_op_t(s, INDEX_op_call); - tcg_out_i(s, (uintptr_t)arg); + tcg_out8(s, which); + tcg_out_i(s, (uintptr_t)info); + old_code_ptr[1] = s->code_ptr - old_code_ptr; } @@ -629,11 +629,9 @@ static void tcg_target_init(TCGContext *s) s->reserved_regs = 0; tcg_regset_set_reg(s->reserved_regs, TCG_REG_CALL_STACK); - /* We use negative offsets from "sp" so that we can distinguish - stores that might pretend to be call arguments. */ - tcg_set_frame(s, TCG_REG_CALL_STACK, - -CPU_TEMP_BUF_NLONGS * sizeof(long), - CPU_TEMP_BUF_NLONGS * sizeof(long)); + /* The call arguments come first, followed by the temp storage. */ + tcg_set_frame(s, TCG_REG_CALL_STACK, TCG_STATIC_CALL_ARGS_SIZE, + TCG_STATIC_FRAME_SIZE); } /* Generate global QEMU prologue and epilogue code. */ From patchwork Thu Feb 4 01:44:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376198 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp857351jah; Wed, 3 Feb 2021 18:32:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJxNVSpforoEk3ICVy/9IhdNKe0VdNfBzqojaySZSnoA/rAl8Xo2rpNUuALzdFCK868cjffG X-Received: by 2002:a25:e54:: with SMTP id 81mr8748289ybo.404.1612405925179; Wed, 03 Feb 2021 18:32:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612405925; cv=none; d=google.com; s=arc-20160816; b=Y4Yx2+3+ZBEtxLJwljmko0gwg/uaTzOrRSrb0b2AKqJDgRJPu48adn9yu3V4BWLedY 219zQqd6Wm9yAe7S9qEPxHEpyLUgqP4LmrLZn2dB3RaolK3/ockyhMf3wOyCQt4gIE+/ mQGvipmCs8Rg+zHizVQCANCKv0CFZGEaauvVTInG59VrrMA/N94aKLX15ztoNnCJf5b3 XtzcIcpGE5cU4Ss4zzgmiy7dfPGULaNLIEgjOGgu3yYYt2jXl6ooN1PdJ4Klc2F1LjmK pmjN8qANzqiSZwqiiB3QOE5KpNQdvl+XUzxOqdfSCjrDScyzRh7+gm3BnLmYCfJS/4hr wsiQ== 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=YQBNB7jLXwaZJSYBL0BvoU6n3wPE6zwxayv+Hpeg13U=; b=Aeiy90iSeTIQjGb+AF4ttl1muWTXFWt9FMHERKZqqGmo97yHqzRXtrSraCH7aEyYqh +6WzLl2OTIPtky9OTwQ0dOUhlCIM2fcmJsPa8cNraNFWtmLcyNgPeC1IBf1QQTAs7QQw +5VLi6Mg+sgYkf4b0q7jfWxurMB7hhNXSQyv1HxYog57fxxIqHT3+hejT2qQ7Z/fl+e5 0PJQgK5Tla3gRDz21RuIzSpX3GCht60h31T0UA85ewj4iGdGXG4W4yuHvqy3vXAxAnCy XVnCQx7groDBGaTmTjs1tgThQvfLojuw2gqDJ0XD1yh9BQiRxx6IgKdRU+rzfdkQ0XdR m/1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uXpTlARh; 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 h15si4209711ybj.96.2021.02.03.18.32.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:32:05 -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=uXpTlARh; 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]:42220 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7URA-0007im-LV for patch@linaro.org; Wed, 03 Feb 2021 21:32:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45262) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Tjh-0006Cl-F2 for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:47:12 -0500 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]:36058) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Tjd-00048r-DR for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:47:09 -0500 Received: by mail-pl1-x634.google.com with SMTP id e9so898042plh.3 for ; Wed, 03 Feb 2021 17:47:04 -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=YQBNB7jLXwaZJSYBL0BvoU6n3wPE6zwxayv+Hpeg13U=; b=uXpTlARhhPLGPSnuVDZU8sjiGNGdW5EXwqXne5QuPo2m5mq4baN+1dAVNZeyRC8ldl gwbfi/jhdkTsxiIPppl9gDL591Gr4BIOD9+EqsoHuxnHySXDo5KdFZvHU0uExJLDOOOb 0kTOH7fDtAkLYStcfaB3DvPYckJ9b00LKS4J6ytMQzwgH/UvGIv7fUWpTFhLkiPUxKMY hjRu4057ezcvufKh+gs0oId5SI9YErJR4jwz+cE6FLe89mWIpxfkuzXbYGid6rMD4M9/ IDVjLc6m6dwHmurHvrqbM+bqL2D8CfLixz60iMciKyWoAkKXhPRLFcCl8eBqT9BxktqO 972g== 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=YQBNB7jLXwaZJSYBL0BvoU6n3wPE6zwxayv+Hpeg13U=; b=r9o0Jeau9sDbuYZLpO2MwG/c9rpkZkrzKtyvj5E7/FSYfgHk9CK2aT6KeeimjJldxM TKnMTcrEurEvu6UMRqhWiUYe1D72WQgBJcQwIVLvYeswb1BH+mEHcmdJHDfgMv1h1/lU JoS92c0HInOGlHBCcmzOYFl6HQFwHWaQsAg8kQ99eVYbwBzXCzLJxGUCxVF0+vghjI6o Tu/MtjwX8wsiHqbvkCbUTE91MT5lk2yMX9H4Di6ZT7jvjCR4UBxiZOz6E1Nj1GDBlj84 lm7v179hbbV2e5gE8iZxnnyfTsBLX7cy0HR5qp245HPCQMsbNGwu1+gsf725YQg41XCT Lqag== X-Gm-Message-State: AOAM531mn4Ew2O+MpbdOq8qZcBwqcUEYFC3QT7DX1sGVA7SXCrEcD9qG 8EcIDjtcppytcVy3eNePNJo1OggtymkNELrs X-Received: by 2002:a17:902:70c3:b029:de:af88:f17e with SMTP id l3-20020a17090270c3b02900deaf88f17emr5777031plt.3.1612403224131; Wed, 03 Feb 2021 17:47:04 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.47.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:47:03 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 64/93] tcg/tci: Improve tcg_target_call_clobber_regs Date: Wed, 3 Feb 2021 15:44:40 -1000 Message-Id: <20210204014509.882821-65-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x634.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The current setting is much too pessimistic. Indicating only the one or two registers that are actually assigned after a call should avoid unnecessary movement between the register array and the stack array. Signed-off-by: Richard Henderson --- tcg/tci/tcg-target.c.inc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) -- 2.25.1 diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index 8d75482546..4dae09deda 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -623,8 +623,14 @@ static void tcg_target_init(TCGContext *s) tcg_target_available_regs[TCG_TYPE_I32] = BIT(TCG_TARGET_NB_REGS) - 1; /* Registers available for 64 bit operations. */ tcg_target_available_regs[TCG_TYPE_I64] = BIT(TCG_TARGET_NB_REGS) - 1; - /* TODO: Which registers should be set here? */ - tcg_target_call_clobber_regs = BIT(TCG_TARGET_NB_REGS) - 1; + /* + * The interpreter "registers" are in the local stack frame and + * cannot be clobbered by the called helper functions. However, + * the interpreter assumes a 64-bit return value and assigns to + * the return value registers. + */ + tcg_target_call_clobber_regs = + MAKE_64BIT_MASK(TCG_REG_R0, 64 / TCG_TARGET_REG_BITS); s->reserved_regs = 0; tcg_regset_set_reg(s->reserved_regs, TCG_REG_CALL_STACK); From patchwork Thu Feb 4 01:44:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376206 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp860086jah; Wed, 3 Feb 2021 18:37:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJzk8+xY4uzUVWjEzslIkEYTtgmAZCOdcsGidAwQjFvdHWGEFa4tsVuM0PvhyaVIRBqzLBwg X-Received: by 2002:a25:6d8a:: with SMTP id i132mr8978667ybc.337.1612406261032; Wed, 03 Feb 2021 18:37:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612406261; cv=none; d=google.com; s=arc-20160816; b=Czd7zgDRIRbseBQAw2AGFCaHk6OWz4pj9raxsprinl5kSA+WQqGzvPTyFYmv2/McHR 0JqRz5ziJepbC/iheUDM7DX4/dcBKNsbFFBdUOySpqJlJBrmZEnfxhn//B7wJGWvIqhB jhcEoO7FI5iMuqOxs8Z6OjkMP1VMOrepfCCQKkgc3hPUiqX+m13oCrKHmh6pF0ctoKUp L/3nYfQ/EAd47xWvdHaeurOrcxiLiZ8+VZe3tD+YIfRZFB0uue5JT7+alWq0Mgwq9EgS xuc5KSICb/CrHGxPcnKmOzW8vulgzMu5aHQeWzj6oMa/WYIZAd6mFwAqeWTFZWKXFsjC zVVQ== 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=LAWykP8xawhD0n2LEjnvxt6U+It9ZnMCGaTxxtC6jn0=; b=Hxae1b/P9rp3/2IIbbfkzL+O7p3Vetlltr0sd4MzTFmKfJ/Oy2KRPiqXp/Ey11FIjX xEBixcNmbsV3Y42csqIeUkepDDNTazRpR0Xq867CdJslDVfgtwEcU+p5C9gyJGqn26KJ wNoQt3H0JYCSY1xQ+WyKwFk5Nwsu5NBOTa9tnhMjVschC8EE6EFGkRycshLu9oQZKMBw kd2fqQiIZtDMyehUGbbTuU42W2SdJjxP07MnWakPnSUe2iZR/GSZy22v1cRjl/R4a52B j2ndpi9z37KL+fpam6f1TxoAaFJKV2HleJ7yjTRffwSkGzCcNPTiSh+XcxLb4CeuO5f+ B6sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YGX1wPtC; 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 i70si4274692yba.11.2021.02.03.18.37.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:37:41 -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=YGX1wPtC; 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]:32902 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7UWa-0007Hi-F3 for patch@linaro.org; Wed, 03 Feb 2021 21:37:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45280) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Tjj-0006D9-AB for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:47:12 -0500 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]:39193) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Tje-00049J-V4 for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:47:11 -0500 Received: by mail-pj1-x102a.google.com with SMTP id d2so820872pjs.4 for ; Wed, 03 Feb 2021 17:47:06 -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=LAWykP8xawhD0n2LEjnvxt6U+It9ZnMCGaTxxtC6jn0=; b=YGX1wPtCD2Ap8FPJxD1u9xl6GRm8bV1wPkAN/ScfYkHiHzeWPipbnbmzIPZjU6h+lB BwEs0JgZnBAbBOgvdkgEl/hCczUb4ouloF2Cmpfy4bxjhnkendyEnLrcvVI6OoHtQ55a uvm9Kwead7s8U+2JJLbZ+kYBSN1ViIFLHuB70KYYU9a1RuYkm4EXzTVoC+RtAGiGE7/J pRVNh2EcPEpsF4maDwVY50OYBwaHYVkHFQjPp+eS+5vllbYZn47l26TjIFA/hXPFhJX5 fKeYFZUkZMtApMOab3kn6/14XbZArQrFqfMd5qfDArbd70FMWqllCF59g1oynGiBQ1jV tDeA== 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=LAWykP8xawhD0n2LEjnvxt6U+It9ZnMCGaTxxtC6jn0=; b=YH6DJlzYpnIAr77q3A/UHAJ/lhAEeCrFSD2SxOU1mQBQz6/dxgnlKXfY8sIZvu60zX ZbEnjkrZyAb4e24uEwMhp0ULK2h/5P4uxgX/RNPn/gknM6hOXl1LCwWZaHa0A94vIaUE s2eoUkBQUUh2RqjFfuo+cPNDxc8hJMAcXkRPAB4UUwwWhibn4Lj0CUbSwf4nDeXc+WIs XbXJ6F6fPm2Q7n7nU2LmrpjO8gYgcZGRgdaYC/DmCOjYck7hortXoXyS8gnESgGG3/X+ MdigynzvOKXQFNYOFySzbjNS8iGYUv2E9VRLharZfP0SDhmfk+SlL1Bhhcf6DKhQVqXB IQ1w== X-Gm-Message-State: AOAM533gjeQBkPYfH70E3hYUOXqc+jP1+UpFfMKQvjmz2DmG2knA0nmC 2hT8wfDDeXZ3wUp0bY0wCYGL+KyqGDje2N5G X-Received: by 2002:a17:902:70c6:b029:df:d62a:8c69 with SMTP id l6-20020a17090270c6b02900dfd62a8c69mr5597285plt.20.1612403225526; Wed, 03 Feb 2021 17:47:05 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.47.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:47:05 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 65/93] tcg/tci: Move call-return regs to end of tcg_target_reg_alloc_order Date: Wed, 3 Feb 2021 15:44:41 -1000 Message-Id: <20210204014509.882821-66-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102a; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102a.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" As the only call-clobbered regs for TCI, these should receive the least priority. Signed-off-by: Richard Henderson --- tcg/tci/tcg-target.c.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.25.1 diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index 4dae09deda..53edc50a3b 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -170,8 +170,6 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) } static const int tcg_target_reg_alloc_order[] = { - TCG_REG_R0, - TCG_REG_R1, TCG_REG_R2, TCG_REG_R3, TCG_REG_R4, @@ -186,6 +184,8 @@ static const int tcg_target_reg_alloc_order[] = { TCG_REG_R13, TCG_REG_R14, TCG_REG_R15, + TCG_REG_R1, + TCG_REG_R0, }; #if MAX_OPC_PARAM_IARGS != 6 From patchwork Thu Feb 4 01:44:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376199 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp857531jah; Wed, 3 Feb 2021 18:32:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJyh7PQMs/V2eiB78l9fvTA9Q9orXHpMDa6GlKTFr+qIjluqIXSkge4R3WD8OLfSkbwKBwn2 X-Received: by 2002:a25:be4b:: with SMTP id d11mr10185728ybm.16.1612405947257; Wed, 03 Feb 2021 18:32:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612405947; cv=none; d=google.com; s=arc-20160816; b=OT7pZSY/TWxnwJ4JKetPxHSw4k4MhyyFPPuGxJPCV/b1RkC8EWx0mwrKAoZyeXYb/a GyX5/JBXniCtg7tCE2/K1Ty4U9eeKrB/+4u/rl62yk3jTobRJ0bttHzUnCBICs2Kw+pn SVEo7Lhyn41JhdnNeO+VguZ+o8jied7hu4lAtLnhFxg6p5wd30r2RCNMe2VxN7GC6QBz yUK/zjX1wPOqIz16BPeEyyCWslLetP+P9gI+HxKIELqNRLRCQMmvdU+Ef0ddVvJ3VzK1 znFyxAZeBGm7BUA+H1q/rTQk9Qz5O2WplYW5jbD2y4zdNlwINrU0FzCF8l951FeZFxIZ 4iBg== 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=akuogNqTsRbdFKyineyOU7+0wNNNt+eZ2/k7lVk1LqY=; b=oRqHhPoccY0hsXgUa9G3iKlaVCe1YzUNCIsxPE2e0AnMFdL1YBBEMQgzxIdGXvReMW LfUVzaZ9JgB8tJ1jfDNb3IR2YP10F+ZAIBLWEmRk6obMXR74Ngf9LHkmvyvaiFKUGU/L uIiq38UZ9SVD7rgVVRUhp6JrfXMRAy3DWgrscGfsoh58HepLE010HmiBLApWXiHR0CS8 rxHsA0Y1PLnhW2XAXI7OLG4S3PJERA7XGjgfAL7p16ybzPM4Zo5LXnjbWczVywONNhcG gw/LHXsEDUfS0BBMUT/DuhjjFJtKyW30u3RY4q2st+WKLAgt5uWAFQWM/R0klNX+oLYB gnZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sIm0cUPb; 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 e10si4015023ybp.290.2021.02.03.18.32.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:32:27 -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=sIm0cUPb; 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]:42714 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7URW-0007xt-OC for patch@linaro.org; Wed, 03 Feb 2021 21:32:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45316) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Tjm-0006DL-33 for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:47:16 -0500 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]:43298) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Tjg-00049e-Ic for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:47:13 -0500 Received: by mail-pg1-x532.google.com with SMTP id n10so1017256pgl.10 for ; Wed, 03 Feb 2021 17:47:08 -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=akuogNqTsRbdFKyineyOU7+0wNNNt+eZ2/k7lVk1LqY=; b=sIm0cUPbbgveHZSAfIhqybZBzqYbIspHWJnBiFvzKaPhf7QiH1NFM6mT3byN2HvB9K fua2Pc3InkRp2epkA30w7Td5kQMoVd0Jd0vhqhO8R3X5i+2D/6ZylG9yhAr88LOBYlxv OLaV3mDS5JHQOnpqtPd1k3V3/1xStT6gTFT9lIlD/ELwDoywmnsrv/JvxmHkmg993SbL X2ew7alHZnUFS076Cohm9YFmz45QO7ws9liy2RS4caRzNLTUyKnp862ItobhpMjUtfdD nBKhzewpnsb7nHdzWIAATiMkspxm+PQywKy9vSXpMS1Y2Y4vggeIiiqtRvP/lwvdU1aC fPag== 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=akuogNqTsRbdFKyineyOU7+0wNNNt+eZ2/k7lVk1LqY=; b=PlrOkUUn48iMdj9iAHskrS66A/AyLfZlKkA83W6y5QZaTAoKcEv7DzcnpyzESNhiIC IQESTRo5hQ9PGfR8LL7U2gESwbDkii36oUzshqA+K0cd/RMSuYZzsmv+gzqX6YoyZXfs earQHASURNgim3ZiXGmbcx6eCjJWe3HwkzhPlIc7WuaVtsiWummTPOgF4L+eF2yyFZID LwHlhn0z4UHFwng9621wL0vfiDHNt4o3p9iAq8mdP7Baf+y/biXODJfF33LuzH0lsLgJ Jqv/9/5nJbopsFp8q8dYqon21oJ+0rNYn7AJgx0/sqgGwHr6IpofqiKHfMY8MYdlCNqy KgRQ== X-Gm-Message-State: AOAM531WPt3MRPORW+3DI+RzXWTuZdSfB2OYmYkYlPxZdkhnSWqPIgkt y8F+UFysw1YX9H8EzhFjpxehRKq4PAMhFvZU X-Received: by 2002:aa7:80ca:0:b029:1c1:b636:ecc2 with SMTP id a10-20020aa780ca0000b02901c1b636ecc2mr5841449pfn.20.1612403227117; Wed, 03 Feb 2021 17:47:07 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.47.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:47:06 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 66/93] tcg/tci: Push opcode emit into each case Date: Wed, 3 Feb 2021 15:44:42 -1000 Message-Id: <20210204014509.882821-67-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::532; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x532.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We're about to split out bytecode output into helpers, but we can't do that one at a time if tcg_out_op_t is being done outside of the switch. Signed-off-by: Richard Henderson --- tcg/tci/tcg-target.c.inc | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) -- 2.25.1 diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index 53edc50a3b..050d514853 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -385,40 +385,48 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, { uint8_t *old_code_ptr = s->code_ptr; - tcg_out_op_t(s, opc); - switch (opc) { case INDEX_op_exit_tb: + tcg_out_op_t(s, opc); tcg_out_i(s, args[0]); + old_code_ptr[1] = s->code_ptr - old_code_ptr; break; case INDEX_op_goto_tb: tcg_debug_assert(s->tb_jmp_insn_offset == 0); /* indirect jump method. */ + tcg_out_op_t(s, opc); tcg_out_i(s, (uintptr_t)(s->tb_jmp_target_addr + args[0])); + old_code_ptr[1] = s->code_ptr - old_code_ptr; set_jmp_reset_offset(s, args[0]); break; case INDEX_op_br: + tcg_out_op_t(s, opc); tci_out_label(s, arg_label(args[0])); + old_code_ptr[1] = s->code_ptr - old_code_ptr; break; CASE_32_64(setcond) + tcg_out_op_t(s, opc); tcg_out_r(s, args[0]); tcg_out_r(s, args[1]); tcg_out_r(s, args[2]); tcg_out8(s, args[3]); /* condition */ + old_code_ptr[1] = s->code_ptr - old_code_ptr; break; #if TCG_TARGET_REG_BITS == 32 case INDEX_op_setcond2_i32: /* setcond2_i32 cond, t0, t1_low, t1_high, t2_low, t2_high */ + tcg_out_op_t(s, opc); tcg_out_r(s, args[0]); tcg_out_r(s, args[1]); tcg_out_r(s, args[2]); tcg_out_r(s, args[3]); tcg_out_r(s, args[4]); tcg_out8(s, args[5]); /* condition */ + old_code_ptr[1] = s->code_ptr - old_code_ptr; break; #endif @@ -436,10 +444,12 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, CASE_64(st32) CASE_64(st) stack_bounds_check(args[1], args[2]); + tcg_out_op_t(s, opc); tcg_out_r(s, args[0]); tcg_out_r(s, args[1]); tcg_debug_assert(args[2] == (int32_t)args[2]); tcg_out32(s, args[2]); + old_code_ptr[1] = s->code_ptr - old_code_ptr; break; CASE_32_64(add) @@ -462,12 +472,15 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, CASE_32_64(divu) /* Optional (TCG_TARGET_HAS_div_*). */ CASE_32_64(rem) /* Optional (TCG_TARGET_HAS_div_*). */ CASE_32_64(remu) /* Optional (TCG_TARGET_HAS_div_*). */ + tcg_out_op_t(s, opc); tcg_out_r(s, args[0]); tcg_out_r(s, args[1]); tcg_out_r(s, args[2]); + old_code_ptr[1] = s->code_ptr - old_code_ptr; break; CASE_32_64(deposit) /* Optional (TCG_TARGET_HAS_deposit_*). */ + tcg_out_op_t(s, opc); { TCGArg pos = args[3], len = args[4]; TCGArg max = opc == INDEX_op_deposit_i32 ? 32 : 64; @@ -481,13 +494,16 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, tcg_out8(s, pos); tcg_out8(s, len); } + old_code_ptr[1] = s->code_ptr - old_code_ptr; break; CASE_32_64(brcond) + tcg_out_op_t(s, opc); tcg_out_r(s, args[0]); tcg_out_r(s, args[1]); tcg_out8(s, args[2]); /* condition */ tci_out_label(s, arg_label(args[3])); + old_code_ptr[1] = s->code_ptr - old_code_ptr; break; CASE_32_64(neg) /* Optional (TCG_TARGET_HAS_neg_*). */ @@ -503,48 +519,59 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, CASE_32_64(bswap16) /* Optional (TCG_TARGET_HAS_bswap16_*). */ CASE_32_64(bswap32) /* Optional (TCG_TARGET_HAS_bswap32_*). */ CASE_64(bswap64) /* Optional (TCG_TARGET_HAS_bswap64_i64). */ + tcg_out_op_t(s, opc); tcg_out_r(s, args[0]); tcg_out_r(s, args[1]); + old_code_ptr[1] = s->code_ptr - old_code_ptr; break; #if TCG_TARGET_REG_BITS == 32 case INDEX_op_add2_i32: case INDEX_op_sub2_i32: + tcg_out_op_t(s, opc); tcg_out_r(s, args[0]); tcg_out_r(s, args[1]); tcg_out_r(s, args[2]); tcg_out_r(s, args[3]); tcg_out_r(s, args[4]); tcg_out_r(s, args[5]); + old_code_ptr[1] = s->code_ptr - old_code_ptr; break; case INDEX_op_brcond2_i32: + tcg_out_op_t(s, opc); tcg_out_r(s, args[0]); tcg_out_r(s, args[1]); tcg_out_r(s, args[2]); tcg_out_r(s, args[3]); tcg_out8(s, args[4]); /* condition */ tci_out_label(s, arg_label(args[5])); + old_code_ptr[1] = s->code_ptr - old_code_ptr; break; case INDEX_op_mulu2_i32: + tcg_out_op_t(s, opc); tcg_out_r(s, args[0]); tcg_out_r(s, args[1]); tcg_out_r(s, args[2]); tcg_out_r(s, args[3]); + old_code_ptr[1] = s->code_ptr - old_code_ptr; break; #endif case INDEX_op_qemu_ld_i32: case INDEX_op_qemu_st_i32: + tcg_out_op_t(s, opc); tcg_out_r(s, *args++); tcg_out_r(s, *args++); if (TARGET_LONG_BITS > TCG_TARGET_REG_BITS) { tcg_out_r(s, *args++); } tcg_out32(s, *args++); + old_code_ptr[1] = s->code_ptr - old_code_ptr; break; case INDEX_op_qemu_ld_i64: case INDEX_op_qemu_st_i64: + tcg_out_op_t(s, opc); tcg_out_r(s, *args++); if (TCG_TARGET_REG_BITS == 32) { tcg_out_r(s, *args++); @@ -554,9 +581,12 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, tcg_out_r(s, *args++); } tcg_out32(s, *args++); + old_code_ptr[1] = s->code_ptr - old_code_ptr; break; case INDEX_op_mb: + tcg_out_op_t(s, opc); + old_code_ptr[1] = s->code_ptr - old_code_ptr; break; case INDEX_op_mov_i32: /* Always emitted via tcg_out_mov. */ @@ -565,7 +595,6 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, default: tcg_abort(); } - old_code_ptr[1] = s->code_ptr - old_code_ptr; } static void tcg_out_st(TCGContext *s, TCGType type, TCGReg arg, TCGReg arg1, From patchwork Thu Feb 4 01:44:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376204 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp859792jah; Wed, 3 Feb 2021 18:37:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJwqnEXXmoWKi3KbQYTpZvuNG/yCpbRTBsEJJFVX+L01j6YmB1kZpVXeqqF1RRdcjQcO5CDp X-Received: by 2002:a25:8206:: with SMTP id q6mr9156901ybk.156.1612406223891; Wed, 03 Feb 2021 18:37:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612406223; cv=none; d=google.com; s=arc-20160816; b=JXw9jm5xiDZcQ8HhxBih69WtDWfZOCA9/jTPXp7pRXgMLnCGMSEULBgmoQncPSWrOe t4KvJE1c6WXYqrTDeZlIlPh5pqiuZAznu6OhpHuIFnbZ9GgM8/kPOefEKU8aZmYrnHJy DC+3Nz0948jN5CCXm2lKIEnZ1YvCJjBydAzrATh76XB5IFt53aoRlndRO/8vrXTVY7oK nIqMydB8wWT+Rp/Y5wgtyHLlidRYXhGNdpp3GJTSOa8OzbiFtMAyAgeoKYqHZZX5thwr W5OB6mw4PzA8lHmUERXpE2aMpCTh4hrHtHwzzlTdouN4ndSgPx+/3FoBtVjJXowUTitV CGaA== 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=r51gde6XQroUTuOp18Wacrk/m6aRKZagEOpI8SD7K0E=; b=UyEKP0RbRdcuaRCMbQNvYPLSxHvirN/zRruMy5SEADSdbieJMO1oSw6bXZYExrH5SP Al7lKP+MhtOkibSOv9gq/YKS0aLIxrZ/iQ30lMlDPvJpENs0S6QuaohTrMPUwoW/8Sro j2RCGnQtJnYQdTJzUJhzriOuR6qk6BaaXit+DA2obTTexzYXHtgbkkum+rGdEc/Bxb6W MpPS9gvpkDhgleVd3FYqvzEqe6BhOEZOuL0qHC+6B8a0pzNf5ghLXmYSF70ea1UIZuoZ 7FOSzKwcfQijQxKTc8/NGR3ILoFavphnrxi48UB4XZ8lLnduDIu0lHS/fyI4228H2KuI pcxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mnRk04CM; 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 r22si4806255ybd.26.2021.02.03.18.37.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:37:03 -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=mnRk04CM; 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]:59256 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7UVz-0006VN-8U for patch@linaro.org; Wed, 03 Feb 2021 21:37:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45378) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Tjs-0006ED-3I for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:47:20 -0500 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]:54671) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Tji-0004B2-E2 for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:47:18 -0500 Received: by mail-pj1-x1032.google.com with SMTP id m12so771436pjs.4 for ; Wed, 03 Feb 2021 17:47:09 -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=r51gde6XQroUTuOp18Wacrk/m6aRKZagEOpI8SD7K0E=; b=mnRk04CMbYnHsFBpHWCrgFQELbSVEYEkc1At4b3HVFT/dd/Y310CTMBKd3t4a/XGWj 3LdTZdBnt/kmTA8IkwpsL3INoIbWskkKdnkdZTNXFkm+B8YxtCb+ZgKPglF81x9wwdym kgsGyr5g9gAew1qmHlQg2c8aO/h4p6OdnLZTeFfsvA1H+tZFxN8s18CLdwKGOWPoJ8S7 GFyqDC6Bnp20xabjdnRHB7GjGnAzNYc2iHePvdSwCecw6Bqs75xYJCH6jtrr7LiUf4Ph mrNGQ+qi0pDWtaa0U+YCpFO5gRT773LbXmvLEdU4GB+PhjUmMmYDQfyjtArxk+Pks0Db wJCQ== 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=r51gde6XQroUTuOp18Wacrk/m6aRKZagEOpI8SD7K0E=; b=DWGp1wl3RedwyfdjHJ9J9adXgNxPeEI0XDVg5EEScQO9R9FWNoLHQiAPZJN4Oy6YGF 0EWsurARpnVPMpBaQnNwMMp9ZD1CAGTA6Dufst7KcI0vg0Y0xn0+1LGp6qU7QWOz0leS 5C1s0MnxfaGkhNxeErqgm94wPFpY9fFolWemdmGP7NBwgmhb1OUu6zDSNxEtut+8gdCD ocJAKYvdT2eeZqx6YC7oWf4NvTUPERvqDKU2WBwT4yqSrq85Gn5/NHpkLOznzHe/EamE PpZB6PO6fz4PWBmUYdlMKfkQpO3MSbkAUAi9FESI+f6RNV3tBUMY5KB1kZ5zkxK434jc 3lrw== X-Gm-Message-State: AOAM530Bhe59hVoyMHn/00ysN4GSQybNEq2U0HD0OLHq7Os2cGcmyqIF jv5yLWMocGpGRrF+KAUIjDkdwSZ25jqmHQMd X-Received: by 2002:a17:902:b7c7:b029:e1:6cbe:db19 with SMTP id v7-20020a170902b7c7b02900e16cbedb19mr5788454plz.20.1612403228759; Wed, 03 Feb 2021 17:47:08 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.47.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:47:08 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 67/93] tcg/tci: Split out tcg_out_op_rrs Date: Wed, 3 Feb 2021 15:44:43 -1000 Message-Id: <20210204014509.882821-68-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1032.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- tcg/tci/tcg-target.c.inc | 84 +++++++++++++++++++--------------------- 1 file changed, 39 insertions(+), 45 deletions(-) -- 2.25.1 diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index 050d514853..707f801099 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -283,32 +283,38 @@ static void stack_bounds_check(TCGReg base, target_long offset) } } -static void tcg_out_ld(TCGContext *s, TCGType type, TCGReg ret, TCGReg arg1, - intptr_t arg2) +static void tcg_out_op_rrs(TCGContext *s, TCGOpcode op, + TCGReg r0, TCGReg r1, intptr_t i2) { uint8_t *old_code_ptr = s->code_ptr; - stack_bounds_check(arg1, arg2); - if (type == TCG_TYPE_I32) { - tcg_out_op_t(s, INDEX_op_ld_i32); - tcg_out_r(s, ret); - tcg_out_r(s, arg1); - tcg_out32(s, arg2); - } else { - tcg_debug_assert(type == TCG_TYPE_I64); -#if TCG_TARGET_REG_BITS == 64 - tcg_out_op_t(s, INDEX_op_ld_i64); - tcg_out_r(s, ret); - tcg_out_r(s, arg1); - tcg_debug_assert(arg2 == (int32_t)arg2); - tcg_out32(s, arg2); -#else - TODO(); -#endif - } + tcg_out_op_t(s, op); + tcg_out_r(s, r0); + tcg_out_r(s, r1); + tcg_debug_assert(i2 == (int32_t)i2); + tcg_out32(s, i2); + old_code_ptr[1] = s->code_ptr - old_code_ptr; } +static void tcg_out_ld(TCGContext *s, TCGType type, TCGReg val, TCGReg base, + intptr_t offset) +{ + stack_bounds_check(base, offset); + switch (type) { + case TCG_TYPE_I32: + tcg_out_op_rrs(s, INDEX_op_ld_i32, val, base, offset); + break; +#if TCG_TARGET_REG_BITS == 64 + case TCG_TYPE_I64: + tcg_out_op_rrs(s, INDEX_op_ld_i64, val, base, offset); + break; +#endif + default: + g_assert_not_reached(); + } +} + static bool tcg_out_mov(TCGContext *s, TCGType type, TCGReg ret, TCGReg arg) { uint8_t *old_code_ptr = s->code_ptr; @@ -444,12 +450,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, CASE_64(st32) CASE_64(st) stack_bounds_check(args[1], args[2]); - tcg_out_op_t(s, opc); - tcg_out_r(s, args[0]); - tcg_out_r(s, args[1]); - tcg_debug_assert(args[2] == (int32_t)args[2]); - tcg_out32(s, args[2]); - old_code_ptr[1] = s->code_ptr - old_code_ptr; + tcg_out_op_rrs(s, opc, args[0], args[1], args[2]); break; CASE_32_64(add) @@ -597,29 +598,22 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, } } -static void tcg_out_st(TCGContext *s, TCGType type, TCGReg arg, TCGReg arg1, - intptr_t arg2) +static void tcg_out_st(TCGContext *s, TCGType type, TCGReg val, TCGReg base, + intptr_t offset) { - uint8_t *old_code_ptr = s->code_ptr; - - stack_bounds_check(arg1, arg2); - if (type == TCG_TYPE_I32) { - tcg_out_op_t(s, INDEX_op_st_i32); - tcg_out_r(s, arg); - tcg_out_r(s, arg1); - tcg_out32(s, arg2); - } else { - tcg_debug_assert(type == TCG_TYPE_I64); + stack_bounds_check(base, offset); + switch (type) { + case TCG_TYPE_I32: + tcg_out_op_rrs(s, INDEX_op_st_i32, val, base, offset); + break; #if TCG_TARGET_REG_BITS == 64 - tcg_out_op_t(s, INDEX_op_st_i64); - tcg_out_r(s, arg); - tcg_out_r(s, arg1); - tcg_out32(s, arg2); -#else - TODO(); + case TCG_TYPE_I64: + tcg_out_op_rrs(s, INDEX_op_st_i64, val, base, offset); + break; #endif + default: + g_assert_not_reached(); } - old_code_ptr[1] = s->code_ptr - old_code_ptr; } static inline bool tcg_out_sti(TCGContext *s, TCGType type, TCGArg val, From patchwork Thu Feb 4 01:44:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376210 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp862324jah; Wed, 3 Feb 2021 18:42:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJxRZheEU0WHJE8Jv1qq9X0CtZKnzcCakVuJGNlRbSs6myNJ6k7utHihSSv50dKGhlpdbuxv X-Received: by 2002:a25:3104:: with SMTP id x4mr9174246ybx.141.1612406534963; Wed, 03 Feb 2021 18:42:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612406534; cv=none; d=google.com; s=arc-20160816; b=qqUYXtpbxGm1vK171sTlnJg2YCUUmeBt2Uk/M48D5bo6QIoRzW7hcRosxDabZglBqi n2aRwfhTJOTm8BqSQUqi1XXrO9PSa3iwdQ3QFEmcFlPwAAchmqwWDGte0PsmEF1Ij/Nx af741V/YfGQCOY5Y/sNkbLttEEyDebKXa8r7MMo0TVKY2DtN9rd77cFENh1MGOsKgJfR hWh/FHPGe+odIflJqBeK6wIbnuYtlA1A9fnsOA4nwZmNpLVFiu3Trkh5FwEN9QALFaRW cSWG1CfOapATXdQfX5xyAs+6cOkfvTD2zOxNYVAMmzVFUscciTFv9bVuvrGXmxL71LX4 ZTnw== 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=EsUj7sq9+NLQtwJZ+3yHUWsYmpE8j3VuEo3uruSYCgE=; b=ikzwozXj5ne7JA23SKfdzuJn6Q0rR8hFdead/8FYT3t/dJt8lC/HCroxXO9jsC9TLT gh8jq2TJPOrKc7dZWcflKlhzcs1yJictNCZEqRY/CVswADjJrXizsr2n9MeigQ+20/ff ma3X6JzdFs4wRT/t+XR3llR3QZHtkdrdptmqCYSvRRGx7U7NV6uY6nkg3RjLxSIqc0hZ xq7JoSDm7qsvcEChNWGVPgMMuAHEcZIPiCirvlU1t6erV3jGzFN/WTehMHHg2bgmQVXY fONHMdHwatpq5EYWBSG0G5wCF6E9Xk7hbeW4mdyuN3s0LMoA+XpyljP8n17gSzU4xrF4 YzzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KstoxnUm; 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 y123si4126260ybc.263.2021.02.03.18.42.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:42:14 -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=KstoxnUm; 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]:41276 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7Ub0-0002pH-Ex for patch@linaro.org; Wed, 03 Feb 2021 21:42:14 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45380) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Tjs-0006EE-45 for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:47:21 -0500 Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]:34189) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Tjj-0004BF-T5 for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:47:19 -0500 Received: by mail-pg1-x52d.google.com with SMTP id o7so1054311pgl.1 for ; Wed, 03 Feb 2021 17:47:11 -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=EsUj7sq9+NLQtwJZ+3yHUWsYmpE8j3VuEo3uruSYCgE=; b=KstoxnUmgvmkDQoWpUNgeskekrIFS0LKIQZ7itcoVV6L3bV18HgvncFiLNU3hleiN6 edqYE0f4r2CqMeKtgTucUJkTFwuzwciXRt+ADweuNlAycqmDd6LLJRR5j2ePQGN+mzrX 6RUZKSKNbDFghBCND/3xnOtEmSXTeoi2hYMFXH5pes6rTV0oqNGgQ5EiflcdsBFBFG5J FYwqn5z7SxG9Yyj6u8sRqLeYPIa9+CkhNURojPMmR6Nd/wXgzCHvIG3dqBmIgZINTon5 4wiIaHoyeBEw7F+dGehWWkInaiA2sNxYsX6mZZQ3IXIvRLXG6H6zDZM9riWgzII05t9I PK5Q== 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=EsUj7sq9+NLQtwJZ+3yHUWsYmpE8j3VuEo3uruSYCgE=; b=iFoNNiA6ULnI6K4C/1pDR5/ZxkeWoI6tuoCYbKW8NBK+pvTYo1C7vlyeeUrIDvSKZU C3/ooRmSvMC4fUMgx9i1fOBQEzn8DB7lDKwkuVNG7xxl/L8E6gbX6TBLaqCVbCLac0aS I6ttJu8MYg1cOf4SiOgY49COcyyCeSxj5LUcqiFdh3Ep7savKFMbVbE1sbLsn6MSoChR SEMvIFLCWMcgVkSIOZjInewHfz+toldSAx7pVpDZKQCQBMOBqMKZ36ngeCVRfZ98BIp3 ra2Ny6T0VUIry03WAgFbrOz0I7hWR10HzyZTRQ7nd1D8HUUqZVngH4GPW0IdOzQVQLlT +rqQ== X-Gm-Message-State: AOAM53374quEtPqjv4Rz41bUfIunxjWUQJNO+01fxC5ex3erW7ejnGnM 0Ek/oPshWNpGaNnNHLyMp+Gx+oAGikAgMQLy X-Received: by 2002:a63:43c6:: with SMTP id q189mr6568583pga.245.1612403230202; Wed, 03 Feb 2021 17:47:10 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.47.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:47:09 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 68/93] tcg/tci: Split out tcg_out_op_l Date: Wed, 3 Feb 2021 15:44:44 -1000 Message-Id: <20210204014509.882821-69-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52d; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52d.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- tcg/tci/tcg-target.c.inc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) -- 2.25.1 diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index 707f801099..1e3f2c4049 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -283,6 +283,16 @@ static void stack_bounds_check(TCGReg base, target_long offset) } } +static void tcg_out_op_l(TCGContext *s, TCGOpcode op, TCGLabel *l0) +{ + uint8_t *old_code_ptr = s->code_ptr; + + tcg_out_op_t(s, op); + tci_out_label(s, l0); + + old_code_ptr[1] = s->code_ptr - old_code_ptr; +} + static void tcg_out_op_rrs(TCGContext *s, TCGOpcode op, TCGReg r0, TCGReg r1, intptr_t i2) { @@ -408,9 +418,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, break; case INDEX_op_br: - tcg_out_op_t(s, opc); - tci_out_label(s, arg_label(args[0])); - old_code_ptr[1] = s->code_ptr - old_code_ptr; + tcg_out_op_l(s, opc, arg_label(args[0])); break; CASE_32_64(setcond) From patchwork Thu Feb 4 01:44:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376214 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp863543jah; Wed, 3 Feb 2021 18:44:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJyRTLFQ0kha/kz34ANO89V+7yNTR51q68xZtkNuBDrDuA2HNgzqo5Bp9xJCKZziCzMnJa6X X-Received: by 2002:a25:4843:: with SMTP id v64mr8611330yba.24.1612406683268; Wed, 03 Feb 2021 18:44:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612406683; cv=none; d=google.com; s=arc-20160816; b=LFRW9N1cblNSb3pn/wnQe9mOoCb3E/DRbSusxR/OgS0DACH8SkNsVJYVPnQBUfx+2u gHXmbbg0yqz/DjU3D4uJbeYIdhLDgSQ1GuV487e2XsdqsrhtwEVIWrOKQS4G8HIxiLov cTBY+I1JxZx7ebpTfVkPWYMZOGgyqLHgEy5lDMidP+xgoD05vpbZZpUG1aGw0s+3t85k Tb8zkzKWj3iwQhBrsw3Ij8Cs2tuVMYd5rVeW24xiAWsRFqoKvu/nvPssWnEjWTyQ4msG ubdY11/5z80cSWJWgKFwqjvNGGxp9GPtVUSjQP4VSV/o6k2DROhJMQdEcyiyKqFO9Hvx 80+Q== 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=06Y+cyMxl+dC1AQMaIsueXy7S/PiohsOvXqBqGkx3uw=; b=sbrcJQV664xOm57w3Xq3xUsiPUTSAiAZT2WLskJDzF0FHHdaqeD54XiJMBNRq+G5H1 NL70HL5sOvi5iE//vdon7DMt+U4nNAgeS0ScpBDz9V74HHl3ln2lvVAsE0/S9fZrFAio 03/eGplOeO3acSLsUgF3IBo/ZzM+BKaxjFvMIwb098lRFJxYumYnRU2wbLdbDLVp4sHb gDURa4Q2KBG54KHLX+nzJ7rjiQnZaC1QzIO9UDAGxl2cLqh/COrHnRNC9KyChoBucTpX xnqiLmyyQppzbIgaE9QHE0ohRZ+9U/DLS5W39ak6+LNCQeguzyYDbK7tQ0/fLbQaOjNy doCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pK+mdlgx; 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 b7si3330371ybr.163.2021.02.03.18.44.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:44:43 -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=pK+mdlgx; 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]:49768 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7UdO-0006Jf-Lr for patch@linaro.org; Wed, 03 Feb 2021 21:44:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45436) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Tjx-0006GW-P6 for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:47:25 -0500 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]:37454) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Tjl-0004Bn-Nf for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:47:25 -0500 Received: by mail-pf1-x42b.google.com with SMTP id b145so1076125pfb.4 for ; Wed, 03 Feb 2021 17:47:12 -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=06Y+cyMxl+dC1AQMaIsueXy7S/PiohsOvXqBqGkx3uw=; b=pK+mdlgxoivRR0qEhvJ9FQhkTL2fsZ/T5fTb+NMUMeTFTaw7Ugfp+ZMgUJNYwXEA0f zBXNJF6XtdG5FKE6Dm21xIh606XR6p924SykELRu4iBfx/qqxYFLkvZyv7xZBvZXWtvt l+Xcx4q8L47Y6/jeo1o+E/pfMerGTyFYvn6teJOaakKpQSDSPSoo9uDg/JOS32L3gvW7 DtON0P5VHoldU/LIVrj8y+hrT5pgKFZXlTI2C7Ip1sqyYhZzz5beE4rMbANxbP+yVqby ++4Rbkm1HcNgxwA8NuL5jurnBGYx+gzmMxYRMgxi/r6pwyHp41uhi1iRufXnY/0FUFze BIiw== 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=06Y+cyMxl+dC1AQMaIsueXy7S/PiohsOvXqBqGkx3uw=; b=EVcnqWfY8pCaQWxSssSnROA8oPx4q8HayI2QL+5n9dF4Kiv/c98vrq12e3jMmSj9FY rFzM1Y54h1WIhZf85ZBGUvpaOJTv601Iqdsp9BTyxYlp2cijzpdBPvt5PQGIsl3axLbt pvKozNv1/TlOZ8NirosGk59WTV45a/5IOXrXUZ/rRNlCmFmmvwUceQXDhyEy4JeQD0Lx 58xP0zZUi/lyuvtuzGqQR7k8qzwCMK8puBjwWeTyBfrOBoUe4nxrfDtp5Z7+6e75bUjZ NbXGSefwbc62SnVl01xY4bGaO7n7OdPxz6AqR2vfWwZKUZ8v3M+myoXG/64snGu+DzYN pUlw== X-Gm-Message-State: AOAM533DhfWj2WZPBj4jeRnngcOHcsyk8Ut5SRqKbTYSPGZfPu1dfQw9 VxwrIgUOr3QEbHDKGFSTthsGBQgFxWw2TQNz X-Received: by 2002:a63:ce4a:: with SMTP id r10mr6625334pgi.3.1612403231878; Wed, 03 Feb 2021 17:47:11 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.47.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:47:11 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 69/93] tcg/tci: Split out tcg_out_op_p Date: Wed, 3 Feb 2021 15:44:45 -1000 Message-Id: <20210204014509.882821-70-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42b; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42b.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=unavailable 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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- tcg/tci/tcg-target.c.inc | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) -- 2.25.1 diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index 1e3f2c4049..cb0cbbb8da 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -293,6 +293,16 @@ static void tcg_out_op_l(TCGContext *s, TCGOpcode op, TCGLabel *l0) old_code_ptr[1] = s->code_ptr - old_code_ptr; } +static void tcg_out_op_p(TCGContext *s, TCGOpcode op, void *p0) +{ + uint8_t *old_code_ptr = s->code_ptr; + + tcg_out_op_t(s, op); + tcg_out_i(s, (uintptr_t)p0); + + old_code_ptr[1] = s->code_ptr - old_code_ptr; +} + static void tcg_out_op_rrs(TCGContext *s, TCGOpcode op, TCGReg r0, TCGReg r1, intptr_t i2) { @@ -403,17 +413,13 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, switch (opc) { case INDEX_op_exit_tb: - tcg_out_op_t(s, opc); - tcg_out_i(s, args[0]); - old_code_ptr[1] = s->code_ptr - old_code_ptr; + tcg_out_op_p(s, opc, (void *)args[0]); break; case INDEX_op_goto_tb: tcg_debug_assert(s->tb_jmp_insn_offset == 0); /* indirect jump method. */ - tcg_out_op_t(s, opc); - tcg_out_i(s, (uintptr_t)(s->tb_jmp_target_addr + args[0])); - old_code_ptr[1] = s->code_ptr - old_code_ptr; + tcg_out_op_p(s, opc, s->tb_jmp_target_addr + args[0]); set_jmp_reset_offset(s, args[0]); break; From patchwork Thu Feb 4 01:44:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376205 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp860033jah; Wed, 3 Feb 2021 18:37:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJyp2MeFLz3arx8NYf2q/7h5YLLdbs+XYMQbNNjjepeMuggGjQS2wiU8dqQEXp5ya4E7X+i0 X-Received: by 2002:a25:da47:: with SMTP id n68mr8289229ybf.75.1612406255096; Wed, 03 Feb 2021 18:37:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612406255; cv=none; d=google.com; s=arc-20160816; b=d1+bBT9/OJe7yVCeo0ed8iMrm3aMr9FOQ8dLe7KkMwhhrI87+LMK/MyBiUwHToNVcI fljA6Afa8/aQDEEZxq2Hg5rdIonhqkTz33nOjoHDKk+L0qeDuv4G4Qe411IU6IvTq5fC DM6NQULiscLuRpUiO9h420zeCgCZ2W37OI79WXkAaO+PbVkVBEKkWsFjwIm/AxGZvYPO u8hv2Y7jBkXOLiT57aiAeM8PweY13pzBZztztRCxwcgmdZQ8ENQ3eTj0H9NpTF+Urm9P Rh4lNGFzh35+g3pIZZDiFklOR2qasrArqItrmRlmXyWGzE7EBCc7mBnTwcPyycwNNDjb T3qw== 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=Kpfe6JZmwXM15Cw7O9Ulgnnkm0DVoqv1s4+DGCwKajc=; b=wfoLs7WHIHv9t8LnAo4uedV8HgLSmdfzNOdRR7WrvBeQHpOVu/dR7KarYUGCYYF5HM 8ExcijzcV6gH+h55yxiUJV4MnED+nvJXMCGgDzD/kZ6WDqPMW0shWqbI/MSLx3qGGwiU q4xeSTdcQmCQlPZwfbLFdaeqlfxiE84Ci148UakkxFafkQdTQM/nQSoWEoz6AmG0uj67 9bY6mxHtN7hVrgLt/sPTtDjdZ3dysE0XmzPmJHT4OvyfLDTi1z2S9fC66h0ZXyEU5fTZ 9i6oVNgyYAcb5ccdz58k+E6gQU18i1i1hkmxTyWdLXv9NmI44ZRnB1hZ9UHi+NOO0F3z 9lbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sqtsnxO4; 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 g35si3999598ybi.33.2021.02.03.18.37.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:37:35 -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=sqtsnxO4; 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]:59766 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7UWU-0006jK-IU for patch@linaro.org; Wed, 03 Feb 2021 21:37:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45412) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Tjv-0006Fl-Vh for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:47:24 -0500 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]:38931) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Tjp-0004Ce-0u for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:47:23 -0500 Received: by mail-pf1-x432.google.com with SMTP id e19so1069386pfh.6 for ; Wed, 03 Feb 2021 17:47:14 -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=Kpfe6JZmwXM15Cw7O9Ulgnnkm0DVoqv1s4+DGCwKajc=; b=sqtsnxO4M+CXXiGZF9Srv4vrSMPBv3HsqqheH0oRaXdnfVSl3kE5Pfq2lole0x75GT 4rk7MXmu/+YVw+cg+ExOK9na01KD8yNXgEz6lF8iaSY34OV3bcjQh2j9GHtvbJ45YlVe TXXNh16V3FRRs8X/zACOvJ2Cs9/eMhqYH0sWq5ggOYFC7KTApY61bqNyJumTyn9iTeYq 1PHLHmm6fkyP+UwY4UD4ppHNUehP4XY2L55lVaombD7oZXvxornX2GxEkgQGSEDakoS1 2ps5HV3npcokVqbqL3CMQY+ABZ7AqWJK8KCoym04GfuTu5XbMj034iAO9LsnLuOv5rTH 9bUw== 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=Kpfe6JZmwXM15Cw7O9Ulgnnkm0DVoqv1s4+DGCwKajc=; b=pBkh3rcPmuT7CDTno6amfkTkI0SX7MeMx3ucTGCKrYryj54RlBohfwZcdZ64SrbD7w IybuKe+bsWnlo7wOcR22ws+0Wu8nYZy/uGFLctViRwueij8a3bCUC+8Rd4Kvolm/7eLF E+eEX+JncPfMhiZvZSnk5Xv1ajwt74dUR8C3wgav4iaz3h2wBdozzHp0UQrkRWJtNArm sKoRXtlAMqydYujuy6p45j+XKVnmByukGDxwctRItbLeZustBOXulE4WkttsKnKRWe1B pr5vnGpkv3nhCHkOa3H0KsfOMr03e2vzptz93txn8QRBfReXZA4W58gKY0HYw9zgi8Yc W5eA== X-Gm-Message-State: AOAM531qnn2kBN7T7w7ZL863O0FUDkdedYdb2v4ESAAv+/jzT44mBies wtYP/+frXTHfScvZgNg6FUuRA6wloWZgy/GU X-Received: by 2002:a65:5283:: with SMTP id y3mr6468591pgp.174.1612403233216; Wed, 03 Feb 2021 17:47:13 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.47.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:47:12 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 70/93] tcg/tci: Split out tcg_out_op_rr Date: Wed, 3 Feb 2021 15:44:46 -1000 Message-Id: <20210204014509.882821-71-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x432.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" At the same time, validate the type argument in tcg_out_mov. Signed-off-by: Richard Henderson --- tcg/tci/tcg-target.c.inc | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) -- 2.25.1 diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index cb0cbbb8da..272e3ca70b 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -303,6 +303,17 @@ static void tcg_out_op_p(TCGContext *s, TCGOpcode op, void *p0) old_code_ptr[1] = s->code_ptr - old_code_ptr; } +static void tcg_out_op_rr(TCGContext *s, TCGOpcode op, TCGReg r0, TCGReg r1) +{ + uint8_t *old_code_ptr = s->code_ptr; + + tcg_out_op_t(s, op); + tcg_out_r(s, r0); + tcg_out_r(s, r1); + + old_code_ptr[1] = s->code_ptr - old_code_ptr; +} + static void tcg_out_op_rrs(TCGContext *s, TCGOpcode op, TCGReg r0, TCGReg r1, intptr_t i2) { @@ -337,16 +348,18 @@ static void tcg_out_ld(TCGContext *s, TCGType type, TCGReg val, TCGReg base, static bool tcg_out_mov(TCGContext *s, TCGType type, TCGReg ret, TCGReg arg) { - uint8_t *old_code_ptr = s->code_ptr; - tcg_debug_assert(ret != arg); -#if TCG_TARGET_REG_BITS == 32 - tcg_out_op_t(s, INDEX_op_mov_i32); -#else - tcg_out_op_t(s, INDEX_op_mov_i64); + switch (type) { + case TCG_TYPE_I32: + tcg_out_op_rr(s, INDEX_op_mov_i32, ret, arg); + break; +#if TCG_TARGET_REG_BITS == 64 + case TCG_TYPE_I64: + tcg_out_op_rr(s, INDEX_op_mov_i64, ret, arg); + break; #endif - tcg_out_r(s, ret); - tcg_out_r(s, arg); - old_code_ptr[1] = s->code_ptr - old_code_ptr; + default: + g_assert_not_reached(); + } return true; } @@ -534,10 +547,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, CASE_32_64(bswap16) /* Optional (TCG_TARGET_HAS_bswap16_*). */ CASE_32_64(bswap32) /* Optional (TCG_TARGET_HAS_bswap32_*). */ CASE_64(bswap64) /* Optional (TCG_TARGET_HAS_bswap64_i64). */ - tcg_out_op_t(s, opc); - tcg_out_r(s, args[0]); - tcg_out_r(s, args[1]); - old_code_ptr[1] = s->code_ptr - old_code_ptr; + tcg_out_op_rr(s, opc, args[0], args[1]); break; #if TCG_TARGET_REG_BITS == 32 From patchwork Thu Feb 4 01:44:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376209 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp862027jah; Wed, 3 Feb 2021 18:41:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJw0oeWP9Q54G+7qomByUHEaNnngTCP3T8GfaQ3wR9w11o7+QbXRy12gCXZ6oML1AWJO0Six X-Received: by 2002:a25:5ac2:: with SMTP id o185mr8969934ybb.252.1612406495513; Wed, 03 Feb 2021 18:41:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612406495; cv=none; d=google.com; s=arc-20160816; b=DjpCKdj3iZMN3XTzn+HTIoTE31nAfNnjZItgzxbWPfNH/oRmJDicEwAPwMK6Zyfvm5 D0QWM5zF75hFB3ZgBExZsXvVNKqlj384V3OTrI4YsbxAL0G9HGjMsPBmgAqmTUhYm/dt +HrgEGK26Pl/8uOFEh+mGZBewHqfiBfnrdYEZEL2n/ITMk6DwEQO+skX7KcyvKtmbrqc lfcQ/HdKaFGFszPGn0pYRqiMDS5/u56nC/DImGxs2S5E9xdZgmzSewmKqsZbSmznoXB4 VIQnBNneQvdCcb1c/ipE84uSY8OJDzSftlqEBgQc9O85vU1+JbD72gHY/kuD1a7kbu5/ npMw== 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=RzFAVc3cWW3yr0pGO36GqM64ymG+VJfs9mt8bjfFgIQ=; b=pNTVAUoLjEeY1WZ5Io7pNDrVQnpOZ0E00kN9iFiznEB55u9TLhCS++Kalj/w+DzsDo O1JH8jYbm1ZpN5ebG/yIi4O9s+68MdjL9MPQPWe19sRonSder5Yg1CwxXRq8RHeKW4zH jpfvYAG2ueS+OWBC0EGg+J/+Ztmtu/XVvI99efvCEsjSk/4AGs4QSzsAnnR9IZgTq5e6 atVz8ulyQH+ftKd41VluRbyUxL37Obs8xqsmiZciWdUaT3Jh3ZPUnznGxKKOvtK5/mNQ M6ycs8brR5FRmidz65Bp1oumG/mlfMFoASyW1IBQ8gI0xVweuzQ6QlGxvoR4y7l+zbwl izSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UHtm5QhL; 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 x20si4551296ybd.399.2021.02.03.18.41.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:41:35 -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=UHtm5QhL; 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]:37676 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7UaN-0001Ik-08 for patch@linaro.org; Wed, 03 Feb 2021 21:41:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45444) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Tjz-0006Hb-Pv for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:47:27 -0500 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]:38935) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Tjp-0004Cr-WF for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:47:27 -0500 Received: by mail-pf1-x436.google.com with SMTP id e19so1069424pfh.6 for ; Wed, 03 Feb 2021 17:47:15 -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=RzFAVc3cWW3yr0pGO36GqM64ymG+VJfs9mt8bjfFgIQ=; b=UHtm5QhL8LD3/dlHMVFiRRx/A2R36R5pWiy9EF3XggjQJqdFX4lPsl+3RUSf+qh6AX 0ZwC2VdEp0iwL6HlwSwdkPwrvIVLhANep/f1Hm1/yLj9tclJpv7F06o41AOAm90dwiEm KBpS3gcmRzcy+z6OQLUsBP3xPxKGxSEQewx3FAjQwdW/zb8h+cjZ1K0YQsEdYTGzSJL0 EWWG1PinNL8TLblr68G4fPIiOr11jLy4JU/KqKkaT6sLPbkBSHpYxN0gTnEQdBaKsg2b wX4wOYf7SZljyLH8IRCLcCEx8kEXNxREHV2YaJhXCu8x6VO/2b8JtO3X0fJWkzFmyswl yGwA== 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=RzFAVc3cWW3yr0pGO36GqM64ymG+VJfs9mt8bjfFgIQ=; b=i4rgPB/671oAAfUpsoR2siJRFBQdoSiWwk2pzLDf2Nwso4WVWoreQIXN8fKpSs7oCP mLh4F7WlSSL/8CJXsOwOywt8+Tu29mKtq/WG9wHBoYjjkd4hpz8e8/mkjmE8mGuf4Xd1 bbi9AaIxrJbadpa2OQWkHue+9G1xSI5Hbt+3dLLe+o+hcS8WD2v0tCW5Q7P0b1Up65HU a20IBRSBluesdb12sjwpAL3Rtt5bOB7LD3XtNHAclmcszyokKilW4H0JoU7I3ngY4EyK map/Usv9rA/KXubkTswY6ZSBYVQg3bVt4rRV+OKO/udXVv3+O/B2fjN42Sr9GbCnPX6K VfrQ== X-Gm-Message-State: AOAM5327SVySZKfPWGats6R56KPaIJtZgrPIyEziK6geXoPeU9lyiV9c G4H1pxgMdiK4tfejY9RnGImtdMhiNiSh0Iye X-Received: by 2002:a63:1f54:: with SMTP id q20mr6525879pgm.135.1612403234703; Wed, 03 Feb 2021 17:47:14 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.47.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:47:14 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 71/93] tcg/tci: Split out tcg_out_op_rrr Date: Wed, 3 Feb 2021 15:44:47 -1000 Message-Id: <20210204014509.882821-72-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::436; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x436.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- tcg/tci/tcg-target.c.inc | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) -- 2.25.1 diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index 272e3ca70b..546424c2bd 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -314,6 +314,19 @@ static void tcg_out_op_rr(TCGContext *s, TCGOpcode op, TCGReg r0, TCGReg r1) old_code_ptr[1] = s->code_ptr - old_code_ptr; } +static void tcg_out_op_rrr(TCGContext *s, TCGOpcode op, + TCGReg r0, TCGReg r1, TCGReg r2) +{ + uint8_t *old_code_ptr = s->code_ptr; + + tcg_out_op_t(s, op); + tcg_out_r(s, r0); + tcg_out_r(s, r1); + tcg_out_r(s, r2); + + old_code_ptr[1] = s->code_ptr - old_code_ptr; +} + static void tcg_out_op_rrs(TCGContext *s, TCGOpcode op, TCGReg r0, TCGReg r1, intptr_t i2) { @@ -500,11 +513,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, CASE_32_64(divu) /* Optional (TCG_TARGET_HAS_div_*). */ CASE_32_64(rem) /* Optional (TCG_TARGET_HAS_div_*). */ CASE_32_64(remu) /* Optional (TCG_TARGET_HAS_div_*). */ - tcg_out_op_t(s, opc); - tcg_out_r(s, args[0]); - tcg_out_r(s, args[1]); - tcg_out_r(s, args[2]); - old_code_ptr[1] = s->code_ptr - old_code_ptr; + tcg_out_op_rrr(s, opc, args[0], args[1], args[2]); break; CASE_32_64(deposit) /* Optional (TCG_TARGET_HAS_deposit_*). */ From patchwork Thu Feb 4 01:44:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376215 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp864059jah; Wed, 3 Feb 2021 18:45:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJwd+xomdOOI9nN7X5DFeRWzPL8fViAbAKq+HOSrVVGm53WnZHNbrY9ssisgM7n5xkw1zHq7 X-Received: by 2002:a25:1086:: with SMTP id 128mr8702097ybq.375.1612406740164; Wed, 03 Feb 2021 18:45:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612406740; cv=none; d=google.com; s=arc-20160816; b=nqo8Lx/gOMB55tdGPOcl/DPY7eavYh2ZCapkyhX9XF6v44z3eEZHsGbLoW6JBo9rt8 lrhs8T5XBv134LjCgw1ANQAHm4FD/Nbv2DuIvOUVkYaepCztVHRmPgwMOxf6Bx0JiG54 3B9NOq0fN98HfLnvzxXyper23KJKkRQMa71iPp9/BfWuoaOBEBJ+Sv1UlZWl1rMaghGx HU7SlOficp2dLiBYn3FSh4FxcEu4mrWSeufon6C0y1bdNmE7koz4XQGxkhTY87JSo+Q+ 4CFykGuxu3MA/kv8jvlBDnHsrsIYDrLUe0iiMepgVc/vUuh3ZmIndZKrbL+N1F6i5Wob +ADw== 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=QUs6bZlAERttu34ccVgcqABRUHJrBFMHH0LXLYX1oZo=; b=cNYIX1ujLJgtRbVmyX90O6e5rOvjgk9LVyyeWa7rZX4iF8e5BHzgn/Yu0qO/Q+HXm5 J72vYkLGVPg/YrM5vwCuGDVrK0jqZB6AWdsLR9wRR6e/4QhYNpNBPdOloz/12bbLSLOu CHMBFrKrS+FHjgR1rlpgETyM5+x4NfYTFqGGTtpz67iP4arRImOPVG7TKO0qWDpVmf8A H57xaQxTFh9QsJzE5j3onTG4tfVYA9Anes//nhrDiPc4cQMMU2fnkpbaad1xToD+wGC+ l1RHm27vh8bx/YxTm7Dmd6BBN6Ffm/rQS0+ELp4EdppPdToVHGmhfcRkaDjm+G0WtyLm 0n2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Bqmlt0r3; 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 y17si4177409ybk.250.2021.02.03.18.45.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:45:40 -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=Bqmlt0r3; 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]:50292 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7UeJ-0006Wk-HL for patch@linaro.org; Wed, 03 Feb 2021 21:45:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45470) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Tk3-0006KL-Io for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:47:31 -0500 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]:46777) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Tjq-0004Cx-0T for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:47:31 -0500 Received: by mail-pf1-x429.google.com with SMTP id f63so1048742pfa.13 for ; Wed, 03 Feb 2021 17:47:17 -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=QUs6bZlAERttu34ccVgcqABRUHJrBFMHH0LXLYX1oZo=; b=Bqmlt0r3Db+fjsBSQj9sptkfcBIOqh/cN0mdklasHUs4TQY5qbrLLPxL4w8kfka711 DSYs7h2xiNMkMyGU8nVUA4O9RD+hTkQcxmjttEJ/3xs8v9ZFWMh0+zOk6kM7P6c2FyY4 2A+tRBg6FYicFVDlAPHhy5gRbvYdDpD2JmAYyvYNjT+xx8jwMZH2QXKVvQ4WkALS9E78 9lXL6VFFl6Ack1PxlTFsQr92V09MWYWRvBGzYSvPT+kbGGF4aoe8xb0TG9e1qM5c80es Lg9qIwhQqZg1QX1cmvFbNAAeTP71DXmrLz0Q4odpFGR9AFFNGHwcFOCA5R9Ug0YaeybU kukQ== 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=QUs6bZlAERttu34ccVgcqABRUHJrBFMHH0LXLYX1oZo=; b=BETrK6vlpdhQcEvZvv4KRSdwgFkcJFbs7oeYXA4YRzDEEkyGm4KsVY4tRj8XwJMUoX S90CfdAfEW5J63hxAZ2CyD9ob1+dQr2/+qR7fitWbXnL+OHKUdl3ijaQtp6OEgc3riw4 xFs700S6DV18QOGkK27PWhxalwpxkwHCWj94kjNA0tvkub8c8sl8kNY12GzSzooN1Onl r+HHIHUC1HJfWymREl9w4uXoQlh+TT6KZDIoATHDpFRtn0Fon7M3b++C061LdTh5TdRw emsgZh4Srpkyx0S+pRp7rz7yYDHMs0Ej7HTAGoETRG1J+3Aqeh7mLT7LKOdXfqgfNR0b iptw== X-Gm-Message-State: AOAM532trvEomPt1+VZLUjy14z22tbbZyVrk7PL3HrgKLbit1Dw3J1IN hb19Q2wu/weQayYIPm1W8ca8ul8Rw3u5CWFy X-Received: by 2002:a63:5142:: with SMTP id r2mr6696576pgl.248.1612403236154; Wed, 03 Feb 2021 17:47:16 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.47.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:47:15 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 72/93] tcg/tci: Split out tcg_out_op_rrrc Date: Wed, 3 Feb 2021 15:44:48 -1000 Message-Id: <20210204014509.882821-73-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::429; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x429.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=unavailable 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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- tcg/tci/tcg-target.c.inc | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) -- 2.25.1 diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index 546424c2bd..5848779208 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -341,6 +341,20 @@ static void tcg_out_op_rrs(TCGContext *s, TCGOpcode op, old_code_ptr[1] = s->code_ptr - old_code_ptr; } +static void tcg_out_op_rrrc(TCGContext *s, TCGOpcode op, + TCGReg r0, TCGReg r1, TCGReg r2, TCGCond c3) +{ + uint8_t *old_code_ptr = s->code_ptr; + + tcg_out_op_t(s, op); + tcg_out_r(s, r0); + tcg_out_r(s, r1); + tcg_out_r(s, r2); + tcg_out8(s, c3); + + old_code_ptr[1] = s->code_ptr - old_code_ptr; +} + static void tcg_out_ld(TCGContext *s, TCGType type, TCGReg val, TCGReg base, intptr_t offset) { @@ -454,12 +468,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, break; CASE_32_64(setcond) - tcg_out_op_t(s, opc); - tcg_out_r(s, args[0]); - tcg_out_r(s, args[1]); - tcg_out_r(s, args[2]); - tcg_out8(s, args[3]); /* condition */ - old_code_ptr[1] = s->code_ptr - old_code_ptr; + tcg_out_op_rrrc(s, opc, args[0], args[1], args[2], args[3]); break; #if TCG_TARGET_REG_BITS == 32 From patchwork Thu Feb 4 01:44:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376219 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp866144jah; Wed, 3 Feb 2021 18:49:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJzqwdeAhFgC0y4NI2u+cl58iqQRoNmH5HlxyZ4UXuSSQfHQJCAWLDzEwtx7yLNMYm+ziyin X-Received: by 2002:a25:cb83:: with SMTP id b125mr8780778ybg.192.1612406974063; Wed, 03 Feb 2021 18:49:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612406974; cv=none; d=google.com; s=arc-20160816; b=sLvHQhB699wF/mvuqjcEoe1AMj3iwwNI+vg2fvQGN23qW76P8RnVyJUeBd7xIrxgjX opdvOBoiGDwVIS0N0oFGRknygDzdswMTjcUqwBaJCcrjkXfxto0cdJHQMtXposu8L27Z lXczUwP8LPjX9WIab9RzD7QbwMWhHA974a4bHz1WuT8q9dhyfromPlOBwxqglvQdESe5 eI+tvmihU0+KmRwfYAe1cYiSYYhG637bK32CGgUvM0e3usLgJAsxRtfz1R0kwnZj+nWt bA0PKHcct4LRB6pXGnSJ9/GQl2oxXSzdOMtsjEB0uSYwEqMgTlNQTtwQx+AnE4KaCKs/ OpaA== 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=A8+oxGont/+bDGkQ3AaEp3aS+SzJCnRbYSKjy2ImL7Q=; b=HP+d0LILX8m4wQ9BKt+MdJqcEH4ZI74CPIoauAn+VXAfTfohw9owRsCo5fha+8hZE4 oVPmVS0XQjS+4SfmflFHmisiaBH65DijV0YJaw2JszQHUnoTG8i+AzS0Th/jeIiBKIXt 3q1xMIz+2O6xdkI2QECLKcut7AR91yF9cwHVVXUySTLcWw0cTORMmEHL/m0n4xqDcOJ7 np2QaFpmEj8+zMvXacNA7oD6OU2lDU98/ncZUO/Vhi77mMgDBI/a3IMEc99dzVEnxI0D pvca7+3ox4IAO0Fz3f2VysB/z1pVa9a2wdYQ90QTaFyO8Mz+EpL63EIubOcXHia/E8GL C5Mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=s8yxaLTQ; 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 e130si4164723ybf.196.2021.02.03.18.49.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:49:34 -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=s8yxaLTQ; 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]:38356 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7Ui5-0005HF-HT for patch@linaro.org; Wed, 03 Feb 2021 21:49:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45468) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Tk3-0006KK-KG for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:47:31 -0500 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]:33138) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Tjr-0004D4-SP for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:47:29 -0500 Received: by mail-pf1-x430.google.com with SMTP id o20so1092524pfu.0 for ; Wed, 03 Feb 2021 17:47:18 -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=A8+oxGont/+bDGkQ3AaEp3aS+SzJCnRbYSKjy2ImL7Q=; b=s8yxaLTQnVhmH3/rLDV9uofiHQ/uf7eLHl21/p/OXNY8oD0ZiDeMInUT9iEU08AreP KbH/eR57tLwL1uFCJ1IUFHf6nF+QePpu72rXdWKpOEjukLBsT2EMI1IWe+BESkSQipyf 6KX4R5uZh5fN6OAMp9XholEwjpUPyDN8Z1JoInSSKl65uqcVol3S33t/sxlW12+cTRfD epvo3V3uV27BKaKjWunt6ELMTb6ayNnRXRQ6f/CaZ6S/6ZjAxCEPCH6Noo+YfkyP8PI4 DApvMcKWey13TcJQWixgPyk5f1HKBndfIww+PJ4C6b0wFB5ac6a2nlBZAEc/JNlGgSwQ PB1Q== 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=A8+oxGont/+bDGkQ3AaEp3aS+SzJCnRbYSKjy2ImL7Q=; b=oiv7ledgBwsg0+14YXMjhLvjc/ky2M6YLgBXgiau2c2mvYLveAT4xtIKWcnaCguOdV WTn+7vVQFYIvfJMzsKfm4BWOAqmZn4IDjfTGHTs5If976QQfa2aowZ8JCGNSSYA3/S5g 9siOb5iZs+aSZ68ZHlPU2FifWfdn5cmVDuOlcPmz98ZbJs58DEyMtZCSitPhxeusVCvP kWqCZ6ukkU4Vyw+dJ74kNQQp/jZlF6W8mJonvePg089EepS8sCzyR5m65s/2NIi5z0yL qmNyRqK6UudZv5tCUUhWubrJg4aVIYQODossCEinM39Jj3PGoVDO04SvO2Zlcq7+uIlX zZ1w== X-Gm-Message-State: AOAM533RM6DHnFB9LDZPOeyuxPoKzejnAVjbF22RoM//VUqqQtT1N1in K3Nl5wlsYyAbnm/hzpwwD3Kqoi8McPbp3LoO X-Received: by 2002:a65:6aba:: with SMTP id x26mr6403330pgu.125.1612403237776; Wed, 03 Feb 2021 17:47:17 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.47.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:47:17 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 73/93] tcg/tci: Split out tcg_out_op_rrrrrc Date: Wed, 3 Feb 2021 15:44:49 -1000 Message-Id: <20210204014509.882821-74-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::430; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x430.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- tcg/tci/tcg-target.c.inc | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) -- 2.25.1 diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index 5848779208..8eda159dde 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -355,6 +355,25 @@ static void tcg_out_op_rrrc(TCGContext *s, TCGOpcode op, old_code_ptr[1] = s->code_ptr - old_code_ptr; } +#if TCG_TARGET_REG_BITS == 32 +static void tcg_out_op_rrrrrc(TCGContext *s, TCGOpcode op, + TCGReg r0, TCGReg r1, TCGReg r2, + TCGReg r3, TCGReg r4, TCGCond c5) +{ + uint8_t *old_code_ptr = s->code_ptr; + + tcg_out_op_t(s, op); + tcg_out_r(s, r0); + tcg_out_r(s, r1); + tcg_out_r(s, r2); + tcg_out_r(s, r3); + tcg_out_r(s, r4); + tcg_out8(s, c5); + + old_code_ptr[1] = s->code_ptr - old_code_ptr; +} +#endif + static void tcg_out_ld(TCGContext *s, TCGType type, TCGReg val, TCGReg base, intptr_t offset) { @@ -473,15 +492,8 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, #if TCG_TARGET_REG_BITS == 32 case INDEX_op_setcond2_i32: - /* setcond2_i32 cond, t0, t1_low, t1_high, t2_low, t2_high */ - tcg_out_op_t(s, opc); - tcg_out_r(s, args[0]); - tcg_out_r(s, args[1]); - tcg_out_r(s, args[2]); - tcg_out_r(s, args[3]); - tcg_out_r(s, args[4]); - tcg_out8(s, args[5]); /* condition */ - old_code_ptr[1] = s->code_ptr - old_code_ptr; + tcg_out_op_rrrrrc(s, opc, args[0], args[1], args[2], + args[3], args[4], args[5]); break; #endif From patchwork Thu Feb 4 01:44:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376217 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp864464jah; Wed, 3 Feb 2021 18:46:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJwnyQmD0wKOcZXcQMqbaBCKEDxl4YB0OXrrFcMnzKHBC6JxG0tVOZdazERtsVQwEwR5Kpmd X-Received: by 2002:a25:cbd8:: with SMTP id b207mr8901580ybg.426.1612406790987; Wed, 03 Feb 2021 18:46:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612406790; cv=none; d=google.com; s=arc-20160816; b=Rh97XOPr9ZPv0aTpoNZewI+BlIbYpaLWTxrh9KYXdQnXKjtSYL0hq9U2BiFVEw/GgL rVxL7qeimmjwHNJ7RDi+YB6uqz6ViTMtISLhTPQgTE0PTtwPOP2Fl/6BM8TeadrRhf79 8QThgjhbdkfpL0mXUhHHZrRMy2ZjcSi9/MxBQaCZ4ULUeToFiZ8ysyX/mdCYFH9Tckkb 1XZSokeWfj8luVq9EgLXLYl8ne2Qw6EIuOvoWfSEuDwoNltHjvpbtRGha193c+pkWM18 HdVgbKmru4Eyxm+aGSUSSBjjM1Uoqo/CSTefUbfHcRRegZnyOPJyyURLgRCOir8tzEyk 4bXg== 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=6fN3MzHzuWIrC3R6bdCZxAnV3xyNnPemffGo42IAOp8=; b=v1MT/tG3/PdwCqrlwUdBT9AOZcdCo3Guy7+KMJumhONejIMJCG0uLpggeusRev1CXO H84FnnqXVhL93wGSFOmGrOlwSTEfMZnx/RKZLFpQu0d9eGxxvv45LV3R3JnNUCKtmyL4 zBvlOAhBIBDpRjmuHAfUPRFXnwmnx2j6JGtxRJjMCgjbhaex4ls0FsUkmiDj+UMG17V8 6dNeXu4HV7VirBIWaAVR0zwSuUmVENs+gUy+WaewGCZUFLNze3XoHrGmIO5DGs9SPZ2m Bm/3n31Fj7ksxSPVc8mmjibnW4OwG1NyjVLF77LnuBvh8k0wc2/+nXbYi3W8a9koYnHu Pt9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xkvRnbgW; 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 p125si3986427ybc.62.2021.02.03.18.46.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:46:30 -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=xkvRnbgW; 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]:54906 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7Uf8-0000Ea-EP for patch@linaro.org; Wed, 03 Feb 2021 21:46:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45472) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Tk3-0006Ke-Ld for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:47:31 -0500 Received: from mail-pg1-x52f.google.com ([2607:f8b0:4864:20::52f]:43296) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Tjt-0004DG-Ho for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:47:31 -0500 Received: by mail-pg1-x52f.google.com with SMTP id n10so1017520pgl.10 for ; Wed, 03 Feb 2021 17:47:20 -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=6fN3MzHzuWIrC3R6bdCZxAnV3xyNnPemffGo42IAOp8=; b=xkvRnbgWZeun6WPN2tb/1XcIyq7nwXk6TRMtnW3lWzWUgj7533DS+qXjYyvhmi+t1H iKh7ZYGF+oaBNEkWL9+9QtLSND/SZQAlW35PkpB8XzhyuYAujiaVH2+q7pzoD0iLXJsu x3GD5R6ocb/jbTF5OfWwtm/UoyXmdSObOCRJUOI4ZN3lZOosBEUHU2vTScwQXkpKtGdL 8rICHYrITT7ip7Sm6/MA8sQw+Fz3rj7tkqkK8nQYwlAB+Wi2QLfbH1LaPORcwLNf1FcJ KZPGexkCPk9T6x9KMHjSVzP9SsZ2PJbMx1xzYhoZy7XFQxFxfiKL/dLazfsLZZoEHFtj ScKw== 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=6fN3MzHzuWIrC3R6bdCZxAnV3xyNnPemffGo42IAOp8=; b=uLMKslAsZMbkDuLgVgvfWA+PiDU9N6Tiebwf/C3sz1aEK6Dh7CqPoqN3tPDo0yEe44 HG3bjcyxMAD4clMVEZ09GiguQ0FPknn4/ROJscW/bzj9DHOhGb16nMWiuqRQsCFGT+bc KRf1l95V/XFLCxoOlcx6KzR/1oE9z/8INQb92upeyYoLVplLVAKk7H6Whyky2VSWqsfE Pcr5FLnNw+iR4Xu8qKwx9MZOL1NL3g+ZQGgfxzuAbTosxPO7EVRqo3uSIm3M8zxmJgaT 4AOTlc0xXS0YVDrm14d6N/0a7rLBmubx2r/V222fRMG7TZAEUGX1eYiFKXvhCNyut86G Pung== X-Gm-Message-State: AOAM533zI8wYQiLFGnoT1/NO6vLWRQvLMPdlAyiEh8TpSLiOzfHvxE6a Yz0C5/1+tqjEK6VinvsNvQ75yl13w5XTKgd4 X-Received: by 2002:a63:4c0e:: with SMTP id z14mr6535732pga.408.1612403239353; Wed, 03 Feb 2021 17:47:19 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.47.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:47:18 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 74/93] tcg/tci: Split out tcg_out_op_rrrbb Date: Wed, 3 Feb 2021 15:44:50 -1000 Message-Id: <20210204014509.882821-75-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52f; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52f.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- tcg/tci/tcg-target.c.inc | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) -- 2.25.1 diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index 8eda159dde..6c743a8fbd 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -355,6 +355,21 @@ static void tcg_out_op_rrrc(TCGContext *s, TCGOpcode op, old_code_ptr[1] = s->code_ptr - old_code_ptr; } +static void tcg_out_op_rrrbb(TCGContext *s, TCGOpcode op, TCGReg r0, + TCGReg r1, TCGReg r2, uint8_t b3, uint8_t b4) +{ + uint8_t *old_code_ptr = s->code_ptr; + + tcg_out_op_t(s, op); + tcg_out_r(s, r0); + tcg_out_r(s, r1); + tcg_out_r(s, r2); + tcg_out8(s, b3); + tcg_out8(s, b4); + + old_code_ptr[1] = s->code_ptr - old_code_ptr; +} + #if TCG_TARGET_REG_BITS == 32 static void tcg_out_op_rrrrrc(TCGContext *s, TCGOpcode op, TCGReg r0, TCGReg r1, TCGReg r2, @@ -538,7 +553,6 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, break; CASE_32_64(deposit) /* Optional (TCG_TARGET_HAS_deposit_*). */ - tcg_out_op_t(s, opc); { TCGArg pos = args[3], len = args[4]; TCGArg max = opc == INDEX_op_deposit_i32 ? 32 : 64; @@ -546,13 +560,8 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, tcg_debug_assert(pos < max); tcg_debug_assert(pos + len <= max); - tcg_out_r(s, args[0]); - tcg_out_r(s, args[1]); - tcg_out_r(s, args[2]); - tcg_out8(s, pos); - tcg_out8(s, len); + tcg_out_op_rrrbb(s, opc, args[0], args[1], args[2], pos, len); } - old_code_ptr[1] = s->code_ptr - old_code_ptr; break; CASE_32_64(brcond) From patchwork Thu Feb 4 01:44:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376223 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp867989jah; Wed, 3 Feb 2021 18:53:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJz0Vu+UW/UZGBBCmZv9zfbHyaYYBeaDtqE4SA7QbU/H6W5sOYBnsmNi/RPp+5eEIfTKtPZI X-Received: by 2002:a5b:7c4:: with SMTP id t4mr8851796ybq.496.1612407183446; Wed, 03 Feb 2021 18:53:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612407183; cv=none; d=google.com; s=arc-20160816; b=tB/VolVU3tDW1/jqCCXSgLAB1oSk241N0kg1kH+XIloqnwkNeqKYXDb6j3DNZV1X6V 0YwR7z7BBoPQcU89PNQ035r0wIXzeXIfeXlciXXlyyqhTCNgw77PtOhV/RCFBUi7t9oc BNOZEi2+mIRAMVANFbj5/Q96lzr/ZyaBaqkql390aPrJmA0/wxRu1ZaERE2+rlbUak+7 KNtzD2BlRDQPcvTzlACCje+MKm1speqhe9R9JUsO7RIilVwx8xWOtNeLRRkWoWN2/Upq n5Q32eqBR4RLfLrQ9/9MbG4p67yCBq9mWjvMdqEsdSOhK127JKrHQ3CZafk33TA3INV2 8ndA== 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=p6E9LDuPBslW5lnZ+lbP25axObg1A1JUNAlm8q5oVbA=; b=b9kT/vbYsrNbekG+nwyLVYQJyDEQSBpOlWVIC0f7SBJfqHmGjD8gbIXboKrzwWPlcT ZylVGFJRQt6Dh4agKJ3V038j/IBsvOG2oXN5jV09nzb7yaSUuMRBDhyCfTltMdP+2b+T O3uoiUIodFxfH91b+KC6Uh6mGN3UcmQb/b7MN8iysUpE4bhKAL3HXQ/wEt5T4EH0hiE8 4HRoAahGkfsMDwuTWJM6Py7o4KAHOyZ25MrtogYeOtbGZD6zyUMWKjMTPopy3BXr0VKD QAr9dZl3SuphIKY3x0Ou/jNSptJdVk/lsiPL6VSGRyT65wFj9wTYaT9gDVYcnjrjH94B Wq5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XwqoYckS; 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 r141si4696131ybc.469.2021.02.03.18.53.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:53:03 -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=XwqoYckS; 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]:46626 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7UlS-0000ZP-Rf for patch@linaro.org; Wed, 03 Feb 2021 21:53:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45518) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Tk5-0006OL-9V for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:47:33 -0500 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]:40260) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Tjv-0004DZ-5s for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:47:33 -0500 Received: by mail-pj1-x1030.google.com with SMTP id z9so818955pjl.5 for ; Wed, 03 Feb 2021 17:47:21 -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=p6E9LDuPBslW5lnZ+lbP25axObg1A1JUNAlm8q5oVbA=; b=XwqoYckSabpVxvAGqV0DrFmktCk9t8RevaXgLASgoS8jTGXS56knh3iQTpNKfwZVuJ 9ekaPazK6bKUqj36k3lHPokMw5BneHN+ueeozJ7sWxNkeVYUZdMnGHvCSFoxZ/kSBnIJ nAkgPB6AJfCaSAKLpwxIc0Xce6m8n2JJqEydO/M3aSy0SNNrASKd48LxOFPbgyZXny8V J9ZgTvTFyxfGaVRWfPcBsIwcHaGS10bIQ1R2CsGy+0POjqbdqNxdRBHz7gqAa92w2HRm 4GMLF4n25H3KVGXJsGPZS+rjqJtjeX1tD77hrZik/qWrvBbTlU7LDfb2WGytQTWzKbKp Jh3A== 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=p6E9LDuPBslW5lnZ+lbP25axObg1A1JUNAlm8q5oVbA=; b=IIlTSnLLuSZZ2pwNalA/S5BuB/AKujQAYnJ9orTX7uNMwO6JT/KyZQ8LlOOJ4qCJ6a CjcOrZc/nFO9CUMFnVg+PySzUgKRfxDuuGKbqp9Yzo7br97qaftke12mVDAhmr2HJiLf nGPKi/wkT22ud3zU91UOstquc9nBD3lE4Mil5D43jRyl7bW9kzInkALk9mikC/xyi0HR uaWJj0p3KzbJXCbFeso4R4aadbHOB9M+Moxv4rdQKgWmsKPVputHJDLQdsdQjykF60yP tn/8pad6dySXLAO5Nr9a4l/GKy0nGTwC/nndhSFMmkmwsT6rmA0/GIgzrj5HZ238Thbz Blpw== X-Gm-Message-State: AOAM5337RL8bT4/kaBSPH8T0c2rS3mToAHyTNgYV4axG374kh7tv1sxm 8KlzlwjzAETehIEW7d2OW/VTCqeUa4wM9U+G X-Received: by 2002:a17:90b:4d0a:: with SMTP id mw10mr5870235pjb.217.1612403240965; Wed, 03 Feb 2021 17:47:20 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.47.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:47:20 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 75/93] tcg/tci: Split out tcg_out_op_rrcl Date: Wed, 3 Feb 2021 15:44:51 -1000 Message-Id: <20210204014509.882821-76-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1030; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1030.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- tcg/tci/tcg-target.c.inc | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) -- 2.25.1 diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index 6c743a8fbd..8cc63124d4 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -341,6 +341,20 @@ static void tcg_out_op_rrs(TCGContext *s, TCGOpcode op, old_code_ptr[1] = s->code_ptr - old_code_ptr; } +static void tcg_out_op_rrcl(TCGContext *s, TCGOpcode op, + TCGReg r0, TCGReg r1, TCGCond c2, TCGLabel *l3) +{ + uint8_t *old_code_ptr = s->code_ptr; + + tcg_out_op_t(s, op); + tcg_out_r(s, r0); + tcg_out_r(s, r1); + tcg_out8(s, c2); + tci_out_label(s, l3); + + old_code_ptr[1] = s->code_ptr - old_code_ptr; +} + static void tcg_out_op_rrrc(TCGContext *s, TCGOpcode op, TCGReg r0, TCGReg r1, TCGReg r2, TCGCond c3) { @@ -565,12 +579,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, break; CASE_32_64(brcond) - tcg_out_op_t(s, opc); - tcg_out_r(s, args[0]); - tcg_out_r(s, args[1]); - tcg_out8(s, args[2]); /* condition */ - tci_out_label(s, arg_label(args[3])); - old_code_ptr[1] = s->code_ptr - old_code_ptr; + tcg_out_op_rrcl(s, opc, args[0], args[1], args[2], arg_label(args[3])); break; CASE_32_64(neg) /* Optional (TCG_TARGET_HAS_neg_*). */ From patchwork Thu Feb 4 01:44:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376211 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp862664jah; Wed, 3 Feb 2021 18:43:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJx2i0Qsy03e6Q9JDCf2RCiM/FRNIEZQ3RlqwiFBIcNBJfLXJBXZpdd7yI0WlvSe/yqlhbmb X-Received: by 2002:a25:80c9:: with SMTP id c9mr8562745ybm.279.1612406585970; Wed, 03 Feb 2021 18:43:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612406585; cv=none; d=google.com; s=arc-20160816; b=bhLupioR3Kf0FYMold+s+Pegue6yeRnCNRUlUFzdZWf1Luvl1mXr9JDi6rqqe35btH Ij1YyGbqNsqBksgHfnZnYDjH6gUrt/zpMD4HsvhftCNI99VeiFl7h22/LPiiHDRXytf1 qtIUew4TKVVhMMV/U3xPdLtc3pOiaKZQiWCV8dbUi429i7KqKQYU83Wfhfo0Pf3PCSGi 1hDlS3OC2reHmJ+MgQH2yYr6C9WNournoEs2fFPhd6r/nJJ9TPFZNkudw9M5/Gt43bU6 rEa8lhoSLMUlAangDpHsjIfRq7l2Dq7i2rOh0DVsFJSs7Q393v6zc+xeEAnuF9YuQBZp oZfg== 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=Muk10JaSTB/BV2ItdFkgjXJDIa6PJidFm2ztv5V4ygc=; b=b+0f3VbxA6BAA0KuLTxAtJPi3JNW5sAmRFV5+dbtu01VmRxT7KcN8epB8qtzhNj6W8 LlshGW+IJUzRWhFYCHbYKxl+m5TT58zh6hmvc6LQZagrrsfHesbEq//rqhUGfqnzrWwh TMDjGl3KD2FAMFEuvU2W6zBX+SykSiOB/JkWkiKEVqzgZxarhm7HgLqqvLO2sLzYb+4A 6/kTgK2Rp+XuMp3V9zqXNbR91hK+KqkIWlYn1uWM1r5gOssKQdxBhpCP+W00gbFKDnkC yWtCo7tovt5vh6hJdndjwBK4MLmnIgCUEKs3pqAsxQbxiel6nfnI7/S+HkooArkSamQi bCJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=v7FDmm9P; 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 l15si4038915ybq.274.2021.02.03.18.43.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:43:05 -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=v7FDmm9P; 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]:42974 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7Ubp-0003VR-Ev for patch@linaro.org; Wed, 03 Feb 2021 21:43:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45490) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Tk4-0006Lv-94 for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:47:32 -0500 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]:46279) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Tjx-0004Dm-Ht for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:47:31 -0500 Received: by mail-pl1-x62c.google.com with SMTP id u11so866453plg.13 for ; Wed, 03 Feb 2021 17:47:23 -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=Muk10JaSTB/BV2ItdFkgjXJDIa6PJidFm2ztv5V4ygc=; b=v7FDmm9PK6r3qBZgy7298sJ2lMbc/wxaFsnlDPCQ92y3+dQbR+rVKtIVCRCI2LBS4m OjRaVllh/bMBalUUhvYjElMtQqQ4VKaAQLGkHeZW5wPiPzlY3AK1RfLgMpJDbt63J3wH 1uOVRGhredUULV6iKqmpEA1wFUzbU2S/YF6kxzRcLmflKuQARmlwXnYwhAimjwBSrHuz /SCgOKhKk2wmqxI3IIvZC/ZH4L0v5jGJ4hSu+b7yObbuvZD4EXK3DB6qD/yTi7XDZG9s ML2mLMVSVCAMJdbi1eRhTNs2PMsdZ8lShbEn5tCoQVZ2s5NBnD8lCknfkf2Tj275mHGC MgtA== 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=Muk10JaSTB/BV2ItdFkgjXJDIa6PJidFm2ztv5V4ygc=; b=j/qBRFLsnOniPxxTluEttLveWlBSbWVeqYat4NNzJAjupqHO1M4i7OF1P7U8jLJvl/ hxt9uH3mZvQsL0StoCyKvvKLrWqlwvHL90pmQQCbo3R6bllOWReuAKTc3VOEVsWMcdVt CSkxV5CE+2qReAJSSOUtqojg2fSys2h4NRezE2euTXtxeTVP6ytvdexdgqIZtlpY+hzg kw45VvTabntdkdMr2WlvCswHZzpdxIq4hHHHNNy4+PxmweD0JZSzAefAQC6E7/fLWS5u fjTiDDg6M1nR1XrcVrZCeOm0dahZD055Mh2QNWCgN1Ymu/XZ/KjExXbeZO05FdOZMiBq TpYw== X-Gm-Message-State: AOAM532yNvjUWsRCk0KqCV32SQ9YtaE/uHv2Dd0+eoeFIr0Bx2o65WNQ dMes1aS49Twx9Y8M8YbI1Flo1pUKyPX7xS/c X-Received: by 2002:a17:90a:43a7:: with SMTP id r36mr6034348pjg.189.1612403242597; Wed, 03 Feb 2021 17:47:22 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.47.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:47:21 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 76/93] tcg/tci: Split out tcg_out_op_rrrrrr Date: Wed, 3 Feb 2021 15:44:52 -1000 Message-Id: <20210204014509.882821-77-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-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: , Cc: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- tcg/tci/tcg-target.c.inc | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) -- 2.25.1 diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index 8cc63124d4..f7595fbd65 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -401,6 +401,23 @@ static void tcg_out_op_rrrrrc(TCGContext *s, TCGOpcode op, old_code_ptr[1] = s->code_ptr - old_code_ptr; } + +static void tcg_out_op_rrrrrr(TCGContext *s, TCGOpcode op, + TCGReg r0, TCGReg r1, TCGReg r2, + TCGReg r3, TCGReg r4, TCGReg r5) +{ + uint8_t *old_code_ptr = s->code_ptr; + + tcg_out_op_t(s, op); + tcg_out_r(s, r0); + tcg_out_r(s, r1); + tcg_out_r(s, r2); + tcg_out_r(s, r3); + tcg_out_r(s, r4); + tcg_out_r(s, r5); + + old_code_ptr[1] = s->code_ptr - old_code_ptr; +} #endif static void tcg_out_ld(TCGContext *s, TCGType type, TCGReg val, TCGReg base, @@ -601,14 +618,8 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, #if TCG_TARGET_REG_BITS == 32 case INDEX_op_add2_i32: case INDEX_op_sub2_i32: - tcg_out_op_t(s, opc); - tcg_out_r(s, args[0]); - tcg_out_r(s, args[1]); - tcg_out_r(s, args[2]); - tcg_out_r(s, args[3]); - tcg_out_r(s, args[4]); - tcg_out_r(s, args[5]); - old_code_ptr[1] = s->code_ptr - old_code_ptr; + tcg_out_op_rrrrrr(s, opc, args[0], args[1], args[2], + args[3], args[4], args[5]); break; case INDEX_op_brcond2_i32: tcg_out_op_t(s, opc); From patchwork Thu Feb 4 01:44:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376213 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp863003jah; Wed, 3 Feb 2021 18:43:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJzG/Hh9Jmxb+emHGAQm6l/vbEt8v9pUY7ZoIzKCEaB0LLEP1VpOBvWVb2cZtCWClBPX2FnV X-Received: by 2002:a5b:952:: with SMTP id x18mr9012699ybq.69.1612406625869; Wed, 03 Feb 2021 18:43:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612406625; cv=none; d=google.com; s=arc-20160816; b=kDZLJOBfSZsbs/Wm895l73yAtUDG9YbReVGWvZOftFUhSB20Qj6a5WR6dBh7QdhrFu EyJ1VhvsA/H/eIW3WkI0agxEux6yebiQIu4w19K41EoXrjoM2VVuChJzas922g0ED7Ts bCRkuOi4i/0a9ASdeQpeXieIr9iG8h3MXKdrY8BIS8pg5a1knP5EA91EELZ7peysMGIo H0VaWsBDKNaoDfR4ithGTN7bb8uL5x5aJOQOXqOQObR8UGheugeYUGOT2nk7nU3RjO1Y 3Dv5Bj3rK9Pkb8SpQTyYWHdCTI1eACKy/Zf0+DzRGPF0R6BbAHHMDJATHPXsSRsMvgiu qiSg== 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=RltB6tJRO1PShAvoUlO75Uo0j450X071u7i11eDg0EU=; b=l2CxG2Doe/yEgTMx+EbjDXW8zjj+mjuEez/YGLlFiB8Clt0OC5C58+efieURdBeVJM 8Xy5mdaMCkWoal9qIVggt3V9pkpq4kX0m7wcl8Gi+PMX3qIyeki6UWQvyYLazzhuB780 XAPbJmvAKddIvSrsshKPobceYP3hKdNKkSzlTrerVrs3bfW4p9W8YIiwCra7ZPROO/Ft 0h6JIcAyTlSpdjJ0JUBrHZO3v1hDWTzUa+35xsQ5cctMc48D2J0pK6l+X0zDdFBpXMTP OrKmiNkb9P2ON2qElrsyEof37p6F9+i24w28JFUPe/7n4s/FfdtGx4UR8klqgOeouPE+ AI6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ugn8vqTq; 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 l195si4184431ybf.109.2021.02.03.18.43.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:43:45 -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=Ugn8vqTq; 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]:46030 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7UcT-0004mM-BV for patch@linaro.org; Wed, 03 Feb 2021 21:43:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45502) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Tk4-0006N3-Om for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:47:32 -0500 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]:37461) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Tjx-0004Du-I5 for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:47:32 -0500 Received: by mail-pj1-x1036.google.com with SMTP id g15so828987pjd.2 for ; Wed, 03 Feb 2021 17:47: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=RltB6tJRO1PShAvoUlO75Uo0j450X071u7i11eDg0EU=; b=Ugn8vqTq9pUv2FIREqDAdqAA71cRKBD8wQwrUvhzriLyjxlGy8g+/Xfrk5HkPbnufX ykOSdnX8fEyfoXs7go09ihErRvqLmlKWAHBBJUv9lILjjzHKAiyDhbZeAapFK1clImOG cKeqRP5qc+MemAOk8SsbeUZk7kgWNXgXo8r5eO9racLfNj0s2CZw8DzwTy5t16GVYDSQ AprwODb7RqwMYGRt68KiZeUx1cquPslHUdjyhhZBWcDsvGgk0HcCqebT5QMZCZlKFoJQ MnuZjixiGc6hYxJPwydsXVeoYXeiCvx9LIFhGLY34QEmKiP1YI66h09v2/wYH05hIUkc cKnQ== 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=RltB6tJRO1PShAvoUlO75Uo0j450X071u7i11eDg0EU=; b=re3zWeEILzYmUx0nlEWEtnFEJSFyL2SF4xvrjw1YeVOF/iA39CFTi4cXFvdadnZoOm sz2EDqmWwfX+FYWwj2V5m96DR6Go7nq2xPDbXCDjUYdvU6m5Fi/eEr4Zsv12Ax4lXbnt /AHwkpoboYknq5ttVUYSCInNzcbymxMnp7uTP1Bpl8QWkrRLPGnbottu0XVZU8L0Jm8E BZPml4rRDE/WgkrUsKiZctKgB0HjIMsgzer0v4jJIY8KwJWigQD4Of/0cXMM9eLXnZPZ qS4PFJ+2lYzubsfF3A+A3nXezBQAR0JlPwGtMrPW9QFzjmJAcTwXuwMYlz9mkjEFoecC srdQ== X-Gm-Message-State: AOAM531Mwmg3cRuROI3f+oQQD32F/X07xNiebgnYvUcso3t9obcMie3j Vmx4KQLaX6IhjESSXmI6zlbqFSMzStZqf5tJ X-Received: by 2002:a17:90a:4096:: with SMTP id l22mr4327050pjg.34.1612403244089; Wed, 03 Feb 2021 17:47:24 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.47.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:47:23 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 77/93] tcg/tci: Split out tcg_out_op_rrrr Date: Wed, 3 Feb 2021 15:44:53 -1000 Message-Id: <20210204014509.882821-78-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1036; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1036.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- tcg/tci/tcg-target.c.inc | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) -- 2.25.1 diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index f7595fbd65..c2bbd85130 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -385,6 +385,20 @@ static void tcg_out_op_rrrbb(TCGContext *s, TCGOpcode op, TCGReg r0, } #if TCG_TARGET_REG_BITS == 32 +static void tcg_out_op_rrrr(TCGContext *s, TCGOpcode op, + TCGReg r0, TCGReg r1, TCGReg r2, TCGReg r3) +{ + uint8_t *old_code_ptr = s->code_ptr; + + tcg_out_op_t(s, op); + tcg_out_r(s, r0); + tcg_out_r(s, r1); + tcg_out_r(s, r2); + tcg_out_r(s, r3); + + old_code_ptr[1] = s->code_ptr - old_code_ptr; +} + static void tcg_out_op_rrrrrc(TCGContext *s, TCGOpcode op, TCGReg r0, TCGReg r1, TCGReg r2, TCGReg r3, TCGReg r4, TCGCond c5) @@ -632,12 +646,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, old_code_ptr[1] = s->code_ptr - old_code_ptr; break; case INDEX_op_mulu2_i32: - tcg_out_op_t(s, opc); - tcg_out_r(s, args[0]); - tcg_out_r(s, args[1]); - tcg_out_r(s, args[2]); - tcg_out_r(s, args[3]); - old_code_ptr[1] = s->code_ptr - old_code_ptr; + tcg_out_op_rrrr(s, opc, args[0], args[1], args[2], args[3]); break; #endif From patchwork Thu Feb 4 01:44:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376216 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp864201jah; Wed, 3 Feb 2021 18:45:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJxJpfUaBvdrO3nrUhRXc+ni61oSyh/+/hASdPv5gR0gdOEMg87IR3+64PSFYhGbL22In7sx X-Received: by 2002:a25:8b02:: with SMTP id i2mr8818592ybl.197.1612406758001; Wed, 03 Feb 2021 18:45:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612406757; cv=none; d=google.com; s=arc-20160816; b=CtF+k23VstDalKPyXF2lOj+RDI8+fl/68tkTpSPzQTHiiP/6iWlmiTHUJWaHqoFUtT bc96XjCddPHjDFP4teSS8SnH8YiidwEmc+E4YK/GQeAbNz+/Y9B5LaFpa6fVtkGhllEs yIG/SQ7MGDSxruKKqv+NTYAkNqojDajCH7PenpNZ5mEpYayJyqD/olABi7VqxRA/788Y T595dlUziM+U0r/RxORwKpocc5C7biViZmybx/5s8OicUa3cM1q/hvD7oDNfNPuk5q3q UTw8j1TxITJ/DF893z6DrtP2Oo5R/iYkK0FGZ+iQ+ftDflT8qUGArGonREfpR9tHnkkY 6RRw== 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=FuCnYTOQyWEVo9ZyllKi/tHo7oVf70VfVQ0xN8tYC5M=; b=QIVAXY63iUuXo2ej6nXpG6wIzZCbcOjLSDdC6kFdhJVWqDGTJ7Buo4iErk50QMpzrr 0xQL64x96+FHCSPPkfmtHmCISbp5LvjDtQH+qudc9Xow5/Uovh6F7gsKoRtcQDP0W/IG u4gc0qiCbSn3LYUnolTqk5uRixsVzEAJmRp0TW9TRRR3Cm6UZ8n4fodJMV72+dEOuXao A+YO62ejvBBhaFIHW7NfuKeWE33Q5jfORtO1IJEkX7a3fNdw/zMJ3mGfjxtbYUs2OgBf 1XU1jfDO6/7qfCJQ2mW0mwe8yhUF7qijLOrEDb6EDKClYMcZ6W26qmvbPfpmbRym6d44 r4MA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yDp2QiqP; 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 i4si3903264ybe.341.2021.02.03.18.45.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:45:57 -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=yDp2QiqP; 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]:51474 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7Ueb-000796-Fd for patch@linaro.org; Wed, 03 Feb 2021 21:45:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45514) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Tk5-0006Ne-3N for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:47:33 -0500 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]:33844) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Tjz-0004E8-GX for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:47:32 -0500 Received: by mail-pf1-x42f.google.com with SMTP id m6so1089776pfk.1 for ; Wed, 03 Feb 2021 17:47:26 -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=FuCnYTOQyWEVo9ZyllKi/tHo7oVf70VfVQ0xN8tYC5M=; b=yDp2QiqP+EutfIOic0KaJkm3rUDj7VZmbCacPw3oSw0GkkOq84BIyWCW79KhDbd17E kdGXa0vfDi8p3Yu7mB7QsvOAPIT/tyOKoTGGbCAjkmfnAHJi05QWHIqR6GvxNmf9cJQx 2vZn1/C4M86h2HLLGoMoQplV/aiI4PD6NsOc6vdQK7mOci9K3+EdqqBAz6Yiuj8HNADT d/4CoonQixRj4ZmYVFpPNXlKjatjqb9ZQKtGX7b5U1y++Cr5j/tkzYFcH0DSBYi5qEdY VRyWHKW7cd+/R+5x95M7jHp4hNjkrY85kjfHMbwj1F56vbtpvigRoIWM4NW3cYlZr9+r bSmA== 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=FuCnYTOQyWEVo9ZyllKi/tHo7oVf70VfVQ0xN8tYC5M=; b=H7kstULMa+NvEGu7BwIV1M4Sp2gklP+akfIUtFdtzwGr6EcFrt6q+bJxhkUoGA61bL l8NPISIIK+XM5jmO73PrLlSBnCcdcdHLaH1q54QK53FcG2XWIF+DGwB4YeQBNwp2mV1J r5MplRzIR+AxxrxgG86KaajFZ3qKx0QFS6NKljGN0if6Bg3vNqooSzHxr6wYptvPTKkF VSud2r/quJ45X2rAdYODRxBGGN3dYjpQiAIUyOOA1Ag6jXQ4cleZTl86TQqzVcL6DH2H b3i7vi1KMw1poyvFkrzRKiZxWI4JFIi6IwqCovPNVA+isxeaRSrecBHmAUhHvEHr3e/w LN+Q== X-Gm-Message-State: AOAM532Ebk0dOwtJfyqwqG5ZKmOE1lqDjZGkivpd5jF9bV4DgEawZY86 jNhRQFS4/3kAkN+6WfDv+LO8ZRu2Co2gWvni X-Received: by 2002:a62:7883:0:b029:1b6:8641:1fb2 with SMTP id t125-20020a6278830000b02901b686411fb2mr5724848pfc.10.1612403245623; Wed, 03 Feb 2021 17:47:25 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.47.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:47:25 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 78/93] tcg/tci: Split out tcg_out_op_rrrrcl Date: Wed, 3 Feb 2021 15:44:54 -1000 Message-Id: <20210204014509.882821-79-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42f; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42f.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- tcg/tci/tcg-target.c.inc | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) -- 2.25.1 diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index c2bbd85130..fb4aacaca3 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -399,6 +399,23 @@ static void tcg_out_op_rrrr(TCGContext *s, TCGOpcode op, old_code_ptr[1] = s->code_ptr - old_code_ptr; } +static void tcg_out_op_rrrrcl(TCGContext *s, TCGOpcode op, + TCGReg r0, TCGReg r1, TCGReg r2, TCGReg r3, + TCGCond c4, TCGLabel *l5) +{ + uint8_t *old_code_ptr = s->code_ptr; + + tcg_out_op_t(s, op); + tcg_out_r(s, r0); + tcg_out_r(s, r1); + tcg_out_r(s, r2); + tcg_out_r(s, r3); + tcg_out8(s, c4); + tci_out_label(s, l5); + + old_code_ptr[1] = s->code_ptr - old_code_ptr; +} + static void tcg_out_op_rrrrrc(TCGContext *s, TCGOpcode op, TCGReg r0, TCGReg r1, TCGReg r2, TCGReg r3, TCGReg r4, TCGCond c5) @@ -636,14 +653,8 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, args[3], args[4], args[5]); break; case INDEX_op_brcond2_i32: - tcg_out_op_t(s, opc); - tcg_out_r(s, args[0]); - tcg_out_r(s, args[1]); - tcg_out_r(s, args[2]); - tcg_out_r(s, args[3]); - tcg_out8(s, args[4]); /* condition */ - tci_out_label(s, arg_label(args[5])); - old_code_ptr[1] = s->code_ptr - old_code_ptr; + tcg_out_op_rrrrcl(s, opc, args[0], args[1], args[2], + args[3], args[4], arg_label(args[5])); break; case INDEX_op_mulu2_i32: tcg_out_op_rrrr(s, opc, args[0], args[1], args[2], args[3]); From patchwork Thu Feb 4 01:44:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376218 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp865691jah; Wed, 3 Feb 2021 18:48:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJy5tdq2DTTAIoX2+M+0Irsu/1pzFFSaQtZE+GQJAnpmn25lkZn4a2oszgxyrNL7z4YlE1mH X-Received: by 2002:a25:ce51:: with SMTP id x78mr8974540ybe.198.1612406922245; Wed, 03 Feb 2021 18:48:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612406922; cv=none; d=google.com; s=arc-20160816; b=dIbDNqxoXB0tVRIk+e1+0YvcYdd+v69VEs4DUBE6vgmGpp9UijdoT8llnjPmkc2RYE A2HjD9l5BXH1gCXXYYMQ/Ktvn7Zg6qTgS0PVH0hcV6vYAIYfRjzAPRFckdRUw1HMipTj P/3nvb16QrHEC39kHU8oceBBPVcox+18VvoiQ/RBGDc55TCkCA3Ky9tIeEMOQGIH4jWX GTs8X6s4A2AhR6aA0OLMTeWnF2tox0hUaeKZo4jOa4/vL1sUo2Mnb3oVq8XJePYtAx2O iXq1VX9jmM0RzBGc2GAhnxwQmKZ42CQV2s1hOIPYzqxIyQWuHGBEiR9d3VgNUKCf+6Ht TeBA== 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=UtDE8Pm65Grc/U22TwT0AwuyG4b+N8yR6xVz8cz41eM=; b=agHnffp+0moOBzV0CGufk2KhMRt4wrsgBtLUZc2KN2+Ku06/YfbIyZXHentcoZHCBZ 8kwWYSXdMXYzWErCvT9+M7sY50Xt95neZ1rZ7uJqCmoVeekgzJvzzRqgQt3fMF9Issth wNM8VLMXkPoUflCSd0QqNGuy1gr2zoVTa3WYNwt604EQDtokMdpbt/tASpkTzs6ksPCs c85oaQHvLjbt5+VVfpl8KpnPIP5w2kZ/mjuWMRHlZnvdW+uGprNXRdM0rE0xB3+avusE lt2tzjWimcEInIph7mFeJZx9Ku+11eNSb0zAzvURjQGESAU9ANH9juWalZk1769rUd59 nYQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iUn2gDuy; 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 j13si4266642ybp.459.2021.02.03.18.48.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:48:42 -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=iUn2gDuy; 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]:35220 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7UhF-0003vk-JZ for patch@linaro.org; Wed, 03 Feb 2021 21:48:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45520) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Tk6-0006Sp-MI for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:47:34 -0500 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]:40781) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Tk1-0004F3-Hh for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:47:34 -0500 Received: by mail-pf1-x42f.google.com with SMTP id i63so1070415pfg.7 for ; Wed, 03 Feb 2021 17:47:28 -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=UtDE8Pm65Grc/U22TwT0AwuyG4b+N8yR6xVz8cz41eM=; b=iUn2gDuytfVBb9/COd2Ua1DDJO0yMDr97GUDsUrBuRy88g2FtpAqAI9+cNNnvHJgcU /J9TojRnRRgF53QHPmJeSTDA/CVEtP+Vljh1L7cggNDUZ241jznN7Z3m+NPU1tUcBGdk LPJTMV9qbb74bpp4Zjr3GLQ6pFCYvtpQ1y7qv5NvrWJ/9IAL6nRabv3WCR6sMOTC4Ncx Rg/2chIjDUQkhkbI+FJaDv2I5GXJm3qmRYtG8oDn+a8OtUnbqQ1hOlm5XJ9j3M+opm51 jvYKxNR606EVTHk81oBMFfN3jLz5BSk6s4sxni+N+d/zd2zmmdCm7Tm6mYjZ4V0RUAug weVA== 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=UtDE8Pm65Grc/U22TwT0AwuyG4b+N8yR6xVz8cz41eM=; b=F7oHWLVFvBwBcegvd3T/zVV9J5tqA9Ie8dPu2nxtGLl95OaIn8eMmmAZep2HDfo9Tt KYHYXF0RR55ucjicW+BkJzTcdUhhzhAiMYH+7SuEiza0kiT9mK//Ex4tL/ZIzbDf7uMG 2gxuO88TdTk+/IXEsbnTSv41K5n4xEWys5WwGfwYx6KYjjznT05hzHNZ0ZJn26iyOsfp 8A/G7TwMBAuSMH4fo52lyo8/6c7ras2HlBSN008khTNYJjqrrzI0kJvRpB5PuDxZSg07 y4532JHMG4fSj0E9tlKtfaFX7vfEGr0IjoSkNR87T6VtltzdV0RPhHpd7Zp2uDjUIG+N vnUg== X-Gm-Message-State: AOAM533kzy4lW/uQawmOZJBWB18WELOZedws9if/NIKsuptZ1URiuTMY 8JJ54YrImG2zuMfHwTi3wxUALZ/bpv7wzVDt X-Received: by 2002:a62:ddcf:0:b029:1b7:baca:6c71 with SMTP id w198-20020a62ddcf0000b02901b7baca6c71mr5865362pff.43.1612403246993; Wed, 03 Feb 2021 17:47:26 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.47.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:47:26 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 79/93] tcg/tci: Split out tcg_out_op_{rrm,rrrm,rrrrm} Date: Wed, 3 Feb 2021 15:44:55 -1000 Message-Id: <20210204014509.882821-80-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42f; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42f.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- tcg/tci/tcg-target.c.inc | 70 ++++++++++++++++++++++++++++++---------- 1 file changed, 53 insertions(+), 17 deletions(-) -- 2.25.1 diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index fb4aacaca3..f93772f01f 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -314,6 +314,19 @@ static void tcg_out_op_rr(TCGContext *s, TCGOpcode op, TCGReg r0, TCGReg r1) old_code_ptr[1] = s->code_ptr - old_code_ptr; } +static void tcg_out_op_rrm(TCGContext *s, TCGOpcode op, + TCGReg r0, TCGReg r1, TCGArg m2) +{ + uint8_t *old_code_ptr = s->code_ptr; + + tcg_out_op_t(s, op); + tcg_out_r(s, r0); + tcg_out_r(s, r1); + tcg_out32(s, m2); + + old_code_ptr[1] = s->code_ptr - old_code_ptr; +} + static void tcg_out_op_rrr(TCGContext *s, TCGOpcode op, TCGReg r0, TCGReg r1, TCGReg r2) { @@ -369,6 +382,20 @@ static void tcg_out_op_rrrc(TCGContext *s, TCGOpcode op, old_code_ptr[1] = s->code_ptr - old_code_ptr; } +static void tcg_out_op_rrrm(TCGContext *s, TCGOpcode op, + TCGReg r0, TCGReg r1, TCGReg r2, TCGArg m3) +{ + uint8_t *old_code_ptr = s->code_ptr; + + tcg_out_op_t(s, op); + tcg_out_r(s, r0); + tcg_out_r(s, r1); + tcg_out_r(s, r2); + tcg_out32(s, m3); + + old_code_ptr[1] = s->code_ptr - old_code_ptr; +} + static void tcg_out_op_rrrbb(TCGContext *s, TCGOpcode op, TCGReg r0, TCGReg r1, TCGReg r2, uint8_t b3, uint8_t b4) { @@ -384,6 +411,21 @@ static void tcg_out_op_rrrbb(TCGContext *s, TCGOpcode op, TCGReg r0, old_code_ptr[1] = s->code_ptr - old_code_ptr; } +static void tcg_out_op_rrrrm(TCGContext *s, TCGOpcode op, TCGReg r0, + TCGReg r1, TCGReg r2, TCGReg r3, TCGArg m4) +{ + uint8_t *old_code_ptr = s->code_ptr; + + tcg_out_op_t(s, op); + tcg_out_r(s, r0); + tcg_out_r(s, r1); + tcg_out_r(s, r2); + tcg_out_r(s, r3); + tcg_out32(s, m4); + + old_code_ptr[1] = s->code_ptr - old_code_ptr; +} + #if TCG_TARGET_REG_BITS == 32 static void tcg_out_op_rrrr(TCGContext *s, TCGOpcode op, TCGReg r0, TCGReg r1, TCGReg r2, TCGReg r3) @@ -663,29 +705,23 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, case INDEX_op_qemu_ld_i32: case INDEX_op_qemu_st_i32: - tcg_out_op_t(s, opc); - tcg_out_r(s, *args++); - tcg_out_r(s, *args++); - if (TARGET_LONG_BITS > TCG_TARGET_REG_BITS) { - tcg_out_r(s, *args++); + if (TARGET_LONG_BITS <= TCG_TARGET_REG_BITS) { + tcg_out_op_rrm(s, opc, args[0], args[1], args[2]); + } else { + tcg_out_op_rrrm(s, opc, args[0], args[1], args[2], args[3]); } - tcg_out32(s, *args++); - old_code_ptr[1] = s->code_ptr - old_code_ptr; break; case INDEX_op_qemu_ld_i64: case INDEX_op_qemu_st_i64: - tcg_out_op_t(s, opc); - tcg_out_r(s, *args++); - if (TCG_TARGET_REG_BITS == 32) { - tcg_out_r(s, *args++); + if (TCG_TARGET_REG_BITS == 64) { + tcg_out_op_rrm(s, opc, args[0], args[1], args[2]); + } else if (TARGET_LONG_BITS <= TCG_TARGET_REG_BITS) { + tcg_out_op_rrrm(s, opc, args[0], args[1], args[2], args[3]); + } else { + tcg_out_op_rrrrm(s, opc, args[0], args[1], + args[2], args[3], args[4]); } - tcg_out_r(s, *args++); - if (TARGET_LONG_BITS > TCG_TARGET_REG_BITS) { - tcg_out_r(s, *args++); - } - tcg_out32(s, *args++); - old_code_ptr[1] = s->code_ptr - old_code_ptr; break; case INDEX_op_mb: From patchwork Thu Feb 4 01:54:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376220 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp866159jah; Wed, 3 Feb 2021 18:49:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJz0HwZcxLUdqazbrIZVKn7ZuLZniLoaai7h6aLz8q+3+HFOveAKHfsitLyUvgfXAszaehP0 X-Received: by 2002:a25:bec2:: with SMTP id k2mr9021773ybm.42.1612406975564; Wed, 03 Feb 2021 18:49:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612406975; cv=none; d=google.com; s=arc-20160816; b=PMGiTENnuamtihfXtxel/nzflEk0xSf7nXGkTCfuH0SqMkGX39YB39wie1wzEUuS5r FNB4g8Y220kVb3rSfdLcz36MRaO7NAsSW8fwWU5j496jnf9pPKNcMWOHVzNinXMszO4t KMCqki0HxE6vn+YHQzzHdos0fyitttQV1mPwtUKzKrfTkFVimTehxWcFlb/WscsBdBH5 1Xjca0N8qBH1cFlxaq3MT1itbchkmHQ0lPPZ5LIqTRp5gSTkCEFLfydGj0lBIvI2XxcL wQ6wle95RjKLhZNjXb7aaZWxXaw2Nu2EonbmRLuFnWvFDIbNiu8VaBrGxVSJdlyBNGkY p0iA== 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=Vq4qc1b2g43xbe/29EXgve4/dpXJMnCEHSHrRl9cyeE=; b=aS3p2767NBY7PFVps/b2XwdcV6WhD91RYsoaOL4hBOuvGQCjdC64dcZ43QCDMm6h6R VFe8W7E4DRQb7kmm4KX6JRjTtuc/3a7n4B+F+U2tmofZ6NA1/J/Tzm0vQUWVPtKlILES 5GJM2muHSEdLW5ovBngp7RO8okOWcJtOFnDgZYznEBF+Y5ifsb7vvXp9dLlrfHbk2OqQ CTgGgjtDuLKekBXZKPV7XvGoqZT/z/osTpPehw/n09sZOXwGQI9pI01GMlxrtqa6KDbn HYrqmWEJDrOVqTIouY5judQwnTJfK+iQ51GMX4op5ojSvLzcNVO7XXR5s8o3OtKAnq+g 3hcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dBleJIp7; 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 u60si5249908ybi.475.2021.02.03.18.49.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:49:35 -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=dBleJIp7; 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]:38518 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7Ui7-0005Lz-1y for patch@linaro.org; Wed, 03 Feb 2021 21:49:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46752) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7TrG-0007x4-90 for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:54:58 -0500 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]:36080) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7TrE-0006Qw-Md for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:54:57 -0500 Received: by mail-pl1-x634.google.com with SMTP id e9so907324plh.3 for ; Wed, 03 Feb 2021 17:54:56 -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=Vq4qc1b2g43xbe/29EXgve4/dpXJMnCEHSHrRl9cyeE=; b=dBleJIp7eM6v2xo8UrzFm8pRF97pLj2hzHbVsPQyAhak0swfNH7f/BryDg2sCKVb5v /R+aOg1OQS0ZNqCHuuFm/TUivgM7qAAsUwYyr/7VX6dkp9Ol8vW6XIogzksjQYwqLMwx HfkJ7sQTCzx790fRK5Xru4y4pLlQsdzrqV6R/9pt4G/1U0f3MQGqDlwPzSEIiONFH+Fb dejR2PBaMS1j/ign4o3pTUeZVjgxkxMTkWLVPw4WXT81bnPYz1lNA73WvR8hmrgux5qq 2kIDQlvZV1om9754evzJ6WcJRAvFQu1KB/7zu77ZSCdKhLpzWmaNnbAuQnRcnEwR72tK LOmQ== 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=Vq4qc1b2g43xbe/29EXgve4/dpXJMnCEHSHrRl9cyeE=; b=jBmFt2j2s7VZ4nvJi93svZboTf+o+Q4xyIB3BQ6K/OKvcMQss79alJGgNd7iDTY6fk X2Z9hlNu/b7tcLhwHGJ4dy+4+HSfcoGpF5MTwXZp4Lj3AkdKzGetoO9DsgLtN39ZQ5ng sADD/waykNdu179MbPC9hZGYCy2+XRojxf4QwBffAum7Z7ZR5sUfRwej1R3H58ghjAiU b6l8TRsVsjRnbsXWdvabLJzZYPEm0m9vxAkP8tZPzuJTZEdfA8jjmkhasird1KB98T4k aSFav3TgDK8MmbrzRsFkHcLdgbNLoy+wtqBw+eu01GOZEe6JIuBNqAfDez/ERazlsmBR oz5Q== X-Gm-Message-State: AOAM5307N0grD2+b3n5JTvIcuRNan+EgaaCBw/pRqxBdzVrThoye6KKC eZ/3oGrfyJ9qkh7ZML7g73Ntxqls1xv+NGF4 X-Received: by 2002:a17:902:7043:b029:df:cabc:cc97 with SMTP id h3-20020a1709027043b02900dfcabccc97mr5865587plt.4.1612403695211; Wed, 03 Feb 2021 17:54:55 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id h23sm4176238pgh.64.2021.02.03.17.54.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:54:54 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 80/93] tcg/tci: Split out tcg_out_op_v Date: Wed, 3 Feb 2021 15:54:52 -1000 Message-Id: <20210204015452.885290-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x634.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- tcg/tci/tcg-target.c.inc | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) -- 2.25.1 diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index f93772f01f..eeafec6d44 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -303,6 +303,15 @@ static void tcg_out_op_p(TCGContext *s, TCGOpcode op, void *p0) old_code_ptr[1] = s->code_ptr - old_code_ptr; } +static void tcg_out_op_v(TCGContext *s, TCGOpcode op) +{ + uint8_t *old_code_ptr = s->code_ptr; + + tcg_out_op_t(s, op); + + old_code_ptr[1] = s->code_ptr - old_code_ptr; +} + static void tcg_out_op_rr(TCGContext *s, TCGOpcode op, TCGReg r0, TCGReg r1) { uint8_t *old_code_ptr = s->code_ptr; @@ -587,8 +596,6 @@ static void tcg_out_call(TCGContext *s, const tcg_insn_unit *arg) static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, const int *const_args) { - uint8_t *old_code_ptr = s->code_ptr; - switch (opc) { case INDEX_op_exit_tb: tcg_out_op_p(s, opc, (void *)args[0]); @@ -725,8 +732,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, break; case INDEX_op_mb: - tcg_out_op_t(s, opc); - old_code_ptr[1] = s->code_ptr - old_code_ptr; + tcg_out_op_v(s, opc); break; case INDEX_op_mov_i32: /* Always emitted via tcg_out_mov. */ From patchwork Thu Feb 4 01:55:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376224 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp867993jah; Wed, 3 Feb 2021 18:53:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJzKVmLSxhKgC5Ln6jRbvTNRiIQCGpwy6cO6A4BIJPWeO9Dx75uULr1LYFBQAH63j1JJ/MRZ X-Received: by 2002:a25:ce4b:: with SMTP id x72mr9152312ybe.386.1612407184258; Wed, 03 Feb 2021 18:53:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612407184; cv=none; d=google.com; s=arc-20160816; b=vTGQ9Ywx+3ZqpgTmdniX0EQM8T1xUkli4OPQcIrDXkBXzp5U30I6H8Le+qW5nFB9il xVYhebsKQzXaEgtvIWuAKIohNuIYBjsPlhbpErQ/o/HGfrtMLE6d8+eTv9ibu4B6cgB7 QhV5AFAAHRwzXFPaLGgS0sx6HQPhwFVdQQQvWB6EVeJNuEeWOhx9fUz8vdqWZ6IvV6N4 0s2r9KSVXJ7clzSPtP534TQn04TM8eL3dPa2HSX5Z2jNZ22qDuwv3bvlxuAXsx5R/Ohy H/y2TLSY+HZwR2vf23DSIsLk9nkEIfYGNXk84QR5/kTad3/jxO5hbhD/HHMsmvs9sP9i bPgA== 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=kQwYPaxcLPGVIBaZFpt4Ukjta9EglPQhHZw+11ye7O8=; b=TDt/p/YAreqv2S2rijzxc1sZsXtW1pliFhI7OlWOojfRel9rss0keCjmPY9gRiPiuM li3v7L1sfHOFqAWduqVsUA/zCwlJUX3aw3A+tD2cOoDm79DX0bUbf3vI2aSZoixUGkP3 UMXfe1YdsLUOH1lx3gRwWPkU6nxRmwpZ7mlhttFH9MkuhVeux2ahoq5p/VjnWSe29JeR yi+DBffSTULFyugl3xTCwe4MHGAR84MSKVIKYSnanYk+mqw4EF5MvV0ta7Q+nxOTLnHz v9k7tPJkAfwehgocbX+5tkgzm6npIvTCMQDJspTe80Y77ieg8cNlAQyCVUGC2x2m6FcI v4Yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mPh2ZPAD; 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 t59si4841280ybi.182.2021.02.03.18.53.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:53:04 -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=mPh2ZPAD; 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]:46714 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7UlT-0000ba-O8 for patch@linaro.org; Wed, 03 Feb 2021 21:53:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46844) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Trb-0008Dl-6t for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:55:19 -0500 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]:39225) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7TrY-0006Wt-40 for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:55:18 -0500 Received: by mail-pj1-x1031.google.com with SMTP id d2so831457pjs.4 for ; Wed, 03 Feb 2021 17:55:14 -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=kQwYPaxcLPGVIBaZFpt4Ukjta9EglPQhHZw+11ye7O8=; b=mPh2ZPADP8GBYQusOPUAXPIi/f8R2LSKnZdU9nm4OnRRX8uPEiS6ZgchqpSYw7Rm7t jP4WGPBu50nmnCsxayllIQnudsEURhX25YFljF+IL7lTng0Lp3WmLvHwOUwTG4yy2z/H pB8ypYZF98YkAo2YmakZs+6ZJfA/dj2vKtblXQ9liQz0i8Z8IIsol8QnOYV10omZBdnq 8/fJyFZrum0RpH66jyYEG4AjEkANUZxBAo1YiWGlbOwXsn9tdeB+XG4VgGVk5SLt2i5C n5b45eWFQHKHDLLFgJ2ffWrOB2JgmuNI7MukuwW9sY5iwtaZW8UYkzgArYVhRW4Ln41F +PyQ== 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=kQwYPaxcLPGVIBaZFpt4Ukjta9EglPQhHZw+11ye7O8=; b=rZB3HMBLk3N3lZL8G3ewtbRaVWInZ/4r4bizDp7zyIf76IRy8rbY0bLAxvgZZUtT+j zIqhZG1O+YHV6m7ngLm8FwDF/IgRHbd//oLrhXAVbBrGHThQtwO5BCD4Iber9ytBFWfI PSLzZXl5yWv+PzpbR7l6wQyhpov3ZUen6JrnVUk3OJwDOQWOZ/OkOk7kiwDU411R9h3Z 0X8fd11EIRC2JQrktpveGLciWN4LfPjdMESOVB5EHa2TAv6rv3FJDWp71wcBokFHzZzQ FXyTd2sA/VOBISHYLUTNfhGJ2x5lrkJOIVneI+II/TKIcXxS1mao/v1I7BV4FZyM0kSB KOBA== X-Gm-Message-State: AOAM530XLoEKD4kQiFfTh605UtbIugNgsqR3e4pzcPW7vWcNKm/PFeov eHLhA2xYEUJkPBpsTB+gruFdl0T3MLFMbPQh X-Received: by 2002:a17:902:e5cc:b029:de:cdab:2da5 with SMTP id u12-20020a170902e5ccb02900decdab2da5mr5753165plf.32.1612403714058; Wed, 03 Feb 2021 17:55:14 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id x1sm4248768pgj.37.2021.02.03.17.55.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:55:13 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 81/93] tcg/tci: Split out tcg_out_op_np Date: Wed, 3 Feb 2021 15:55:10 -1000 Message-Id: <20210204015510.885341-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1031; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1031.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- tcg/tci/tcg-target.c.inc | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) -- 2.25.1 diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index eeafec6d44..e4a5872b2a 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -312,6 +312,18 @@ static void tcg_out_op_v(TCGContext *s, TCGOpcode op) old_code_ptr[1] = s->code_ptr - old_code_ptr; } +static void tcg_out_op_np(TCGContext *s, TCGOpcode op, + uint8_t n0, const void *p1) +{ + uint8_t *old_code_ptr = s->code_ptr; + + tcg_out_op_t(s, op); + tcg_out8(s, n0); + tcg_out_i(s, (uintptr_t)p1); + + old_code_ptr[1] = s->code_ptr - old_code_ptr; +} + static void tcg_out_op_rr(TCGContext *s, TCGOpcode op, TCGReg r0, TCGReg r1) { uint8_t *old_code_ptr = s->code_ptr; @@ -561,7 +573,6 @@ static void tcg_out_movi(TCGContext *s, TCGType type, static void tcg_out_call(TCGContext *s, const tcg_insn_unit *arg) { - uint8_t *old_code_ptr = s->code_ptr; const TCGHelperInfo *info; uint8_t which; @@ -574,11 +585,8 @@ static void tcg_out_call(TCGContext *s, const tcg_insn_unit *arg) tcg_debug_assert(info->cif->rtype->size == 8); which = 2; } - tcg_out_op_t(s, INDEX_op_call); - tcg_out8(s, which); - tcg_out_i(s, (uintptr_t)info); - old_code_ptr[1] = s->code_ptr - old_code_ptr; + tcg_out_op_np(s, INDEX_op_call, which, info); } #if TCG_TARGET_REG_BITS == 64 From patchwork Thu Feb 4 01:55:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376226 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp868902jah; Wed, 3 Feb 2021 18:55:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJw1NB24m69d2NF33sEEONWS1DA2ZrpmwNlV2ewZ/FwDCyyyxAzDaDJeLojf8Xn2OqZdLZ9I X-Received: by 2002:a25:6191:: with SMTP id v139mr8880352ybb.396.1612407300984; Wed, 03 Feb 2021 18:55:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612407300; cv=none; d=google.com; s=arc-20160816; b=X09yb6twrlNoST+ab2BK5DJ3O1Vz3NVmYA2RjThA8dTuR/GiSyDWPEjG2rf74f8suO +5HIPCeUAFc98RPkZ/gEaif/yZjapSwYeKKCHH2oqNHw4wydqL0IctCTKNdxbLFNR8h+ d0xzp/3ajfF+6FNx0dkrF+5alR76MUKg7Lz/dbG7iJlvxUKY16vDaplBRojANdVm7cX1 6j969VJ7LkdQ2sQUED9OC7rYq1kUk3jDXwJNn4dqeQX+a21L2jzjU2HMC/fNd4HMSOdQ 7YCNc2/yOPyVbBigVb44QoPvJnamjoSn6DLl6NQxp6h7gbJ002B7AWdJEYHpPsKqSKvd kyMQ== 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=nbzdCRnUzVvHAlHdm0W/U/kL5Ps02KKsV67u0VtR3Rc=; b=F4Y2M03rjkDapRK8HJN2Ug0I00u94WznoGOKMDHcDV9CgpHADIbNuDXgiK3doGktxm aX3q3V5TOcz92xGsnsV9nyxD7zPCnSbOgTcmLV4J58mgAmxwG98OxfJEnBkNcOgTKjCI EnWgpQBrBInqjqFJrzFjGnl6v/L7kXoUhbjUugf1SvTGanvercRoBZZgFxHnMLl18klW ldQjqxGj/alJv/+/RlenTD7cScAlIEsvzWlX7kbEl7RNpEfNWA/rqMplb9yWKBlyxIyO WobjFdQKbYj5/S2e7srPSaBgba9VXOTkt5o+KIB5Ke+cahnaIMEhaz7pMM26i3pSjtqY lwvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ggDMgUJC; 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 v19si3948652ybj.479.2021.02.03.18.55.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:55:00 -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=ggDMgUJC; 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]:52898 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7UnM-0003A9-4b for patch@linaro.org; Wed, 03 Feb 2021 21:55:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46906) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Ts2-0008QX-Le for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:55:47 -0500 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]:34232) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Trr-0006gq-HH for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:55:43 -0500 Received: by mail-pg1-x534.google.com with SMTP id o7so1065897pgl.1 for ; Wed, 03 Feb 2021 17:55:33 -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=nbzdCRnUzVvHAlHdm0W/U/kL5Ps02KKsV67u0VtR3Rc=; b=ggDMgUJCODLaNK20KTZ1hBgRwL0Bo2KBembs38je25CjqPME7osnBWSquewY0Sitil BTniQOkI3vG98OVhlMyPNYv0yjX/EFr+JqxrKd3pAepgkbymMtfvXmR6FGT/kJ28Xthe q9htpFJ+NI/fJSWAamzRjrJNOszAoBZnsh4TPScxb1c9/rn1ECIyL2RgYEXk/vwqP+YC UORsrQYNPuy5SdSBn0glhNlIb8iNDBWFJ4tILkm425nCGKwr0gG7q7i9zWsAFV+1BdZO yYrjOVtaJzSy1xRgejF+ap7CLGsvKWe1cCW5tDmor1y9amplnMXlpQitNo62klLD3seA DINQ== 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=nbzdCRnUzVvHAlHdm0W/U/kL5Ps02KKsV67u0VtR3Rc=; b=EZ6GlL/DHNznnuNNCTtuxKCvHFFn4kxaamNLsnS3ndHcLuOVai8ijYQ1qNrcdXC8AW sidCs/1VCDAbqTPC9JgTt/H9Zk3rGNLEzuwAZamU6htaQZOVqK5nHguNnus6y867A1Rs a2OCZGdmypeo/TLQBTcci9V6XTamJ/EKn221MCcTfewdaldkTnduR/maoNridP404UIv uUIpWbl3R3XAvnjIdrQLLm1UIqOXE2w+WOpcqdsiQWfMDV+kFVrbzKDfRytZzXFajc2H UoTeWm8J5Mjc77is6WYDmY1cbAui2K2JrI9xILyg1mt0V5WgL4JzZ5js6arMcI8S+ne7 F42g== X-Gm-Message-State: AOAM532YkrVNx0Q9i6OAYr75BFxrWA5B77wCxmso8XYTyxJHq/zYu5aP PVkPz0ko4xOvca+ANmihVeWTqZS8JekE3QS+ X-Received: by 2002:a63:ab4f:: with SMTP id k15mr6134100pgp.280.1612403732956; Wed, 03 Feb 2021 17:55:32 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id j4sm3538230pfa.131.2021.02.03.17.55.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:55:32 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 82/93] tcg/tci: Split out tcg_out_op_r[iI] Date: Wed, 3 Feb 2021 15:55:29 -1000 Message-Id: <20210204015529.885398-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::534; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x534.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- tcg/tci/tcg-target.c.inc | 50 ++++++++++++++++++++++++++++------------ 1 file changed, 35 insertions(+), 15 deletions(-) -- 2.25.1 diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index e4a5872b2a..c2d2bd24d7 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -324,6 +324,31 @@ static void tcg_out_op_np(TCGContext *s, TCGOpcode op, old_code_ptr[1] = s->code_ptr - old_code_ptr; } +static void tcg_out_op_ri(TCGContext *s, TCGOpcode op, TCGReg r0, int32_t i1) +{ + uint8_t *old_code_ptr = s->code_ptr; + + tcg_out_op_t(s, op); + tcg_out_r(s, r0); + tcg_out32(s, i1); + + old_code_ptr[1] = s->code_ptr - old_code_ptr; +} + +#if TCG_TARGET_REG_BITS == 64 +static void tcg_out_op_rI(TCGContext *s, TCGOpcode op, + TCGReg r0, uint64_t i1) +{ + uint8_t *old_code_ptr = s->code_ptr; + + tcg_out_op_t(s, op); + tcg_out_r(s, r0); + tcg_out64(s, i1); + + old_code_ptr[1] = s->code_ptr - old_code_ptr; +} +#endif + static void tcg_out_op_rr(TCGContext *s, TCGOpcode op, TCGReg r0, TCGReg r1) { uint8_t *old_code_ptr = s->code_ptr; @@ -550,25 +575,20 @@ static bool tcg_out_mov(TCGContext *s, TCGType type, TCGReg ret, TCGReg arg) } static void tcg_out_movi(TCGContext *s, TCGType type, - TCGReg t0, tcg_target_long arg) + TCGReg ret, tcg_target_long arg) { - uint8_t *old_code_ptr = s->code_ptr; - uint32_t arg32 = arg; - if (type == TCG_TYPE_I32 || arg == arg32) { - tcg_out_op_t(s, INDEX_op_tci_movi_i32); - tcg_out_r(s, t0); - tcg_out32(s, arg32); - } else { - tcg_debug_assert(type == TCG_TYPE_I64); + switch (type) { + case TCG_TYPE_I32: + tcg_out_op_ri(s, INDEX_op_tci_movi_i32, ret, arg); + break; #if TCG_TARGET_REG_BITS == 64 - tcg_out_op_t(s, INDEX_op_tci_movi_i64); - tcg_out_r(s, t0); - tcg_out64(s, arg); -#else - TODO(); + case TCG_TYPE_I64: + tcg_out_op_rI(s, INDEX_op_tci_movi_i64, ret, arg); + break; #endif + default: + g_assert_not_reached(); } - old_code_ptr[1] = s->code_ptr - old_code_ptr; } static void tcg_out_call(TCGContext *s, const tcg_insn_unit *arg) From patchwork Thu Feb 4 01:55:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376228 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp869385jah; Wed, 3 Feb 2021 18:56:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJxl1YF1ntNbcM2RqLFHBqbTPQVNRusNGWi6M7VmbmWAcgf2kAOERjjROHzVvSK113al7tC/ X-Received: by 2002:a25:d24b:: with SMTP id j72mr8601879ybg.475.1612407368901; Wed, 03 Feb 2021 18:56:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612407368; cv=none; d=google.com; s=arc-20160816; b=zYDfQPLPWLfnLesbM4LwEP6vyQydRFz+nfaY+pHtO8MYiXEnl1kZJor1XptbjDBJLg PQhXX0t7xAs7hb9/2ag2wwxSYE/s4kp1Qy7D2w3qSB7ZHIHT7FxVO9Wh19H4lzyQmUTf TGzcvjSPkY/2Y7rJFxDhi1iom5euQZT6a6wK4U3XJhPsSHWjVjQhnZ+C8HoLbX6Ns+AW NCsam6tRm4Xu0+z7IlcejmbGP5U7wMPf66+xfEVtNiqo+2KQXuHhZmLnRSK+/gxoNcQN dBWdJeJrGESnnoxL9QVTxCtbX4VbILeLHBxoBsIBBxPpMRoknZYQ4YnOrWD1trS6nK/e hxWw== 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=j84CVB2/9NSVvHC05jyj/ExvjNOevKnlsYLw94URCgw=; b=fEqg/IwmV+JB6HZAASl01noAKwXhtglLhN7N+iXCUL9xxF2r1Nur41idrDbJbaxnP5 areaeFcULzyEJAuu0pCujNzbsItYv0yKN853cfCxDgvkPieKFSOXRDGhaqWs6PCNwEPz pEWb3pKzsMYM3ng5aTCzuL6e5ExdABvb0nubwS4xttLiz9T+12bgGcRrUfdR4P3SQdZU w3bU18GP3yDS3tNCVD5aIfFK6B5Hl6VLbb54saqjI1eIvF7mDaU/CinOTVk1Ltv/dhpT dIi5LGzyPjjHDOFWsWw14LcVEDQ778Ih3ODTyQ1X/M1cKoAw2eAiznjpM7c6PoswkmBm 0htQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZuUkcMSw; 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 189si3870838ybp.480.2021.02.03.18.56.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:56:08 -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=ZuUkcMSw; 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]:55076 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7UoS-0004Ab-DD for patch@linaro.org; Wed, 03 Feb 2021 21:56:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46934) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7TsA-0008Tw-KI for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:55:55 -0500 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]:38900) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Ts9-0006kr-2r for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:55:54 -0500 Received: by mail-pj1-x1031.google.com with SMTP id l18so836523pji.3 for ; Wed, 03 Feb 2021 17:55:52 -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=j84CVB2/9NSVvHC05jyj/ExvjNOevKnlsYLw94URCgw=; b=ZuUkcMSw6Kg/ha7AJdzh+FWdLdVkv2o9xXbKFKN0HE8XiQkild0h2Z0tiK+ng4Aar1 a4vxG/5pw0H4ZhQ+qqwq5CzYe5frfwzEc6ajirzRwRc/pYUexUauY1+gC3dfNSk2JRg/ obGic6BWE9i6VvYrzBi2U31coZGZ+EN85yOucLX0OAuSURKCRvf1AsxqDUE85PCJrOJN 4+AsXE2bx+mszqugC5IRKwnobORGkjY0G0QuEDp1FC7rEdRqpvJmWBATGHDSDbdJD6Mj XEjQoxzg0rl3oQ2BE2TnN30K6+enHp1td/Wf/4UdGTOk4zkxNsUPxzTnIAfrPO85fBjj sENg== 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=j84CVB2/9NSVvHC05jyj/ExvjNOevKnlsYLw94URCgw=; b=ELZcMMMMMEuj69lZDtUCh9hk118tFSK4LLCbiFxKtqu4CvVaQt7FdsfXu7IPaf2xCw 0aw3zZOLmVf12gjuL/L+Isw+KergMHoNDCkYSJzHxw1XaH+ZPYzlZqtizvzIkiYevJgx 1LP21UipQXXXUWNhMW3Ae1410aqWE43HAFPHmlV10oQIg952EQbjz3fX8w+FPxKdBvRN LogIxjJ/XYQMDL66NOrIWE1z5yN1mLL3qWPrhZv9y+WtuRlcYdOBmJ5e9mLMPWtJUUgz d0QqfHiu6b0ZHf4XXQfUIEDyRXt3Ls8qG29w4Y3zklNh09ps+oHFpTkDwtCHMvAE/q2q 4sxA== X-Gm-Message-State: AOAM5326nIw1nQLVXHUujvhujOHnBYwmncIVYxAs43PmxcgD57RcaYtR /vPWfv0YDH1UvmXgwtW/9St31m4ZjWQAm0Il X-Received: by 2002:a17:90a:4dc1:: with SMTP id r1mr5967650pjl.12.1612403751853; Wed, 03 Feb 2021 17:55:51 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id 78sm3588463pfx.127.2021.02.03.17.55.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:55:51 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 83/93] tcg/tci: Reserve r13 for a temporary Date: Wed, 3 Feb 2021 15:55:48 -1000 Message-Id: <20210204015548.885449-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1031; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1031.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We're about to adjust the offset range on host memory ops, and the format of branches. Both will require a temporary. Signed-off-by: Richard Henderson --- tcg/tci/tcg-target.h | 1 + tcg/tci/tcg-target.c.inc | 1 + 2 files changed, 2 insertions(+) -- 2.25.1 diff --git a/tcg/tci/tcg-target.h b/tcg/tci/tcg-target.h index 4df10e2e83..1558a6e44e 100644 --- a/tcg/tci/tcg-target.h +++ b/tcg/tci/tcg-target.h @@ -155,6 +155,7 @@ typedef enum { TCG_REG_R14, TCG_REG_R15, + TCG_REG_TMP = TCG_REG_R13, TCG_AREG0 = TCG_REG_R14, TCG_REG_CALL_STACK = TCG_REG_R15, } TCGReg; diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index c2d2bd24d7..b29e75425d 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -829,6 +829,7 @@ static void tcg_target_init(TCGContext *s) MAKE_64BIT_MASK(TCG_REG_R0, 64 / TCG_TARGET_REG_BITS); s->reserved_regs = 0; + tcg_regset_set_reg(s->reserved_regs, TCG_REG_TMP); tcg_regset_set_reg(s->reserved_regs, TCG_REG_CALL_STACK); /* The call arguments come first, followed by the temp storage. */ From patchwork Thu Feb 4 01:56:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376221 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp867586jah; Wed, 3 Feb 2021 18:52:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJxu41jObNrkkDwlWgOenbtEEoj0sPjziUiRUZ8aH4zyjXF+tKZhBPFqNbCThNIAulGTUpOb X-Received: by 2002:a25:d24b:: with SMTP id j72mr8584880ybg.475.1612407131041; Wed, 03 Feb 2021 18:52:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612407131; cv=none; d=google.com; s=arc-20160816; b=sqHCuK0rU8gQbaxcNr9Cpbt9vxWSGxD0mxyIZY/1sTK5rRLscFE9e2hhKk+NYzkOIC 0BL0qNmZO1gdUKtfzLNFFVGqB4NnwTvbzY+92c3CSZ43I1McoHjiHuQipLuNq1+DWnV+ XrSVG595HM5IYq08i6sEso5mlFYw6OeZHXN4fPSq7H+typxtyTwCJIaflo6iuMjGVhas y0MwdFecGsgB5+CCcw3AoVpN3kWaAAeB+N1fFHO69ilKAvfwnwPWKLGUKafwk2hhIqID /2pvTQEI8sh9f+xMqbmQ+386ByPPAYdiTxD1f38NVkOeYC3928GjE9xPKZbQpg0xYrNC 7t9w== 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=B9R5rR38+7XqiIyLeWWFMRDiEMmeppRUcow0M2UfyuA=; b=bPbTS3deAGeA2IcwfhxBi2DepDMTgfe42UVLcVfvxnBykJ8Xff30ol7a4e6PoOXlSk 5QwnZqAa5UcVH/E9+UNLkNYaPlXZnnAfi71flnLCah1EtjbACajeorzXlryEWdXZfeWM kn14kEiljWioOG81nSOPEhHdB/n6y9G8m7f6qQA7Afb8dIKg/3ut0GZSFM/7fLrHxmC3 oljNTuC4JtvZTF+DR2Wx8La1x8NK3WO1o7b/ha6jeJCHkSRl5EZVD90o0fZIXsI37tqe q9w6cwRKF20LHK+q7W/1CFa7sHTrayVw27WEYKbD0ohcawp6dTIhr3xUWrMJiRbR9pDV Lmvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DKE4Mw8y; 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 y67si4142336ybf.165.2021.02.03.18.52.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:52:11 -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=DKE4Mw8y; 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]:44150 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7Ukc-0007xF-F6 for patch@linaro.org; Wed, 03 Feb 2021 21:52:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47010) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7TsU-0000UX-H6 for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:56:14 -0500 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]:35093) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7TsR-0006rE-TD for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:56:14 -0500 Received: by mail-pf1-x434.google.com with SMTP id w14so1098799pfi.2 for ; Wed, 03 Feb 2021 17:56:11 -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=B9R5rR38+7XqiIyLeWWFMRDiEMmeppRUcow0M2UfyuA=; b=DKE4Mw8yMXsTj/dAkKPmuGw5wSrpXbp0kui9ioYWRLe0uP6eWNe9j4hv1m2C9H/tCG +3dMbch8lYBt3lg3z7YBZGRWTGxECvwkBH3rD/hEy2CqleviE+fPaWJUWhoQYUk0UBNH 6NC9qwLO7KWXtdB83TXQNNOKoU9hTiDGPxhn/m/zTbggxT3p0J6TjnLNUKywHDHqhDaf iym9MxMBcVsdFHNNdermf6iGxQjrvLFk4XK06dNA6scPTfQTMJdXHnnSdoGm9HHIqYQj BRjhYOss+LOC/QnHn4Esj/LUk2xqv7DZKm3MSB6A0iE832DZkMEnRIyDx70icplDFmkN 5V9g== 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=B9R5rR38+7XqiIyLeWWFMRDiEMmeppRUcow0M2UfyuA=; b=CUpMMaheBh8skSa6SBDJXRxUT3hCzF70AbdW8iO3FNWqY8tgr3j9KLZ/jzy5MVjhjs 6e6BWn8JDaSgAtBC16s97dkMnlwnCGaoZvN15ItYi0L68zdCdv4tzBV00jFqsL6XDuNM 9nr6/Ckz0JBRiHo2Z8ufg+wc3Bz+d+n8aWhVndo5bVh3OcP3WPsQSyrZoJnzzM+B4mwm M5aCqpKIyimGqxxxyR7IqT504oqw5TYaJzUjbo6g9lIA0p6DXxCF7bJiik7wHeNCNL/a gvRkUgfB+qKXIc2MpLhI9MToEmiHiU92KczQZ9XEgSWog/SoqwVVhMfVp69+Gf8oWhdL y5Tw== X-Gm-Message-State: AOAM532OsiFwr6XaqV0y4muR28vkzzrbWC2Lzmi6afDTQFDiTHftP5UE OiPSEEGvAcZZZ1AUaU4p3JAkS80eE4JBhFyM X-Received: by 2002:a62:3503:0:b029:1aa:6f15:b9fe with SMTP id c3-20020a6235030000b02901aa6f15b9femr5771737pfa.65.1612403770414; Wed, 03 Feb 2021 17:56:10 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id s1sm3218165pjg.17.2021.02.03.17.56.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:56:09 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 84/93] tcg/tci: Emit setcond before brcond Date: Wed, 3 Feb 2021 15:56:07 -1000 Message-Id: <20210204015607.885503-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The encoding planned for tci does not have enough room for brcond2, with 4 registers and a condition as input as well as the label. Resolve the condition into TCG_REG_TMP, and relax brcond to one register plus a label, considering the condition to always be reg != 0. Signed-off-by: Richard Henderson --- tcg/tci.c | 68 ++++++++++------------------------------ tcg/tci/tcg-target.c.inc | 52 +++++++++++------------------- 2 files changed, 35 insertions(+), 85 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index d27db9f720..e7268b13e1 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -141,6 +141,16 @@ static void tci_args_nl(const uint8_t **tb_ptr, uint8_t *n0, void **l1) check_size(start, tb_ptr); } +static void tci_args_rl(const uint8_t **tb_ptr, TCGReg *r0, void **l1) +{ + const uint8_t *start = *tb_ptr; + + *r0 = tci_read_r(tb_ptr); + *l1 = (void *)tci_read_label(tb_ptr); + + check_size(start, tb_ptr); +} + static void tci_args_rr(const uint8_t **tb_ptr, TCGReg *r0, TCGReg *r1) { @@ -212,19 +222,6 @@ static void tci_args_rrs(const uint8_t **tb_ptr, check_size(start, tb_ptr); } -static void tci_args_rrcl(const uint8_t **tb_ptr, - TCGReg *r0, TCGReg *r1, TCGCond *c2, void **l3) -{ - const uint8_t *start = *tb_ptr; - - *r0 = tci_read_r(tb_ptr); - *r1 = tci_read_r(tb_ptr); - *c2 = tci_read_b(tb_ptr); - *l3 = (void *)tci_read_label(tb_ptr); - - check_size(start, tb_ptr); -} - static void tci_args_rrrc(const uint8_t **tb_ptr, TCGReg *r0, TCGReg *r1, TCGReg *r2, TCGCond *c3) { @@ -293,21 +290,6 @@ static void tci_args_rrrr(const uint8_t **tb_ptr, check_size(start, tb_ptr); } -static void tci_args_rrrrcl(const uint8_t **tb_ptr, TCGReg *r0, TCGReg *r1, - TCGReg *r2, TCGReg *r3, TCGCond *c4, void **l5) -{ - const uint8_t *start = *tb_ptr; - - *r0 = tci_read_r(tb_ptr); - *r1 = tci_read_r(tb_ptr); - *r2 = tci_read_r(tb_ptr); - *r3 = tci_read_r(tb_ptr); - *c4 = tci_read_b(tb_ptr); - *l5 = (void *)tci_read_label(tb_ptr); - - check_size(start, tb_ptr); -} - static void tci_args_rrrrrc(const uint8_t **tb_ptr, TCGReg *r0, TCGReg *r1, TCGReg *r2, TCGReg *r3, TCGReg *r4, TCGCond *c5) { @@ -723,8 +705,8 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, break; #endif case INDEX_op_brcond_i32: - tci_args_rrcl(&tb_ptr, &r0, &r1, &condition, &ptr); - if (tci_compare32(regs[r0], regs[r1], condition)) { + tci_args_rl(&tb_ptr, &r0, &ptr); + if ((uint32_t)regs[r0]) { tb_ptr = ptr; } break; @@ -741,15 +723,6 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, T2 = tci_uint64(regs[r5], regs[r4]); tci_write_reg64(regs, r1, r0, T1 - T2); break; - case INDEX_op_brcond2_i32: - tci_args_rrrrcl(&tb_ptr, &r0, &r1, &r2, &r3, &condition, &ptr); - T1 = tci_uint64(regs[r1], regs[r0]); - T2 = tci_uint64(regs[r3], regs[r2]); - if (tci_compare64(T1, T2, condition)) { - tb_ptr = ptr; - continue; - } - break; case INDEX_op_mulu2_i32: tci_args_rrrr(&tb_ptr, &r0, &r1, &r2, &r3); tci_write_reg64(regs, r1, r0, (uint64_t)regs[r2] * regs[r3]); @@ -877,8 +850,8 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, break; #endif case INDEX_op_brcond_i64: - tci_args_rrcl(&tb_ptr, &r0, &r1, &condition, &ptr); - if (tci_compare64(regs[r0], regs[r1], condition)) { + tci_args_rl(&tb_ptr, &r0, &ptr); + if (regs[r0]) { tb_ptr = ptr; } break; @@ -1188,9 +1161,9 @@ int print_insn_tci(bfd_vma addr, disassemble_info *info) case INDEX_op_brcond_i32: case INDEX_op_brcond_i64: - tci_args_rrcl(&tb_ptr, &r0, &r1, &c, &ptr); - info->fprintf_func(info->stream, "%-12s %s,%s,%s,%p", - op_name, str_r(r0), str_r(r1), str_c(c), ptr); + tci_args_rl(&tb_ptr, &r0, &ptr); + info->fprintf_func(info->stream, "%-12s %s,0,ne,%p", + op_name, str_r(r0), ptr); break; case INDEX_op_setcond_i32: @@ -1315,13 +1288,6 @@ int print_insn_tci(bfd_vma addr, disassemble_info *info) str_r(r3), str_r(r4), str_c(c)); break; - case INDEX_op_brcond2_i32: - tci_args_rrrrcl(&tb_ptr, &r0, &r1, &r2, &r3, &c, &ptr); - info->fprintf_func(info->stream, "%-12s %s,%s,%s,%s,%s,%p", - op_name, str_r(r0), str_r(r1), - str_r(r2), str_r(r3), str_c(c), ptr); - break; - case INDEX_op_mulu2_i32: tci_args_rrrr(&tb_ptr, &r0, &r1, &r2, &r3); info->fprintf_func(info->stream, "%-12s %s,%s,%s,%s", diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index b29e75425d..e06d4e9380 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -349,6 +349,17 @@ static void tcg_out_op_rI(TCGContext *s, TCGOpcode op, } #endif +static void tcg_out_op_rl(TCGContext *s, TCGOpcode op, TCGReg r0, TCGLabel *l1) +{ + uint8_t *old_code_ptr = s->code_ptr; + + tcg_out_op_t(s, op); + tcg_out_r(s, r0); + tci_out_label(s, l1); + + old_code_ptr[1] = s->code_ptr - old_code_ptr; +} + static void tcg_out_op_rr(TCGContext *s, TCGOpcode op, TCGReg r0, TCGReg r1) { uint8_t *old_code_ptr = s->code_ptr; @@ -400,20 +411,6 @@ static void tcg_out_op_rrs(TCGContext *s, TCGOpcode op, old_code_ptr[1] = s->code_ptr - old_code_ptr; } -static void tcg_out_op_rrcl(TCGContext *s, TCGOpcode op, - TCGReg r0, TCGReg r1, TCGCond c2, TCGLabel *l3) -{ - uint8_t *old_code_ptr = s->code_ptr; - - tcg_out_op_t(s, op); - tcg_out_r(s, r0); - tcg_out_r(s, r1); - tcg_out8(s, c2); - tci_out_label(s, l3); - - old_code_ptr[1] = s->code_ptr - old_code_ptr; -} - static void tcg_out_op_rrrc(TCGContext *s, TCGOpcode op, TCGReg r0, TCGReg r1, TCGReg r2, TCGCond c3) { @@ -487,23 +484,6 @@ static void tcg_out_op_rrrr(TCGContext *s, TCGOpcode op, old_code_ptr[1] = s->code_ptr - old_code_ptr; } -static void tcg_out_op_rrrrcl(TCGContext *s, TCGOpcode op, - TCGReg r0, TCGReg r1, TCGReg r2, TCGReg r3, - TCGCond c4, TCGLabel *l5) -{ - uint8_t *old_code_ptr = s->code_ptr; - - tcg_out_op_t(s, op); - tcg_out_r(s, r0); - tcg_out_r(s, r1); - tcg_out_r(s, r2); - tcg_out_r(s, r3); - tcg_out8(s, c4); - tci_out_label(s, l5); - - old_code_ptr[1] = s->code_ptr - old_code_ptr; -} - static void tcg_out_op_rrrrrc(TCGContext *s, TCGOpcode op, TCGReg r0, TCGReg r1, TCGReg r2, TCGReg r3, TCGReg r4, TCGCond c5) @@ -704,7 +684,10 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, break; CASE_32_64(brcond) - tcg_out_op_rrcl(s, opc, args[0], args[1], args[2], arg_label(args[3])); + tcg_out_op_rrrc(s, (opc == INDEX_op_brcond_i32 + ? INDEX_op_setcond_i32 : INDEX_op_setcond_i64), + TCG_REG_TMP, args[0], args[1], args[2]); + tcg_out_op_rl(s, opc, TCG_REG_TMP, arg_label(args[3])); break; CASE_32_64(neg) /* Optional (TCG_TARGET_HAS_neg_*). */ @@ -730,8 +713,9 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, args[3], args[4], args[5]); break; case INDEX_op_brcond2_i32: - tcg_out_op_rrrrcl(s, opc, args[0], args[1], args[2], - args[3], args[4], arg_label(args[5])); + tcg_out_op_rrrrrc(s, INDEX_op_setcond2_i32, TCG_REG_TMP, + args[0], args[1], args[2], args[3], args[4]); + tcg_out_op_rl(s, INDEX_op_brcond_i32, TCG_REG_TMP, arg_label(args[5])); break; case INDEX_op_mulu2_i32: tcg_out_op_rrrr(s, opc, args[0], args[1], args[2], args[3]); From patchwork Thu Feb 4 01:56:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376229 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp869397jah; Wed, 3 Feb 2021 18:56:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJzmR4pozm4upWlhLWhZ+0jPy0eC6pcK4xuuNrS2ZRePw+jXx+IvDAKMhab7FsBEP/nnrWrd X-Received: by 2002:a5b:745:: with SMTP id s5mr8987824ybq.265.1612407370278; Wed, 03 Feb 2021 18:56:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612407370; cv=none; d=google.com; s=arc-20160816; b=KQkLHXPRlfVcU4GmDEuk4GuQWShQ8kzHi2oX4B8mgGQ9rsUPKzZEoXjILS8A/lCbGS aDY1v9LFQT7F5iiL43M7Rl1yAg9Q7lRQwdy7SQGMlJscsq6Tcw7p2TSWznjcaBOUIISV wy2+ibofXbAyTrTJr9ZoWkuyk73kIWPIjMh08C041rIQ2ifwQCphXqdoikjpINpAo32z 8OXU7Q2PYTPGQzRmu6Q19PgDwrxOA5MQktdiLfALKKgnX9SNekbk5cVQg2ntedqxu09N xTz7JNqr9vcrkWHB2Rqgr5u6KBh9UFCaDPlCijXNF6wadDNg6wsa88+7k6JWVpKWBTgs YnAg== 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=5KjNyz2z06X1nzffKUJIUfEvh2+8GuNK8mnSHukJjZc=; b=TruuNr96bF3+V7zQWLM58B+oKjg5gAoszXCP3L6e76rT/nEsNeWpIJ3Rl3346UxkkZ 8NddUQOTf4dy4lX5kjoEkQSReOQXW/DIqxbt1g1knfipoKK1RUfr83/xiC2qIX1RIYHR DDe+JrfcTdIDTYCOzYtiE4rsrUmNFX5iB48nPxgvXS2trY7BCR/sPjEBknescuFzIePf 5Y+dkKe4aB4DMfV+Cx+oTDb5z/dPwORraHi1xSmfhGE19EWbGWnZLEJoJCEBgoPPjXrc goKOHS8pPjZkyZBOGbjekMprjGd4WaKHC62VdHzMtDN9ui6PqGITkvL+FJ8qfn5R5/H2 ffMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=y98clrTj; 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 i16si4165957ybq.31.2021.02.03.18.56.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:56:10 -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=y98clrTj; 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]:55210 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7UoT-0004Ep-L5 for patch@linaro.org; Wed, 03 Feb 2021 21:56:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47044) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Tsm-0000oQ-Oi for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:56:34 -0500 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]:36078) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Tsk-0006wR-6u for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:56:32 -0500 Received: by mail-pl1-x62d.google.com with SMTP id e9so909162plh.3 for ; Wed, 03 Feb 2021 17:56:29 -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=5KjNyz2z06X1nzffKUJIUfEvh2+8GuNK8mnSHukJjZc=; b=y98clrTjWIslQr7/0N1ZO/1eufhFRNXArBMNDrLF3Dvpv3FwkLYxxJ8qNZ2eMJ7PcS 8Rz5a93IuM8lRMEPPCWrg8f+QHcPDfavmyLcj6EUxvx/sW2H0iLvWDR3Mpc3h/oaysjk mnvLqOh5CGSfrIr13WD5hAL44ooylfq8ZXuhH00yd/8xDlTrmKoKhNdQtKshFs5tcpTB smem7YenO9FjFc7xQ1M5fac9KYjTziXY7zzESgU5R14Q/2Xox1RykGpZekn7SDPuhHkF SYmuYIXHx5I01NeVKL/78JKeo5FdGYXec8Apb4BOSNO2HzN4+pNzVnB4CvPm/PUzSA7k Xcfg== 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=5KjNyz2z06X1nzffKUJIUfEvh2+8GuNK8mnSHukJjZc=; b=eeV1FujTDTBSTnqFxcYp3HRV+ElAI3GYJGKI9+oIpcgbyEqd6gJEiOfKwEjsZFNxRR gK2GAx5rQEmJqH63qygAPmOtzko9Y/OfIzRXhEBuBg7pGButfQ38INxLTHdbScihHweJ BgFvYswRWT60ZJXXEEHym65zfJxtWeA49pJAIElKrqi7NVPqhfGlqN8abfuoSQuAboqj vov4NazwJeD7vR0AXZuStWPzEnaEAUDTxqccPcUdHm8OX/oV87rIG0+DixkyM3PdZM3k l+cTomCjcYB2+wVmnXP/514BLjTSMmYWuPimYEzFcetY99PybQgOS6PJNBPJPulmlLb1 ZajA== X-Gm-Message-State: AOAM530tYpm9c6QI1uG1OST/9DzTojB0xAY2IiK0ZwYsWGiwvpQJiW6M iottn9thZfi56urbIJBCI2L0wu6tZ+HfMH6P X-Received: by 2002:a17:90a:bb82:: with SMTP id v2mr5947807pjr.178.1612403788981; Wed, 03 Feb 2021 17:56:28 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id a18sm1432841pfr.220.2021.02.03.17.56.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:56:28 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 85/93] tcg/tci: Remove tci_write_reg Date: Wed, 3 Feb 2021 15:56:26 -1000 Message-Id: <20210204015626.885554-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62d.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Inline it into its one caller, tci_write_reg64. Drop the asserts that are redundant with tcg_read_r. Signed-off-by: Richard Henderson --- tcg/tci.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index e7268b13e1..4f81cbb904 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -36,20 +36,11 @@ __thread uintptr_t tci_tb_ptr; -static void -tci_write_reg(tcg_target_ulong *regs, TCGReg index, tcg_target_ulong value) -{ - tci_assert(index < TCG_TARGET_NB_REGS); - tci_assert(index != TCG_AREG0); - tci_assert(index != TCG_REG_CALL_STACK); - regs[index] = value; -} - static void tci_write_reg64(tcg_target_ulong *regs, uint32_t high_index, uint32_t low_index, uint64_t value) { - tci_write_reg(regs, low_index, value); - tci_write_reg(regs, high_index, value >> 32); + regs[low_index] = value; + regs[high_index] = value >> 32; } /* Create a 64 bit value from two 32 bit values. */ From patchwork Thu Feb 4 01:56:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376232 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp870423jah; Wed, 3 Feb 2021 18:58:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJw6n70edYlpNyRWfJ1690jz56DuuD8KjNrrcmnZ5Ly47YsCdsaqvkF6kz9xQR6zzUDXwZ0+ X-Received: by 2002:a25:c04d:: with SMTP id c74mr8276537ybf.102.1612407515572; Wed, 03 Feb 2021 18:58:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612407515; cv=none; d=google.com; s=arc-20160816; b=lxP/e0v3rIPDmXwMBioPY39oguCxXwJ9na4+eckU8WYTPfwm7AJcdQ92o8bMexGDD6 j1HUFqz/11DraScH0VagOnxHO59BDKWdqq59NV9QqbYE52lQRnLeFDhz2ueJM/2tdZw5 perGJS3+MsOuQWeeqxASP8PgmiVnclEDpqUJKsCJIHMRBn9AxHjpla35xb71cISoh3T9 SOgCUVu//suI0IhknpZoHEXXzJay1oR1LGOkTBU3HIwjHqc7eF0PVuP+EUMeEngnWida VGGCYCQd16t01heDOF4PRgvdnEWm8qk1iPyQmsCV56ZKVZSMczzVdQrhLReH2kfvkCeD qGng== 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=kzUnbpFd4N7AqVaseztP0v4eZMlcZVSSr/zLlepL4IA=; b=T0ZbTEQeiFq2ecpHtQn6hssjsgsUn6f0zu48tvyYYOH1j3xK+us5DCJv0wKdY7YVyk 4VAWeHTpdKhQoBM+fW/cmYNDyIYKeOofh++1BSJQ+iFn2SyEzhYwsBohe4vJK9AgNrzr JqcBvT2A/goyvNjuiYA/8Pqxz1hC3+S7y6N4gcMg/mh6Hs/5wVMq0LpSUkiIRd5isuB/ 5rX4XfB2efPnpa20MZ6Xd6uTcwuxK+vq2COyIqKLKpxtaIuZn0xoDVpUiC00aByFvXsQ ZjhYFYQ742UatBhpxwr1a0zWi9kKkxekqZKjFMRtNKZ4yGKHHBIYiO+ZjXSg6EvJg3lW 9coQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="lmL2/T42"; 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 n18si3627896ybp.144.2021.02.03.18.58.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:58:35 -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="lmL2/T42"; 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]:36132 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7Uqo-00081m-Tx for patch@linaro.org; Wed, 03 Feb 2021 21:58:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47136) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Tt9-0001Cy-5t for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:56:55 -0500 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]:42524) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Tt4-00076R-J6 for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:56:54 -0500 Received: by mail-pl1-x633.google.com with SMTP id s15so890952plr.9 for ; Wed, 03 Feb 2021 17:56:49 -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=kzUnbpFd4N7AqVaseztP0v4eZMlcZVSSr/zLlepL4IA=; b=lmL2/T428QnpkEah5HXAYc+5a0JwCcKvT17Hdj3FIsN641G0YU3XXvYPNguIMV2x6j QnQlzywxJWfhTncjDeebU9Ai6Q+f2edW7ITATUl8tS7YG9lQSo1OaDKmy+kaRc4JgDgN ysxbC6xLcqBprCgSJCYvWhfZp924koSboP47KSjW41MzpehirMFaAaH4yQWyjiOykkYV yDLmYfX/EFJBMU4uon3r0NGpDckcxpAp3YPQFl0nUo8fXFu9ZXzHSk8LGa2QYcG9vA9s Hx2WcwKqowocGGWJtIBiOFW3juTFPhB4lkpPVj2D6i/5ghaOB6eEhbR2HJxp1+3HiFr3 Gn4A== 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=kzUnbpFd4N7AqVaseztP0v4eZMlcZVSSr/zLlepL4IA=; b=pPsvbUS1tAiEXjGLK7Ftwn6Iia2SDxFhBKIPBLK6iMJT9TrYTdloGpYfFVwKrDIEJx 245vap+IhLBOrVzNV2mPC+qXIixP4p1LKVnDfhGc3/sQGnTzAAEgR4Cw6Ldw/CWFslzL 3Tm/T7e1NJGyJP65OWJvFD4rRu6+5x0PtNj42LIBuhP7BX74+20ko+9y+sL742MwM8br nFLPbnQt6bIMNnKIvyaAmXPISYjyYogWENzl/z/xYEELlOUkiAKpYkVBCwEm4FfD+dQG N13VZ4Gojp+MUStFGKjoFDQEOQhBOTOOlQzfluu8ttq0jZXzqixJ1rs/CW8UY4x456Rh H2EQ== X-Gm-Message-State: AOAM531NMttsbxR9gX2TrcmwHKkP1q+081lob+YN7o5W1fgy5RoIoEMQ Yrls+uJhPrOkoLNXlOkK3/PXhM/aa/unoBCG X-Received: by 2002:a17:90a:de2:: with SMTP id 89mr5735238pjv.26.1612403807757; Wed, 03 Feb 2021 17:56:47 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id l13sm3222390pjq.30.2021.02.03.17.56.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:56:47 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 86/93] tcg/tci: Change encoding to uint32_t units Date: Wed, 3 Feb 2021 15:56:44 -1000 Message-Id: <20210204015644.885606-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::633; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x633.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This removes all of the problems with unaligned accesses to the bytecode stream. With an 8-bit opcode at the bottom, we have 24 bits remaining, which are generally split into 6 4-bit slots. This fits well with the maximum length opcodes, e.g. INDEX_op_add2_i386, which have 6 register operands. We have, in previous patches, rearranged things such that there are no operations with a label, which have more than one other operand. Which leaves us with a 20-bit field in which to encode a label, giving us a maximum TB size of 512k -- easily large. Change the INDEX_op_tci_movi_{i32,i64} opcodes to tci_mov[il]. The former puts the immediate in the upper 20 bits of the insn, like we do for the label displacement. The later uses a label to reference an entry in the constant pool. Thus, in the worst case we still have a single memory reference for any constant, but now the constants are out-of-line of the bytecode and can be shared between different moves saving space. Change INDEX_op_call to use a label to reference a pair of pointers in the constant pool. This removes the only slightly dodgy link with the layout of struct TCGHelperInfo. The re-encode cannot be done in pieces. Signed-off-by: Richard Henderson --- include/tcg/tcg-opc.h | 4 +- tcg/tci/tcg-target.h | 3 +- tcg/tci.c | 534 +++++++++++++++------------------------ tcg/tci/tcg-target.c.inc | 386 +++++++++++++--------------- tcg/tci/README | 20 +- 5 files changed, 380 insertions(+), 567 deletions(-) -- 2.25.1 diff --git a/include/tcg/tcg-opc.h b/include/tcg/tcg-opc.h index bbb0884af8..5bbec858aa 100644 --- a/include/tcg/tcg-opc.h +++ b/include/tcg/tcg-opc.h @@ -277,8 +277,8 @@ DEF(last_generic, 0, 0, 0, TCG_OPF_NOT_PRESENT) #ifdef TCG_TARGET_INTERPRETER /* These opcodes are only for use between the tci generator and interpreter. */ -DEF(tci_movi_i32, 1, 0, 1, TCG_OPF_NOT_PRESENT) -DEF(tci_movi_i64, 1, 0, 1, TCG_OPF_64BIT | TCG_OPF_NOT_PRESENT) +DEF(tci_movi, 1, 0, 1, TCG_OPF_NOT_PRESENT) +DEF(tci_movl, 1, 0, 1, TCG_OPF_NOT_PRESENT) #endif #undef TLADDR_ARGS diff --git a/tcg/tci/tcg-target.h b/tcg/tci/tcg-target.h index 1558a6e44e..d953f2ead3 100644 --- a/tcg/tci/tcg-target.h +++ b/tcg/tci/tcg-target.h @@ -41,7 +41,7 @@ #define TCG_TARGET_H #define TCG_TARGET_INTERPRETER 1 -#define TCG_TARGET_INSN_UNIT_SIZE 1 +#define TCG_TARGET_INSN_UNIT_SIZE 4 #define TCG_TARGET_TLB_DISPLACEMENT_BITS 32 #if UINTPTR_MAX == UINT32_MAX @@ -165,6 +165,7 @@ typedef enum { #define TCG_TARGET_STACK_ALIGN 8 #define HAVE_TCG_QEMU_TB_EXEC +#define TCG_TARGET_NEED_POOL_LABELS /* We could notice __i386__ or __s390x__ and reduce the barriers depending on the host. But if you want performance, you use the normal backend. diff --git a/tcg/tci.c b/tcg/tci.c index 4f81cbb904..c4f0a7e82d 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -49,49 +49,6 @@ static uint64_t tci_uint64(uint32_t high, uint32_t low) return ((uint64_t)high << 32) + low; } -/* Read constant byte from bytecode. */ -static uint8_t tci_read_b(const uint8_t **tb_ptr) -{ - return *(tb_ptr[0]++); -} - -/* Read register number from bytecode. */ -static TCGReg tci_read_r(const uint8_t **tb_ptr) -{ - uint8_t regno = tci_read_b(tb_ptr); - tci_assert(regno < TCG_TARGET_NB_REGS); - return regno; -} - -/* Read constant (native size) from bytecode. */ -static tcg_target_ulong tci_read_i(const uint8_t **tb_ptr) -{ - tcg_target_ulong value = *(const tcg_target_ulong *)(*tb_ptr); - *tb_ptr += sizeof(value); - return value; -} - -/* Read unsigned constant (32 bit) from bytecode. */ -static uint32_t tci_read_i32(const uint8_t **tb_ptr) -{ - uint32_t value = *(const uint32_t *)(*tb_ptr); - *tb_ptr += sizeof(value); - return value; -} - -/* Read signed constant (32 bit) from bytecode. */ -static int32_t tci_read_s32(const uint8_t **tb_ptr) -{ - int32_t value = *(const int32_t *)(*tb_ptr); - *tb_ptr += sizeof(value); - return value; -} - -static tcg_target_ulong tci_read_label(const uint8_t **tb_ptr) -{ - return tci_read_i(tb_ptr); -} - /* * Load sets of arguments all at once. The naming convention is: * tci_args_ @@ -106,209 +63,128 @@ static tcg_target_ulong tci_read_label(const uint8_t **tb_ptr) * s = signed ldst offset */ -static void check_size(const uint8_t *start, const uint8_t **tb_ptr) +static void tci_args_l(uint32_t insn, const void *tb_ptr, void **l0) { - const uint8_t *old_code_ptr = start - 2; - uint8_t op_size = old_code_ptr[1]; - tci_assert(*tb_ptr == old_code_ptr + op_size); + int diff = sextract32(insn, 12, 20); + *l0 = diff ? (void *)tb_ptr + diff : NULL; } -static void tci_args_l(const uint8_t **tb_ptr, void **l0) +static void tci_args_nl(uint32_t insn, const void *tb_ptr, + uint8_t *n0, void **l1) { - const uint8_t *start = *tb_ptr; - - *l0 = (void *)tci_read_label(tb_ptr); - - check_size(start, tb_ptr); + *n0 = extract32(insn, 8, 4); + *l1 = sextract32(insn, 12, 20) + (void *)tb_ptr; } -static void tci_args_nl(const uint8_t **tb_ptr, uint8_t *n0, void **l1) +static void tci_args_rl(uint32_t insn, const void *tb_ptr, + TCGReg *r0, void **l1) { - const uint8_t *start = *tb_ptr; - - *n0 = tci_read_b(tb_ptr); - *l1 = (void *)tci_read_label(tb_ptr); - - check_size(start, tb_ptr); + *r0 = extract32(insn, 8, 4); + *l1 = sextract32(insn, 12, 20) + (void *)tb_ptr; } -static void tci_args_rl(const uint8_t **tb_ptr, TCGReg *r0, void **l1) +static void tci_args_rr(uint32_t insn, TCGReg *r0, TCGReg *r1) { - const uint8_t *start = *tb_ptr; - - *r0 = tci_read_r(tb_ptr); - *l1 = (void *)tci_read_label(tb_ptr); - - check_size(start, tb_ptr); + *r0 = extract32(insn, 8, 4); + *r1 = extract32(insn, 12, 4); } -static void tci_args_rr(const uint8_t **tb_ptr, - TCGReg *r0, TCGReg *r1) +static void tci_args_ri(uint32_t insn, TCGReg *r0, tcg_target_ulong *i1) { - const uint8_t *start = *tb_ptr; - - *r0 = tci_read_r(tb_ptr); - *r1 = tci_read_r(tb_ptr); - - check_size(start, tb_ptr); + *r0 = extract32(insn, 8, 4); + *i1 = sextract32(insn, 12, 20); } -static void tci_args_ri(const uint8_t **tb_ptr, - TCGReg *r0, tcg_target_ulong *i1) +static void tci_args_rrm(uint32_t insn, TCGReg *r0, + TCGReg *r1, TCGMemOpIdx *m2) { - const uint8_t *start = *tb_ptr; - - *r0 = tci_read_r(tb_ptr); - *i1 = tci_read_i32(tb_ptr); - - check_size(start, tb_ptr); + *r0 = extract32(insn, 8, 4); + *r1 = extract32(insn, 12, 4); + *m2 = extract32(insn, 20, 12); } -#if TCG_TARGET_REG_BITS == 64 -static void tci_args_rI(const uint8_t **tb_ptr, - TCGReg *r0, tcg_target_ulong *i1) +static void tci_args_rrr(uint32_t insn, TCGReg *r0, TCGReg *r1, TCGReg *r2) { - const uint8_t *start = *tb_ptr; - - *r0 = tci_read_r(tb_ptr); - *i1 = tci_read_i(tb_ptr); - - check_size(start, tb_ptr); -} -#endif - -static void tci_args_rrm(const uint8_t **tb_ptr, - TCGReg *r0, TCGReg *r1, TCGMemOpIdx *m2) -{ - const uint8_t *start = *tb_ptr; - - *r0 = tci_read_r(tb_ptr); - *r1 = tci_read_r(tb_ptr); - *m2 = tci_read_i32(tb_ptr); - - check_size(start, tb_ptr); + *r0 = extract32(insn, 8, 4); + *r1 = extract32(insn, 12, 4); + *r2 = extract32(insn, 16, 4); } -static void tci_args_rrr(const uint8_t **tb_ptr, - TCGReg *r0, TCGReg *r1, TCGReg *r2) +static void tci_args_rrs(uint32_t insn, TCGReg *r0, TCGReg *r1, int32_t *i2) { - const uint8_t *start = *tb_ptr; - - *r0 = tci_read_r(tb_ptr); - *r1 = tci_read_r(tb_ptr); - *r2 = tci_read_r(tb_ptr); - - check_size(start, tb_ptr); + *r0 = extract32(insn, 8, 4); + *r1 = extract32(insn, 12, 4); + *i2 = sextract32(insn, 16, 16); } -static void tci_args_rrs(const uint8_t **tb_ptr, - TCGReg *r0, TCGReg *r1, int32_t *i2) -{ - const uint8_t *start = *tb_ptr; - - *r0 = tci_read_r(tb_ptr); - *r1 = tci_read_r(tb_ptr); - *i2 = tci_read_s32(tb_ptr); - - check_size(start, tb_ptr); -} - -static void tci_args_rrrc(const uint8_t **tb_ptr, +static void tci_args_rrrc(uint32_t insn, TCGReg *r0, TCGReg *r1, TCGReg *r2, TCGCond *c3) { - const uint8_t *start = *tb_ptr; - - *r0 = tci_read_r(tb_ptr); - *r1 = tci_read_r(tb_ptr); - *r2 = tci_read_r(tb_ptr); - *c3 = tci_read_b(tb_ptr); - - check_size(start, tb_ptr); + *r0 = extract32(insn, 8, 4); + *r1 = extract32(insn, 12, 4); + *r2 = extract32(insn, 16, 4); + *c3 = extract32(insn, 20, 4); } -static void tci_args_rrrm(const uint8_t **tb_ptr, +static void tci_args_rrrm(uint32_t insn, TCGReg *r0, TCGReg *r1, TCGReg *r2, TCGMemOpIdx *m3) { - const uint8_t *start = *tb_ptr; - - *r0 = tci_read_r(tb_ptr); - *r1 = tci_read_r(tb_ptr); - *r2 = tci_read_r(tb_ptr); - *m3 = tci_read_i32(tb_ptr); - - check_size(start, tb_ptr); + *r0 = extract32(insn, 8, 4); + *r1 = extract32(insn, 12, 4); + *r2 = extract32(insn, 16, 4); + *m3 = extract32(insn, 20, 12); } -static void tci_args_rrrbb(const uint8_t **tb_ptr, TCGReg *r0, TCGReg *r1, +static void tci_args_rrrbb(uint32_t insn, TCGReg *r0, TCGReg *r1, TCGReg *r2, uint8_t *i3, uint8_t *i4) { - const uint8_t *start = *tb_ptr; - - *r0 = tci_read_r(tb_ptr); - *r1 = tci_read_r(tb_ptr); - *r2 = tci_read_r(tb_ptr); - *i3 = tci_read_b(tb_ptr); - *i4 = tci_read_b(tb_ptr); - - check_size(start, tb_ptr); + *r0 = extract32(insn, 8, 4); + *r1 = extract32(insn, 12, 4); + *r2 = extract32(insn, 16, 4); + *i3 = extract32(insn, 20, 6); + *i4 = extract32(insn, 26, 6); } -static void tci_args_rrrrm(const uint8_t **tb_ptr, TCGReg *r0, TCGReg *r1, - TCGReg *r2, TCGReg *r3, TCGMemOpIdx *m4) +static void tci_args_rrrrr(uint32_t insn, TCGReg *r0, TCGReg *r1, + TCGReg *r2, TCGReg *r3, TCGReg *r4) { - const uint8_t *start = *tb_ptr; - - *r0 = tci_read_r(tb_ptr); - *r1 = tci_read_r(tb_ptr); - *r2 = tci_read_r(tb_ptr); - *r3 = tci_read_r(tb_ptr); - *m4 = tci_read_i32(tb_ptr); - - check_size(start, tb_ptr); + *r0 = extract32(insn, 8, 4); + *r1 = extract32(insn, 12, 4); + *r2 = extract32(insn, 16, 4); + *r3 = extract32(insn, 20, 4); + *r4 = extract32(insn, 24, 4); } #if TCG_TARGET_REG_BITS == 32 -static void tci_args_rrrr(const uint8_t **tb_ptr, +static void tci_args_rrrr(uint32_t insn, TCGReg *r0, TCGReg *r1, TCGReg *r2, TCGReg *r3) { - const uint8_t *start = *tb_ptr; - - *r0 = tci_read_r(tb_ptr); - *r1 = tci_read_r(tb_ptr); - *r2 = tci_read_r(tb_ptr); - *r3 = tci_read_r(tb_ptr); - - check_size(start, tb_ptr); + *r0 = extract32(insn, 8, 4); + *r1 = extract32(insn, 12, 4); + *r2 = extract32(insn, 16, 4); + *r3 = extract32(insn, 20, 4); } -static void tci_args_rrrrrc(const uint8_t **tb_ptr, TCGReg *r0, TCGReg *r1, +static void tci_args_rrrrrc(uint32_t insn, TCGReg *r0, TCGReg *r1, TCGReg *r2, TCGReg *r3, TCGReg *r4, TCGCond *c5) { - const uint8_t *start = *tb_ptr; - - *r0 = tci_read_r(tb_ptr); - *r1 = tci_read_r(tb_ptr); - *r2 = tci_read_r(tb_ptr); - *r3 = tci_read_r(tb_ptr); - *r4 = tci_read_r(tb_ptr); - *c5 = tci_read_b(tb_ptr); - - check_size(start, tb_ptr); + *r0 = extract32(insn, 8, 4); + *r1 = extract32(insn, 12, 4); + *r2 = extract32(insn, 16, 4); + *r3 = extract32(insn, 20, 4); + *r4 = extract32(insn, 24, 4); + *c5 = extract32(insn, 28, 4); } -static void tci_args_rrrrrr(const uint8_t **tb_ptr, TCGReg *r0, TCGReg *r1, +static void tci_args_rrrrrr(uint32_t insn, TCGReg *r0, TCGReg *r1, TCGReg *r2, TCGReg *r3, TCGReg *r4, TCGReg *r5) { - const uint8_t *start = *tb_ptr; - - *r0 = tci_read_r(tb_ptr); - *r1 = tci_read_r(tb_ptr); - *r2 = tci_read_r(tb_ptr); - *r3 = tci_read_r(tb_ptr); - *r4 = tci_read_r(tb_ptr); - *r5 = tci_read_r(tb_ptr); - - check_size(start, tb_ptr); + *r0 = extract32(insn, 8, 4); + *r1 = extract32(insn, 12, 4); + *r2 = extract32(insn, 16, 4); + *r3 = extract32(insn, 20, 4); + *r4 = extract32(insn, 24, 4); + *r5 = extract32(insn, 28, 4); } #endif @@ -464,7 +340,7 @@ static bool tci_compare64(uint64_t u0, uint64_t u1, TCGCond condition) uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, const void *v_tb_ptr) { - const uint8_t *tb_ptr = v_tb_ptr; + const uint32_t *tb_ptr = v_tb_ptr; tcg_target_ulong regs[TCG_TARGET_NB_REGS]; uint64_t stack[(TCG_STATIC_CALL_ARGS_SIZE + TCG_STATIC_FRAME_SIZE) / sizeof(uint64_t)]; @@ -476,8 +352,9 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, tci_assert(tb_ptr); for (;;) { - TCGOpcode opc = tb_ptr[0]; - TCGReg r0, r1, r2, r3; + uint32_t insn; + TCGOpcode opc; + TCGReg r0, r1, r2, r3, r4; tcg_target_ulong t1; TCGCond condition; target_ulong taddr; @@ -485,23 +362,19 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, uint32_t tmp32; uint64_t tmp64; #if TCG_TARGET_REG_BITS == 32 - TCGReg r4, r5; + TCGReg r5; uint64_t T1, T2; #endif TCGMemOpIdx oi; int32_t ofs; void *ptr; - /* Skip opcode and size entry. */ - tb_ptr += 2; + insn = *tb_ptr++; + opc = extract32(insn, 0, 8); switch (opc) { case INDEX_op_call: - /* - * We are passed a pointer to the TCGHelperInfo, which contains - * the function pointer followed by the ffi_cif pointer. - */ - tci_args_nl(&tb_ptr, &len, &ptr); + tci_args_nl(insn, tb_ptr, &len, &ptr); /* Helper functions may need to access the "return address" */ tci_tb_ptr = (uintptr_t)tb_ptr; @@ -519,8 +392,9 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, } /* - * Call the helper function. Any result winds up - * "left-aligned" in the stack[0] slot. + * We are passed a pointer into the constant pool, which + * contains a pair of the function pointer and the cif pointer. + * Any result winds up "left-aligned" in the stack[0] slot. */ { void **pptr = ptr; @@ -545,76 +419,80 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, break; case INDEX_op_br: - tci_args_l(&tb_ptr, &ptr); + tci_args_l(insn, tb_ptr, &ptr); tb_ptr = ptr; continue; case INDEX_op_setcond_i32: - tci_args_rrrc(&tb_ptr, &r0, &r1, &r2, &condition); + tci_args_rrrc(insn, &r0, &r1, &r2, &condition); regs[r0] = tci_compare32(regs[r1], regs[r2], condition); break; #if TCG_TARGET_REG_BITS == 32 case INDEX_op_setcond2_i32: - tci_args_rrrrrc(&tb_ptr, &r0, &r1, &r2, &r3, &r4, &condition); + tci_args_rrrrrc(insn, &r0, &r1, &r2, &r3, &r4, &condition); T1 = tci_uint64(regs[r2], regs[r1]); T2 = tci_uint64(regs[r4], regs[r3]); regs[r0] = tci_compare64(T1, T2, condition); break; #elif TCG_TARGET_REG_BITS == 64 case INDEX_op_setcond_i64: - tci_args_rrrc(&tb_ptr, &r0, &r1, &r2, &condition); + tci_args_rrrc(insn, &r0, &r1, &r2, &condition); regs[r0] = tci_compare64(regs[r1], regs[r2], condition); break; #endif CASE_32_64(mov) - tci_args_rr(&tb_ptr, &r0, &r1); + tci_args_rr(insn, &r0, &r1); regs[r0] = regs[r1]; break; - case INDEX_op_tci_movi_i32: - tci_args_ri(&tb_ptr, &r0, &t1); + case INDEX_op_tci_movi: + tci_args_ri(insn, &r0, &t1); regs[r0] = t1; break; + case INDEX_op_tci_movl: + tci_args_rl(insn, tb_ptr, &r0, &ptr); + regs[r0] = *(tcg_target_ulong *)ptr; + break; /* Load/store operations (32 bit). */ CASE_32_64(ld8u) - tci_args_rrs(&tb_ptr, &r0, &r1, &ofs); + tci_args_rrs(insn, &r0, &r1, &ofs); ptr = (void *)(regs[r1] + ofs); regs[r0] = *(uint8_t *)ptr; break; CASE_32_64(ld8s) - tci_args_rrs(&tb_ptr, &r0, &r1, &ofs); + tci_args_rrs(insn, &r0, &r1, &ofs); ptr = (void *)(regs[r1] + ofs); regs[r0] = *(int8_t *)ptr; break; CASE_32_64(ld16u) - tci_args_rrs(&tb_ptr, &r0, &r1, &ofs); + tci_args_rrs(insn, &r0, &r1, &ofs); ptr = (void *)(regs[r1] + ofs); regs[r0] = *(uint16_t *)ptr; break; CASE_32_64(ld16s) - tci_args_rrs(&tb_ptr, &r0, &r1, &ofs); + tci_args_rrs(insn, &r0, &r1, &ofs); ptr = (void *)(regs[r1] + ofs); regs[r0] = *(int16_t *)ptr; break; case INDEX_op_ld_i32: CASE_64(ld32u) - tci_args_rrs(&tb_ptr, &r0, &r1, &ofs); + tci_args_rrs(insn, &r0, &r1, &ofs); ptr = (void *)(regs[r1] + ofs); regs[r0] = *(uint32_t *)ptr; break; CASE_32_64(st8) - tci_args_rrs(&tb_ptr, &r0, &r1, &ofs); + tci_args_rrs(insn, &r0, &r1, &ofs); ptr = (void *)(regs[r1] + ofs); *(uint8_t *)ptr = regs[r0]; break; CASE_32_64(st16) - tci_args_rrs(&tb_ptr, &r0, &r1, &ofs); + tci_args_rrs(insn, &r0, &r1, &ofs); ptr = (void *)(regs[r1] + ofs); *(uint16_t *)ptr = regs[r0]; break; case INDEX_op_st_i32: CASE_64(st32) - tci_args_rrs(&tb_ptr, &r0, &r1, &ofs); + tci_args_rrs(insn, &r0, &r1, &ofs); ptr = (void *)(regs[r1] + ofs); *(uint32_t *)ptr = regs[r0]; break; @@ -622,171 +500,166 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, /* Arithmetic operations (mixed 32/64 bit). */ CASE_32_64(add) - tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + tci_args_rrr(insn, &r0, &r1, &r2); regs[r0] = regs[r1] + regs[r2]; break; CASE_32_64(sub) - tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + tci_args_rrr(insn, &r0, &r1, &r2); regs[r0] = regs[r1] - regs[r2]; break; CASE_32_64(mul) - tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + tci_args_rrr(insn, &r0, &r1, &r2); regs[r0] = regs[r1] * regs[r2]; break; CASE_32_64(and) - tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + tci_args_rrr(insn, &r0, &r1, &r2); regs[r0] = regs[r1] & regs[r2]; break; CASE_32_64(or) - tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + tci_args_rrr(insn, &r0, &r1, &r2); regs[r0] = regs[r1] | regs[r2]; break; CASE_32_64(xor) - tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + tci_args_rrr(insn, &r0, &r1, &r2); regs[r0] = regs[r1] ^ regs[r2]; break; /* Arithmetic operations (32 bit). */ case INDEX_op_div_i32: - tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + tci_args_rrr(insn, &r0, &r1, &r2); regs[r0] = (int32_t)regs[r1] / (int32_t)regs[r2]; break; case INDEX_op_divu_i32: - tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + tci_args_rrr(insn, &r0, &r1, &r2); regs[r0] = (uint32_t)regs[r1] / (uint32_t)regs[r2]; break; case INDEX_op_rem_i32: - tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + tci_args_rrr(insn, &r0, &r1, &r2); regs[r0] = (int32_t)regs[r1] % (int32_t)regs[r2]; break; case INDEX_op_remu_i32: - tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + tci_args_rrr(insn, &r0, &r1, &r2); regs[r0] = (uint32_t)regs[r1] % (uint32_t)regs[r2]; break; /* Shift/rotate operations (32 bit). */ case INDEX_op_shl_i32: - tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + tci_args_rrr(insn, &r0, &r1, &r2); regs[r0] = (uint32_t)regs[r1] << (regs[r2] & 31); break; case INDEX_op_shr_i32: - tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + tci_args_rrr(insn, &r0, &r1, &r2); regs[r0] = (uint32_t)regs[r1] >> (regs[r2] & 31); break; case INDEX_op_sar_i32: - tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + tci_args_rrr(insn, &r0, &r1, &r2); regs[r0] = (int32_t)regs[r1] >> (regs[r2] & 31); break; #if TCG_TARGET_HAS_rot_i32 case INDEX_op_rotl_i32: - tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + tci_args_rrr(insn, &r0, &r1, &r2); regs[r0] = rol32(regs[r1], regs[r2] & 31); break; case INDEX_op_rotr_i32: - tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + tci_args_rrr(insn, &r0, &r1, &r2); regs[r0] = ror32(regs[r1], regs[r2] & 31); break; #endif #if TCG_TARGET_HAS_deposit_i32 case INDEX_op_deposit_i32: - tci_args_rrrbb(&tb_ptr, &r0, &r1, &r2, &pos, &len); + tci_args_rrrbb(insn, &r0, &r1, &r2, &pos, &len); regs[r0] = deposit32(regs[r1], pos, len, regs[r2]); break; #endif case INDEX_op_brcond_i32: - tci_args_rl(&tb_ptr, &r0, &ptr); + tci_args_rl(insn, tb_ptr, &r0, &ptr); if ((uint32_t)regs[r0]) { tb_ptr = ptr; } break; #if TCG_TARGET_REG_BITS == 32 case INDEX_op_add2_i32: - tci_args_rrrrrr(&tb_ptr, &r0, &r1, &r2, &r3, &r4, &r5); + tci_args_rrrrrr(insn, &r0, &r1, &r2, &r3, &r4, &r5); T1 = tci_uint64(regs[r3], regs[r2]); T2 = tci_uint64(regs[r5], regs[r4]); tci_write_reg64(regs, r1, r0, T1 + T2); break; case INDEX_op_sub2_i32: - tci_args_rrrrrr(&tb_ptr, &r0, &r1, &r2, &r3, &r4, &r5); + tci_args_rrrrrr(insn, &r0, &r1, &r2, &r3, &r4, &r5); T1 = tci_uint64(regs[r3], regs[r2]); T2 = tci_uint64(regs[r5], regs[r4]); tci_write_reg64(regs, r1, r0, T1 - T2); break; case INDEX_op_mulu2_i32: - tci_args_rrrr(&tb_ptr, &r0, &r1, &r2, &r3); + tci_args_rrrr(insn, &r0, &r1, &r2, &r3); tci_write_reg64(regs, r1, r0, (uint64_t)regs[r2] * regs[r3]); break; #endif /* TCG_TARGET_REG_BITS == 32 */ #if TCG_TARGET_HAS_ext8s_i32 || TCG_TARGET_HAS_ext8s_i64 CASE_32_64(ext8s) - tci_args_rr(&tb_ptr, &r0, &r1); + tci_args_rr(insn, &r0, &r1); regs[r0] = (int8_t)regs[r1]; break; #endif #if TCG_TARGET_HAS_ext16s_i32 || TCG_TARGET_HAS_ext16s_i64 CASE_32_64(ext16s) - tci_args_rr(&tb_ptr, &r0, &r1); + tci_args_rr(insn, &r0, &r1); regs[r0] = (int16_t)regs[r1]; break; #endif #if TCG_TARGET_HAS_ext8u_i32 || TCG_TARGET_HAS_ext8u_i64 CASE_32_64(ext8u) - tci_args_rr(&tb_ptr, &r0, &r1); + tci_args_rr(insn, &r0, &r1); regs[r0] = (uint8_t)regs[r1]; break; #endif #if TCG_TARGET_HAS_ext16u_i32 || TCG_TARGET_HAS_ext16u_i64 CASE_32_64(ext16u) - tci_args_rr(&tb_ptr, &r0, &r1); + tci_args_rr(insn, &r0, &r1); regs[r0] = (uint16_t)regs[r1]; break; #endif #if TCG_TARGET_HAS_bswap16_i32 || TCG_TARGET_HAS_bswap16_i64 CASE_32_64(bswap16) - tci_args_rr(&tb_ptr, &r0, &r1); + tci_args_rr(insn, &r0, &r1); regs[r0] = bswap16(regs[r1]); break; #endif #if TCG_TARGET_HAS_bswap32_i32 || TCG_TARGET_HAS_bswap32_i64 CASE_32_64(bswap32) - tci_args_rr(&tb_ptr, &r0, &r1); + tci_args_rr(insn, &r0, &r1); regs[r0] = bswap32(regs[r1]); break; #endif #if TCG_TARGET_HAS_not_i32 || TCG_TARGET_HAS_not_i64 CASE_32_64(not) - tci_args_rr(&tb_ptr, &r0, &r1); + tci_args_rr(insn, &r0, &r1); regs[r0] = ~regs[r1]; break; #endif #if TCG_TARGET_HAS_neg_i32 || TCG_TARGET_HAS_neg_i64 CASE_32_64(neg) - tci_args_rr(&tb_ptr, &r0, &r1); + tci_args_rr(insn, &r0, &r1); regs[r0] = -regs[r1]; break; #endif #if TCG_TARGET_REG_BITS == 64 - case INDEX_op_tci_movi_i64: - tci_args_rI(&tb_ptr, &r0, &t1); - regs[r0] = t1; - break; - /* Load/store operations (64 bit). */ case INDEX_op_ld32s_i64: - tci_args_rrs(&tb_ptr, &r0, &r1, &ofs); + tci_args_rrs(insn, &r0, &r1, &ofs); ptr = (void *)(regs[r1] + ofs); regs[r0] = *(int32_t *)ptr; break; case INDEX_op_ld_i64: - tci_args_rrs(&tb_ptr, &r0, &r1, &ofs); + tci_args_rrs(insn, &r0, &r1, &ofs); ptr = (void *)(regs[r1] + ofs); regs[r0] = *(uint64_t *)ptr; break; case INDEX_op_st_i64: - tci_args_rrs(&tb_ptr, &r0, &r1, &ofs); + tci_args_rrs(insn, &r0, &r1, &ofs); ptr = (void *)(regs[r1] + ofs); *(uint64_t *)ptr = regs[r0]; break; @@ -794,71 +667,71 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, /* Arithmetic operations (64 bit). */ case INDEX_op_div_i64: - tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + tci_args_rrr(insn, &r0, &r1, &r2); regs[r0] = (int64_t)regs[r1] / (int64_t)regs[r2]; break; case INDEX_op_divu_i64: - tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + tci_args_rrr(insn, &r0, &r1, &r2); regs[r0] = (uint64_t)regs[r1] / (uint64_t)regs[r2]; break; case INDEX_op_rem_i64: - tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + tci_args_rrr(insn, &r0, &r1, &r2); regs[r0] = (int64_t)regs[r1] % (int64_t)regs[r2]; break; case INDEX_op_remu_i64: - tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + tci_args_rrr(insn, &r0, &r1, &r2); regs[r0] = (uint64_t)regs[r1] % (uint64_t)regs[r2]; break; /* Shift/rotate operations (64 bit). */ case INDEX_op_shl_i64: - tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + tci_args_rrr(insn, &r0, &r1, &r2); regs[r0] = regs[r1] << (regs[r2] & 63); break; case INDEX_op_shr_i64: - tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + tci_args_rrr(insn, &r0, &r1, &r2); regs[r0] = regs[r1] >> (regs[r2] & 63); break; case INDEX_op_sar_i64: - tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + tci_args_rrr(insn, &r0, &r1, &r2); regs[r0] = (int64_t)regs[r1] >> (regs[r2] & 63); break; #if TCG_TARGET_HAS_rot_i64 case INDEX_op_rotl_i64: - tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + tci_args_rrr(insn, &r0, &r1, &r2); regs[r0] = rol64(regs[r1], regs[r2] & 63); break; case INDEX_op_rotr_i64: - tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + tci_args_rrr(insn, &r0, &r1, &r2); regs[r0] = ror64(regs[r1], regs[r2] & 63); break; #endif #if TCG_TARGET_HAS_deposit_i64 case INDEX_op_deposit_i64: - tci_args_rrrbb(&tb_ptr, &r0, &r1, &r2, &pos, &len); + tci_args_rrrbb(insn, &r0, &r1, &r2, &pos, &len); regs[r0] = deposit64(regs[r1], pos, len, regs[r2]); break; #endif case INDEX_op_brcond_i64: - tci_args_rl(&tb_ptr, &r0, &ptr); + tci_args_rl(insn, tb_ptr, &r0, &ptr); if (regs[r0]) { tb_ptr = ptr; } break; case INDEX_op_ext32s_i64: case INDEX_op_ext_i32_i64: - tci_args_rr(&tb_ptr, &r0, &r1); + tci_args_rr(insn, &r0, &r1); regs[r0] = (int32_t)regs[r1]; break; case INDEX_op_ext32u_i64: case INDEX_op_extu_i32_i64: - tci_args_rr(&tb_ptr, &r0, &r1); + tci_args_rr(insn, &r0, &r1); regs[r0] = (uint32_t)regs[r1]; break; #if TCG_TARGET_HAS_bswap64_i64 case INDEX_op_bswap64_i64: - tci_args_rr(&tb_ptr, &r0, &r1); + tci_args_rr(insn, &r0, &r1); regs[r0] = bswap64(regs[r1]); break; #endif @@ -867,20 +740,20 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, /* QEMU specific operations. */ case INDEX_op_exit_tb: - tci_args_l(&tb_ptr, &ptr); + tci_args_l(insn, tb_ptr, &ptr); return (uintptr_t)ptr; case INDEX_op_goto_tb: - tci_args_l(&tb_ptr, &ptr); + tci_args_l(insn, tb_ptr, &ptr); tb_ptr = *(void **)ptr; break; case INDEX_op_qemu_ld_i32: if (TARGET_LONG_BITS <= TCG_TARGET_REG_BITS) { - tci_args_rrm(&tb_ptr, &r0, &r1, &oi); + tci_args_rrm(insn, &r0, &r1, &oi); taddr = regs[r1]; } else { - tci_args_rrrm(&tb_ptr, &r0, &r1, &r2, &oi); + tci_args_rrrm(insn, &r0, &r1, &r2, &oi); taddr = tci_uint64(regs[r2], regs[r1]); } switch (get_memop(oi) & (MO_BSWAP | MO_SSIZE)) { @@ -916,14 +789,15 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_qemu_ld_i64: if (TCG_TARGET_REG_BITS == 64) { - tci_args_rrm(&tb_ptr, &r0, &r1, &oi); + tci_args_rrm(insn, &r0, &r1, &oi); taddr = regs[r1]; } else if (TARGET_LONG_BITS <= TCG_TARGET_REG_BITS) { - tci_args_rrrm(&tb_ptr, &r0, &r1, &r2, &oi); + tci_args_rrrm(insn, &r0, &r1, &r2, &oi); taddr = regs[r2]; } else { - tci_args_rrrrm(&tb_ptr, &r0, &r1, &r2, &r3, &oi); + tci_args_rrrrr(insn, &r0, &r1, &r2, &r3, &r4); taddr = tci_uint64(regs[r3], regs[r2]); + oi = regs[r4]; } switch (get_memop(oi) & (MO_BSWAP | MO_SSIZE)) { case MO_UB: @@ -974,10 +848,10 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_qemu_st_i32: if (TARGET_LONG_BITS <= TCG_TARGET_REG_BITS) { - tci_args_rrm(&tb_ptr, &r0, &r1, &oi); + tci_args_rrm(insn, &r0, &r1, &oi); taddr = regs[r1]; } else { - tci_args_rrrm(&tb_ptr, &r0, &r1, &r2, &oi); + tci_args_rrrm(insn, &r0, &r1, &r2, &oi); taddr = tci_uint64(regs[r2], regs[r1]); } tmp32 = regs[r0]; @@ -1004,16 +878,17 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_qemu_st_i64: if (TCG_TARGET_REG_BITS == 64) { - tci_args_rrm(&tb_ptr, &r0, &r1, &oi); + tci_args_rrm(insn, &r0, &r1, &oi); taddr = regs[r1]; tmp64 = regs[r0]; } else { if (TARGET_LONG_BITS <= TCG_TARGET_REG_BITS) { - tci_args_rrrm(&tb_ptr, &r0, &r1, &r2, &oi); + tci_args_rrrm(insn, &r0, &r1, &r2, &oi); taddr = regs[r2]; } else { - tci_args_rrrrm(&tb_ptr, &r0, &r1, &r2, &r3, &oi); + tci_args_rrrrr(insn, &r0, &r1, &r2, &r3, &r4); taddr = tci_uint64(regs[r3], regs[r2]); + oi = regs[r4]; } tmp64 = tci_uint64(regs[r1], regs[r0]); } @@ -1097,14 +972,14 @@ static const char *str_c(TCGCond c) /* Disassemble TCI bytecode. */ int print_insn_tci(bfd_vma addr, disassemble_info *info) { - uint8_t buf[256]; - int length, status; + const uint32_t *tb_ptr = (const void *)(uintptr_t)addr; const TCGOpDef *def; const char *op_name; + uint32_t insn; TCGOpcode op; - TCGReg r0, r1, r2, r3; + TCGReg r0, r1, r2, r3, r4; #if TCG_TARGET_REG_BITS == 32 - TCGReg r4, r5; + TCGReg r5; #endif tcg_target_ulong i1; int32_t s2; @@ -1112,71 +987,54 @@ int print_insn_tci(bfd_vma addr, disassemble_info *info) TCGMemOpIdx oi; uint8_t pos, len; void *ptr; - const uint8_t *tb_ptr; - status = info->read_memory_func(addr, buf, 2, info); - if (status != 0) { - info->memory_error_func(status, addr, info); - return -1; - } - op = buf[0]; - length = buf[1]; + /* TCI is always the host, so we don't need to load indirect. */ + insn = *tb_ptr++; - if (length < 2) { - info->fprintf_func(info->stream, "invalid length %d", length); - return 1; - } - - status = info->read_memory_func(addr + 2, buf + 2, length - 2, info); - if (status != 0) { - info->memory_error_func(status, addr + 2, info); - return -1; - } + info->fprintf_func(info->stream, "%08x ", insn); + op = extract32(insn, 0, 8); def = &tcg_op_defs[op]; op_name = def->name; - tb_ptr = buf + 2; switch (op) { case INDEX_op_br: case INDEX_op_exit_tb: case INDEX_op_goto_tb: - tci_args_l(&tb_ptr, &ptr); + tci_args_l(insn, tb_ptr, &ptr); info->fprintf_func(info->stream, "%-12s %p", op_name, ptr); break; case INDEX_op_call: - tci_args_nl(&tb_ptr, &len, &ptr); + tci_args_nl(insn, tb_ptr, &len, &ptr); info->fprintf_func(info->stream, "%-12s %d,%p", op_name, len, ptr); break; case INDEX_op_brcond_i32: case INDEX_op_brcond_i64: - tci_args_rl(&tb_ptr, &r0, &ptr); + tci_args_rl(insn, tb_ptr, &r0, &ptr); info->fprintf_func(info->stream, "%-12s %s,0,ne,%p", op_name, str_r(r0), ptr); break; case INDEX_op_setcond_i32: case INDEX_op_setcond_i64: - tci_args_rrrc(&tb_ptr, &r0, &r1, &r2, &c); + tci_args_rrrc(insn, &r0, &r1, &r2, &c); info->fprintf_func(info->stream, "%-12s %s,%s,%s,%s", op_name, str_r(r0), str_r(r1), str_r(r2), str_c(c)); break; - case INDEX_op_tci_movi_i32: - tci_args_ri(&tb_ptr, &r0, &i1); + case INDEX_op_tci_movi: + tci_args_ri(insn, &r0, &i1); info->fprintf_func(info->stream, "%-12s %s,0x%" TCG_PRIlx "", op_name, str_r(r0), i1); break; -#if TCG_TARGET_REG_BITS == 64 - case INDEX_op_tci_movi_i64: - tci_args_rI(&tb_ptr, &r0, &i1); - info->fprintf_func(info->stream, "%-12s %s,0x%" TCG_PRIlx "", - op_name, str_r(r0), i1); + case INDEX_op_tci_movl: + tci_args_rl(insn, tb_ptr, &r0, &ptr); + info->fprintf_func(info->stream, "%-12s %s,%p", + op_name, str_r(r0), ptr); break; -#endif case INDEX_op_ld8u_i32: case INDEX_op_ld8u_i64: @@ -1197,7 +1055,7 @@ int print_insn_tci(bfd_vma addr, disassemble_info *info) case INDEX_op_st32_i64: case INDEX_op_st_i32: case INDEX_op_st_i64: - tci_args_rrs(&tb_ptr, &r0, &r1, &s2); + tci_args_rrs(insn, &r0, &r1, &s2); info->fprintf_func(info->stream, "%-12s %s,%s,%d", op_name, str_r(r0), str_r(r1), s2); break; @@ -1224,7 +1082,7 @@ int print_insn_tci(bfd_vma addr, disassemble_info *info) case INDEX_op_not_i64: case INDEX_op_neg_i32: case INDEX_op_neg_i64: - tci_args_rr(&tb_ptr, &r0, &r1); + tci_args_rr(insn, &r0, &r1); info->fprintf_func(info->stream, "%-12s %s,%s", op_name, str_r(r0), str_r(r1)); break; @@ -1259,28 +1117,28 @@ int print_insn_tci(bfd_vma addr, disassemble_info *info) case INDEX_op_rotl_i64: case INDEX_op_rotr_i32: case INDEX_op_rotr_i64: - tci_args_rrr(&tb_ptr, &r0, &r1, &r2); + tci_args_rrr(insn, &r0, &r1, &r2); info->fprintf_func(info->stream, "%-12s %s,%s,%s", op_name, str_r(r0), str_r(r1), str_r(r2)); break; case INDEX_op_deposit_i32: case INDEX_op_deposit_i64: - tci_args_rrrbb(&tb_ptr, &r0, &r1, &r2, &pos, &len); + tci_args_rrrbb(insn, &r0, &r1, &r2, &pos, &len); info->fprintf_func(info->stream, "%-12s %s,%s,%s,%d,%d", op_name, str_r(r0), str_r(r1), str_r(r2), pos, len); break; #if TCG_TARGET_REG_BITS == 32 case INDEX_op_setcond2_i32: - tci_args_rrrrrc(&tb_ptr, &r0, &r1, &r2, &r3, &r4, &c); + tci_args_rrrrrc(insn, &r0, &r1, &r2, &r3, &r4, &c); info->fprintf_func(info->stream, "%-12s %s,%s,%s,%s,%s,%s", op_name, str_r(r0), str_r(r1), str_r(r2), str_r(r3), str_r(r4), str_c(c)); break; case INDEX_op_mulu2_i32: - tci_args_rrrr(&tb_ptr, &r0, &r1, &r2, &r3); + tci_args_rrrr(insn, &r0, &r1, &r2, &r3); info->fprintf_func(info->stream, "%-12s %s,%s,%s,%s", op_name, str_r(r0), str_r(r1), str_r(r2), str_r(r3)); @@ -1288,7 +1146,7 @@ int print_insn_tci(bfd_vma addr, disassemble_info *info) case INDEX_op_add2_i32: case INDEX_op_sub2_i32: - tci_args_rrrrrr(&tb_ptr, &r0, &r1, &r2, &r3, &r4, &r5); + tci_args_rrrrrr(insn, &r0, &r1, &r2, &r3, &r4, &r5); info->fprintf_func(info->stream, "%-12s %s,%s,%s,%s,%s,%s", op_name, str_r(r0), str_r(r1), str_r(r2), str_r(r3), str_r(r4), str_r(r5)); @@ -1306,30 +1164,38 @@ int print_insn_tci(bfd_vma addr, disassemble_info *info) len += DIV_ROUND_UP(TARGET_LONG_BITS, TCG_TARGET_REG_BITS); switch (len) { case 2: - tci_args_rrm(&tb_ptr, &r0, &r1, &oi); + tci_args_rrm(insn, &r0, &r1, &oi); info->fprintf_func(info->stream, "%-12s %s,%s,%x", op_name, str_r(r0), str_r(r1), oi); break; case 3: - tci_args_rrrm(&tb_ptr, &r0, &r1, &r2, &oi); + tci_args_rrrm(insn, &r0, &r1, &r2, &oi); info->fprintf_func(info->stream, "%-12s %s,%s,%s,%x", op_name, str_r(r0), str_r(r1), str_r(r2), oi); break; case 4: - tci_args_rrrrm(&tb_ptr, &r0, &r1, &r2, &r3, &oi); - info->fprintf_func(info->stream, "%-12s %s,%s,%s,%s,%x", + tci_args_rrrrr(insn, &r0, &r1, &r2, &r3, &r4); + info->fprintf_func(info->stream, "%-12s %s,%s,%s,%s,%s", op_name, str_r(r0), str_r(r1), - str_r(r2), str_r(r3), oi); + str_r(r2), str_r(r3), str_r(r4)); break; default: g_assert_not_reached(); } break; + case 0: + /* tcg_out_nop_fill uses zeros */ + if (insn == 0) { + info->fprintf_func(info->stream, "align"); + break; + } + /* fall through */ + default: info->fprintf_func(info->stream, "illegal opcode %d", op); break; } - return length; + return sizeof(insn); } diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index e06d4e9380..0df8384be7 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -22,20 +22,7 @@ * THE SOFTWARE. */ -/* TODO list: - * - See TODO comments in code. - */ - -/* Marker for missing code. */ -#define TODO() \ - do { \ - fprintf(stderr, "TODO %s:%u: %s()\n", \ - __FILE__, __LINE__, __func__); \ - tcg_abort(); \ - } while (0) - -/* Bitfield n...m (in 32 bit value). */ -#define BITS(n, m) (((0xffffffffU << (31 - n)) >> (31 - n + m)) << m) +#include "../tcg-pool.c.inc" static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) { @@ -226,52 +213,16 @@ static const char *const tcg_target_reg_names[TCG_TARGET_NB_REGS] = { static bool patch_reloc(tcg_insn_unit *code_ptr, int type, intptr_t value, intptr_t addend) { - /* tcg_out_reloc always uses the same type, addend. */ - tcg_debug_assert(type == sizeof(tcg_target_long)); + intptr_t diff = value - (intptr_t)(code_ptr + 1); + tcg_debug_assert(addend == 0); - tcg_debug_assert(value != 0); - if (TCG_TARGET_REG_BITS == 32) { - tcg_patch32(code_ptr, value); - } else { - tcg_patch64(code_ptr, value); - } - return true; -} - -/* Write value (native size). */ -static void tcg_out_i(TCGContext *s, tcg_target_ulong v) -{ - if (TCG_TARGET_REG_BITS == 32) { - tcg_out32(s, v); - } else { - tcg_out64(s, v); - } -} - -/* Write opcode. */ -static void tcg_out_op_t(TCGContext *s, TCGOpcode op) -{ - tcg_out8(s, op); - tcg_out8(s, 0); -} - -/* Write register. */ -static void tcg_out_r(TCGContext *s, TCGArg t0) -{ - tcg_debug_assert(t0 < TCG_TARGET_NB_REGS); - tcg_out8(s, t0); -} - -/* Write label. */ -static void tci_out_label(TCGContext *s, TCGLabel *label) -{ - if (label->has_value) { - tcg_out_i(s, label->u.value); - tcg_debug_assert(label->u.value); - } else { - tcg_out_reloc(s, s->code_ptr, sizeof(tcg_target_ulong), label, 0); - s->code_ptr += sizeof(tcg_target_ulong); + tcg_debug_assert(type == 20); + + if (diff == sextract32(diff, 0, type)) { + tcg_patch32(code_ptr, deposit32(*code_ptr, 32 - type, type, diff)); + return true; } + return false; } static void stack_bounds_check(TCGReg base, target_long offset) @@ -285,251 +236,236 @@ static void stack_bounds_check(TCGReg base, target_long offset) static void tcg_out_op_l(TCGContext *s, TCGOpcode op, TCGLabel *l0) { - uint8_t *old_code_ptr = s->code_ptr; + tcg_insn_unit insn = 0; - tcg_out_op_t(s, op); - tci_out_label(s, l0); - - old_code_ptr[1] = s->code_ptr - old_code_ptr; + tcg_out_reloc(s, s->code_ptr, 20, l0, 0); + insn = deposit32(insn, 0, 8, op); + tcg_out32(s, insn); } static void tcg_out_op_p(TCGContext *s, TCGOpcode op, void *p0) { - uint8_t *old_code_ptr = s->code_ptr; + tcg_insn_unit insn = 0; + intptr_t diff; - tcg_out_op_t(s, op); - tcg_out_i(s, (uintptr_t)p0); - - old_code_ptr[1] = s->code_ptr - old_code_ptr; + /* Special case for exit_tb: map null -> 0. */ + if (p0 == NULL) { + diff = 0; + } else { + diff = p0 - (void *)(s->code_ptr + 1); + tcg_debug_assert(diff != 0); + if (diff != sextract32(diff, 0, 20)) { + tcg_raise_tb_overflow(s); + } + } + insn = deposit32(insn, 0, 8, op); + insn = deposit32(insn, 12, 20, diff); + tcg_out32(s, insn); } static void tcg_out_op_v(TCGContext *s, TCGOpcode op) { - uint8_t *old_code_ptr = s->code_ptr; - - tcg_out_op_t(s, op); - - old_code_ptr[1] = s->code_ptr - old_code_ptr; -} - -static void tcg_out_op_np(TCGContext *s, TCGOpcode op, - uint8_t n0, const void *p1) -{ - uint8_t *old_code_ptr = s->code_ptr; - - tcg_out_op_t(s, op); - tcg_out8(s, n0); - tcg_out_i(s, (uintptr_t)p1); - - old_code_ptr[1] = s->code_ptr - old_code_ptr; + tcg_out32(s, (uint8_t)op); } static void tcg_out_op_ri(TCGContext *s, TCGOpcode op, TCGReg r0, int32_t i1) { - uint8_t *old_code_ptr = s->code_ptr; + tcg_insn_unit insn = 0; - tcg_out_op_t(s, op); - tcg_out_r(s, r0); - tcg_out32(s, i1); - - old_code_ptr[1] = s->code_ptr - old_code_ptr; + tcg_debug_assert(i1 == sextract32(i1, 0, 20)); + insn = deposit32(insn, 0, 8, op); + insn = deposit32(insn, 8, 4, r0); + insn = deposit32(insn, 12, 20, i1); + tcg_out32(s, insn); } -#if TCG_TARGET_REG_BITS == 64 -static void tcg_out_op_rI(TCGContext *s, TCGOpcode op, - TCGReg r0, uint64_t i1) -{ - uint8_t *old_code_ptr = s->code_ptr; - - tcg_out_op_t(s, op); - tcg_out_r(s, r0); - tcg_out64(s, i1); - - old_code_ptr[1] = s->code_ptr - old_code_ptr; -} -#endif - static void tcg_out_op_rl(TCGContext *s, TCGOpcode op, TCGReg r0, TCGLabel *l1) { - uint8_t *old_code_ptr = s->code_ptr; + tcg_insn_unit insn = 0; - tcg_out_op_t(s, op); - tcg_out_r(s, r0); - tci_out_label(s, l1); - - old_code_ptr[1] = s->code_ptr - old_code_ptr; + tcg_out_reloc(s, s->code_ptr, 20, l1, 0); + insn = deposit32(insn, 0, 8, op); + insn = deposit32(insn, 8, 4, r0); + tcg_out32(s, insn); } static void tcg_out_op_rr(TCGContext *s, TCGOpcode op, TCGReg r0, TCGReg r1) { - uint8_t *old_code_ptr = s->code_ptr; + tcg_insn_unit insn = 0; - tcg_out_op_t(s, op); - tcg_out_r(s, r0); - tcg_out_r(s, r1); - - old_code_ptr[1] = s->code_ptr - old_code_ptr; + insn = deposit32(insn, 0, 8, op); + insn = deposit32(insn, 8, 4, r0); + insn = deposit32(insn, 12, 4, r1); + tcg_out32(s, insn); } static void tcg_out_op_rrm(TCGContext *s, TCGOpcode op, TCGReg r0, TCGReg r1, TCGArg m2) { - uint8_t *old_code_ptr = s->code_ptr; + tcg_insn_unit insn = 0; - tcg_out_op_t(s, op); - tcg_out_r(s, r0); - tcg_out_r(s, r1); - tcg_out32(s, m2); - - old_code_ptr[1] = s->code_ptr - old_code_ptr; + tcg_debug_assert(m2 == extract32(m2, 0, 12)); + insn = deposit32(insn, 0, 8, op); + insn = deposit32(insn, 8, 4, r0); + insn = deposit32(insn, 12, 4, r1); + insn = deposit32(insn, 20, 12, m2); + tcg_out32(s, insn); } static void tcg_out_op_rrr(TCGContext *s, TCGOpcode op, TCGReg r0, TCGReg r1, TCGReg r2) { - uint8_t *old_code_ptr = s->code_ptr; + tcg_insn_unit insn = 0; - tcg_out_op_t(s, op); - tcg_out_r(s, r0); - tcg_out_r(s, r1); - tcg_out_r(s, r2); - - old_code_ptr[1] = s->code_ptr - old_code_ptr; + insn = deposit32(insn, 0, 8, op); + insn = deposit32(insn, 8, 4, r0); + insn = deposit32(insn, 12, 4, r1); + insn = deposit32(insn, 16, 4, r2); + tcg_out32(s, insn); } static void tcg_out_op_rrs(TCGContext *s, TCGOpcode op, TCGReg r0, TCGReg r1, intptr_t i2) { - uint8_t *old_code_ptr = s->code_ptr; + tcg_insn_unit insn = 0; - tcg_out_op_t(s, op); - tcg_out_r(s, r0); - tcg_out_r(s, r1); - tcg_debug_assert(i2 == (int32_t)i2); - tcg_out32(s, i2); - - old_code_ptr[1] = s->code_ptr - old_code_ptr; + tcg_debug_assert(i2 == sextract32(i2, 0, 16)); + insn = deposit32(insn, 0, 8, op); + insn = deposit32(insn, 8, 4, r0); + insn = deposit32(insn, 12, 4, r1); + insn = deposit32(insn, 16, 16, i2); + tcg_out32(s, insn); } static void tcg_out_op_rrrc(TCGContext *s, TCGOpcode op, TCGReg r0, TCGReg r1, TCGReg r2, TCGCond c3) { - uint8_t *old_code_ptr = s->code_ptr; + tcg_insn_unit insn = 0; - tcg_out_op_t(s, op); - tcg_out_r(s, r0); - tcg_out_r(s, r1); - tcg_out_r(s, r2); - tcg_out8(s, c3); - - old_code_ptr[1] = s->code_ptr - old_code_ptr; + insn = deposit32(insn, 0, 8, op); + insn = deposit32(insn, 8, 4, r0); + insn = deposit32(insn, 12, 4, r1); + insn = deposit32(insn, 16, 4, r2); + insn = deposit32(insn, 20, 4, c3); + tcg_out32(s, insn); } static void tcg_out_op_rrrm(TCGContext *s, TCGOpcode op, TCGReg r0, TCGReg r1, TCGReg r2, TCGArg m3) { - uint8_t *old_code_ptr = s->code_ptr; + tcg_insn_unit insn = 0; - tcg_out_op_t(s, op); - tcg_out_r(s, r0); - tcg_out_r(s, r1); - tcg_out_r(s, r2); - tcg_out32(s, m3); - - old_code_ptr[1] = s->code_ptr - old_code_ptr; + tcg_debug_assert(m3 == extract32(m3, 0, 12)); + insn = deposit32(insn, 0, 8, op); + insn = deposit32(insn, 8, 4, r0); + insn = deposit32(insn, 12, 4, r1); + insn = deposit32(insn, 16, 4, r2); + insn = deposit32(insn, 20, 12, m3); + tcg_out32(s, insn); } static void tcg_out_op_rrrbb(TCGContext *s, TCGOpcode op, TCGReg r0, TCGReg r1, TCGReg r2, uint8_t b3, uint8_t b4) { - uint8_t *old_code_ptr = s->code_ptr; + tcg_insn_unit insn = 0; - tcg_out_op_t(s, op); - tcg_out_r(s, r0); - tcg_out_r(s, r1); - tcg_out_r(s, r2); - tcg_out8(s, b3); - tcg_out8(s, b4); - - old_code_ptr[1] = s->code_ptr - old_code_ptr; + tcg_debug_assert(b3 == extract32(b3, 0, 6)); + tcg_debug_assert(b4 == extract32(b4, 0, 6)); + insn = deposit32(insn, 0, 8, op); + insn = deposit32(insn, 8, 4, r0); + insn = deposit32(insn, 12, 4, r1); + insn = deposit32(insn, 16, 4, r2); + insn = deposit32(insn, 20, 6, b3); + insn = deposit32(insn, 26, 6, b4); + tcg_out32(s, insn); } -static void tcg_out_op_rrrrm(TCGContext *s, TCGOpcode op, TCGReg r0, - TCGReg r1, TCGReg r2, TCGReg r3, TCGArg m4) +static void tcg_out_op_rrrrr(TCGContext *s, TCGOpcode op, TCGReg r0, + TCGReg r1, TCGReg r2, TCGReg r3, TCGReg r4) { - uint8_t *old_code_ptr = s->code_ptr; + tcg_insn_unit insn = 0; - tcg_out_op_t(s, op); - tcg_out_r(s, r0); - tcg_out_r(s, r1); - tcg_out_r(s, r2); - tcg_out_r(s, r3); - tcg_out32(s, m4); - - old_code_ptr[1] = s->code_ptr - old_code_ptr; + insn = deposit32(insn, 0, 8, op); + insn = deposit32(insn, 8, 4, r0); + insn = deposit32(insn, 12, 4, r1); + insn = deposit32(insn, 16, 4, r2); + insn = deposit32(insn, 20, 4, r3); + insn = deposit32(insn, 24, 4, r4); + tcg_out32(s, insn); } #if TCG_TARGET_REG_BITS == 32 static void tcg_out_op_rrrr(TCGContext *s, TCGOpcode op, TCGReg r0, TCGReg r1, TCGReg r2, TCGReg r3) { - uint8_t *old_code_ptr = s->code_ptr; + tcg_insn_unit insn = 0; - tcg_out_op_t(s, op); - tcg_out_r(s, r0); - tcg_out_r(s, r1); - tcg_out_r(s, r2); - tcg_out_r(s, r3); - - old_code_ptr[1] = s->code_ptr - old_code_ptr; + insn = deposit32(insn, 0, 8, op); + insn = deposit32(insn, 8, 4, r0); + insn = deposit32(insn, 12, 4, r1); + insn = deposit32(insn, 16, 4, r2); + insn = deposit32(insn, 20, 4, r3); + tcg_out32(s, insn); } static void tcg_out_op_rrrrrc(TCGContext *s, TCGOpcode op, TCGReg r0, TCGReg r1, TCGReg r2, TCGReg r3, TCGReg r4, TCGCond c5) { - uint8_t *old_code_ptr = s->code_ptr; + tcg_insn_unit insn = 0; - tcg_out_op_t(s, op); - tcg_out_r(s, r0); - tcg_out_r(s, r1); - tcg_out_r(s, r2); - tcg_out_r(s, r3); - tcg_out_r(s, r4); - tcg_out8(s, c5); - - old_code_ptr[1] = s->code_ptr - old_code_ptr; + insn = deposit32(insn, 0, 8, op); + insn = deposit32(insn, 8, 4, r0); + insn = deposit32(insn, 12, 4, r1); + insn = deposit32(insn, 16, 4, r2); + insn = deposit32(insn, 20, 4, r3); + insn = deposit32(insn, 24, 4, r4); + insn = deposit32(insn, 28, 4, c5); + tcg_out32(s, insn); } static void tcg_out_op_rrrrrr(TCGContext *s, TCGOpcode op, TCGReg r0, TCGReg r1, TCGReg r2, TCGReg r3, TCGReg r4, TCGReg r5) { - uint8_t *old_code_ptr = s->code_ptr; + tcg_insn_unit insn = 0; - tcg_out_op_t(s, op); - tcg_out_r(s, r0); - tcg_out_r(s, r1); - tcg_out_r(s, r2); - tcg_out_r(s, r3); - tcg_out_r(s, r4); - tcg_out_r(s, r5); - - old_code_ptr[1] = s->code_ptr - old_code_ptr; + insn = deposit32(insn, 0, 8, op); + insn = deposit32(insn, 8, 4, r0); + insn = deposit32(insn, 12, 4, r1); + insn = deposit32(insn, 16, 4, r2); + insn = deposit32(insn, 20, 4, r3); + insn = deposit32(insn, 24, 4, r4); + insn = deposit32(insn, 28, 4, r5); + tcg_out32(s, insn); } #endif +static void tcg_out_ldst(TCGContext *s, TCGOpcode op, TCGReg val, + TCGReg base, intptr_t offset) +{ + stack_bounds_check(base, offset); + if (offset != sextract32(offset, 0, 16)) { + tcg_out_movi(s, TCG_TYPE_PTR, TCG_REG_TMP, offset); + tcg_out_op_rrr(s, (TCG_TARGET_REG_BITS == 32 + ? INDEX_op_add_i32 : INDEX_op_add_i64), + TCG_REG_TMP, TCG_REG_TMP, base); + base = TCG_REG_TMP; + offset = 0; + } + tcg_out_op_rrs(s, op, val, base, offset); +} + static void tcg_out_ld(TCGContext *s, TCGType type, TCGReg val, TCGReg base, intptr_t offset) { - stack_bounds_check(base, offset); switch (type) { case TCG_TYPE_I32: - tcg_out_op_rrs(s, INDEX_op_ld_i32, val, base, offset); + tcg_out_ldst(s, INDEX_op_ld_i32, val, base, offset); break; #if TCG_TARGET_REG_BITS == 64 case TCG_TYPE_I64: - tcg_out_op_rrs(s, INDEX_op_ld_i64, val, base, offset); + tcg_out_ldst(s, INDEX_op_ld_i64, val, base, offset); break; #endif default: @@ -559,22 +495,33 @@ static void tcg_out_movi(TCGContext *s, TCGType type, { switch (type) { case TCG_TYPE_I32: - tcg_out_op_ri(s, INDEX_op_tci_movi_i32, ret, arg); - break; #if TCG_TARGET_REG_BITS == 64 + arg = (int32_t)arg; + /* fall through */ case TCG_TYPE_I64: - tcg_out_op_rI(s, INDEX_op_tci_movi_i64, ret, arg); - break; #endif + break; default: g_assert_not_reached(); } + + if (arg == sextract32(arg, 0, 20)) { + tcg_out_op_ri(s, INDEX_op_tci_movi, ret, arg); + } else { + tcg_insn_unit insn = 0; + + new_pool_label(s, arg, 20, s->code_ptr, 0); + insn = deposit32(insn, 0, 8, INDEX_op_tci_movl); + insn = deposit32(insn, 8, 4, ret); + tcg_out32(s, insn); + } } static void tcg_out_call(TCGContext *s, const tcg_insn_unit *arg) { const TCGHelperInfo *info; uint8_t which; + tcg_insn_unit insn = 0; info = g_hash_table_lookup(helper_table, (gpointer)arg); if (info->cif->rtype == &ffi_type_void) { @@ -586,7 +533,11 @@ static void tcg_out_call(TCGContext *s, const tcg_insn_unit *arg) which = 2; } - tcg_out_op_np(s, INDEX_op_call, which, info); + new_pool_l2(s, 20, s->code_ptr, 0, + (uintptr_t)info->func, (uintptr_t)info->cif); + insn = deposit32(insn, 0, 8, INDEX_op_call); + insn = deposit32(insn, 8, 4, which); + tcg_out32(s, insn); } #if TCG_TARGET_REG_BITS == 64 @@ -644,8 +595,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, case INDEX_op_st_i32: CASE_64(st32) CASE_64(st) - stack_bounds_check(args[1], args[2]); - tcg_out_op_rrs(s, opc, args[0], args[1], args[2]); + tcg_out_ldst(s, opc, args[0], args[1], args[2]); break; CASE_32_64(add) @@ -738,8 +688,9 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, } else if (TARGET_LONG_BITS <= TCG_TARGET_REG_BITS) { tcg_out_op_rrrm(s, opc, args[0], args[1], args[2], args[3]); } else { - tcg_out_op_rrrrm(s, opc, args[0], args[1], - args[2], args[3], args[4]); + tcg_out_movi(s, TCG_TYPE_I32, TCG_REG_TMP, args[4]); + tcg_out_op_rrrrr(s, opc, args[0], args[1], + args[2], args[3], TCG_REG_TMP); } break; @@ -787,6 +738,11 @@ static int tcg_target_const_match(tcg_target_long val, TCGType type, return arg_ct->ct & TCG_CT_CONST; } +static void tcg_out_nop_fill(tcg_insn_unit *p, int count) +{ + memset(p, 0, sizeof(*p) * count); +} + static void tcg_target_init(TCGContext *s) { #if defined(CONFIG_DEBUG_TCG_INTERPRETER) diff --git a/tcg/tci/README b/tcg/tci/README index 9bb7d7a5d3..f72a40a395 100644 --- a/tcg/tci/README +++ b/tcg/tci/README @@ -23,10 +23,12 @@ This is what TCI (Tiny Code Interpreter) does. Like each TCG host frontend, TCI implements the code generator in tcg-target.c.inc, tcg-target.h. Both files are in directory tcg/tci. -The additional file tcg/tci.c adds the interpreter. +The additional file tcg/tci.c adds the interpreter and disassembler. -The bytecode consists of opcodes (same numeric values as those used by -TCG), command length and arguments of variable size and number. +The bytecode consists of opcodes (with only a few exceptions, with +the same same numeric values and semantics as used by TCG), and up +to six arguments packed into a 32-bit integer. See comments in tci.c +for details on the encoding. 3) Usage @@ -39,11 +41,6 @@ suggest using this option. Setting it automatically would need additional code in configure which must be fixed when new native TCG implementations are added. -System emulation should work on any 32 or 64 bit host. -User mode emulation might work. Maybe a new linker script (*.ld) -is needed. Byte order might be wrong (on big endian hosts) -and need fixes in configure. - For hosts with native TCG, the interpreter TCI can be enabled by configure --enable-tcg-interpreter @@ -118,13 +115,6 @@ u1 = linux-user-test works in the interpreter. These opcodes raise a runtime exception, so it is possible to see where code must be added. -* The pseudo code is not optimized and still ugly. For hosts with special - alignment requirements, it needs some fixes (maybe aligned bytecode - would also improve speed for hosts which support byte alignment). - -* A better disassembler for the pseudo code would be nice (a very primitive - disassembler is included in tcg-target.c.inc). - * It might be useful to have a runtime option which selects the native TCG or TCI, so QEMU would have to include two TCGs. Today, selecting TCI is a configure option, so you need two compilations of QEMU. From patchwork Thu Feb 4 01:57:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376231 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp870286jah; Wed, 3 Feb 2021 18:58:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJxQipHLRFvHpGLsOsI52B2HdCNlPByTTQNsEOe5fLe2VM7WNJLXYxF8Rnx0KKxM3WwtjaT2 X-Received: by 2002:a25:bd8f:: with SMTP id f15mr8799661ybh.463.1612407496870; Wed, 03 Feb 2021 18:58:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612407496; cv=none; d=google.com; s=arc-20160816; b=UcPkDysj5xJ4kruHrFjgV82QrJn6YaOFTUTVLhk6HIXiV10wO3Vo2IEXYhX+nF0iQT plTcZ6ISp4QxqjQ6K2iE0QHVAcw3aFPu89xl55z3VnQvJ9UCDj4+6YfLC5y+5VtmZp1J gP1YIUyMdRaGG0HcR2PhWDTt6MMrdbvSo1L4w46NJ5/2j1PcQiSX3VDsWLBbLjmyvc52 Z4kHp7iJoReQ1j0jUpI6nJqYCNwbrzJQRHqKwaj2ZXx1hlrLpoiHDSuPQNK7xvO9Y/io eAS+ocsp/hCmD++kX0S6bObx0dZuZpvGfwDLV+cRWu0nUkgw1T1HXxnhRNTkFWC5NlI1 4ISg== 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=ZqOw+gxfHcL+GE2Ru72t2p+WgkIxr/f1vF2n8FMDX2k=; b=LC0zB4uCnXoF56x27C85qrwsaLmZa0S4YH67AZ9GkqMPBh8zP5IhR7d27vhyqWF54q bg4oEQmY4jvdSFehj3dgAhHWxJnN0aNE4KYgCaxSLCE1DXKR9aBAna6UcJMT6IFVci9T UMWv4ffFpf5utSfz0DF21op3aVt8MjRKUBP3NsMBAigwLfQus0syG6PS5oBv9/1KmpuL 6ENgoyimiJw1+3pZTTzJoe600Slerpx5BqZzmiKy+hRLerAT4lYKnOnomzz0/4oyM3FC ig8EChPvMtmTUGIII+OCRx18Nhhz9xNaaN9P/fHLfRHVLDfHqw3YfGCaLr5NT3UuqpXF hgtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GpBqUzAn; 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 u64si4052119ybi.45.2021.02.03.18.58.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:58:16 -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=GpBqUzAn; 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]:35210 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7UqW-0007ey-Ae for patch@linaro.org; Wed, 03 Feb 2021 21:58:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47202) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7TtR-0001Nf-4y for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:57:13 -0500 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]:35995) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7TtL-0007Bz-GM for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:57:09 -0500 Received: by mail-pf1-x42e.google.com with SMTP id y142so1094307pfb.3 for ; Wed, 03 Feb 2021 17:57:07 -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=ZqOw+gxfHcL+GE2Ru72t2p+WgkIxr/f1vF2n8FMDX2k=; b=GpBqUzAnFIKA/lbJ3a8umNNPl+oG24xZ0UdZ8oKz1mn7VZFCCo1EfbYlFwGFy8WGPQ o0aQbOf3nxXl7s80ni068/A8n3minVkl8icb7S1jzS9vDA+cJi8c6MsFOcxQAs5IdDfu ykkhh2e7jFCa2KMNCEu9wfusoX+vP2pXEYSumbAkLtU17Xe8CDQxolHPJSiGFIfRKsJw UJu71QYQ2sD3UiL6XwVDWF6OEaAqytayo/AMQ+4A+F64vUVHxFdLrD5V5r5ZkqtwLtCw 8GOGJqjXcf10YMOY4Zq9r5sXdjord0i1mewqDyBfvzkDr34VAwiZC8pbGHyMTpXF4wkN 15Xw== 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=ZqOw+gxfHcL+GE2Ru72t2p+WgkIxr/f1vF2n8FMDX2k=; b=DDangCWOk3W7l1bKffLqQuGwzPSX9VvkAIFuw8LTNp+mdPIw4+pKEEyK/F4RwgfLUA 0q04iBMtTw30EkfFI/g5CmTa8tdfUo9TTZ6o4RXMXrkEycedwUjzOardB9hpfv1Nw0PU 3Wt9Lhy9og7vY1k5txxqX1VrRKYrAWozI7YRAPar7XcV6y1S1oJ0jig8xpTVfFIhTb1q xrjWvTxWrcNDPKDwFa3P7TLFFrZyVc71sQcXowgrbJwHcOOzgNVNj1f7/EgMusT1dSjq BPrTtB3N7Dd4z7BQC+XR1v80hzJsXBs41HTcSNWwiOFUVi8gCE1RETiOVvObJ8Fw/80X yWZQ== X-Gm-Message-State: AOAM533RGaqxhY/PHERc0VrYyYY1ff4KPByxCAlcrZzEuAbKmc6zAU+P cL3baiMKgZV0biwsCcDrKCqoJtcws4GfVB4E X-Received: by 2002:a63:4f09:: with SMTP id d9mr6793173pgb.70.1612403826136; Wed, 03 Feb 2021 17:57:06 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id y200sm266845pfc.103.2021.02.03.17.57.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:57:05 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 87/93] tcg/tci: Implement goto_ptr Date: Wed, 3 Feb 2021 15:57:03 -1000 Message-Id: <20210204015703.885660-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42e.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This operation is critical to staying within the interpretation loop longer, which avoids the overhead of setup and teardown for many TBs. The check in tcg_prologue_init is disabled because TCI does want to use NULL to indicate exit, as opposed to branching to a real epilogue. Signed-off-by: Richard Henderson --- tcg/tci/tcg-target-con-set.h | 1 + tcg/tci/tcg-target.h | 2 +- tcg/tcg.c | 2 ++ tcg/tci.c | 19 +++++++++++++++++++ tcg/tci/tcg-target.c.inc | 16 ++++++++++++++++ 5 files changed, 39 insertions(+), 1 deletion(-) -- 2.25.1 diff --git a/tcg/tci/tcg-target-con-set.h b/tcg/tci/tcg-target-con-set.h index 316730f32c..ae2dc3b844 100644 --- a/tcg/tci/tcg-target-con-set.h +++ b/tcg/tci/tcg-target-con-set.h @@ -9,6 +9,7 @@ * Each operand should be a sequence of constraint letters as defined by * tcg-target-con-str.h; the constraint combination is inclusive or. */ +C_O0_I1(r) C_O0_I2(r, r) C_O0_I3(r, r, r) C_O0_I4(r, r, r, r) diff --git a/tcg/tci/tcg-target.h b/tcg/tci/tcg-target.h index d953f2ead3..17911d3297 100644 --- a/tcg/tci/tcg-target.h +++ b/tcg/tci/tcg-target.h @@ -86,7 +86,7 @@ #define TCG_TARGET_HAS_muls2_i32 0 #define TCG_TARGET_HAS_muluh_i32 0 #define TCG_TARGET_HAS_mulsh_i32 0 -#define TCG_TARGET_HAS_goto_ptr 0 +#define TCG_TARGET_HAS_goto_ptr 1 #define TCG_TARGET_HAS_direct_jump 0 #define TCG_TARGET_HAS_qemu_st8_i32 0 diff --git a/tcg/tcg.c b/tcg/tcg.c index 92aec0d238..ce80adcfbe 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -1314,10 +1314,12 @@ void tcg_prologue_init(TCGContext *s) } #endif +#ifndef CONFIG_TCG_INTERPRETER /* Assert that goto_ptr is implemented completely. */ if (TCG_TARGET_HAS_goto_ptr) { tcg_debug_assert(tcg_code_gen_epilogue != NULL); } +#endif } void tcg_func_start(TCGContext *s) diff --git a/tcg/tci.c b/tcg/tci.c index c4f0a7e82d..a6e30d31a9 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -69,6 +69,11 @@ static void tci_args_l(uint32_t insn, const void *tb_ptr, void **l0) *l0 = diff ? (void *)tb_ptr + diff : NULL; } +static void tci_args_r(uint32_t insn, TCGReg *r0) +{ + *r0 = extract32(insn, 8, 4); +} + static void tci_args_nl(uint32_t insn, const void *tb_ptr, uint8_t *n0, void **l1) { @@ -748,6 +753,15 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, tb_ptr = *(void **)ptr; break; + case INDEX_op_goto_ptr: + tci_args_r(insn, &r0); + ptr = (void *)regs[r0]; + if (!ptr) { + return 0; + } + tb_ptr = ptr; + break; + case INDEX_op_qemu_ld_i32: if (TARGET_LONG_BITS <= TCG_TARGET_REG_BITS) { tci_args_rrm(insn, &r0, &r1, &oi); @@ -1005,6 +1019,11 @@ int print_insn_tci(bfd_vma addr, disassemble_info *info) info->fprintf_func(info->stream, "%-12s %p", op_name, ptr); break; + case INDEX_op_goto_ptr: + tci_args_r(insn, &r0); + info->fprintf_func(info->stream, "%-12s %s", op_name, str_r(r0)); + break; + case INDEX_op_call: tci_args_nl(insn, tb_ptr, &len, &ptr); info->fprintf_func(info->stream, "%-12s %d,%p", op_name, len, ptr); diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index 0df8384be7..db29bc6e54 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -27,6 +27,9 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) { switch (op) { + case INDEX_op_goto_ptr: + return C_O0_I1(r); + case INDEX_op_ld8u_i32: case INDEX_op_ld8s_i32: case INDEX_op_ld16u_i32: @@ -263,6 +266,15 @@ static void tcg_out_op_p(TCGContext *s, TCGOpcode op, void *p0) tcg_out32(s, insn); } +static void tcg_out_op_r(TCGContext *s, TCGOpcode op, TCGReg r0) +{ + tcg_insn_unit insn = 0; + + insn = deposit32(insn, 0, 8, op); + insn = deposit32(insn, 8, 4, r0); + tcg_out32(s, insn); +} + static void tcg_out_op_v(TCGContext *s, TCGOpcode op) { tcg_out32(s, (uint8_t)op); @@ -567,6 +579,10 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, set_jmp_reset_offset(s, args[0]); break; + case INDEX_op_goto_ptr: + tcg_out_op_r(s, opc, args[0]); + break; + case INDEX_op_br: tcg_out_op_l(s, opc, arg_label(args[0])); break; From patchwork Thu Feb 4 01:57:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376234 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp872164jah; Wed, 3 Feb 2021 19:01:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJwFsRsrJx/exCuNQOfZk4LigTYG0apq78cqzRLxzEqt2P7NH7dTE6AvRzfVtB9NhoO0JgbS X-Received: by 2002:a25:fa02:: with SMTP id b2mr8246386ybe.382.1612407684061; Wed, 03 Feb 2021 19:01:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612407684; cv=none; d=google.com; s=arc-20160816; b=BLspBriEvw8usEzQ3ZG0h8nzH81g8AvMGoGbP3cI3Y1wrJgV59FeSF+/z0Z+2vCmCT xVjQXT3n8ZkB8OfpzUUqaW6TNuePEaDlV88nn5FN98LXNYp7+mMNezftABU6BEP1tfS2 owTkOhuhz2DB7UqOPhsRUgHDvg2YbEg/7FDvL47OpHxFSpPSSAtEaxZObAREZqLIid4V vlgwHdOd4fIQl2jEKe+3rFxw7pgqAKOcfUTZn1r1arVbhVDWZiFROF65wn3y9xrrHtpU j1aFdvlVjk4mpNBLu6XVJ7hf9FmxtoWHWq1iMWVnIm5ZEe5YJ9DOi95bXCBp6GyXb8Zg vi1w== 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=lLuTVZMheh+w94V9lSybCso+88KsI23VfpQyYgw6vik=; b=gs1uIWOXNvItfMDXem3L+Dgxw4+vnMQWhofC4vQSl0OtM8TbesenOraRjnLm7Xvq4p INDBb+2FHCRc+389V02XVEsKRKLeW82jr3YbE2EJI7gvUUlrqzHazBFdIxQtP0L0Z8F7 IF0Xq51NudmR825/5mxmuwJwAcJRGYGDjLrR6hAKcpeIO9TTu17VO+3EIa8DfcT7u96D S4U/jMZQy0zT97ljYL5jFPK7gxJm0NVtLZzswvMNzy3XR6+RL5cdiVjQMIwi8XjsAYXm PrTotX4BtG8BAZ75Dz0I5vThEm9QInwHxrI1r3/s7ku+zvRpquaMIZRa6l4OxRianHgd X4Hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=T84PwoRa; 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 o125si3968375yba.354.2021.02.03.19.01.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 19:01:24 -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=T84PwoRa; 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]:43866 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7UtX-0002uM-Fu for patch@linaro.org; Wed, 03 Feb 2021 22:01:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47286) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Ttj-0001xb-Fw for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:57:35 -0500 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]:38604) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Tte-0007Gt-CL for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:57:31 -0500 Received: by mail-pg1-x52b.google.com with SMTP id o16so1053047pgg.5 for ; Wed, 03 Feb 2021 17:57:25 -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=lLuTVZMheh+w94V9lSybCso+88KsI23VfpQyYgw6vik=; b=T84PwoRa2Bfd4ZzTRRQ3ZFeC4XpI1P6LuRY8EnN4aIOOf2qKBaYY0z+QtuNgVhwDVO yfyhJ9DImz3JpcFpFuEIq2eoaPcUfME5SlswIPlsq0/AEg5wcAnttmeEuB6b7S7L9vq1 n3Cj8qGM6MMT5L9+VgWsGckLhv2Lk8F+P+XOJm0zmctJYSk5lhW0HXYri8kzswZRP/1v Cn08ZucRpt1QCPDrlHFN0MkYcnpKgUuS5YwdBCMhedsqcZxNaWku3zHZ/TZOt49OVZBT 0/8jRSEdReujHq6qtQHJcra5UXHJMDA5XQ6sUl/oxHOGvSGWABt1ObtXz/lnPerv5yrt 213Q== 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=lLuTVZMheh+w94V9lSybCso+88KsI23VfpQyYgw6vik=; b=Y2WgTBN0JWOrxdA+veGDK1mkMYpUT+lmqwOuTEma5i/LxY9+DF+K2VuiXjmQF1Nd29 M8iJQmxwfroopedPDvK0csXkFlBYyww++EaIp+nUP5VEOx0koehA0DCIEDVMXKc3z7pS z5Z59M0WPeMxCiWemmyj7Xj3uY9YnTpTyEbLKxQixH0j7wGR9OsUaO7sQ1k27oEw71VP ij3LlCwDlU9QF/DqZS2bctdN02lL7Rh2B76cDVxPFZhLL4F0kynnUOGR58gk07UVGWZU YmQI5mqZWdl4BjYre84D/2SFOSb57cN8OQBxd/kheHjh0oHI/em6Xv00PfO0UWd6SRl1 5Njw== X-Gm-Message-State: AOAM533tKs9fZjsfIFQAJKgBvzNRGr3yyfA4p2pmt+Sd13X+5zprGEaz SRy3ebFwpBQXgnh3j9YcxM5tYU+LYisYqaHi X-Received: by 2002:a65:418b:: with SMTP id a11mr6528127pgq.231.1612403844972; Wed, 03 Feb 2021 17:57:24 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id p15sm3610684pfn.172.2021.02.03.17.57.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:57:24 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 88/93] tcg/tci: Implement movcond Date: Wed, 3 Feb 2021 15:57:21 -1000 Message-Id: <20210204015721.885711-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52b; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52b.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" When this opcode is not available in the backend, tcg middle-end will expand this as a series of 5 opcodes. So implementing this saves bytecode space. Signed-off-by: Richard Henderson --- tcg/tci/tcg-target.h | 4 ++-- tcg/tci.c | 16 +++++++++++++++- tcg/tci/tcg-target.c.inc | 10 +++++++--- 3 files changed, 24 insertions(+), 6 deletions(-) -- 2.25.1 diff --git a/tcg/tci/tcg-target.h b/tcg/tci/tcg-target.h index 17911d3297..f53773a555 100644 --- a/tcg/tci/tcg-target.h +++ b/tcg/tci/tcg-target.h @@ -82,7 +82,7 @@ #define TCG_TARGET_HAS_not_i32 1 #define TCG_TARGET_HAS_orc_i32 0 #define TCG_TARGET_HAS_rot_i32 1 -#define TCG_TARGET_HAS_movcond_i32 0 +#define TCG_TARGET_HAS_movcond_i32 1 #define TCG_TARGET_HAS_muls2_i32 0 #define TCG_TARGET_HAS_muluh_i32 0 #define TCG_TARGET_HAS_mulsh_i32 0 @@ -119,7 +119,7 @@ #define TCG_TARGET_HAS_not_i64 1 #define TCG_TARGET_HAS_orc_i64 0 #define TCG_TARGET_HAS_rot_i64 1 -#define TCG_TARGET_HAS_movcond_i64 0 +#define TCG_TARGET_HAS_movcond_i64 1 #define TCG_TARGET_HAS_muls2_i64 0 #define TCG_TARGET_HAS_add2_i32 0 #define TCG_TARGET_HAS_sub2_i32 0 diff --git a/tcg/tci.c b/tcg/tci.c index a6e30d31a9..2a39f8f5a0 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -169,6 +169,7 @@ static void tci_args_rrrr(uint32_t insn, *r2 = extract32(insn, 16, 4); *r3 = extract32(insn, 20, 4); } +#endif static void tci_args_rrrrrc(uint32_t insn, TCGReg *r0, TCGReg *r1, TCGReg *r2, TCGReg *r3, TCGReg *r4, TCGCond *c5) @@ -181,6 +182,7 @@ static void tci_args_rrrrrc(uint32_t insn, TCGReg *r0, TCGReg *r1, *c5 = extract32(insn, 28, 4); } +#if TCG_TARGET_REG_BITS == 32 static void tci_args_rrrrrr(uint32_t insn, TCGReg *r0, TCGReg *r1, TCGReg *r2, TCGReg *r3, TCGReg *r4, TCGReg *r5) { @@ -431,6 +433,11 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, tci_args_rrrc(insn, &r0, &r1, &r2, &condition); regs[r0] = tci_compare32(regs[r1], regs[r2], condition); break; + case INDEX_op_movcond_i32: + tci_args_rrrrrc(insn, &r0, &r1, &r2, &r3, &r4, &condition); + tmp32 = tci_compare32(regs[r1], regs[r2], condition); + regs[r0] = regs[tmp32 ? r3 : r4]; + break; #if TCG_TARGET_REG_BITS == 32 case INDEX_op_setcond2_i32: tci_args_rrrrrc(insn, &r0, &r1, &r2, &r3, &r4, &condition); @@ -443,6 +450,11 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, tci_args_rrrc(insn, &r0, &r1, &r2, &condition); regs[r0] = tci_compare64(regs[r1], regs[r2], condition); break; + case INDEX_op_movcond_i64: + tci_args_rrrrrc(insn, &r0, &r1, &r2, &r3, &r4, &condition); + tmp32 = tci_compare64(regs[r1], regs[r2], condition); + regs[r0] = regs[tmp32 ? r3 : r4]; + break; #endif CASE_32_64(mov) tci_args_rr(insn, &r0, &r1); @@ -1148,7 +1160,8 @@ int print_insn_tci(bfd_vma addr, disassemble_info *info) op_name, str_r(r0), str_r(r1), str_r(r2), pos, len); break; -#if TCG_TARGET_REG_BITS == 32 + case INDEX_op_movcond_i32: + case INDEX_op_movcond_i64: case INDEX_op_setcond2_i32: tci_args_rrrrrc(insn, &r0, &r1, &r2, &r3, &r4, &c); info->fprintf_func(info->stream, "%-12s %s,%s,%s,%s,%s,%s", @@ -1156,6 +1169,7 @@ int print_insn_tci(bfd_vma addr, disassemble_info *info) str_r(r3), str_r(r4), str_c(c)); break; +#if TCG_TARGET_REG_BITS == 32 case INDEX_op_mulu2_i32: tci_args_rrrr(insn, &r0, &r1, &r2, &r3); info->fprintf_func(info->stream, "%-12s %s,%s,%s,%s", diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index db29bc6e54..a0c458a60a 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -133,9 +133,12 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) return C_O0_I4(r, r, r, r); case INDEX_op_mulu2_i32: return C_O2_I2(r, r, r, r); +#endif + + case INDEX_op_movcond_i32: + case INDEX_op_movcond_i64: case INDEX_op_setcond2_i32: return C_O1_I4(r, r, r, r, r); -#endif case INDEX_op_qemu_ld_i32: return (TARGET_LONG_BITS <= TCG_TARGET_REG_BITS @@ -419,6 +422,7 @@ static void tcg_out_op_rrrr(TCGContext *s, TCGOpcode op, insn = deposit32(insn, 20, 4, r3); tcg_out32(s, insn); } +#endif static void tcg_out_op_rrrrrc(TCGContext *s, TCGOpcode op, TCGReg r0, TCGReg r1, TCGReg r2, @@ -436,6 +440,7 @@ static void tcg_out_op_rrrrrc(TCGContext *s, TCGOpcode op, tcg_out32(s, insn); } +#if TCG_TARGET_REG_BITS == 32 static void tcg_out_op_rrrrrr(TCGContext *s, TCGOpcode op, TCGReg r0, TCGReg r1, TCGReg r2, TCGReg r3, TCGReg r4, TCGReg r5) @@ -591,12 +596,11 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, tcg_out_op_rrrc(s, opc, args[0], args[1], args[2], args[3]); break; -#if TCG_TARGET_REG_BITS == 32 + CASE_32_64(movcond) case INDEX_op_setcond2_i32: tcg_out_op_rrrrrc(s, opc, args[0], args[1], args[2], args[3], args[4], args[5]); break; -#endif CASE_32_64(ld8u) CASE_32_64(ld8s) From patchwork Thu Feb 4 01:57:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376225 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp868257jah; Wed, 3 Feb 2021 18:53:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJykfbP8cKD7jvUke1efQODu+dol5OLWIgNHvWxG4kYh6IV4UrvKespH/lE0Yk4i1eA7w2Oo X-Received: by 2002:a25:400d:: with SMTP id n13mr9310691yba.163.1612407215349; Wed, 03 Feb 2021 18:53:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612407215; cv=none; d=google.com; s=arc-20160816; b=ewU1MSvUeNglPUCCHgiWZpT/EJJ1S3OsJ3hXxUXqFO/B5uZIVvJ0VGamGli4iOos9F kRSTlh9h6Z0L7qy30Zz45YC7VQIeHge28ANTYLGVHlo3jTUoeSaPa1GKjg8110mkqOD3 otHfsvdE2eac9ThFh5Q4yygt8RVb3Ml4+vhvHKNFNsknQH1028dyG2JmZQTTUUELEg22 EqZWZB1FZZTjaXGnGJ3KzxoE9RZnsA+jR/itUigj31jeLOhJyM9qDuWI5WhPR0PgkDDP V1MyS3MojQ7zvW23RiMVWRJosa0FYiqPlaye+tex/CZNwxr3kxJ/Lp6rU4rBrJ3t5ym5 idTw== 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=rhMhsBiepdz6ZgRnVQ9WJVuiU6dgvoZgG9ax0hIWeII=; b=YDm2nUgFaVPeid/OjyyumHdPpwGKZmsf9a30kBFkQchiJhGCfgcwPLxieKiUfEQYyK 4KRqIuIS+g6H9FfRkyfsgsbUGuQSlNx9h93xVYjhLh/crVMt4qx1sJf+dUciBWDHA4nD 1afdSuuljvf+SlDU3JQRu3LkCtq4B/JJO1ZBcybvXVVVXbdD9E3qtzy+yukQCz+QhBIG 2eNleQloMVbgvUMRhKaGZkUdHI5xYDZYIVw+ArYzo/IARkKY3Q+t/ZbJYoz5Lgipu2Tg QOJZopS+4iEOmMTCMIJpFcCZSHu+kqGJ1AWqEmYAdRtgSeAKGBq0gdXc0UwSoOuxJecG KZyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dv0kRLdx; 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 z184si3995836ybc.57.2021.02.03.18.53.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:53:35 -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=dv0kRLdx; 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]:47668 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7Uly-00011G-PX for patch@linaro.org; Wed, 03 Feb 2021 21:53:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47376) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Tu4-0002Gw-RV for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:57:52 -0500 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]:43349) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Tty-0007MH-Uf for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:57:52 -0500 Received: by mail-pg1-x535.google.com with SMTP id n10so1031981pgl.10 for ; Wed, 03 Feb 2021 17:57:44 -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=rhMhsBiepdz6ZgRnVQ9WJVuiU6dgvoZgG9ax0hIWeII=; b=dv0kRLdxnki77yl79jdX5C7LDWxj0itfIMxMUn0eY9MHaxJ+Dr/dYZThufsoEvZFoE ah4KL5oooiCeQ0u1/01G/zi52dJlJPRiQ1CG76Y60ar70ok+393+mvtPBaZACwZaPsEz LU15Mx06TZJAWYEF+uCfho0lf787NUZ9oyr/FzoGVESJG4t5bu37SEOLXuODOUXjAMHE 0MnG9+W7rfX8VanX7A7+f1MXuwQkg1eee1zIbq3hgMyuTI9sjibYPSdH9wlGD7WKSPcS YT7KaDGTrtEC2Ntg87ks/3AQ5MMXD/UutiT6obz7+MY+VhKGK9JIoQqe2PgV7ns+b7fy FxCw== 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=rhMhsBiepdz6ZgRnVQ9WJVuiU6dgvoZgG9ax0hIWeII=; b=fsxY/DYC0LvJTdIjSZ3G4y+My86hf2dueZNh1NGFa8vQgXNB51cYYuDL4dx9J5OokR I2xjAFaxKnrNPS5b2+pmcl+IePCddOnqXp1FKPAD5NrWgtGMlgGV1D64o4fao2qgwi44 oiSRNrVvw8BouqsvT1yTifYcfk8bJ7cSwzGUg75y3D+WL15kXQ4PYP7unOdmmAixKq2o a7RBYdFJ6EV6T/nBf5VEFc5i4s9hbvpbEASeNahXI3knXIFsFOUPUJvEiV196m7VUbVv +XnIP2XU0NcTbwULMFxBnKChOCq49F+N7PhUzaJSR8lpX7znashCM7NTzYSQJyQ4clvX 9x1g== X-Gm-Message-State: AOAM533pUUgckQGkmT+r9rIoLAcqG8GgN9Ynr+CtFeCJuD5i2yV3ZJU4 d9StCUFX4Jr7rOR+tRb6CaqGt/YT+RYragl0 X-Received: by 2002:a62:5505:0:b029:1c9:2c59:b1ff with SMTP id j5-20020a6255050000b02901c92c59b1ffmr5553008pfb.69.1612403863656; Wed, 03 Feb 2021 17:57:43 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id s65sm3681085pfc.95.2021.02.03.17.57.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:57:43 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 89/93] tcg/tci: Implement andc, orc, eqv, nand, nor Date: Wed, 3 Feb 2021 15:57:40 -1000 Message-Id: <20210204015740.885763-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::535; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x535.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" These were already present in tcg-target.c.inc, but not in the interpreter. Signed-off-by: Richard Henderson --- tcg/tci/tcg-target.h | 20 ++++++++++---------- tcg/tci.c | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 10 deletions(-) -- 2.25.1 diff --git a/tcg/tci/tcg-target.h b/tcg/tci/tcg-target.h index f53773a555..5945272a43 100644 --- a/tcg/tci/tcg-target.h +++ b/tcg/tci/tcg-target.h @@ -67,20 +67,20 @@ #define TCG_TARGET_HAS_ext16s_i32 1 #define TCG_TARGET_HAS_ext8u_i32 1 #define TCG_TARGET_HAS_ext16u_i32 1 -#define TCG_TARGET_HAS_andc_i32 0 +#define TCG_TARGET_HAS_andc_i32 1 #define TCG_TARGET_HAS_deposit_i32 1 #define TCG_TARGET_HAS_extract_i32 0 #define TCG_TARGET_HAS_sextract_i32 0 #define TCG_TARGET_HAS_extract2_i32 0 -#define TCG_TARGET_HAS_eqv_i32 0 -#define TCG_TARGET_HAS_nand_i32 0 -#define TCG_TARGET_HAS_nor_i32 0 +#define TCG_TARGET_HAS_eqv_i32 1 +#define TCG_TARGET_HAS_nand_i32 1 +#define TCG_TARGET_HAS_nor_i32 1 #define TCG_TARGET_HAS_clz_i32 0 #define TCG_TARGET_HAS_ctz_i32 0 #define TCG_TARGET_HAS_ctpop_i32 0 #define TCG_TARGET_HAS_neg_i32 1 #define TCG_TARGET_HAS_not_i32 1 -#define TCG_TARGET_HAS_orc_i32 0 +#define TCG_TARGET_HAS_orc_i32 1 #define TCG_TARGET_HAS_rot_i32 1 #define TCG_TARGET_HAS_movcond_i32 1 #define TCG_TARGET_HAS_muls2_i32 0 @@ -108,16 +108,16 @@ #define TCG_TARGET_HAS_ext8u_i64 1 #define TCG_TARGET_HAS_ext16u_i64 1 #define TCG_TARGET_HAS_ext32u_i64 1 -#define TCG_TARGET_HAS_andc_i64 0 -#define TCG_TARGET_HAS_eqv_i64 0 -#define TCG_TARGET_HAS_nand_i64 0 -#define TCG_TARGET_HAS_nor_i64 0 +#define TCG_TARGET_HAS_andc_i64 1 +#define TCG_TARGET_HAS_eqv_i64 1 +#define TCG_TARGET_HAS_nand_i64 1 +#define TCG_TARGET_HAS_nor_i64 1 #define TCG_TARGET_HAS_clz_i64 0 #define TCG_TARGET_HAS_ctz_i64 0 #define TCG_TARGET_HAS_ctpop_i64 0 #define TCG_TARGET_HAS_neg_i64 1 #define TCG_TARGET_HAS_not_i64 1 -#define TCG_TARGET_HAS_orc_i64 0 +#define TCG_TARGET_HAS_orc_i64 1 #define TCG_TARGET_HAS_rot_i64 1 #define TCG_TARGET_HAS_movcond_i64 1 #define TCG_TARGET_HAS_muls2_i64 0 diff --git a/tcg/tci.c b/tcg/tci.c index 2a39f8f5a0..9c17947e6b 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -540,6 +540,36 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, tci_args_rrr(insn, &r0, &r1, &r2); regs[r0] = regs[r1] ^ regs[r2]; break; +#if TCG_TARGET_HAS_andc_i32 || TCG_TARGET_HAS_andc_i64 + CASE_32_64(andc) + tci_args_rrr(insn, &r0, &r1, &r2); + regs[r0] = regs[r1] & ~regs[r2]; + break; +#endif +#if TCG_TARGET_HAS_orc_i32 || TCG_TARGET_HAS_orc_i64 + CASE_32_64(orc) + tci_args_rrr(insn, &r0, &r1, &r2); + regs[r0] = regs[r1] | ~regs[r2]; + break; +#endif +#if TCG_TARGET_HAS_eqv_i32 || TCG_TARGET_HAS_eqv_i64 + CASE_32_64(eqv) + tci_args_rrr(insn, &r0, &r1, &r2); + regs[r0] = ~(regs[r1] ^ regs[r2]); + break; +#endif +#if TCG_TARGET_HAS_nand_i32 || TCG_TARGET_HAS_nand_i64 + CASE_32_64(nand) + tci_args_rrr(insn, &r0, &r1, &r2); + regs[r0] = ~(regs[r1] & regs[r2]); + break; +#endif +#if TCG_TARGET_HAS_nor_i32 || TCG_TARGET_HAS_nor_i64 + CASE_32_64(nor) + tci_args_rrr(insn, &r0, &r1, &r2); + regs[r0] = ~(regs[r1] | regs[r2]); + break; +#endif /* Arithmetic operations (32 bit). */ @@ -1130,6 +1160,16 @@ int print_insn_tci(bfd_vma addr, disassemble_info *info) case INDEX_op_or_i64: case INDEX_op_xor_i32: case INDEX_op_xor_i64: + case INDEX_op_andc_i32: + case INDEX_op_andc_i64: + case INDEX_op_orc_i32: + case INDEX_op_orc_i64: + case INDEX_op_eqv_i32: + case INDEX_op_eqv_i64: + case INDEX_op_nand_i32: + case INDEX_op_nand_i64: + case INDEX_op_nor_i32: + case INDEX_op_nor_i64: case INDEX_op_div_i32: case INDEX_op_div_i64: case INDEX_op_rem_i32: From patchwork Thu Feb 4 01:57:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376230 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp869581jah; Wed, 3 Feb 2021 18:56:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJwG7GbYzW3dujxEZ8RnKmUzcIenRAkanaVvw+1NMhaxZ8ngE98+xhwzxTRJBB+mRa6TxdfL X-Received: by 2002:a25:6905:: with SMTP id e5mr8545241ybc.54.1612407400335; Wed, 03 Feb 2021 18:56:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612407400; cv=none; d=google.com; s=arc-20160816; b=H8xvUoDpZ3GbP3sVmygxOW1LlWWogOKexNueT0eEjtPr6ZZztnHFZOskyYZTpqDjV8 oqO1ES8E0QWrcXAamiP8RcZMU4W+TgcNTOSzdOc421WVee3NHlF0Qgp7gXX44ca/q4wt rKQ2fHZUL4HYJMA5pdOnJdCzkLbV7sEgnZiY0Gy7zjurCWs/TpxJw8ZWPs71vFn6kWf+ yWP/kbBLMtYQ1O4JoiCjfqBzYzV0i/ig91gIG8+OFTxWMIen3yPL2qV9goEOHQGBn54o ng+Ta5ZiXOT9Wssbsv6NRquZDNIV9aPKQaAxAfRwOGZ0nM/884/LfUQsGZsEQxYiOfHQ 9Lng== 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=4GLVuYuzRltqq/bjvGdZN73wsp3XyCbMAEbRMKz6MNY=; b=CLY6XYcHLTeOcrpS/pKo7Ea917OGSkqezRr1BycELJbiZjk7KgYqMLnom/xnCHfLly IKZP1IluoZHYgDNe7E9Mp5OJz2Bdqu2n/pVxGyTHQnYuy9uuI0JEbeKsBexvNRdNGsxK dGKXgKznibyP4/Cf8IegRT4C0jQ/nBuGLQWfT4w2NEB/+1MquDHMXoi+5t2QmoPILozY QT/kvAgMIwq1rHldQwMqWcPsauhMwlRqKa0TMuR6DOo9PMXTbEBoLXv/PD8cRRtNAApP t0q9RS6iCyp2t5rPLzIWtRFBAx88DBC/TU6saxJADP6d4RVGi96duY0o5MIgghFmhmUP hE6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MnIIAI5p; 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 t4si4503845ybc.118.2021.02.03.18.56.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:56:40 -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=MnIIAI5p; 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]:56212 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7Uox-0004fL-Nn for patch@linaro.org; Wed, 03 Feb 2021 21:56:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47440) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7TuL-0002p3-Ce for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:58:09 -0500 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]:44922) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7TuG-0007RD-6Q for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:58:09 -0500 Received: by mail-pl1-x62c.google.com with SMTP id j11so885957plt.11 for ; Wed, 03 Feb 2021 17:58:03 -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=4GLVuYuzRltqq/bjvGdZN73wsp3XyCbMAEbRMKz6MNY=; b=MnIIAI5pnmV6tk2iCnT7Y4fgypEX0tVEnLQAz2tpTWXchBQCECxc9iYleit+ugT6DH o4M3KI13ypjC+xsQEW5XZDKSpjbX3PRXEMJMz/IPxFW3AB6gFnAkx2HqxvRDVeeCqOpb BO5zc7YIr90Nn5OIHfkesWuBAwYYam5yNAvKwbAKyUdmqzSoOJQF0TvlfweumjO1MzQk gQcxZguTZRsezN+sAWV4TKFiAEUcynzpx2Yj97Tdf8f462+Y9iO+bjlQfUY0wVGiozfA MeaYVIWFomHuXbBTal/xoThUXEjlHhRZCtDIt6ucSA4DfbnrM847WtU/oApCqP6OQy6G aofQ== 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=4GLVuYuzRltqq/bjvGdZN73wsp3XyCbMAEbRMKz6MNY=; b=BmSPpF18HJNf1YnETtLj69dv5vjTdKx0YQL/aYq6AJwU0LunW1AX5YSfHTi6ZOoYdf AuvS3lZtX27oTiHcqAWl+eXMeNH6ZOnlfS5eKVUdYMOxVwy7fNJfR+2MADPbe2X/qivR kuxwNTML4oWQxLUmfBqjQk2XTMxhijZJ5Wr/aUc4zqaJqX86kneA26Cr+U5EdSQYDc3U SuGLw39J5ROfW07nrjQpXM3N8jPWYYb1fHVM0k25VBPfcKUfK+9fWPjJUIXxM/60YNs5 MIThHtkD7ZtkSExnDThIOae17l6PwPrrrpII2HYU4ejDKSa+kZAN5Y9BLQqJkXpoRF4D 6Y+g== X-Gm-Message-State: AOAM530ub8jaHdjOt+XplzE0zpvFc0PQEcJhkJYzOLCwoTM1RCoy6wxy OrnBI0HMZXIWF8NzcnTyVx+iRZzDltrR5lW4 X-Received: by 2002:a17:902:9044:b029:df:fa69:1ed1 with SMTP id w4-20020a1709029044b02900dffa691ed1mr5799437plz.11.1612403882560; Wed, 03 Feb 2021 17:58:02 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id bv21sm3356011pjb.15.2021.02.03.17.58.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:58:02 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 90/93] tcg/tci: Implement extract, sextract Date: Wed, 3 Feb 2021 15:57:59 -1000 Message-Id: <20210204015759.885814-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-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: , Cc: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- tcg/tci/tcg-target.h | 8 ++++---- tcg/tci.c | 42 ++++++++++++++++++++++++++++++++++++++++ tcg/tci/tcg-target.c.inc | 32 ++++++++++++++++++++++++++++++ 3 files changed, 78 insertions(+), 4 deletions(-) -- 2.25.1 diff --git a/tcg/tci/tcg-target.h b/tcg/tci/tcg-target.h index 5945272a43..60b67b196b 100644 --- a/tcg/tci/tcg-target.h +++ b/tcg/tci/tcg-target.h @@ -69,8 +69,8 @@ #define TCG_TARGET_HAS_ext16u_i32 1 #define TCG_TARGET_HAS_andc_i32 1 #define TCG_TARGET_HAS_deposit_i32 1 -#define TCG_TARGET_HAS_extract_i32 0 -#define TCG_TARGET_HAS_sextract_i32 0 +#define TCG_TARGET_HAS_extract_i32 1 +#define TCG_TARGET_HAS_sextract_i32 1 #define TCG_TARGET_HAS_extract2_i32 0 #define TCG_TARGET_HAS_eqv_i32 1 #define TCG_TARGET_HAS_nand_i32 1 @@ -97,8 +97,8 @@ #define TCG_TARGET_HAS_bswap32_i64 1 #define TCG_TARGET_HAS_bswap64_i64 1 #define TCG_TARGET_HAS_deposit_i64 1 -#define TCG_TARGET_HAS_extract_i64 0 -#define TCG_TARGET_HAS_sextract_i64 0 +#define TCG_TARGET_HAS_extract_i64 1 +#define TCG_TARGET_HAS_sextract_i64 1 #define TCG_TARGET_HAS_extract2_i64 0 #define TCG_TARGET_HAS_div_i64 1 #define TCG_TARGET_HAS_rem_i64 1 diff --git a/tcg/tci.c b/tcg/tci.c index 9c17947e6b..831a3bb97e 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -122,6 +122,15 @@ static void tci_args_rrs(uint32_t insn, TCGReg *r0, TCGReg *r1, int32_t *i2) *i2 = sextract32(insn, 16, 16); } +static void tci_args_rrbb(uint32_t insn, TCGReg *r0, TCGReg *r1, + uint8_t *i2, uint8_t *i3) +{ + *r0 = extract32(insn, 8, 4); + *r1 = extract32(insn, 12, 4); + *i2 = extract32(insn, 16, 6); + *i3 = extract32(insn, 22, 6); +} + static void tci_args_rrrc(uint32_t insn, TCGReg *r0, TCGReg *r1, TCGReg *r2, TCGCond *c3) { @@ -619,6 +628,18 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, tci_args_rrrbb(insn, &r0, &r1, &r2, &pos, &len); regs[r0] = deposit32(regs[r1], pos, len, regs[r2]); break; +#endif +#if TCG_TARGET_HAS_extract_i32 + case INDEX_op_extract_i32: + tci_args_rrbb(insn, &r0, &r1, &pos, &len); + regs[r0] = extract32(regs[r1], pos, len); + break; +#endif +#if TCG_TARGET_HAS_sextract_i32 + case INDEX_op_sextract_i32: + tci_args_rrbb(insn, &r0, &r1, &pos, &len); + regs[r0] = sextract32(regs[r1], pos, len); + break; #endif case INDEX_op_brcond_i32: tci_args_rl(insn, tb_ptr, &r0, &ptr); @@ -759,6 +780,18 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, tci_args_rrrbb(insn, &r0, &r1, &r2, &pos, &len); regs[r0] = deposit64(regs[r1], pos, len, regs[r2]); break; +#endif +#if TCG_TARGET_HAS_extract_i64 + case INDEX_op_extract_i64: + tci_args_rrbb(insn, &r0, &r1, &pos, &len); + regs[r0] = extract64(regs[r1], pos, len); + break; +#endif +#if TCG_TARGET_HAS_sextract_i64 + case INDEX_op_sextract_i64: + tci_args_rrbb(insn, &r0, &r1, &pos, &len); + regs[r0] = sextract64(regs[r1], pos, len); + break; #endif case INDEX_op_brcond_i64: tci_args_rl(insn, tb_ptr, &r0, &ptr); @@ -1200,6 +1233,15 @@ int print_insn_tci(bfd_vma addr, disassemble_info *info) op_name, str_r(r0), str_r(r1), str_r(r2), pos, len); break; + case INDEX_op_extract_i32: + case INDEX_op_extract_i64: + case INDEX_op_sextract_i32: + case INDEX_op_sextract_i64: + tci_args_rrbb(insn, &r0, &r1, &pos, &len); + info->fprintf_func(info->stream, "%-12s %s,%s,%d,%d", + op_name, str_r(r0), str_r(r1), pos, len); + break; + case INDEX_op_movcond_i32: case INDEX_op_movcond_i64: case INDEX_op_setcond2_i32: diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index a0c458a60a..cedd0328df 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -63,6 +63,10 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) case INDEX_op_bswap32_i32: case INDEX_op_bswap32_i64: case INDEX_op_bswap64_i64: + case INDEX_op_extract_i32: + case INDEX_op_extract_i64: + case INDEX_op_sextract_i32: + case INDEX_op_sextract_i64: return C_O1_I1(r, r); case INDEX_op_st8_i32: @@ -352,6 +356,21 @@ static void tcg_out_op_rrs(TCGContext *s, TCGOpcode op, tcg_out32(s, insn); } +static void tcg_out_op_rrbb(TCGContext *s, TCGOpcode op, TCGReg r0, + TCGReg r1, uint8_t b2, uint8_t b3) +{ + tcg_insn_unit insn = 0; + + tcg_debug_assert(b2 == extract32(b2, 0, 6)); + tcg_debug_assert(b3 == extract32(b3, 0, 6)); + insn = deposit32(insn, 0, 8, op); + insn = deposit32(insn, 8, 4, r0); + insn = deposit32(insn, 12, 4, r1); + insn = deposit32(insn, 16, 6, b2); + insn = deposit32(insn, 22, 6, b3); + tcg_out32(s, insn); +} + static void tcg_out_op_rrrc(TCGContext *s, TCGOpcode op, TCGReg r0, TCGReg r1, TCGReg r2, TCGCond c3) { @@ -653,6 +672,19 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, } break; + CASE_32_64(extract) /* Optional (TCG_TARGET_HAS_extract_*). */ + CASE_32_64(sextract) /* Optional (TCG_TARGET_HAS_sextract_*). */ + { + TCGArg pos = args[2], len = args[3]; + TCGArg max = tcg_op_defs[opc].flags & TCG_OPF_64BIT ? 64 : 32; + + tcg_debug_assert(pos < max); + tcg_debug_assert(pos + len <= max); + + tcg_out_op_rrbb(s, opc, args[0], args[1], pos, len); + } + break; + CASE_32_64(brcond) tcg_out_op_rrrc(s, (opc == INDEX_op_brcond_i32 ? INDEX_op_setcond_i32 : INDEX_op_setcond_i64), From patchwork Thu Feb 4 01:58:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376233 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp870508jah; Wed, 3 Feb 2021 18:58:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJzOzCQsnYRSvHzMLMv6m3ZO7su3NKNZ+FPgzMDe+UK5F+YmFfB4sRP7lAyqrvhBnbP+wRmr X-Received: by 2002:a25:9105:: with SMTP id v5mr8577819ybl.249.1612407527503; Wed, 03 Feb 2021 18:58:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612407527; cv=none; d=google.com; s=arc-20160816; b=apjm2mGmKuoGS9Y9lBUcWnrLFALYFquTq1NzZ2wSyTourACNcQm/ikQYRkhE5/1+LM UokcRLpxJCeJOIMe5/br4m92fxdYBD9T3A5Pc1t70Jw+K2hclrkENyo1H4tDUTi0xqAH 6TU1poM9OMoDaTQXsxBW3tbuIHyMhN2r+d10aBCVaStaWwDPCZFl7SplIvRsL0xNYuci I56u+WRJsprCOVQJMdyjdML4+3f7JylHJUeVUZ4hZ0+dYIsytueQ34qTPyRl57/BmL8v Ey1Ej9G7NIhPysmtjt7BrE41SzaEc0MVDvjsW+ABtbSiMsvSPsDAhAm75qWg3tZBX1JD 061w== 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=zC7cx17hOYUAEREQgXQZ1f4JD2Nj5hKyL6MHd/Exkho=; b=g0erXb4fTqgMT//gwyItkPLKNrOFHqSMqxXO2k9PGmgYYtwrYISERjcioC6R+YkALV 3IGoteMhHrILgJGdt8smdzwyD+2HOqrWzcD3gKfr3sYtVPvL5paVoyWPDnIam3eLjo78 jyzOcyub49k2sQO0phQ6erK+hPmZwZ3Kw4/K5Mtf/Iems6vpaNT2zLocNJ6D4uMt83BX CabsGWFBSeFoYu0K96PY3lpyHmiDh+6RTxKbFFuATGtrH5NONkeYzTpIzGZMn9MVsYpp 0DhoohgXZ7+Eu42xlCaiS0fuVUjfxwlhk1YLWZeLrhDn0N7rLEkY6oYCJaRPsDuQbZ83 Rrfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="x5/j2Muk"; 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 y126si4082301yba.489.2021.02.03.18.58.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:58:47 -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="x5/j2Muk"; 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]:36328 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7Ur0-00086h-S5 for patch@linaro.org; Wed, 03 Feb 2021 21:58:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47504) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Tuj-00034u-Pn for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:58:33 -0500 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]:42843) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7TuY-0007W6-Rt for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:58:30 -0500 Received: by mail-pg1-x52e.google.com with SMTP id g15so1034395pgu.9 for ; Wed, 03 Feb 2021 17:58:21 -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=zC7cx17hOYUAEREQgXQZ1f4JD2Nj5hKyL6MHd/Exkho=; b=x5/j2Muk5Ze5zVjyLllW+2Sg3qZ8ev5Xa4sM179ajxsn6UI+VK+K12HKuTusS0Bubd v/bA/dLtnULjHP/8rLRfp2rbes6XtdciEVU6xVSdsdEQ6WP1OnafZrsSficyzmQDx4fS OYic5sxLyDXG0uDdnL6uuzDigG7ObMM2sczbARnsC6XNwSduP2nvShypVUHs9mhXD3MD fa7O9NMpL2AOdmlpT3z47FXiUcWlFYceZ/srciIJdMdDLL+DEw6B5yiQlj3Y8Y54CwZh yKGefGG9U07Ej6tUxhV2YmNZYHa1W3aVB9W4YBe91ShlZS1ErIb1k1EAPpdxFIlLzKp1 bTnA== 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=zC7cx17hOYUAEREQgXQZ1f4JD2Nj5hKyL6MHd/Exkho=; b=mhR6FltV7biFkTCoMZDT9vEd2d/98+pG+lRczIf5KFfp5gMZtuy5gKQMU1fwclHdGo LnIejmp9hZH+vEY8tFY8GUSLVrbxtrHFp+ShfLX9QgccKcuMJT1/t0e9t8sw3utNngaT Ecq+ikL0q9fpERY8JGiaCeWLumejjTdMFM1RnnRMHhQR84xLX7xgDz6HPZXpMZu+vwVy ZX6fheBeuquTSbmwj5RHuhyMg/5ED9CiYXqF6yTfY9OKWWqsr8lIka1nqUccvHsu/nHb Cprw3o0KXs1CpCOkLMRRfyQ2TI8Q4uPlLoUQbIq0i0u1dp490d+YFvaYk1Yl/TOTuZm/ PcPw== X-Gm-Message-State: AOAM533ktfdBm2XSf+6z7Kd/7mfKp7kSp7xHaN9YwG3TbzhfYPSc2cAA Ewy+jyqeXwjtToYvVK/Yc27T7VLpsL/eAeN+ X-Received: by 2002:a62:ea17:0:b029:1ad:4788:7815 with SMTP id t23-20020a62ea170000b02901ad47887815mr5898345pfh.1.1612403900897; Wed, 03 Feb 2021 17:58:20 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id w184sm4321133pgb.71.2021.02.03.17.58.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:58:20 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 91/93] tcg/tci: Implement clz, ctz, ctpop Date: Wed, 3 Feb 2021 15:58:18 -1000 Message-Id: <20210204015818.885876-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52e; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52e.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- tcg/tci/tcg-target.h | 12 +++++------ tcg/tci.c | 44 ++++++++++++++++++++++++++++++++++++++++ tcg/tci/tcg-target.c.inc | 9 ++++++++ 3 files changed, 59 insertions(+), 6 deletions(-) -- 2.25.1 diff --git a/tcg/tci/tcg-target.h b/tcg/tci/tcg-target.h index 60b67b196b..59859bd8a6 100644 --- a/tcg/tci/tcg-target.h +++ b/tcg/tci/tcg-target.h @@ -75,9 +75,9 @@ #define TCG_TARGET_HAS_eqv_i32 1 #define TCG_TARGET_HAS_nand_i32 1 #define TCG_TARGET_HAS_nor_i32 1 -#define TCG_TARGET_HAS_clz_i32 0 -#define TCG_TARGET_HAS_ctz_i32 0 -#define TCG_TARGET_HAS_ctpop_i32 0 +#define TCG_TARGET_HAS_clz_i32 1 +#define TCG_TARGET_HAS_ctz_i32 1 +#define TCG_TARGET_HAS_ctpop_i32 1 #define TCG_TARGET_HAS_neg_i32 1 #define TCG_TARGET_HAS_not_i32 1 #define TCG_TARGET_HAS_orc_i32 1 @@ -112,9 +112,9 @@ #define TCG_TARGET_HAS_eqv_i64 1 #define TCG_TARGET_HAS_nand_i64 1 #define TCG_TARGET_HAS_nor_i64 1 -#define TCG_TARGET_HAS_clz_i64 0 -#define TCG_TARGET_HAS_ctz_i64 0 -#define TCG_TARGET_HAS_ctpop_i64 0 +#define TCG_TARGET_HAS_clz_i64 1 +#define TCG_TARGET_HAS_ctz_i64 1 +#define TCG_TARGET_HAS_ctpop_i64 1 #define TCG_TARGET_HAS_neg_i64 1 #define TCG_TARGET_HAS_not_i64 1 #define TCG_TARGET_HAS_orc_i64 1 diff --git a/tcg/tci.c b/tcg/tci.c index 831a3bb97e..35f2c4bfbb 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -598,6 +598,26 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, tci_args_rrr(insn, &r0, &r1, &r2); regs[r0] = (uint32_t)regs[r1] % (uint32_t)regs[r2]; break; +#if TCG_TARGET_HAS_clz_i32 + case INDEX_op_clz_i32: + tci_args_rrr(insn, &r0, &r1, &r2); + tmp32 = regs[r1]; + regs[r0] = tmp32 ? clz32(tmp32) : regs[r2]; + break; +#endif +#if TCG_TARGET_HAS_ctz_i32 + case INDEX_op_ctz_i32: + tci_args_rrr(insn, &r0, &r1, &r2); + tmp32 = regs[r1]; + regs[r0] = tmp32 ? ctz32(tmp32) : regs[r2]; + break; +#endif +#if TCG_TARGET_HAS_ctpop_i32 + case INDEX_op_ctpop_i32: + tci_args_rr(insn, &r0, &r1); + regs[r0] = ctpop32(regs[r1]); + break; +#endif /* Shift/rotate operations (32 bit). */ @@ -750,6 +770,24 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, tci_args_rrr(insn, &r0, &r1, &r2); regs[r0] = (uint64_t)regs[r1] % (uint64_t)regs[r2]; break; +#if TCG_TARGET_HAS_clz_i64 + case INDEX_op_clz_i64: + tci_args_rrr(insn, &r0, &r1, &r2); + regs[r0] = regs[r1] ? clz64(regs[r1]) : regs[r2]; + break; +#endif +#if TCG_TARGET_HAS_ctz_i64 + case INDEX_op_ctz_i64: + tci_args_rrr(insn, &r0, &r1, &r2); + regs[r0] = regs[r1] ? ctz64(regs[r1]) : regs[r2]; + break; +#endif +#if TCG_TARGET_HAS_ctpop_i64 + case INDEX_op_ctpop_i64: + tci_args_rr(insn, &r0, &r1); + regs[r0] = ctpop64(regs[r1]); + break; +#endif /* Shift/rotate operations (64 bit). */ @@ -1176,6 +1214,8 @@ int print_insn_tci(bfd_vma addr, disassemble_info *info) case INDEX_op_not_i64: case INDEX_op_neg_i32: case INDEX_op_neg_i64: + case INDEX_op_ctpop_i32: + case INDEX_op_ctpop_i64: tci_args_rr(insn, &r0, &r1); info->fprintf_func(info->stream, "%-12s %s,%s", op_name, str_r(r0), str_r(r1)); @@ -1221,6 +1261,10 @@ int print_insn_tci(bfd_vma addr, disassemble_info *info) case INDEX_op_rotl_i64: case INDEX_op_rotr_i32: case INDEX_op_rotr_i64: + case INDEX_op_clz_i32: + case INDEX_op_clz_i64: + case INDEX_op_ctz_i32: + case INDEX_op_ctz_i64: tci_args_rrr(insn, &r0, &r1, &r2); info->fprintf_func(info->stream, "%-12s %s,%s,%s", op_name, str_r(r0), str_r(r1), str_r(r2)); diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index cedd0328df..664d715440 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -67,6 +67,8 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) case INDEX_op_extract_i64: case INDEX_op_sextract_i32: case INDEX_op_sextract_i64: + case INDEX_op_ctpop_i32: + case INDEX_op_ctpop_i64: return C_O1_I1(r, r); case INDEX_op_st8_i32: @@ -122,6 +124,10 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) case INDEX_op_setcond_i64: case INDEX_op_deposit_i32: case INDEX_op_deposit_i64: + case INDEX_op_clz_i32: + case INDEX_op_clz_i64: + case INDEX_op_ctz_i32: + case INDEX_op_ctz_i64: return C_O1_I2(r, r, r); case INDEX_op_brcond_i32: @@ -657,6 +663,8 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, CASE_32_64(divu) /* Optional (TCG_TARGET_HAS_div_*). */ CASE_32_64(rem) /* Optional (TCG_TARGET_HAS_div_*). */ CASE_32_64(remu) /* Optional (TCG_TARGET_HAS_div_*). */ + CASE_32_64(clz) /* Optional (TCG_TARGET_HAS_clz_*). */ + CASE_32_64(ctz) /* Optional (TCG_TARGET_HAS_ctz_*). */ tcg_out_op_rrr(s, opc, args[0], args[1], args[2]); break; @@ -705,6 +713,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, CASE_32_64(bswap16) /* Optional (TCG_TARGET_HAS_bswap16_*). */ CASE_32_64(bswap32) /* Optional (TCG_TARGET_HAS_bswap32_*). */ CASE_64(bswap64) /* Optional (TCG_TARGET_HAS_bswap64_i64). */ + CASE_32_64(ctpop) /* Optional (TCG_TARGET_HAS_ctpop_*). */ tcg_out_op_rr(s, opc, args[0], args[1]); break; From patchwork Thu Feb 4 01:58:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376235 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp872390jah; Wed, 3 Feb 2021 19:01:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJwMT0A9jgWBC/OymaSoKmd6vQVfVJ4Ag8SXpXhsJG+v3fLOy9r/rh8rM8EZpeh7sZQJBXKf X-Received: by 2002:a25:bec2:: with SMTP id k2mr9075471ybm.42.1612407705715; Wed, 03 Feb 2021 19:01:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612407705; cv=none; d=google.com; s=arc-20160816; b=aKBLAIBoE+BNKogeUw6OqkmeN50SaDLnkAr3NYv23Rt3YeVzwAaQfNYnxehw7AEMs3 iAHyOJEcJyVAxE6fpgmGRtmjcWl4OUrOFNU0Vj7wyBCcn571JPh4de5nKGE/zuj82HN9 I8IsMQEh4a5nXegCi7Wg4o9nsRbL1ZV96UnMWapmUSIo85wXkQl28HTEHxzSjpgI7WvY kU5u9US/rgZsZQfKByVLe2l+sbWL0CIaPjopO9bHsRpU05GlA410FcPoocbaysHJLwEp mHLjQB8Sh3n3GoCiqqOy4imKCNRu1CRKYrM/SORYDY2n9jNvMFGU/R7Xd4VFApwa1yNm efJw== 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=K7frB2t4HRQY2QCd4vmgctpTB+qUKaU+sWJuOgxV4RM=; b=OUnf9CywE8ofC/DntJIf79lMPJRW78bbOmWEefM1usBkxF3NJL6SavYTXtgoNcpUBd bqtHY0wQdJHghYtFT14VoaUs2qRoUmsxA4TxgCD6nCczb0OivzZGPab2qGuLepRn2HbJ AdOI0sXtbDqrb9wCBnvjexCS0CU460l8qBUQ9C1U/w43OWz/MBvsL3BJ84B216FIuxua fCaaEbCS237H5U9zeIBbo274efwVpGn3tcI46hdHYpOgLa71AoQnOZyrJkjXsT315HXz Ufk4g888nYWf7VG32USDRkEipX6CwNwnJcgnWuCzztR873t37h0CB//aomBhiiKh6Mkq ffzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=L3peDv4H; 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 j13si3751116ybh.229.2021.02.03.19.01.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 19:01:45 -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=L3peDv4H; 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]:44948 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7Utt-0003Kx-4P for patch@linaro.org; Wed, 03 Feb 2021 22:01:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47542) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Tuy-0003V1-JN for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:58:48 -0500 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]:40669) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Tuq-0007Zl-RF for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:58:48 -0500 Received: by mail-pg1-x533.google.com with SMTP id b21so1045395pgk.7 for ; Wed, 03 Feb 2021 17:58:40 -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=K7frB2t4HRQY2QCd4vmgctpTB+qUKaU+sWJuOgxV4RM=; b=L3peDv4H7aEltwWOcPCZ8688ephTfrKHliYyspBi2HozLSZ6Em/Pje8JSVzMXqZlt9 riTF+c1w7ROp1fGEV4ITqXTONZXsm4p+2DWUMNsb8YKV8u6TmEbDTXFJ01ouGFIJdSvL RFrhAgMjFeNXO7xvyq54aDtya1dVVTj4CRRBT/hOqer0IwOH39D4R6T5Ec9v8IyBWati OIRG/RQ1L2PIUa0SFhUVzFXggQOwnleyYvjzxHbzxNoYvJ76ZN+4tWQ6gbu8odJJSEgg 5FM+N00GP7oFtCmBtXKd6JnqlzCfvQRYCvGKgoDUwyCfUnJNmjVKoUVZ2RTFRO254JYi unqQ== 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=K7frB2t4HRQY2QCd4vmgctpTB+qUKaU+sWJuOgxV4RM=; b=e61ajFuXPr5+dpskVxbw1KGTUWqcsJSl+PSPny7Gz1PurKce8SafQ2aYut20J5zTpt d9Hgoc3rruHejeGUS/LfdDgpppexVqey6ooaQtBzqzyaLfo6ZgjW+Anl1DF2uv3RkvN1 85Wqtfj85mnRDt83yLawE0tpa+EfQm3VU5NLzB6S28l59UqnYgQyrACftUxHM1LRhhfq y5DI8YKiMQ18lknbkG2WSHO5J7znaChCTu+tz/SRHzEjVUpw3S0J2F5u6zU53+qB36nH /Am0e/fcYBD2Q6ZxYO5MKweBWnD8qwj3frzM6vCDouAg+WgdV1ydYjypH/bSJBahc1Dc Od4A== X-Gm-Message-State: AOAM530IW1Gttmbz/IeGA3KNDZ1Fc3dzJ5+ET9nuSqzLHz/cfPFkGI2s b3GmwvSoPMblQeOo1yhYo1ze79ntsoCpQPMa X-Received: by 2002:a63:d143:: with SMTP id c3mr6826866pgj.86.1612403919564; Wed, 03 Feb 2021 17:58:39 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id x17sm3562973pff.180.2021.02.03.17.58.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:58:38 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 92/93] tcg/tci: Implement mulu2, muls2 Date: Wed, 3 Feb 2021 15:58:36 -1000 Message-Id: <20210204015836.885930-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::533; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x533.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We already had mulu2_i32 for a 32-bit host; expand this to 64-bit hosts as well. The muls2_i32 and the 64-bit opcodes are new. Signed-off-by: Richard Henderson --- tcg/tci/tcg-target.h | 8 ++++---- tcg/tci.c | 35 +++++++++++++++++++++++++++++------ tcg/tci/tcg-target.c.inc | 16 ++++++++++------ 3 files changed, 43 insertions(+), 16 deletions(-) -- 2.25.1 diff --git a/tcg/tci/tcg-target.h b/tcg/tci/tcg-target.h index 59859bd8a6..71a44bbfb0 100644 --- a/tcg/tci/tcg-target.h +++ b/tcg/tci/tcg-target.h @@ -83,7 +83,7 @@ #define TCG_TARGET_HAS_orc_i32 1 #define TCG_TARGET_HAS_rot_i32 1 #define TCG_TARGET_HAS_movcond_i32 1 -#define TCG_TARGET_HAS_muls2_i32 0 +#define TCG_TARGET_HAS_muls2_i32 1 #define TCG_TARGET_HAS_muluh_i32 0 #define TCG_TARGET_HAS_mulsh_i32 0 #define TCG_TARGET_HAS_goto_ptr 1 @@ -120,13 +120,13 @@ #define TCG_TARGET_HAS_orc_i64 1 #define TCG_TARGET_HAS_rot_i64 1 #define TCG_TARGET_HAS_movcond_i64 1 -#define TCG_TARGET_HAS_muls2_i64 0 +#define TCG_TARGET_HAS_muls2_i64 1 #define TCG_TARGET_HAS_add2_i32 0 #define TCG_TARGET_HAS_sub2_i32 0 -#define TCG_TARGET_HAS_mulu2_i32 0 +#define TCG_TARGET_HAS_mulu2_i32 1 #define TCG_TARGET_HAS_add2_i64 0 #define TCG_TARGET_HAS_sub2_i64 0 -#define TCG_TARGET_HAS_mulu2_i64 0 +#define TCG_TARGET_HAS_mulu2_i64 1 #define TCG_TARGET_HAS_muluh_i64 0 #define TCG_TARGET_HAS_mulsh_i64 0 #else diff --git a/tcg/tci.c b/tcg/tci.c index 35f2c4bfbb..5d83b2d957 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -39,7 +39,7 @@ __thread uintptr_t tci_tb_ptr; static void tci_write_reg64(tcg_target_ulong *regs, uint32_t high_index, uint32_t low_index, uint64_t value) { - regs[low_index] = value; + regs[low_index] = (uint32_t)value; regs[high_index] = value >> 32; } @@ -169,7 +169,6 @@ static void tci_args_rrrrr(uint32_t insn, TCGReg *r0, TCGReg *r1, *r4 = extract32(insn, 24, 4); } -#if TCG_TARGET_REG_BITS == 32 static void tci_args_rrrr(uint32_t insn, TCGReg *r0, TCGReg *r1, TCGReg *r2, TCGReg *r3) { @@ -178,7 +177,6 @@ static void tci_args_rrrr(uint32_t insn, *r2 = extract32(insn, 16, 4); *r3 = extract32(insn, 20, 4); } -#endif static void tci_args_rrrrrc(uint32_t insn, TCGReg *r0, TCGReg *r1, TCGReg *r2, TCGReg *r3, TCGReg *r4, TCGCond *c5) @@ -680,11 +678,21 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, T2 = tci_uint64(regs[r5], regs[r4]); tci_write_reg64(regs, r1, r0, T1 - T2); break; +#endif /* TCG_TARGET_REG_BITS == 32 */ +#if TCG_TARGET_HAS_mulu2_i32 case INDEX_op_mulu2_i32: tci_args_rrrr(insn, &r0, &r1, &r2, &r3); - tci_write_reg64(regs, r1, r0, (uint64_t)regs[r2] * regs[r3]); + tmp64 = (uint64_t)(uint32_t)regs[r2] * (uint32_t)regs[r3]; + tci_write_reg64(regs, r1, r0, tmp64); break; -#endif /* TCG_TARGET_REG_BITS == 32 */ +#endif +#if TCG_TARGET_HAS_muls2_i32 + case INDEX_op_muls2_i32: + tci_args_rrrr(insn, &r0, &r1, &r2, &r3); + tmp64 = (int64_t)(int32_t)regs[r2] * (int32_t)regs[r3]; + tci_write_reg64(regs, r1, r0, tmp64); + break; +#endif #if TCG_TARGET_HAS_ext8s_i32 || TCG_TARGET_HAS_ext8s_i64 CASE_32_64(ext8s) tci_args_rr(insn, &r0, &r1); @@ -788,6 +796,18 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, regs[r0] = ctpop64(regs[r1]); break; #endif +#if TCG_TARGET_HAS_mulu2_i64 + case INDEX_op_mulu2_i64: + tci_args_rrrr(insn, &r0, &r1, &r2, &r3); + mulu64(®s[r0], ®s[r1], regs[r2], regs[r3]); + break; +#endif +#if TCG_TARGET_HAS_muls2_i64 + case INDEX_op_muls2_i64: + tci_args_rrrr(insn, &r0, &r1, &r2, &r3); + muls64(®s[r0], ®s[r1], regs[r2], regs[r3]); + break; +#endif /* Shift/rotate operations (64 bit). */ @@ -1295,14 +1315,17 @@ int print_insn_tci(bfd_vma addr, disassemble_info *info) str_r(r3), str_r(r4), str_c(c)); break; -#if TCG_TARGET_REG_BITS == 32 case INDEX_op_mulu2_i32: + case INDEX_op_mulu2_i64: + case INDEX_op_muls2_i32: + case INDEX_op_muls2_i64: tci_args_rrrr(insn, &r0, &r1, &r2, &r3); info->fprintf_func(info->stream, "%-12s %s,%s,%s,%s", op_name, str_r(r0), str_r(r1), str_r(r2), str_r(r3)); break; +#if TCG_TARGET_REG_BITS == 32 case INDEX_op_add2_i32: case INDEX_op_sub2_i32: tci_args_rrrrrr(insn, &r0, &r1, &r2, &r3, &r4, &r5); diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index 664d715440..eb48633fba 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -141,10 +141,14 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) return C_O2_I4(r, r, r, r, r, r); case INDEX_op_brcond2_i32: return C_O0_I4(r, r, r, r); - case INDEX_op_mulu2_i32: - return C_O2_I2(r, r, r, r); #endif + case INDEX_op_mulu2_i32: + case INDEX_op_mulu2_i64: + case INDEX_op_muls2_i32: + case INDEX_op_muls2_i64: + return C_O2_I2(r, r, r, r); + case INDEX_op_movcond_i32: case INDEX_op_movcond_i64: case INDEX_op_setcond2_i32: @@ -434,7 +438,6 @@ static void tcg_out_op_rrrrr(TCGContext *s, TCGOpcode op, TCGReg r0, tcg_out32(s, insn); } -#if TCG_TARGET_REG_BITS == 32 static void tcg_out_op_rrrr(TCGContext *s, TCGOpcode op, TCGReg r0, TCGReg r1, TCGReg r2, TCGReg r3) { @@ -447,7 +450,6 @@ static void tcg_out_op_rrrr(TCGContext *s, TCGOpcode op, insn = deposit32(insn, 20, 4, r3); tcg_out32(s, insn); } -#endif static void tcg_out_op_rrrrrc(TCGContext *s, TCGOpcode op, TCGReg r0, TCGReg r1, TCGReg r2, @@ -728,10 +730,12 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, args[0], args[1], args[2], args[3], args[4]); tcg_out_op_rl(s, INDEX_op_brcond_i32, TCG_REG_TMP, arg_label(args[5])); break; - case INDEX_op_mulu2_i32: +#endif + + CASE_32_64(mulu2) + CASE_32_64(muls2) tcg_out_op_rrrr(s, opc, args[0], args[1], args[2], args[3]); break; -#endif case INDEX_op_qemu_ld_i32: case INDEX_op_qemu_st_i32: From patchwork Thu Feb 4 01:58:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376227 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp869315jah; Wed, 3 Feb 2021 18:55:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJy3Vpz4IVoINuV+ozZOcTUH91JHwjTrpx8Y40R6B3Nqpw1hHuE/JRttwsiNLA6CzSWuUJh+ X-Received: by 2002:a25:f07:: with SMTP id 7mr9033506ybp.399.1612407358784; Wed, 03 Feb 2021 18:55:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612407358; cv=none; d=google.com; s=arc-20160816; b=k4uazCI22aA5Nrm+Q5alVFJkbYxcAUTwTJ5z7Q5+0RtP0Fou7Vd/xIHs1miNWcLijQ nev3Qz5NZLSrrZfaMIjrY4n9aLM95/NkZV9+XJBomOd8fEJ/6I3J4F6ScYMv1Ye1eA/y 23NogTd9bXrr3gYldS8ZFdanrflRaTDLrAHehy+AwictikfE7AFMua6M+IVN1IRzG1Lv A2n2agsliy/N7l9NwGv1wwAvtwCmo/OeTiTFHJlgNxZkGh8sbA1KT1pid/V+q9OCOFiP pHJc30lZN5HSYQftzl+YpSFkxsjzRWP/5kHMa3mIR6NRZ2/HsoWufQ2fs5vKz6/iu7Vj HopA== 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=Ykwqi1nfU63kykOjWC2hHHptQCv8OjjZ7CWKjmVZrJc=; b=S4fOp282SqogYjXOnSvlxNcsE1z0RFGL9SojB0lQROUsQeCLUWFt6sGKVVSwuLypWo mzgXrYEJpKb3lLv/8RE9JoysMpqULSpHCxmnNboMAV6jPCmMbAVupyhW2XHG0QYOy7Sl wRSZY7LTslUZ+wMdQ6KB/7xogtFjJ0QJYDWdZBe6omJWIZHGCdIcaXTxYWDiN03q4Y7w czuWttq1xETU7mVyua1CkTXiVFj1YhN/ddYhA8818UakQXTTPdZo84v7/BXZW6SCXD+u 12kYkZv9FhTHSuud0+4gcZq95/TAIh7sSreHSdVSKHH65SPvdAUdb6wwO6qCtqfPPuuE s/4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EyzgyV3q; 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 m65si4380862ybc.55.2021.02.03.18.55.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:55:58 -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=EyzgyV3q; 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]:53554 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7UoI-0003TI-84 for patch@linaro.org; Wed, 03 Feb 2021 21:55:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47592) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7TvJ-0003q6-KG for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:59:09 -0500 Received: from mail-pg1-x531.google.com ([2607:f8b0:4864:20::531]:37017) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7TvD-0007eR-0X for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:59:09 -0500 Received: by mail-pg1-x531.google.com with SMTP id z21so1057012pgj.4 for ; Wed, 03 Feb 2021 17:58:59 -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=Ykwqi1nfU63kykOjWC2hHHptQCv8OjjZ7CWKjmVZrJc=; b=EyzgyV3qoF5b5CYIQbmuLD93bPKuzXNeVS3xOXCQkn1Xi+3YzhOuXKKNTfvZgoPy+a mXC9QfyU4zQRnUMj3KQOAJx6BsIken6AheLLg9D36E+1k0orSvPqBgBWEFxCPZH73JVR z3wjFHq69iC/rjM3s9cKNvCEqAvRL6XzMg40qJL1Ebje3CGgWpG8wCY26p15jxuB8enU /wGVyijULMPE8ZcQ2dMJ5mTykiFggdSw8ETboSk3sUWw2B7LyitXO3c2iQqDf8uCMkJO eBbXsKlL7K9kAe8oeVgeZmBUsr1Wk1VytEBM9boYHRjBenZpaSeKgVrdLVGdkT+9GsIi EK5A== 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=Ykwqi1nfU63kykOjWC2hHHptQCv8OjjZ7CWKjmVZrJc=; b=sGx5vTfeZkLcWFIC1qizfOcODlt7ZMPdqhEnQD9Fyv5wkdG3zvjRLj4MXa6/Z5ZG/Q 9G5eent5K9Q7PXa0j9rGW5kjwKoIo24QWr931Mj1O22A6UeDyThsCO+C/dYgilGRDgFD g82qBBGbvqHS9QYC3qYQUWXhRJJCFizAajwGFAJWVJse5gKST1yp4YYvgrzjUJbhSKyd ivpLgYPd2hpQkEWBQBN8oPLnWEooEtY+FiApgTelhDTZEph12SStQ+i+Y/IrgKbOOyun ttqhjGVA5YkjZj1CmoRcBIBgtmnvD9yVsKTcvLNO7zr2hcRmtQIfdaVeMiKuJflYorAf O9JA== X-Gm-Message-State: AOAM531WBeJUiHt36fDvLaYqEAetnxWAIc4Gt1f8u2as25VKStpoYb6D xNvyOcv+3Ml8cutmv84lvpM+dQjAZjc8M2ju X-Received: by 2002:a63:f404:: with SMTP id g4mr6581708pgi.114.1612403938056; Wed, 03 Feb 2021 17:58:58 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id s11sm3513983pfu.69.2021.02.03.17.58.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:58:57 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 93/93] tcg/tci: Implement add2, sub2 Date: Wed, 3 Feb 2021 15:58:55 -1000 Message-Id: <20210204015855.885981-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::531; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x531.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: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We already had the 32-bit versions for a 32-bit host; expand this to 64-bit hosts as well. The 64-bit opcodes are new. Signed-off-by: Richard Henderson --- tcg/tci/tcg-target.h | 8 ++++---- tcg/tci.c | 40 ++++++++++++++++++++++++++-------------- tcg/tci/tcg-target.c.inc | 15 ++++++++------- 3 files changed, 38 insertions(+), 25 deletions(-) -- 2.25.1 diff --git a/tcg/tci/tcg-target.h b/tcg/tci/tcg-target.h index 71a44bbfb0..515b3c7a56 100644 --- a/tcg/tci/tcg-target.h +++ b/tcg/tci/tcg-target.h @@ -121,11 +121,11 @@ #define TCG_TARGET_HAS_rot_i64 1 #define TCG_TARGET_HAS_movcond_i64 1 #define TCG_TARGET_HAS_muls2_i64 1 -#define TCG_TARGET_HAS_add2_i32 0 -#define TCG_TARGET_HAS_sub2_i32 0 +#define TCG_TARGET_HAS_add2_i32 1 +#define TCG_TARGET_HAS_sub2_i32 1 #define TCG_TARGET_HAS_mulu2_i32 1 -#define TCG_TARGET_HAS_add2_i64 0 -#define TCG_TARGET_HAS_sub2_i64 0 +#define TCG_TARGET_HAS_add2_i64 1 +#define TCG_TARGET_HAS_sub2_i64 1 #define TCG_TARGET_HAS_mulu2_i64 1 #define TCG_TARGET_HAS_muluh_i64 0 #define TCG_TARGET_HAS_mulsh_i64 0 diff --git a/tcg/tci.c b/tcg/tci.c index 5d83b2d957..ee16142f48 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -189,7 +189,6 @@ static void tci_args_rrrrrc(uint32_t insn, TCGReg *r0, TCGReg *r1, *c5 = extract32(insn, 28, 4); } -#if TCG_TARGET_REG_BITS == 32 static void tci_args_rrrrrr(uint32_t insn, TCGReg *r0, TCGReg *r1, TCGReg *r2, TCGReg *r3, TCGReg *r4, TCGReg *r5) { @@ -200,7 +199,6 @@ static void tci_args_rrrrrr(uint32_t insn, TCGReg *r0, TCGReg *r1, *r4 = extract32(insn, 24, 4); *r5 = extract32(insn, 28, 4); } -#endif static bool tci_compare32(uint32_t u0, uint32_t u1, TCGCond condition) { @@ -368,17 +366,14 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, for (;;) { uint32_t insn; TCGOpcode opc; - TCGReg r0, r1, r2, r3, r4; + TCGReg r0, r1, r2, r3, r4, r5; tcg_target_ulong t1; TCGCond condition; target_ulong taddr; uint8_t pos, len; uint32_t tmp32; uint64_t tmp64; -#if TCG_TARGET_REG_BITS == 32 - TCGReg r5; uint64_t T1, T2; -#endif TCGMemOpIdx oi; int32_t ofs; void *ptr; @@ -665,20 +660,22 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, tb_ptr = ptr; } break; -#if TCG_TARGET_REG_BITS == 32 +#if TCG_TARGET_REG_BITS == 32 || TCG_TARGET_HAS_add2_i32 case INDEX_op_add2_i32: tci_args_rrrrrr(insn, &r0, &r1, &r2, &r3, &r4, &r5); T1 = tci_uint64(regs[r3], regs[r2]); T2 = tci_uint64(regs[r5], regs[r4]); tci_write_reg64(regs, r1, r0, T1 + T2); break; +#endif +#if TCG_TARGET_REG_BITS == 32 || TCG_TARGET_HAS_sub2_i32 case INDEX_op_sub2_i32: tci_args_rrrrrr(insn, &r0, &r1, &r2, &r3, &r4, &r5); T1 = tci_uint64(regs[r3], regs[r2]); T2 = tci_uint64(regs[r5], regs[r4]); tci_write_reg64(regs, r1, r0, T1 - T2); break; -#endif /* TCG_TARGET_REG_BITS == 32 */ +#endif #if TCG_TARGET_HAS_mulu2_i32 case INDEX_op_mulu2_i32: tci_args_rrrr(insn, &r0, &r1, &r2, &r3); @@ -808,6 +805,24 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, muls64(®s[r0], ®s[r1], regs[r2], regs[r3]); break; #endif +#if TCG_TARGET_HAS_add2_i64 + case INDEX_op_add2_i64: + tci_args_rrrrrr(insn, &r0, &r1, &r2, &r3, &r4, &r5); + T1 = regs[r2] + regs[r4]; + T2 = regs[r3] + regs[r5] + (T1 < regs[r2]); + regs[r0] = T1; + regs[r1] = T2; + break; +#endif +#if TCG_TARGET_HAS_add2_i64 + case INDEX_op_sub2_i64: + tci_args_rrrrrr(insn, &r0, &r1, &r2, &r3, &r4, &r5); + T1 = regs[r2] - regs[r4]; + T2 = regs[r3] - regs[r5] - (regs[r2] < regs[r4]); + regs[r0] = T1; + regs[r1] = T2; + break; +#endif /* Shift/rotate operations (64 bit). */ @@ -1124,10 +1139,7 @@ int print_insn_tci(bfd_vma addr, disassemble_info *info) const char *op_name; uint32_t insn; TCGOpcode op; - TCGReg r0, r1, r2, r3, r4; -#if TCG_TARGET_REG_BITS == 32 - TCGReg r5; -#endif + TCGReg r0, r1, r2, r3, r4, r5; tcg_target_ulong i1; int32_t s2; TCGCond c; @@ -1325,15 +1337,15 @@ int print_insn_tci(bfd_vma addr, disassemble_info *info) str_r(r2), str_r(r3)); break; -#if TCG_TARGET_REG_BITS == 32 case INDEX_op_add2_i32: + case INDEX_op_add2_i64: case INDEX_op_sub2_i32: + case INDEX_op_sub2_i64: tci_args_rrrrrr(insn, &r0, &r1, &r2, &r3, &r4, &r5); info->fprintf_func(info->stream, "%-12s %s,%s,%s,%s,%s,%s", op_name, str_r(r0), str_r(r1), str_r(r2), str_r(r3), str_r(r4), str_r(r5)); break; -#endif case INDEX_op_qemu_ld_i64: case INDEX_op_qemu_st_i64: diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index eb48633fba..9b2e2c32a1 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -134,11 +134,13 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) case INDEX_op_brcond_i64: return C_O0_I2(r, r); -#if TCG_TARGET_REG_BITS == 32 - /* TODO: Support R, R, R, R, RI, RI? Will it be faster? */ case INDEX_op_add2_i32: + case INDEX_op_add2_i64: case INDEX_op_sub2_i32: + case INDEX_op_sub2_i64: return C_O2_I4(r, r, r, r, r, r); + +#if TCG_TARGET_REG_BITS == 32 case INDEX_op_brcond2_i32: return C_O0_I4(r, r, r, r); #endif @@ -467,7 +469,6 @@ static void tcg_out_op_rrrrrc(TCGContext *s, TCGOpcode op, tcg_out32(s, insn); } -#if TCG_TARGET_REG_BITS == 32 static void tcg_out_op_rrrrrr(TCGContext *s, TCGOpcode op, TCGReg r0, TCGReg r1, TCGReg r2, TCGReg r3, TCGReg r4, TCGReg r5) @@ -483,7 +484,6 @@ static void tcg_out_op_rrrrrr(TCGContext *s, TCGOpcode op, insn = deposit32(insn, 28, 4, r5); tcg_out32(s, insn); } -#endif static void tcg_out_ldst(TCGContext *s, TCGOpcode op, TCGReg val, TCGReg base, intptr_t offset) @@ -719,12 +719,13 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, tcg_out_op_rr(s, opc, args[0], args[1]); break; -#if TCG_TARGET_REG_BITS == 32 - case INDEX_op_add2_i32: - case INDEX_op_sub2_i32: + CASE_32_64(add2) + CASE_32_64(sub2) tcg_out_op_rrrrrr(s, opc, args[0], args[1], args[2], args[3], args[4], args[5]); break; + +#if TCG_TARGET_REG_BITS == 32 case INDEX_op_brcond2_i32: tcg_out_op_rrrrrc(s, INDEX_op_setcond2_i32, TCG_REG_TMP, args[0], args[1], args[2], args[3], args[4]);