From patchwork Mon Feb 17 19:29:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 865945 Delivered-To: patch@linaro.org Received: by 2002:a5d:64e6:0:b0:38f:210b:807b with SMTP id g6csp1251923wri; Mon, 17 Feb 2025 11:32:20 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXGT4PXSMoyWXmz6FDID8SVojBnJDBoRGFMBNfiu5BgWF8S9t20eKYa0GGysO2eXr1doMZTLw==@linaro.org X-Google-Smtp-Source: AGHT+IEoYa0OhGF3PD3W+l93bHJib6VII0PSi8aZe2e7vednaI+XwwhzmzVuWO6J/S1+kI/KK0Rb X-Received: by 2002:ad4:5aed:0:b0:6e4:442c:288c with SMTP id 6a1803df08f44-6e66ccaac6emr172622366d6.14.1739820740105; Mon, 17 Feb 2025 11:32:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1739820740; cv=none; d=google.com; s=arc-20240605; b=DRPKDFtHShxWVRz+zM1R9vNwNakrFFim8CtSBondBJPN0EzbRXLWW6wsbAUDX04BFB ZAsRK7C8L7GgvNOo7D31Mn0f4n2PHk8G3VSlMK/r0tV/uN/gXXb2QhIZRwabYugNpKxE R1uC9UONBULaskfW35jMcX4GQd90bw6P8UPuX4Gpv7XwYzrj452DTLDiBkU7XY5I0a6t oIny6JKWEwweYp7zLvj+tT+qk9BfyxSEFj24lPNYaR1DJEoiUkN+4Jtb0MHPIEPoiKdC yCcQUt/ntkPB9/XG1rzCEAB+wTadN2Kge1yWMTzYrzbDmYFhath04inyHrRkqVxmg2T0 dPnw== 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=XZB9FMvzvLrWKeW4/rUSQyapeHEL3MGiTY/vrabN1tc=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=Cs7FUYM+IsBfyXV44nt1ofmhyrocNhsVEbgefqkpc2eFSczxsLUtA0XxKLuPA7/7jz RUVSdrDHef/OGNUrtOasASleJ+jIO7xY60LjRF957vMMhuwzk3CCuRy21viSyHmeJAMl h1kw0JJqqsZhialjbWSuJNhgk1vjqeUj8nsDezdFkCE4I2VHMk0UPFEu+CSCqealkdsy P474IJDGUYAsCUkP03rHYmT4CpBS4nEuUynPwtNbVjS8bEoeyn6BC1OEb15wZTGy6Lzg KjLOK9BG5g7U97WpWBsGNdiV2ni1n7E4zs4B14lsW7hyhQYN3NXcxBk4OVSHy4yJasIf qtEQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IDfu1VjL; 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; 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 6a1803df08f44-6e65d9a22aesi91970016d6.199.2025.02.17.11.32.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Feb 2025 11:32: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=IDfu1VjL; 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; 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 1tk6pZ-0002BZ-Cg; Mon, 17 Feb 2025 14:31:01 -0500 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 1tk6os-0001t1-UO for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:20 -0500 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tk6oo-0008H5-2u for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:17 -0500 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-22104c4de96so35833855ad.3 for ; Mon, 17 Feb 2025 11:30:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739820611; x=1740425411; 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=XZB9FMvzvLrWKeW4/rUSQyapeHEL3MGiTY/vrabN1tc=; b=IDfu1VjLatjsdJdGll1rOvH+GqnnvoOY16gHAXQysmJ80sn1+SdCBAzhqnfdvT/R7+ QUYqZQhUM4MEscyqXPh9oNr4QmRzzlxIPD/6kKC9HNHGDXtrqkE3Z9MSBQ95HayOAoPv yyxUwujF2XFhlLvubys2msNzQ0dEen9w4nCZB+M4jZo105bJ8Z5v96Ak7J14lqcnU50j UWRIuqxD5x4Yhdap6e/ud54llAc/l6xH5bFZfLKv3U4BKCTmyF8ttl8dtd1CbcPlag6N HJT4JhSb5ybuk4oZvrsYFF5wqbM/yUO1JFo/U6W0PUTM2aMeM4vZ2z/qfS6AiLilrMui Fq8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739820611; x=1740425411; 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=XZB9FMvzvLrWKeW4/rUSQyapeHEL3MGiTY/vrabN1tc=; b=FoJbsTEaUAKQcoWdDkX3TGKpabwaN+h8a1Xw46xvhTl8CeO5wY1JTpoZCFrDOmWXF/ xveV9PFJqOQFBQZPHFlS40ZW6eTNyeZ/mei/QVqqcKMejQ9XrZpt8NkGY4bDVPgDY4sa +hPpvS5w0EjZRFGaCazo52H/Jmj5yCfqT9dmiWZFsYrH7506X2t/DBxUuEpZjbyF4mlS 01hKlSl7zFHWJWd0x4oVwoigZ6UGUIEjy6rauLRe8bklnqTK99EkRIg+nAr+rRa7MpiI ZtERDaG9qglL2leBmP2YQHW1/pE7gNnFunyiawB4edgkT0DmJsgW+Y6UURT53V1J6loK QQCg== X-Gm-Message-State: AOJu0YwM86hDAufMTFrnzNff7anhETAEVvx8hH1FzqhM1igZjzhKB48R UU/5V0DDWAObSNGETG4tuqYbu9HvsNFe0fpP27ZRPLz+JqN3lr+P34JdnfX9MM3vMSteGA+1zdI q X-Gm-Gg: ASbGncs9A5bxrRJS0lhqbLUcNCYHrmAQ5o9qn3EZRK0Nx8Fz7F8dJznMwxrw99rTzcB H+RElB1cVqqx7N0JhcA5XJuMSSSKloI21XwaGIkZDcJbZtObKJ1fJ4ppzBLbIHCBTroRDNIs/GY 6+Fy9ax4/LbRhQySgGDI9uGURrP1tKTn/lJ+XbHxGNQzlJJS6WfS39Kyc/g07bihBWtU69Mxg5n TWBfzYsOnqdNi06ZiRSy6/5N5n3Vm+A6+vza5zBtyW/BD/MSZ4vaKN5VyyAIUGsMNhc9I2XmIK4 2Y+3J36zw9OPCZbYdyzT3+/qRbs+g986W2DuH1dazBPh35U= X-Received: by 2002:a05:6a20:a107:b0:1ed:a6c6:7206 with SMTP id adf61e73a8af0-1ee8cacc9b8mr21579391637.8.1739820611058; Mon, 17 Feb 2025 11:30:11 -0800 (PST) Received: from stoup.. (71-212-39-66.tukw.qwest.net. [71.212.39.66]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7326a38ff76sm4347164b3a.160.2025.02.17.11.30.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2025 11:30:10 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL v2 01/27] tcg: Remove last traces of TCG_TARGET_NEED_POOL_LABELS Date: Mon, 17 Feb 2025 11:29:42 -0800 Message-ID: <20250217193009.2873875-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250217193009.2873875-1-richard.henderson@linaro.org> References: <20250217193009.2873875-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.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 These should have been removed with the rest. There are a couple of hosts which can emit guest_base into the constant pool: aarch64, mips64, ppc64, riscv64. Fixes: a417ef835058 ("tcg: Remove TCG_TARGET_NEED_LDST_LABELS and TCG_TARGET_NEED_POOL_LABELS") Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- tcg/tci/tcg-target.h | 1 - tcg/tcg.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/tcg/tci/tcg-target.h b/tcg/tci/tcg-target.h index a9ca493d20..bd03aa1bc4 100644 --- a/tcg/tci/tcg-target.h +++ b/tcg/tci/tcg-target.h @@ -72,6 +72,5 @@ typedef enum { } TCGReg; #define HAVE_TCG_QEMU_TB_EXEC -#define TCG_TARGET_NEED_POOL_LABELS #endif /* TCG_TARGET_H */ diff --git a/tcg/tcg.c b/tcg/tcg.c index 43b6712286..53de13df71 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -1598,21 +1598,17 @@ void tcg_prologue_init(void) tcg_qemu_tb_exec = (tcg_prologue_fn *)tcg_splitwx_to_rx(s->code_ptr); #endif -#ifdef TCG_TARGET_NEED_POOL_LABELS s->pool_labels = NULL; -#endif qemu_thread_jit_write(); /* Generate the prologue. */ tcg_target_qemu_prologue(s); -#ifdef TCG_TARGET_NEED_POOL_LABELS /* Allow the prologue to put e.g. guest_base into a pool entry. */ { int result = tcg_out_pool_finalize(s); tcg_debug_assert(result == 0); } -#endif prologue_size = tcg_current_code_size(s); perf_report_prologue(s->code_gen_ptr, prologue_size); From patchwork Mon Feb 17 19:29:43 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 865952 Delivered-To: patch@linaro.org Received: by 2002:a5d:64e6:0:b0:38f:210b:807b with SMTP id g6csp1252222wri; Mon, 17 Feb 2025 11:33:15 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV13/pfkAjlYu5HhhXRSgT9mHICeOU7aFCUnsqEt6qNkmo6B6BrPgJb6WA4fCc72Z0OLk6y6A==@linaro.org X-Google-Smtp-Source: AGHT+IHgiG5vQVjR2biXmlopl7b4pT/NDakAmLj8uA2ItWaZFmkCjD2uqxzrk6TP8QdQg0XnEzCM X-Received: by 2002:a05:620a:24d3:b0:7b6:7a7b:1a4 with SMTP id af79cd13be357-7c08a9c8ea4mr1410308185a.27.1739820795752; Mon, 17 Feb 2025 11:33:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1739820795; cv=none; d=google.com; s=arc-20240605; b=iIza7DKB6HsWTkbGyY3kFe76Pq4I0utW9rTcDZqkdWt6x9R/l9ZPTfCWBdDNE9Vnsd r+RXxie/CQ5dc0LCY8OuXxH3qXoFrSb129zbpTt522/jpKPIISrHIKc/QsCT6vNjNAfs 9Yhu6ZK1nyMrjyCiiLqMLy5ENFVgsC3LZrAclRmE7zWVlWaFbpSFvnvX+jiAlQrNXkXq YRnwp4xvEwmt+1RpHmeTu1+GpGfDeeM5U/0Yk+DMDlnC/n4kp4Y6UXY3/cLfyzHcIRci KshGjFvbn9I0P9lr/MU3z1BP0L86NbR72PVY7xUCk8bXwXh3e3qBUNXkhrdvFXpM8qbf NSCQ== 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=0D+qkdUAnGyLEvzj5WsailDQ6IwrMLobTEZGdeMA0tw=; fh=eu2DY09p+eeddYDiV+DalJS3Vr0kxK5BujclYkgWvDw=; b=O6+2pG3ljx9OjQ5Z2A5OwT7dmsSC1VvP1UPTT15rPGQQryaC3nvfwknN4WmsHGN96i EqyMsC6bD4A5mKEtPS0UzxQR20bo3/SsMEKbekMH+8qxROxMtGeNbbeIpFRsQsWPaIJg fg3lp0NJoQttHEPQQwC/ThWN0b0VyCpp1NwwZbPTd4VhYqi6FH8YJvCB0PoFqW1uzM+z U9jcgDYL9NSJho9educJcnucY06mCZtDUBnzS59+aaFaDKUUdseBlCsTeRjZRMdA8AvY iksxZXYWWEX5lUY/ucdFxqSqImmvKf8XMnjR1sJtS8lSU0WP4q1uk8lft0EoIvwM2BWP qQbQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=f+sm5Okz; 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; 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-7c0a14861e1si195017885a.562.2025.02.17.11.33.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Feb 2025 11:33:15 -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=f+sm5Okz; 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; 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 1tk6pl-0002mz-7I; Mon, 17 Feb 2025 14:31:13 -0500 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 1tk6ov-0001uL-1M for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:22 -0500 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tk6oq-0008I0-0R for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:19 -0500 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-22100006bc8so42904835ad.0 for ; Mon, 17 Feb 2025 11:30:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739820612; x=1740425412; 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=0D+qkdUAnGyLEvzj5WsailDQ6IwrMLobTEZGdeMA0tw=; b=f+sm5OkzHhy+j5Xuc2P9wtYXlwxoHbSNFvqLuyQS1FicdAcUsgxWAduwJuHMbBe+F3 gmvEaXHah/TPlkPx0hFhjn3fj0nmHRJXodg2idIHkn9C1Wl7yXRL05m335uWWdl9F/AT 0oIL3hptyI2y94ywNjDQP+MsI6NhUJ3w4eMFQswsNzKUcIxHu65xHVP/xeLzbIHnSqDR nAHVq1Ts8fE6Ve38RSrbpNT+wz4uFWIQKsKtoYXtBSCyGZnocOFQqIh1Jog0t71GFj6o ekgoPpuCiV//Sh2qbrW4cT+6cZFMlxaKdKMcF+gMtOzdoYngPwX8r06VtYB8TQ3seIC6 /L9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739820612; x=1740425412; 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=0D+qkdUAnGyLEvzj5WsailDQ6IwrMLobTEZGdeMA0tw=; b=EY7WQJDDVYyZF9/iNneYaQOfVcwNjYgKwUo8axLD9JCs0fnGbdCaco299zGYlEN6S8 39127ujBDEc7uZ6/69ZCTGz/N55r3WJs0L0Fz78Czy/r9Vr76wEAgndae9aoQxtJPKBo JSGF1NPKKJ/eiNzyYT4acpu9Z108InT2fwThGRIIyqPVdnOfTZ7nOeVjX0rJXhEp1qBa TUkMOGu2B4qsP8fUTkrRHaRx2jJSud9wkmXtiAaDVj1My+TmymvaleSJ/JrSaMOpgrbT Pc+XFwQ01u3dNdW72znXHF6OJ2lSO2xkiqO36bioWaQtpESQXq24KlpaxB0jUg6JlWD8 J5NQ== X-Gm-Message-State: AOJu0Yyz9hJqvnftrmw/DaBCcm8slUv+4y3vGQk6vzjl9xKYmxGJXXIN Eu0bQk7cQ8SMDx7kYK+dKPv/LKhM3gILHZihYMQdpDVtFfrzYUfIfJTROSdD/1C8y2S19gKc4ls m X-Gm-Gg: ASbGncvz739KsAr5RB66+lJSFnE8vqcaH/irPLF9yU35WsY9fjP+4qSrMxpD1AOilgz 40Tp8UeFQXw7mVuu2KuMf+wSG0uPaNLDOUSbpaxjGVw1imZDx9ab3sZEkGvvM2ZZ4qUSr+4LrYP Ed9/89AyHyKqGp3cVHZEFm8krZr5ABXy1vOviTh5LMwQtYzXlIJQ5zqWWEHLn0dWSHTLQW1SrCf GjRNghjfw0J+RhiqOLzLqh7hJvxi7qkvWBSfotdnw8CmixDsbGcbMywIXgl/QN6niKAvPTGmgIp GJKUtGYPJ9iYnlyUPcfr4s9S3p2Zqmf5ZACwtVHfXw3VLhE= X-Received: by 2002:a05:6a20:6a1e:b0:1e1:b727:1801 with SMTP id adf61e73a8af0-1ee8cbc1aeamr18592428637.27.1739820612222; Mon, 17 Feb 2025 11:30:12 -0800 (PST) Received: from stoup.. (71-212-39-66.tukw.qwest.net. [71.212.39.66]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7326a38ff76sm4347164b3a.160.2025.02.17.11.30.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2025 11:30:11 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PULL v2 02/27] tcg: Remove TCG_OVERSIZED_GUEST Date: Mon, 17 Feb 2025 11:29:43 -0800 Message-ID: <20250217193009.2873875-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250217193009.2873875-1-richard.henderson@linaro.org> References: <20250217193009.2873875-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.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 This is now prohibited in configuration. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- include/qemu/atomic.h | 18 +++-------------- include/tcg/oversized-guest.h | 23 ---------------------- accel/tcg/cputlb.c | 7 ------- accel/tcg/tcg-all.c | 9 ++++----- target/arm/ptw.c | 34 --------------------------------- target/riscv/cpu_helper.c | 13 +------------ docs/devel/multi-thread-tcg.rst | 1 - 7 files changed, 8 insertions(+), 97 deletions(-) delete mode 100644 include/tcg/oversized-guest.h diff --git a/include/qemu/atomic.h b/include/qemu/atomic.h index 7a3f2e6576..f80cba24cf 100644 --- a/include/qemu/atomic.h +++ b/include/qemu/atomic.h @@ -56,25 +56,13 @@ */ #define signal_barrier() __atomic_signal_fence(__ATOMIC_SEQ_CST) -/* Sanity check that the size of an atomic operation isn't "overly large". +/* + * Sanity check that the size of an atomic operation isn't "overly large". * Despite the fact that e.g. i686 has 64-bit atomic operations, we do not * want to use them because we ought not need them, and this lets us do a * bit of sanity checking that other 32-bit hosts might build. - * - * That said, we have a problem on 64-bit ILP32 hosts in that in order to - * sync with TCG_OVERSIZED_GUEST, this must match TCG_TARGET_REG_BITS. - * We'd prefer not want to pull in everything else TCG related, so handle - * those few cases by hand. - * - * Note that x32 is fully detected with __x86_64__ + _ILP32, and that for - * Sparc we always force the use of sparcv9 in configure. MIPS n32 (ILP32) & - * n64 (LP64) ABIs are both detected using __mips64. */ -#if defined(__x86_64__) || defined(__sparc__) || defined(__mips64) -# define ATOMIC_REG_SIZE 8 -#else -# define ATOMIC_REG_SIZE sizeof(void *) -#endif +#define ATOMIC_REG_SIZE sizeof(void *) /* Weak atomic operations prevent the compiler moving other * loads/stores past the atomic operation load/store. However there is diff --git a/include/tcg/oversized-guest.h b/include/tcg/oversized-guest.h deleted file mode 100644 index 641b9749ff..0000000000 --- a/include/tcg/oversized-guest.h +++ /dev/null @@ -1,23 +0,0 @@ -/* SPDX-License-Identifier: MIT */ -/* - * Define TCG_OVERSIZED_GUEST - * Copyright (c) 2008 Fabrice Bellard - */ - -#ifndef EXEC_TCG_OVERSIZED_GUEST_H -#define EXEC_TCG_OVERSIZED_GUEST_H - -#include "tcg-target-reg-bits.h" -#include "cpu-param.h" - -/* - * Oversized TCG guests make things like MTTCG hard - * as we can't use atomics for cputlb updates. - */ -#if TARGET_LONG_BITS > TCG_TARGET_REG_BITS -#define TCG_OVERSIZED_GUEST 1 -#else -#define TCG_OVERSIZED_GUEST 0 -#endif - -#endif diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index b4ccf0cdcb..17e2251695 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -47,7 +47,6 @@ #include "qemu/plugin-memory.h" #endif #include "tcg/tcg-ldst.h" -#include "tcg/oversized-guest.h" /* DEBUG defines, enable DEBUG_TLB_LOG to log to the CPU_LOG_MMU target */ /* #define DEBUG_TLB */ @@ -118,12 +117,8 @@ static inline uint64_t tlb_read_idx(const CPUTLBEntry *entry, return qatomic_read(ptr); #else const uint64_t *ptr = &entry->addr_idx[access_type]; -# if TCG_OVERSIZED_GUEST - return *ptr; -# else /* ofs might correspond to .addr_write, so use qatomic_read */ return qatomic_read(ptr); -# endif #endif } @@ -908,8 +903,6 @@ static void tlb_reset_dirty_range_locked(CPUTLBEntry *tlb_entry, uint32_t *ptr_write = (uint32_t *)&tlb_entry->addr_write; ptr_write += HOST_BIG_ENDIAN; qatomic_set(ptr_write, *ptr_write | TLB_NOTDIRTY); -#elif TCG_OVERSIZED_GUEST - tlb_entry->addr_write |= TLB_NOTDIRTY; #else qatomic_set(&tlb_entry->addr_write, tlb_entry->addr_write | TLB_NOTDIRTY); diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c index 95adaacee8..c1a30b0121 100644 --- a/accel/tcg/tcg-all.c +++ b/accel/tcg/tcg-all.c @@ -28,7 +28,6 @@ #include "exec/replay-core.h" #include "system/cpu-timers.h" #include "tcg/startup.h" -#include "tcg/oversized-guest.h" #include "qapi/error.h" #include "qemu/error-report.h" #include "qemu/accel.h" @@ -41,6 +40,8 @@ #include "hw/boards.h" #endif #include "internal-common.h" +#include "cpu-param.h" + struct TCGState { AccelState parent_obj; @@ -72,7 +73,7 @@ DECLARE_INSTANCE_CHECKER(TCGState, TCG_STATE, static bool default_mttcg_enabled(void) { - if (icount_enabled() || TCG_OVERSIZED_GUEST) { + if (icount_enabled()) { return false; } #ifdef TARGET_SUPPORTS_MTTCG @@ -145,9 +146,7 @@ static void tcg_set_thread(Object *obj, const char *value, Error **errp) TCGState *s = TCG_STATE(obj); if (strcmp(value, "multi") == 0) { - if (TCG_OVERSIZED_GUEST) { - error_setg(errp, "No MTTCG when guest word size > hosts"); - } else if (icount_enabled()) { + if (icount_enabled()) { error_setg(errp, "No MTTCG when icount is enabled"); } else { #ifndef TARGET_SUPPORTS_MTTCG diff --git a/target/arm/ptw.c b/target/arm/ptw.c index 64bb6878a4..4330900348 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -16,9 +16,6 @@ #include "internals.h" #include "cpu-features.h" #include "idau.h" -#ifdef CONFIG_TCG -# include "tcg/oversized-guest.h" -#endif typedef struct S1Translate { /* @@ -840,7 +837,6 @@ static uint64_t arm_casq_ptw(CPUARMState *env, uint64_t old_val, ptw->out_rw = true; } -#ifdef CONFIG_ATOMIC64 if (ptw->out_be) { old_val = cpu_to_be64(old_val); new_val = cpu_to_be64(new_val); @@ -852,36 +848,6 @@ static uint64_t arm_casq_ptw(CPUARMState *env, uint64_t old_val, cur_val = qatomic_cmpxchg__nocheck((uint64_t *)host, old_val, new_val); cur_val = le64_to_cpu(cur_val); } -#else - /* - * We can't support the full 64-bit atomic cmpxchg on the host. - * Because this is only used for FEAT_HAFDBS, which is only for AA64, - * we know that TCG_OVERSIZED_GUEST is set, which means that we are - * running in round-robin mode and could only race with dma i/o. - */ -#if !TCG_OVERSIZED_GUEST -# error "Unexpected configuration" -#endif - bool locked = bql_locked(); - if (!locked) { - bql_lock(); - } - if (ptw->out_be) { - cur_val = ldq_be_p(host); - if (cur_val == old_val) { - stq_be_p(host, new_val); - } - } else { - cur_val = ldq_le_p(host); - if (cur_val == old_val) { - stq_le_p(host, new_val); - } - } - if (!locked) { - bql_unlock(); - } -#endif - return cur_val; #else /* AArch32 does not have FEAT_HADFS; non-TCG guests only use debug-mode. */ diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c index e1dfc4ecbf..8ff6d900f2 100644 --- a/target/riscv/cpu_helper.c +++ b/target/riscv/cpu_helper.c @@ -32,7 +32,6 @@ #include "system/cpu-timers.h" #include "cpu_bits.h" #include "debug.h" -#include "tcg/oversized-guest.h" #include "pmp.h" int riscv_env_mmu_index(CPURISCVState *env, bool ifetch) @@ -1167,9 +1166,7 @@ static int get_physical_address(CPURISCVState *env, hwaddr *physical, hwaddr pte_addr; int i; -#if !TCG_OVERSIZED_GUEST -restart: -#endif + restart: for (i = 0; i < levels; i++, ptshift -= ptidxbits) { target_ulong idx; if (i == 0) { @@ -1388,13 +1385,6 @@ restart: false, MEMTXATTRS_UNSPECIFIED); if (memory_region_is_ram(mr)) { target_ulong *pte_pa = qemu_map_ram_ptr(mr->ram_block, addr1); -#if TCG_OVERSIZED_GUEST - /* - * MTTCG is not enabled on oversized TCG guests so - * page table updates do not need to be atomic - */ - *pte_pa = pte = updated_pte; -#else target_ulong old_pte; if (riscv_cpu_sxl(env) == MXL_RV32) { old_pte = qatomic_cmpxchg((uint32_t *)pte_pa, pte, updated_pte); @@ -1405,7 +1395,6 @@ restart: goto restart; } pte = updated_pte; -#endif } else { /* * Misconfigured PTE in ROM (AD bits are not preset) or diff --git a/docs/devel/multi-thread-tcg.rst b/docs/devel/multi-thread-tcg.rst index 7fd0a07633..b0f473961d 100644 --- a/docs/devel/multi-thread-tcg.rst +++ b/docs/devel/multi-thread-tcg.rst @@ -37,7 +37,6 @@ if: * forced by --accel tcg,thread=single * enabling --icount mode -* 64 bit guests on 32 bit hosts (TCG_OVERSIZED_GUEST) In the general case of running translated code there should be no inter-vCPU dependencies and all vCPUs should be able to run at full From patchwork Mon Feb 17 19:29:44 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 865958 Delivered-To: patch@linaro.org Received: by 2002:a5d:64e6:0:b0:38f:210b:807b with SMTP id g6csp1252500wri; Mon, 17 Feb 2025 11:34:08 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW8R4/bmY8B9mEuE1Tj3bi8szpOiQSDkI/Jm+3lmafWBeljw2mZBzxfydZcIuT6jcFH0vr04Q==@linaro.org X-Google-Smtp-Source: AGHT+IHXrAOOoSKycnuq1H0hKvTbIeiuLyHwK+7PXMo4hWMFRqU6Oel1DfMRcAUZsWu5ZtyV/fDe X-Received: by 2002:a05:6214:19cf:b0:6e4:6f07:21a8 with SMTP id 6a1803df08f44-6e66cc8a8d0mr116103046d6.9.1739820847874; Mon, 17 Feb 2025 11:34:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1739820847; cv=none; d=google.com; s=arc-20240605; b=Up3w2ZqPQlh6vkvObFrzFDvhT+3uHUSTPeWO/GcpQbJUCNxl6iy5OHl8NhX2JtmhbZ zsvxHGoRMPCu4Q+MFUfm6f1mZe7IIeGLl1NtIB6bhlt9+9l/qViuQufSJzBsqJQrWQqc 1rTZHYOKAqOMIgbpLMHFSWtC+K4YcPxg2u50qNi6v3K+Vf/S3PKzfKr+8LKdALPQmj+e geClrMdyO2enIisWgJL+UfRlnpsy7agmFIkmMtIFQ2L5h9xRWzN2zobj5/2gBhy19OxZ oEhpjjBYCAiUVenVDtRmgR/eU9laMi6LnS9ikyrZGpYAOEa9LEZ912YjWw99p44NLfvZ B33g== 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=CoSz+0yLhVK3dbyvfDxsdAZSwsgZvLHw47U3xK2XgEE=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=XEdy/Du++npnQhQMYlY1Rz7TDd6rSRYu06HFQ5ltqoxIEyLOXmvDlhJ5jFIjIltqJe OA75PeADBMcqhJ+H4H+ybNGDZ5Ff+I3J+gGKXEvoSr5UN4wBO+5fzQhOnz99mg5McxRI EIiN50njHAXaiqw+nR1k8MixwsFlNglQxfw3IS4BQnnFWvEuIl3iJk5AAsIw3vF5EHKV /Nl7jqqMs3kBSPeeMlDQ3AT3zpKzPIw3sJnevc5kSbkNaKWXRnpxl/jU0lbJgfoftQlR PwMzhU+5s9GJeQCQm2D/i3uZQ4/A111CFjC/YdalQ0D4qsH69UviyZmAmTKiO8i7T+CP 4ddg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DiD6SrzG; 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; 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 6a1803df08f44-6e675efe226si40444016d6.57.2025.02.17.11.34.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Feb 2025 11:34:07 -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=DiD6SrzG; 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; 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 1tk6pa-0002CY-3O; Mon, 17 Feb 2025 14:31:02 -0500 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 1tk6ou-0001uD-R1 for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:22 -0500 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tk6oq-0008I9-1b for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:18 -0500 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-220e6028214so75943245ad.0 for ; Mon, 17 Feb 2025 11:30:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739820613; x=1740425413; 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=CoSz+0yLhVK3dbyvfDxsdAZSwsgZvLHw47U3xK2XgEE=; b=DiD6SrzGktzOiJznQQL1Soh4UqqMB1xL3FQw/v6xhjL0aBPGMg6A/ox4CaofNSxjnz viac39LzLiPFWafDjgJYizmAnLoXCQ0w9fd42ov8h3RHjGu3A0ioyAsR5V8aQ7XhfurR KLNlK13MP48CO2eT+4QSVsZAVA4YwpndbE3Zbo4kBF7Pr8yvW01x7GKT2g2oGie9Ev6B /7W/rOytXMt1Ia2yHmMrq7gRU0nj5CTWDS+0rkZlHSkw6KMUeYnN2/YDDVWfpvw2yvtJ kQoD1dsQGPAi7qSAwqgwbAI2c8vOh2JiAr+hg+MVNJ/BMcO8R9XBqhI07655SdpN4Q8o n0wQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739820613; x=1740425413; 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=CoSz+0yLhVK3dbyvfDxsdAZSwsgZvLHw47U3xK2XgEE=; b=qV6TUNEWu6SIcfgdwETKXe71w1y+pa+k0GufGcuzpinw87AkHysaEQmxhrkW0xTVXa Sea7NUCUWf4lP6ubjYrbLucY6r4l/2m9EnQUeM1jk8zioIe52l7vBZO8wXXbnuj27b3V 2H6BEM2R7QO4BwJtD007NHHX6krapSLImROn6ZFcP1wK3BIu4lia/UHJudnGvIXcTb2y 08iGo1Emg01AF501DZbn4bOsd0vm+a1nijXMQ3R68E+o3m7gImFBlXnjtyWX4L56k/4p ywhq5/rpB0NT/AdoRZrowp9wYYgtcO0PG5TqakNu/S/ST4nPrpH7P1QC/QUJL/tnXDkB Oqug== X-Gm-Message-State: AOJu0Ywz2HmIYNMRQ+wR7L+qdbTzCLFzUVkAdvamqi2zQjqctFWIiWHI k/WvMJkcqDpedOiEnxDZF9iarf9dmITxMNlvxutBrPIONB7XSyjZnMme60z2fBjlX/v5fMjBqZf J X-Gm-Gg: ASbGnct3ebTJKycu1KjrUvQuypdrQxHzu14ZJgo7voisubUT37gobgAjEftt4Q3aZmh dyhNeqANa+5yzXF3BicH4svphZvVsh8RJyXhOD9xzeDj1MCgb6Z7cSp/5tBmWTeo9l5SOcatcXG nqgJwY8P52HmigyYJcZ44Cc93K7eZzTLxv/TJ/1TQQRhavsx1vy+1kSsW7jmOIAiRGA1fvavgU3 ME0wL53+OP55pPe5sTshT4XUxjK7am/HeOMqwFkeSr8wsN4SgWVur4zLaLrpPt96UcKlm0hBP5e KLMSK+5/8YDiT+QMLrapjHhH9zBrM/hN457UYRsGWNFxMo0= X-Received: by 2002:a05:6a21:6da7:b0:1ee:5d05:a18f with SMTP id adf61e73a8af0-1ee8cc25a7cmr19924143637.35.1739820612937; Mon, 17 Feb 2025 11:30:12 -0800 (PST) Received: from stoup.. (71-212-39-66.tukw.qwest.net. [71.212.39.66]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7326a38ff76sm4347164b3a.160.2025.02.17.11.30.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2025 11:30:12 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL v2 03/27] tcg: Drop support for two address registers in gen_ldst Date: Mon, 17 Feb 2025 11:29:44 -0800 Message-ID: <20250217193009.2873875-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250217193009.2873875-1-richard.henderson@linaro.org> References: <20250217193009.2873875-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=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 Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/tcg-op-ldst.c | 21 +++------------------ tcg/tcg.c | 4 +--- 2 files changed, 4 insertions(+), 21 deletions(-) diff --git a/tcg/tcg-op-ldst.c b/tcg/tcg-op-ldst.c index 77271e0193..7ba9a3ef7e 100644 --- a/tcg/tcg-op-ldst.c +++ b/tcg/tcg-op-ldst.c @@ -91,25 +91,10 @@ static MemOp tcg_canonicalize_memop(MemOp op, bool is64, bool st) static void gen_ldst(TCGOpcode opc, TCGType type, TCGTemp *vl, TCGTemp *vh, TCGTemp *addr, MemOpIdx oi) { - if (TCG_TARGET_REG_BITS == 64 || tcg_ctx->addr_type == TCG_TYPE_I32) { - if (vh) { - tcg_gen_op4(opc, type, temp_arg(vl), temp_arg(vh), - temp_arg(addr), oi); - } else { - tcg_gen_op3(opc, type, temp_arg(vl), temp_arg(addr), oi); - } + if (vh) { + tcg_gen_op4(opc, type, temp_arg(vl), temp_arg(vh), temp_arg(addr), oi); } else { - /* See TCGV_LOW/HIGH. */ - TCGTemp *al = addr + HOST_BIG_ENDIAN; - TCGTemp *ah = addr + !HOST_BIG_ENDIAN; - - if (vh) { - tcg_gen_op5(opc, type, temp_arg(vl), temp_arg(vh), - temp_arg(al), temp_arg(ah), oi); - } else { - tcg_gen_op4(opc, type, temp_arg(vl), - temp_arg(al), temp_arg(ah), oi); - } + tcg_gen_op3(opc, type, temp_arg(vl), temp_arg(addr), oi); } } diff --git a/tcg/tcg.c b/tcg/tcg.c index 53de13df71..14c2d38160 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -1690,9 +1690,7 @@ void tcg_func_start(TCGContext *s) s->emit_before_op = NULL; QSIMPLEQ_INIT(&s->labels); - tcg_debug_assert(s->addr_type == TCG_TYPE_I32 || - s->addr_type == TCG_TYPE_I64); - + tcg_debug_assert(s->addr_type <= TCG_TYPE_REG); tcg_debug_assert(s->insn_start_words > 0); } From patchwork Mon Feb 17 19:29:45 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 865960 Delivered-To: patch@linaro.org Received: by 2002:a5d:64e6:0:b0:38f:210b:807b with SMTP id g6csp1252633wri; Mon, 17 Feb 2025 11:34:28 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWSRdKMH7kGlRLRLqKW4D21FCuKklG2U+e+qYrNAJKlKkDpniXcmfqbYhlmRbMcGDI5o41Idg==@linaro.org X-Google-Smtp-Source: AGHT+IFCxVuHoAjpbMCD7TxaYORuqTzzockrH83DTcyKo8ygl0DHQZij5D0fixjZ0Ls+ur1kpeNQ X-Received: by 2002:ad4:5d48:0:b0:6e6:668a:a286 with SMTP id 6a1803df08f44-6e66ccdf20emr162583746d6.14.1739820867920; Mon, 17 Feb 2025 11:34:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1739820867; cv=none; d=google.com; s=arc-20240605; b=hBJMhP0ZYl29wALXmquMMIeM5r0gai4ThrkQ+hCVsw7cBGJ25ujl6dcLh354DzhlDF II9b6OqEr7hlqB4YbGMAqD9ODvL+7DWS0nGulYORvKZCBNLyEaltnvq0uuitBTlokm1l bRNP+lKW9sYj4o0JRYGL8jiOyymJZD6vnZG9rylaPPUXTKsRGA3AnedrdZxlxS9z6jUq OcfadV/a3PeD8K9iHVSJI4Hf6Cd+TpnHbpLwjgG5Mcl5mGHFWSTjIAfzZFUGjsgyJWBc JQkjAfNSFP3P8aSD8ny3G+AC7tgYy3nceVIZmdScEcTC9st+mEwmWQxQwelOi14KBoGY HO7A== 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=Wj993E3ZZf03MKcBtMhEA9Clo7QI2t/6YKu10ngaiXc=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=FBYCAe7LCirN1Pii7YVF4rmp2l7iLZ0W6zOIcTgI4JyKyct80/EdyXbxX9Pr9dmeBH 2AsyEORc2a1PREdKmgzC+QlJ6dKXiKwmZoP+1b0Pu1dLrp7YT5MlPMszyRxGcFfuzxG2 STBekwaT0YHaPRBPhlg3qIcos0aJWDzjdwBCX2GCsXSlLQ2izUC+Quu3sIWrQbjgF4tp 5qcVWoCrVCzFGf01GLH/KqDxNDyeuPfGrxyDF1KXr7nql14+O6uvCsb/nIxnmma0lLH9 SFi+sBh6ItD76VNPCZ/oa2I+KDNFa3bMDMOPYAE2ZdXivvgLA9t3x34Nr93p4/NL0edl 9qRg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TGh7fUsB; 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; 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 6a1803df08f44-6e65d9a20f2si94846426d6.246.2025.02.17.11.34.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Feb 2025 11:34: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=TGh7fUsB; 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; 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 1tk6pg-0002UR-0q; Mon, 17 Feb 2025 14:31:08 -0500 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 1tk6ox-0001uv-5b for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:26 -0500 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tk6oq-0008IU-Rc for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:22 -0500 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-2210d92292eso55110035ad.1 for ; Mon, 17 Feb 2025 11:30:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739820614; x=1740425414; 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=Wj993E3ZZf03MKcBtMhEA9Clo7QI2t/6YKu10ngaiXc=; b=TGh7fUsBiK/udDfYDHdxl2NWopRX0G4pU7fumYAuZeiNHVcqNcyQYMhFk9nSwdcMsC dxWXPPcf4ETW6U+txKuHWrebxwJLKxTF0RoDcmEywt/m6h23tLPLn9jeUNXaI5glGJfX wU+XmJqWiWKJSMQctSMmyPFXhduxB8kpdnpIkSVCmNmPzAABExjVONj5B0TsT0tWcIJZ tTt5ov+sTl/5mOKTzajOtXhG1MbInLIONo+LhJluohPjdbfTs1RDwZGmpv6QsqCV0+HX +6uLqO+FOtfvcB60buxaes3bTlpe6RzQ3vtoCf4m9IWHvdoYbkq2SeiJwJsENnocOQ31 vUAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739820614; x=1740425414; 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=Wj993E3ZZf03MKcBtMhEA9Clo7QI2t/6YKu10ngaiXc=; b=ZEybxgKUuC9EepwQIN9e+CJXB5iLwpuRNCF4Nn92V4r8T005uy5jZ/iL3L71RJNiJW U9ik4RcgKbTJ5nFyFJStRRgWWtqeYKBpq0tlzaIwnG9ChXsA61kCmELpm+OagDRAGoFe qzppo5pqgyki0YU+dvJTmmdnopeFXSd/uC5uM7dhoZkA/yOKrPxBEcy56DTXMrOoz6bd S4zl9p6abiQPc8DNH84uLfDyObSjsxGrlvxd6Nc/DcOC4gsrjCPV5mTguR8rx48N/LkR oIm22EUpy7yElUfdQgQBT2ja9RdZxOzPPl+Jl0Xe9OJPh7EdCpKqllHV+yGGXEh/GLwN Tdfw== X-Gm-Message-State: AOJu0YzSnpIntYaVqlFio6+T4GWqK/r5BWrWXX3noO9oMdh3hzrybv6F czGoBewHqH4Y7nxtafQHv62SaYQenPhxIcVoOgvB6c3KaDisuVWqhECxB0uHUn4rI8H/Y5UnFed 1 X-Gm-Gg: ASbGncupxeSIs1EB4BrREmd9Hyu49F7iDJRnw9hSrLg9bkLU7EfUZRS9l6T91T9inyz zfxoYO5zVIyRJiaqUzINeJNFGikBq+Ae9EI77riyHAxRgn8qq82pPwk4/HS8qo8bRGEWIYKSNIN TBjK0Q0O8VItzBoTHH/6Ta71hqnNLk7ipFXfVeuwXJmcsqfas3vh6Y+onUCdMLkppENTTXdki// 0EBg2fEp3xAuGKBWgj9MfXBnjS4ycEe+ATqbAZny3tZ6leAl4voXQqbTDkGuQnTc4aZSxbpOLuX l7Nq1PaunXmUqRp/dY+vw8oYFkavVksK/d7FUE17cxwy7A0= X-Received: by 2002:a05:6a00:438d:b0:732:6480:2bed with SMTP id d2e1a72fcca58-73264802c51mr15131013b3a.13.1739820613864; Mon, 17 Feb 2025 11:30:13 -0800 (PST) Received: from stoup.. (71-212-39-66.tukw.qwest.net. [71.212.39.66]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7326a38ff76sm4347164b3a.160.2025.02.17.11.30.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2025 11:30:13 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL v2 04/27] tcg: Merge INDEX_op_qemu_*_{a32,a64}_* Date: Mon, 17 Feb 2025 11:29:45 -0800 Message-ID: <20250217193009.2873875-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250217193009.2873875-1-richard.henderson@linaro.org> References: <20250217193009.2873875-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62f; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62f.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.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 Since 64-on-32 is now unsupported, guest addresses always fit in one host register. Drop the replication of opcodes. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/tcg/tcg-opc.h | 28 ++------ tcg/optimize.c | 21 ++---- tcg/tcg-op-ldst.c | 82 +++++---------------- tcg/tcg.c | 42 ++++------- tcg/tci.c | 119 ++++++------------------------- tcg/aarch64/tcg-target.c.inc | 36 ++++------ tcg/arm/tcg-target.c.inc | 40 +++-------- tcg/i386/tcg-target.c.inc | 69 ++++-------------- tcg/loongarch64/tcg-target.c.inc | 36 ++++------ tcg/mips/tcg-target.c.inc | 51 +++---------- tcg/ppc/tcg-target.c.inc | 68 ++++-------------- tcg/riscv/tcg-target.c.inc | 24 +++---- tcg/s390x/tcg-target.c.inc | 36 ++++------ tcg/sparc64/tcg-target.c.inc | 24 +++---- tcg/tci/tcg-target.c.inc | 60 ++++------------ 15 files changed, 177 insertions(+), 559 deletions(-) diff --git a/include/tcg/tcg-opc.h b/include/tcg/tcg-opc.h index 9383e295f4..5bf78b0764 100644 --- a/include/tcg/tcg-opc.h +++ b/include/tcg/tcg-opc.h @@ -188,36 +188,22 @@ DEF(goto_ptr, 0, 1, 0, TCG_OPF_BB_EXIT | TCG_OPF_BB_END) DEF(plugin_cb, 0, 0, 1, TCG_OPF_NOT_PRESENT) DEF(plugin_mem_cb, 0, 1, 1, TCG_OPF_NOT_PRESENT) -/* Replicate ld/st ops for 32 and 64-bit guest addresses. */ -DEF(qemu_ld_a32_i32, 1, 1, 1, +DEF(qemu_ld_i32, 1, 1, 1, TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS) -DEF(qemu_st_a32_i32, 0, 1 + 1, 1, +DEF(qemu_st_i32, 0, 1 + 1, 1, TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS) -DEF(qemu_ld_a32_i64, DATA64_ARGS, 1, 1, +DEF(qemu_ld_i64, DATA64_ARGS, 1, 1, TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS) -DEF(qemu_st_a32_i64, 0, DATA64_ARGS + 1, 1, - TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS) - -DEF(qemu_ld_a64_i32, 1, DATA64_ARGS, 1, - TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS) -DEF(qemu_st_a64_i32, 0, 1 + DATA64_ARGS, 1, - TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS) -DEF(qemu_ld_a64_i64, DATA64_ARGS, DATA64_ARGS, 1, - TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS) -DEF(qemu_st_a64_i64, 0, DATA64_ARGS + DATA64_ARGS, 1, +DEF(qemu_st_i64, 0, DATA64_ARGS + 1, 1, TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS) /* Only used by i386 to cope with stupid register constraints. */ -DEF(qemu_st8_a32_i32, 0, 1 + 1, 1, - TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS) -DEF(qemu_st8_a64_i32, 0, 1 + DATA64_ARGS, 1, +DEF(qemu_st8_i32, 0, 1 + 1, 1, TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS) /* Only for 64-bit hosts at the moment. */ -DEF(qemu_ld_a32_i128, 2, 1, 1, TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS) -DEF(qemu_ld_a64_i128, 2, 1, 1, TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS) -DEF(qemu_st_a32_i128, 0, 3, 1, TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS) -DEF(qemu_st_a64_i128, 0, 3, 1, TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS) +DEF(qemu_ld_i128, 2, 1, 1, TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS) +DEF(qemu_st_i128, 0, 3, 1, TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS) /* Host vector support. */ diff --git a/tcg/optimize.c b/tcg/optimize.c index bca11cc427..f922f86a1d 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -3011,29 +3011,22 @@ void tcg_optimize(TCGContext *s) CASE_OP_32_64_VEC(orc): done = fold_orc(&ctx, op); break; - case INDEX_op_qemu_ld_a32_i32: - case INDEX_op_qemu_ld_a64_i32: + case INDEX_op_qemu_ld_i32: done = fold_qemu_ld_1reg(&ctx, op); break; - case INDEX_op_qemu_ld_a32_i64: - case INDEX_op_qemu_ld_a64_i64: + case INDEX_op_qemu_ld_i64: if (TCG_TARGET_REG_BITS == 64) { done = fold_qemu_ld_1reg(&ctx, op); break; } QEMU_FALLTHROUGH; - case INDEX_op_qemu_ld_a32_i128: - case INDEX_op_qemu_ld_a64_i128: + case INDEX_op_qemu_ld_i128: done = fold_qemu_ld_2reg(&ctx, op); break; - case INDEX_op_qemu_st8_a32_i32: - case INDEX_op_qemu_st8_a64_i32: - case INDEX_op_qemu_st_a32_i32: - case INDEX_op_qemu_st_a64_i32: - case INDEX_op_qemu_st_a32_i64: - case INDEX_op_qemu_st_a64_i64: - case INDEX_op_qemu_st_a32_i128: - case INDEX_op_qemu_st_a64_i128: + case INDEX_op_qemu_st8_i32: + case INDEX_op_qemu_st_i32: + case INDEX_op_qemu_st_i64: + case INDEX_op_qemu_st_i128: done = fold_qemu_st(&ctx, op); break; CASE_OP_32_64(rem): diff --git a/tcg/tcg-op-ldst.c b/tcg/tcg-op-ldst.c index 7ba9a3ef7e..73838e2701 100644 --- a/tcg/tcg-op-ldst.c +++ b/tcg/tcg-op-ldst.c @@ -217,7 +217,6 @@ static void tcg_gen_qemu_ld_i32_int(TCGv_i32 val, TCGTemp *addr, MemOp orig_memop; MemOpIdx orig_oi, oi; TCGv_i64 copy_addr; - TCGOpcode opc; tcg_gen_req_mo(TCG_MO_LD_LD | TCG_MO_ST_LD); orig_memop = memop = tcg_canonicalize_memop(memop, 0, 0); @@ -233,12 +232,8 @@ static void tcg_gen_qemu_ld_i32_int(TCGv_i32 val, TCGTemp *addr, } copy_addr = plugin_maybe_preserve_addr(addr); - if (tcg_ctx->addr_type == TCG_TYPE_I32) { - opc = INDEX_op_qemu_ld_a32_i32; - } else { - opc = INDEX_op_qemu_ld_a64_i32; - } - gen_ldst(opc, TCG_TYPE_I32, tcgv_i32_temp(val), NULL, addr, oi); + gen_ldst(INDEX_op_qemu_ld_i32, TCG_TYPE_I32, + tcgv_i32_temp(val), NULL, addr, oi); plugin_gen_mem_callbacks_i32(val, copy_addr, addr, orig_oi, QEMU_PLUGIN_MEM_R); @@ -295,17 +290,9 @@ static void tcg_gen_qemu_st_i32_int(TCGv_i32 val, TCGTemp *addr, } if (TCG_TARGET_HAS_qemu_st8_i32 && (memop & MO_SIZE) == MO_8) { - if (tcg_ctx->addr_type == TCG_TYPE_I32) { - opc = INDEX_op_qemu_st8_a32_i32; - } else { - opc = INDEX_op_qemu_st8_a64_i32; - } + opc = INDEX_op_qemu_st8_i32; } else { - if (tcg_ctx->addr_type == TCG_TYPE_I32) { - opc = INDEX_op_qemu_st_a32_i32; - } else { - opc = INDEX_op_qemu_st_a64_i32; - } + opc = INDEX_op_qemu_st_i32; } gen_ldst(opc, TCG_TYPE_I32, tcgv_i32_temp(val), NULL, addr, oi); plugin_gen_mem_callbacks_i32(val, NULL, addr, orig_oi, QEMU_PLUGIN_MEM_W); @@ -329,7 +316,6 @@ static void tcg_gen_qemu_ld_i64_int(TCGv_i64 val, TCGTemp *addr, MemOp orig_memop; MemOpIdx orig_oi, oi; TCGv_i64 copy_addr; - TCGOpcode opc; if (TCG_TARGET_REG_BITS == 32 && (memop & MO_SIZE) < MO_64) { tcg_gen_qemu_ld_i32_int(TCGV_LOW(val), addr, idx, memop); @@ -355,12 +341,7 @@ static void tcg_gen_qemu_ld_i64_int(TCGv_i64 val, TCGTemp *addr, } copy_addr = plugin_maybe_preserve_addr(addr); - if (tcg_ctx->addr_type == TCG_TYPE_I32) { - opc = INDEX_op_qemu_ld_a32_i64; - } else { - opc = INDEX_op_qemu_ld_a64_i64; - } - gen_ldst_i64(opc, val, addr, oi); + gen_ldst_i64(INDEX_op_qemu_ld_i64, val, addr, oi); plugin_gen_mem_callbacks_i64(val, copy_addr, addr, orig_oi, QEMU_PLUGIN_MEM_R); @@ -397,7 +378,6 @@ static void tcg_gen_qemu_st_i64_int(TCGv_i64 val, TCGTemp *addr, { TCGv_i64 swap = NULL; MemOpIdx orig_oi, oi; - TCGOpcode opc; if (TCG_TARGET_REG_BITS == 32 && (memop & MO_SIZE) < MO_64) { tcg_gen_qemu_st_i32_int(TCGV_LOW(val), addr, idx, memop); @@ -428,12 +408,7 @@ static void tcg_gen_qemu_st_i64_int(TCGv_i64 val, TCGTemp *addr, oi = make_memop_idx(memop, idx); } - if (tcg_ctx->addr_type == TCG_TYPE_I32) { - opc = INDEX_op_qemu_st_a32_i64; - } else { - opc = INDEX_op_qemu_st_a64_i64; - } - gen_ldst_i64(opc, val, addr, oi); + gen_ldst_i64(INDEX_op_qemu_st_i64, val, addr, oi); plugin_gen_mem_callbacks_i64(val, NULL, addr, orig_oi, QEMU_PLUGIN_MEM_W); if (swap) { @@ -545,7 +520,6 @@ static void tcg_gen_qemu_ld_i128_int(TCGv_i128 val, TCGTemp *addr, { MemOpIdx orig_oi; TCGv_i64 ext_addr = NULL; - TCGOpcode opc; check_max_alignment(memop_alignment_bits(memop)); tcg_gen_req_mo(TCG_MO_LD_LD | TCG_MO_ST_LD); @@ -573,12 +547,7 @@ static void tcg_gen_qemu_ld_i128_int(TCGv_i128 val, TCGTemp *addr, hi = TCGV128_HIGH(val); } - if (tcg_ctx->addr_type == TCG_TYPE_I32) { - opc = INDEX_op_qemu_ld_a32_i128; - } else { - opc = INDEX_op_qemu_ld_a64_i128; - } - gen_ldst(opc, TCG_TYPE_I128, tcgv_i64_temp(lo), + gen_ldst(INDEX_op_qemu_ld_i128, TCG_TYPE_I128, tcgv_i64_temp(lo), tcgv_i64_temp(hi), addr, oi); if (need_bswap) { @@ -594,12 +563,6 @@ static void tcg_gen_qemu_ld_i128_int(TCGv_i128 val, TCGTemp *addr, canonicalize_memop_i128_as_i64(mop, memop); need_bswap = (mop[0] ^ memop) & MO_BSWAP; - if (tcg_ctx->addr_type == TCG_TYPE_I32) { - opc = INDEX_op_qemu_ld_a32_i64; - } else { - opc = INDEX_op_qemu_ld_a64_i64; - } - /* * Since there are no global TCGv_i128, there is no visible state * changed if the second load faults. Load directly into the two @@ -613,7 +576,8 @@ static void tcg_gen_qemu_ld_i128_int(TCGv_i128 val, TCGTemp *addr, y = TCGV128_LOW(val); } - gen_ldst_i64(opc, x, addr, make_memop_idx(mop[0], idx)); + gen_ldst_i64(INDEX_op_qemu_ld_i64, x, addr, + make_memop_idx(mop[0], idx)); if (need_bswap) { tcg_gen_bswap64_i64(x, x); @@ -629,7 +593,8 @@ static void tcg_gen_qemu_ld_i128_int(TCGv_i128 val, TCGTemp *addr, addr_p8 = tcgv_i64_temp(t); } - gen_ldst_i64(opc, y, addr_p8, make_memop_idx(mop[1], idx)); + gen_ldst_i64(INDEX_op_qemu_ld_i64, y, addr_p8, + make_memop_idx(mop[1], idx)); tcg_temp_free_internal(addr_p8); if (need_bswap) { @@ -663,7 +628,6 @@ static void tcg_gen_qemu_st_i128_int(TCGv_i128 val, TCGTemp *addr, { MemOpIdx orig_oi; TCGv_i64 ext_addr = NULL; - TCGOpcode opc; check_max_alignment(memop_alignment_bits(memop)); tcg_gen_req_mo(TCG_MO_ST_LD | TCG_MO_ST_ST); @@ -694,13 +658,8 @@ static void tcg_gen_qemu_st_i128_int(TCGv_i128 val, TCGTemp *addr, hi = TCGV128_HIGH(val); } - if (tcg_ctx->addr_type == TCG_TYPE_I32) { - opc = INDEX_op_qemu_st_a32_i128; - } else { - opc = INDEX_op_qemu_st_a64_i128; - } - gen_ldst(opc, TCG_TYPE_I128, tcgv_i64_temp(lo), - tcgv_i64_temp(hi), addr, oi); + gen_ldst(INDEX_op_qemu_st_i128, TCG_TYPE_I128, + tcgv_i64_temp(lo), tcgv_i64_temp(hi), addr, oi); if (need_bswap) { tcg_temp_free_i64(lo); @@ -713,12 +672,6 @@ static void tcg_gen_qemu_st_i128_int(TCGv_i128 val, TCGTemp *addr, canonicalize_memop_i128_as_i64(mop, memop); - if (tcg_ctx->addr_type == TCG_TYPE_I32) { - opc = INDEX_op_qemu_st_a32_i64; - } else { - opc = INDEX_op_qemu_st_a64_i64; - } - if ((memop & MO_BSWAP) == MO_LE) { x = TCGV128_LOW(val); y = TCGV128_HIGH(val); @@ -733,7 +686,8 @@ static void tcg_gen_qemu_st_i128_int(TCGv_i128 val, TCGTemp *addr, x = b; } - gen_ldst_i64(opc, x, addr, make_memop_idx(mop[0], idx)); + gen_ldst_i64(INDEX_op_qemu_st_i64, x, addr, + make_memop_idx(mop[0], idx)); if (tcg_ctx->addr_type == TCG_TYPE_I32) { TCGv_i32 t = tcg_temp_ebb_new_i32(); @@ -747,10 +701,12 @@ static void tcg_gen_qemu_st_i128_int(TCGv_i128 val, TCGTemp *addr, if (b) { tcg_gen_bswap64_i64(b, y); - gen_ldst_i64(opc, b, addr_p8, make_memop_idx(mop[1], idx)); + gen_ldst_i64(INDEX_op_qemu_st_i64, b, addr_p8, + make_memop_idx(mop[1], idx)); tcg_temp_free_i64(b); } else { - gen_ldst_i64(opc, y, addr_p8, make_memop_idx(mop[1], idx)); + gen_ldst_i64(INDEX_op_qemu_st_i64, y, addr_p8, + make_memop_idx(mop[1], idx)); } tcg_temp_free_internal(addr_p8); } else { diff --git a/tcg/tcg.c b/tcg/tcg.c index 14c2d38160..fef93b25ff 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -2147,24 +2147,17 @@ bool tcg_op_supported(TCGOpcode op, TCGType type, unsigned flags) case INDEX_op_exit_tb: case INDEX_op_goto_tb: case INDEX_op_goto_ptr: - case INDEX_op_qemu_ld_a32_i32: - case INDEX_op_qemu_ld_a64_i32: - case INDEX_op_qemu_st_a32_i32: - case INDEX_op_qemu_st_a64_i32: - case INDEX_op_qemu_ld_a32_i64: - case INDEX_op_qemu_ld_a64_i64: - case INDEX_op_qemu_st_a32_i64: - case INDEX_op_qemu_st_a64_i64: + case INDEX_op_qemu_ld_i32: + case INDEX_op_qemu_st_i32: + case INDEX_op_qemu_ld_i64: + case INDEX_op_qemu_st_i64: return true; - case INDEX_op_qemu_st8_a32_i32: - case INDEX_op_qemu_st8_a64_i32: + case INDEX_op_qemu_st8_i32: return TCG_TARGET_HAS_qemu_st8_i32; - case INDEX_op_qemu_ld_a32_i128: - case INDEX_op_qemu_ld_a64_i128: - case INDEX_op_qemu_st_a32_i128: - case INDEX_op_qemu_st_a64_i128: + case INDEX_op_qemu_ld_i128: + case INDEX_op_qemu_st_i128: return TCG_TARGET_HAS_qemu_ldst_i128; case INDEX_op_mov_i32: @@ -2862,20 +2855,13 @@ void tcg_dump_ops(TCGContext *s, FILE *f, bool have_prefs) } i = 1; break; - case INDEX_op_qemu_ld_a32_i32: - case INDEX_op_qemu_ld_a64_i32: - case INDEX_op_qemu_st_a32_i32: - case INDEX_op_qemu_st_a64_i32: - case INDEX_op_qemu_st8_a32_i32: - case INDEX_op_qemu_st8_a64_i32: - case INDEX_op_qemu_ld_a32_i64: - case INDEX_op_qemu_ld_a64_i64: - case INDEX_op_qemu_st_a32_i64: - case INDEX_op_qemu_st_a64_i64: - case INDEX_op_qemu_ld_a32_i128: - case INDEX_op_qemu_ld_a64_i128: - case INDEX_op_qemu_st_a32_i128: - case INDEX_op_qemu_st_a64_i128: + case INDEX_op_qemu_ld_i32: + case INDEX_op_qemu_st_i32: + case INDEX_op_qemu_st8_i32: + case INDEX_op_qemu_ld_i64: + case INDEX_op_qemu_st_i64: + case INDEX_op_qemu_ld_i128: + case INDEX_op_qemu_st_i128: { const char *s_al, *s_op, *s_at; MemOpIdx oi = op->args[k++]; diff --git a/tcg/tci.c b/tcg/tci.c index 8c1c53424d..d223258efe 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -154,16 +154,6 @@ static void tci_args_rrrbb(uint32_t insn, TCGReg *r0, TCGReg *r1, *i4 = extract32(insn, 26, 6); } -static void tci_args_rrrrr(uint32_t insn, TCGReg *r0, TCGReg *r1, - TCGReg *r2, TCGReg *r3, TCGReg *r4) -{ - *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); -} - static void tci_args_rrrr(uint32_t insn, TCGReg *r0, TCGReg *r1, TCGReg *r2, TCGReg *r3) { @@ -912,43 +902,21 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, tb_ptr = ptr; break; - case INDEX_op_qemu_ld_a32_i32: + case INDEX_op_qemu_ld_i32: tci_args_rrm(insn, &r0, &r1, &oi); - taddr = (uint32_t)regs[r1]; - goto do_ld_i32; - case INDEX_op_qemu_ld_a64_i32: - if (TCG_TARGET_REG_BITS == 64) { - tci_args_rrm(insn, &r0, &r1, &oi); - taddr = regs[r1]; - } else { - tci_args_rrrr(insn, &r0, &r1, &r2, &r3); - taddr = tci_uint64(regs[r2], regs[r1]); - oi = regs[r3]; - } - do_ld_i32: + taddr = regs[r1]; regs[r0] = tci_qemu_ld(env, taddr, oi, tb_ptr); break; - case INDEX_op_qemu_ld_a32_i64: - if (TCG_TARGET_REG_BITS == 64) { - tci_args_rrm(insn, &r0, &r1, &oi); - taddr = (uint32_t)regs[r1]; - } else { - tci_args_rrrr(insn, &r0, &r1, &r2, &r3); - taddr = (uint32_t)regs[r2]; - oi = regs[r3]; - } - goto do_ld_i64; - case INDEX_op_qemu_ld_a64_i64: + case INDEX_op_qemu_ld_i64: if (TCG_TARGET_REG_BITS == 64) { tci_args_rrm(insn, &r0, &r1, &oi); taddr = regs[r1]; } else { - tci_args_rrrrr(insn, &r0, &r1, &r2, &r3, &r4); - taddr = tci_uint64(regs[r3], regs[r2]); - oi = regs[r4]; + tci_args_rrrr(insn, &r0, &r1, &r2, &r3); + taddr = regs[r2]; + oi = regs[r3]; } - do_ld_i64: tmp64 = tci_qemu_ld(env, taddr, oi, tb_ptr); if (TCG_TARGET_REG_BITS == 32) { tci_write_reg64(regs, r1, r0, tmp64); @@ -957,47 +925,23 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, } break; - case INDEX_op_qemu_st_a32_i32: + case INDEX_op_qemu_st_i32: tci_args_rrm(insn, &r0, &r1, &oi); - taddr = (uint32_t)regs[r1]; - goto do_st_i32; - case INDEX_op_qemu_st_a64_i32: - if (TCG_TARGET_REG_BITS == 64) { - tci_args_rrm(insn, &r0, &r1, &oi); - taddr = regs[r1]; - } else { - tci_args_rrrr(insn, &r0, &r1, &r2, &r3); - taddr = tci_uint64(regs[r2], regs[r1]); - oi = regs[r3]; - } - do_st_i32: + taddr = regs[r1]; tci_qemu_st(env, taddr, regs[r0], oi, tb_ptr); break; - case INDEX_op_qemu_st_a32_i64: - if (TCG_TARGET_REG_BITS == 64) { - tci_args_rrm(insn, &r0, &r1, &oi); - tmp64 = regs[r0]; - taddr = (uint32_t)regs[r1]; - } else { - tci_args_rrrr(insn, &r0, &r1, &r2, &r3); - tmp64 = tci_uint64(regs[r1], regs[r0]); - taddr = (uint32_t)regs[r2]; - oi = regs[r3]; - } - goto do_st_i64; - case INDEX_op_qemu_st_a64_i64: + case INDEX_op_qemu_st_i64: if (TCG_TARGET_REG_BITS == 64) { tci_args_rrm(insn, &r0, &r1, &oi); tmp64 = regs[r0]; taddr = regs[r1]; } else { - tci_args_rrrrr(insn, &r0, &r1, &r2, &r3, &r4); + tci_args_rrrr(insn, &r0, &r1, &r2, &r3); tmp64 = tci_uint64(regs[r1], regs[r0]); - taddr = tci_uint64(regs[r3], regs[r2]); - oi = regs[r4]; + taddr = regs[r2]; + oi = regs[r3]; } - do_st_i64: tci_qemu_st(env, taddr, tmp64, oi, tb_ptr); break; @@ -1269,42 +1213,21 @@ int print_insn_tci(bfd_vma addr, disassemble_info *info) str_r(r3), str_r(r4), str_r(r5)); break; - case INDEX_op_qemu_ld_a32_i32: - case INDEX_op_qemu_st_a32_i32: - len = 1 + 1; - goto do_qemu_ldst; - case INDEX_op_qemu_ld_a32_i64: - case INDEX_op_qemu_st_a32_i64: - case INDEX_op_qemu_ld_a64_i32: - case INDEX_op_qemu_st_a64_i32: - len = 1 + DIV_ROUND_UP(64, TCG_TARGET_REG_BITS); - goto do_qemu_ldst; - case INDEX_op_qemu_ld_a64_i64: - case INDEX_op_qemu_st_a64_i64: - len = 2 * DIV_ROUND_UP(64, TCG_TARGET_REG_BITS); - goto do_qemu_ldst; - do_qemu_ldst: - switch (len) { - case 2: - 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: + case INDEX_op_qemu_ld_i64: + case INDEX_op_qemu_st_i64: + if (TCG_TARGET_REG_BITS == 32) { 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; - case 4: - 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), str_r(r4)); - break; - default: - g_assert_not_reached(); } + /* fall through */ + case INDEX_op_qemu_ld_i32: + case INDEX_op_qemu_st_i32: + 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 0: diff --git a/tcg/aarch64/tcg-target.c.inc b/tcg/aarch64/tcg-target.c.inc index 66eb4b73b5..45dc2c649b 100644 --- a/tcg/aarch64/tcg-target.c.inc +++ b/tcg/aarch64/tcg-target.c.inc @@ -2398,24 +2398,18 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType ext, tcg_out_insn(s, 3506, CSEL, ext, a0, REG0(3), REG0(4), args[5]); break; - case INDEX_op_qemu_ld_a32_i32: - case INDEX_op_qemu_ld_a64_i32: - case INDEX_op_qemu_ld_a32_i64: - case INDEX_op_qemu_ld_a64_i64: + case INDEX_op_qemu_ld_i32: + case INDEX_op_qemu_ld_i64: tcg_out_qemu_ld(s, a0, a1, a2, ext); break; - case INDEX_op_qemu_st_a32_i32: - case INDEX_op_qemu_st_a64_i32: - case INDEX_op_qemu_st_a32_i64: - case INDEX_op_qemu_st_a64_i64: + case INDEX_op_qemu_st_i32: + case INDEX_op_qemu_st_i64: tcg_out_qemu_st(s, REG0(0), a1, a2, ext); break; - case INDEX_op_qemu_ld_a32_i128: - case INDEX_op_qemu_ld_a64_i128: + case INDEX_op_qemu_ld_i128: tcg_out_qemu_ldst_i128(s, a0, a1, a2, args[3], true); break; - case INDEX_op_qemu_st_a32_i128: - case INDEX_op_qemu_st_a64_i128: + case INDEX_op_qemu_st_i128: tcg_out_qemu_ldst_i128(s, REG0(0), REG0(1), a2, args[3], false); break; @@ -3084,21 +3078,15 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) case INDEX_op_movcond_i64: return C_O1_I4(r, r, rC, rZ, rZ); - case INDEX_op_qemu_ld_a32_i32: - case INDEX_op_qemu_ld_a64_i32: - case INDEX_op_qemu_ld_a32_i64: - case INDEX_op_qemu_ld_a64_i64: + case INDEX_op_qemu_ld_i32: + case INDEX_op_qemu_ld_i64: return C_O1_I1(r, r); - case INDEX_op_qemu_ld_a32_i128: - case INDEX_op_qemu_ld_a64_i128: + case INDEX_op_qemu_ld_i128: return C_O2_I1(r, r, r); - case INDEX_op_qemu_st_a32_i32: - case INDEX_op_qemu_st_a64_i32: - case INDEX_op_qemu_st_a32_i64: - case INDEX_op_qemu_st_a64_i64: + case INDEX_op_qemu_st_i32: + case INDEX_op_qemu_st_i64: return C_O0_I2(rZ, r); - case INDEX_op_qemu_st_a32_i128: - case INDEX_op_qemu_st_a64_i128: + case INDEX_op_qemu_st_i128: return C_O0_I3(rZ, rZ, r); case INDEX_op_deposit_i32: diff --git a/tcg/arm/tcg-target.c.inc b/tcg/arm/tcg-target.c.inc index 12dad7307f..05bb367a39 100644 --- a/tcg/arm/tcg-target.c.inc +++ b/tcg/arm/tcg-target.c.inc @@ -2071,37 +2071,21 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, ARITH_MOV, args[0], 0, 0); break; - case INDEX_op_qemu_ld_a32_i32: + case INDEX_op_qemu_ld_i32: tcg_out_qemu_ld(s, args[0], -1, args[1], -1, args[2], TCG_TYPE_I32); break; - case INDEX_op_qemu_ld_a64_i32: - tcg_out_qemu_ld(s, args[0], -1, args[1], args[2], - args[3], TCG_TYPE_I32); - break; - case INDEX_op_qemu_ld_a32_i64: + case INDEX_op_qemu_ld_i64: tcg_out_qemu_ld(s, args[0], args[1], args[2], -1, args[3], TCG_TYPE_I64); break; - case INDEX_op_qemu_ld_a64_i64: - tcg_out_qemu_ld(s, args[0], args[1], args[2], args[3], - args[4], TCG_TYPE_I64); - break; - case INDEX_op_qemu_st_a32_i32: + case INDEX_op_qemu_st_i32: tcg_out_qemu_st(s, args[0], -1, args[1], -1, args[2], TCG_TYPE_I32); break; - case INDEX_op_qemu_st_a64_i32: - tcg_out_qemu_st(s, args[0], -1, args[1], args[2], - args[3], TCG_TYPE_I32); - break; - case INDEX_op_qemu_st_a32_i64: + case INDEX_op_qemu_st_i64: tcg_out_qemu_st(s, args[0], args[1], args[2], -1, args[3], TCG_TYPE_I64); break; - case INDEX_op_qemu_st_a64_i64: - tcg_out_qemu_st(s, args[0], args[1], args[2], args[3], - args[4], TCG_TYPE_I64); - break; case INDEX_op_bswap16_i32: tcg_out_bswap16(s, COND_AL, args[0], args[1], args[2]); @@ -2243,22 +2227,14 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) case INDEX_op_setcond2_i32: return C_O1_I4(r, r, r, rI, rI); - case INDEX_op_qemu_ld_a32_i32: + case INDEX_op_qemu_ld_i32: return C_O1_I1(r, q); - case INDEX_op_qemu_ld_a64_i32: - return C_O1_I2(r, q, q); - case INDEX_op_qemu_ld_a32_i64: + case INDEX_op_qemu_ld_i64: return C_O2_I1(e, p, q); - case INDEX_op_qemu_ld_a64_i64: - return C_O2_I2(e, p, q, q); - case INDEX_op_qemu_st_a32_i32: + case INDEX_op_qemu_st_i32: return C_O0_I2(q, q); - case INDEX_op_qemu_st_a64_i32: - return C_O0_I3(q, q, q); - case INDEX_op_qemu_st_a32_i64: + case INDEX_op_qemu_st_i64: return C_O0_I3(Q, p, q); - case INDEX_op_qemu_st_a64_i64: - return C_O0_I4(Q, p, q, q); case INDEX_op_st_vec: return C_O0_I2(w, r); diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc index 2cac151331..ca6e8abc57 100644 --- a/tcg/i386/tcg-target.c.inc +++ b/tcg/i386/tcg-target.c.inc @@ -2879,62 +2879,33 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, tcg_out_modrm(s, OPC_GRP3_Ev + rexw, EXT3_NOT, a0); break; - case INDEX_op_qemu_ld_a64_i32: - if (TCG_TARGET_REG_BITS == 32) { - tcg_out_qemu_ld(s, a0, -1, a1, a2, args[3], TCG_TYPE_I32); - break; - } - /* fall through */ - case INDEX_op_qemu_ld_a32_i32: + case INDEX_op_qemu_ld_i32: tcg_out_qemu_ld(s, a0, -1, a1, -1, a2, TCG_TYPE_I32); break; - case INDEX_op_qemu_ld_a32_i64: + case INDEX_op_qemu_ld_i64: if (TCG_TARGET_REG_BITS == 64) { tcg_out_qemu_ld(s, a0, -1, a1, -1, a2, TCG_TYPE_I64); } else { tcg_out_qemu_ld(s, a0, a1, a2, -1, args[3], TCG_TYPE_I64); } break; - case INDEX_op_qemu_ld_a64_i64: - if (TCG_TARGET_REG_BITS == 64) { - tcg_out_qemu_ld(s, a0, -1, a1, -1, a2, TCG_TYPE_I64); - } else { - tcg_out_qemu_ld(s, a0, a1, a2, args[3], args[4], TCG_TYPE_I64); - } - break; - case INDEX_op_qemu_ld_a32_i128: - case INDEX_op_qemu_ld_a64_i128: + case INDEX_op_qemu_ld_i128: tcg_debug_assert(TCG_TARGET_REG_BITS == 64); tcg_out_qemu_ld(s, a0, a1, a2, -1, args[3], TCG_TYPE_I128); break; - case INDEX_op_qemu_st_a64_i32: - case INDEX_op_qemu_st8_a64_i32: - if (TCG_TARGET_REG_BITS == 32) { - tcg_out_qemu_st(s, a0, -1, a1, a2, args[3], TCG_TYPE_I32); - break; - } - /* fall through */ - case INDEX_op_qemu_st_a32_i32: - case INDEX_op_qemu_st8_a32_i32: + case INDEX_op_qemu_st_i32: + case INDEX_op_qemu_st8_i32: tcg_out_qemu_st(s, a0, -1, a1, -1, a2, TCG_TYPE_I32); break; - case INDEX_op_qemu_st_a32_i64: + case INDEX_op_qemu_st_i64: if (TCG_TARGET_REG_BITS == 64) { tcg_out_qemu_st(s, a0, -1, a1, -1, a2, TCG_TYPE_I64); } else { tcg_out_qemu_st(s, a0, a1, a2, -1, args[3], TCG_TYPE_I64); } break; - case INDEX_op_qemu_st_a64_i64: - if (TCG_TARGET_REG_BITS == 64) { - tcg_out_qemu_st(s, a0, -1, a1, -1, a2, TCG_TYPE_I64); - } else { - tcg_out_qemu_st(s, a0, a1, a2, args[3], args[4], TCG_TYPE_I64); - } - break; - case INDEX_op_qemu_st_a32_i128: - case INDEX_op_qemu_st_a64_i128: + case INDEX_op_qemu_st_i128: tcg_debug_assert(TCG_TARGET_REG_BITS == 64); tcg_out_qemu_st(s, a0, a1, a2, -1, args[3], TCG_TYPE_I128); break; @@ -3824,36 +3795,24 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) case INDEX_op_clz_i64: return have_lzcnt ? C_N1_I2(r, r, rW) : C_N1_I2(r, r, r); - case INDEX_op_qemu_ld_a32_i32: + case INDEX_op_qemu_ld_i32: return C_O1_I1(r, L); - case INDEX_op_qemu_ld_a64_i32: - return TCG_TARGET_REG_BITS == 64 ? C_O1_I1(r, L) : C_O1_I2(r, L, L); - case INDEX_op_qemu_st_a32_i32: + case INDEX_op_qemu_st_i32: return C_O0_I2(L, L); - case INDEX_op_qemu_st_a64_i32: - return TCG_TARGET_REG_BITS == 64 ? C_O0_I2(L, L) : C_O0_I3(L, L, L); - case INDEX_op_qemu_st8_a32_i32: + case INDEX_op_qemu_st8_i32: return C_O0_I2(s, L); - case INDEX_op_qemu_st8_a64_i32: - return TCG_TARGET_REG_BITS == 64 ? C_O0_I2(s, L) : C_O0_I3(s, L, L); - case INDEX_op_qemu_ld_a32_i64: + case INDEX_op_qemu_ld_i64: return TCG_TARGET_REG_BITS == 64 ? C_O1_I1(r, L) : C_O2_I1(r, r, L); - case INDEX_op_qemu_ld_a64_i64: - return TCG_TARGET_REG_BITS == 64 ? C_O1_I1(r, L) : C_O2_I2(r, r, L, L); - case INDEX_op_qemu_st_a32_i64: + case INDEX_op_qemu_st_i64: return TCG_TARGET_REG_BITS == 64 ? C_O0_I2(L, L) : C_O0_I3(L, L, L); - case INDEX_op_qemu_st_a64_i64: - return TCG_TARGET_REG_BITS == 64 ? C_O0_I2(L, L) : C_O0_I4(L, L, L, L); - case INDEX_op_qemu_ld_a32_i128: - case INDEX_op_qemu_ld_a64_i128: + case INDEX_op_qemu_ld_i128: tcg_debug_assert(TCG_TARGET_REG_BITS == 64); return C_O2_I1(r, r, L); - case INDEX_op_qemu_st_a32_i128: - case INDEX_op_qemu_st_a64_i128: + case INDEX_op_qemu_st_i128: tcg_debug_assert(TCG_TARGET_REG_BITS == 64); return C_O0_I3(L, L, L); diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc index cebe8dd354..4f32bf3e97 100644 --- a/tcg/loongarch64/tcg-target.c.inc +++ b/tcg/loongarch64/tcg-target.c.inc @@ -1675,28 +1675,22 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, tcg_out_ldst(s, OPC_ST_D, a0, a1, a2); break; - case INDEX_op_qemu_ld_a32_i32: - case INDEX_op_qemu_ld_a64_i32: + case INDEX_op_qemu_ld_i32: tcg_out_qemu_ld(s, a0, a1, a2, TCG_TYPE_I32); break; - case INDEX_op_qemu_ld_a32_i64: - case INDEX_op_qemu_ld_a64_i64: + case INDEX_op_qemu_ld_i64: tcg_out_qemu_ld(s, a0, a1, a2, TCG_TYPE_I64); break; - case INDEX_op_qemu_ld_a32_i128: - case INDEX_op_qemu_ld_a64_i128: + case INDEX_op_qemu_ld_i128: tcg_out_qemu_ldst_i128(s, a0, a1, a2, a3, true); break; - case INDEX_op_qemu_st_a32_i32: - case INDEX_op_qemu_st_a64_i32: + case INDEX_op_qemu_st_i32: tcg_out_qemu_st(s, a0, a1, a2, TCG_TYPE_I32); break; - case INDEX_op_qemu_st_a32_i64: - case INDEX_op_qemu_st_a64_i64: + case INDEX_op_qemu_st_i64: tcg_out_qemu_st(s, a0, a1, a2, TCG_TYPE_I64); break; - case INDEX_op_qemu_st_a32_i128: - case INDEX_op_qemu_st_a64_i128: + case INDEX_op_qemu_st_i128: tcg_out_qemu_ldst_i128(s, a0, a1, a2, a3, false); break; @@ -2233,18 +2227,14 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) case INDEX_op_st32_i64: case INDEX_op_st_i32: case INDEX_op_st_i64: - case INDEX_op_qemu_st_a32_i32: - case INDEX_op_qemu_st_a64_i32: - case INDEX_op_qemu_st_a32_i64: - case INDEX_op_qemu_st_a64_i64: + case INDEX_op_qemu_st_i32: + case INDEX_op_qemu_st_i64: return C_O0_I2(rZ, r); - case INDEX_op_qemu_ld_a32_i128: - case INDEX_op_qemu_ld_a64_i128: + case INDEX_op_qemu_ld_i128: return C_N2_I1(r, r, r); - case INDEX_op_qemu_st_a32_i128: - case INDEX_op_qemu_st_a64_i128: + case INDEX_op_qemu_st_i128: return C_O0_I3(r, r, r); case INDEX_op_brcond_i32: @@ -2290,10 +2280,8 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) case INDEX_op_ld32u_i64: case INDEX_op_ld_i32: case INDEX_op_ld_i64: - case INDEX_op_qemu_ld_a32_i32: - case INDEX_op_qemu_ld_a64_i32: - case INDEX_op_qemu_ld_a32_i64: - case INDEX_op_qemu_ld_a64_i64: + case INDEX_op_qemu_ld_i32: + case INDEX_op_qemu_ld_i64: return C_O1_I1(r, r); case INDEX_op_andc_i32: diff --git a/tcg/mips/tcg-target.c.inc b/tcg/mips/tcg-target.c.inc index 99f6ef6c76..b1d512ca2a 100644 --- a/tcg/mips/tcg-target.c.inc +++ b/tcg/mips/tcg-target.c.inc @@ -2095,53 +2095,27 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, tcg_out_setcond2(s, args[5], a0, a1, a2, args[3], args[4]); break; - case INDEX_op_qemu_ld_a64_i32: - if (TCG_TARGET_REG_BITS == 32) { - tcg_out_qemu_ld(s, a0, 0, a1, a2, args[3], TCG_TYPE_I32); - break; - } - /* fall through */ - case INDEX_op_qemu_ld_a32_i32: + case INDEX_op_qemu_ld_i32: tcg_out_qemu_ld(s, a0, 0, a1, 0, a2, TCG_TYPE_I32); break; - case INDEX_op_qemu_ld_a32_i64: + case INDEX_op_qemu_ld_i64: if (TCG_TARGET_REG_BITS == 64) { tcg_out_qemu_ld(s, a0, 0, a1, 0, a2, TCG_TYPE_I64); } else { tcg_out_qemu_ld(s, a0, a1, a2, 0, args[3], TCG_TYPE_I64); } break; - case INDEX_op_qemu_ld_a64_i64: - if (TCG_TARGET_REG_BITS == 64) { - tcg_out_qemu_ld(s, a0, 0, a1, 0, a2, TCG_TYPE_I64); - } else { - tcg_out_qemu_ld(s, a0, a1, a2, args[3], args[4], TCG_TYPE_I64); - } - break; - case INDEX_op_qemu_st_a64_i32: - if (TCG_TARGET_REG_BITS == 32) { - tcg_out_qemu_st(s, a0, 0, a1, a2, args[3], TCG_TYPE_I32); - break; - } - /* fall through */ - case INDEX_op_qemu_st_a32_i32: + case INDEX_op_qemu_st_i32: tcg_out_qemu_st(s, a0, 0, a1, 0, a2, TCG_TYPE_I32); break; - case INDEX_op_qemu_st_a32_i64: + case INDEX_op_qemu_st_i64: if (TCG_TARGET_REG_BITS == 64) { tcg_out_qemu_st(s, a0, 0, a1, 0, a2, TCG_TYPE_I64); } else { tcg_out_qemu_st(s, a0, a1, a2, 0, args[3], TCG_TYPE_I64); } break; - case INDEX_op_qemu_st_a64_i64: - if (TCG_TARGET_REG_BITS == 64) { - tcg_out_qemu_st(s, a0, 0, a1, 0, a2, TCG_TYPE_I64); - } else { - tcg_out_qemu_st(s, a0, a1, a2, args[3], args[4], TCG_TYPE_I64); - } - break; case INDEX_op_add2_i32: tcg_out_addsub2(s, a0, a1, a2, args[3], args[4], args[5], @@ -2301,23 +2275,14 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) case INDEX_op_brcond2_i32: return C_O0_I4(rZ, rZ, rZ, rZ); - case INDEX_op_qemu_ld_a32_i32: + case INDEX_op_qemu_ld_i32: return C_O1_I1(r, r); - case INDEX_op_qemu_ld_a64_i32: - return TCG_TARGET_REG_BITS == 64 ? C_O1_I1(r, r) : C_O1_I2(r, r, r); - case INDEX_op_qemu_st_a32_i32: + case INDEX_op_qemu_st_i32: return C_O0_I2(rZ, r); - case INDEX_op_qemu_st_a64_i32: - return TCG_TARGET_REG_BITS == 64 ? C_O0_I2(rZ, r) : C_O0_I3(rZ, r, r); - case INDEX_op_qemu_ld_a32_i64: + case INDEX_op_qemu_ld_i64: return TCG_TARGET_REG_BITS == 64 ? C_O1_I1(r, r) : C_O2_I1(r, r, r); - case INDEX_op_qemu_ld_a64_i64: - return TCG_TARGET_REG_BITS == 64 ? C_O1_I1(r, r) : C_O2_I2(r, r, r, r); - case INDEX_op_qemu_st_a32_i64: + case INDEX_op_qemu_st_i64: return TCG_TARGET_REG_BITS == 64 ? C_O0_I2(rZ, r) : C_O0_I3(rZ, rZ, r); - case INDEX_op_qemu_st_a64_i64: - return (TCG_TARGET_REG_BITS == 64 ? C_O0_I2(rZ, r) - : C_O0_I4(rZ, rZ, r, r)); default: return C_NotImplemented; diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc index 6e711cd53f..801cb6f3cb 100644 --- a/tcg/ppc/tcg-target.c.inc +++ b/tcg/ppc/tcg-target.c.inc @@ -3308,17 +3308,10 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, tcg_out32(s, MODUD | TAB(args[0], args[1], args[2])); break; - case INDEX_op_qemu_ld_a64_i32: - if (TCG_TARGET_REG_BITS == 32) { - tcg_out_qemu_ld(s, args[0], -1, args[1], args[2], - args[3], TCG_TYPE_I32); - break; - } - /* fall through */ - case INDEX_op_qemu_ld_a32_i32: + case INDEX_op_qemu_ld_i32: tcg_out_qemu_ld(s, args[0], -1, args[1], -1, args[2], TCG_TYPE_I32); break; - case INDEX_op_qemu_ld_a32_i64: + case INDEX_op_qemu_ld_i64: if (TCG_TARGET_REG_BITS == 64) { tcg_out_qemu_ld(s, args[0], -1, args[1], -1, args[2], TCG_TYPE_I64); @@ -3327,32 +3320,15 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, args[3], TCG_TYPE_I64); } break; - case INDEX_op_qemu_ld_a64_i64: - if (TCG_TARGET_REG_BITS == 64) { - tcg_out_qemu_ld(s, args[0], -1, args[1], -1, - args[2], TCG_TYPE_I64); - } else { - tcg_out_qemu_ld(s, args[0], args[1], args[2], args[3], - args[4], TCG_TYPE_I64); - } - break; - case INDEX_op_qemu_ld_a32_i128: - case INDEX_op_qemu_ld_a64_i128: + case INDEX_op_qemu_ld_i128: tcg_debug_assert(TCG_TARGET_REG_BITS == 64); tcg_out_qemu_ldst_i128(s, args[0], args[1], args[2], args[3], true); break; - case INDEX_op_qemu_st_a64_i32: - if (TCG_TARGET_REG_BITS == 32) { - tcg_out_qemu_st(s, args[0], -1, args[1], args[2], - args[3], TCG_TYPE_I32); - break; - } - /* fall through */ - case INDEX_op_qemu_st_a32_i32: + case INDEX_op_qemu_st_i32: tcg_out_qemu_st(s, args[0], -1, args[1], -1, args[2], TCG_TYPE_I32); break; - case INDEX_op_qemu_st_a32_i64: + case INDEX_op_qemu_st_i64: if (TCG_TARGET_REG_BITS == 64) { tcg_out_qemu_st(s, args[0], -1, args[1], -1, args[2], TCG_TYPE_I64); @@ -3361,17 +3337,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, args[3], TCG_TYPE_I64); } break; - case INDEX_op_qemu_st_a64_i64: - if (TCG_TARGET_REG_BITS == 64) { - tcg_out_qemu_st(s, args[0], -1, args[1], -1, - args[2], TCG_TYPE_I64); - } else { - tcg_out_qemu_st(s, args[0], args[1], args[2], args[3], - args[4], TCG_TYPE_I64); - } - break; - case INDEX_op_qemu_st_a32_i128: - case INDEX_op_qemu_st_a64_i128: + case INDEX_op_qemu_st_i128: tcg_debug_assert(TCG_TARGET_REG_BITS == 64); tcg_out_qemu_ldst_i128(s, args[0], args[1], args[2], args[3], false); break; @@ -4306,29 +4272,19 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) case INDEX_op_sub2_i32: return C_O2_I4(r, r, rI, rZM, r, r); - case INDEX_op_qemu_ld_a32_i32: + case INDEX_op_qemu_ld_i32: return C_O1_I1(r, r); - case INDEX_op_qemu_ld_a64_i32: - return TCG_TARGET_REG_BITS == 64 ? C_O1_I1(r, r) : C_O1_I2(r, r, r); - case INDEX_op_qemu_ld_a32_i64: + case INDEX_op_qemu_ld_i64: return TCG_TARGET_REG_BITS == 64 ? C_O1_I1(r, r) : C_O2_I1(r, r, r); - case INDEX_op_qemu_ld_a64_i64: - return TCG_TARGET_REG_BITS == 64 ? C_O1_I1(r, r) : C_O2_I2(r, r, r, r); - case INDEX_op_qemu_st_a32_i32: + case INDEX_op_qemu_st_i32: return C_O0_I2(r, r); - case INDEX_op_qemu_st_a64_i32: + case INDEX_op_qemu_st_i64: return TCG_TARGET_REG_BITS == 64 ? C_O0_I2(r, r) : C_O0_I3(r, r, r); - case INDEX_op_qemu_st_a32_i64: - return TCG_TARGET_REG_BITS == 64 ? C_O0_I2(r, r) : C_O0_I3(r, r, r); - case INDEX_op_qemu_st_a64_i64: - return TCG_TARGET_REG_BITS == 64 ? C_O0_I2(r, r) : C_O0_I4(r, r, r, r); - case INDEX_op_qemu_ld_a32_i128: - case INDEX_op_qemu_ld_a64_i128: + case INDEX_op_qemu_ld_i128: return C_N1O1_I1(o, m, r); - case INDEX_op_qemu_st_a32_i128: - case INDEX_op_qemu_st_a64_i128: + case INDEX_op_qemu_st_i128: return C_O0_I3(o, m, r); case INDEX_op_add_vec: diff --git a/tcg/riscv/tcg-target.c.inc b/tcg/riscv/tcg-target.c.inc index 61dc310c1a..55a3398712 100644 --- a/tcg/riscv/tcg-target.c.inc +++ b/tcg/riscv/tcg-target.c.inc @@ -2309,20 +2309,16 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, args[3], const_args[3], args[4], const_args[4]); break; - case INDEX_op_qemu_ld_a32_i32: - case INDEX_op_qemu_ld_a64_i32: + case INDEX_op_qemu_ld_i32: tcg_out_qemu_ld(s, a0, a1, a2, TCG_TYPE_I32); break; - case INDEX_op_qemu_ld_a32_i64: - case INDEX_op_qemu_ld_a64_i64: + case INDEX_op_qemu_ld_i64: tcg_out_qemu_ld(s, a0, a1, a2, TCG_TYPE_I64); break; - case INDEX_op_qemu_st_a32_i32: - case INDEX_op_qemu_st_a64_i32: + case INDEX_op_qemu_st_i32: tcg_out_qemu_st(s, a0, a1, a2, TCG_TYPE_I32); break; - case INDEX_op_qemu_st_a32_i64: - case INDEX_op_qemu_st_a64_i64: + case INDEX_op_qemu_st_i64: tcg_out_qemu_st(s, a0, a1, a2, TCG_TYPE_I64); break; @@ -2761,15 +2757,11 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) case INDEX_op_sub2_i64: return C_O2_I4(r, r, rZ, rZ, rM, rM); - case INDEX_op_qemu_ld_a32_i32: - case INDEX_op_qemu_ld_a64_i32: - case INDEX_op_qemu_ld_a32_i64: - case INDEX_op_qemu_ld_a64_i64: + case INDEX_op_qemu_ld_i32: + case INDEX_op_qemu_ld_i64: return C_O1_I1(r, r); - case INDEX_op_qemu_st_a32_i32: - case INDEX_op_qemu_st_a64_i32: - case INDEX_op_qemu_st_a32_i64: - case INDEX_op_qemu_st_a64_i64: + case INDEX_op_qemu_st_i32: + case INDEX_op_qemu_st_i64: return C_O0_I2(rZ, r); case INDEX_op_st_vec: diff --git a/tcg/s390x/tcg-target.c.inc b/tcg/s390x/tcg-target.c.inc index dc7722dc31..6786e7b316 100644 --- a/tcg/s390x/tcg-target.c.inc +++ b/tcg/s390x/tcg-target.c.inc @@ -2455,28 +2455,22 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, args[2], const_args[2], args[3], const_args[3], args[4]); break; - case INDEX_op_qemu_ld_a32_i32: - case INDEX_op_qemu_ld_a64_i32: + case INDEX_op_qemu_ld_i32: tcg_out_qemu_ld(s, args[0], args[1], args[2], TCG_TYPE_I32); break; - case INDEX_op_qemu_ld_a32_i64: - case INDEX_op_qemu_ld_a64_i64: + case INDEX_op_qemu_ld_i64: tcg_out_qemu_ld(s, args[0], args[1], args[2], TCG_TYPE_I64); break; - case INDEX_op_qemu_st_a32_i32: - case INDEX_op_qemu_st_a64_i32: + case INDEX_op_qemu_st_i32: tcg_out_qemu_st(s, args[0], args[1], args[2], TCG_TYPE_I32); break; - case INDEX_op_qemu_st_a32_i64: - case INDEX_op_qemu_st_a64_i64: + case INDEX_op_qemu_st_i64: tcg_out_qemu_st(s, args[0], args[1], args[2], TCG_TYPE_I64); break; - case INDEX_op_qemu_ld_a32_i128: - case INDEX_op_qemu_ld_a64_i128: + case INDEX_op_qemu_ld_i128: tcg_out_qemu_ldst_i128(s, args[0], args[1], args[2], args[3], true); break; - case INDEX_op_qemu_st_a32_i128: - case INDEX_op_qemu_st_a64_i128: + case INDEX_op_qemu_st_i128: tcg_out_qemu_ldst_i128(s, args[0], args[1], args[2], args[3], false); break; @@ -3366,21 +3360,15 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) case INDEX_op_ctpop_i64: return C_O1_I1(r, r); - case INDEX_op_qemu_ld_a32_i32: - case INDEX_op_qemu_ld_a64_i32: - case INDEX_op_qemu_ld_a32_i64: - case INDEX_op_qemu_ld_a64_i64: + case INDEX_op_qemu_ld_i32: + case INDEX_op_qemu_ld_i64: return C_O1_I1(r, r); - case INDEX_op_qemu_st_a32_i64: - case INDEX_op_qemu_st_a64_i64: - case INDEX_op_qemu_st_a32_i32: - case INDEX_op_qemu_st_a64_i32: + case INDEX_op_qemu_st_i64: + case INDEX_op_qemu_st_i32: return C_O0_I2(r, r); - case INDEX_op_qemu_ld_a32_i128: - case INDEX_op_qemu_ld_a64_i128: + case INDEX_op_qemu_ld_i128: return C_O2_I1(o, m, r); - case INDEX_op_qemu_st_a32_i128: - case INDEX_op_qemu_st_a64_i128: + case INDEX_op_qemu_st_i128: return C_O0_I3(o, m, r); case INDEX_op_deposit_i32: diff --git a/tcg/sparc64/tcg-target.c.inc b/tcg/sparc64/tcg-target.c.inc index 733cb51651..ea0a3b8692 100644 --- a/tcg/sparc64/tcg-target.c.inc +++ b/tcg/sparc64/tcg-target.c.inc @@ -1426,20 +1426,16 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, tcg_out_arithi(s, a1, a0, 32, SHIFT_SRLX); break; - case INDEX_op_qemu_ld_a32_i32: - case INDEX_op_qemu_ld_a64_i32: + case INDEX_op_qemu_ld_i32: tcg_out_qemu_ld(s, a0, a1, a2, TCG_TYPE_I32); break; - case INDEX_op_qemu_ld_a32_i64: - case INDEX_op_qemu_ld_a64_i64: + case INDEX_op_qemu_ld_i64: tcg_out_qemu_ld(s, a0, a1, a2, TCG_TYPE_I64); break; - case INDEX_op_qemu_st_a32_i32: - case INDEX_op_qemu_st_a64_i32: + case INDEX_op_qemu_st_i32: tcg_out_qemu_st(s, a0, a1, a2, TCG_TYPE_I32); break; - case INDEX_op_qemu_st_a32_i64: - case INDEX_op_qemu_st_a64_i64: + case INDEX_op_qemu_st_i64: tcg_out_qemu_st(s, a0, a1, a2, TCG_TYPE_I64); break; @@ -1570,10 +1566,8 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) case INDEX_op_extu_i32_i64: case INDEX_op_extract_i64: case INDEX_op_sextract_i64: - case INDEX_op_qemu_ld_a32_i32: - case INDEX_op_qemu_ld_a64_i32: - case INDEX_op_qemu_ld_a32_i64: - case INDEX_op_qemu_ld_a64_i64: + case INDEX_op_qemu_ld_i32: + case INDEX_op_qemu_ld_i64: return C_O1_I1(r, r); case INDEX_op_st8_i32: @@ -1583,10 +1577,8 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) case INDEX_op_st_i32: case INDEX_op_st32_i64: case INDEX_op_st_i64: - case INDEX_op_qemu_st_a32_i32: - case INDEX_op_qemu_st_a64_i32: - case INDEX_op_qemu_st_a32_i64: - case INDEX_op_qemu_st_a64_i64: + case INDEX_op_qemu_st_i32: + case INDEX_op_qemu_st_i64: return C_O0_I2(rZ, r); case INDEX_op_add_i32: diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index d6c77325a3..36e018dd19 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -169,22 +169,14 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) case INDEX_op_setcond2_i32: return C_O1_I4(r, r, r, r, r); - case INDEX_op_qemu_ld_a32_i32: + case INDEX_op_qemu_ld_i32: return C_O1_I1(r, r); - case INDEX_op_qemu_ld_a64_i32: - return TCG_TARGET_REG_BITS == 64 ? C_O1_I1(r, r) : C_O1_I2(r, r, r); - case INDEX_op_qemu_ld_a32_i64: + case INDEX_op_qemu_ld_i64: return TCG_TARGET_REG_BITS == 64 ? C_O1_I1(r, r) : C_O2_I1(r, r, r); - case INDEX_op_qemu_ld_a64_i64: - return TCG_TARGET_REG_BITS == 64 ? C_O1_I1(r, r) : C_O2_I2(r, r, r, r); - case INDEX_op_qemu_st_a32_i32: + case INDEX_op_qemu_st_i32: return C_O0_I2(r, r); - case INDEX_op_qemu_st_a64_i32: + case INDEX_op_qemu_st_i64: return TCG_TARGET_REG_BITS == 64 ? C_O0_I2(r, r) : C_O0_I3(r, r, r); - case INDEX_op_qemu_st_a32_i64: - return TCG_TARGET_REG_BITS == 64 ? C_O0_I2(r, r) : C_O0_I3(r, r, r); - case INDEX_op_qemu_st_a64_i64: - return TCG_TARGET_REG_BITS == 64 ? C_O0_I2(r, r) : C_O0_I4(r, r, r, r); default: return C_NotImplemented; @@ -422,20 +414,6 @@ static void tcg_out_op_rrrbb(TCGContext *s, TCGOpcode op, TCGReg r0, tcg_out32(s, insn); } -static void tcg_out_op_rrrrr(TCGContext *s, TCGOpcode op, TCGReg r0, - TCGReg r1, TCGReg r2, TCGReg r3, TCGReg r4) -{ - tcg_insn_unit insn = 0; - - 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); -} - static void tcg_out_op_rrrr(TCGContext *s, TCGOpcode op, TCGReg r0, TCGReg r1, TCGReg r2, TCGReg r3) { @@ -833,29 +811,21 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, tcg_out_op_rrrr(s, opc, args[0], args[1], args[2], args[3]); break; - case INDEX_op_qemu_ld_a32_i32: - case INDEX_op_qemu_st_a32_i32: - tcg_out_op_rrm(s, opc, args[0], args[1], args[2]); - break; - case INDEX_op_qemu_ld_a64_i32: - case INDEX_op_qemu_st_a64_i32: - case INDEX_op_qemu_ld_a32_i64: - case INDEX_op_qemu_st_a32_i64: - if (TCG_TARGET_REG_BITS == 64) { - tcg_out_op_rrm(s, opc, args[0], args[1], args[2]); - } else { + case INDEX_op_qemu_ld_i64: + case INDEX_op_qemu_st_i64: + if (TCG_TARGET_REG_BITS == 32) { tcg_out_movi(s, TCG_TYPE_I32, TCG_REG_TMP, args[3]); tcg_out_op_rrrr(s, opc, args[0], args[1], args[2], TCG_REG_TMP); + break; } - break; - case INDEX_op_qemu_ld_a64_i64: - case INDEX_op_qemu_st_a64_i64: - if (TCG_TARGET_REG_BITS == 64) { - tcg_out_op_rrm(s, opc, args[0], args[1], args[2]); + /* fall through */ + case INDEX_op_qemu_ld_i32: + case INDEX_op_qemu_st_i32: + if (TCG_TARGET_REG_BITS == 64 && s->addr_type == TCG_TYPE_I32) { + tcg_out_ext32u(s, TCG_REG_TMP, args[1]); + tcg_out_op_rrm(s, opc, args[0], TCG_REG_TMP, args[2]); } else { - 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); + tcg_out_op_rrm(s, opc, args[0], args[1], args[2]); } break; From patchwork Mon Feb 17 19:29:46 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 865940 Delivered-To: patch@linaro.org Received: by 2002:a5d:64e6:0:b0:38f:210b:807b with SMTP id g6csp1251420wri; Mon, 17 Feb 2025 11:31:07 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXW7ZR7dQoklYHfg2wVzYiBiPKBFtIPviZ9jfBzcwKsw+FxPyUQyFpGZ7vS//2uLurq7vL6yQ==@linaro.org X-Google-Smtp-Source: AGHT+IGQJcBEo3/HwnktEX5sxNUengqmks1qnnqUw1KXSJntDDZBWkgp/u0EHKtUxQOAQTH+Hk97 X-Received: by 2002:a05:6214:d46:b0:6e4:4484:f357 with SMTP id 6a1803df08f44-6e66cd19ecamr124836956d6.30.1739820666874; Mon, 17 Feb 2025 11:31:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1739820666; cv=none; d=google.com; s=arc-20240605; b=kU0uvGYFd+GCm9zOckQZH1HYypYLmAB5PmaDGPVgQAKAnfwRoSkrFKRQcoC4XF7bBK MbgHL8fmcgSiN8bcbY4XK0dIgMQXZhb0mSpNDWXSWq/H/syJNYLOxgLhO07CN7JjMI2n Dk4BqPZSbBd4oZGQLKqdicDhaRmiwgdggkTQb0bzKgjJhBfRvFgUTwTSGhPyp9ba92UL BRfw8f0Rf5jDev6jpPk4E5E/qcylUiULHRUSMmJd7HW55EBecDy/XUeXLXqyLJRyKsyd w0qz/JuKrpLcXeVOfkzq+muV42Wm9Odj3AUyg/e7RuzJBSrWQGAEO0wvGOGbaAbtTg3j foxg== 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=JOcnNG3plMZjN1kwpuxQZOKJY9zyN5PehP6lpfakNCY=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=TH6dC2X/yJwUGH0hqJvDubqYYp3SdWqVUgW+0BJFs54jn4mhQaVkw8XlPK/0kd2DuM kM1F/legMPcLofwas7XsNLRZCcsY8j6GVOicfJNvPBgZrdI8zhQgHLV/m9EmLFcZC9GR xw66er/GlkAvJwkka/MMaduN+r1b+ZxeIzznwkXDA+/ZQArgz3a0SGRqZDofO7enJtA8 ef4gFLQgNNl5SvCkuwbKuB7Jz5eFH4bk7ZWZ7ZI8gdDOZJSudq1QMHNTrR9aDpt6wbeU w4or25rsDlyh4H336hodKGIT7ZEWtJPR7dbod3xHYXpg6DzdaJ5OF33CtKO+G+8o3Fye uzKg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PAKVWYpp; 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; 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 6a1803df08f44-6e65d9c18a7si95262626d6.364.2025.02.17.11.31.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Feb 2025 11:31: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=PAKVWYpp; 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; 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 1tk6pV-00028L-Q4; Mon, 17 Feb 2025 14:30:57 -0500 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 1tk6ov-0001uN-3Q for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:22 -0500 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tk6oq-0008IW-RX for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:20 -0500 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-22100006bc8so42905185ad.0 for ; Mon, 17 Feb 2025 11:30:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739820614; x=1740425414; 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=JOcnNG3plMZjN1kwpuxQZOKJY9zyN5PehP6lpfakNCY=; b=PAKVWYppPAnYVpdafV0oozKCVXuhgV3uHMtShclX0toGpvqkgVAET05X/TWtFt5JVL ym8ZeBsxD9CCntZ45mDB9DJzw/qjllboKIWGAFSvqCQWDLnC6mPYDM4qLln/XyWN6/Ga liiEB3Ij92WBa9eCvgfcDTNuEd43BV6TI7MnsnCyYnFFwIQ2EQOC9RG9UOn2MJAYOSiO bS7m0ZMdWKaeUWfVS2ijarSx54Vsblx7YSbvij17TBuCZ9G4MpOmVJNBrRZJhfSlEK6L w4Iq13POl/l2cHjG9S3hRO7sS4W3YHf41DptUiPIq39tTCPmaBUc19N2/Y+d6XYbnN01 /GWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739820614; x=1740425414; 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=JOcnNG3plMZjN1kwpuxQZOKJY9zyN5PehP6lpfakNCY=; b=FTCiGbb9Tw6aFhYALi5rwwZ1S64v3eGevf771n9GIqOqeVIMieHsdAYUaD8oMCwtYP IA4CsvzRf7St6dKaNqacK7ZUASQMjtBg5VvkEZKrwkd10jHB6BfWwn27qTX9r/QcgULX TBDVEGBMGJZY8EsLERZzALOiiDc2t68Ng5Ii4YPmdlL598AtFUk3JMp9DbA6eee144YR pAkyXaL8szGItZf0RPjDCZ3LLpo8TtYfuARgpDOE6zBAOwzOFXCyKRKDwOIQwreHrE8Z 9B7MTz4gc3dSbrMZrLe1DH5ACCvgJoxc9c6Ll6VnxGdz0r31tkUbavSSsDsTdKsORK0g Vtyw== X-Gm-Message-State: AOJu0YzjrUt7E50oVe9gyAnDadVEjJZJ63Qzz1cD81C1kl3AoW1/Erjm f7ZuuIVOqsDxl7MQYib5PDZbA6H8m3EiYDR9CmvYcG6kT79zD7NHNgYma/cygSFHzuFbTREVFa3 R X-Gm-Gg: ASbGncsB4saSgLTClaUidxzKQLBBFdkjHoFW6cbDHcUUmSHLayxo8oMdA6CJNR0Riym oVyagh0cEna2XyLJ4VHXYDoB4JkLV8K0XwnDsIMIWu/aekVQySg1u0iyLCVsTagxAvItcKseMR+ 287cGzU7ybzdF7bWVAKEkAuMiVZV2ihky4EgsnZjNSAjoyZOWEtN92xbhn6ju8l0YHLe2XmU4tK s5/XJLy2YRIdpeq88ngtO38+DxI/idCir2LM9RyWBiVb7klk+XvAEsxSIxnnrl1XV7CXR2Hu6ok kvtPeBlLjxtPdU9dl/hAx8/spkJt+JZWmIbcGtB62Ppps98= X-Received: by 2002:a05:6a00:1804:b0:727:3cd0:1167 with SMTP id d2e1a72fcca58-732619005camr15955806b3a.21.1739820614549; Mon, 17 Feb 2025 11:30:14 -0800 (PST) Received: from stoup.. (71-212-39-66.tukw.qwest.net. [71.212.39.66]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7326a38ff76sm4347164b3a.160.2025.02.17.11.30.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2025 11:30:14 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL v2 05/27] tcg/arm: Drop addrhi from prepare_host_addr Date: Mon, 17 Feb 2025 11:29:46 -0800 Message-ID: <20250217193009.2873875-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250217193009.2873875-1-richard.henderson@linaro.org> References: <20250217193009.2873875-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.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 The guest address will now always be TCG_TYPE_I32. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/arm/tcg-target.c.inc | 73 +++++++++++++--------------------------- 1 file changed, 23 insertions(+), 50 deletions(-) diff --git a/tcg/arm/tcg-target.c.inc b/tcg/arm/tcg-target.c.inc index 05bb367a39..93a3ccaf66 100644 --- a/tcg/arm/tcg-target.c.inc +++ b/tcg/arm/tcg-target.c.inc @@ -676,14 +676,8 @@ static void tcg_out_ldrd_r(TCGContext *s, ARMCond cond, TCGReg rt, tcg_out_memop_r(s, cond, INSN_LDRD_REG, rt, rn, rm, 1, 1, 0); } -static void __attribute__((unused)) -tcg_out_ldrd_rwb(TCGContext *s, ARMCond cond, TCGReg rt, TCGReg rn, TCGReg rm) -{ - tcg_out_memop_r(s, cond, INSN_LDRD_REG, rt, rn, rm, 1, 1, 1); -} - -static void __attribute__((unused)) -tcg_out_strd_8(TCGContext *s, ARMCond cond, TCGReg rt, TCGReg rn, int imm8) +static void tcg_out_strd_8(TCGContext *s, ARMCond cond, TCGReg rt, + TCGReg rn, int imm8) { tcg_out_memop_8(s, cond, INSN_STRD_IMM, rt, rn, imm8, 1, 0); } @@ -1455,8 +1449,7 @@ static bool tcg_out_qemu_st_slow_path(TCGContext *s, TCGLabelQemuLdst *lb) #define MIN_TLB_MASK_TABLE_OFS -256 static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, - TCGReg addrlo, TCGReg addrhi, - MemOpIdx oi, bool is_ld) + TCGReg addr, MemOpIdx oi, bool is_ld) { TCGLabelQemuLdst *ldst = NULL; MemOp opc = get_memop(oi); @@ -1465,14 +1458,14 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, if (tcg_use_softmmu) { *h = (HostAddress){ .cond = COND_AL, - .base = addrlo, + .base = addr, .index = TCG_REG_R1, .index_scratch = true, }; } else { *h = (HostAddress){ .cond = COND_AL, - .base = addrlo, + .base = addr, .index = guest_base ? TCG_REG_GUEST_BASE : -1, .index_scratch = false, }; @@ -1492,8 +1485,7 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, ldst = new_ldst_label(s); ldst->is_ld = is_ld; ldst->oi = oi; - ldst->addrlo_reg = addrlo; - ldst->addrhi_reg = addrhi; + ldst->addrlo_reg = addr; /* Load cpu->neg.tlb.f[mmu_idx].{mask,table} into {r0,r1}. */ QEMU_BUILD_BUG_ON(offsetof(CPUTLBDescFast, mask) != 0); @@ -1501,30 +1493,20 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, tcg_out_ldrd_8(s, COND_AL, TCG_REG_R0, TCG_AREG0, fast_off); /* Extract the tlb index from the address into R0. */ - tcg_out_dat_reg(s, COND_AL, ARITH_AND, TCG_REG_R0, TCG_REG_R0, addrlo, + tcg_out_dat_reg(s, COND_AL, ARITH_AND, TCG_REG_R0, TCG_REG_R0, addr, SHIFT_IMM_LSR(s->page_bits - CPU_TLB_ENTRY_BITS)); /* * Add the tlb_table pointer, creating the CPUTLBEntry address in R1. - * Load the tlb comparator into R2/R3 and the fast path addend into R1. + * Load the tlb comparator into R2 and the fast path addend into R1. */ QEMU_BUILD_BUG_ON(HOST_BIG_ENDIAN); if (cmp_off == 0) { - if (s->addr_type == TCG_TYPE_I32) { - tcg_out_ld32_rwb(s, COND_AL, TCG_REG_R2, - TCG_REG_R1, TCG_REG_R0); - } else { - tcg_out_ldrd_rwb(s, COND_AL, TCG_REG_R2, - TCG_REG_R1, TCG_REG_R0); - } + tcg_out_ld32_rwb(s, COND_AL, TCG_REG_R2, TCG_REG_R1, TCG_REG_R0); } else { tcg_out_dat_reg(s, COND_AL, ARITH_ADD, TCG_REG_R1, TCG_REG_R1, TCG_REG_R0, 0); - if (s->addr_type == TCG_TYPE_I32) { - tcg_out_ld32_12(s, COND_AL, TCG_REG_R2, TCG_REG_R1, cmp_off); - } else { - tcg_out_ldrd_8(s, COND_AL, TCG_REG_R2, TCG_REG_R1, cmp_off); - } + tcg_out_ld32_12(s, COND_AL, TCG_REG_R2, TCG_REG_R1, cmp_off); } /* Load the tlb addend. */ @@ -1543,11 +1525,11 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, * This leaves the least significant alignment bits unchanged, and of * course must be zero. */ - t_addr = addrlo; + t_addr = addr; if (a_mask < s_mask) { t_addr = TCG_REG_R0; tcg_out_dat_imm(s, COND_AL, ARITH_ADD, t_addr, - addrlo, s_mask - a_mask); + addr, s_mask - a_mask); } if (use_armv7_instructions && s->page_bits <= 16) { tcg_out_movi32(s, COND_AL, TCG_REG_TMP, ~(s->page_mask | a_mask)); @@ -1558,7 +1540,7 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, } else { if (a_mask) { tcg_debug_assert(a_mask <= 0xff); - tcg_out_dat_imm(s, COND_AL, ARITH_TST, 0, addrlo, a_mask); + tcg_out_dat_imm(s, COND_AL, ARITH_TST, 0, addr, a_mask); } tcg_out_dat_reg(s, COND_AL, ARITH_MOV, TCG_REG_TMP, 0, t_addr, SHIFT_IMM_LSR(s->page_bits)); @@ -1566,21 +1548,16 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, 0, TCG_REG_R2, TCG_REG_TMP, SHIFT_IMM_LSL(s->page_bits)); } - - if (s->addr_type != TCG_TYPE_I32) { - tcg_out_dat_reg(s, COND_EQ, ARITH_CMP, 0, TCG_REG_R3, addrhi, 0); - } } else if (a_mask) { ldst = new_ldst_label(s); ldst->is_ld = is_ld; ldst->oi = oi; - ldst->addrlo_reg = addrlo; - ldst->addrhi_reg = addrhi; + ldst->addrlo_reg = addr; /* We are expecting alignment to max out at 7 */ tcg_debug_assert(a_mask <= 0xff); /* tst addr, #mask */ - tcg_out_dat_imm(s, COND_AL, ARITH_TST, 0, addrlo, a_mask); + tcg_out_dat_imm(s, COND_AL, ARITH_TST, 0, addr, a_mask); } return ldst; @@ -1678,14 +1655,13 @@ static void tcg_out_qemu_ld_direct(TCGContext *s, MemOp opc, TCGReg datalo, } static void tcg_out_qemu_ld(TCGContext *s, TCGReg datalo, TCGReg datahi, - TCGReg addrlo, TCGReg addrhi, - MemOpIdx oi, TCGType data_type) + TCGReg addr, MemOpIdx oi, TCGType data_type) { MemOp opc = get_memop(oi); TCGLabelQemuLdst *ldst; HostAddress h; - ldst = prepare_host_addr(s, &h, addrlo, addrhi, oi, true); + ldst = prepare_host_addr(s, &h, addr, oi, true); if (ldst) { ldst->type = data_type; ldst->datalo_reg = datalo; @@ -1764,14 +1740,13 @@ static void tcg_out_qemu_st_direct(TCGContext *s, MemOp opc, TCGReg datalo, } static void tcg_out_qemu_st(TCGContext *s, TCGReg datalo, TCGReg datahi, - TCGReg addrlo, TCGReg addrhi, - MemOpIdx oi, TCGType data_type) + TCGReg addr, MemOpIdx oi, TCGType data_type) { MemOp opc = get_memop(oi); TCGLabelQemuLdst *ldst; HostAddress h; - ldst = prepare_host_addr(s, &h, addrlo, addrhi, oi, false); + ldst = prepare_host_addr(s, &h, addr, oi, false); if (ldst) { ldst->type = data_type; ldst->datalo_reg = datalo; @@ -2072,19 +2047,17 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, break; case INDEX_op_qemu_ld_i32: - tcg_out_qemu_ld(s, args[0], -1, args[1], -1, args[2], TCG_TYPE_I32); + tcg_out_qemu_ld(s, args[0], -1, args[1], args[2], TCG_TYPE_I32); break; case INDEX_op_qemu_ld_i64: - tcg_out_qemu_ld(s, args[0], args[1], args[2], -1, - args[3], TCG_TYPE_I64); + tcg_out_qemu_ld(s, args[0], args[1], args[2], args[3], TCG_TYPE_I64); break; case INDEX_op_qemu_st_i32: - tcg_out_qemu_st(s, args[0], -1, args[1], -1, args[2], TCG_TYPE_I32); + tcg_out_qemu_st(s, args[0], -1, args[1], args[2], TCG_TYPE_I32); break; case INDEX_op_qemu_st_i64: - tcg_out_qemu_st(s, args[0], args[1], args[2], -1, - args[3], TCG_TYPE_I64); + tcg_out_qemu_st(s, args[0], args[1], args[2], args[3], TCG_TYPE_I64); break; case INDEX_op_bswap16_i32: From patchwork Mon Feb 17 19:29:47 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 865939 Delivered-To: patch@linaro.org Received: by 2002:a5d:64e6:0:b0:38f:210b:807b with SMTP id g6csp1251323wri; Mon, 17 Feb 2025 11:30:53 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXLuE5TBZ3ILir6w0ntwxc2UAOBDn3+ZCnIxyPsasrnYxsDaAmBlCf0O6I4ebdzaqbupPq+NA==@linaro.org X-Google-Smtp-Source: AGHT+IFf6To+5TkG/Y090qmKY+gaC5otQ0jvpUFTFPifNVMLV9Yz1k+e1RA86L91zUtGmPku7GpQ X-Received: by 2002:a05:620a:4012:b0:7c0:7770:c57b with SMTP id af79cd13be357-7c08a9d8d77mr1397123885a.25.1739820653282; Mon, 17 Feb 2025 11:30:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1739820653; cv=none; d=google.com; s=arc-20240605; b=lGiWao90JMvZRA6pWa8beQ4TBVmA9YZmbnCNsLT1EjKSviulCs0DY61kq7huRKZsdM CHq8c2p7V5c6SC01Jjaza0JJ4JrgoItB+SGMJo9FBw8IFbLn8Fxw61UQAGaqo17LNa5O pVAKWYu9SwS5rRV8FcAP1hxu9olvMXcdAA+hnh6evetzNxCygbHESTCwD+s9A0r/m+OH WkhEu1EBYJkhalVBwmfhygEHRCZk+/mVqn/hF1WUkUHpRaxhSJzTPvmG/jbU3K+hLNb9 C86ptycD/qGAmuPDDq27nYWkSBbQM6sNeD337mLNQ0Y+2FRLgIuUk2fExZpBQ3aCr/tk Z76Q== 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=MkSZ1z/mYS0WLY38Nj4nOWztbQOUR5F30WqULi7ciuM=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=AUBV+bY9qd4rXlcMmNlT9WDf64tToK9gATUk7e5TV0YB8deHnYv4MMMhEc/RLVuhSc mlvXYXU7bk6w3OolttMgk6AgO1MEvYLxljpxCTmhoMNHMmEKtLjv+tsB7sz8TE3y1MmS S41ZT4lX0V+o7ESAwaq+3Gv8jEb2/pK92OnQXzW8L/7DsnvIt8BfsqWJLxJbMS8/m9SI 1YqBopUKXNlmXP5oq0SPgVwelCvNPyh3VKY1NKINpd8iwbvOZRwYjHBKcDBxnDlpGICw rN3yLTvt7D9lwtPlFqoS6iuqr8iqtEHYyst1sPP+eSmDehAOorZ0mFHmVQtcZEXINVym K5uA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JCP9SudI; 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; 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-7c09afab4ebsi279532785a.242.2025.02.17.11.30.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Feb 2025 11:30:53 -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=JCP9SudI; 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; 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 1tk6pA-0001yQ-1k; Mon, 17 Feb 2025 14:30:41 -0500 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 1tk6ov-0001uM-2q for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:22 -0500 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tk6os-0008JO-K8 for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:20 -0500 Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-219f8263ae0so83256895ad.0 for ; Mon, 17 Feb 2025 11:30:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739820615; x=1740425415; 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=MkSZ1z/mYS0WLY38Nj4nOWztbQOUR5F30WqULi7ciuM=; b=JCP9SudIvzqypuZuynvTjbSARncuzrurhS5r/tYST/OZicpZH9wEx964AV6tBe3pug vJi8C8s2QOb1i12tBEBPHF2AuZ1VcXEIRNwsDwJi5J9qS/huxQeL9mR+kvSsxxRygzX5 uznH0dBAEEW63KylMdMJWZJ0tG1bifl3ARMGLCTURxooG+uEpdtT6duqLcegz/GCOdoW cWFN9aWoG048pAj+rePAD8PbX3X4PuODk64BV7yOM6tCNXdKCWVddEStdUdc919hC4XV D+wN23SzOpCnZQJexmLsJcza/b8z3wtY4BHlIJjX057rQu0lOXmlobz38SmkzljXRCL6 jHqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739820615; x=1740425415; 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=MkSZ1z/mYS0WLY38Nj4nOWztbQOUR5F30WqULi7ciuM=; b=WM6PVUdWRVpINpeQeQousODmkZU3uHq4749WanwqSYMu7C9q8FG8ibliHIHjGs7KdD 4uRkyjdJP5JrqJBhfp9okIpe5JOBGBb1XlLNdS3FqK5cd2oCS6xQHNzYoeLW5DPmBHoH ZLarSRsbiilotcfOwR9C0R/rTFMRG3cKW6LNeS2NambekMr/e++OfhPudsXQ9K4VBUEZ WLCNSS+3U2oiHxy4ngDbcmUxeRPTB5usdu8BzOnmExloEHq9Z8mnWAvGx+5RBnFA2xkW j6zO8EKPicvJYh0zJrYgfwvdIyRExF6JZZ44ZtqN2bv4oG2qUN58sxTjdgGXi4zX4th+ vWRQ== X-Gm-Message-State: AOJu0Ywrjx46OhlVXaUR+nKyUJ7yutCE6RX+EdSgF4vJI0bouXnh1muN LVswZuHe/tXCl0XMShQehjBmBXUV0Uno6IumswnxeBu/ND9FUuKUA38hZ1XzPfqT//BJdpr7MDE R X-Gm-Gg: ASbGncuZeGR7kW7xqBxE38oK++c39HQMPk8F4W3Bly9ur5WvYJBKPuO90JmzfnvSP0H Xant6+OiJj64lMYgGPhbx1/OHnnIus42F13kQCtcw42zSvT82KepcWBKtmGUYadIQxDQ7m0sjO5 cO4Uqq8As83MDVVFacyX8gU2jIklfd9noO14jRvivSyuqC2qtZWr9okTJF9qS6UfPncJKiZMCFW zYEpB7Trvvb+6r5NzWztvgNKK37yk1/XSBd36ihUsMFnPC3Tqv5/nlzewDC97riJfVk5wa31p2f gigIVCvA7v8JCiBOoc70ZTDGoaMjdWKLhv4UW0dVPYLmTRQ= X-Received: by 2002:a05:6a21:898c:b0:1ee:aa06:1a48 with SMTP id adf61e73a8af0-1eeaa06b243mr8842112637.22.1739820615191; Mon, 17 Feb 2025 11:30:15 -0800 (PST) Received: from stoup.. (71-212-39-66.tukw.qwest.net. [71.212.39.66]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7326a38ff76sm4347164b3a.160.2025.02.17.11.30.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2025 11:30:14 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL v2 06/27] tcg/i386: Drop addrhi from prepare_host_addr Date: Mon, 17 Feb 2025 11:29:47 -0800 Message-ID: <20250217193009.2873875-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250217193009.2873875-1-richard.henderson@linaro.org> References: <20250217193009.2873875-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=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 The guest address will now always fit in one register. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/i386/tcg-target.c.inc | 56 ++++++++++++++------------------------- 1 file changed, 20 insertions(+), 36 deletions(-) diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc index ca6e8abc57..b33fe7fe23 100644 --- a/tcg/i386/tcg-target.c.inc +++ b/tcg/i386/tcg-target.c.inc @@ -2169,8 +2169,7 @@ static inline int setup_guest_base_seg(void) * is required and fill in @h with the host address for the fast path. */ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, - TCGReg addrlo, TCGReg addrhi, - MemOpIdx oi, bool is_ld) + TCGReg addr, MemOpIdx oi, bool is_ld) { TCGLabelQemuLdst *ldst = NULL; MemOp opc = get_memop(oi); @@ -2184,7 +2183,7 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, } else { *h = x86_guest_base; } - h->base = addrlo; + h->base = addr; h->aa = atom_and_align_for_opc(s, opc, MO_ATOM_IFALIGN, s_bits == MO_128); a_mask = (1 << h->aa.align) - 1; @@ -2202,8 +2201,7 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, ldst = new_ldst_label(s); ldst->is_ld = is_ld; ldst->oi = oi; - ldst->addrlo_reg = addrlo; - ldst->addrhi_reg = addrhi; + ldst->addrlo_reg = addr; if (TCG_TARGET_REG_BITS == 64) { ttype = s->addr_type; @@ -2217,7 +2215,7 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, } } - tcg_out_mov(s, tlbtype, TCG_REG_L0, addrlo); + tcg_out_mov(s, tlbtype, TCG_REG_L0, addr); tcg_out_shifti(s, SHIFT_SHR + tlbrexw, TCG_REG_L0, s->page_bits - CPU_TLB_ENTRY_BITS); @@ -2233,10 +2231,10 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, * check that we don't cross pages for the complete access. */ if (a_mask >= s_mask) { - tcg_out_mov(s, ttype, TCG_REG_L1, addrlo); + tcg_out_mov(s, ttype, TCG_REG_L1, addr); } else { tcg_out_modrm_offset(s, OPC_LEA + trexw, TCG_REG_L1, - addrlo, s_mask - a_mask); + addr, s_mask - a_mask); } tlb_mask = s->page_mask | a_mask; tgen_arithi(s, ARITH_AND + trexw, TCG_REG_L1, tlb_mask, 0); @@ -2250,17 +2248,6 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, ldst->label_ptr[0] = s->code_ptr; s->code_ptr += 4; - if (TCG_TARGET_REG_BITS == 32 && s->addr_type == TCG_TYPE_I64) { - /* cmp 4(TCG_REG_L0), addrhi */ - tcg_out_modrm_offset(s, OPC_CMP_GvEv, addrhi, - TCG_REG_L0, cmp_ofs + 4); - - /* jne slow_path */ - tcg_out_opc(s, OPC_JCC_long + JCC_JNE, 0, 0, 0); - ldst->label_ptr[1] = s->code_ptr; - s->code_ptr += 4; - } - /* TLB Hit. */ tcg_out_ld(s, TCG_TYPE_PTR, TCG_REG_L0, TCG_REG_L0, offsetof(CPUTLBEntry, addend)); @@ -2270,11 +2257,10 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, ldst = new_ldst_label(s); ldst->is_ld = is_ld; ldst->oi = oi; - ldst->addrlo_reg = addrlo; - ldst->addrhi_reg = addrhi; + ldst->addrlo_reg = addr; /* jne slow_path */ - jcc = tcg_out_cmp(s, TCG_COND_TSTNE, addrlo, a_mask, true, false); + jcc = tcg_out_cmp(s, TCG_COND_TSTNE, addr, a_mask, true, false); tcg_out_opc(s, OPC_JCC_long + jcc, 0, 0, 0); ldst->label_ptr[0] = s->code_ptr; s->code_ptr += 4; @@ -2446,13 +2432,12 @@ static void tcg_out_qemu_ld_direct(TCGContext *s, TCGReg datalo, TCGReg datahi, } static void tcg_out_qemu_ld(TCGContext *s, TCGReg datalo, TCGReg datahi, - TCGReg addrlo, TCGReg addrhi, - MemOpIdx oi, TCGType data_type) + TCGReg addr, MemOpIdx oi, TCGType data_type) { TCGLabelQemuLdst *ldst; HostAddress h; - ldst = prepare_host_addr(s, &h, addrlo, addrhi, oi, true); + ldst = prepare_host_addr(s, &h, addr, oi, true); tcg_out_qemu_ld_direct(s, datalo, datahi, h, data_type, get_memop(oi)); if (ldst) { @@ -2574,13 +2559,12 @@ static void tcg_out_qemu_st_direct(TCGContext *s, TCGReg datalo, TCGReg datahi, } static void tcg_out_qemu_st(TCGContext *s, TCGReg datalo, TCGReg datahi, - TCGReg addrlo, TCGReg addrhi, - MemOpIdx oi, TCGType data_type) + TCGReg addr, MemOpIdx oi, TCGType data_type) { TCGLabelQemuLdst *ldst; HostAddress h; - ldst = prepare_host_addr(s, &h, addrlo, addrhi, oi, false); + ldst = prepare_host_addr(s, &h, addr, oi, false); tcg_out_qemu_st_direct(s, datalo, datahi, h, get_memop(oi)); if (ldst) { @@ -2880,34 +2864,34 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, break; case INDEX_op_qemu_ld_i32: - tcg_out_qemu_ld(s, a0, -1, a1, -1, a2, TCG_TYPE_I32); + tcg_out_qemu_ld(s, a0, -1, a1, a2, TCG_TYPE_I32); break; case INDEX_op_qemu_ld_i64: if (TCG_TARGET_REG_BITS == 64) { - tcg_out_qemu_ld(s, a0, -1, a1, -1, a2, TCG_TYPE_I64); + tcg_out_qemu_ld(s, a0, -1, a1, a2, TCG_TYPE_I64); } else { - tcg_out_qemu_ld(s, a0, a1, a2, -1, args[3], TCG_TYPE_I64); + tcg_out_qemu_ld(s, a0, a1, a2, args[3], TCG_TYPE_I64); } break; case INDEX_op_qemu_ld_i128: tcg_debug_assert(TCG_TARGET_REG_BITS == 64); - tcg_out_qemu_ld(s, a0, a1, a2, -1, args[3], TCG_TYPE_I128); + tcg_out_qemu_ld(s, a0, a1, a2, args[3], TCG_TYPE_I128); break; case INDEX_op_qemu_st_i32: case INDEX_op_qemu_st8_i32: - tcg_out_qemu_st(s, a0, -1, a1, -1, a2, TCG_TYPE_I32); + tcg_out_qemu_st(s, a0, -1, a1, a2, TCG_TYPE_I32); break; case INDEX_op_qemu_st_i64: if (TCG_TARGET_REG_BITS == 64) { - tcg_out_qemu_st(s, a0, -1, a1, -1, a2, TCG_TYPE_I64); + tcg_out_qemu_st(s, a0, -1, a1, a2, TCG_TYPE_I64); } else { - tcg_out_qemu_st(s, a0, a1, a2, -1, args[3], TCG_TYPE_I64); + tcg_out_qemu_st(s, a0, a1, a2, args[3], TCG_TYPE_I64); } break; case INDEX_op_qemu_st_i128: tcg_debug_assert(TCG_TARGET_REG_BITS == 64); - tcg_out_qemu_st(s, a0, a1, a2, -1, args[3], TCG_TYPE_I128); + tcg_out_qemu_st(s, a0, a1, a2, args[3], TCG_TYPE_I128); break; OP_32_64(mulu2): From patchwork Mon Feb 17 19:29:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 865953 Delivered-To: patch@linaro.org Received: by 2002:a5d:64e6:0:b0:38f:210b:807b with SMTP id g6csp1252335wri; Mon, 17 Feb 2025 11:33:42 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCULZD/WxwBC6RehH4FCaleInKeFRQw55TWbj7dW7PJP+CiXnuR6lTe/um9m8X640HTgU6bpEA==@linaro.org X-Google-Smtp-Source: AGHT+IE/eSsOoUZqbWYSb8dXX68D08i44DdGq71Fyt53T1/9Q+aST+1aEsNVHz2bK3VKgykCpT+2 X-Received: by 2002:a05:620a:170f:b0:7b6:f278:fa9b with SMTP id af79cd13be357-7c08b01ce22mr1577781285a.12.1739820822157; Mon, 17 Feb 2025 11:33:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1739820822; cv=none; d=google.com; s=arc-20240605; b=HQmhbOjuVva2pCwmlfg6pRyN59J4zybQNr48SnyCL39e81FLH7Fh6c+oNy+zjAJMlG SJARy2zXAk29G7DUnspkCwvJ2JXfLx3oR0pgCHii7DmDsiuD9hyC3VD5MHp9C0W9EXGn rVu+BAVLFqMKl3TReDsESGZMgXsx0UiCpUf/qJFHCqsaaZfj6UREVIB/FuMZmYNP/ier XU3HEdUNNypxEiHLN2Zv0zzlVWKtDh+VnSVNE4rI2WYi5g4fLDIhHSUCiMPnqT0HPJto O8nYNyMUIEsdIccQEjAH3ixN2WF70A+DgdcY4nPYmEMgaCCiMcvexhwwzb0PByDsCncT BKFg== 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=CPVDesfkRpmTOWA3zfnP41neg542OwOsuYWNBsm3NxY=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=UTLaPokkXNY6J7JijJ4/HtYXCTtn2ZBbJsGFftixQm4t89vRWmKRzAFPonrpGKGEie xy8m3eR12c3hupKn3mTLSOGdHSjgL5HZeks49jwNIcExOISQoc2Zef3bFNPnu6QNulsG IPeoVKmTH5UjflarnSW748wvsZ3ERjWRfhYM8aNYhj72IwL1dCOzsZX4GAOmxX6TwdTn dBeLpQxzVyM3l+7WwCuT2v0XZWvJCQcIZcRkl+kKos3ENYHdoK22dUe2Oq+WtdCqOHtQ nN4jDol5PShzabx9E8QaA6uZFMDsgZOKRkOAl36CC5FaMx+ocgobP/vEiWGizGUw5G6y vuLw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jXFazzbZ; 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; 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-7c09d902367si266420185a.449.2025.02.17.11.33.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Feb 2025 11:33: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=jXFazzbZ; 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; 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 1tk6pd-0002NR-LV; Mon, 17 Feb 2025 14:31:05 -0500 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 1tk6ow-0001ut-JJ for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:25 -0500 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tk6os-0008Ji-Kw for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:22 -0500 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-21f61b01630so88172355ad.1 for ; Mon, 17 Feb 2025 11:30:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739820616; x=1740425416; 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=CPVDesfkRpmTOWA3zfnP41neg542OwOsuYWNBsm3NxY=; b=jXFazzbZccK8wfoNoe1cAhHTW+HPCIE0qXGuZ1zKgu7drGKVKq4Ws1QbnwlS4Ag4Hm iGMhZ9Iko6+i9h46j6nDTQIhM0EHIkRk1nh39agQDqX3OMKzcHp1mV1zLSBeJ1ZanvTs 21NbNIOh2dR1jZwf2hOPI6wIzL5Y4S7Ee1t9msbf5/HWovV7jet4MbeTquqDv6yVF6uy R8J2Q4MYrk2WY+2gpFQuLJlwIOUqiEg4+3GSTvkJH3WFZPHn5rkD5hgkbx4edhdp2vze nfO/TK7BPelS79r5aLaBTMUv5x9vGLqCrfPb674MsK+cxTpl7tMdngUQfYfzq4RUaM0R Rytg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739820616; x=1740425416; 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=CPVDesfkRpmTOWA3zfnP41neg542OwOsuYWNBsm3NxY=; b=bcJWF0f65QFb6FBb45ZFo0pzfbLKPhP55nniUIoxZHepzbDXwGfz7ibYnm8KD/+tJ4 g/F73rimnRzPNwCeR6HzVRy9c4/VR9McJyTOtjF0wm8EwRyNjKa9OhX3d0TI/50oXbxs AzXL3Sk+8Upy6psyCUdl4iurKnQlaCfQJiT2WpIQrJxyxezR0XQ272t8qmsXy5RdKZRq T35Dfgrxd+l7Rgek96L60ZBYnu5qVqOy8dCcFxw233iJgSuHLjUSEpFHJkSQL2qbbMj8 dT9MSRTTyAo752rnJ1mxwCkN2z/H4sxSxTKAWnzUSQGv/wvuc7N7i/raWJ2peW9TGqbq XVMQ== X-Gm-Message-State: AOJu0YxeYT1vGvI73cKtFJ6aSe8V8zuTCVb8SVB9cy9EuIgcPaUgnxG0 +VAywTkOFv5eyMyOwl4tokdsEFAoh2G+KSCtG1tenwkiWYiHyejXBocR/wjlnlVwJ36TnFtBZEI 8 X-Gm-Gg: ASbGncvbheaR7BcDzbIavT47V83qnPdlNB1GvLa6hd1CPZ7Zb7woGuynwdF/ROMAUTS vFxnVsQ5BF5wXxKAoYCt9gLcJ6CQIGOgl8kON/uMvNEBztQVay1blfUdmmhP5fwZtzE+VrD5qc9 3+XFOTXLMAFUephnDy5C8fKyUZQmB0BTsr2Mw/fI8Ky0PMdlFGdH1t3hKZJ0QRU7cbKqdxgOM8N ZU7DrX3T224E3Nez42vl1XsLT9uLHDQb6dQr5ZKdEM0U8tt3SC9MDQl0R7LzvewpTeYAvC3pzpd KsIiEXFj3ukvtJ0U9SvB0yDZu658xku5NiJI+bI3e7EVl6c= X-Received: by 2002:a05:6a00:3c84:b0:732:1ce5:4a4c with SMTP id d2e1a72fcca58-73262158d02mr16175151b3a.1.1739820616033; Mon, 17 Feb 2025 11:30:16 -0800 (PST) Received: from stoup.. (71-212-39-66.tukw.qwest.net. [71.212.39.66]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7326a38ff76sm4347164b3a.160.2025.02.17.11.30.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2025 11:30:15 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL v2 07/27] tcg/mips: Drop addrhi from prepare_host_addr Date: Mon, 17 Feb 2025 11:29:48 -0800 Message-ID: <20250217193009.2873875-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250217193009.2873875-1-richard.henderson@linaro.org> References: <20250217193009.2873875-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.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 The guest address will now always fit in one register. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/mips/tcg-target.c.inc | 62 ++++++++++++++------------------------- 1 file changed, 22 insertions(+), 40 deletions(-) diff --git a/tcg/mips/tcg-target.c.inc b/tcg/mips/tcg-target.c.inc index b1d512ca2a..153ce1f3c3 100644 --- a/tcg/mips/tcg-target.c.inc +++ b/tcg/mips/tcg-target.c.inc @@ -1217,8 +1217,7 @@ bool tcg_target_has_memory_bswap(MemOp memop) * is required and fill in @h with the host address for the fast path. */ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, - TCGReg addrlo, TCGReg addrhi, - MemOpIdx oi, bool is_ld) + TCGReg addr, MemOpIdx oi, bool is_ld) { TCGType addr_type = s->addr_type; TCGLabelQemuLdst *ldst = NULL; @@ -1245,8 +1244,7 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, ldst = new_ldst_label(s); ldst->is_ld = is_ld; ldst->oi = oi; - ldst->addrlo_reg = addrlo; - ldst->addrhi_reg = addrhi; + ldst->addrlo_reg = addr; /* Load tlb_mask[mmu_idx] and tlb_table[mmu_idx]. */ tcg_out_ld(s, TCG_TYPE_PTR, TCG_TMP0, TCG_AREG0, mask_off); @@ -1254,11 +1252,10 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, /* Extract the TLB index from the address into TMP3. */ if (TCG_TARGET_REG_BITS == 32 || addr_type == TCG_TYPE_I32) { - tcg_out_opc_sa(s, OPC_SRL, TCG_TMP3, addrlo, + tcg_out_opc_sa(s, OPC_SRL, TCG_TMP3, addr, s->page_bits - CPU_TLB_ENTRY_BITS); } else { - tcg_out_dsrl(s, TCG_TMP3, addrlo, - s->page_bits - CPU_TLB_ENTRY_BITS); + tcg_out_dsrl(s, TCG_TMP3, addr, s->page_bits - CPU_TLB_ENTRY_BITS); } tcg_out_opc_reg(s, OPC_AND, TCG_TMP3, TCG_TMP3, TCG_TMP0); @@ -1288,48 +1285,35 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, tcg_out_opc_imm(s, (TCG_TARGET_REG_BITS == 32 || addr_type == TCG_TYPE_I32 ? OPC_ADDIU : OPC_DADDIU), - TCG_TMP2, addrlo, s_mask - a_mask); + TCG_TMP2, addr, s_mask - a_mask); tcg_out_opc_reg(s, OPC_AND, TCG_TMP1, TCG_TMP1, TCG_TMP2); } else { - tcg_out_opc_reg(s, OPC_AND, TCG_TMP1, TCG_TMP1, addrlo); + tcg_out_opc_reg(s, OPC_AND, TCG_TMP1, TCG_TMP1, addr); } /* Zero extend a 32-bit guest address for a 64-bit host. */ if (TCG_TARGET_REG_BITS == 64 && addr_type == TCG_TYPE_I32) { - tcg_out_ext32u(s, TCG_TMP2, addrlo); - addrlo = TCG_TMP2; + tcg_out_ext32u(s, TCG_TMP2, addr); + addr = TCG_TMP2; } ldst->label_ptr[0] = s->code_ptr; tcg_out_opc_br(s, OPC_BNE, TCG_TMP1, TCG_TMP0); - /* Load and test the high half tlb comparator. */ - if (TCG_TARGET_REG_BITS == 32 && addr_type != TCG_TYPE_I32) { - /* delay slot */ - tcg_out_ldst(s, OPC_LW, TCG_TMP0, TCG_TMP3, cmp_off + HI_OFF); - - /* Load the tlb addend for the fast path. */ - tcg_out_ld(s, TCG_TYPE_PTR, TCG_TMP3, TCG_TMP3, add_off); - - ldst->label_ptr[1] = s->code_ptr; - tcg_out_opc_br(s, OPC_BNE, addrhi, TCG_TMP0); - } - /* delay slot */ base = TCG_TMP3; - tcg_out_opc_reg(s, ALIAS_PADD, base, TCG_TMP3, addrlo); + tcg_out_opc_reg(s, ALIAS_PADD, base, TCG_TMP3, addr); } else { if (a_mask && (use_mips32r6_instructions || a_bits != s_bits)) { ldst = new_ldst_label(s); ldst->is_ld = is_ld; ldst->oi = oi; - ldst->addrlo_reg = addrlo; - ldst->addrhi_reg = addrhi; + ldst->addrlo_reg = addr; /* We are expecting a_bits to max out at 7, much lower than ANDI. */ tcg_debug_assert(a_bits < 16); - tcg_out_opc_imm(s, OPC_ANDI, TCG_TMP0, addrlo, a_mask); + tcg_out_opc_imm(s, OPC_ANDI, TCG_TMP0, addr, a_mask); ldst->label_ptr[0] = s->code_ptr; if (use_mips32r6_instructions) { @@ -1340,7 +1324,7 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, } } - base = addrlo; + base = addr; if (TCG_TARGET_REG_BITS == 64 && addr_type == TCG_TYPE_I32) { tcg_out_ext32u(s, TCG_REG_A0, base); base = TCG_REG_A0; @@ -1460,14 +1444,13 @@ static void tcg_out_qemu_ld_unalign(TCGContext *s, TCGReg lo, TCGReg hi, } static void tcg_out_qemu_ld(TCGContext *s, TCGReg datalo, TCGReg datahi, - TCGReg addrlo, TCGReg addrhi, - MemOpIdx oi, TCGType data_type) + TCGReg addr, MemOpIdx oi, TCGType data_type) { MemOp opc = get_memop(oi); TCGLabelQemuLdst *ldst; HostAddress h; - ldst = prepare_host_addr(s, &h, addrlo, addrhi, oi, true); + ldst = prepare_host_addr(s, &h, addr, oi, true); if (use_mips32r6_instructions || h.aa.align >= (opc & MO_SIZE)) { tcg_out_qemu_ld_direct(s, datalo, datahi, h.base, opc, data_type); @@ -1547,14 +1530,13 @@ static void tcg_out_qemu_st_unalign(TCGContext *s, TCGReg lo, TCGReg hi, } static void tcg_out_qemu_st(TCGContext *s, TCGReg datalo, TCGReg datahi, - TCGReg addrlo, TCGReg addrhi, - MemOpIdx oi, TCGType data_type) + TCGReg addr, MemOpIdx oi, TCGType data_type) { MemOp opc = get_memop(oi); TCGLabelQemuLdst *ldst; HostAddress h; - ldst = prepare_host_addr(s, &h, addrlo, addrhi, oi, false); + ldst = prepare_host_addr(s, &h, addr, oi, false); if (use_mips32r6_instructions || h.aa.align >= (opc & MO_SIZE)) { tcg_out_qemu_st_direct(s, datalo, datahi, h.base, opc); @@ -2096,24 +2078,24 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, break; case INDEX_op_qemu_ld_i32: - tcg_out_qemu_ld(s, a0, 0, a1, 0, a2, TCG_TYPE_I32); + tcg_out_qemu_ld(s, a0, 0, a1, a2, TCG_TYPE_I32); break; case INDEX_op_qemu_ld_i64: if (TCG_TARGET_REG_BITS == 64) { - tcg_out_qemu_ld(s, a0, 0, a1, 0, a2, TCG_TYPE_I64); + tcg_out_qemu_ld(s, a0, 0, a1, a2, TCG_TYPE_I64); } else { - tcg_out_qemu_ld(s, a0, a1, a2, 0, args[3], TCG_TYPE_I64); + tcg_out_qemu_ld(s, a0, a1, a2, args[3], TCG_TYPE_I64); } break; case INDEX_op_qemu_st_i32: - tcg_out_qemu_st(s, a0, 0, a1, 0, a2, TCG_TYPE_I32); + tcg_out_qemu_st(s, a0, 0, a1, a2, TCG_TYPE_I32); break; case INDEX_op_qemu_st_i64: if (TCG_TARGET_REG_BITS == 64) { - tcg_out_qemu_st(s, a0, 0, a1, 0, a2, TCG_TYPE_I64); + tcg_out_qemu_st(s, a0, 0, a1, a2, TCG_TYPE_I64); } else { - tcg_out_qemu_st(s, a0, a1, a2, 0, args[3], TCG_TYPE_I64); + tcg_out_qemu_st(s, a0, a1, a2, args[3], TCG_TYPE_I64); } break; From patchwork Mon Feb 17 19:29:49 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 865942 Delivered-To: patch@linaro.org Received: by 2002:a5d:64e6:0:b0:38f:210b:807b with SMTP id g6csp1251519wri; Mon, 17 Feb 2025 11:31:22 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV5yDkVthAaxs6lAF3+879ARQA7CA0QfPZ3AIaj4FZbaVSNu9Ca4o1RMCYjTZqNdqDFrlNPng==@linaro.org X-Google-Smtp-Source: AGHT+IHLQOyCwqxa1RLxyvbJ7/XJnBiOmer0hZ3zNIyPCa957FYyKxuRg0E4HaQzkH91FhTGwmEO X-Received: by 2002:a05:6214:88:b0:6e4:3478:b55a with SMTP id 6a1803df08f44-6e66cd2fe70mr129391406d6.35.1739820682648; Mon, 17 Feb 2025 11:31:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1739820682; cv=none; d=google.com; s=arc-20240605; b=YtVsLecQuiJ93hLATiwu2nYkrdtkG2N7XfYKIFI7x5V0/y7F4X8Fq3lku1rnxYz9h7 OoMVqsWBaHg7SDC0sQovQyP8gkRtAWweTcF0lxcN0XJUFL5hiFs9MJgVJhVU6K94QR90 czdywqWMDas0tpxD3Zew1jLN1yAuvOpRulH9WHWi3iSwzyUiRA3Poa8ksSFS0kLWamy1 dHZqZt1USRoMLp6Sqi1pa6uEt8donMq1f+3cMGx3hp1Juz/pQvQ1yaVBuJ1NU5AuOyP9 ab/rOMgDPS+MdTdPAcRVRx1FZk24nIJzduVu/6AXxtrTDn0xhH3DkQI90Skbo1HJ+TOu WOTQ== 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=Q42Wl93XZQ8l+eIAXYd7qQ+kbojGHP8GopxWhwXIvfQ=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=KQycmZN6M4thWoujoxG8jMChBaEh+kBJsl/F7+Tp6brrUn+Y21PNjAUVOlzvKxyGMl 51eY0CoB/VRTesY4szser+ZrhFpIT/e9Xf2bCNpASee2t/Pw9z6T4d2JSgFjbnSGwzU0 USHrPQioTl28DUxnTq5k0QULxYErQ8xWy2921bHK+hkwPEePuKtwytkk6fnDr2zznwx+ WrtOG0hdeswziJMNQ/p5mCS0rwMpBtATyq2cW2g1rUERbUMndGaRmNiCqHIvKn46JUnv nBu/Ol6t531LzqdXCiKF/m8oDxRXej5eRGfSInxJE42cN98nAVp5mwMkYqS1cJDf6Quy Q7Fg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=m29ZHx+X; 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; 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 6a1803df08f44-6e65d73472fsi92041076d6.31.2025.02.17.11.31.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Feb 2025 11:31:22 -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=m29ZHx+X; 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; 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 1tk6pP-00025O-OW; Mon, 17 Feb 2025 14:30:51 -0500 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 1tk6ov-0001uK-0P for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:22 -0500 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tk6os-0008Jv-KJ for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:20 -0500 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-22101839807so53310785ad.3 for ; Mon, 17 Feb 2025 11:30:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739820617; x=1740425417; 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=Q42Wl93XZQ8l+eIAXYd7qQ+kbojGHP8GopxWhwXIvfQ=; b=m29ZHx+Xfa62h3dRnxVOGRH4y6qea6FBcREgNfD2mI/cfQGF0RlNd8/GW+4id6+WVv 7YCAvATVZ1dSKHxuHH1nbszyllvpAjkt4w6PUHCAnQQVy2UaYSHI5lBbzZtoUXd+db/Z 50Qahjc0eRI4rGMg0+2H3DyR+iYsc5inAAqKMJrArrR/BcavCKxDZiTiE2YxV+BcYwJH xZ7LCu6QGcpZ2YnOO8JMga2iBLhzHAdI73g25ddIcuxTM4VVRNHS0Cw4BeKEBWKda0eW XEGQ8bfPI/bY/UIbrF2E7s9Myx56NI3hWlV6WWgIw0F7XVCISY8c4u976zp/8+CoyMrX SPCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739820617; x=1740425417; 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=Q42Wl93XZQ8l+eIAXYd7qQ+kbojGHP8GopxWhwXIvfQ=; b=I2ermArEsSQc0zZuGW+93fEEpaoF5qWrpxeeB/TQ1mQLJ3gt/Kx/Rrqe+CBzX/5L6o h9rVnenNYoWcN8108q2DsiaWnzmBTUcgA+1KCCQd/HTj+J2vRuQPXDgwfCDHGUN38v1d x1klAg+2U15CVpF7KbZ+KZYfZdb0wDkOhh2Aq0P6HEioEgxW+whSIeJHv2LTeowN4y7g jqIhuktWSVL/5r2vcUV2jYFL590qy2X6yG6AUw9b2QgcY1pSj4/eLQOuo281KSeJxWMv cmtMsj9YYP/Kq7mXxI5tod1aOY/ySvNE4V9YJMQLikJGY/GP7eoz+6A3Smr1N9jS2NDq 4P6w== X-Gm-Message-State: AOJu0Yzb8dKjiIzFnkS7A8BbIQjAbE2wuMNYLi+qRhL8fl9dzbWH+YQ+ YnGOoCyxDvEPWDWmnQUW45fYhncacnIulYzN84a3bgpDYfpGr+/tTpGo1y1nehVn841+WR8U8Mv P X-Gm-Gg: ASbGncvH0UsF/eOAGUB3w0rOVDO08xoOAYIX78UPECKOutrnkKjTkrnirb8HO+lThtY Eh9sB8GizK6r2XNRoPw2ywmFu5z0MofDQpp/MaJ78Ox/rvijluc/Sh+bU1q/2HFS50AR7jIH3F6 J6mrRgZvyTSGM7SL3R6sIzPkJHOM2J+EoOGe+QXLdNp91v10i1uFP70PiyvjQHGaEJ55PHPXafN 8+9y5n3Az49Yo8mYERjSHL+10WchU0RDNOADzUvylgaMJ6L3Z5OhtTbT401VKvhj1wtc1GWENxd ySOTt71L14T+4KazWrOB6klm+4qXoyB/D2oI4J0y9FO2SjM= X-Received: by 2002:a05:6a20:6a05:b0:1ee:68e3:ff45 with SMTP id adf61e73a8af0-1ee8cbe4f98mr21908213637.35.1739820616717; Mon, 17 Feb 2025 11:30:16 -0800 (PST) Received: from stoup.. (71-212-39-66.tukw.qwest.net. [71.212.39.66]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7326a38ff76sm4347164b3a.160.2025.02.17.11.30.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2025 11:30:16 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL v2 08/27] tcg/ppc: Drop addrhi from prepare_host_addr Date: Mon, 17 Feb 2025 11:29:49 -0800 Message-ID: <20250217193009.2873875-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250217193009.2873875-1-richard.henderson@linaro.org> References: <20250217193009.2873875-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.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 The guest address will now always fit in one register. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target.c.inc | 75 ++++++++++++---------------------------- 1 file changed, 23 insertions(+), 52 deletions(-) diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc index 801cb6f3cb..74b93f4b57 100644 --- a/tcg/ppc/tcg-target.c.inc +++ b/tcg/ppc/tcg-target.c.inc @@ -2438,8 +2438,7 @@ bool tcg_target_has_memory_bswap(MemOp memop) * is required and fill in @h with the host address for the fast path. */ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, - TCGReg addrlo, TCGReg addrhi, - MemOpIdx oi, bool is_ld) + TCGReg addr, MemOpIdx oi, bool is_ld) { TCGType addr_type = s->addr_type; TCGLabelQemuLdst *ldst = NULL; @@ -2474,8 +2473,7 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, ldst = new_ldst_label(s); ldst->is_ld = is_ld; ldst->oi = oi; - ldst->addrlo_reg = addrlo; - ldst->addrhi_reg = addrhi; + ldst->addrlo_reg = addr; /* Load tlb_mask[mmu_idx] and tlb_table[mmu_idx]. */ tcg_out_ld(s, TCG_TYPE_PTR, TCG_REG_TMP1, TCG_AREG0, mask_off); @@ -2483,10 +2481,10 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, /* Extract the page index, shifted into place for tlb index. */ if (TCG_TARGET_REG_BITS == 32) { - tcg_out_shri32(s, TCG_REG_R0, addrlo, + tcg_out_shri32(s, TCG_REG_R0, addr, s->page_bits - CPU_TLB_ENTRY_BITS); } else { - tcg_out_shri64(s, TCG_REG_R0, addrlo, + tcg_out_shri64(s, TCG_REG_R0, addr, s->page_bits - CPU_TLB_ENTRY_BITS); } tcg_out32(s, AND | SAB(TCG_REG_TMP1, TCG_REG_TMP1, TCG_REG_R0)); @@ -2534,10 +2532,10 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, if (a_bits < s_bits) { a_bits = s_bits; } - tcg_out_rlw(s, RLWINM, TCG_REG_R0, addrlo, 0, + tcg_out_rlw(s, RLWINM, TCG_REG_R0, addr, 0, (32 - a_bits) & 31, 31 - s->page_bits); } else { - TCGReg t = addrlo; + TCGReg t = addr; /* * If the access is unaligned, we need to make sure we fail if we @@ -2566,30 +2564,8 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, } } - if (TCG_TARGET_REG_BITS == 32 && addr_type != TCG_TYPE_I32) { - /* Low part comparison into cr7. */ - tcg_out_cmp(s, TCG_COND_EQ, TCG_REG_R0, TCG_REG_TMP2, - 0, 7, TCG_TYPE_I32); - - /* Load the high part TLB comparator into TMP2. */ - tcg_out_ld(s, TCG_TYPE_I32, TCG_REG_TMP2, TCG_REG_TMP1, - cmp_off + 4 * !HOST_BIG_ENDIAN); - - /* Load addend, deferred for this case. */ - tcg_out_ld(s, TCG_TYPE_PTR, TCG_REG_TMP1, TCG_REG_TMP1, - offsetof(CPUTLBEntry, addend)); - - /* High part comparison into cr6. */ - tcg_out_cmp(s, TCG_COND_EQ, addrhi, TCG_REG_TMP2, - 0, 6, TCG_TYPE_I32); - - /* Combine comparisons into cr0. */ - tcg_out32(s, CRAND | BT(0, CR_EQ) | BA(6, CR_EQ) | BB(7, CR_EQ)); - } else { - /* Full comparison into cr0. */ - tcg_out_cmp(s, TCG_COND_EQ, TCG_REG_R0, TCG_REG_TMP2, - 0, 0, addr_type); - } + /* Full comparison into cr0. */ + tcg_out_cmp(s, TCG_COND_EQ, TCG_REG_R0, TCG_REG_TMP2, 0, 0, addr_type); /* Load a pointer into the current opcode w/conditional branch-link. */ ldst->label_ptr[0] = s->code_ptr; @@ -2601,12 +2577,11 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, ldst = new_ldst_label(s); ldst->is_ld = is_ld; ldst->oi = oi; - ldst->addrlo_reg = addrlo; - ldst->addrhi_reg = addrhi; + ldst->addrlo_reg = addr; /* We are expecting a_bits to max out at 7, much lower than ANDI. */ tcg_debug_assert(a_bits < 16); - tcg_out32(s, ANDI | SAI(addrlo, TCG_REG_R0, (1 << a_bits) - 1)); + tcg_out32(s, ANDI | SAI(addr, TCG_REG_R0, (1 << a_bits) - 1)); ldst->label_ptr[0] = s->code_ptr; tcg_out32(s, BC | BI(0, CR_EQ) | BO_COND_FALSE | LK); @@ -2617,24 +2592,23 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, if (TCG_TARGET_REG_BITS == 64 && addr_type == TCG_TYPE_I32) { /* Zero-extend the guest address for use in the host address. */ - tcg_out_ext32u(s, TCG_REG_TMP2, addrlo); + tcg_out_ext32u(s, TCG_REG_TMP2, addr); h->index = TCG_REG_TMP2; } else { - h->index = addrlo; + h->index = addr; } return ldst; } static void tcg_out_qemu_ld(TCGContext *s, TCGReg datalo, TCGReg datahi, - TCGReg addrlo, TCGReg addrhi, - MemOpIdx oi, TCGType data_type) + TCGReg addr, MemOpIdx oi, TCGType data_type) { MemOp opc = get_memop(oi); TCGLabelQemuLdst *ldst; HostAddress h; - ldst = prepare_host_addr(s, &h, addrlo, addrhi, oi, true); + ldst = prepare_host_addr(s, &h, addr, oi, true); if (TCG_TARGET_REG_BITS == 32 && (opc & MO_SIZE) == MO_64) { if (opc & MO_BSWAP) { @@ -2678,14 +2652,13 @@ static void tcg_out_qemu_ld(TCGContext *s, TCGReg datalo, TCGReg datahi, } static void tcg_out_qemu_st(TCGContext *s, TCGReg datalo, TCGReg datahi, - TCGReg addrlo, TCGReg addrhi, - MemOpIdx oi, TCGType data_type) + TCGReg addr, MemOpIdx oi, TCGType data_type) { MemOp opc = get_memop(oi); TCGLabelQemuLdst *ldst; HostAddress h; - ldst = prepare_host_addr(s, &h, addrlo, addrhi, oi, false); + ldst = prepare_host_addr(s, &h, addr, oi, false); if (TCG_TARGET_REG_BITS == 32 && (opc & MO_SIZE) == MO_64) { if (opc & MO_BSWAP) { @@ -2729,7 +2702,7 @@ static void tcg_out_qemu_ldst_i128(TCGContext *s, TCGReg datalo, TCGReg datahi, uint32_t insn; TCGReg index; - ldst = prepare_host_addr(s, &h, addr_reg, -1, oi, is_ld); + ldst = prepare_host_addr(s, &h, addr_reg, oi, is_ld); /* Compose the final address, as LQ/STQ have no indexing. */ index = h.index; @@ -3309,14 +3282,13 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, break; case INDEX_op_qemu_ld_i32: - tcg_out_qemu_ld(s, args[0], -1, args[1], -1, args[2], TCG_TYPE_I32); + tcg_out_qemu_ld(s, args[0], -1, args[1], args[2], TCG_TYPE_I32); break; case INDEX_op_qemu_ld_i64: if (TCG_TARGET_REG_BITS == 64) { - tcg_out_qemu_ld(s, args[0], -1, args[1], -1, - args[2], TCG_TYPE_I64); + tcg_out_qemu_ld(s, args[0], -1, args[1], args[2], TCG_TYPE_I64); } else { - tcg_out_qemu_ld(s, args[0], args[1], args[2], -1, + tcg_out_qemu_ld(s, args[0], args[1], args[2], args[3], TCG_TYPE_I64); } break; @@ -3326,14 +3298,13 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, break; case INDEX_op_qemu_st_i32: - tcg_out_qemu_st(s, args[0], -1, args[1], -1, args[2], TCG_TYPE_I32); + tcg_out_qemu_st(s, args[0], -1, args[1], args[2], TCG_TYPE_I32); break; case INDEX_op_qemu_st_i64: if (TCG_TARGET_REG_BITS == 64) { - tcg_out_qemu_st(s, args[0], -1, args[1], -1, - args[2], TCG_TYPE_I64); + tcg_out_qemu_st(s, args[0], -1, args[1], args[2], TCG_TYPE_I64); } else { - tcg_out_qemu_st(s, args[0], args[1], args[2], -1, + tcg_out_qemu_st(s, args[0], args[1], args[2], args[3], TCG_TYPE_I64); } break; From patchwork Mon Feb 17 19:29:50 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 865947 Delivered-To: patch@linaro.org Received: by 2002:a5d:64e6:0:b0:38f:210b:807b with SMTP id g6csp1252021wri; Mon, 17 Feb 2025 11:32:40 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVNhi2YrZeXAKvijyDcBFNgR4N8sbuQ0l8sXuRiFx5g/2T3wJ4+N6i11btFW+9hmRgwveNABQ==@linaro.org X-Google-Smtp-Source: AGHT+IG48Ckb8AaAVKr6ta+kDdmq1GfJkeVg4pbgbhknIA9ESU/x4bdC8VdcMt5hdRf8olhLfpm5 X-Received: by 2002:a05:622a:488e:b0:462:b7c9:10e with SMTP id d75a77b69052e-471c0152cfamr291736481cf.13.1739820759979; Mon, 17 Feb 2025 11:32:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1739820759; cv=none; d=google.com; s=arc-20240605; b=Ps0t9iPuq9s0FDZUKHl+eBnDG6C3Hp0+Xn7HC5ujOL3hXbTzZhW7Yfk+pZQRSTHl9L jV85AkLrKGkbB9kvOLPB0tUPEXF8Jh1dBiSwjAVs2d/doJlDVoEKj9qyvXwuc3ZBBnLx SgyWaXX54SeF4o1XdUxgFjzkquFRp+bYti2N8b1OyepTzUrw5CZE8UmP/KCivcCdmkoJ M+ZroHsLefERHw0Jg2xTDXjjMjQemARppE1xgdKTiWIh7GHbkI+T3wW21QUqC8Kiakb8 CncDjwdFMMdnNQ3cbUS+Dq+u2nvKJ2zuOppIiv/n5RI9iTKQr9jzifgh5G1zMMUNJKWJ mK5A== 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=bjZ/gYyzhdiz61dtt91DImwS+lEhF+ORlkHG1x+DTPI=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=QsYL+z9h+TVsoq3euj8k8fV/KFD+RO29BN52qqpOW6IhgPj8iGNblLlDL9UEtwApGo 5D5T8UAo6mq/sJ0gtMYth8BQy0OUTX/dTIy0W+EZxw0LepKyk9rW1IfcVCo30RNn6yVp CwEVIWu3WF4VM5sAaKUj4/0X+cODTRu2zxor6I6RolH+aSd0kpnX0LtcV7gCbJa76KRw zxEzQYBhBf1FJjLMmWf0YfV49fJ0OH0kjMiu6QRrK9J9/O3gBrDfSI75hYkJ8l6ChDhh NYFJh95eeNL2C/mzfGrP8CFLF8syqeUMSApgL3obhJUdKbsuoRuTjysVzVqMtto99v6y ux9Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=N+Zy0c7C; 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; dara=fail 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 d75a77b69052e-471f5e46778si14872991cf.72.2025.02.17.11.32.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Feb 2025 11:32: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=fail header.i=@linaro.org header.s=google header.b=N+Zy0c7C; 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; dara=fail 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 1tk6pb-0002I0-Mh; Mon, 17 Feb 2025 14:31:03 -0500 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 1tk6ox-0001uu-54 for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:26 -0500 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tk6ou-0008Kj-F4 for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:22 -0500 Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-220dc3831e3so66720745ad.0 for ; Mon, 17 Feb 2025 11:30:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739820617; x=1740425417; 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=bjZ/gYyzhdiz61dtt91DImwS+lEhF+ORlkHG1x+DTPI=; b=N+Zy0c7C3tRuYrmJd30P68nppgH+mBCYUio3hdhwoNKYOUkPv7ER8KPlIj2zJAf81C 63gHy6Su01QK/hO9mDsSED0BjXW3y45RExf9mwmCLwMNlHWxO/dCFogT9+hCiADzCrPo xHMAx2pEEP4jEkB8MP+gVKM4uNJTYhvJDgTKc/zXzq8KcIydpbGurPmVwlg/99hewUFI F01ZmtiV4WfMqNmNnYrPJflULrbzVgaodZKuWZef8ZEz/HCaAz0XdSqiT7VUdbHBJrzC BK2EeW5TAptZC+AVy+aiLX3C5LoFvmYFgeqU0mL8qq1oc6IITHwXQu4AdJK0rCWqwTby uFKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739820617; x=1740425417; 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=bjZ/gYyzhdiz61dtt91DImwS+lEhF+ORlkHG1x+DTPI=; b=uT63z33ztIAqARXboNLTV3FnCHWIIpm8CLHpsnHsMSMT0LgD0r2N2SDU/Oep8xab/I 8dabjrqMyZ1AaELQyidvpYQMlg5cJ1/OYjTn7enzG7ysHYnaCUSv5uuerTq2UGw1lz7y IvxYUosxqQwhU1oK8kYOSv4+r36vp5NkSS8XzH7wEnKphVCgVAz92R3ZNRtx/QNqnl17 Q/+yhlqrT0Aw/xt32qRbdWi5PsGaX25TD2twDRVvvnO1p1NB4qM1X5dXq8i8YfXrEwmZ xqb8aKRsKP4JggTv/oQCPtz5j32lT+63pehnEaTsi+WBimp/wjlIosNKSFBN+O+Puy5E qPoQ== X-Gm-Message-State: AOJu0YzZKTzRDoycZJjab7kCeo4rDz/FHeYGlFvF16oS9yohp6pU2FUY 3SLzpY0Kp86mOJAUPNBXMWTLKW6mSFFEYD7Dx4fKoHo500a8c9FaPpcJz4vQgXucwDf9j2BJBLx + X-Gm-Gg: ASbGnctVhb+EVZWAl4ILSHWJ5JtGXosWE3qsyVZshGnjsrmmg3/UyQJGxLQvbGQEltQ QCFBH7/3UcGG8ZFcF413o5CHqe3iYDBJM8ewq42t6pqnfe81KUYYrGETHADLwK0ktHprQvcmTPS lIxm2CoA3X4zx0+FwMcDqTkMS5MP2Jy8/M8BLylymBu/4BnBSNZU3iOukmfsBd50Sg4MEaTM9xd e3gZPEsHRzIpxcHk+YvQpj+TYxmjF72PuuxVZERUxxa1x895ZTWTMlpW0PQp0I1A9PxgA11yv4h 2JI3mEInioG4ACzqM0HYAxEhX6dWHndDT8R+12wP2ThswSA= X-Received: by 2002:a05:6a00:6597:b0:732:6276:b46c with SMTP id d2e1a72fcca58-7326276b487mr12924449b3a.0.1739820617487; Mon, 17 Feb 2025 11:30:17 -0800 (PST) Received: from stoup.. (71-212-39-66.tukw.qwest.net. [71.212.39.66]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7326a38ff76sm4347164b3a.160.2025.02.17.11.30.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2025 11:30:17 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL v2 09/27] tcg: Replace addr{lo, hi}_reg with addr_reg in TCGLabelQemuLdst Date: Mon, 17 Feb 2025 11:29:50 -0800 Message-ID: <20250217193009.2873875-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250217193009.2873875-1-richard.henderson@linaro.org> References: <20250217193009.2873875-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=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 There is now always only one guest address register. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/tcg.c | 18 +++++++++--------- tcg/aarch64/tcg-target.c.inc | 4 ++-- tcg/arm/tcg-target.c.inc | 4 ++-- tcg/i386/tcg-target.c.inc | 4 ++-- tcg/loongarch64/tcg-target.c.inc | 4 ++-- tcg/mips/tcg-target.c.inc | 4 ++-- tcg/ppc/tcg-target.c.inc | 4 ++-- tcg/riscv/tcg-target.c.inc | 4 ++-- tcg/s390x/tcg-target.c.inc | 4 ++-- tcg/sparc64/tcg-target.c.inc | 4 ++-- 10 files changed, 27 insertions(+), 27 deletions(-) diff --git a/tcg/tcg.c b/tcg/tcg.c index fef93b25ff..55cb9b3ac7 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -100,8 +100,7 @@ struct TCGLabelQemuLdst { bool is_ld; /* qemu_ld: true, qemu_st: false */ MemOpIdx oi; TCGType type; /* result type of a load */ - TCGReg addrlo_reg; /* reg index for low word of guest virtual addr */ - TCGReg addrhi_reg; /* reg index for high word of guest virtual addr */ + TCGReg addr_reg; /* reg index for guest virtual addr */ TCGReg datalo_reg; /* reg index for low word to be loaded or stored */ TCGReg datahi_reg; /* reg index for high word to be loaded or stored */ const tcg_insn_unit *raddr; /* addr of the next IR of qemu_ld/st IR */ @@ -6061,7 +6060,7 @@ static void tcg_out_ld_helper_args(TCGContext *s, const TCGLabelQemuLdst *ldst, */ tcg_out_helper_add_mov(mov, loc + HOST_BIG_ENDIAN, TCG_TYPE_I32, TCG_TYPE_I32, - ldst->addrlo_reg, -1); + ldst->addr_reg, -1); tcg_out_helper_load_slots(s, 1, mov, parm); tcg_out_helper_load_imm(s, loc[!HOST_BIG_ENDIAN].arg_slot, @@ -6069,7 +6068,7 @@ static void tcg_out_ld_helper_args(TCGContext *s, const TCGLabelQemuLdst *ldst, next_arg += 2; } else { nmov = tcg_out_helper_add_mov(mov, loc, TCG_TYPE_I64, s->addr_type, - ldst->addrlo_reg, ldst->addrhi_reg); + ldst->addr_reg, -1); tcg_out_helper_load_slots(s, nmov, mov, parm); next_arg += nmov; } @@ -6226,21 +6225,22 @@ static void tcg_out_st_helper_args(TCGContext *s, const TCGLabelQemuLdst *ldst, /* Handle addr argument. */ loc = &info->in[next_arg]; - if (TCG_TARGET_REG_BITS == 32 && s->addr_type == TCG_TYPE_I32) { + tcg_debug_assert(s->addr_type <= TCG_TYPE_REG); + if (TCG_TARGET_REG_BITS == 32) { /* - * 32-bit host with 32-bit guest: zero-extend the guest address + * 32-bit host (and thus 32-bit guest): zero-extend the guest address * to 64-bits for the helper by storing the low part. Later, * after we have processed the register inputs, we will load a * zero for the high part. */ tcg_out_helper_add_mov(mov, loc + HOST_BIG_ENDIAN, TCG_TYPE_I32, TCG_TYPE_I32, - ldst->addrlo_reg, -1); + ldst->addr_reg, -1); next_arg += 2; nmov += 1; } else { n = tcg_out_helper_add_mov(mov, loc, TCG_TYPE_I64, s->addr_type, - ldst->addrlo_reg, ldst->addrhi_reg); + ldst->addr_reg, -1); next_arg += n; nmov += n; } @@ -6288,7 +6288,7 @@ static void tcg_out_st_helper_args(TCGContext *s, const TCGLabelQemuLdst *ldst, g_assert_not_reached(); } - if (TCG_TARGET_REG_BITS == 32 && s->addr_type == TCG_TYPE_I32) { + if (TCG_TARGET_REG_BITS == 32) { /* Zero extend the address by loading a zero for the high part. */ loc = &info->in[1 + !HOST_BIG_ENDIAN]; tcg_out_helper_load_imm(s, loc->arg_slot, TCG_TYPE_I32, 0, parm); diff --git a/tcg/aarch64/tcg-target.c.inc b/tcg/aarch64/tcg-target.c.inc index 45dc2c649b..6f383c1592 100644 --- a/tcg/aarch64/tcg-target.c.inc +++ b/tcg/aarch64/tcg-target.c.inc @@ -1775,7 +1775,7 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, ldst = new_ldst_label(s); ldst->is_ld = is_ld; ldst->oi = oi; - ldst->addrlo_reg = addr_reg; + ldst->addr_reg = addr_reg; mask_type = (s->page_bits + s->tlb_dyn_max_bits > 32 ? TCG_TYPE_I64 : TCG_TYPE_I32); @@ -1837,7 +1837,7 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, ldst->is_ld = is_ld; ldst->oi = oi; - ldst->addrlo_reg = addr_reg; + ldst->addr_reg = addr_reg; /* tst addr, #mask */ tcg_out_logicali(s, I3404_ANDSI, 0, TCG_REG_XZR, addr_reg, a_mask); diff --git a/tcg/arm/tcg-target.c.inc b/tcg/arm/tcg-target.c.inc index 93a3ccaf66..83f6eb6099 100644 --- a/tcg/arm/tcg-target.c.inc +++ b/tcg/arm/tcg-target.c.inc @@ -1485,7 +1485,7 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, ldst = new_ldst_label(s); ldst->is_ld = is_ld; ldst->oi = oi; - ldst->addrlo_reg = addr; + ldst->addr_reg = addr; /* Load cpu->neg.tlb.f[mmu_idx].{mask,table} into {r0,r1}. */ QEMU_BUILD_BUG_ON(offsetof(CPUTLBDescFast, mask) != 0); @@ -1552,7 +1552,7 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, ldst = new_ldst_label(s); ldst->is_ld = is_ld; ldst->oi = oi; - ldst->addrlo_reg = addr; + ldst->addr_reg = addr; /* We are expecting alignment to max out at 7 */ tcg_debug_assert(a_mask <= 0xff); diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc index b33fe7fe23..cfea4c496d 100644 --- a/tcg/i386/tcg-target.c.inc +++ b/tcg/i386/tcg-target.c.inc @@ -2201,7 +2201,7 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, ldst = new_ldst_label(s); ldst->is_ld = is_ld; ldst->oi = oi; - ldst->addrlo_reg = addr; + ldst->addr_reg = addr; if (TCG_TARGET_REG_BITS == 64) { ttype = s->addr_type; @@ -2257,7 +2257,7 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, ldst = new_ldst_label(s); ldst->is_ld = is_ld; ldst->oi = oi; - ldst->addrlo_reg = addr; + ldst->addr_reg = addr; /* jne slow_path */ jcc = tcg_out_cmp(s, TCG_COND_TSTNE, addr, a_mask, true, false); diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc index 4f32bf3e97..dd67e8f6bc 100644 --- a/tcg/loongarch64/tcg-target.c.inc +++ b/tcg/loongarch64/tcg-target.c.inc @@ -1010,7 +1010,7 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, ldst = new_ldst_label(s); ldst->is_ld = is_ld; ldst->oi = oi; - ldst->addrlo_reg = addr_reg; + ldst->addr_reg = addr_reg; tcg_out_ld(s, TCG_TYPE_PTR, TCG_REG_TMP0, TCG_AREG0, mask_ofs); tcg_out_ld(s, TCG_TYPE_PTR, TCG_REG_TMP1, TCG_AREG0, table_ofs); @@ -1055,7 +1055,7 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, ldst->is_ld = is_ld; ldst->oi = oi; - ldst->addrlo_reg = addr_reg; + ldst->addr_reg = addr_reg; /* * Without micro-architecture details, we don't know which of diff --git a/tcg/mips/tcg-target.c.inc b/tcg/mips/tcg-target.c.inc index 153ce1f3c3..d744b853cd 100644 --- a/tcg/mips/tcg-target.c.inc +++ b/tcg/mips/tcg-target.c.inc @@ -1244,7 +1244,7 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, ldst = new_ldst_label(s); ldst->is_ld = is_ld; ldst->oi = oi; - ldst->addrlo_reg = addr; + ldst->addr_reg = addr; /* Load tlb_mask[mmu_idx] and tlb_table[mmu_idx]. */ tcg_out_ld(s, TCG_TYPE_PTR, TCG_TMP0, TCG_AREG0, mask_off); @@ -1309,7 +1309,7 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, ldst->is_ld = is_ld; ldst->oi = oi; - ldst->addrlo_reg = addr; + ldst->addr_reg = addr; /* We are expecting a_bits to max out at 7, much lower than ANDI. */ tcg_debug_assert(a_bits < 16); diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc index 74b93f4b57..2d16807ec7 100644 --- a/tcg/ppc/tcg-target.c.inc +++ b/tcg/ppc/tcg-target.c.inc @@ -2473,7 +2473,7 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, ldst = new_ldst_label(s); ldst->is_ld = is_ld; ldst->oi = oi; - ldst->addrlo_reg = addr; + ldst->addr_reg = addr; /* Load tlb_mask[mmu_idx] and tlb_table[mmu_idx]. */ tcg_out_ld(s, TCG_TYPE_PTR, TCG_REG_TMP1, TCG_AREG0, mask_off); @@ -2577,7 +2577,7 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, ldst = new_ldst_label(s); ldst->is_ld = is_ld; ldst->oi = oi; - ldst->addrlo_reg = addr; + ldst->addr_reg = addr; /* We are expecting a_bits to max out at 7, much lower than ANDI. */ tcg_debug_assert(a_bits < 16); diff --git a/tcg/riscv/tcg-target.c.inc b/tcg/riscv/tcg-target.c.inc index 55a3398712..689fbea0df 100644 --- a/tcg/riscv/tcg-target.c.inc +++ b/tcg/riscv/tcg-target.c.inc @@ -1727,7 +1727,7 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, TCGReg *pbase, ldst = new_ldst_label(s); ldst->is_ld = is_ld; ldst->oi = oi; - ldst->addrlo_reg = addr_reg; + ldst->addr_reg = addr_reg; init_setting_vtype(s); @@ -1790,7 +1790,7 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, TCGReg *pbase, ldst = new_ldst_label(s); ldst->is_ld = is_ld; ldst->oi = oi; - ldst->addrlo_reg = addr_reg; + ldst->addr_reg = addr_reg; init_setting_vtype(s); diff --git a/tcg/s390x/tcg-target.c.inc b/tcg/s390x/tcg-target.c.inc index 6786e7b316..b2e1cd60ff 100644 --- a/tcg/s390x/tcg-target.c.inc +++ b/tcg/s390x/tcg-target.c.inc @@ -1920,7 +1920,7 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, ldst = new_ldst_label(s); ldst->is_ld = is_ld; ldst->oi = oi; - ldst->addrlo_reg = addr_reg; + ldst->addr_reg = addr_reg; tcg_out_sh64(s, RSY_SRLG, TCG_TMP0, addr_reg, TCG_REG_NONE, s->page_bits - CPU_TLB_ENTRY_BITS); @@ -1974,7 +1974,7 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, ldst = new_ldst_label(s); ldst->is_ld = is_ld; ldst->oi = oi; - ldst->addrlo_reg = addr_reg; + ldst->addr_reg = addr_reg; tcg_debug_assert(a_mask <= 0xffff); tcg_out_insn(s, RI, TMLL, addr_reg, a_mask); diff --git a/tcg/sparc64/tcg-target.c.inc b/tcg/sparc64/tcg-target.c.inc index ea0a3b8692..527af5665d 100644 --- a/tcg/sparc64/tcg-target.c.inc +++ b/tcg/sparc64/tcg-target.c.inc @@ -1127,7 +1127,7 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, ldst = new_ldst_label(s); ldst->is_ld = is_ld; ldst->oi = oi; - ldst->addrlo_reg = addr_reg; + ldst->addr_reg = addr_reg; ldst->label_ptr[0] = s->code_ptr; /* bne,pn %[xi]cc, label0 */ @@ -1147,7 +1147,7 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, ldst = new_ldst_label(s); ldst->is_ld = is_ld; ldst->oi = oi; - ldst->addrlo_reg = addr_reg; + ldst->addr_reg = addr_reg; ldst->label_ptr[0] = s->code_ptr; /* bne,pn %icc, label0 */ From patchwork Mon Feb 17 19:29:51 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 865955 Delivered-To: patch@linaro.org Received: by 2002:a5d:64e6:0:b0:38f:210b:807b with SMTP id g6csp1252393wri; Mon, 17 Feb 2025 11:33:50 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWRfjCnVFDnR6ffF65rlHSGzW3N6us0hL0NuyF9ewTGcx5ciRRMbQiywf6czz215BbmKZ9bQA==@linaro.org X-Google-Smtp-Source: AGHT+IH8Rt2or4sEVsF60KHOCMXlIrLO/4iQdqKRiyZdOnORtgEsCrngut2q/G1PQyjmpNGQ0oeI X-Received: by 2002:a05:6214:2467:b0:6d4:254f:1c8e with SMTP id 6a1803df08f44-6e66ce323dfmr181525486d6.37.1739820830438; Mon, 17 Feb 2025 11:33:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1739820830; cv=none; d=google.com; s=arc-20240605; b=eX+8ZRvW87mvD89s3yj1rISpZvyIIyqqdR28l8m+g7nxSDzCMwnQUFi1j0iE2GqaUb 1DWP8Rpa9Gt3dC9Lgx0Pshv6Kal7g5+C0F1GrAayeaSKdRGJ8UyAwaeNdyfeUq6HvT8m dnmbukLw9Yw0AUWY+IHeRnfKqjXuw7Q/OCgeY8UhybV1YMNx/9jsLEuAhKBxqZrmCjjF JLtPYyv+jzXxqdvZv5yV01m8K3gVVfS5c4W2v21tqeTKpD86Nv04ioZMSywhnUIoBJLP 6WcJk5QPOjrbhFPPB4WILK4U6hIf2bykTx26bSxruYBkRjN0KpzWvD6sErpg1j7Du9IY XS6Q== 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=qBwpUjrpRy3DP9hoK1GLQ8GO+p0lkCqNn69gucYO0P8=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=iuj530Bbr9R8m1jnzJcYmbD0z7hMkN72alpCSxlJKpgetdKUmtJ0qsfLhuCXhzoOP/ 2wT8xNbPFo/SuGQRuSAsJMmEx4d8EwBiytjfrStUI43e4bHS53zWjx9qRf6JZmHs/sBD qinKenLFoWFLmRgzY9zWN0c50s3JcvhLBV8HeO+J/4DnUvuGbyedf2kWaR6SPGfa0UuL MlsJqby++5C4ddiFIcADfDrdYtaB3kNyWDeDkReCipFkkQpwBLNIwnoaNwPvD8HAXMGv rvtozJg/3/RXeYzcFij6c0cqbMdyNWpfCAmLB0bM5YzGFoMvIehyOMooehOXvZC8C8g+ wYdg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=px07RPka; 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; 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 6a1803df08f44-6e65d9a8e1dsi94626136d6.167.2025.02.17.11.33.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Feb 2025 11:33:50 -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=px07RPka; 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; 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 1tk6pX-0002A3-7W; Mon, 17 Feb 2025 14:30:59 -0500 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 1tk6ow-0001ua-Be for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:22 -0500 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tk6ou-0008Lj-Eu for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:22 -0500 Received: by mail-pj1-x1034.google.com with SMTP id 98e67ed59e1d1-2fc0026eb79so8738460a91.0 for ; Mon, 17 Feb 2025 11:30:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739820618; x=1740425418; 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=qBwpUjrpRy3DP9hoK1GLQ8GO+p0lkCqNn69gucYO0P8=; b=px07RPkaOXNtP8tenxaiCEW4LiWNmO9Wfat5fz2KlMT6OnWMfvQAYgfIXVgOTAt1ON j6Q+sp7syfA0TZJwlGvXcH0tYya87lyd+G3V/w/+AlzlFSePldFJjR7mrQX/x3Lfiba9 Zp0FfVTlSgnFG6QAsV6r+NE+qUXgn9JuL8U8ZjInu9M+8qcbWzJ4626wKaRtTS+utJtu CvIxw6d2barlwFeRcWrEfV0fCStyWOkTAHjTYKAnr+8v4FR4PLeILiOZGQyMcMEEyM18 s5Rq+sR18vGK6JDELKeISa05apdoC1XvpKoGvL0DR8tX2iGMC6Z60eTH3HXOoeBxOQnI wcRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739820618; x=1740425418; 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=qBwpUjrpRy3DP9hoK1GLQ8GO+p0lkCqNn69gucYO0P8=; b=Wjr12EY5M+orbKIy27yda6JapLs1S4f4Po/0c3IuNcbKMflZGJdPDnz+siCyqRVjce toeOjzxFVTDRIm2U6L7CB9fk6YjqqqWWH7r6TWGkU5HvIcmWGc/gJxaMDNjkznAmI9p9 O4+t7hZ0acSn1k3s2XJ8TEpW5K4+ZHmuf3LiL54xkHkhl8XcwHAw6QND81BhI0D0NV3K CU9bWByjk8gWnqShtQf2SuBdncpnkgreQhwA9WOq95wBk31MyvRxdIjH//wtqiQPsmG6 NbzZ056EUuEwCzFmJ2Vqi0TaXG5HHWe6T/LUlPyViK1mzVNZno3FMPnAWzDhElbyFvBK dkyQ== X-Gm-Message-State: AOJu0Yx5vPLWQJbIWJvmEbQnPej3S17ny3vpZlx84wpKtK/DHBdGuURx o41Y/7KU5UkJwCg7O6GmPGFmkYpwKwcCZiWn0t/yr9BCjqcZiglGFcJzuIwY+3hDSKTALHFlm7H 7 X-Gm-Gg: ASbGnct5ygpwFuVgSa7fN8I20+5SND94qCFJu9RzQoGKnyBbxKbWSEU945EII/8MQ7o 71tNwh+EUK6B6AGy3vsH7nphtFTrZ/Iw5Gq0WplNW4GLrjNNJmLkrFGAfsGt96PBuiMc0aBtQo9 TWnSXGlgQKo7pnunuxMLwb9GoYuSi52MydVy95I8NAr7k276WuowagCbGhcAukQsZKIj54RAa7F cOpTU4bKHR2q7wAhDPj73+JxUgs8Pzlh0WnBbIJvlcz8JQ0SIqacK2CUMwQCvhi1fiIoijywyHJ cVAJ0ttxydqkmcwpqxE6/tEuxhCm/xQKXX7b/iLE/t55gTI= X-Received: by 2002:a05:6a00:2d9d:b0:730:95a6:3761 with SMTP id d2e1a72fcca58-7326177e484mr20681206b3a.3.1739820618236; Mon, 17 Feb 2025 11:30:18 -0800 (PST) Received: from stoup.. (71-212-39-66.tukw.qwest.net. [71.212.39.66]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7326a38ff76sm4347164b3a.160.2025.02.17.11.30.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2025 11:30:17 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL v2 10/27] plugins: Fix qemu_plugin_read_memory_vaddr parameters Date: Mon, 17 Feb 2025 11:29:51 -0800 Message-ID: <20250217193009.2873875-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250217193009.2873875-1-richard.henderson@linaro.org> References: <20250217193009.2873875-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.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 The declaration uses uint64_t for addr. Fixes: 595cd9ce2ec ("plugins: add plugin API to read guest memory") Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- plugins/api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/api.c b/plugins/api.c index 4110cfaa23..cf8cdf076a 100644 --- a/plugins/api.c +++ b/plugins/api.c @@ -561,7 +561,7 @@ GArray *qemu_plugin_get_registers(void) return create_register_handles(regs); } -bool qemu_plugin_read_memory_vaddr(vaddr addr, GByteArray *data, size_t len) +bool qemu_plugin_read_memory_vaddr(uint64_t addr, GByteArray *data, size_t len) { g_assert(current_cpu); From patchwork Mon Feb 17 19:29:52 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 865948 Delivered-To: patch@linaro.org Received: by 2002:a5d:64e6:0:b0:38f:210b:807b with SMTP id g6csp1252051wri; Mon, 17 Feb 2025 11:32:47 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUSBv/K7fZFaKyG15gcautbPxyfnSbRxGn8sWT5FnYbdrXmODzNx8hyG1ICabDWVBrWM3V00Q==@linaro.org X-Google-Smtp-Source: AGHT+IGyi9CyegP7mqsU5jzPVKGx1PctRw8Nrs+NvG8p49mcAFVOD0aYGtoNBqjCST2aSYc+bR5c X-Received: by 2002:a05:622a:900a:b0:471:f272:985b with SMTP id d75a77b69052e-471f27299c1mr48427001cf.42.1739820767157; Mon, 17 Feb 2025 11:32:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1739820767; cv=none; d=google.com; s=arc-20240605; b=J6HF3PJiCTWkcY6Kv+8ZIQCGyuFjc3XzDYxO7113rrfcAOOybdUbecantc++FfqAs1 cc/JDcxBIjY9Ji4bFPA3DiC4JXg1s/elVJ/Cd4c66fX1aKaiMpvqe//fNKpouVKgwSei oTN2OyK9MuSKmxUSmdbKR8YZIGFxDE+d1QVdhn+NWJGeOzNsTJPiTQ2jxLQA6BfLcG5K PJmisrWv9czPPXiJEX6SvAXvj7nGjlRWAdNhdXQ369ZJCvzriBdCMxh4Cm2q4WgNuOWK 8ClTIU8zMJjb+wHffcT9rEP3eCn6mIFUqok9K4ez0IB5kUc0W4FtECNpU3Qw2YdA4APN ChIQ== 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:to:from :dkim-signature; bh=K2WH4FlAMIZ4FEc2EEi85vRc1c0fQFd97dzVfYF6JEw=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=jnUPPZ7bf8sQEebubivAs0A5QaUZCac32ZFlSZfJsoXiiTSG72LyR2FtyKgnqjqI8+ i5xOFjjuEK0BLoH1upzBHVsukVd8G6VSXr6Fbdcem9o7dQLhCPNyHJBo1fUq0Idl9Jrg 7+sFm0k1hA2tUxvcUwOkDHUpB7JBkEdyaOGn/y7iV9JE/3mjUghxBLsF8pukUGE8eaDJ 7oVHmnWco8DQp6siviw244VF58p/CNtkeL3u30VAeFag2x7Cp5VmZidCqE32jixTbBxw 8qB6khgW7R1So0gVimqi/sRYpV8PX27+ECNvlZhPVXqDHErKhjRSf2lvkQtrHSXl0eEg oewQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=neJJdwk4; 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; 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 d75a77b69052e-471f74a1b2esi12559341cf.58.2025.02.17.11.32.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Feb 2025 11:32: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=neJJdwk4; 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; 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 1tk6pb-0002I9-MS; Mon, 17 Feb 2025 14:31:03 -0500 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 1tk6ow-0001uZ-B2 for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:22 -0500 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tk6ou-0008MY-M8 for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:22 -0500 Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-221206dbd7eso26586585ad.2 for ; Mon, 17 Feb 2025 11:30:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739820619; x=1740425419; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=K2WH4FlAMIZ4FEc2EEi85vRc1c0fQFd97dzVfYF6JEw=; b=neJJdwk4UPYsY3t45/cP8QwB2AF+ECfpIH9S+ZN5wQgVOLiH3pkLP34hgVBRinnc2f gz+7r3cz6fGRhIuIqD/TWV0/GwMaK50aVBECCCZ5ZKw+CV+DWRvDrewq57nF1oGd7FF2 kyQDcX6WbKjbgb4DjY7GIJQtQTL6y1Pwp6y4qRH8Pyw2Ho9djH+iAU5UHnJJF+4mSdWk 9t9beeu2zvzn0OiobjZAxn+VY8KZnRA/Yc75Dgj9dNZW3sC2UFpxXbqFsxlHpJJUl6L5 7E/0m+j2p+VGNBH/TElpyOWvbAlY1kKWjtnQufTUsfLK0EyzjPcKDhC/FtxqglqaeSVj rPkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739820619; x=1740425419; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=K2WH4FlAMIZ4FEc2EEi85vRc1c0fQFd97dzVfYF6JEw=; b=iJCQy/+MZ3GYTgQUB41CjDQqVv0n36nRmw56wONTQg/sBRSaq21wjlgWwvKCVjOhoO y0fa+8muPDKNhmSHV1/pfyQG6aIyro6oGDmjyKAsK/wZxj9Kg4a8cKEtQsLFfrZgxa6O AIEYaJMdgwQcZKWdM4Q+irEDWuLmJzN4y0+9sX9sjgOyRXxRClyb425RFasr1y9Aesyb eHl9riqW6j0P/qCQY4MYHSdaRFwTaEkdlOkvcaTwnqswgq2gRxdGQAkGfYSzPKrMTPoa ENETNTm/QZV7d4elyn5hlcg/FAbEz0EgYpu0y+x9rPqur48Wd3WnY/p39/iSPSV8TJcN 4sqg== X-Gm-Message-State: AOJu0YwOeJN5CUiovt2QYIdEqSv3ncCSb5aDmb5X2Z+SHD1mMDotFYq8 eYdB5QJmixrbkbUelOH1QVuUHzZvELsWVeoFqgF0qUoIjgu8EhW8A1HgM6o5E78P+q31wpmHgA1 q X-Gm-Gg: ASbGncurA6RJ2YUpOFiVeUhbh5p6/uVo7CIrq4ryytQ8yVXdX74nMdtvuY98X0l8qxU edZU4LLZnVatIAZ+cJBAfAc7fcYT8uzk4pbOfWUAUe/l6jRiKjYFX/BftfneemVjfXi16TjEzaA 3XJ1HDrploqTgWfk/1h+hBs7cK5SO4v63zfkYhbMG4uz4m66WISZ8vAaqV8c7K5hzcISDGoJvyC xWwrWbElW6LcZRmePuJy3M7xFh55wCguWB0hV+f0dEMkslERY57MSV//jtxV6gU4hkCDytnutuA yKMc2/iIITDClGHMzTQWtCHf6RQ2gRDL5mVkmBBZ4+Y/1Cc= X-Received: by 2002:a05:6a20:9145:b0:1ee:c1b2:76c8 with SMTP id adf61e73a8af0-1eec1b277fcmr2181528637.37.1739820618829; Mon, 17 Feb 2025 11:30:18 -0800 (PST) Received: from stoup.. (71-212-39-66.tukw.qwest.net. [71.212.39.66]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7326a38ff76sm4347164b3a.160.2025.02.17.11.30.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2025 11:30:18 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL v2 11/27] accel/tcg: Fix tlb_set_page_with_attrs, tlb_set_page Date: Mon, 17 Feb 2025 11:29:52 -0800 Message-ID: <20250217193009.2873875-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250217193009.2873875-1-richard.henderson@linaro.org> References: <20250217193009.2873875-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=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 The declarations use vaddr for size. Signed-off-by: Richard Henderson --- accel/tcg/cputlb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index 17e2251695..75d075d044 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -1193,7 +1193,7 @@ void tlb_set_page_full(CPUState *cpu, int mmu_idx, void tlb_set_page_with_attrs(CPUState *cpu, vaddr addr, hwaddr paddr, MemTxAttrs attrs, int prot, - int mmu_idx, uint64_t size) + int mmu_idx, vaddr size) { CPUTLBEntryFull full = { .phys_addr = paddr, @@ -1208,7 +1208,7 @@ void tlb_set_page_with_attrs(CPUState *cpu, vaddr addr, void tlb_set_page(CPUState *cpu, vaddr addr, hwaddr paddr, int prot, - int mmu_idx, uint64_t size) + int mmu_idx, vaddr size) { tlb_set_page_with_attrs(cpu, addr, paddr, MEMTXATTRS_UNSPECIFIED, prot, mmu_idx, size); From patchwork Mon Feb 17 19:29:53 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 865959 Delivered-To: patch@linaro.org Received: by 2002:a5d:64e6:0:b0:38f:210b:807b with SMTP id g6csp1252641wri; Mon, 17 Feb 2025 11:34:29 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU8KRgfXfP+6ErFQFbQ55359i92z+p/mRxMUM0rNIb4l9o1ll9/0BMU6dZscIrT3dX7g8u6cQ==@linaro.org X-Google-Smtp-Source: AGHT+IE5YG4kNrtCsyzqPtC8G+enkMHmAj+bsRPxMKVMwmfZSulznepmQdAF3ho8lEmfwdDvr/T4 X-Received: by 2002:a05:6214:20aa:b0:6e6:6535:17dd with SMTP id 6a1803df08f44-6e66cc86bf1mr178858466d6.7.1739820869202; Mon, 17 Feb 2025 11:34:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1739820869; cv=none; d=google.com; s=arc-20240605; b=SlMHxspR5W0iJJf9UMcbs6RM6jqPrLQi6JlJfNlunzbyI2QrmLr4nfx9ZpwsYcDDWz HUnmbZMuCb34aNJlykwIKc9zyZBOAXHTo3lBu9r3Il5NiGYta8gx+6HqxK5iUOnXvaxj FJu7LpOQoDPZZw+PLpNQuyOtkgkHY/j7Wtd50157rFY/nfJl8Kpofg8a64cmCn/eeeRX 1GPMxf6IQWAsHtIZtyImr64nTF2GixEkx+qbqcFShac04/UzQiP4bE5u9ZVr7k1OD0mY yWQPtVJ1047Gizg+CkoIS844eOUPzlFalVmXiskPIYTCBKDMVlivKcJMlhd55HdnDL2y iOYA== 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:to:from :dkim-signature; bh=oS5Y9/paa9jMbBQhn+BAkk9Qf6Zlh0Z5idEcCp0uG9E=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=BY2KPUJFHz4ljFVUktQLSIkL4sDVm4CMU6CtqrtGIzEr5Z1q3ZndBOKeRiXoWR5pBs tzGsPP6muOGuWyp2mmM+xlCy2QT76iHs+NOK5vMAzB0ql7CAiI3QmLGFfKQfB+9pRsiP Nlatg1C8a5Eg3UW9pbuQcJbEym3orI/7YCy1egM6AekJlVaQ7n10mLqydoXtXrrhSBuH RX5hELfnxERC0TymHPhs6z0WqROQRWtWLrNVPj8iDZ/F/youCVtcoISbGlkN3zsvhxwM HSHx/lHI3SlEzteotlw8QEJQW9tXl2PJIZUdpFSrJmLOZZ+Gd56bXVWHsWS3qpoyyUyv UA/A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NSIlwrO6; 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; 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 6a1803df08f44-6e674c7de8fsi42786226d6.186.2025.02.17.11.34.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Feb 2025 11:34: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=NSIlwrO6; 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; 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 1tk6pg-0002UH-1x; Mon, 17 Feb 2025 14:31:08 -0500 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 1tk6oy-0001vY-0u for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:28 -0500 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tk6ov-0008Mo-1V for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:23 -0500 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-220ca204d04so61620385ad.0 for ; Mon, 17 Feb 2025 11:30:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739820619; x=1740425419; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=oS5Y9/paa9jMbBQhn+BAkk9Qf6Zlh0Z5idEcCp0uG9E=; b=NSIlwrO6Gb7iq9o0U9UAonbiOpLYoffOoy3VuxwarABg6WcIPeRa+20wNIt6ZxPrpG ppBm3vOSU+cUUyJbfNFydqlVtI0YODhbHxy+9ABj318/dd4UoEfWr4dgEeofF51MlK7B fUcbuzc0jix11zscP0/XjFWyrArKY1RbgxSf1W7jgTUnEs0hjiIZSMqbK+/hbgrzT36K d8R7NvDhGEJzvA2YmUm5j2rBJE5idz/r3WnVA/R6UyblxltSTvzWHHmsGc+M/q6fBDIz rUwVSUOAmG+PEQ4zrs1xtX+fwGQ7alsbwdsVsA7LJQFeX9QchUxq4vyfsIVKajr63ZJs A+RQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739820619; x=1740425419; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oS5Y9/paa9jMbBQhn+BAkk9Qf6Zlh0Z5idEcCp0uG9E=; b=KIlluHIbZwpfeEJRXQL04p0U23o5+V3L4+Vg3NHP8YaKJsHP4KjLdnsfOVCImkaqSc J6aFKr19kWWPoifJl1g+xHRD8fKJDpGEYL23Z8AxWOkakjP3UTOr1Zb5K4SYyKGL484e Bg+pCSsJin0xOIlqyvw+SQqZxG+nbiqFqN2dtO+nd9jwO450OQX7+uQ8Fe3krGSasmai lJQSx6qDcLH+gMjpi9LkAiNw5yAjKuY77jMT4W1f0TYG/s3vYUvXbkqfF27HU+es5ABB oZP9kRa0uC0n7vdyRcG+xmPqmSba+ryV02XKYnlyAMNkopLhDRRVz8Dxc8jhhPZZR63O zNhg== X-Gm-Message-State: AOJu0YzV4Nu8X8YJ+hRx7yf6eBhC/snJpK4/O3DB/cSaTwBTzvvKf8dt qo8I+0gbRTkH6gzjmY4j2xIQtEB/7q3+OOk1MtuE+LoTUh5O34KN+SSyajqKaXLCOK26wR2cyvb 7 X-Gm-Gg: ASbGncsZcGeGU708lH0synUj6hcKziJJoh2AEuyxPewR5X3NZ9IJMrQJJnaL6zi1XVR UP/TA/LXjGLBpAzj5m2DkWu8F6khYp5lHd28DRm/fs0rdROrHJvhOFoUyECEDAQqwBYJKnJ43Zy GlLYyBzHv9vxi/gmC9rrCOvcrNy3aFBL+FMfF7oebm0AiwayNzQGze6OVyap9ZvIvsUHgUvWGs2 MqtrYdpIY6lhg7KHH/kvhFfQRR5oBmGXeT8MTTVqjeinTnlP2KE8pvdqXxwIei4xMrL0wKjB59/ oQjDFZTF0yP5IvrUQNTHnHmKX7b7PN9Vw+LILpHAcO4OvMI= X-Received: by 2002:a05:6a00:3d0f:b0:732:4c47:f807 with SMTP id d2e1a72fcca58-732618fa196mr14649336b3a.21.1739820619502; Mon, 17 Feb 2025 11:30:19 -0800 (PST) Received: from stoup.. (71-212-39-66.tukw.qwest.net. [71.212.39.66]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7326a38ff76sm4347164b3a.160.2025.02.17.11.30.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2025 11:30:19 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL v2 12/27] target/loongarch: Use VADDR_PRIx for logging pc_next Date: Mon, 17 Feb 2025 11:29:53 -0800 Message-ID: <20250217193009.2873875-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250217193009.2873875-1-richard.henderson@linaro.org> References: <20250217193009.2873875-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.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 DisasContextBase.pc_next has type vaddr; use the correct log format. Signed-off-by: Richard Henderson --- target/loongarch/tcg/translate.c | 2 +- target/loongarch/tcg/insn_trans/trans_atomic.c.inc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target/loongarch/tcg/translate.c b/target/loongarch/tcg/translate.c index 3480f54c71..e59e4ed25b 100644 --- a/target/loongarch/tcg/translate.c +++ b/target/loongarch/tcg/translate.c @@ -289,7 +289,7 @@ static void loongarch_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs) if (!decode(ctx, ctx->opcode)) { qemu_log_mask(LOG_UNIMP, "Error: unknown opcode. " - TARGET_FMT_lx ": 0x%x\n", + "0x%" VADDR_PRIx ": 0x%x\n", ctx->base.pc_next, ctx->opcode); generate_exception(ctx, EXCCODE_INE); } diff --git a/target/loongarch/tcg/insn_trans/trans_atomic.c.inc b/target/loongarch/tcg/insn_trans/trans_atomic.c.inc index 974bc2a70f..3d70d75941 100644 --- a/target/loongarch/tcg/insn_trans/trans_atomic.c.inc +++ b/target/loongarch/tcg/insn_trans/trans_atomic.c.inc @@ -56,7 +56,7 @@ static bool gen_am(DisasContext *ctx, arg_rrr *a, if (a->rd != 0 && (a->rj == a->rd || a->rk == a->rd)) { qemu_log_mask(LOG_GUEST_ERROR, "Warning: source register overlaps destination register" - "in atomic insn at pc=0x" TARGET_FMT_lx "\n", + "in atomic insn at pc=0x%" VADDR_PRIx "\n", ctx->base.pc_next - 4); return false; } From patchwork Mon Feb 17 19:29:54 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 865963 Delivered-To: patch@linaro.org Received: by 2002:a5d:64e6:0:b0:38f:210b:807b with SMTP id g6csp1252821wri; Mon, 17 Feb 2025 11:35:06 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWjgLLARC6bgrUX0A28yoEMmdWMPlAid0WOjge4fvn0iGAEOjtRiwfTwjtmjh6ydHG+wn/ccQ==@linaro.org X-Google-Smtp-Source: AGHT+IFcc1i1EGv3zJHDXnbY5D26X/tOi0CYW1SfT3TNbNnl827aNdMA7toQ/2x10dTpuIs27I+S X-Received: by 2002:a05:6214:29cb:b0:6e2:43d1:5fec with SMTP id 6a1803df08f44-6e66cd08d29mr155805836d6.33.1739820906748; Mon, 17 Feb 2025 11:35:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1739820906; cv=none; d=google.com; s=arc-20240605; b=keQU88iLRQ4dKMnojsg4jvuwiQb+274yYwNqbU600h02rjoe1YNSJWDhWR2+7m4lvU zjL+/T0HtpbV7OR86qNhnd3xV0929nMbV7u3OqZ1MT6TnNz+Oz6YkRop5ov2q0bOrLfT IU1Zy/gfFdqexTez13eFS8UaIkmEmWUoXC0GJCpbj0Ln4YFQAoogUtEQLgYhiSoM0NsA l6082qSw3EPCwa+n9r4buYLZmMQIq+0SsOY1fgG4MQIiux4NMQgz0EGA3cE5iXvVLcg7 jA01IhEDYOS8ViHJPm2nQts/9TfrQAGHWM4e8s+gIf+GTMarGTV9aDFXgrlK4qRE67mS Kktw== 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=0w1nAz3ZZyz0kW9yi4rO7ndLN0hIyYSz6AGDjBaQFXE=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=gVyNElzF4ERxnPRuspMhNQELPc1T5N2DhBPZJOMvyv9qkuVKxli/bQyKx8r3pm4n9+ bvoec0KYbU1QxARGDSO3LEnmF1UagwKcFWcpUrR/8kvvHi27649jhg7tBuwVUhvCr9ek lX6+zS8PyiFRpkRhR8bVR+H+soNUd6fwxk9diPoRIJmgOlZ1tbWizH+pppxQjVU/7E14 r409e6ndRalbDt4t7T25bQXUaKzNzYJBbEFxtOX/81KKxHBOHtznWf1INIV7ieHpj14J R/CHCuTLpdjid2y9lz+LfjxhR3B7+5NUgJh5v9F6CGgWE60uOogwuTTRcPh60mh6a4Ro 4w+g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SkMrefKC; 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; 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 d75a77b69052e-471feeadb25si2809691cf.616.2025.02.17.11.35.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Feb 2025 11:35: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=SkMrefKC; 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; 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 1tk6pa-0002CZ-2E; Mon, 17 Feb 2025 14:31:02 -0500 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 1tk6oy-0001vZ-5o for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:28 -0500 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tk6ov-0008NR-N2 for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:23 -0500 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-2211acda7f6so33379685ad.3 for ; Mon, 17 Feb 2025 11:30:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739820620; x=1740425420; 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=0w1nAz3ZZyz0kW9yi4rO7ndLN0hIyYSz6AGDjBaQFXE=; b=SkMrefKC/kpBk8qF0PSXfU24VR8dvw0z4VDHVjQkSTM18CL4ElRgdD4o0yZ/Mz9i/E 7TRHn0cbWMt9oUNIUFqhXNW5USDalHbaDrXuMc8zN/5swQ4wPT0nGc8xSrGsuuWVrCB7 CiAiv+UDDrONMl2AK7s3P0FpT2DxbMGlQvFhZ8CFqHcNGsAj9st92hvUoU/ktCrnN9Pc Z/1E2v4luQdvJ7UKWUaZtevRZxXhJ2p+hglMUryEV4gcvP3t+5w1/Qub9AEPq3U8SHxa 37TedIV3JrCY14Tu83pykHEghoLdpA++xA5wRU5FR7t68VIAPinHqZ+SvxZVmsHshEpV aRnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739820620; x=1740425420; 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=0w1nAz3ZZyz0kW9yi4rO7ndLN0hIyYSz6AGDjBaQFXE=; b=YUrwlE8CUNoSBi2F1S3K6J+/NpG0/wDst6ppOP4jl6PYoQ5YQoUsWq7CUYMTZ7sFrg 6I/YnqdW3hLr83CDr9/MPtX0376dCdEtpScGDU+/W12ahHkzU46m/cj8/3Bu1Roewnn0 16wcuheTpfEwaUqpCGTD8yIDSvy29Yrx4C3YXc/AQDCMaaNkWgUV6S/wHeKU4GV7omZ7 y0RfgDopO7ytJGh1RqHXZN45eykJ6GmYYjIgrwcqvbIUV8yk02dFqt/sYADL4xZlTtct dFzWVeC3X8fjl8Q7JQ1aqWSp7l6wbyuB0dyV27rVy+XUjuJbNYzH8Tua3vRueShAM8V0 PLdQ== X-Gm-Message-State: AOJu0Yx7I/N5UfU7J21BgcHRrM2q74WuWO600kxyui+WzALPSQHW2IWA vYQGIgs+6b+VoAd14+C+cvoLfKJi1I7YN0SayUU94vTn1wCxoYNb6g5NfEpsTVrqbUqB7k4ia/h S X-Gm-Gg: ASbGnctsCCwrMcmbppW35h3W1PHbN0W7ywOcrDpjbJdMBgIne7V7DzA7oMyDuAlKrrF Ch42LlbIt+WUbhL2hhqz4fwRwnOzjvQAlaZ6L1HuAiDlgiqPduDmMQF3uz1aKP9MCgk+AsXdrAt qPc5WizL9Aun6KvkMT/xQRmdJ8qzPUeB8XcYHkfzyJdipVV2tTC2UfUDQUKP2mfN/U10rWgnNxJ O0H4h8rJ6RMVkY0rziqfV2m8MrjLTmEyKOwbZlFpXGk7A0TCXir0wus5+9S7EWXlCjeVKuhcGbu P4aC2nURj7Uf3z7i5D+NsB9WtYNwZgqfFPBmtry3R6akV7A= X-Received: by 2002:a05:6a21:33a1:b0:1ee:62e4:78cc with SMTP id adf61e73a8af0-1ee8cc1420bmr18591901637.36.1739820620112; Mon, 17 Feb 2025 11:30:20 -0800 (PST) Received: from stoup.. (71-212-39-66.tukw.qwest.net. [71.212.39.66]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7326a38ff76sm4347164b3a.160.2025.02.17.11.30.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2025 11:30:19 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL v2 13/27] include/exec: Change vaddr to uintptr_t Date: Mon, 17 Feb 2025 11:29:54 -0800 Message-ID: <20250217193009.2873875-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250217193009.2873875-1-richard.henderson@linaro.org> References: <20250217193009.2873875-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.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 Since we no longer support 64-bit guests on 32-bit hosts, we can use a 32-bit type on a 32-bit host. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/exec/vaddr.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/include/exec/vaddr.h b/include/exec/vaddr.h index b9844afc77..28bec632fb 100644 --- a/include/exec/vaddr.h +++ b/include/exec/vaddr.h @@ -6,13 +6,15 @@ /** * vaddr: * Type wide enough to contain any #target_ulong virtual address. + * We do not support 64-bit guest on 32-host and detect at configure time. + * Therefore, a host pointer width will always fit a guest pointer. */ -typedef uint64_t vaddr; -#define VADDR_PRId PRId64 -#define VADDR_PRIu PRIu64 -#define VADDR_PRIo PRIo64 -#define VADDR_PRIx PRIx64 -#define VADDR_PRIX PRIX64 -#define VADDR_MAX UINT64_MAX +typedef uintptr_t vaddr; +#define VADDR_PRId PRIdPTR +#define VADDR_PRIu PRIuPTR +#define VADDR_PRIo PRIoPTR +#define VADDR_PRIx PRIxPTR +#define VADDR_PRIX PRIXPTR +#define VADDR_MAX UINTPTR_MAX #endif From patchwork Mon Feb 17 19:29:55 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 865962 Delivered-To: patch@linaro.org Received: by 2002:a5d:64e6:0:b0:38f:210b:807b with SMTP id g6csp1252818wri; Mon, 17 Feb 2025 11:35:06 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUPRTI9dCkPMmkOutzmkMP/K6P+dqdLYto/I699RlEYYQ+jimV6hcS0FdwiWw52wcrXfnT1Xg==@linaro.org X-Google-Smtp-Source: AGHT+IED+l+mAvtjVdz5n1IEaPVTGmsIKGIRUoS0iYRLYjZeasnAfVICMJjqSOr48BZEwkStovvG X-Received: by 2002:a05:6214:29cb:b0:6e1:700e:488a with SMTP id 6a1803df08f44-6e66ccc476bmr142587586d6.22.1739820906206; Mon, 17 Feb 2025 11:35:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1739820906; cv=none; d=google.com; s=arc-20240605; b=RwwG5UNofVYDpEUyPzvr3HEH0+sbcrgXYhqiYrKJW7gNrnzKygfPGENzgH/i1X0cOD dTYAJpmMM33HX4661EseIPTYW/sY3F/Vtt1ikXQQxcZG/aazL6qPPlKQrfA9q/LKLJrJ 63FKzk6crsxokA3k/e6uVGalzNA6szamQFk/YPgchQp0sbjjIBQ9f53K8myjozuYYmhA jvIP3VX+zhKlfUofj+qIbntUdtuVL6aKEyWQBDfca3H/Nl519bFv2WqNmTVTKYjU5kEd N0z2+4GZ2xqMGACZoFiN+rHz4TR+sAuyA5n9SQPMwUtVoZMNDnUuGRZx79u/TJpAg8L1 MSjQ== 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=jSqS9kMTvyRTGLGgXwsTZ3V17qWRY5dQH7PE/q6TsPI=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=kM2Cmfwt/npLtBM4YZIDv8oYVltNzg+7GIEqPnTNQNbCuGFgO/yz6+BzbSH2Qxfn7n 9SpGKleQUnXeAzonPhazl8rctiTSK73eTdn+JuAluEkEHkp+mV7O7vM1Sq8Q6sDlo2Lx 7dFmGUPj5vwGRDQfv72Sar01AVYl7PqRuuh5vLBNb+CS7ZVKZIZalNCZry0CIXMuxI08 5uQ1FT0a3Vn1pA8mp+JhsyPZRtPxoVcR9Oda2KZQ/MvpEiq4tsXPJdq/zNo/GOjDbMnj lf8RKqlO8RmJPCR4qw0L4kngNxCsSXuhWieLzmcgQlvbfgKcB4o0/RgLbUlvKiBa1nrs FuIA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PJd+4S7E; 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; 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 6a1803df08f44-6e664c6d035si77187546d6.5.2025.02.17.11.35.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Feb 2025 11:35: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=PJd+4S7E; 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; 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 1tk6pj-0002eR-QR; Mon, 17 Feb 2025 14:31:11 -0500 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 1tk6p2-0001xC-F5 for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:28 -0500 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tk6ow-0008O5-Gb for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:24 -0500 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-22100006bc8so42906375ad.0 for ; Mon, 17 Feb 2025 11:30:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739820621; x=1740425421; 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=jSqS9kMTvyRTGLGgXwsTZ3V17qWRY5dQH7PE/q6TsPI=; b=PJd+4S7EkQkLxdfLfKdsL35JffUT2hDkDRReAOgmbwIO+jJW0j5cT2mvrc7NrRbyxY ziPqUl+BZSgMFXlQA6Vg7CGty/y/fssIUXULhBUE8z/CjM2M50lQiOcRu95KApSyMMp7 AkNDrRPpEvFeMLKIWNnT+NV4RdACHCvOERklsR/qnKNcHjvqxr1l6XXMqxLaoUCBDqCo wxfv7TsJ+/M2VN04D50sMLQ+vOOrbY9DK6ptjYm2uSwHTzxni8WhGvK3rpc96w++djMW esoQNmOCJk1ov8bSqPtrSbTq7pRnj5di1dtYTXuz54yDuMHUHut6BNFAom1w058dRi2Q nUcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739820621; x=1740425421; 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=jSqS9kMTvyRTGLGgXwsTZ3V17qWRY5dQH7PE/q6TsPI=; b=QWZ2X3h6zUHeYVdXX7vs4a/aCE6A6s/2i/6odJcnLWuXOfhrmreFwGxol76wy3T7hA MfgsPE6Vo8CsIND1ZpGgkLZuf7E16UwyHj6Z/gyLJOfIsLYWjy0HdApKA79DOQRKfJwm EEXX4Kt9Fmy4GRym1xYyUMIamXeVAL+ytR9cVuV+mDAsGHa5QVhWrt5VGNsZE+xG7PBM FSjn6uQuRp70kMbfJ1YpzuDGLNMBBh0oRZp4Mh6OFx/+Gl7HDYhnUoEw5mTG8npgdjvs 8QxI2GLpTT+d51glGa8IpiyXTSWN9j2ke1E365A6LITKQ5nj+QL6/CtBP4eTtZ/twZYy YwiQ== X-Gm-Message-State: AOJu0YxoZtevAfkbB2pkhDwclmVOndmi8jT8sYIDrCdnS80OjwzhOevV KDr1cAQIsyZ7RDHlaWQ48eZJDMwh9evYvhHbJR0cLM/EaAHGYYG0gcCMi8zf68BfSvMT0FEJuDn 6 X-Gm-Gg: ASbGncseVwRxMSKqccO1WnH6ATrv3dwCTeLiXIkg/ZiGeX80qdAbXwAe7WTYFc2vJL9 AUi/lI5md4By0/ATTvnnfExYv9lf7nNiaRd/mtQPZo7pvezUFscHZufUYydlDBiOIHqxbknIQ7g Rory03Q2BcVAX2FzJuwICEV5NbtaIMWLnb9fXyYcc2MhVyZhrjirpYtUmi9e0ck89yxr6OEed3q /V8XnmVD6lYKNzHrOTOWadjKn+DQ2yn6gXZVjxjFwHo6nCMhnn4CDpG/e54IaqBeHN0psbcqKeI Duxtu4uS9Aj1U2SUgb9mZ1Dt0m3mLMUAxs3y1lEnKYXhO+s= X-Received: by 2002:a05:6a21:483:b0:1e1:ccf3:a72 with SMTP id adf61e73a8af0-1ee8cbc1de0mr19814638637.28.1739820620739; Mon, 17 Feb 2025 11:30:20 -0800 (PST) Received: from stoup.. (71-212-39-66.tukw.qwest.net. [71.212.39.66]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7326a38ff76sm4347164b3a.160.2025.02.17.11.30.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2025 11:30:20 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL v2 14/27] include/exec: Use uintptr_t in CPUTLBEntry Date: Mon, 17 Feb 2025 11:29:55 -0800 Message-ID: <20250217193009.2873875-15-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250217193009.2873875-1-richard.henderson@linaro.org> References: <20250217193009.2873875-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.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 Since we no longer support 64-bit guests on 32-bit hosts, we can use a 32-bit type on a 32-bit host. This shrinks the size of the structure to 16 bytes on a 32-bit host. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/exec/tlb-common.h | 10 +++++----- accel/tcg/cputlb.c | 21 ++++----------------- tcg/arm/tcg-target.c.inc | 1 - tcg/mips/tcg-target.c.inc | 12 +++++------- tcg/ppc/tcg-target.c.inc | 21 +++++---------------- 5 files changed, 19 insertions(+), 46 deletions(-) diff --git a/include/exec/tlb-common.h b/include/exec/tlb-common.h index dc5a5faa0b..03b5a8ffc7 100644 --- a/include/exec/tlb-common.h +++ b/include/exec/tlb-common.h @@ -19,14 +19,14 @@ #ifndef EXEC_TLB_COMMON_H #define EXEC_TLB_COMMON_H 1 -#define CPU_TLB_ENTRY_BITS 5 +#define CPU_TLB_ENTRY_BITS (HOST_LONG_BITS == 32 ? 4 : 5) /* Minimalized TLB entry for use by TCG fast path. */ typedef union CPUTLBEntry { struct { - uint64_t addr_read; - uint64_t addr_write; - uint64_t addr_code; + uintptr_t addr_read; + uintptr_t addr_write; + uintptr_t addr_code; /* * Addend to virtual address to get host address. IO accesses * use the corresponding iotlb value. @@ -37,7 +37,7 @@ typedef union CPUTLBEntry { * Padding to get a power of two size, as well as index * access to addr_{read,write,code}. */ - uint64_t addr_idx[(1 << CPU_TLB_ENTRY_BITS) / sizeof(uint64_t)]; + uintptr_t addr_idx[(1 << CPU_TLB_ENTRY_BITS) / sizeof(uintptr_t)]; } CPUTLBEntry; QEMU_BUILD_BUG_ON(sizeof(CPUTLBEntry) != (1 << CPU_TLB_ENTRY_BITS)); diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index 75d075d044..ad158050a1 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -104,22 +104,15 @@ static inline uint64_t tlb_read_idx(const CPUTLBEntry *entry, { /* Do not rearrange the CPUTLBEntry structure members. */ QEMU_BUILD_BUG_ON(offsetof(CPUTLBEntry, addr_read) != - MMU_DATA_LOAD * sizeof(uint64_t)); + MMU_DATA_LOAD * sizeof(uintptr_t)); QEMU_BUILD_BUG_ON(offsetof(CPUTLBEntry, addr_write) != - MMU_DATA_STORE * sizeof(uint64_t)); + MMU_DATA_STORE * sizeof(uintptr_t)); QEMU_BUILD_BUG_ON(offsetof(CPUTLBEntry, addr_code) != - MMU_INST_FETCH * sizeof(uint64_t)); + MMU_INST_FETCH * sizeof(uintptr_t)); -#if TARGET_LONG_BITS == 32 - /* Use qatomic_read, in case of addr_write; only care about low bits. */ - const uint32_t *ptr = (uint32_t *)&entry->addr_idx[access_type]; - ptr += HOST_BIG_ENDIAN; - return qatomic_read(ptr); -#else - const uint64_t *ptr = &entry->addr_idx[access_type]; + const uintptr_t *ptr = &entry->addr_idx[access_type]; /* ofs might correspond to .addr_write, so use qatomic_read */ return qatomic_read(ptr); -#endif } static inline uint64_t tlb_addr_write(const CPUTLBEntry *entry) @@ -899,14 +892,8 @@ static void tlb_reset_dirty_range_locked(CPUTLBEntry *tlb_entry, addr &= TARGET_PAGE_MASK; addr += tlb_entry->addend; if ((addr - start) < length) { -#if TARGET_LONG_BITS == 32 - uint32_t *ptr_write = (uint32_t *)&tlb_entry->addr_write; - ptr_write += HOST_BIG_ENDIAN; - qatomic_set(ptr_write, *ptr_write | TLB_NOTDIRTY); -#else qatomic_set(&tlb_entry->addr_write, tlb_entry->addr_write | TLB_NOTDIRTY); -#endif } } } diff --git a/tcg/arm/tcg-target.c.inc b/tcg/arm/tcg-target.c.inc index 83f6eb6099..cec3d761d4 100644 --- a/tcg/arm/tcg-target.c.inc +++ b/tcg/arm/tcg-target.c.inc @@ -1500,7 +1500,6 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, * Add the tlb_table pointer, creating the CPUTLBEntry address in R1. * Load the tlb comparator into R2 and the fast path addend into R1. */ - QEMU_BUILD_BUG_ON(HOST_BIG_ENDIAN); if (cmp_off == 0) { tcg_out_ld32_rwb(s, COND_AL, TCG_REG_R2, TCG_REG_R1, TCG_REG_R0); } else { diff --git a/tcg/mips/tcg-target.c.inc b/tcg/mips/tcg-target.c.inc index d744b853cd..14b3cb1eba 100644 --- a/tcg/mips/tcg-target.c.inc +++ b/tcg/mips/tcg-target.c.inc @@ -1262,18 +1262,16 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, /* Add the tlb_table pointer, creating the CPUTLBEntry address. */ tcg_out_opc_reg(s, ALIAS_PADD, TCG_TMP3, TCG_TMP3, TCG_TMP1); - if (TCG_TARGET_REG_BITS == 32 || addr_type == TCG_TYPE_I32) { - /* Load the (low half) tlb comparator. */ + /* Load the tlb comparator. */ + if (TCG_TARGET_REG_BITS == 64 && addr_type == TCG_TYPE_I32) { tcg_out_ld(s, TCG_TYPE_I32, TCG_TMP0, TCG_TMP3, cmp_off + HOST_BIG_ENDIAN * 4); } else { - tcg_out_ld(s, TCG_TYPE_I64, TCG_TMP0, TCG_TMP3, cmp_off); + tcg_out_ld(s, TCG_TYPE_REG, TCG_TMP0, TCG_TMP3, cmp_off); } - if (TCG_TARGET_REG_BITS == 64 || addr_type == TCG_TYPE_I32) { - /* Load the tlb addend for the fast path. */ - tcg_out_ld(s, TCG_TYPE_PTR, TCG_TMP3, TCG_TMP3, add_off); - } + /* Load the tlb addend for the fast path. */ + tcg_out_ld(s, TCG_TYPE_PTR, TCG_TMP3, TCG_TMP3, add_off); /* * Mask the page bits, keeping the alignment bits to compare against. diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc index 2d16807ec7..822925a19b 100644 --- a/tcg/ppc/tcg-target.c.inc +++ b/tcg/ppc/tcg-target.c.inc @@ -2490,27 +2490,16 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, tcg_out32(s, AND | SAB(TCG_REG_TMP1, TCG_REG_TMP1, TCG_REG_R0)); /* - * Load the (low part) TLB comparator into TMP2. + * Load the TLB comparator into TMP2. * For 64-bit host, always load the entire 64-bit slot for simplicity. * We will ignore the high bits with tcg_out_cmp(..., addr_type). */ - if (TCG_TARGET_REG_BITS == 64) { - if (cmp_off == 0) { - tcg_out32(s, LDUX | TAB(TCG_REG_TMP2, - TCG_REG_TMP1, TCG_REG_TMP2)); - } else { - tcg_out32(s, ADD | TAB(TCG_REG_TMP1, - TCG_REG_TMP1, TCG_REG_TMP2)); - tcg_out_ld(s, TCG_TYPE_I64, TCG_REG_TMP2, - TCG_REG_TMP1, cmp_off); - } - } else if (cmp_off == 0 && !HOST_BIG_ENDIAN) { - tcg_out32(s, LWZUX | TAB(TCG_REG_TMP2, - TCG_REG_TMP1, TCG_REG_TMP2)); + if (cmp_off == 0) { + tcg_out32(s, (TCG_TARGET_REG_BITS == 64 ? LDUX : LWZUX) + | TAB(TCG_REG_TMP2, TCG_REG_TMP1, TCG_REG_TMP2)); } else { tcg_out32(s, ADD | TAB(TCG_REG_TMP1, TCG_REG_TMP1, TCG_REG_TMP2)); - tcg_out_ld(s, TCG_TYPE_I32, TCG_REG_TMP2, TCG_REG_TMP1, - cmp_off + 4 * HOST_BIG_ENDIAN); + tcg_out_ld(s, TCG_TYPE_PTR, TCG_REG_TMP2, TCG_REG_TMP1, cmp_off); } /* From patchwork Mon Feb 17 19:29:56 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 865951 Delivered-To: patch@linaro.org Received: by 2002:a5d:64e6:0:b0:38f:210b:807b with SMTP id g6csp1252191wri; Mon, 17 Feb 2025 11:33:12 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVa30GrkaIJiHAy5SfQvQ+lmviOXor/Vc9bzY3NfL6znJeeJDWyQVevmUwH5EW9ro4S3YEtNg==@linaro.org X-Google-Smtp-Source: AGHT+IH3sKAV7Gzv8811vR4mlrv6P79u4iVHya49yrkNSIyXyGBOD17FlZj3McgLh7I/i3BwfxCY X-Received: by 2002:ad4:5fcd:0:b0:6e6:6c7f:110a with SMTP id 6a1803df08f44-6e66cd0b603mr154104976d6.39.1739820792186; Mon, 17 Feb 2025 11:33:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1739820792; cv=none; d=google.com; s=arc-20240605; b=V5kbRGqr40ZCI+uG07w783qwd3D2HG0+X7IU8tbAdzAlTOs9C7GYGbXVG35kz22V6T a6vYbO6XfTYuQMSgk0El2oTTHZDKSq/1YC4adJE8h4MwAVDODNN/cj9WxFwkMRPAumOu RGaPiYAGihC2Y4EHARPc3gtXJeO4107G1VJU2rzbBV2IWQ1bPutdT7JYJuCqHas3+AXF wQq7rI1tb59HKamdWVWh04W7vETqh0rVl1kSzRnfkPUWtNn5D4pbo9RAau3FJGfsq5yx djDql5lPfX9WjyiW1mNZAAGchTHsBKhNopcFM4w6zTO9osQXdAMUu+dlNkXiBAN7Ofow 1amw== 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=JhOCjaCEdODZDzVDXbbcrJWRHEHJ4tXKXvv0DPCf8Os=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=hU3yRmr5AvFvyR0aiQBi6XG6Ms4vO6ss9+VIq49yJvpfU6cqL02NFXAy9reYkkyPIU R0hd+RMg3N6Nz3CYE/NUzxty+XnI41UL5bY0ETCTruVLUiVpjiZ9zhYDOkgD9Lb/2/Ev XbGEYyGm2qRS6+tv5xwHH/1Bj/fjBEPm+uaHQsodUdevDhRY8JNmLdWC5OsxSxbXMct5 iQ55r9UDibwe/OxWLrQT8IrC1i16xYWsUdUZDs+AKDJWgp2cU5tT7Qug2v0kDZbmBNZo AWViKN2oApFkNCQ3MpcFJU8itfyhIXh14LuDvszeYrUfho1hake9oCHfLuKW/RlN76WN lNCA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=r7tggrZZ; 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; 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 6a1803df08f44-6e65d9a1eadsi92141996d6.264.2025.02.17.11.33.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Feb 2025 11:33:12 -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=r7tggrZZ; 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; 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 1tk6pu-0003I9-7Y; Mon, 17 Feb 2025 14:31:22 -0500 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 1tk6p3-0001xo-Am for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:31 -0500 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tk6ox-0008Oe-NG for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:25 -0500 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-220ecbdb4c2so89316335ad.3 for ; Mon, 17 Feb 2025 11:30:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739820622; x=1740425422; 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=JhOCjaCEdODZDzVDXbbcrJWRHEHJ4tXKXvv0DPCf8Os=; b=r7tggrZZmjT5pcOuW6+QymiexZL9YGMzG7ITN+EnAXGi3rqTQWkVZxYG8w2wyvROKP /EucLQt61Nbwxk76FTVDlhAuxgaXZ6m08o06REYLoCAYmtIjN+zQjLS3WmbHBxSoK8dk rHmqXIG70BmqIQxVQSC+pekdp9sd/hn7F9ptE1Zgzjsgvj9TZSmJq7XLXdC9nGAE/m9H p3l0S2gGGOm3IrvspllDVGcLfUbrRngMB6we34iss6O96UcK+hhIeLEOTUnECzm9uINP DKElhwKncYjD7IqH+mHy3Dp4cL4Qx+7fVLf96bi+oP1/lF+kvbPUIh0lOmi6peoKt+EE mAkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739820622; x=1740425422; 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=JhOCjaCEdODZDzVDXbbcrJWRHEHJ4tXKXvv0DPCf8Os=; b=TxO8APtMzUDFsZ0Zu8wZFDBnbgFZG4CNNi+UvZih/wrhh9IP7jMzvQToGgAAF7ELXD NvBttGtV0YH6QHmwb+gk9YZq0G1wKthHqkhSjRYi5gkRyu8uYHK4JLkJpNxvCXBjTWf3 UeJBPSGEmw1Tdxc5bYVEwiVwE4d4PGaLZEHsFXNR6wpNiFRSNBs/yliNqzKQVtpjiHO8 ROPI0ygOvLnq3e6ZxdWL2i4plZ4zB8H6RDWKtmkX0Fk4cvHB+NeG7XsacVh8THSB/eBk Jr0/9tRkV+haxiXbSTtMGQwzNjYZINzsut5X1+vtC2cCPyJPMjYdMzHHZpgPnJtd6sj8 uyog== X-Gm-Message-State: AOJu0YwmvM4MSYnR6GQY3d3hn5z3HfxmUVGlScqQBDWthXJxGQ1etGPU AHwWsjjK8Fqqi6COUgIk8o+3wW73ZEyN2jsRHIbhcUPxxx/0rM3+dPGVnZzuv0Ym9JEY3T/3DhB N X-Gm-Gg: ASbGncsxp6K+nN4MKht6RMUuGqKUoBO8uEwveXj73Up+4GTcQSM++Z0w0x9liU6czGA c8yw3zwKxRlHtw2FLbmsr0bRBKI7yjE/l6//GIWECtyAknqUMfwuSliwqLNz9jNlKyYeSSNwtuY u1mJhJrqbpfKS5BzFHg/qSrec0bA+zcD/xHah2DWtgkgAu9z0UkPxSUEuzehOyVbcO7CDgeH8CI iikzAak6CboyLZDH9YAZFenfoGANsf96c0xVIdNIw/FQ5egHGeLiODU47HoID4KZczqccItISRE gkMz/OCAM1TxzgAZZQP+z7/++5z0c+t5Y/GHPiJG2E2HsrU= X-Received: by 2002:a05:6a20:43a0:b0:1ee:7ac8:8256 with SMTP id adf61e73a8af0-1ee8cb83182mr20269258637.25.1739820622217; Mon, 17 Feb 2025 11:30:22 -0800 (PST) Received: from stoup.. (71-212-39-66.tukw.qwest.net. [71.212.39.66]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7326a38ff76sm4347164b3a.160.2025.02.17.11.30.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2025 11:30:21 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL v2 15/27] tcg: Introduce the 'z' constraint for a hardware zero register Date: Mon, 17 Feb 2025 11:29:56 -0800 Message-ID: <20250217193009.2873875-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250217193009.2873875-1-richard.henderson@linaro.org> References: <20250217193009.2873875-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.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 For loongarch, mips, riscv and sparc, a zero register is available all the time. For aarch64, register index 31 depends on context: sometimes it is the stack pointer, and sometimes it is the zero register. Introduce a new general-purpose constraint which maps 0 to TCG_REG_ZERO, if defined. This differs from existing constant constraints in that const_arg[*] is recorded as false, indicating that the value is in a register. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 3 ++- tcg/aarch64/tcg-target.h | 2 ++ tcg/loongarch64/tcg-target.h | 2 ++ tcg/mips/tcg-target.h | 2 ++ tcg/riscv/tcg-target.h | 2 ++ tcg/sparc64/tcg-target.h | 3 ++- tcg/tcg.c | 29 ++++++++++++++++++++++------- docs/devel/tcg-ops.rst | 4 +++- 8 files changed, 37 insertions(+), 10 deletions(-) diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index 1d1d668f52..84d99508b6 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -713,7 +713,8 @@ void tb_target_set_jmp_target(const TranslationBlock *, int, void tcg_set_frame(TCGContext *s, TCGReg reg, intptr_t start, intptr_t size); -#define TCG_CT_CONST 1 /* any constant of register size */ +#define TCG_CT_CONST 1 /* any constant of register size */ +#define TCG_CT_REG_ZERO 2 /* zero, in TCG_REG_ZERO */ typedef struct TCGArgConstraint { unsigned ct : 16; diff --git a/tcg/aarch64/tcg-target.h b/tcg/aarch64/tcg-target.h index 0dd6e1f069..3f3df5176d 100644 --- a/tcg/aarch64/tcg-target.h +++ b/tcg/aarch64/tcg-target.h @@ -45,6 +45,8 @@ typedef enum { TCG_AREG0 = TCG_REG_X19, } TCGReg; +#define TCG_REG_ZERO TCG_REG_XZR + #define TCG_TARGET_NB_REGS 64 #endif /* AARCH64_TCG_TARGET_H */ diff --git a/tcg/loongarch64/tcg-target.h b/tcg/loongarch64/tcg-target.h index 8533284631..6a206fb97e 100644 --- a/tcg/loongarch64/tcg-target.h +++ b/tcg/loongarch64/tcg-target.h @@ -85,4 +85,6 @@ typedef enum { TCG_VEC_TMP0 = TCG_REG_V23, } TCGReg; +#define TCG_REG_ZERO TCG_REG_ZERO + #endif /* LOONGARCH_TCG_TARGET_H */ diff --git a/tcg/mips/tcg-target.h b/tcg/mips/tcg-target.h index 3090acc4f5..bd4ca5f852 100644 --- a/tcg/mips/tcg-target.h +++ b/tcg/mips/tcg-target.h @@ -70,4 +70,6 @@ typedef enum { TCG_AREG0 = TCG_REG_S8, } TCGReg; +#define TCG_REG_ZERO TCG_REG_ZERO + #endif diff --git a/tcg/riscv/tcg-target.h b/tcg/riscv/tcg-target.h index db5f3d8b72..6dc77d944b 100644 --- a/tcg/riscv/tcg-target.h +++ b/tcg/riscv/tcg-target.h @@ -57,4 +57,6 @@ typedef enum { TCG_REG_TMP2 = TCG_REG_T4, } TCGReg; +#define TCG_REG_ZERO TCG_REG_ZERO + #endif diff --git a/tcg/sparc64/tcg-target.h b/tcg/sparc64/tcg-target.h index f7d75d5806..1b9adccd85 100644 --- a/tcg/sparc64/tcg-target.h +++ b/tcg/sparc64/tcg-target.h @@ -64,6 +64,7 @@ typedef enum { TCG_REG_I7, } TCGReg; -#define TCG_AREG0 TCG_REG_I0 +#define TCG_AREG0 TCG_REG_I0 +#define TCG_REG_ZERO TCG_REG_G0 #endif diff --git a/tcg/tcg.c b/tcg/tcg.c index 55cb9b3ac7..e8950df2ad 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -3223,6 +3223,11 @@ static void process_constraint_sets(void) case 'i': args_ct[i].ct |= TCG_CT_CONST; break; +#ifdef TCG_REG_ZERO + case 'z': + args_ct[i].ct |= TCG_CT_REG_ZERO; + break; +#endif /* Include all of the target-specific constraints. */ @@ -5074,13 +5079,23 @@ static void tcg_reg_alloc_op(TCGContext *s, const TCGOp *op) arg_ct = &args_ct[i]; ts = arg_temp(arg); - if (ts->val_type == TEMP_VAL_CONST - && tcg_target_const_match(ts->val, arg_ct->ct, ts->type, - op_cond, TCGOP_VECE(op))) { - /* constant is OK for instruction */ - const_args[i] = 1; - new_args[i] = ts->val; - continue; + if (ts->val_type == TEMP_VAL_CONST) { +#ifdef TCG_REG_ZERO + if (ts->val == 0 && (arg_ct->ct & TCG_CT_REG_ZERO)) { + /* Hardware zero register: indicate register via non-const. */ + const_args[i] = 0; + new_args[i] = TCG_REG_ZERO; + continue; + } +#endif + + if (tcg_target_const_match(ts->val, arg_ct->ct, ts->type, + op_cond, TCGOP_VECE(op))) { + /* constant is OK for instruction */ + const_args[i] = 1; + new_args[i] = ts->val; + continue; + } } reg = ts->reg; diff --git a/docs/devel/tcg-ops.rst b/docs/devel/tcg-ops.rst index 6608a29376..688984fd39 100644 --- a/docs/devel/tcg-ops.rst +++ b/docs/devel/tcg-ops.rst @@ -927,7 +927,9 @@ operation uses a constant input constraint which does not allow all constants, it must also accept registers in order to have a fallback. The constraint '``i``' is defined generically to accept any constant. The constraint '``r``' is not defined generically, but is consistently -used by each backend to indicate all registers. +used by each backend to indicate all registers. If ``TCG_REG_ZERO`` +is defined by the backend, the constraint '``z``' is defined generically +to map constant 0 to the hardware zero register. The movi_i32 and movi_i64 operations must accept any constants. From patchwork Mon Feb 17 19:29:57 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 865964 Delivered-To: patch@linaro.org Received: by 2002:a5d:64e6:0:b0:38f:210b:807b with SMTP id g6csp1252909wri; Mon, 17 Feb 2025 11:35:20 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCX+6Tb3886kQjXreNBU7+WJ0sFaRRJoe2YW4cRNfHPmmQz4fiXkB26iEommesbFEy2SRhEtow==@linaro.org X-Google-Smtp-Source: AGHT+IGXEgEIFjYiJqsErfL9TsVH5isHyJQFVy7NAPPqhFx7UpKoj5UsMipB6a7hUm+Mc15M7/kk X-Received: by 2002:a05:620a:1790:b0:7b6:c4c7:ecfe with SMTP id af79cd13be357-7c08a98632emr1160401385a.4.1739820919775; Mon, 17 Feb 2025 11:35:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1739820919; cv=none; d=google.com; s=arc-20240605; b=fRCPSwaxOPEGYpfk/AprQNxtUqnDjAdMtpcBjvueptdhkesesBUk7O63ND1uc3+xfN eoWiIJmN+KuoknRqr+vQ7uxKdYC+vplu/hQ54RSk6kVt/QAqX2q8VCwMazcUNblDzgJu ZaO1VHUy2VPqBPv08WdSmxBmF3iJpD8yy/E0fyBMx889pVwJ8Tzf5Lz1ulDYSal0I/96 GnMSwHe13HYFR3GNlMUg3SfBPrFVTalpziv50YMSBh220nsw6H7z2xfjQgESCs4QIJWf ucsc1VJDwohyM1bx/wXt1YKT/XkBle4U+F4XVaJP23lbBoBs4h3qC5ApPZl0CSRh9xkA MWvw== 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:to:from :dkim-signature; bh=8GN03SSPW+BnvgJXCFM6j1oZ9exlKICCoE1kSPFtm0A=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=C8793PFI4xiFRya3XBXPixujeVNR5w1z0sxJILDvdbjgEq2XUaqd1BEcf/Ufu9Ayam P/376N6JlCO4eSVWrbvSihZQ9NQYOCn44Kp/wWvoSYr2OcMoPXJlnHCJfTGLerRYb1SS OTz8L0pVWQqQGoAFXyUskiR8chuaBJr1fqD8cDHyfEO4u9R6xEwvWVesRFZeYWWNBOeI 6Vt5hSCAIK7iUtokLhlGPwwiGZ489upUjSAUrX16ej2cgc6zHoM51qTe6y2EHOEP2EY4 7SPsasE0nhdhqCCiNDod9lsp1dAC7erAiXqAznRlNpZkpiOJgu9YgJX3gJF03B99BUzN WN4g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="hevKij/y"; 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; 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-7c09f908520si241894685a.433.2025.02.17.11.35.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Feb 2025 11:35: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="hevKij/y"; 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; 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 1tk6pj-0002bG-18; Mon, 17 Feb 2025 14:31:11 -0500 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 1tk6p6-0001yS-IA for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:34 -0500 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tk6p2-0008PV-6V for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:31 -0500 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-22101839807so53312415ad.3 for ; Mon, 17 Feb 2025 11:30:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739820623; x=1740425423; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=8GN03SSPW+BnvgJXCFM6j1oZ9exlKICCoE1kSPFtm0A=; b=hevKij/yi+eZiOc+85OWZQcpra63JW1bLW4f491Rg1uRjfNa71/EV/D2OqgmvfkHyN d2jt48LrDcl0eNTXifbALe4Hb5C749Qhcz9PX9KxudpBrVgI0mWcFemq678+cRGq22aT xJqN3mZhTlGr9HA9XueANzAN2EqKZ/gz1s0dWCa5gDIO7rV0GnakPhltqaEh50kSQDO/ mZ2+sHUZeFx+tTZzi30lM1wWBUw3gqmjEbZnISdFtDV/cppmfx86xw3Rxtq/JctoTTgt Q/G1m3nn1dXcQjLll39f8LiNJDbbo/0TICSwdvcHm2Dkn3rLm6gvHONj4XbQbwWrs5XU rYbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739820623; x=1740425423; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8GN03SSPW+BnvgJXCFM6j1oZ9exlKICCoE1kSPFtm0A=; b=QbH1htkcf5e8pVvwB23I11gQ6QX0xv8DQ1RVsv1KFlobU47sE+6VisdrnL8UeLPPfN WYA9dJVV5Emt/0xoeooNeXHNn2ML9Xcu6cP8Ne6pH2oT85sTohXA7+ooK9M52L1CIjfu kknETI0zlAucGdHrsPaqdvx5w6e7codUik4KtuB4MNHLHaG+xlC0qAocPcTQthxVI8Eo o73BBM9e0nUFPfb7VziG7g/G143Ws1elE2ff4WLMdxhciuPLGqiDI0AXH3MFLOVUXzlZ aXxBFBalfpM8S7hOVNc2d+X9JqMDzAkP3OuH3Y+N1RW0Ij6WQV2iR1jKD7oy9WmXnJ6v cDsQ== X-Gm-Message-State: AOJu0YzyBkR2b0p6DMw44fM7CJkMlMwumCc7sqPwmboS85XPC9EiWn42 Ce4GDOLT2AA1U3EUt7bzdNiJdXvdsqqKaIDtWnaHosZ7K3ISY9ZxLMu4vWmRi5SO/e3CPhgLcEB m X-Gm-Gg: ASbGncvnkm2R3XHuQFuJDo7e5HMzLDdrRBLRia0Jvm3BIB7sUvK3P3PoT+9+VRDWsG8 SHKtv2zJ3GrGXBo99VwONn+OjGiRR/gW2rHNKD493H4OW6HbhM2+RrWQL0714ALLEJWZfEAOsWa YSCnBMAC9ynwjzEsQDRTHYQMOeXjvYXMXZ0lPfLk4Hn2TlSCFTc4UU6z856mY6Nlb/3XAyAKH6e TYOVSTqbCM/OPiruTA9Jv182a27Op99sOOLmcAEvqDlOGDq1DCUrVrq58rPF6/mYESEa3Cm+hLh 1xiFbNsw0Rr/zkzL9lJAvM8wJEADPplsr/wbues2Yzgxc1A= X-Received: by 2002:a05:6a21:33a9:b0:1ee:7c01:d16 with SMTP id adf61e73a8af0-1ee8cbbccf0mr22016113637.30.1739820623421; Mon, 17 Feb 2025 11:30:23 -0800 (PST) Received: from stoup.. (71-212-39-66.tukw.qwest.net. [71.212.39.66]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7326a38ff76sm4347164b3a.160.2025.02.17.11.30.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2025 11:30:23 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL v2 16/27] tcg/aarch64: Use 'z' constraint Date: Mon, 17 Feb 2025 11:29:57 -0800 Message-ID: <20250217193009.2873875-17-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250217193009.2873875-1-richard.henderson@linaro.org> References: <20250217193009.2873875-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=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 Note that 'Z' is still used for addsub2. Signed-off-by: Richard Henderson --- tcg/aarch64/tcg-target-con-set.h | 12 ++++----- tcg/aarch64/tcg-target.c.inc | 46 ++++++++++++++------------------ 2 files changed, 26 insertions(+), 32 deletions(-) diff --git a/tcg/aarch64/tcg-target-con-set.h b/tcg/aarch64/tcg-target-con-set.h index 44fcc1206e..1281e5efc0 100644 --- a/tcg/aarch64/tcg-target-con-set.h +++ b/tcg/aarch64/tcg-target-con-set.h @@ -11,27 +11,27 @@ */ C_O0_I1(r) C_O0_I2(r, rC) -C_O0_I2(rZ, r) +C_O0_I2(rz, r) C_O0_I2(w, r) -C_O0_I3(rZ, rZ, r) +C_O0_I3(rz, rz, r) C_O1_I1(r, r) C_O1_I1(w, r) C_O1_I1(w, w) C_O1_I1(w, wr) -C_O1_I2(r, 0, rZ) +C_O1_I2(r, 0, rz) C_O1_I2(r, r, r) C_O1_I2(r, r, rA) C_O1_I2(r, r, rAL) C_O1_I2(r, r, rC) C_O1_I2(r, r, ri) C_O1_I2(r, r, rL) -C_O1_I2(r, rZ, rZ) +C_O1_I2(r, rz, rz) C_O1_I2(w, 0, w) C_O1_I2(w, w, w) C_O1_I2(w, w, wN) C_O1_I2(w, w, wO) C_O1_I2(w, w, wZ) C_O1_I3(w, w, w, w) -C_O1_I4(r, r, rC, rZ, rZ) +C_O1_I4(r, r, rC, rz, rz) C_O2_I1(r, r, r) -C_O2_I4(r, r, rZ, rZ, rA, rMZ) +C_O2_I4(r, r, rz, rz, rA, rMZ) diff --git a/tcg/aarch64/tcg-target.c.inc b/tcg/aarch64/tcg-target.c.inc index 6f383c1592..4645242d85 100644 --- a/tcg/aarch64/tcg-target.c.inc +++ b/tcg/aarch64/tcg-target.c.inc @@ -2125,10 +2125,6 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType ext, TCGArg a2 = args[2]; int c2 = const_args[2]; - /* Some operands are defined with "rZ" constraint, a register or - the zero register. These need not actually test args[I] == 0. */ -#define REG0(I) (const_args[I] ? TCG_REG_XZR : (TCGReg)args[I]) - switch (opc) { case INDEX_op_goto_ptr: tcg_out_insn(s, 3207, BR, a0); @@ -2171,18 +2167,18 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType ext, case INDEX_op_st8_i32: case INDEX_op_st8_i64: - tcg_out_ldst(s, I3312_STRB, REG0(0), a1, a2, 0); + tcg_out_ldst(s, I3312_STRB, a0, a1, a2, 0); break; case INDEX_op_st16_i32: case INDEX_op_st16_i64: - tcg_out_ldst(s, I3312_STRH, REG0(0), a1, a2, 1); + tcg_out_ldst(s, I3312_STRH, a0, a1, a2, 1); break; case INDEX_op_st_i32: case INDEX_op_st32_i64: - tcg_out_ldst(s, I3312_STRW, REG0(0), a1, a2, 2); + tcg_out_ldst(s, I3312_STRW, a0, a1, a2, 2); break; case INDEX_op_st_i64: - tcg_out_ldst(s, I3312_STRX, REG0(0), a1, a2, 3); + tcg_out_ldst(s, I3312_STRX, a0, a1, a2, 3); break; case INDEX_op_add_i32: @@ -2395,7 +2391,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType ext, /* FALLTHRU */ case INDEX_op_movcond_i64: tcg_out_cmp(s, ext, args[5], a1, a2, c2); - tcg_out_insn(s, 3506, CSEL, ext, a0, REG0(3), REG0(4), args[5]); + tcg_out_insn(s, 3506, CSEL, ext, a0, args[3], args[4], args[5]); break; case INDEX_op_qemu_ld_i32: @@ -2404,13 +2400,13 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType ext, break; case INDEX_op_qemu_st_i32: case INDEX_op_qemu_st_i64: - tcg_out_qemu_st(s, REG0(0), a1, a2, ext); + tcg_out_qemu_st(s, a0, a1, a2, ext); break; case INDEX_op_qemu_ld_i128: tcg_out_qemu_ldst_i128(s, a0, a1, a2, args[3], true); break; case INDEX_op_qemu_st_i128: - tcg_out_qemu_ldst_i128(s, REG0(0), REG0(1), a2, args[3], false); + tcg_out_qemu_ldst_i128(s, a0, a1, a2, args[3], false); break; case INDEX_op_bswap64_i64: @@ -2439,7 +2435,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType ext, case INDEX_op_deposit_i64: case INDEX_op_deposit_i32: - tcg_out_dep(s, ext, a0, REG0(2), args[3], args[4]); + tcg_out_dep(s, ext, a0, a2, args[3], args[4]); break; case INDEX_op_extract_i64: @@ -2459,25 +2455,25 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType ext, case INDEX_op_extract2_i64: case INDEX_op_extract2_i32: - tcg_out_extr(s, ext, a0, REG0(2), REG0(1), args[3]); + tcg_out_extr(s, ext, a0, a2, a1, args[3]); break; case INDEX_op_add2_i32: - tcg_out_addsub2(s, TCG_TYPE_I32, a0, a1, REG0(2), REG0(3), + tcg_out_addsub2(s, TCG_TYPE_I32, a0, a1, a2, args[3], (int32_t)args[4], args[5], const_args[4], const_args[5], false); break; case INDEX_op_add2_i64: - tcg_out_addsub2(s, TCG_TYPE_I64, a0, a1, REG0(2), REG0(3), args[4], + tcg_out_addsub2(s, TCG_TYPE_I64, a0, a1, a2, args[3], args[4], args[5], const_args[4], const_args[5], false); break; case INDEX_op_sub2_i32: - tcg_out_addsub2(s, TCG_TYPE_I32, a0, a1, REG0(2), REG0(3), + tcg_out_addsub2(s, TCG_TYPE_I32, a0, a1, a2, args[3], (int32_t)args[4], args[5], const_args[4], const_args[5], true); break; case INDEX_op_sub2_i64: - tcg_out_addsub2(s, TCG_TYPE_I64, a0, a1, REG0(2), REG0(3), args[4], + tcg_out_addsub2(s, TCG_TYPE_I64, a0, a1, a2, args[3], args[4], args[5], const_args[4], const_args[5], true); break; @@ -2513,8 +2509,6 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType ext, default: g_assert_not_reached(); } - -#undef REG0 } static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, @@ -3010,7 +3004,7 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) case INDEX_op_st16_i64: case INDEX_op_st32_i64: case INDEX_op_st_i64: - return C_O0_I2(rZ, r); + return C_O0_I2(rz, r); case INDEX_op_add_i32: case INDEX_op_add_i64: @@ -3076,7 +3070,7 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) case INDEX_op_movcond_i32: case INDEX_op_movcond_i64: - return C_O1_I4(r, r, rC, rZ, rZ); + return C_O1_I4(r, r, rC, rz, rz); case INDEX_op_qemu_ld_i32: case INDEX_op_qemu_ld_i64: @@ -3085,23 +3079,23 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) return C_O2_I1(r, r, r); case INDEX_op_qemu_st_i32: case INDEX_op_qemu_st_i64: - return C_O0_I2(rZ, r); + return C_O0_I2(rz, r); case INDEX_op_qemu_st_i128: - return C_O0_I3(rZ, rZ, r); + return C_O0_I3(rz, rz, r); case INDEX_op_deposit_i32: case INDEX_op_deposit_i64: - return C_O1_I2(r, 0, rZ); + return C_O1_I2(r, 0, rz); case INDEX_op_extract2_i32: case INDEX_op_extract2_i64: - return C_O1_I2(r, rZ, rZ); + return C_O1_I2(r, rz, rz); 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, rZ, rZ, rA, rMZ); + return C_O2_I4(r, r, rz, rz, rA, rMZ); case INDEX_op_add_vec: case INDEX_op_sub_vec: From patchwork Mon Feb 17 19:29:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 865946 Delivered-To: patch@linaro.org Received: by 2002:a5d:64e6:0:b0:38f:210b:807b with SMTP id g6csp1251962wri; Mon, 17 Feb 2025 11:32:28 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXW/JRPKVEMbKRwrav60CjDvJlT7UfZ8d1sipkOG7d8cfTmthvkvxusVvqmeviuDdFeP3YNAg==@linaro.org X-Google-Smtp-Source: AGHT+IG/WRyourhZmmnruDV6WzOXUrb2OtRi00KW2zEyUdyFMoEmjaQZt6hihDS06TTMYI5aXzdc X-Received: by 2002:a05:620a:a014:b0:7c0:9b92:1342 with SMTP id af79cd13be357-7c09b921f99mr627775585a.55.1739820748000; Mon, 17 Feb 2025 11:32:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1739820747; cv=none; d=google.com; s=arc-20240605; b=NOMgzIYx2D43uW2hI6topTG/kzVhhPG6sqv3uAUkgGftM0AXO7t8/a05lZ4tIaZuTL 4s08VyeW6bFOR5tSAB8e8lYMhTh4wwyAw2AakBvCprJlPIvTsQsa2SZQpEw4panNA42I baiMOtdUMhG5hH0Mms1X3D/ONfJ+nmkcOUTYYqH/cB0o53wXxhadd1GbDB1cgvUpX7g5 2BXVMfng6wYWCbZFVR+9UkNogOvIIUHcG4j593qrUwatnR/8mdyvCZhvkDbo9ndSqCzR +vOB5eWylO0rW3/Qo3fZB54QCvDxxRiFGk44GIrMnL5FAP4HhrmkOhWcqnCIKEm1klS+ 5iLA== 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=c+QFcPwjE+/PZmsE+ZNS1uNg3roQJkJdP7G2ngjxuz4=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=YmJ7bGl34QcC0vtvfyCRrxOalRakOeqoBN2g5dYfQcE5HAcEQc2vpe7xMxYpHJUGrP EUYaG8Bde7VGdKNfjYm11DU0GrAb9RKUFTQzQSrtpNcWFhxQfmvUVR7RhI9aUB98yxdN qbSTI3fndyVGTDuzV5GRKiKI6NHiof8HpjTHkYgJkL0XvwuOhq+FgmkmZ1Ly1DfSxl/g lsnS2FvFpkWxN+m/7KAF1NObGTcn1cCpUXYhhFtLA0KpBLlHdvm4W9yefQQ6ycdiJgaA pdD7CGQ2QbqplVOTpzDznU7JQ9SDPZ+DI2bi0GOULoFxkP+xvzhbfhMUHBMLjbM5vkQZ oJ4g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VjIM+hPe; 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; 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-7c09be3124csi277830485a.237.2025.02.17.11.32.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Feb 2025 11: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=VjIM+hPe; 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; 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 1tk6pb-0002Dz-1e; Mon, 17 Feb 2025 14:31:03 -0500 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 1tk6p8-0001yg-7u for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:38 -0500 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tk6p3-0008Pp-3Q for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:32 -0500 Received: by mail-pj1-x1035.google.com with SMTP id 98e67ed59e1d1-2fc0026eb79so8738611a91.0 for ; Mon, 17 Feb 2025 11:30:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739820624; x=1740425424; 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=c+QFcPwjE+/PZmsE+ZNS1uNg3roQJkJdP7G2ngjxuz4=; b=VjIM+hPecrbHQCwfEdxmOZ2/Wu8YMN7MaVK5SmZTpLsQ3bVHtI96FzO6Iw5dk3Lj4Y P4wCVdXIYQktFdVIQkhNvtVorgbGLWfuqxR9jP6Imjn9rMjOzgmeONsJsgen+j29ry0I WKHhgJY0zoLmYd9LGdnwXP/SDuCuYGPLCSpm8RdeKzjg3sLQtccIFe5ig6TLDob9spiy /OyevxUqJbUct/BwHUMSLkUKYYxpG/E/c0UIVLT8f0ZIv4NZyvlXpeG9B4raW+9ZgTMH mlb+td8osOfAZSZ3DzRP40Ut7r5ctnulClNpGKzwKJS/XfBIx2yOACHlbwSoxi+b+8lN Ky6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739820624; x=1740425424; 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=c+QFcPwjE+/PZmsE+ZNS1uNg3roQJkJdP7G2ngjxuz4=; b=WC5SDQl6DIh9knSkxw2QepVLfinaEa4GaGO5IVoG5PA9y4TISWfZJij1obI77J3Eq0 3n5ujHQPq0EUCZ2/qyJflN6uv9F09jFQfKqymB2Aq66HREbIZ70eG9A2zcU8MooVecmz Fr1/irc8BZZTdFXMX1NkDq9GGfjwzC172juOJ9ZMQQpnnEtZ4iJoIniWjZdkSD6lRPL9 pMpxy1S6unN9bqIF2pBFSCuBXoff3ylnf0blRJ5hfgYmYpqtVIaDkYtE2byErmuLiGZF MKMbuLM2iiELvctOofEcXNvRI0BX6MDTa2TfDYXFTDUd0ZWkL1pzaeTBqgj7CQCq9E6b LK0Q== X-Gm-Message-State: AOJu0Yx76nyAFqPZ/dZKh064IM477mqHX6skynSdh1foUOuwvlkTfTXZ NYtrSXezxe0Rg9Dp3gBXmaAFYca1p0jt25rVr4a0F5VuEkrVWcJmxuDmaEuz99hwcu+eItBda4N F X-Gm-Gg: ASbGncsTsur45dIv2RLQe+MPiTqav8skz9X8GNIpCQMLOm5MpiRlzto4IbJdYZV5FyD ko03tNtX9dC7jENCHMMO7EOz6nShClIGqCPKtH51b0a7x2gcrfsAJzH26qQWf8AhTSTG6LtadUX OF6JZ/pu6Ac2yMyeniDYl2qfFaPKCehK3Dets9UHWTxgHhLRNZ3rkmokMwiROYKOty5apj4CIJX QaDTyx9iJ9QhWT0JE/bikpHMTzNxeIIxvCG2pJbs1LL6gdTYL/a25u/84wG0z+229JPDPZKTc6i LeTjLOxH2yNQpcLR7Iovf8gzO3Ye79OuGOpfBTLuHbn+eZk= X-Received: by 2002:a05:6a00:3c84:b0:730:9a85:c940 with SMTP id d2e1a72fcca58-732618fa927mr17586255b3a.20.1739820624659; Mon, 17 Feb 2025 11:30:24 -0800 (PST) Received: from stoup.. (71-212-39-66.tukw.qwest.net. [71.212.39.66]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7326a38ff76sm4347164b3a.160.2025.02.17.11.30.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2025 11:30:24 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL v2 17/27] tcg/loongarch64: Use 'z' constraint Date: Mon, 17 Feb 2025 11:29:58 -0800 Message-ID: <20250217193009.2873875-18-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250217193009.2873875-1-richard.henderson@linaro.org> References: <20250217193009.2873875-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1035; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1035.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.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 Replace target-specific 'Z' with generic 'z'. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target-con-set.h | 15 ++++++------- tcg/loongarch64/tcg-target-con-str.h | 1 - tcg/loongarch64/tcg-target.c.inc | 32 ++++++++++++---------------- 3 files changed, 21 insertions(+), 27 deletions(-) diff --git a/tcg/loongarch64/tcg-target-con-set.h b/tcg/loongarch64/tcg-target-con-set.h index cae6c2aad6..8afaee9476 100644 --- a/tcg/loongarch64/tcg-target-con-set.h +++ b/tcg/loongarch64/tcg-target-con-set.h @@ -15,8 +15,8 @@ * tcg-target-con-str.h; the constraint combination is inclusive or. */ C_O0_I1(r) -C_O0_I2(rZ, r) -C_O0_I2(rZ, rZ) +C_O0_I2(rz, r) +C_O0_I2(rz, rz) C_O0_I2(w, r) C_O0_I3(r, r, r) C_O1_I1(r, r) @@ -28,14 +28,13 @@ C_O1_I2(r, r, rI) C_O1_I2(r, r, rJ) C_O1_I2(r, r, rU) C_O1_I2(r, r, rW) -C_O1_I2(r, r, rZ) -C_O1_I2(r, 0, rZ) -C_O1_I2(r, rZ, ri) -C_O1_I2(r, rZ, rJ) -C_O1_I2(r, rZ, rZ) +C_O1_I2(r, 0, rz) +C_O1_I2(r, rz, ri) +C_O1_I2(r, rz, rJ) +C_O1_I2(r, rz, rz) C_O1_I2(w, w, w) C_O1_I2(w, w, wM) C_O1_I2(w, w, wA) C_O1_I3(w, w, w, w) -C_O1_I4(r, rZ, rJ, rZ, rZ) +C_O1_I4(r, rz, rJ, rz, rz) C_N2_I1(r, r, r) diff --git a/tcg/loongarch64/tcg-target-con-str.h b/tcg/loongarch64/tcg-target-con-str.h index 2ba9c135ac..99759120b4 100644 --- a/tcg/loongarch64/tcg-target-con-str.h +++ b/tcg/loongarch64/tcg-target-con-str.h @@ -23,7 +23,6 @@ REGS('w', ALL_VECTOR_REGS) CONST('I', TCG_CT_CONST_S12) CONST('J', TCG_CT_CONST_S32) CONST('U', TCG_CT_CONST_U12) -CONST('Z', TCG_CT_CONST_ZERO) CONST('C', TCG_CT_CONST_C12) CONST('W', TCG_CT_CONST_WSZ) CONST('M', TCG_CT_CONST_VCMP) diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc index dd67e8f6bc..cbd7642b58 100644 --- a/tcg/loongarch64/tcg-target.c.inc +++ b/tcg/loongarch64/tcg-target.c.inc @@ -173,14 +173,13 @@ static TCGReg tcg_target_call_oarg_reg(TCGCallReturnKind kind, int slot) #define TCG_GUEST_BASE_REG TCG_REG_S1 -#define TCG_CT_CONST_ZERO 0x100 -#define TCG_CT_CONST_S12 0x200 -#define TCG_CT_CONST_S32 0x400 -#define TCG_CT_CONST_U12 0x800 -#define TCG_CT_CONST_C12 0x1000 -#define TCG_CT_CONST_WSZ 0x2000 -#define TCG_CT_CONST_VCMP 0x4000 -#define TCG_CT_CONST_VADD 0x8000 +#define TCG_CT_CONST_S12 0x100 +#define TCG_CT_CONST_S32 0x200 +#define TCG_CT_CONST_U12 0x400 +#define TCG_CT_CONST_C12 0x800 +#define TCG_CT_CONST_WSZ 0x1000 +#define TCG_CT_CONST_VCMP 0x2000 +#define TCG_CT_CONST_VADD 0x4000 #define ALL_GENERAL_REGS MAKE_64BIT_MASK(0, 32) #define ALL_VECTOR_REGS MAKE_64BIT_MASK(32, 32) @@ -197,9 +196,6 @@ static bool tcg_target_const_match(int64_t val, int ct, if (ct & TCG_CT_CONST) { return true; } - if ((ct & TCG_CT_CONST_ZERO) && val == 0) { - return true; - } if ((ct & TCG_CT_CONST_S12) && val == sextreg(val, 0, 12)) { return true; } @@ -2229,7 +2225,7 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) case INDEX_op_st_i64: case INDEX_op_qemu_st_i32: case INDEX_op_qemu_st_i64: - return C_O0_I2(rZ, r); + return C_O0_I2(rz, r); case INDEX_op_qemu_ld_i128: return C_N2_I1(r, r, r); @@ -2239,7 +2235,7 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) case INDEX_op_brcond_i32: case INDEX_op_brcond_i64: - return C_O0_I2(rZ, rZ); + return C_O0_I2(rz, rz); case INDEX_op_ext8s_i32: case INDEX_op_ext8s_i64: @@ -2332,14 +2328,14 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) case INDEX_op_deposit_i32: case INDEX_op_deposit_i64: /* Must deposit into the same register as input */ - return C_O1_I2(r, 0, rZ); + return C_O1_I2(r, 0, rz); case INDEX_op_sub_i32: case INDEX_op_setcond_i32: - return C_O1_I2(r, rZ, ri); + return C_O1_I2(r, rz, ri); case INDEX_op_sub_i64: case INDEX_op_setcond_i64: - return C_O1_I2(r, rZ, rJ); + return C_O1_I2(r, rz, rJ); case INDEX_op_mul_i32: case INDEX_op_mul_i64: @@ -2355,11 +2351,11 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) case INDEX_op_rem_i64: case INDEX_op_remu_i32: case INDEX_op_remu_i64: - return C_O1_I2(r, rZ, rZ); + return C_O1_I2(r, rz, rz); case INDEX_op_movcond_i32: case INDEX_op_movcond_i64: - return C_O1_I4(r, rZ, rJ, rZ, rZ); + return C_O1_I4(r, rz, rJ, rz, rz); case INDEX_op_ld_vec: case INDEX_op_dupm_vec: From patchwork Mon Feb 17 19:29:59 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 865954 Delivered-To: patch@linaro.org Received: by 2002:a5d:64e6:0:b0:38f:210b:807b with SMTP id g6csp1252341wri; Mon, 17 Feb 2025 11:33:43 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU30tmJ5uv++dYqxQjfo3eBzm2KqyDKhluM99gGw7SNhoVr7WYBfQg62X++u2Evnw1TUBdo4w==@linaro.org X-Google-Smtp-Source: AGHT+IHtk7bAK1d/v63nB23YXiFqhVKu0YX1IV/Q+tBJkQ7p6FIA1keehSOo6ktTuZhnZuFFjVGu X-Received: by 2002:ac8:7c4c:0:b0:471:bdbd:2f05 with SMTP id d75a77b69052e-471c022534cmr274740041cf.25.1739820823022; Mon, 17 Feb 2025 11:33:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1739820823; cv=none; d=google.com; s=arc-20240605; b=XWJxznkwJpgSkJmoRB55fmqHF1ph7zqf3aik+7/JQJS87u9587S9tkEo7XNA6ukoLT PJkuAELKqa07e7QxyF8lTZFs0i3qzNQlufimTj0pUURRl87vNM9BADQpEMD0KiI+QWDV 2gHFW8HO8DAJz4faiBj71nRXr7fypeO7ia5tFoMORQNvdDyd1FKsHt+mu9MclxbW3qBl qj8FQgsX7aN6JJUb6TQmYEwjCgRtS++mJWEr6GHrpeUIQpH/FG9lA3qtb2wImbX6We4h MbxkKMIQgimtI9CZ0zEVjKFJsC6UtvKgPIAMw853uObFO5EtfGqCMwgU4q/0KG5hkAae LrRw== 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=zjENz02CQDbkRalonzQouff56ChSpitsxbPWI9dSHgw=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=PM4lNa3PXOWs0TEhhghPGQznwzwACA9l8W1p0VhqopcnzRAPKGjge2q9NiyOo89DRg Z6z1mwRWoNRDxTgn9qhIWQbKBGaUgk3esFr/6VLIPZ544cy974bWm8SEpGFeQMuNP9GI cr4ntuc75tMfZ6XJ45OwHV5zHlz6r0yn6PGcci69dCMmHmQLYhgzg1ROpw+gm9rPyXba UDayxDOtvZtSdv45WoGEaaBnriJo099nUP5u+iihTNkZrhs/j5t4r/0edpw/CRqTJ7L0 ovlN0qPXyKOmMmPdhKfTAEoMIrWRX8b3u+0iVG3j2xbBnhRilRXkypTvbv4hJFBznaO6 okEQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OQ1a7Q6V; 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; 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 d75a77b69052e-471f0639c93si26994941cf.88.2025.02.17.11.33.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Feb 2025 11:33: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=OQ1a7Q6V; 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; 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 1tk6pn-0002s0-0J; Mon, 17 Feb 2025 14:31:15 -0500 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 1tk6p8-0001yi-8S for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:37 -0500 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tk6p3-0008Pw-Q4 for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:33 -0500 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-21f61b01630so88174135ad.1 for ; Mon, 17 Feb 2025 11:30:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739820625; x=1740425425; 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=zjENz02CQDbkRalonzQouff56ChSpitsxbPWI9dSHgw=; b=OQ1a7Q6V1Lympu55ysWJG1Ycx5JKZ16BaQyQiuRPjjuasA4ZRJQmydnwLWvZliPamA iaCAs/s1e6CMG0URG4Yxhmq/AiNGA0XGsIlj5Bi43jzw+0tMFBk8R35YcguSkZc19zOq zLLw0SvbS5X/gQJQ7B/GQR9sentgPN743jy+/I1u97idk55wEYDD9dkMw2XUP2zdT561 hVxwqzdyJqv0aLfpTIZLrl0ZLqhKnz7kIblr/4qWGCDnWiwkXDaDXJaIz/VWDRzx6XEm Y/Rrs1DRPfNM86LnOD05T7y2j5iqwGp3i5pN0eZo5nAwg8eXSodFbwrJJaTcP3ws8rSr j53A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739820625; x=1740425425; 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=zjENz02CQDbkRalonzQouff56ChSpitsxbPWI9dSHgw=; b=Y8257M0kb2Ynlr3ksSKkLYeWqvQtn72bLNn0W6CCk97F4/CKZHErWNVUM2Rl4J+Ciz 2xOF4C+RjZedlOJQ7EAaQo5D3rP7dTvaD41lX+meHmDJi2v3+N14a/bEnQ6Fn8qpd0PF FcMZXsbHS0cJy2rE4i3XzF7LEiIyDODs7r+ZwXgkKY3af7XYFBuPiPhVbLQIvP7akWZI 1B/uJokdQ04B1FvaLKp6d0lFyTJGs0mjrsj1WDvRpXy3BMTaAB0+OhE8DL8RHPothZ+S 5ltPPCrjWrYV4SbR1A8CDV0gROyAf3lLFqjKQibFg8GV9dLnqqvRn+6MAB49apxUWqZG LXCw== X-Gm-Message-State: AOJu0YwD4cbDgsEc/KJXr8hWbHXlvJGerD1hjL4xdh16s6aarsonuukO 52DxAV4i/RAWOmHkM9QtW0d8Lo/sU+Qdjgv/bdA2YwyypYLFPvNJU5su0VZf8S3qkGi+Nz89h5P A X-Gm-Gg: ASbGncuJY7jnl2YFpAMF2hjhzRO9hsHbbUYLQ7uV/JMjTRgvy3XSEmUG95+Tviyk46z 1ggSY/IiYlKZH+ZWPyxKrD+BVZwm288VNntCXOOLVu+llSirQjEu1BOsMdJ1qFzU9Zzf57QHAK4 NZk8T39jkvNY5YprtGVuTWQFsPk1sgd1vVaPv1Fvz1XsaoGdiEQoMxwcyf4FQERg+gFAG+0Ms2s vdIsKMgEM/JN/TTCPKer6R0awQaDayQB0pDNToBUlLquQFa0vKn0XqbO1L5t2ElIuzbuoYs0wN+ rJcbHTXAFEMdBfNOQFzUJpivJaazZuQKV/oapA8Zu1oFHlg= X-Received: by 2002:a05:6a20:2584:b0:1e1:a449:ff71 with SMTP id adf61e73a8af0-1ee8d67ef96mr16738432637.1.1739820625376; Mon, 17 Feb 2025 11:30:25 -0800 (PST) Received: from stoup.. (71-212-39-66.tukw.qwest.net. [71.212.39.66]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7326a38ff76sm4347164b3a.160.2025.02.17.11.30.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2025 11:30:25 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL v2 18/27] tcg/mips: Use 'z' constraint Date: Mon, 17 Feb 2025 11:29:59 -0800 Message-ID: <20250217193009.2873875-19-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250217193009.2873875-1-richard.henderson@linaro.org> References: <20250217193009.2873875-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.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 Replace target-specific 'Z' with generic 'z'. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/mips/tcg-target-con-set.h | 26 ++++++++++----------- tcg/mips/tcg-target-con-str.h | 1 - tcg/mips/tcg-target.c.inc | 44 ++++++++++++++--------------------- 3 files changed, 31 insertions(+), 40 deletions(-) diff --git a/tcg/mips/tcg-target-con-set.h b/tcg/mips/tcg-target-con-set.h index 864034f468..06ab04cc4d 100644 --- a/tcg/mips/tcg-target-con-set.h +++ b/tcg/mips/tcg-target-con-set.h @@ -10,24 +10,24 @@ * tcg-target-con-str.h; the constraint combination is inclusive or. */ C_O0_I1(r) -C_O0_I2(rZ, r) -C_O0_I2(rZ, rZ) -C_O0_I3(rZ, r, r) -C_O0_I3(rZ, rZ, r) -C_O0_I4(rZ, rZ, rZ, rZ) -C_O0_I4(rZ, rZ, r, r) +C_O0_I2(rz, r) +C_O0_I2(rz, rz) +C_O0_I3(rz, r, r) +C_O0_I3(rz, rz, r) +C_O0_I4(rz, rz, rz, rz) +C_O0_I4(rz, rz, r, r) C_O1_I1(r, r) -C_O1_I2(r, 0, rZ) +C_O1_I2(r, 0, rz) C_O1_I2(r, r, r) C_O1_I2(r, r, ri) C_O1_I2(r, r, rI) C_O1_I2(r, r, rIK) C_O1_I2(r, r, rJ) -C_O1_I2(r, r, rWZ) -C_O1_I2(r, rZ, rN) -C_O1_I2(r, rZ, rZ) -C_O1_I4(r, rZ, rZ, rZ, 0) -C_O1_I4(r, rZ, rZ, rZ, rZ) +C_O1_I2(r, r, rzW) +C_O1_I2(r, rz, rN) +C_O1_I2(r, rz, rz) +C_O1_I4(r, rz, rz, rz, 0) +C_O1_I4(r, rz, rz, rz, rz) C_O2_I1(r, r, r) C_O2_I2(r, r, r, r) -C_O2_I4(r, r, rZ, rZ, rN, rN) +C_O2_I4(r, r, rz, rz, rN, rN) diff --git a/tcg/mips/tcg-target-con-str.h b/tcg/mips/tcg-target-con-str.h index 413c280a7a..dfe2b156df 100644 --- a/tcg/mips/tcg-target-con-str.h +++ b/tcg/mips/tcg-target-con-str.h @@ -19,4 +19,3 @@ CONST('J', TCG_CT_CONST_S16) CONST('K', TCG_CT_CONST_P2M1) CONST('N', TCG_CT_CONST_N16) CONST('W', TCG_CT_CONST_WSZ) -CONST('Z', TCG_CT_CONST_ZERO) diff --git a/tcg/mips/tcg-target.c.inc b/tcg/mips/tcg-target.c.inc index 14b3cb1eba..f8c105ba37 100644 --- a/tcg/mips/tcg-target.c.inc +++ b/tcg/mips/tcg-target.c.inc @@ -184,12 +184,11 @@ static bool patch_reloc(tcg_insn_unit *code_ptr, int type, g_assert_not_reached(); } -#define TCG_CT_CONST_ZERO 0x100 -#define TCG_CT_CONST_U16 0x200 /* Unsigned 16-bit: 0 - 0xffff. */ -#define TCG_CT_CONST_S16 0x400 /* Signed 16-bit: -32768 - 32767 */ -#define TCG_CT_CONST_P2M1 0x800 /* Power of 2 minus 1. */ -#define TCG_CT_CONST_N16 0x1000 /* "Negatable" 16-bit: -32767 - 32767 */ -#define TCG_CT_CONST_WSZ 0x2000 /* word size */ +#define TCG_CT_CONST_U16 0x100 /* Unsigned 16-bit: 0 - 0xffff. */ +#define TCG_CT_CONST_S16 0x200 /* Signed 16-bit: -32768 - 32767 */ +#define TCG_CT_CONST_P2M1 0x400 /* Power of 2 minus 1. */ +#define TCG_CT_CONST_N16 0x800 /* "Negatable" 16-bit: -32767 - 32767 */ +#define TCG_CT_CONST_WSZ 0x1000 /* word size */ #define ALL_GENERAL_REGS 0xffffffffu @@ -204,8 +203,6 @@ static bool tcg_target_const_match(int64_t val, int ct, { if (ct & TCG_CT_CONST) { return 1; - } else if ((ct & TCG_CT_CONST_ZERO) && val == 0) { - return 1; } else if ((ct & TCG_CT_CONST_U16) && val == (uint16_t)val) { return 1; } else if ((ct & TCG_CT_CONST_S16) && val == (int16_t)val) { @@ -1666,11 +1663,6 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, TCGArg a0, a1, a2; int c2; - /* - * Note that many operands use the constraint set "rZ". - * We make use of the fact that 0 is the ZERO register, - * and hence such cases need not check for const_args. - */ a0 = args[0]; a1 = args[1]; a2 = args[2]; @@ -2181,14 +2173,14 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) case INDEX_op_st16_i64: case INDEX_op_st32_i64: case INDEX_op_st_i64: - return C_O0_I2(rZ, r); + return C_O0_I2(rz, r); case INDEX_op_add_i32: case INDEX_op_add_i64: return C_O1_I2(r, r, rJ); case INDEX_op_sub_i32: case INDEX_op_sub_i64: - return C_O1_I2(r, rZ, rN); + return C_O1_I2(r, rz, rN); case INDEX_op_mul_i32: case INDEX_op_mulsh_i32: case INDEX_op_muluh_i32: @@ -2207,7 +2199,7 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) case INDEX_op_remu_i64: case INDEX_op_nor_i64: case INDEX_op_setcond_i64: - return C_O1_I2(r, rZ, rZ); + return C_O1_I2(r, rz, rz); case INDEX_op_muls2_i32: case INDEX_op_mulu2_i32: case INDEX_op_muls2_i64: @@ -2234,35 +2226,35 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) return C_O1_I2(r, r, ri); case INDEX_op_clz_i32: case INDEX_op_clz_i64: - return C_O1_I2(r, r, rWZ); + return C_O1_I2(r, r, rzW); case INDEX_op_deposit_i32: case INDEX_op_deposit_i64: - return C_O1_I2(r, 0, rZ); + return C_O1_I2(r, 0, rz); case INDEX_op_brcond_i32: case INDEX_op_brcond_i64: - return C_O0_I2(rZ, rZ); + return C_O0_I2(rz, rz); case INDEX_op_movcond_i32: case INDEX_op_movcond_i64: return (use_mips32r6_instructions - ? C_O1_I4(r, rZ, rZ, rZ, rZ) - : C_O1_I4(r, rZ, rZ, rZ, 0)); + ? C_O1_I4(r, rz, rz, rz, rz) + : C_O1_I4(r, rz, rz, rz, 0)); case INDEX_op_add2_i32: case INDEX_op_sub2_i32: - return C_O2_I4(r, r, rZ, rZ, rN, rN); + return C_O2_I4(r, r, rz, rz, rN, rN); case INDEX_op_setcond2_i32: - return C_O1_I4(r, rZ, rZ, rZ, rZ); + return C_O1_I4(r, rz, rz, rz, rz); case INDEX_op_brcond2_i32: - return C_O0_I4(rZ, rZ, rZ, rZ); + return C_O0_I4(rz, rz, rz, rz); case INDEX_op_qemu_ld_i32: return C_O1_I1(r, r); case INDEX_op_qemu_st_i32: - return C_O0_I2(rZ, r); + return C_O0_I2(rz, r); case INDEX_op_qemu_ld_i64: return TCG_TARGET_REG_BITS == 64 ? C_O1_I1(r, r) : C_O2_I1(r, r, r); case INDEX_op_qemu_st_i64: - return TCG_TARGET_REG_BITS == 64 ? C_O0_I2(rZ, r) : C_O0_I3(rZ, rZ, r); + return TCG_TARGET_REG_BITS == 64 ? C_O0_I2(rz, r) : C_O0_I3(rz, rz, r); default: return C_NotImplemented; From patchwork Mon Feb 17 19:30:00 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 865944 Delivered-To: patch@linaro.org Received: by 2002:a5d:64e6:0:b0:38f:210b:807b with SMTP id g6csp1251860wri; Mon, 17 Feb 2025 11:32:11 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUIcnozIPLDGksvuoyMK90ysk15UscjKiWQCFgRe4rTHPKXznk88urZbdDZl8Nmm0EXWi5WuQ==@linaro.org X-Google-Smtp-Source: AGHT+IH9FxcTqwM2RG7QO9dgDh9uKwf1qSKUgKv6iUBbSbM0MvBvelNOHXZIhChKSUNMQyYCdyhb X-Received: by 2002:a05:622a:1828:b0:471:ba79:cf31 with SMTP id d75a77b69052e-471dbecc36emr152014941cf.49.1739820730894; Mon, 17 Feb 2025 11:32:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1739820730; cv=none; d=google.com; s=arc-20240605; b=JFg7S/eHiE5oy9uYlKkiz60Nwwz+Dt9NrvOKO7ISrTudlE2caTtdHtFx7s9D9paOle OHy+7P1QvcOdBbXniy5sdSe5dPrq4chAbjBwrMXXwJixSVTt6Ne+eD5RHeED3tgqB0wA XCjOXud8QJ+PKBIMRRjB5FP5zf5RuT+fAyG6dUklNVFm/MuQAL8nfncv8bQy6kqiJZ8n IcL4uGU+juh0RxQzzgXDYH09kya+rONs9Ne0OwWpBg4x9VD6sT9agKIp3AZ2mO3jyjtr yEV+Rg8Qm8qQeySEmWSyXRsepyKtMXOyjGUnirSFUiGFREsBqBirtUUXgGlbbZx2gtmn Ck0w== 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=dPHXMTVD2Fm2wK5XqhrhS+/8+R7tQQXD2orYSrUxi/8=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=Tq6TRsiiRjeuVQ3qwo9ikZ9Io3/h9WGDFxvUSUnXPT36CahoCyTc2VzuClDrVk+eaa AZWDiuRrymoLN6p/3Ubybh0mh10OGLZVjHuIqrX8j6tbQUMHBjrFfaE1CpGq+79EJbcO AH0CzCHz0kLlJucjc6GZI3y8u4mtxwJXi/D2VKEzU8+Zsve2VPBo2FjPDNSvXuqDgrNC PS7THCuEzP9QLa7w1Y5fFal64drrKCmOjxNoIRSda3FtN50aZSFVMRbU9DAOVVtXaJYP oLQdm1XHDkMqVzSAvygdaTRLRHgSW2Wjr1OkHLeCv7kaRjdnatgy6dW7/sqmwsHIr9p+ u+Dw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iAJZkT0w; 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; 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 d75a77b69052e-471efbfee08si26744881cf.61.2025.02.17.11.32.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Feb 2025 11:32: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=iAJZkT0w; 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; 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 1tk6qT-0003ub-Ay; Mon, 17 Feb 2025 14:32:00 -0500 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 1tk6p6-0001yR-EV for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:34 -0500 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tk6p2-0008Q6-7N for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:31 -0500 Received: by mail-pj1-x102d.google.com with SMTP id 98e67ed59e1d1-2fc20e0f0ceso5810867a91.3 for ; Mon, 17 Feb 2025 11:30:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739820627; x=1740425427; 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=dPHXMTVD2Fm2wK5XqhrhS+/8+R7tQQXD2orYSrUxi/8=; b=iAJZkT0wefHgJ6kuXfPS1oHFbbRgiaTlmaVG+um0D3Sj0vfBMYU034ox+84kGdGAWb Smjn3pCOpFbDvVdwnz9v6dSNaZRSFtgwZqTjFnRLXB6R/fOlxvurDph7Q1kJhdhUqtAv NZH50ItEU4RbYjNnBT3zp1AErQ6szrBBH3N3ajqSBjIRqc6Jk7E1qRHWMJBWR2fTHXD0 lX4caTs5sHzRFjQ+/Et2tnXYrW6EBpW0gcsaO5jt3P4UzK9fgu77PHpB7kQqu8cODmHC 0G/neglO+RbzawlIaGKsHTQJI2o9fscNIMAf8SsR/bnyDptWsaNO/09nklYULZrfTx3y EWwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739820627; x=1740425427; 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=dPHXMTVD2Fm2wK5XqhrhS+/8+R7tQQXD2orYSrUxi/8=; b=ozLs7Y+rBxsktm9FnKuPjfQ4ONer8VRg/C3j/DJle/iW5XN6xWeAc58LnEtpHJtKAv nUrco/KdCbDRZAM/m8S82UU/KV8H9jFs1XJOwTTxTefyq4775sxBr7XTbpA3G9vAqKwJ VCMuMiUSdTRXOUE6ztMhbsSf3KPk+yrTiAYH/CXSGjyEnuxfNVmbdFKefOudrNQZcnwL 7BObj9/CB8Udy5Up+0Fgq3kPDvyjUFepGIfYmVJK5MLQWzJo05KT4fe/IiKAMjRyCdpF Zg3JhEW1ZcDfamBPASmqSCwPpFWo1hQnziWwHzrFIAZjH1/Cz+yRlCE77AYejp0mK+UA hhDw== X-Gm-Message-State: AOJu0YyTuNnaMijJjNRuMYZB+RGRdgcAH8fMq0A8UgnnSb+lNJAzVS9Q d17gf9n7xgCYfO7RNzbbA2bgo897Me4o/R4q2xtFhSPee/Ijz/pyIGH5kOjZy2gzOVrXMoT+/OQ R X-Gm-Gg: ASbGncuoVbv/LN19RstmcXDF3Rx3XkZDPYR2YiwDWC2FoJfzLHjOUD3umUYHsjxlbMd VUqf685Zwc5Vvun34XHsdyCCRQrZbGjX3DtKfBGWGkIVAzIDgGVV4jmbFOGJ1hBoF4dDCWY2DEK 7H6uttX+y7aSl1DfkhVKiv3vZwZxAKUOr9pIQAmD1PVgBlpc3QHNgHA0I55GK4Io3see9dmmunN iFzB23qDhRbdbslhCNdJF2q+RWEP15YDv9PWBSuQhivKdspySD8O2gKLf/byUAQxp6GKsrcn9IO Cgi/jBDg0WIyEUOPS0KHmGfq3c2p3pxo7tANrIpp21Tcjbs= X-Received: by 2002:a05:6a00:1903:b0:725:df1a:285 with SMTP id d2e1a72fcca58-732617c63d2mr16018665b3a.12.1739820626728; Mon, 17 Feb 2025 11:30:26 -0800 (PST) Received: from stoup.. (71-212-39-66.tukw.qwest.net. [71.212.39.66]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7326a38ff76sm4347164b3a.160.2025.02.17.11.30.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2025 11:30:26 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL v2 19/27] tcg/riscv: Use 'z' constraint Date: Mon, 17 Feb 2025 11:30:00 -0800 Message-ID: <20250217193009.2873875-20-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250217193009.2873875-1-richard.henderson@linaro.org> References: <20250217193009.2873875-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102d; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102d.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.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 Replace target-specific 'Z' with generic 'z'. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/riscv/tcg-target-con-set.h | 10 +++++----- tcg/riscv/tcg-target-con-str.h | 1 - tcg/riscv/tcg-target.c.inc | 28 ++++++++++++---------------- 3 files changed, 17 insertions(+), 22 deletions(-) diff --git a/tcg/riscv/tcg-target-con-set.h b/tcg/riscv/tcg-target-con-set.h index 3c4ef44eb0..e92e815491 100644 --- a/tcg/riscv/tcg-target-con-set.h +++ b/tcg/riscv/tcg-target-con-set.h @@ -10,17 +10,17 @@ * tcg-target-con-str.h; the constraint combination is inclusive or. */ C_O0_I1(r) -C_O0_I2(rZ, r) -C_O0_I2(rZ, rZ) +C_O0_I2(rz, r) +C_O0_I2(rz, rz) C_O1_I1(r, r) C_O1_I2(r, r, ri) C_O1_I2(r, r, rI) C_O1_I2(r, r, rJ) -C_O1_I2(r, rZ, rN) -C_O1_I2(r, rZ, rZ) +C_O1_I2(r, rz, rN) +C_O1_I2(r, rz, rz) C_N1_I2(r, r, rM) C_O1_I4(r, r, rI, rM, rM) -C_O2_I4(r, r, rZ, rZ, rM, rM) +C_O2_I4(r, r, rz, rz, rM, rM) C_O0_I2(v, r) C_O1_I1(v, r) C_O1_I1(v, v) diff --git a/tcg/riscv/tcg-target-con-str.h b/tcg/riscv/tcg-target-con-str.h index 089efe96ca..2f9700638c 100644 --- a/tcg/riscv/tcg-target-con-str.h +++ b/tcg/riscv/tcg-target-con-str.h @@ -21,4 +21,3 @@ CONST('K', TCG_CT_CONST_S5) CONST('L', TCG_CT_CONST_CMP_VI) CONST('N', TCG_CT_CONST_N12) CONST('M', TCG_CT_CONST_M12) -CONST('Z', TCG_CT_CONST_ZERO) diff --git a/tcg/riscv/tcg-target.c.inc b/tcg/riscv/tcg-target.c.inc index 689fbea0df..f7e1ca5a56 100644 --- a/tcg/riscv/tcg-target.c.inc +++ b/tcg/riscv/tcg-target.c.inc @@ -112,13 +112,12 @@ static TCGReg tcg_target_call_oarg_reg(TCGCallReturnKind kind, int slot) return TCG_REG_A0 + slot; } -#define TCG_CT_CONST_ZERO 0x100 -#define TCG_CT_CONST_S12 0x200 -#define TCG_CT_CONST_N12 0x400 -#define TCG_CT_CONST_M12 0x800 -#define TCG_CT_CONST_J12 0x1000 -#define TCG_CT_CONST_S5 0x2000 -#define TCG_CT_CONST_CMP_VI 0x4000 +#define TCG_CT_CONST_S12 0x100 +#define TCG_CT_CONST_N12 0x200 +#define TCG_CT_CONST_M12 0x400 +#define TCG_CT_CONST_J12 0x800 +#define TCG_CT_CONST_S5 0x1000 +#define TCG_CT_CONST_CMP_VI 0x2000 #define ALL_GENERAL_REGS MAKE_64BIT_MASK(0, 32) #define ALL_VECTOR_REGS MAKE_64BIT_MASK(32, 32) @@ -391,9 +390,6 @@ static bool tcg_target_const_match(int64_t val, int ct, if (ct & TCG_CT_CONST) { return 1; } - if ((ct & TCG_CT_CONST_ZERO) && val == 0) { - return 1; - } if (type >= TCG_TYPE_V64) { /* Val is replicated by VECE; extract the highest element. */ val >>= (-8 << vece) & 63; @@ -2681,7 +2677,7 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) case INDEX_op_st16_i64: case INDEX_op_st32_i64: case INDEX_op_st_i64: - return C_O0_I2(rZ, r); + return C_O0_I2(rz, r); case INDEX_op_add_i32: case INDEX_op_and_i32: @@ -2707,7 +2703,7 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) case INDEX_op_sub_i32: case INDEX_op_sub_i64: - return C_O1_I2(r, rZ, rN); + return C_O1_I2(r, rz, rN); case INDEX_op_mul_i32: case INDEX_op_mulsh_i32: @@ -2723,7 +2719,7 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) case INDEX_op_divu_i64: case INDEX_op_rem_i64: case INDEX_op_remu_i64: - return C_O1_I2(r, rZ, rZ); + return C_O1_I2(r, rz, rz); case INDEX_op_shl_i32: case INDEX_op_shr_i32: @@ -2745,7 +2741,7 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) case INDEX_op_brcond_i32: case INDEX_op_brcond_i64: - return C_O0_I2(rZ, rZ); + return C_O0_I2(rz, rz); case INDEX_op_movcond_i32: case INDEX_op_movcond_i64: @@ -2755,14 +2751,14 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) case INDEX_op_add2_i64: case INDEX_op_sub2_i32: case INDEX_op_sub2_i64: - return C_O2_I4(r, r, rZ, rZ, rM, rM); + return C_O2_I4(r, r, rz, rz, rM, rM); case INDEX_op_qemu_ld_i32: case INDEX_op_qemu_ld_i64: return C_O1_I1(r, r); case INDEX_op_qemu_st_i32: case INDEX_op_qemu_st_i64: - return C_O0_I2(rZ, r); + return C_O0_I2(rz, r); case INDEX_op_st_vec: return C_O0_I2(v, r); From patchwork Mon Feb 17 19:30:01 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 865961 Delivered-To: patch@linaro.org Received: by 2002:a5d:64e6:0:b0:38f:210b:807b with SMTP id g6csp1252793wri; Mon, 17 Feb 2025 11:35:01 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWXfbndLf54UJJpd3+QiMLCzktbLkHqijQxhKvBIEkaM4MXUz3p44e0v7SY6Vce4jJAA6t/1Q==@linaro.org X-Google-Smtp-Source: AGHT+IEJzDC5ai5YPb7QkdPex4tfvfuWrFETgw7+qUgT9y/Iic2tdX6ZstokB+ZK7io8LSLO09kc X-Received: by 2002:a05:620a:1790:b0:7b6:c4c7:ecfe with SMTP id af79cd13be357-7c08a98632emr1160284485a.4.1739820901116; Mon, 17 Feb 2025 11:35:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1739820901; cv=none; d=google.com; s=arc-20240605; b=SPmy+L8fSNTMvIrrOjnZVXA3RidlIrV5NQpFehgrFCeFhMq/OmRGWXdIf5mLj/1j7w 7xl/PFxJsrjXkjLANYYXvYjiT+ukqe2RTs+Lf+TDIX2TUzyooPV4XdBj4BBRdGpH4xT7 6L+Aj9MaHCAnZXZIDhYtkmJHYea5Z5pgEbLx0Xh5uQVjwUyd3oYFf/7sbSSAuO4+2dcw WLuJe32jfN2lwzxb2Z/YMU5EhtCa5HBrrHdFU34lg/1qF3bH/u1UG3WZ2qtIjjtrNGCs /oTS6KTM2Zarahye/Ssx7Re/fwujlEjOf21SB6qpSn710T9DibeDYQVjyMz7othHVK+3 otag== 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=ArewPxzX2L3g8+NIrXN+9y4T1awyV4Vx9ORorXETkQs=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=FHq1IyqTNMuT47rDWr86ljry+S9HyOR0H8QKnHyIN1n2kV7jXiJ7ixaExiz6WXkIE1 WFMqbFs0SikuP4py6q8zNQiWWH1XCRx6P4mmuhIzujVtLe7qvF2OP6OMkmxy2uio9H20 /hcT5EPQtIW2MUJtBXftsJcRM63P15RZSw9RjWJ1X/6rqdtXUmc96R6SK6IigYkVq803 /Ki5DtOO+7bZwmErVAh7M8OrSXxQRKZSl7DNkfFgdjLkYhSvhX6dvz/UxvwtaEKY6Mj0 cu8+R+JfBiFWQLSzlIpLM2iXFpD863qBaRgm8KosNnlrnfMGRbYkXd+4f2Z12vcekzdF Uygw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="la7DW/W/"; 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; 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-7c09fc2b80bsi230212585a.301.2025.02.17.11.35.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Feb 2025 11:35: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="la7DW/W/"; 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; 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 1tk6pj-0002bN-1L; Mon, 17 Feb 2025 14:31:11 -0500 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 1tk6p8-0001yh-8O for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:38 -0500 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tk6p3-0008QE-Q0 for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:32 -0500 Received: by mail-pj1-x1035.google.com with SMTP id 98e67ed59e1d1-2fbf77b2b64so8698828a91.2 for ; Mon, 17 Feb 2025 11:30:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739820627; x=1740425427; 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=ArewPxzX2L3g8+NIrXN+9y4T1awyV4Vx9ORorXETkQs=; b=la7DW/W/yYvIeHXxeU7vw3EXenGtRJR2au5sIqfegcu8346raRUms/46aufTBUhP7h WySLoD4Qs+RxAKlxZnDRzPHw5YXzm85YE+Pptq9137FgxVow3GjbXTPA+aU5sgJDiDtP RJyCQwL/+KQlfXcUWEl7Os9rYJ0jmCRBzCcnd6mPoSTCyx3l2STSgP3pF2+UPO9Y+sgu RyV9oFMdwUyDLZYuHl2KRhvTgUe2kFhEOBc6rtws96OK8jK3Z/W16UOl+8xVt0079QYN AxWjvKP4D4jKtJfopk2LjGxgm2uQmdMlNaT7NrxpBkv/SUpbpA2yBpksKjwRk5AYU05W R9Mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739820627; x=1740425427; 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=ArewPxzX2L3g8+NIrXN+9y4T1awyV4Vx9ORorXETkQs=; b=u1mgWuVY0XVzRtdnhIGKkkA0JqZS8ufuS5CiMdk9GV8osbTvYGDo5UwS4MlF3fObFT vsf+jVQvR+C5oH8g4R6zKzXXnCM6/ZtdAMmHhcYtpo57J1jXwdGfyrqA9qpzHk3GGcp+ wcvuAPaHPj6idTkS2HT4znCSGUwyZqjKA9+W+fMzKdW1rf1AbkgKAXHbbVp3hS1CfL99 6QTANDausEzjf9Fsn0jb8PtrTJM8cP4QtEDDn3oalPl7BuqDJNAq85R+ZXoC4Us/Ac3H O6EHFk4T8JJ4mfybQc+CYCtU8m5LPDnvLw6W4NO/vfSTQPN7o1bpwArhWnFzzamUvio+ tMkQ== X-Gm-Message-State: AOJu0YxP0HFh7EuuoP2kMmfqYBcPlENhFXiA2huLH80Tyn7zz3dfwUHn /YK65LJBojmymv/UDoeG9K0Yaao58Bm+4TD4bXUg+/R1gt1nlRzYLf2aarydNdYsv6A6GF8K3tr g X-Gm-Gg: ASbGncv5Y6pUP7EIHAAtXU3MxOxUXwDir5Zyi8DaB4UdzaAlgXSeMSma0K29bh0V+5V ABfzna/5O1n1YtOnj3ftlJMUGb4wv3qYOwSzW4yszcBOLZ215rWEKVzeaeJ4T4fcFtjzW83qJRy JE2zyA3toQTbvwBEI1kai4JhHYXMNBRxP+rfSVWa8bvpC9/9TeDQehTKOvQQcZ19yCTOOJiM6uR lO0ueA5j9cbfVymA/aJcziufe+nF7OaunPrcm4YzexOrDKd2Por6V25bxEzeNg3Ep9p8oLNjXc9 Ez/dNyaRpngoDrX/FvTVmz54bcE49+XDlV45PWezAuDTtOI= X-Received: by 2002:a05:6a00:2447:b0:732:7fc1:92b with SMTP id d2e1a72fcca58-7327fc109efmr6331735b3a.14.1739820627446; Mon, 17 Feb 2025 11:30:27 -0800 (PST) Received: from stoup.. (71-212-39-66.tukw.qwest.net. [71.212.39.66]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7326a38ff76sm4347164b3a.160.2025.02.17.11.30.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2025 11:30:27 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL v2 20/27] tcg/sparc64: Use 'z' constraint Date: Mon, 17 Feb 2025 11:30:01 -0800 Message-ID: <20250217193009.2873875-21-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250217193009.2873875-1-richard.henderson@linaro.org> References: <20250217193009.2873875-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1035; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1035.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.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 Replace target-specific 'Z' with generic 'z'. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/sparc64/tcg-target-con-set.h | 12 ++++++------ tcg/sparc64/tcg-target-con-str.h | 1 - tcg/sparc64/tcg-target.c.inc | 17 +++++++---------- 3 files changed, 13 insertions(+), 17 deletions(-) diff --git a/tcg/sparc64/tcg-target-con-set.h b/tcg/sparc64/tcg-target-con-set.h index 434bf25072..61f9fa3d9f 100644 --- a/tcg/sparc64/tcg-target-con-set.h +++ b/tcg/sparc64/tcg-target-con-set.h @@ -10,11 +10,11 @@ * tcg-target-con-str.h; the constraint combination is inclusive or. */ C_O0_I1(r) -C_O0_I2(rZ, r) -C_O0_I2(rZ, rJ) +C_O0_I2(rz, r) +C_O0_I2(rz, rJ) C_O1_I1(r, r) C_O1_I2(r, r, r) -C_O1_I2(r, rZ, rJ) -C_O1_I4(r, rZ, rJ, rI, 0) -C_O2_I2(r, r, rZ, rJ) -C_O2_I4(r, r, rZ, rZ, rJ, rJ) +C_O1_I2(r, rz, rJ) +C_O1_I4(r, rz, rJ, rI, 0) +C_O2_I2(r, r, rz, rJ) +C_O2_I4(r, r, rz, rz, rJ, rJ) diff --git a/tcg/sparc64/tcg-target-con-str.h b/tcg/sparc64/tcg-target-con-str.h index 0577ec4942..2f033b3ac2 100644 --- a/tcg/sparc64/tcg-target-con-str.h +++ b/tcg/sparc64/tcg-target-con-str.h @@ -16,4 +16,3 @@ REGS('r', ALL_GENERAL_REGS) */ CONST('I', TCG_CT_CONST_S11) CONST('J', TCG_CT_CONST_S13) -CONST('Z', TCG_CT_CONST_ZERO) diff --git a/tcg/sparc64/tcg-target.c.inc b/tcg/sparc64/tcg-target.c.inc index 527af5665d..7c722f59a8 100644 --- a/tcg/sparc64/tcg-target.c.inc +++ b/tcg/sparc64/tcg-target.c.inc @@ -76,7 +76,6 @@ static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = { #define TCG_CT_CONST_S11 0x100 #define TCG_CT_CONST_S13 0x200 -#define TCG_CT_CONST_ZERO 0x400 #define ALL_GENERAL_REGS MAKE_64BIT_MASK(0, 32) @@ -340,9 +339,7 @@ static bool tcg_target_const_match(int64_t val, int ct, val = (int32_t)val; } - if ((ct & TCG_CT_CONST_ZERO) && val == 0) { - return 1; - } else if ((ct & TCG_CT_CONST_S11) && check_fit_tl(val, 11)) { + if ((ct & TCG_CT_CONST_S11) && check_fit_tl(val, 11)) { return 1; } else if ((ct & TCG_CT_CONST_S13) && check_fit_tl(val, 13)) { return 1; @@ -1579,7 +1576,7 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) case INDEX_op_st_i64: case INDEX_op_qemu_st_i32: case INDEX_op_qemu_st_i64: - return C_O0_I2(rZ, r); + return C_O0_I2(rz, r); case INDEX_op_add_i32: case INDEX_op_add_i64: @@ -1611,22 +1608,22 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) case INDEX_op_setcond_i64: case INDEX_op_negsetcond_i32: case INDEX_op_negsetcond_i64: - return C_O1_I2(r, rZ, rJ); + return C_O1_I2(r, rz, rJ); case INDEX_op_brcond_i32: case INDEX_op_brcond_i64: - return C_O0_I2(rZ, rJ); + return C_O0_I2(rz, rJ); case INDEX_op_movcond_i32: case INDEX_op_movcond_i64: - return C_O1_I4(r, rZ, rJ, rI, 0); + return C_O1_I4(r, rz, rJ, rI, 0); 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, rZ, rZ, rJ, rJ); + return C_O2_I4(r, r, rz, rz, rJ, rJ); case INDEX_op_mulu2_i32: case INDEX_op_muls2_i32: - return C_O2_I2(r, r, rZ, rJ); + return C_O2_I2(r, r, rz, rJ); case INDEX_op_muluh_i64: return C_O1_I2(r, r, r); From patchwork Mon Feb 17 19:30:02 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 865950 Delivered-To: patch@linaro.org Received: by 2002:a5d:64e6:0:b0:38f:210b:807b with SMTP id g6csp1252113wri; Mon, 17 Feb 2025 11:32:56 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW44fAPymIAhXR00QvikwFBN8GWXxQm+Ixtuqb6OLkzM/EaNJuGcBHBLWmHBVc1GHQdlTMBXg==@linaro.org X-Google-Smtp-Source: AGHT+IEOluOQvB2TKz9jNiVv9LeSgs+Bn8H0MJtTg1RboVprOnziC22VEGHUOcK7Q6N2tOy07iED X-Received: by 2002:ac8:5a43:0:b0:471:fee7:9610 with SMTP id d75a77b69052e-471fee79827mr7510511cf.12.1739820776692; Mon, 17 Feb 2025 11:32:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1739820776; cv=none; d=google.com; s=arc-20240605; b=M8mGUhlhX9JV4HkGQIdZszcO3XBqaKT/26IouoDNhsaWHt/bcFfXdksObgE4D1cB90 1G8HVVhxAnGmOXNTzbAOVYEqPSfc0d97IPaaMmvGuBNVvlu/l1sLp2ROkxhNSGFIoyas 4Gw0qkE4fN6jHnCuVmfH4KISmA7Er8XOc1t9OyMLLdiIcpHR5BHxuLMfi2EXlUgy+qkq py1bztKQB+KDKokX1sAGH+zqbsEgpDRvn6xxyYLL3H9PmcGVxkgyjogAPp5oWl+KbVa/ I3t/6brlWfQS3/C8KUF/W9gOaGbtJeJ/s5wgj4keGVNw7xDLWWx2J/N1fr3lGbQCYKPg +UGA== 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=CLskJS7NaQB4gx7iCFIleGp2eUUyNj3sDlYnjboU4bU=; fh=MhBxCvw5uELj28Ok7GB965Ny6sY/xXt4upOZnSimWaE=; b=CyFdxv1A0o4ZgkwxjjLJ/tJiDPs44zFILuTxEgBAIQqdton9+XZEESt4INzRHUz8rA RSSxJhvJ7XcRmQq3ekyEX9c6Qiog/KgD5qJAsgM1zMOzcmHm0Np51MpfkgwwaulggTg0 ns8gfSzyCeuVNJbbzmt1/M7gX1UF3PgChnrdlRq+G10X5zAy2rKWMa5u1RlxXAnwk2Y/ vC7Ss1aQNqhJIH6dK5U0JP3tlSRomCcn2fLpCayrgjKAU6+Q8em9fU+ARYfTpQz5zu/d YYAqRVvLNeMTL1mDxvKAkzEhByYtH3JsDyBOWCh4bc0lzKk2cDa7+1RxWEJa6aUxJ/Hy A28A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PlCavxct; 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; 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 d75a77b69052e-471eb37f892si32580531cf.77.2025.02.17.11.32.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Feb 2025 11:32: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=PlCavxct; 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; 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 1tk6qZ-0004Jk-DC; Mon, 17 Feb 2025 14:32:03 -0500 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 1tk6pA-0001zK-Ae for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:44 -0500 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tk6p4-0008QU-Vv for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:35 -0500 Received: by mail-pj1-x1032.google.com with SMTP id 98e67ed59e1d1-2fbffe0254fso8694938a91.3 for ; Mon, 17 Feb 2025 11:30:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739820628; x=1740425428; 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=CLskJS7NaQB4gx7iCFIleGp2eUUyNj3sDlYnjboU4bU=; b=PlCavxctxOveuvsIymIoLT23E8JgclYTlGASFJfvqOlj/+I/QZckN7wNhLfKvh+M6q l8rcTyS9ibcxJkmo6VN7qPovOY9xnqBM3FAWcfQ+oAU+lVrjUk1pZPGzV/tCdB3wQGPN j5cNn7L7b0/j3nfJxqYmV/HfU+9sE0k7qZLOc11FMbe3rLPVcxBdhdIZcs5C62BMAso5 BI+RhBry6iRdL/1VHoqdeUq80YRJb2kDGbUXnMaSz3dzyuoraI3RfuBX5dOtZnWDfzVF p84puYzvpK/NGKC9dcGBb7R55fIly7QJ1JqDQXZhw9U+b09zaXjnjN2QHaRxvLxRguZ0 dBdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739820628; x=1740425428; 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=CLskJS7NaQB4gx7iCFIleGp2eUUyNj3sDlYnjboU4bU=; b=hKYBLGtvAL5lEYKGwnMM6cOn6GMFRgWkezS+vR7HvlCGhB3KP4OvKQe+kft/aUiNBU nV+/V272GcSMTz5+ZblYbuTvnGtWdwYQrj+F2YIlvKSffzq8h5vhA0CYBhJXOi8f91C9 vGURjZHQMEtwjeWOTlYuF51vgQMfRibeAtzQIbaMrVwO/qlrYS7vmi/0mr8ZgzsSrOyk qgxz7CzWnPtw5cvYkQC7mlDKpeo/1CIHaZ1VstTaikMml6qlJOLbiCzCHkq4h4TuIWNL bz2qRT3KjXn0T/IMQHwR+oA3NR6qpOuxSiMgInesyBrRA18my5lLxLeaUN6qyf900t6B kgVA== X-Gm-Message-State: AOJu0YxRGwZOV34yYsCqfSnPRHhJ3/npSTBsclRnh2T48gnJ4KjXhZrz g9Cz8OXISZUNu/4QTOpjSjuze08GWfmwzSliH5878DHo2V6YNjhw2y9PE/pJgp1LqZUd1z4DofH a X-Gm-Gg: ASbGncsF6ckJH8JHMnPuwGp7gqhzVXpa2ibrczNAXU+kzfvmichpcwzvGAPTLudsCTa GezfEDePfqp7hCKx2X3mg4+v2htrqPMNYqMyzr6cO6+xVGFMduoq2LvEmrrc4LMGck0mLG9V5Hd /IC/Jp39KIelS0XP9aUI+aqkEkvEUlBtohUYzu4d53mNea/meclvoYG7RRuseEU3+sV1qq3sMm0 0Imgtq6/Od8dMlkn1+wr2Lovvq6atWgrzLB/vozJ5svJM5k39dHWV0g8/2zZYOQLoeCOlOwQN2F tXm4FPBY9ECrf12ieHgIBu5GMRW6S2vCZMrAy1EfC4oE9G4= X-Received: by 2002:a05:6a00:2447:b0:732:7fc1:92b with SMTP id d2e1a72fcca58-7327fc109efmr6331791b3a.14.1739820628099; Mon, 17 Feb 2025 11:30:28 -0800 (PST) Received: from stoup.. (71-212-39-66.tukw.qwest.net. [71.212.39.66]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7326a38ff76sm4347164b3a.160.2025.02.17.11.30.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2025 11:30:27 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Fabiano Rosas Subject: [PULL v2 21/27] elfload: Fix alignment when unmapping excess reservation Date: Mon, 17 Feb 2025 11:30:02 -0800 Message-ID: <20250217193009.2873875-22-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250217193009.2873875-1-richard.henderson@linaro.org> References: <20250217193009.2873875-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.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: Fabiano Rosas When complying with the alignment requested in the ELF and unmapping the excess reservation, having align_end not aligned to the guest page causes the unmap to be rejected by the alignment check at target_munmap and later brk adjustments hit an EEXIST. Fix by aligning the start of region to be unmapped. Fixes: c81d1fafa6 ("linux-user: Honor elf alignment when placing images") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1913 Signed-off-by: Fabiano Rosas [rth: Align load_end as well.] Signed-off-by: Richard Henderson Message-ID: <20250213143558.10504-1-farosas@suse.de> --- linux-user/elfload.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index a2c152e5ad..8799e4ea27 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -3351,8 +3351,8 @@ static void load_elf_image(const char *image_name, const ImageSource *src, if (align_size != reserve_size) { abi_ulong align_addr = ROUND_UP(load_addr, align); - abi_ulong align_end = align_addr + reserve_size; - abi_ulong load_end = load_addr + align_size; + abi_ulong align_end = TARGET_PAGE_ALIGN(align_addr + reserve_size); + abi_ulong load_end = TARGET_PAGE_ALIGN(load_addr + align_size); if (align_addr != load_addr) { target_munmap(load_addr, align_addr - load_addr); From patchwork Mon Feb 17 19:30:03 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 865957 Delivered-To: patch@linaro.org Received: by 2002:a5d:64e6:0:b0:38f:210b:807b with SMTP id g6csp1252473wri; Mon, 17 Feb 2025 11:34:02 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXXVkyVHTiFQ0ZgHrGw9HMV1xHuerQfVQ1I9YT8VBCWzVppUI6dDwdCdZgU7MflcoRYTxKf3A==@linaro.org X-Google-Smtp-Source: AGHT+IE/FA0N0ZgAxF6UkDPaDqES9OOrxcKJrp8834uuNJAxgH2hWyxnN9o+x7NvBroymwjjq2xS X-Received: by 2002:a05:620a:2622:b0:7c0:a8a5:81b6 with SMTP id af79cd13be357-7c0a8a58407mr241833685a.39.1739820842682; Mon, 17 Feb 2025 11:34:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1739820842; cv=none; d=google.com; s=arc-20240605; b=SU8bQnDpJ1vAUfzQsZSEQsHko3ONJJ7CShziTlD7d70tt95nhi2+i2vrwXwUNZEU+i JAWp9bYE00Rwh0DQMQ+Z8hC7rgDBTGPmek/K5BPOQh986MySLSgwoWQwstJr7IB60A3b BfhCO3aikMDhLAz+3wSOk8yJFx0kd345S9GPzfxCcKBoIYDgym46CEbx3AR64LmtQWJ8 aUSrCdY0mNMZ48MJi257Bvn9PbiY9YYCBQIrwJFBgjYRHfKf354ot17utq+5u/tU4DJJ P2BOuq1DWM3+aBJen4eLJVvDDTxHXvJMshVKov/vU59IXlX/m1dWzMOGiib1BJOtq11+ QuSQ== 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=rHMuLXwDxnjUgeWyF7p2JwNyxJ+JG8MBxC5p4lqjmmU=; fh=IB3WlE9bbmmgtCSkpY8aqI4QYCKoqbha83gT4/CExAQ=; b=WAIXMTMuI/ld6sw2D6U4/hJuzm8MN7mc0iNJTCv0H8xh448J/LRJ9BMHC7LX8XAw2Z 1G1OJE9aEvhijixFet93ehxumYwlhWPYH0c8B4YrrEryHDTqLKEmd4hav1D9QX9qLQ5j rT/wa4Gt0n9HBtRKxA/tymr/uAgjd12fLwcIH5+udZY1xZ5P9k8cUDgp91adgO3jIc4q JDM3TsxX7hgZ2hA+5Ss47S4rzKHmAlOBM0Vg1EmbH6E9bo4XSMJDb3SFQfR0o4KahOcH 4+fG+2iod+pM4orU1rLOgBCJKjD9a29yyGI7kbODSzqqt1f6NpZOww//z9MBeCI5SCbE yToQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=M2TbGyVq; 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; 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-7c09bff2562si272953385a.490.2025.02.17.11.34.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Feb 2025 11:34: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=M2TbGyVq; 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; 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 1tk6pd-0002NQ-KM; Mon, 17 Feb 2025 14:31:05 -0500 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 1tk6pA-0001zI-9u for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:44 -0500 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tk6p4-0008Qc-W6 for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:35 -0500 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-221057b6ac4so35459595ad.2 for ; Mon, 17 Feb 2025 11:30:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739820629; x=1740425429; 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=rHMuLXwDxnjUgeWyF7p2JwNyxJ+JG8MBxC5p4lqjmmU=; b=M2TbGyVqByrMAPdFmU0O3AnVvQ03Dzje6c+i5JeQI0162kx2zgPp3zLyk0tKNVlKlN xLuSXmSh7QkZoqM6u6UC67bygeBs1Bq07nGUBEZH/V5Ya24PDgEEjwvoG99dQRVqbkye PUGrY4NEP6YqSJWK6vbXpy3XuO6GcwdPiAvWuapi+PR55xrE98qEt2TDvA5GTgUyystd RdXBaP0RwtQAsPLB6en8rkTHns7G9X/X6EBPLkaxSMV0YBVU55j7+H68wqjzsdIDxHzc z1PbX1bmh8OIyiPiZt126ET4vLWBb2JeqCb+xRdAC6QXuzaBYQBPEDsjsQZePoq+OMXU cE8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739820629; x=1740425429; 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=rHMuLXwDxnjUgeWyF7p2JwNyxJ+JG8MBxC5p4lqjmmU=; b=M2p8zCrpcOH89x5NecgVBd21KCCb4/TK0gOAziFO/ezNvm1MRIcIjjJDbjg95zIsXc oz1kFp3FRMS020ciRynJ24K5KgTe7tpekIV0tBr8PYQwwU6ACQ4lqQ3QsTSZrYsVAhl/ JTzMuyGqKkh/s5jjsiqA/T102Vg7eAxjYoAPcPY2VXhs2acchOEUmFL1UOf9SlIvIpKE 80UmHtRAAkCgEvarMs6IEn0zPjYEqLELXJv+TOn4MKu9RHd/PZbKDYTy8MO9DID0Hig5 JuFEwzp1KGOeahqVqZl20AG/dfojrEvvgBDJPjKgM8xM99lgenHO0cLqPaSzUbxvVyif 2o3A== X-Gm-Message-State: AOJu0YwuYjcWVHfm20IAnm14HviJArinbGAIkors38Mcyv5DRNMLD83m 52Vd5g/AZa+tYUZ8Z4YsP5BxZmWa0vLavfrJLBQNeIAmUFwuHWIAOSQAxz9GQyTpSogH3/Gt69i p X-Gm-Gg: ASbGncuELQavz8EZUxKahheagvb/3P8WsXH8zZUMrD6pC6HIRbWlhBNETGFUuuS8m2E jvCyc2Dqvn2v7PPumCiUrYVWf5aXXAEJsljxPBBiVQcvtqJZbqhGmTiFyptj7wf4cnJYD7IY+Wa sb+DoLV/RFGurPP9wChf1Hw9hgO5Ss877Tuiy9ZFvr1gitAMjYYeulGknwffYojzLEs3f3vpSJu eyH606qIeChBSdiQwwrTTdQI5T69I9hUAD6IFoELYy2BG+es8BepiWqnr/3DIyYqkJhDe1KCrkN UbbhfTYyhPIt20/Rj4vihXC7lnklwE52RvkkaOyUQDwihmg= X-Received: by 2002:a05:6a00:cc9:b0:730:937f:e838 with SMTP id d2e1a72fcca58-732618f5724mr14202731b3a.22.1739820628926; Mon, 17 Feb 2025 11:30:28 -0800 (PST) Received: from stoup.. (71-212-39-66.tukw.qwest.net. [71.212.39.66]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7326a38ff76sm4347164b3a.160.2025.02.17.11.30.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2025 11:30:28 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Andreas Schwab , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Subject: [PULL v2 22/27] linux-user: Move TARGET_SA_RESTORER out of generic/signal.h Date: Mon, 17 Feb 2025 11:30:03 -0800 Message-ID: <20250217193009.2873875-23-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250217193009.2873875-1-richard.henderson@linaro.org> References: <20250217193009.2873875-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.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: Andreas Schwab SA_RESTORER and the associated sa_restorer field of struct sigaction are an obsolete feature, not expected to be used by future architectures. They are also absent on RISC-V, LoongArch, Hexagon and OpenRISC, but defined due to their use of generic/signal.h. This leads to corrupted data and out-of-bounds accesses. Move the definition of TARGET_SA_RESTORER out of generic/signal.h into the target_signal.h files that need it. Note that m68k has the sa_restorer field, but does not use it and does not define SA_RESTORER. Reported-by: Thomas Weißschuh Signed-off-by: Andreas Schwab Reviewed-by: Thomas Weißschuh Reviewed-by: Richard Henderson Signed-off-by: Richard Henderson Message-ID: --- linux-user/aarch64/target_signal.h | 2 ++ linux-user/arm/target_signal.h | 2 ++ linux-user/generic/signal.h | 1 - linux-user/i386/target_signal.h | 2 ++ linux-user/m68k/target_signal.h | 1 + linux-user/microblaze/target_signal.h | 2 ++ linux-user/ppc/target_signal.h | 2 ++ linux-user/s390x/target_signal.h | 2 ++ linux-user/sh4/target_signal.h | 2 ++ linux-user/x86_64/target_signal.h | 2 ++ linux-user/xtensa/target_signal.h | 2 ++ 11 files changed, 19 insertions(+), 1 deletion(-) diff --git a/linux-user/aarch64/target_signal.h b/linux-user/aarch64/target_signal.h index 40e399d990..6f66a50bfd 100644 --- a/linux-user/aarch64/target_signal.h +++ b/linux-user/aarch64/target_signal.h @@ -3,6 +3,8 @@ #include "../generic/signal.h" +#define TARGET_SA_RESTORER 0x04000000 + #define TARGET_SEGV_MTEAERR 8 /* Asynchronous ARM MTE error */ #define TARGET_SEGV_MTESERR 9 /* Synchronous ARM MTE exception */ diff --git a/linux-user/arm/target_signal.h b/linux-user/arm/target_signal.h index 0e6351d9f7..ff1810b1fe 100644 --- a/linux-user/arm/target_signal.h +++ b/linux-user/arm/target_signal.h @@ -3,6 +3,8 @@ #include "../generic/signal.h" +#define TARGET_SA_RESTORER 0x04000000 + #define TARGET_ARCH_HAS_SETUP_FRAME #define TARGET_ARCH_HAS_SIGTRAMP_PAGE 1 diff --git a/linux-user/generic/signal.h b/linux-user/generic/signal.h index 6fd05b77bb..b34740258e 100644 --- a/linux-user/generic/signal.h +++ b/linux-user/generic/signal.h @@ -15,7 +15,6 @@ #define TARGET_SA_RESTART 0x10000000 #define TARGET_SA_NODEFER 0x40000000 #define TARGET_SA_RESETHAND 0x80000000 -#define TARGET_SA_RESTORER 0x04000000 #define TARGET_SIGHUP 1 #define TARGET_SIGINT 2 diff --git a/linux-user/i386/target_signal.h b/linux-user/i386/target_signal.h index 9315cba241..eee792ef63 100644 --- a/linux-user/i386/target_signal.h +++ b/linux-user/i386/target_signal.h @@ -3,6 +3,8 @@ #include "../generic/signal.h" +#define TARGET_SA_RESTORER 0x04000000 + #define TARGET_ARCH_HAS_SETUP_FRAME #define TARGET_ARCH_HAS_SIGTRAMP_PAGE 1 diff --git a/linux-user/m68k/target_signal.h b/linux-user/m68k/target_signal.h index 6e0f4b74e3..b05b9303b0 100644 --- a/linux-user/m68k/target_signal.h +++ b/linux-user/m68k/target_signal.h @@ -3,6 +3,7 @@ #include "../generic/signal.h" +#define TARGET_ARCH_HAS_SA_RESTORER 1 #define TARGET_ARCH_HAS_SETUP_FRAME #define TARGET_ARCH_HAS_SIGTRAMP_PAGE 1 diff --git a/linux-user/microblaze/target_signal.h b/linux-user/microblaze/target_signal.h index 7dc5c45f00..ffe4442213 100644 --- a/linux-user/microblaze/target_signal.h +++ b/linux-user/microblaze/target_signal.h @@ -3,6 +3,8 @@ #include "../generic/signal.h" +#define TARGET_SA_RESTORER 0x04000000 + #define TARGET_ARCH_HAS_SIGTRAMP_PAGE 1 #endif /* MICROBLAZE_TARGET_SIGNAL_H */ diff --git a/linux-user/ppc/target_signal.h b/linux-user/ppc/target_signal.h index 5be24e152b..53fae473f3 100644 --- a/linux-user/ppc/target_signal.h +++ b/linux-user/ppc/target_signal.h @@ -3,6 +3,8 @@ #include "../generic/signal.h" +#define TARGET_SA_RESTORER 0x04000000 + #if !defined(TARGET_PPC64) #define TARGET_ARCH_HAS_SETUP_FRAME #endif diff --git a/linux-user/s390x/target_signal.h b/linux-user/s390x/target_signal.h index 41e0e34a55..738e0673f4 100644 --- a/linux-user/s390x/target_signal.h +++ b/linux-user/s390x/target_signal.h @@ -3,6 +3,8 @@ #include "../generic/signal.h" +#define TARGET_SA_RESTORER 0x04000000 + #define TARGET_ARCH_HAS_SETUP_FRAME #define TARGET_ARCH_HAS_SIGTRAMP_PAGE 1 diff --git a/linux-user/sh4/target_signal.h b/linux-user/sh4/target_signal.h index eee6a1a7cd..0bde417fd1 100644 --- a/linux-user/sh4/target_signal.h +++ b/linux-user/sh4/target_signal.h @@ -3,6 +3,8 @@ #include "../generic/signal.h" +#define TARGET_SA_RESTORER 0x04000000 + #define TARGET_ARCH_HAS_SETUP_FRAME #define TARGET_ARCH_HAS_SIGTRAMP_PAGE 1 diff --git a/linux-user/x86_64/target_signal.h b/linux-user/x86_64/target_signal.h index 9d9717406f..0af100c661 100644 --- a/linux-user/x86_64/target_signal.h +++ b/linux-user/x86_64/target_signal.h @@ -3,6 +3,8 @@ #include "../generic/signal.h" +#define TARGET_SA_RESTORER 0x04000000 + /* For x86_64, use of SA_RESTORER is mandatory. */ #define TARGET_ARCH_HAS_SIGTRAMP_PAGE 0 diff --git a/linux-user/xtensa/target_signal.h b/linux-user/xtensa/target_signal.h index e4b1bea5cb..8a198bf8ac 100644 --- a/linux-user/xtensa/target_signal.h +++ b/linux-user/xtensa/target_signal.h @@ -3,6 +3,8 @@ #include "../generic/signal.h" +#define TARGET_SA_RESTORER 0x04000000 + #define TARGET_ARCH_HAS_SIGTRAMP_PAGE 1 #endif From patchwork Mon Feb 17 19:30:04 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 865956 Delivered-To: patch@linaro.org Received: by 2002:a5d:64e6:0:b0:38f:210b:807b with SMTP id g6csp1252442wri; Mon, 17 Feb 2025 11:33:59 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUaUyOm/rgUOVRYQQPsHUZ1jpjnwP8vngGUX08/Qie7HRS4Ym4C9f79oVvAmszD4wde2Z7Stw==@linaro.org X-Google-Smtp-Source: AGHT+IEb+RCIf238nsAIcF/bTn0lTEKH8Pzjdm2KzHCaJqORvUoQvDhr+2gKJU1v/I3Iv8dVD5u1 X-Received: by 2002:a05:620a:4624:b0:7c0:b95:693b with SMTP id af79cd13be357-7c08a98f9d7mr1433201785a.7.1739820838585; Mon, 17 Feb 2025 11:33:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1739820838; cv=none; d=google.com; s=arc-20240605; b=QJyZHlEWMXzh+D9x0q7oWc/IzxZxscfliAQ2SThIxjzoY/3VwmvrtSdIapAGPrKOyi OvlVBiu0VGz1s+5XyQ5S7iJI2hdmf0E9lgIXXeCYR1obEKCVNgEMlO14ybRibJRI/uUN AxExrqx7VawHI+MmXNBtMowetCl7lDWqrBVZlOq6Ve+2Kl3nwlKkcesLwT0bt5JDnRpH e9lxFmfkTTE5pagdMU1ealbolZg7oOII/LzO6YHQnV+TO9NzKToJMSzXtNHngbGBoKjT m5Ef9FU3DE3aBNzjwT6+llQF3JEUtTsQbwf7n6fylbW8BUhC//zDwKQwvO6AVUhXmxxX SkKw== 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=fAxPDj0myQVPp6aikkb7gZtJzw/Id1WCci49i4T0v4I=; fh=5R6H1gW0X/bNurHprVm281a7Gu2FPpArYOSv2pjBoKc=; b=OIhosHEJRfT7eG+k5OWXXCEXNZWSU2Ev66V3oQzM5/fz5aKz97cyi2U2vvJHuoaE2s yz1sLDkyJ1C97RmeeikOGLjHHzWB/X/VDZ6aYkoDB1nEASNJmkS7hqYfbyQvAG5xI0ZW YifwDnmWepVH+xvAzNRt4ql5vrYx2D9xxNW1eZEWVndwpYM9QDtQj+gr9zdhIA+WIJJP u9jfc3yLSN/QOkcpa7ZYlVGyyBSJ5CjqpTauu6/wIQ2eY61t8l+THyxaCgcgHIpxzue+ J2z3Kkbhggb2Z5iwtoOBkicpyvz91cndVZe4fNtp+6H+cJ1XVBEFqco8OJf0ue43EDRO zsKQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GeXO26s8; 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; 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-7c09bffbf24si269815585a.102.2025.02.17.11.33.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Feb 2025 11:33: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=GeXO26s8; 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; 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 1tk6pn-0002vm-OC; Mon, 17 Feb 2025 14:31:16 -0500 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 1tk6pA-0001zN-UX for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:44 -0500 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tk6p6-0008Qq-CN for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:36 -0500 Received: by mail-pj1-x1034.google.com with SMTP id 98e67ed59e1d1-2fc32756139so4467831a91.1 for ; Mon, 17 Feb 2025 11:30:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739820630; x=1740425430; 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=fAxPDj0myQVPp6aikkb7gZtJzw/Id1WCci49i4T0v4I=; b=GeXO26s8uJhbbhZSp3x+v8iU+EBwRbUQSZmng7epZ/3OgIKmYymvrcT+QPuvZdg08z WSI0saCze5buXYI6CtAJewLhKQ+0GCj+WJLLk70hr+ODfDaQmNgZiexY0mStOkT/5Hlr mWZpYcOsE8pDaasFT32VKHxqsrbv1/YMjBXzyy7y1VuNJR6pFI9UgioRBIMngDvhIFZS 8xlKmbKbKtaiIL4WDDumvLp56o/kI/9lX520VIgamzwszPTmgLymzF9PeqGpRmpij23x qSB9JrwIErW0jyuypmQPUG9ZAnElt6kMSqW58eYvsa1V4rPoOGKCRY8EJ30O+DbpdCzF RISA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739820630; x=1740425430; 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=fAxPDj0myQVPp6aikkb7gZtJzw/Id1WCci49i4T0v4I=; b=sOf5sw8xbwCu6bKqjqXLzujPqZxEHc4gMhyOz6tYL9eJLZfHZYHNZ/WbPWGMqg4rVn bMEhKiVoVHISPbfwWSJyre1gARjUrNI4lss6UjUB4QDhF3rZnnzH0NI6OTr9gkvJtmTx vDpPI7c5gYw6yZpGnGFsHBC7EYmOh+iFrDQJ7qk8YHQRtPOsUembT8xRrN/G8tuD+Dxb cMqZ/UR5Z+ih/rRE6DfFlcjzgYnMdLwqnj/vCvTX8FkmSy2nL7B1ps001ngewoq/0G00 EuuLmnqtz7try9oBq03hnriP2ENG7eqocUJgD2i+4O030xx8Zns4+K9RD26y5CCOg8Ny xPIw== X-Gm-Message-State: AOJu0Yx/ZToo4bGetZTnfkKQQeD0NZxX6GBxWT9AOVwgwakFhYeYzbX/ 0291r4YzBIEIOI8chjY/RwXw5OOe2jnPGgIIeFFx6mjfdzII5S4pNKT5AY70V1x+Q3uY2HVmDsN + X-Gm-Gg: ASbGncuUiFfHM187zlSdpXDxs/trNNgz84tQ9iCR5DzxUK/u8XzjjVKOHipqPDgFu1Z EQ+7s61F5bke8IH6wy0PR1yO7M/aaSzzaXN23tzAXx9l5icH132QaO7m5itzHY1dOPodjrHfoAk H4h1kjrlERyfy4tQ6W+M3qJhsR4Pi1Z3dJgJWI0EfkJ9n/R5hWp2uyj5d1utpEljG7e9ZfC9NNn wcoPsZBwQZGenJ3dcvFL5rcDeBudeU9niUQ3szyuPnUoDdXT1RM/3tMAh2cYzN0FRIz7/9t8DNo 7azUH0lhsHPS63fIxn/HjTxYMJtQjk6/9blr/1lJdoEVHSE= X-Received: by 2002:a05:6a00:139d:b0:730:87b2:e839 with SMTP id d2e1a72fcca58-732618f564cmr18316945b3a.21.1739820629737; Mon, 17 Feb 2025 11:30:29 -0800 (PST) Received: from stoup.. (71-212-39-66.tukw.qwest.net. [71.212.39.66]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7326a38ff76sm4347164b3a.160.2025.02.17.11.30.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2025 11:30:29 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Mikael Szreder , qemu-stable@nongnu.org, Artyom Tarasenko Subject: [PULL v2 23/27] target/sparc: Fix register selection for all F*TOx and FxTO* instructions Date: Mon, 17 Feb 2025 11:30:04 -0800 Message-ID: <20250217193009.2873875-24-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250217193009.2873875-1-richard.henderson@linaro.org> References: <20250217193009.2873875-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=unavailable 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: Mikael Szreder A bug was introduced in commit 0bba7572d40d which causes the fdtox and fqtox instructions to incorrectly select the destination registers. More information and a test program can be found in issue #2802. Cc: qemu-stable@nongnu.org Fixes: 0bba7572d40d ("target/sparc: Perform DFPREG/QFPREG in decodetree") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2802 Signed-off-by: Mikael Szreder Acked-by: Artyom Tarasenko [rth: Squash patches together, since the second fixes a typo in the first.] Signed-off-by: Richard Henderson Message-ID: <20250205090333.19626-3-git@miszr.win> --- target/sparc/insns.decode | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index 989c20b44a..cfcdf6690e 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -321,12 +321,12 @@ FdMULq 10 ..... 110100 ..... 0 0110 1110 ..... @q_d_d FNHADDs 10 ..... 110100 ..... 0 0111 0001 ..... @r_r_r FNHADDd 10 ..... 110100 ..... 0 0111 0010 ..... @d_d_d FNsMULd 10 ..... 110100 ..... 0 0111 1001 ..... @d_r_r -FsTOx 10 ..... 110100 00000 0 1000 0001 ..... @r_r2 -FdTOx 10 ..... 110100 00000 0 1000 0010 ..... @r_d2 -FqTOx 10 ..... 110100 00000 0 1000 0011 ..... @r_q2 -FxTOs 10 ..... 110100 00000 0 1000 0100 ..... @r_r2 -FxTOd 10 ..... 110100 00000 0 1000 1000 ..... @d_r2 -FxTOq 10 ..... 110100 00000 0 1000 1100 ..... @q_r2 +FsTOx 10 ..... 110100 00000 0 1000 0001 ..... @d_r2 +FdTOx 10 ..... 110100 00000 0 1000 0010 ..... @d_d2 +FqTOx 10 ..... 110100 00000 0 1000 0011 ..... @d_q2 +FxTOs 10 ..... 110100 00000 0 1000 0100 ..... @r_d2 +FxTOd 10 ..... 110100 00000 0 1000 1000 ..... @d_d2 +FxTOq 10 ..... 110100 00000 0 1000 1100 ..... @q_d2 FiTOs 10 ..... 110100 00000 0 1100 0100 ..... @r_r2 FdTOs 10 ..... 110100 00000 0 1100 0110 ..... @r_d2 FqTOs 10 ..... 110100 00000 0 1100 0111 ..... @r_q2 From patchwork Mon Feb 17 19:30:05 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 865943 Delivered-To: patch@linaro.org Received: by 2002:a5d:64e6:0:b0:38f:210b:807b with SMTP id g6csp1251572wri; Mon, 17 Feb 2025 11:31:33 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUnQLoglQn58TWjmUrCt8mqtQ8t+eFiORcifMVndcACRh2UyTvxFreEZu7am+x39138612DoA==@linaro.org X-Google-Smtp-Source: AGHT+IG5S8Oj7SAyYg2a5Oh4kOUAlDmpK2oxE7k3iq8xGbdZSKSMDnrtlwCydIozN/uyUhhKe7Zv X-Received: by 2002:a05:620a:4111:b0:7c0:7935:6401 with SMTP id af79cd13be357-7c08a9925c1mr1425223785a.2.1739820692942; Mon, 17 Feb 2025 11:31:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1739820692; cv=none; d=google.com; s=arc-20240605; b=OSrf8Mhl/BAQBFc0q+BZPbN2aRWZuQ3IuvtmdC6EPXMkaiDBSIiZ/WMvaegwBJFWee A7CkyD0qGaEdN3oO1n5pAEW/cjrzKVFdBfAhAKGVybnN6kmpKroyEN0+QZvqOiYRT832 w6gwsOEKYXrk+rUSCnnc9nS3xwR7rbDkiOuqTGw4SkNbS9snkCsnGtn3cvUfACkyG1qe 7ac+RHRKo91SnBw6sWDPOKJ03XjwXy6E8Ii6g578/NEsUDfi9BOqdjgpuDGhcAvti36S Kv0fTQaZktBmqMBRqnTwcZgZ2TB3A0xH3TBwPV0s9678Wk20HomItB8gz8Dk+K6jmuiU FjSw== 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=ZoiLt3pf8hgXu53AUbpJI+JmE6qkg40H4RF3hXdm60A=; fh=HAmkNPWcZyjMXlFsUC0UJ0/DOHfK6N5iDFuCShuD3eU=; b=i6HqBcuZ/mlf/U+EHa/Sd9Mf4DX42dCyiWfYFfwSUU5XxGleA2i9yYfPdzCaNl0NDd +U0vWu9sOUrJ0HKB2B0Pv1+gfNrECfIkdt3qwIRVXJe1VWwrdN6flVFimpL3can64bIU v20clXBLJS0wdB8ODmrYOWgCkTXz+FP53RgvgePpWVoAOndduG51wffqJ8X3n7lOraZy ekoNkpPF08xsG8rtzkrTuZYNKiLSMo0LESJWAvS2LzRnySZslmsOWG5do0O8j6fLW43K WsBCvyF8T9nOQvGqUY9HX3ZVvgmLYId9SeYftxB+4svOBYXEucGJyOzo8xQpqAq0TvCg 0vEw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=r6Qn65mC; 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; 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-7c0ab8c58adsi35658385a.160.2025.02.17.11.31.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Feb 2025 11:31:32 -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=r6Qn65mC; 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; 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 1tk6pq-0002yp-PR; Mon, 17 Feb 2025 14:31:18 -0500 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 1tk6pA-0001zM-Qc for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:44 -0500 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tk6p6-0008R5-CN for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:36 -0500 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-221206dbd7eso26589065ad.2 for ; Mon, 17 Feb 2025 11:30:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739820630; x=1740425430; 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=ZoiLt3pf8hgXu53AUbpJI+JmE6qkg40H4RF3hXdm60A=; b=r6Qn65mCal8xE383Ihe+VFdEu/bYDCXXiY56rCmWjSqYest3ZGD2irU2NNkfsMgZe2 uI7YXiOvM014ZMSnB7HWzgJ/RJy3xzqucoc3Nmez2TTOfjCXnsrr2xYPA0YmwZSNOZrq pyiK4jif37KRWF16ZXAaeKdWUe22HKKAmBZ3LHrFqUUQvnkzaAjypNTUoCd10Nx2NKQw HoNxS1gFRG2MzmWjkyvSMiGl3l4fOqVryNGi4cSeLlJR+uwHAN3rk4vdma3705PA4jHe RjRrSzTCkAe7bY2a4JAoSiqtv/1vYW3PnbzJnHlPtgCtX0nkDDjQ6OZD/IOr5hNRC5ES On6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739820630; x=1740425430; 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=ZoiLt3pf8hgXu53AUbpJI+JmE6qkg40H4RF3hXdm60A=; b=nwvq4pfXZxE2RPOWvfXTSv1ZGOG27lHujker6iAfogVTX0dyweufsioZen33l1mWsm EkGDN6SnlVpshbd2GX9ldUPKFdcEDGHEvB1QhhwjQTMIqXBcHUOzqIo86yN/Ig5KrF6y BY3D+p5eLG71/AaN6eAkC5gGReZxKl4VXFmRKJKOj6hFBUQeyvksfwh+5ByKlRKeoRtT BtfeObZMx1q6fT2qZ9ch9TKoPSnkeCUAxHFqsSg+SspSYKPrw6bM9U06ApevwUrZOWXe rai4n6G3DXRQaMA3MdryjllpYIKLz6jsC4zFsiT5kwtiDy/3J+w5Kr8rXUc4VUWcNn+y H1Og== X-Gm-Message-State: AOJu0YzAH2NF8cEPCOd824y43whf412A4XT5Rg7lb1eGULIyzvLUA+vU QHBTHjpsHgwqpBdC4lobXoaO2j/X+Il6go5BcCiuk0SmEvgjl+ViFltLSG8ytYSdIBwLTtflFGx w X-Gm-Gg: ASbGncuOunLNRu2hxIq98PAORaxco5kHEPFBvwwjIIfyfYrSOCuFQtGkPQV1fjSVTPP UdgOuYEx/Lw+GBpE+S4moYZO9uRPTC1n9dOmxla7fq0QsOnayIVnFkvVUcuRZUop52lus1XDmOB WjcWP5hSFrZGofxuHPu014+iKkSzmGuQ+h9eTRvC4OFCjzsB/WPoG7Ttk/klncFqLVUkbYQhqDX CnIC/3LW4zg+pMbHEiyI4GJv7SVxf0YyL+XYlpN35XUJ0VH/uNLaNQM55HxRjDBtvfIt+dh2caa sfLVmoJ4enXvvmrCgzSSn5I8Ab+d87QRdQxsBXaQnulP00E= X-Received: by 2002:a05:6a00:2d9d:b0:730:f1b7:9bc4 with SMTP id d2e1a72fcca58-73261779914mr17984780b3a.4.1739820630568; Mon, 17 Feb 2025 11:30:30 -0800 (PST) Received: from stoup.. (71-212-39-66.tukw.qwest.net. [71.212.39.66]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7326a38ff76sm4347164b3a.160.2025.02.17.11.30.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2025 11:30:30 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Mikael Szreder , qemu-stable@nongnu.org Subject: [PULL v2 24/27] target/sparc: Fix gdbstub incorrectly handling registers f32-f62 Date: Mon, 17 Feb 2025 11:30:05 -0800 Message-ID: <20250217193009.2873875-25-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250217193009.2873875-1-richard.henderson@linaro.org> References: <20250217193009.2873875-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x635.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.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: Mikael Szreder The gdbstub implementation for the Sparc architecture would incorrectly calculate the the floating point register offset. This resulted in, for example, registers f32 and f34 to point to the same value. The issue was caused by the confusion between even register numbers and even register indexes. For example, the register index of f32 is 64 and f34 is 65. Cc: qemu-stable@nongnu.org Fixes: 30038fd81808 ("target-sparc: Change fpr representation to doubles.") Signed-off-by: Mikael Szreder Reviewed-by: Richard Henderson Signed-off-by: Richard Henderson Message-ID: <20250214070343.11501-1-git@miszr.win> --- target/sparc/gdbstub.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/target/sparc/gdbstub.c b/target/sparc/gdbstub.c index ec0036e9ef..134617fb23 100644 --- a/target/sparc/gdbstub.c +++ b/target/sparc/gdbstub.c @@ -79,8 +79,13 @@ int sparc_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n) } } if (n < 80) { - /* f32-f62 (double width, even numbers only) */ - return gdb_get_reg64(mem_buf, env->fpr[(n - 32) / 2].ll); + /* f32-f62 (16 double width registers, even register numbers only) + * n == 64: f32 : env->fpr[16] + * n == 65: f34 : env->fpr[17] + * etc... + * n == 79: f62 : env->fpr[31] + */ + return gdb_get_reg64(mem_buf, env->fpr[(n - 64) + 16].ll); } switch (n) { case 80: @@ -173,8 +178,13 @@ int sparc_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n) } return 4; } else if (n < 80) { - /* f32-f62 (double width, even numbers only) */ - env->fpr[(n - 32) / 2].ll = tmp; + /* f32-f62 (16 double width registers, even register numbers only) + * n == 64: f32 : env->fpr[16] + * n == 65: f34 : env->fpr[17] + * etc... + * n == 79: f62 : env->fpr[31] + */ + env->fpr[(n - 64) + 16].ll = tmp; } else { switch (n) { case 80: From patchwork Mon Feb 17 19:30:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 865941 Delivered-To: patch@linaro.org Received: by 2002:a5d:64e6:0:b0:38f:210b:807b with SMTP id g6csp1251459wri; Mon, 17 Feb 2025 11:31:15 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUKJmJ2bVkssZyCMXM0MCWd0ZAzrjVF0XWjFHToxFkGjaHv0iKjTFqzEsqV9hFQuFjvqtt1sw==@linaro.org X-Google-Smtp-Source: AGHT+IHESbFOZNtiVzcotJ9qnptK/36MYxLC/hxJwBCjeMDwBvyWTyqdwh76iELGHps4hDQ+nz+c X-Received: by 2002:a05:622a:118d:b0:471:d334:b6de with SMTP id d75a77b69052e-471dbeb9e5fmr158885181cf.49.1739820675260; Mon, 17 Feb 2025 11:31:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1739820675; cv=none; d=google.com; s=arc-20240605; b=RoNkQeE8Zjm8o0+8hYCvkgVL2g2HSDHtP86cL3FWFP0O3T9ki17D09fT3v6jauPxwz KGY0TX6vpTTO6JfIGsWjtbPbBBvGVyU48eXqrLpmjG4dz6f15t2tJgpgmZ/uxEDXdHg7 3f/T1bwsjPZRqNqfBlrAdVRx5Yiow/IPIiGq6V4SGn3Tqa33p48HWaBBKNUeyu8a30TJ NmuTLusBpl3tAk+4U/lKkFryQjMklEC8SOQ2YPuxWl32So8eQL/GU+DGf1+vGMRqKjl5 Bc6ZJ/EZ1SM7/SAY4CInmEBAu8HCJffXjNod2Wq+tE7nPIz1LGT8mkrS6lwXxFxYXfbG rhag== 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=jFWOgm7cwZ/f43Ltoxf8K/SGg9Wf6xR2m2O9XTNwnuM=; fh=BCs+wvEZt5rkBhfX27gsniXySkweGfmkv5PoYOXC8d8=; b=WDvPKFixrTTSODHM70dDjoalp8GoNhZAycik2u1k0Pa48PkSoNHKl7+D6ivdwLyVkX UrajqpYX7bc8uaESL27Z/9i0sjAOprTLDP3cwuzuYqNiESJrdl9cs/oH7HpeKFqRZw0f mYs2VwDuwdOfnLDEKYkYQbYcsap6dDgMa8RBCT3xq5PQXu/pJU0FLMTS5V/LUdoylLrd PNpJw7dCTWdoHM5nTbfYmcczJ4WCUIdi/7TPEdaSkmdcMcHoRyD4dTILoW/8pzKYPvkm sQnQb62vwq6zYf3SrT1OBC6EyKakrac8uN/b/sBOVjCC3FRhg3dT4OwamsQxFNKyBVxa WUDA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=py3+qOk7; 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; 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 d75a77b69052e-471c2b48befsi92811401cf.457.2025.02.17.11.31.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Feb 2025 11:31:15 -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=py3+qOk7; 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; 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 1tk6ph-0002Wo-Mo; Mon, 17 Feb 2025 14:31:10 -0500 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 1tk6pC-0001zW-4l for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:45 -0500 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tk6p7-0008RJ-WA for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:37 -0500 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-2210d92292eso55117045ad.1 for ; Mon, 17 Feb 2025 11:30:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739820631; x=1740425431; 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=jFWOgm7cwZ/f43Ltoxf8K/SGg9Wf6xR2m2O9XTNwnuM=; b=py3+qOk7syXPF+Vx8Yd9T7Jc2VAx+HQzwY9K9G+ICJYyFYTI3MSoY0231at7mUpISc zoAST2QxxB2Pfb5tUY63OhibXzvA7/4P7+trJXUiD4jDhvWcBiqlR82Uaxub3MW8ni+v QBcSQCW4R10lo7daNCSJs6a2P2VIVYgZmnZApIuZvIpZl0AEv9w+8tflEHoiEG8JcJah O/um5DdoCSxPguxUr7bLTqUFjxYxQvjyr8JEZb9x5DO/T5SQ0B3DaroparLMvb/8z7hY VKkkdtEK9OCktClLCu0GPet9/yLByLSQ1onlxDvd+knpDG+lMDU6TRGlFWb0MsDvpm4F ts8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739820631; x=1740425431; 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=jFWOgm7cwZ/f43Ltoxf8K/SGg9Wf6xR2m2O9XTNwnuM=; b=SFjRj9WRU/dmciCUsPwj/4DQBGtsx7mi5AUHpvRUIQXfGJcxjIw+k8IvwLxkW56CLY pVowv36C9SNPI/bRf+qxCB6WcLBL0vC4KJiYBteYGlBFqDW2IeGzIQd9wTtkwz9yMkJA QGzP/5HF9I2Q373AGrSFT1tSc0S7Tiq3/EnM9RELLUBoaYE1JPl/8eT2Lommike4VCAX 3B/+qbiUu8g26+xqbDZ6jhYsWGfDl5ChiYgCLWA/ipXttIzaLiNHYjcM1KK6OkERhjTI r6U7B5tKxAjPKUUSHAuTAv7uLXJVDURlEaJlq2OS5kN095vhrertO11sb1f2TEeqmOZp 2c7g== X-Gm-Message-State: AOJu0YyRO/VIOPfROQvRx5MToSLfoo07Bb3zkVZXmGXBq3Erbi5oI07X F8T3cBmB3rwdFvzs3k+6495in3fkK5IOlRbckJSN9L9gf8fq3j4/FgihC0H3cXnx2dmNrZzuWtn + X-Gm-Gg: ASbGnctMcxeu1hdJPJ7+xz6s+hhvLFxlKDhvwyHnPyb72x6vaWzvF16vMoqvLt/Ll+I VIlhjp4Ttuzdq2opdX0Ere/XcLHvXJRE2u+xjh/PnxjeS7/BBTe3aa9ctp3IgW2PXxdPWeYhaH7 3YgAkFPsNxNgezP8VyhbbiJJ9WqnI1b/YfeZdmk2kx4Jb6iFvDOKoqcYUPRX9nJ7iVqVxeDhk56 rik1iZ1GLM0EdrKU4HYqr2N8t4ExwdP+ApiXNkLhRMhs4+EGElL7iezBLLtUNAZOIh3fZ2P6/Sa kQqd1XEsOnzFC2xqKnOYpq3gIRGZlcrHD2o3ozVaJb+qYgM= X-Received: by 2002:a05:6a21:999e:b0:1ee:3b8e:3439 with SMTP id adf61e73a8af0-1ee8cbe597cmr20099790637.38.1739820631380; Mon, 17 Feb 2025 11:30:31 -0800 (PST) Received: from stoup.. (71-212-39-66.tukw.qwest.net. [71.212.39.66]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7326a38ff76sm4347164b3a.160.2025.02.17.11.30.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2025 11:30:31 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Artyom Tarasenko Subject: [PULL v2 25/27] target/sparc: fake UltraSPARC T1 PCR and PIC registers Date: Mon, 17 Feb 2025 11:30:06 -0800 Message-ID: <20250217193009.2873875-26-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250217193009.2873875-1-richard.henderson@linaro.org> References: <20250217193009.2873875-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.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: Artyom Tarasenko Fake access to PCR Performance Control Register and PIC Performance Instrumentation Counter. Ignore writes in privileged mode, and return 0 on reads. This allows booting Tribblix, MilaX and v9os under Niagara target. Signed-off-by: Artyom Tarasenko Reviewed-by: Richard Henderson Signed-off-by: Richard Henderson Message-ID: <20250209211248.50383-1-atar4qemu@gmail.com> --- target/sparc/translate.c | 19 +++++++++++++++++++ target/sparc/insns.decode | 7 ++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 7e5c7351cb..bfe63649db 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -2882,6 +2882,14 @@ static TCGv do_rd_leon3_config(DisasContext *dc, TCGv dst) TRANS(RDASR17, ASR17, do_rd_special, true, a->rd, do_rd_leon3_config) +static TCGv do_rdpic(DisasContext *dc, TCGv dst) +{ + return tcg_constant_tl(0); +} + +TRANS(RDPIC, HYPV, do_rd_special, supervisor(dc), a->rd, do_rdpic) + + static TCGv do_rdccr(DisasContext *dc, TCGv dst) { gen_helper_rdccr(dst, tcg_env); @@ -3315,6 +3323,17 @@ static void do_wrfprs(DisasContext *dc, TCGv src) TRANS(WRFPRS, 64, do_wr_special, a, true, do_wrfprs) +static bool do_priv_nop(DisasContext *dc, bool priv) +{ + if (!priv) { + return raise_priv(dc); + } + return advance_pc(dc); +} + +TRANS(WRPCR, HYPV, do_priv_nop, supervisor(dc)) +TRANS(WRPIC, HYPV, do_priv_nop, supervisor(dc)) + static void do_wrgsr(DisasContext *dc, TCGv src) { gen_trap_ifnofpu(dc); diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index cfcdf6690e..9e39d23273 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -96,7 +96,10 @@ CALL 01 i:s30 RDTICK 10 rd:5 101000 00100 0 0000000000000 RDPC 10 rd:5 101000 00101 0 0000000000000 RDFPRS 10 rd:5 101000 00110 0 0000000000000 - RDASR17 10 rd:5 101000 10001 0 0000000000000 + { + RDASR17 10 rd:5 101000 10001 0 0000000000000 + RDPIC 10 rd:5 101000 10001 0 0000000000000 + } RDGSR 10 rd:5 101000 10011 0 0000000000000 RDSOFTINT 10 rd:5 101000 10110 0 0000000000000 RDTICK_CMPR 10 rd:5 101000 10111 0 0000000000000 @@ -114,6 +117,8 @@ CALL 01 i:s30 WRCCR 10 00010 110000 ..... . ............. @n_r_ri WRASI 10 00011 110000 ..... . ............. @n_r_ri WRFPRS 10 00110 110000 ..... . ............. @n_r_ri + WRPCR 10 10000 110000 01000 0 0000000000000 + WRPIC 10 10001 110000 01000 0 0000000000000 { WRGSR 10 10011 110000 ..... . ............. @n_r_ri WRPOWERDOWN 10 10011 110000 ..... . ............. @n_r_ri From patchwork Mon Feb 17 19:30:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 865949 Delivered-To: patch@linaro.org Received: by 2002:a5d:64e6:0:b0:38f:210b:807b with SMTP id g6csp1252110wri; Mon, 17 Feb 2025 11:32:56 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCURhw5+5+/MDy/iWZAc5XGoFkg/8YPe3d9+UrXqtZmclm63LSrUxrWY8BMs068CwQ2DtopebA==@linaro.org X-Google-Smtp-Source: AGHT+IG3WXGMQaADaNVMTj7FNWZ5tGIsSGe4c/L6OEvE/9OYw6ElMGCUUsfiO1g3NwcoD/hO0P5w X-Received: by 2002:a05:620a:1790:b0:7b6:cb3c:cb81 with SMTP id af79cd13be357-7c07a8ea722mr2691829585a.18.1739820776105; Mon, 17 Feb 2025 11:32:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1739820776; cv=none; d=google.com; s=arc-20240605; b=gWJBCOmSghnCQw0uhFP78ldW/F4pq1CsWTcRnqSn0LnMsdALa88Z935oWKMlkjWid0 qtkr+7K8G4q6aBf3HFa2InI/Og1NCZExkibmf+KfmBsRFNCJOpS+Z/6fQ2A/OQSBSijN nZIZ23YjZW6ypW2uMDpwQQxh60SKhzpXdt5SPEynh4LRtf1w7xbcVAI8h4XPRRcb5a/5 gSRavC1wHmlFub4yr0Dmlfg8AzKBEzmUFUzPdPL1BR6bkslAtzY0z3OvT3UqwHSow/qr XCgfH/p6A1SEe6jR+x/miRhByi3veRBxYyJhq7XxXUO7H8iiU3eYhgHBZsCNqmcBoV7m Dz9g== 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=d1zb22AyjlqmHw+UQQqRIL7eiAR7k2i23HZM7g6s8GU=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=lu37zzTe7kxEBYfAkn7DKAs5ibASTunhlmV8tLt4yig968Cv0SJrCxu8SxOZI2rxBD 7dUnkPFQsqsFcypRl03Nt8Ki1LbFiT7WkDf/DpzV7lBbCGBy936qfraJpO9ueucDb0q/ NUifi1UZrJAbaUCj9c07oJq/i4bEyCE1g7CmWKGyvg4Y01wm1gAFD3j9g/uekUjfm0ZP P74QfbUBOkGpOQBxaK9+w/AcTWCPOPmoKoouvwZXFTXUqNmk3SekPoX3Rozl+Z5Aor1B LHPOTi/9JBcvCQq3OQkOPxj0yOzz7kxSJfY/5w7gpuzoiiPOOpZmrwRczpG0KY8TDBBM 1iLQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=OquQvsvn; 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; dara=fail 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-7c0a170cb95si202057785a.422.2025.02.17.11.32.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Feb 2025 11:32: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=fail header.i=@linaro.org header.s=google header.b=OquQvsvn; 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; dara=fail 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 1tk6pl-0002mx-8R; Mon, 17 Feb 2025 14:31:13 -0500 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 1tk6pC-0001zV-4u for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:45 -0500 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tk6p8-0008RT-02 for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:37 -0500 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-220dc3831e3so66724015ad.0 for ; Mon, 17 Feb 2025 11:30:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739820632; x=1740425432; 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=d1zb22AyjlqmHw+UQQqRIL7eiAR7k2i23HZM7g6s8GU=; b=OquQvsvn/+GYRvFyn+egjNMJQeba5IZ6E+iNUEV7zHNkXK1898FNytiOfQABDaePZD tlXpKYaJL9zUNMuRzKVLyC1MJ754Mi7H1a/bPANBtwdZh8rE5MMQrth+i1HqPRAbs8m8 YX05OX6gE7Ghzxm6vcP2hJBOWxV8teJnSsh4+1EGZ74D7uKJvdNSkJfCSyREwSf5EiaK pbOxI08P0+Frw0B00zS/pituRRaCJxBFdB8NOknsPDyP8k5H1n3/VLvNxm5HgGuLTGtD TA59lNV7T0XZcutfgBk2Mb3Ci7pub/y2IDdLxlcM1O+GtzPt5cvNRfVHU8QX8krW+Di0 YuIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739820632; x=1740425432; 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=d1zb22AyjlqmHw+UQQqRIL7eiAR7k2i23HZM7g6s8GU=; b=wwZETN/j+ug7iV6xPYcnOM/9EdW9yizdRGqMLeTNa4iuPdblCTTNCI3541F9VwsFZT tULh6FYFPYZljCGzvvgG4PAecMT6FA1aTcyd7I3vM2MgchLewc5ACbwndGB8qZb09xrC 2oBCNzQfJxy+bWo4KQsSRGkjLbDs37y/ITnMsMac5Xvpjs/708z70aG8Prt9a7VF4WWP LxoNO2psvPfYTAuy7LnG1PskA3R0SCy6axKxQIkpl0qCI5ytbyM4RC1q9Bb3RGmWrIEd Ytdv8YQX7GB4PwuiLdeE1EP52+u7PpLQURjgY1bZrcGp7BAghnr3O27s9E7mF7Yf4C8+ IT3A== X-Gm-Message-State: AOJu0YwBSGm2+HmSfYd35CJSgl7CMOenFE3gQ0+V7LGpFYs6nmak4xPE omzAlDJzuLNPSTpoMfnHNYVRK+1UajOGbIiXHFY9WopFfrspSTvTTL7/C2BsSwPAEHq8f0/Lpvv 9 X-Gm-Gg: ASbGncttZC9/HFdssXLDwTZp0OPHL7OB05WfgApn12Uz2z9pUBzIuhU3TTod3KHb+Yx yM3b8JwRQZobIYxkfpTFokpTZGwUplNB5AZZGDaHPWrq7QbNbrke3rwbmL3ZE/idLg5+P5iscUs b4S3EL8XnDM4fN77aRLTLjmPn859/Y9FWqLHgKBiXaVSotZ+papkGvArQ5ie3ypCXMAi4L2A9sQ 6qiGzZ9RKO8TO+t4SLUyjqsvTK3Nk76o3PBKlSZfHG5zsc/MCQppO/kQypwoHVGIS561EvNnNmz iz2Ttv5oNweDuCHF7CLDNVx2GWbYxy26bxCF7EVW/BZuvyo= X-Received: by 2002:a05:6a00:4fd2:b0:730:949d:2d52 with SMTP id d2e1a72fcca58-73262158ademr17638718b3a.3.1739820631952; Mon, 17 Feb 2025 11:30:31 -0800 (PST) Received: from stoup.. (71-212-39-66.tukw.qwest.net. [71.212.39.66]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7326a38ff76sm4347164b3a.160.2025.02.17.11.30.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2025 11:30:31 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL v2 26/27] tcg/i386: Use tcg_{high, unsigned}_cond in tcg_out_brcond2 Date: Mon, 17 Feb 2025 11:30:07 -0800 Message-ID: <20250217193009.2873875-27-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250217193009.2873875-1-richard.henderson@linaro.org> References: <20250217193009.2873875-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.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 Eliminate code repetition by using the appropriate helpers. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/i386/tcg-target.c.inc | 65 +++++---------------------------------- 1 file changed, 8 insertions(+), 57 deletions(-) diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc index cfea4c496d..33d303a123 100644 --- a/tcg/i386/tcg-target.c.inc +++ b/tcg/i386/tcg-target.c.inc @@ -1658,6 +1658,7 @@ static void tcg_out_brcond2(TCGContext *s, const TCGArg *args, tcg_out_brcond(s, 0, cond, args[1], args[3], const_args[3], label_this, small); break; + case TCG_COND_NE: case TCG_COND_TSTNE: tcg_out_brcond(s, 0, cond, args[0], args[2], const_args[2], @@ -1665,64 +1666,14 @@ static void tcg_out_brcond2(TCGContext *s, const TCGArg *args, tcg_out_brcond(s, 0, cond, args[1], args[3], const_args[3], label_this, small); break; - case TCG_COND_LT: - tcg_out_brcond(s, 0, TCG_COND_LT, args[1], args[3], const_args[3], - label_this, small); - tcg_out_jxx(s, JCC_JNE, label_next, 1); - tcg_out_brcond(s, 0, TCG_COND_LTU, args[0], args[2], const_args[2], - label_this, small); - break; - case TCG_COND_LE: - tcg_out_brcond(s, 0, TCG_COND_LT, args[1], args[3], const_args[3], - label_this, small); - tcg_out_jxx(s, JCC_JNE, label_next, 1); - tcg_out_brcond(s, 0, TCG_COND_LEU, args[0], args[2], const_args[2], - label_this, small); - break; - case TCG_COND_GT: - tcg_out_brcond(s, 0, TCG_COND_GT, args[1], args[3], const_args[3], - label_this, small); - tcg_out_jxx(s, JCC_JNE, label_next, 1); - tcg_out_brcond(s, 0, TCG_COND_GTU, args[0], args[2], const_args[2], - label_this, small); - break; - case TCG_COND_GE: - tcg_out_brcond(s, 0, TCG_COND_GT, args[1], args[3], const_args[3], - label_this, small); - tcg_out_jxx(s, JCC_JNE, label_next, 1); - tcg_out_brcond(s, 0, TCG_COND_GEU, args[0], args[2], const_args[2], - label_this, small); - break; - case TCG_COND_LTU: - tcg_out_brcond(s, 0, TCG_COND_LTU, args[1], args[3], const_args[3], - label_this, small); - tcg_out_jxx(s, JCC_JNE, label_next, 1); - tcg_out_brcond(s, 0, TCG_COND_LTU, args[0], args[2], const_args[2], - label_this, small); - break; - case TCG_COND_LEU: - tcg_out_brcond(s, 0, TCG_COND_LTU, args[1], args[3], const_args[3], - label_this, small); - tcg_out_jxx(s, JCC_JNE, label_next, 1); - tcg_out_brcond(s, 0, TCG_COND_LEU, args[0], args[2], const_args[2], - label_this, small); - break; - case TCG_COND_GTU: - tcg_out_brcond(s, 0, TCG_COND_GTU, args[1], args[3], const_args[3], - label_this, small); - tcg_out_jxx(s, JCC_JNE, label_next, 1); - tcg_out_brcond(s, 0, TCG_COND_GTU, args[0], args[2], const_args[2], - label_this, small); - break; - case TCG_COND_GEU: - tcg_out_brcond(s, 0, TCG_COND_GTU, args[1], args[3], const_args[3], - label_this, small); - tcg_out_jxx(s, JCC_JNE, label_next, 1); - tcg_out_brcond(s, 0, TCG_COND_GEU, args[0], args[2], const_args[2], - label_this, small); - break; + default: - g_assert_not_reached(); + tcg_out_brcond(s, 0, tcg_high_cond(cond), args[1], + args[3], const_args[3], label_this, small); + tcg_out_jxx(s, JCC_JNE, label_next, 1); + tcg_out_brcond(s, 0, tcg_unsigned_cond(cond), args[0], + args[2], const_args[2], label_this, small); + break; } tcg_out_label(s, label_next); } From patchwork Mon Feb 17 19:30:08 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 865966 Delivered-To: patch@linaro.org Received: by 2002:a5d:64e6:0:b0:38f:210b:807b with SMTP id g6csp1253009wri; Mon, 17 Feb 2025 11:35:38 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVV4Kr5NymscMo194AsIVhNieqz5PI8G92xW+lbcNjimIBcxTGnxWMHRoq1pp7UkyhrjlvUXg==@linaro.org X-Google-Smtp-Source: AGHT+IHZ3BYULw+zvgTDTrcSENLMkP2Ss6chYnZOFFtnzvjON3d9UtY961Qm6APQcp0Ywar0kRv6 X-Received: by 2002:ad4:5d48:0:b0:6e4:2bc8:fb79 with SMTP id 6a1803df08f44-6e66ccda36amr147430716d6.21.1739820938735; Mon, 17 Feb 2025 11:35:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1739820938; cv=none; d=google.com; s=arc-20240605; b=JEESUvMxCu6YpIcFQwm54wkAVeTA4uOiTCqKhGyokspVOZbUcaOv7DkueVJJU0Tv0z OF9lcKSJId9mMC3XYvNhJHy52aCw+N2jz5F4x+Bi1ZOr4Ay6tn0RL0IkKY32Mpkl/oCT iOB9ELXvNZLvUwQwDEpWjQYmmG0LLssheXjrt5e9Z+H/6wZZB8pPZc0u35TYBbNMwm9q i4ET+MnytaBEr16chIUa3FD2jJ1pFNAL07KYrKSYNJJ9hiKzfOPWCrsmGAm0paw38yzQ 1gbo8CSvb5c7P7z87jw24XL7SLbHChPamEfuZZWtQrELr9IjByjaFaF5arL8QDV+u8T5 xOGQ== 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=S5Lf3oD5xg4WJC6myt6Lc6+y6lzumg0EZEkqeBcijFs=; fh=hCxFjoGWrGrRQspmq/CLS+yuX8/gGHZ6aT42c5brLWg=; b=MXkabHcGZlpJN+KMvEeP7MVhobDRA48UGXuAY/GWsO0ZwHMF6PGMOghB29m8PzpDKi VwAfptg4bUW2k2+YgYPaWLIL8fDELEZB6UU8u3Dtz39rHcjjIpa4ZFD/nUFLAeO3Quu5 SJmJjDbPyvyMF5BP6UvLS2Tc7CoDpktgl0es3m/wTClu6U2L5ULziAxt4eEg1Wx2f+3L i/UtD3qSV+VUsvHydSNBqmZ7ebi+q0sGiS436rJjZ28RwNai9o/B5pw3RJe6dFUJDW3F Q+rryNBRYhvsF54fm2yp3vVdyIzbDpCa3LMfU5QbORQMWScoQx/Bi0g08DoqtQVJ700x ye/w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=rb7FpNcY; 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; dara=fail 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 6a1803df08f44-6e65d9d14dfsi91904966d6.493.2025.02.17.11.35.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Feb 2025 11:35: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=fail header.i=@linaro.org header.s=google header.b=rb7FpNcY; 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; dara=fail 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 1tk6ps-000383-8m; Mon, 17 Feb 2025 14:31:20 -0500 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 1tk6pC-0001zX-6h for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:45 -0500 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tk6p8-0008Rc-0F for qemu-devel@nongnu.org; Mon, 17 Feb 2025 14:30:37 -0500 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-220d39a5627so67734675ad.1 for ; Mon, 17 Feb 2025 11:30:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739820632; x=1740425432; 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=S5Lf3oD5xg4WJC6myt6Lc6+y6lzumg0EZEkqeBcijFs=; b=rb7FpNcYtK//suiSDD6bUBOm/+sk67ZEOI2oNbFllzBlD9qrbUfEy7sQ+v7K/+pqZo 4fAs0zyDcKS54mXtGy2cV5r3EPcvOldnUcYdO6QIyf3xFudNTcgwJCyHBEl/ASJ4/mSx UKAdqWddAcdbyB2yYOVdWg/Usm+QoIMMHr1BI87TClaJwCeWTAw6pmmjAkeWJSvMZt7o 67GEUL+Pa8urY6+lEdEwfNd8anCbfe3K3k+7RAmtahW1cUlGEhq4dpNRS02LOkYcfPjD ngTAaMMSY2zrYRMQ765bcgZxQNPPsYOG/IFoNdmO3kgkMkW+5csy/vlXoBjMHcM6wzPT Tojw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739820632; x=1740425432; 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=S5Lf3oD5xg4WJC6myt6Lc6+y6lzumg0EZEkqeBcijFs=; b=CvK6xxrV74eeQ10bYANQGi2SgnxIB3I58L6FEQIe6UXCwd4nUUi9ZqalPypp+8/w1H kpuxNB0AQzeIgtUdQ27XgRMtw/ynZ2Nw7SW9Ohnqpjan8T9fDBtZrChVElUbxfQFaC/H QS6PtsINmRqEpqoNlM3kzm+HZ/KVIR0J4a2pIxqQLJcI0A9Zjd47Ju75+KOLN0OnCwp4 Ye/DpBs1KIcw3w/zaETf3yXhnMIwj3hzCshrlfN31IP/EDmxux2CJ0+PHmCaaYdpb+Oi A6s0Ex8w7rkCxkLL2CFCtRIFr9Jm2NfmI2Re6xSYFaCUkLWIM0BasH8UqgXaHFENasVM Yvkg== X-Gm-Message-State: AOJu0YxbSEEKfkvEVsOVSl4FyuOQLOOPOnX4TJeMoBjmIFQrUTcZ1Noy BslQx8DpRh6/lsjFku119zrMEc8AVuJba9uxqqhkSkePImgUIpkCOxs0z+xOkExWXM7sEmdFdBh m X-Gm-Gg: ASbGncv7hSbpxztYK3+yS/Lik4beoDawtBSj3t229/HADodLsPq/zFV3pz8X5o/+58o PeBOe60L84QQ5/+TKxr0f7q6tfzyD6vkYbBB7jCGREaq2WS0gRziRX0gp/BLV07u/7CV6j7IRJq z6IMYLAB9JYnR2i3YBIwPQg1yxIwvWADtiAWLrTWD1lgN1o5G2vXBHXzJFUZc78KVJCg8uaXHDr ib1+Yd31ZbvWj1cfYKfifdFtVhvnBQbB1xDq3Py9jpvorCmXWZ8Wgy0mkgnngoM4NyHlTTXR50g IoI/ZllAtA1ORtgtxAupj8UZJTah5ZiLbcV2KfAr9IjDs4g= X-Received: by 2002:a05:6a00:3c84:b0:730:98ef:30b5 with SMTP id d2e1a72fcca58-732617741a4mr14657672b3a.5.1739820632612; Mon, 17 Feb 2025 11:30:32 -0800 (PST) Received: from stoup.. (71-212-39-66.tukw.qwest.net. [71.212.39.66]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7326a38ff76sm4347164b3a.160.2025.02.17.11.30.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2025 11:30:32 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Alistair Francis , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= Subject: [PULL v2 27/27] tcg: Remove TCG_TARGET_HAS_{br, set}cond2 from riscv and loongarch64 Date: Mon, 17 Feb 2025 11:30:08 -0800 Message-ID: <20250217193009.2873875-28-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250217193009.2873875-1-richard.henderson@linaro.org> References: <20250217193009.2873875-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.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 These defines never should have been added as they were never used. Only 32-bit hosts may have these opcodes and they have them unconditionally. Fixes: 6cb14e4de29 ("tcg/loongarch64: Add the tcg-target.h file") Fixes: fb1f70f3685 ("tcg/riscv: Add the tcg-target.h file") Acked-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target-has.h | 2 -- tcg/riscv/tcg-target-has.h | 2 -- 2 files changed, 4 deletions(-) diff --git a/tcg/loongarch64/tcg-target-has.h b/tcg/loongarch64/tcg-target-has.h index ac88522eef..188b00799f 100644 --- a/tcg/loongarch64/tcg-target-has.h +++ b/tcg/loongarch64/tcg-target-has.h @@ -37,8 +37,6 @@ #define TCG_TARGET_HAS_clz_i32 1 #define TCG_TARGET_HAS_ctz_i32 1 #define TCG_TARGET_HAS_ctpop_i32 0 -#define TCG_TARGET_HAS_brcond2 0 -#define TCG_TARGET_HAS_setcond2 0 #define TCG_TARGET_HAS_qemu_st8_i32 0 /* 64-bit operations */ diff --git a/tcg/riscv/tcg-target-has.h b/tcg/riscv/tcg-target-has.h index f35f9b31f5..98081084f2 100644 --- a/tcg/riscv/tcg-target-has.h +++ b/tcg/riscv/tcg-target-has.h @@ -37,8 +37,6 @@ #define TCG_TARGET_HAS_clz_i32 (cpuinfo & CPUINFO_ZBB) #define TCG_TARGET_HAS_ctz_i32 (cpuinfo & CPUINFO_ZBB) #define TCG_TARGET_HAS_ctpop_i32 (cpuinfo & CPUINFO_ZBB) -#define TCG_TARGET_HAS_brcond2 1 -#define TCG_TARGET_HAS_setcond2 1 #define TCG_TARGET_HAS_qemu_st8_i32 0 #define TCG_TARGET_HAS_negsetcond_i64 1