From patchwork Mon May 19 04:05:34 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 891104 Delivered-To: patch@linaro.org Received: by 2002:adf:e88a:0:b0:3a3:61c9:c5d4 with SMTP id d10csp899978wrm; Sun, 18 May 2025 21:31:48 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU+3wNjKC78vbz3Foy+0Jtf8xqiCo0n+O6bgZ1Q0pntbPEsIFhh/Ek8trWcksRFvGRbdM8qAw==@linaro.org X-Google-Smtp-Source: AGHT+IEdeXOUpoEdWeB2RV3cv2ayHboqjycZ2epbRrvWxnzPsgUmmuXRPUfrRj5lm5PuabHQXSaO X-Received: by 2002:a05:620a:424d:b0:7c5:47c6:b886 with SMTP id af79cd13be357-7cd47fc5851mr1591973785a.43.1747629108762; Sun, 18 May 2025 21:31:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1747629108; cv=none; d=google.com; s=arc-20240605; b=RLokyw+rDP0rCgOI253FscfRAqWdM6tz+CsowO8Dr29Hs1Ve6cIrgwd//gK769P0th N9KNexFsljPA6VHouIyOYdgvBXN47Y3YIsDNfwUTajREbgLxNwnmFy9eQSMI0LZoRscr nLV0IyjLQIHw+uk0DhY61Uu2sWeUQZ2Zr2y8EP/I/Ln/gXPmOLcedI91GnbSVgikYM7O wK6yrAeG3O5Ip6sb3dqbh9FW99+Lk/jlUWxubjhI/wp6J9IesodcW7YHNVlGAQWnRhbt qWCiOyz4Tjso2IbhKOrCEs0An0z8J/FoZQFeratI95iarPOcMljIgpp9zHcdzecXeDpw zCuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=Hd86zRGeQ+HNxBDexFTf6eP4HL08/wwze9zOl4z9vq0=; fh=HDQYu5lPAnkQefrBKmRl4cF3eYSeew0dhs6uIHrlDww=; b=K7lxyGb1c38IGgxIK51rH58jP1kAf+6ovJIJ2PHWvm45AVNl8tu02J3YeowERo3czu Q4zymaWmkPFoLKF7evm8twMeCfFGoQNDGvcCO+73+to+sB9YhbTCIY6KJFw/MBDkZtze whxzEPsoE4FnT89+WEqE2Q1suo9IrZ2TuthZS4LHK+sqS6wrcrSo7PZIS3L9qT+dMR7c lk5mnxxYbycYHJ006bJjwMkD0Nvvo/HKiW1VPBbK2ED+4EZUgdNu2Mr14yIYPSE3Pb8h ZFsXAP+LDk8ka8V3KroypcUvqfpfM1B4T79MtBvq2fHQ8ITSFapnB8xQQdx9lW58WpPn jpQg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=GCaIygWF; 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=QUARANTINE dis=NONE) header.from=gmail.com; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7cd467ce2f0si768835185a.18.2025.05.18.21.31.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 18 May 2025 21:31:48 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=GCaIygWF; 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=QUARANTINE dis=NONE) header.from=gmail.com; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uGs3q-0001AA-Nq; Mon, 19 May 2025 00:25:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uGroM-0007ao-1N for qemu-devel@nongnu.org; Mon, 19 May 2025 00:09:10 -0400 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uGroK-0004JV-7n for qemu-devel@nongnu.org; Mon, 19 May 2025 00:09:09 -0400 Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-231ecd4f2a5so18044905ad.0 for ; Sun, 18 May 2025 21:09:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1747627746; x=1748232546; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Hd86zRGeQ+HNxBDexFTf6eP4HL08/wwze9zOl4z9vq0=; b=GCaIygWFzoiqQ9h9gaiVe6Zf6/GiXf2WJMKpI3dxfAbDbs5ecL+pf+11LGbzY6IcbG Q2cbMej51SwsdH8p7/MiPKA5qzHXk6iLgiyBOqi3uy03t7VfseY4Qts7JZjbmDkqg/au Ag8hwq0EdVlhNX4cXxXVG1citRBvFYZ4C9qAZwiL8I/cLPU/5946An+L4O0jvnL/ieB8 T0SvvGvIgnFswXDRPp38iWUJ8/hCiSRdEBw6oOoks0liLKEgFvHlc6RQWkmlWbk/wptp kcsoH3bfjh2LvYmNdwnIzyMjr5uvAjE34QfJka1v8pGp7il6FyPg3CUNF0TzwxxJmAyz HBMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747627746; x=1748232546; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Hd86zRGeQ+HNxBDexFTf6eP4HL08/wwze9zOl4z9vq0=; b=S6F+BSPt1H8DYF3IxHox3miygkN5dzn2TPwktnPmmy+bCx0+ml2BmxL4w64IqNvGUG YsyLRBPuch3/qfXFl4Zb94i9Yan9Th7RY61C+HEWQ6HoLSJFmcvGripeR5OC0Jw7beWV 9snF8wEQ8n4AyI7gU80kpxjjc9ybWF8jrY1R/ge2C1tVpcT0SWdjBNfkr8UHZIAIU14W djfAw6x7USCd1lrzX7vBhEMxMfNQjvjMGYiMJ6OkrX5WMFkr/11gPvNdntWvDsg0Pxe4 E6xnLOhT4yj1Z3rAJLzZnpoi+tkqqQYF2B8CSotpUf7GtktROBS7CwBILS5mrJWBxki1 QbjA== X-Gm-Message-State: AOJu0YxJPruBfzzH2oayIzxEhg7XDVYdQywwNUF2LgBqVgulFGTTVYUK 9CslOCtl8KCgo9H0Xq4qV/yfyCNLsI9JWvaAU+G5Xg0WvX3yjqsR2prLscS1uQ== X-Gm-Gg: ASbGncuFJ1jheQhYgsATsyHhf0GhgeMgDA8YpiLmJs/e1T87C8SPYNPIOY/0naS1Z49 y3Lx/JzzltjUQjzA1sJssxeHVPwaGL2tpX1Fp20cJCsNs/edVIZdj9krycEI6cUNtYbcpTJsc28 hv9csDGQW2JbeWjNyJxORvYZN9JHItz2LFuRen+UoORLPJCrSp8DG7HPo2cQB5sILpRgnL70sL9 1B50WlmMOqnSKdYl3FgsLXBllEqkK8ZWWzjRitIphlSSl7RiZYAauFCCyIowmB38Sdjf5SmYEti M3ApR+//A0PLRWqHttWtnHXDj7hPkZY/x1KsUHmEKBbThYnoxc/qRrhYvkSRxqZPcpFuOR5BXsn tbWhS2kFnUPTEjCmJEpxYySzqTM5Ij/gyvIy1UGRJ4IukP/uPvmjN1f4a X-Received: by 2002:a17:902:ec89:b0:224:93e:b5d7 with SMTP id d9443c01a7336-231de370eb9mr154482585ad.34.1747627746512; Sun, 18 May 2025 21:09:06 -0700 (PDT) Received: from toolbx.alistair23.me (2403-580b-97e8-0-82ce-f179-8a79-69f4.ip6.aussiebb.net. [2403:580b:97e8:0:82ce:f179:8a79:69f4]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-231ecd5ea41sm41750035ad.228.2025.05.18.21.09.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 May 2025 21:09:05 -0700 (PDT) From: alistair23@gmail.com X-Google-Original-From: alistair.francis@wdc.com To: qemu-devel@nongnu.org Cc: alistair23@gmail.com, Richard Henderson , Alistair Francis , Daniel Henrique Barboza , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= Subject: [PULL 37/56] target/riscv: Move insn_len to internals.h Date: Mon, 19 May 2025 14:05:34 +1000 Message-ID: <20250519040555.3797167-38-alistair.francis@wdc.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250519040555.3797167-1-alistair.francis@wdc.com> References: <20250519040555.3797167-1-alistair.francis@wdc.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::633; envelope-from=alistair23@gmail.com; helo=mail-pl1-x633.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Signed-off-by: Richard Henderson Reviewed-by: Alistair Francis Reviewed-by: Daniel Henrique Barboza Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20250425152311.804338-7-richard.henderson@linaro.org> Signed-off-by: Alistair Francis --- target/riscv/internals.h | 5 +++++ target/riscv/translate.c | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/target/riscv/internals.h b/target/riscv/internals.h index 213aff31d8..4570bd50be 100644 --- a/target/riscv/internals.h +++ b/target/riscv/internals.h @@ -201,4 +201,9 @@ static inline target_ulong adjust_addr_virt(CPURISCVState *env, return adjust_addr_body(env, addr, true); } +static inline int insn_len(uint16_t first_word) +{ + return (first_word & 3) == 3 ? 4 : 2; +} + #endif diff --git a/target/riscv/translate.c b/target/riscv/translate.c index 85128f997b..0d4f7d601c 100644 --- a/target/riscv/translate.c +++ b/target/riscv/translate.c @@ -1209,11 +1209,6 @@ static uint32_t opcode_at(DisasContextBase *dcbase, target_ulong pc) /* The specification allows for longer insns, but not supported by qemu. */ #define MAX_INSN_LEN 4 -static inline int insn_len(uint16_t first_word) -{ - return (first_word & 3) == 3 ? 4 : 2; -} - const RISCVDecoder decoder_table[] = { { always_true_p, decode_insn32 }, { has_xthead_p, decode_xthead},