Message ID | 20250117182456.2077110-65-richard.henderson@linaro.org |
---|---|
State | New |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp843403wrb; Fri, 17 Jan 2025 10:29:58 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUX4xV6FHpH+EDlillDbdwWzPPPqZjzNkFVwKTt1tt9LRuKe5EILKK3Pc5TU17kBT1YRIr1zw==@linaro.org X-Google-Smtp-Source: AGHT+IEnbFh1WUSwus/Kws112bxfR8mvJatwsdDTOjxFiGlyw/7WNk+f987nB9R7rZiNeAg+4Sbk X-Received: by 2002:a05:620a:1793:b0:7bd:bafc:32ad with SMTP id af79cd13be357-7be6320c3a3mr572860185a.34.1737138598350; Fri, 17 Jan 2025 10:29:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138598; cv=none; d=google.com; s=arc-20240605; b=LlTt8K1USUi88507tgBDPXuyxq46YSKfr2OBOuwxKNOB70d/1Zi+v7eGmHYDCzHSiZ WnPUHW0o6HSnRm6HBasnbPBmLt40Mo5V4YojLhkrmgZd9l2Ofa5bqTUu7NmC4rhROdy1 PkNZMKusQo3fbLMfLJTbmIQao3yzo0oB35uObuevYKnH/qFiJ5gfbIwYeLEyZyOPgioL fpCg6IwLOVXhcXx2HEIx3rgKp2Ngm74CkSNuSjqy6npS7vGlrnYQhHUR7Vlmz30AMqb3 gWVcagwtcyMm+wHvYc9tLfdeydAppgQvVHRCuZhCo0pwzuKS3vdxBHg7LjXpIlOyEQzA QoBA== 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=crcvNbjkly9KMWSjp1gKNNJHKJypn6AEpvxWtvO08G0=; fh=OD2lp1dfJFstOGLpXnIzbHomhWx3nF/XGvY6bQVU7c8=; b=LYd6NG7IGRixCmjnwIjPE0cU/6zKmB/ZRKtpHIbS2L7lDXln0VCYP3fY2RsD2TK+om 6WJCYBu7lEHrellzK1oB/J2BOfgG6l6ZtRW4S91ptuOxbIuU6zxZXH2ea5Mx2UUzKk4R gQxgqSsa4PJmt8QSzZBLqMtH2npHoqg/55nckIZ1Iq8WLEsK4G2SrYMucbfxEenLCCT4 4RZGcG/RwRa+2Hj3L/BIAFGPR5bTQI47CGzuiknLa513fEmIhkY7SzmVwcdTPjQetdsU iLjT6osENkwgTmpiuTjcsqJgBQhmV89ShRvG68wchb/eSwcQkmZbliFu21qMhJUO9Dpq EiOg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=imTuE0jf; 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: <qemu-devel-bounces+patch=linaro.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7be614f569fsi319947385a.627.2025.01.17.10.29.58 for <patch@linaro.org> (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:29: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=imTuE0jf; 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 <qemu-devel-bounces@nongnu.org>) id 1tYr69-0007rj-L3; Fri, 17 Jan 2025 13:29:37 -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 <richard.henderson@linaro.org>) id 1tYr5o-00063i-3M for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:29:16 -0500 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <richard.henderson@linaro.org>) id 1tYr5l-0000KO-HP for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:29:15 -0500 Received: by mail-pj1-x1030.google.com with SMTP id 98e67ed59e1d1-2f43d17b0e3so4449007a91.0 for <qemu-devel@nongnu.org>; Fri, 17 Jan 2025 10:29:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138552; x=1737743352; 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=crcvNbjkly9KMWSjp1gKNNJHKJypn6AEpvxWtvO08G0=; b=imTuE0jfSTcBSVkl2So3TvmA8VJJtwYN0TVwv9FcJpnqyTi2ElD/tbTjenin84aCTY opYcamu9HphkRStRzknwd3xYnuqOF092EFKMwXBKJKQZKmzu4F4h5hfOnOU4Tb4dg/9g X0VFBriayBzNyzyETDmI5VGErHLTlxwzCKEZsyMmzzwtccGNUa8aCZcA0SvdzE5Azhmm ktoLzSY5KLuGbUFPBjyL5cuPj6J3d8VuTRd8P7TWAgrDHSkwY1Ztw3HRgaJUh8QZ5icB K26fWZYnAR1cMCZ/s8pYfupUMIMvMFR7wyHN/1YQoPb54omqQzxCH09MhHBnfn6Bt4h2 mIkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138552; x=1737743352; 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=crcvNbjkly9KMWSjp1gKNNJHKJypn6AEpvxWtvO08G0=; b=mDqrVllPtWnuusXIE5i6Fqy0rrufSu6KL/Sv4kaWRfPe6/5WSHmyPwAMkPkuQBHBga NprTGWi9460iB0ItkNfqN7Ubir9koP7ZyaNLf22yDXJkkzYxDvkjP0hCpI6qDe0ZqmKB KTBLo9zUiWUVgvGMuduk9NGlvYfGTvpHnQkYIRxkxfGhRLMIY/CkFGFlNpgbNe4ElSNi hOvGxSRax9iau0JwjpF/8qDVv0URmhOgjPcqbkJ9VEYVn6nEnjgRSgf1QbRUi2odmyLP y7vL3o7BAnrlI6wyldLS2UCzs9BWOEClcIbBJjzC7vtLqUPaUUA+6NsSO8wqx5zGHf2f bUxw== X-Gm-Message-State: AOJu0YzycEMp4ntmpsLVI0AUVhxep4HVyL1P5kezAeSH7reyi84+57F9 WtCTOGVHb1bdf62L61ibUlQhPO9VSyeN2adbwedgCQo3D9q/lcYzum2lvvwPS8xh6QTTah3yCQK i X-Gm-Gg: ASbGncu3ZMwSQAHPIp/uqBoILLgHm/z5UZEBWhV/5T9wgIhh/mSidaBgnjTPi5lElno ejKirFILFKyNwqzPJ5A9D+2+jeLcn7upfA16ByafuhabcE8QZrZaZbt2UUrBHUsI6ULvQDIcPum PoysxDSkeHAIKal68J7Q+n9XyJeLr4gkLD4qXPzPwAE+tAto4JE9+O8vLxm25JYLkU0Oh1lhaoz dy/7VhQaKDAqkWq401nvt1hvnq/HIy9G+mtMs4vt0ijjx3SStMzpuV89nkYPVbSABFdejUQ0+lR RshvX0VqRKUYKJc= X-Received: by 2002:a17:90b:53c6:b0:2ee:4982:e59f with SMTP id 98e67ed59e1d1-2f782cbfa4cmr5914747a91.17.1737138551986; Fri, 17 Jan 2025 10:29:11 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f77629bf96sm2614105a91.36.2025.01.17.10.29.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:29:11 -0800 (PST) From: Richard Henderson <richard.henderson@linaro.org> To: qemu-devel@nongnu.org Cc: Alistair Francis <alistair.francis@wdc.com> Subject: [PULL 64/68] tcg/riscv: Use BEXTI for single-bit extractions Date: Fri, 17 Jan 2025 10:24:52 -0800 Message-ID: <20250117182456.2077110-65-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::1030; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1030.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org |
Series |
[PULL,01/68] disas/riscv: Guard dec->cfg dereference for host disassemble
|
expand
|
diff --git a/tcg/riscv/tcg-target-has.h b/tcg/riscv/tcg-target-has.h index 0f9cc04f8c..f35f9b31f5 100644 --- a/tcg/riscv/tcg-target-has.h +++ b/tcg/riscv/tcg-target-has.h @@ -110,7 +110,13 @@ tcg_target_extract_valid(TCGType type, unsigned ofs, unsigned len) /* ofs > 0 uses SRLIW; ofs == 0 uses add.uw. */ return ofs || (cpuinfo & CPUINFO_ZBA); } - return (cpuinfo & CPUINFO_ZBB) && ofs == 0 && len == 16; + switch (len) { + case 1: + return (cpuinfo & CPUINFO_ZBS) && ofs != 0; + case 16: + return (cpuinfo & CPUINFO_ZBB) && ofs == 0; + } + return false; } #define TCG_TARGET_extract_valid tcg_target_extract_valid diff --git a/tcg/riscv/tcg-target.c.inc b/tcg/riscv/tcg-target.c.inc index 4f6e18f59e..61dc310c1a 100644 --- a/tcg/riscv/tcg-target.c.inc +++ b/tcg/riscv/tcg-target.c.inc @@ -163,6 +163,7 @@ typedef enum { OPC_ANDI = 0x7013, OPC_AUIPC = 0x17, OPC_BEQ = 0x63, + OPC_BEXTI = 0x48005013, OPC_BGE = 0x5063, OPC_BGEU = 0x7063, OPC_BLT = 0x4063, @@ -2354,9 +2355,15 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, } /* FALLTHRU */ case INDEX_op_extract_i32: - if (a2 == 0 && args[3] == 16) { + switch (args[3]) { + case 1: + tcg_out_opc_imm(s, OPC_BEXTI, a0, a1, a2); + break; + case 16: + tcg_debug_assert(a2 == 0); tcg_out_ext16u(s, a0, a1); - } else { + break; + default: g_assert_not_reached(); } break;