From patchwork Fri Dec 13 17:31:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850131 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1637658wry; Fri, 13 Dec 2024 09:33:21 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWfs1iVWPmzmrMgqyieaOcvf3/l+wUt+BQUIku2glotAna9gGKG/Btrw8drtOFSpGMSU5JjYg==@linaro.org X-Google-Smtp-Source: AGHT+IHAk6xMGj69yuIrB9i7nWjL1RnCPjA+RkUzB99h7vz55EAL8acX4d2eqxOB2/LTZtbFpee+ X-Received: by 2002:a05:622a:149:b0:466:8a95:d1cc with SMTP id d75a77b69052e-467a58314d1mr62818171cf.47.1734111200906; Fri, 13 Dec 2024 09:33:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111200; cv=none; d=google.com; s=arc-20240605; b=aFic41VKIEZwYkt/RNkapnOjTIQgAINOTTqbzImHPK11FI29+uqH6QsUAOtzgchT1f Fyrqjui/OnCA+/aal3M5UUEU/SDk6PcxFcGNGubYq6riVtUlFX1k/P9bjmXLx1FYUB/k GY4kQuKdUGejn4K16os3tG0x3WhaYPxr4EEgA4eYlkCUwyE8KCbabRUm9NEvYbUediNj TroOOHwvEDJnqPtSdjcPWNxU/+jc5NsMUZWsss3NfUvz1f773x3tNm0Xy5Vm2kzdSR4s s4JIObqK7huXdd5M6fdpNI1eJIhAfGxOsCQ8dC8DKCXb2jRd6qsQRaAupHWiBuFzH5BF vNlg== 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=xo0UYeexX9TkySsgN+7gPRXhELG1k0acVRq85YNwIwg=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=F+inEmm51H8ls+zlxg37tr+q5vJhqpwOXSWrihCwxI2q6wWeyuFUvzm8LLo736oNuf ldrkF0hfnmAziBFMdaT4NgY/UH9dCgnnxbsIKMpWlVVo66l9huX9bOXHDgkR520w3qk9 8is+8mYMWdVvvhpngnm0rH/MndsXTkCrGSwSO0zn2extHWCceUQNiuD/4WYsCGzrY4iM DSpqFlqCF26ziiWj1eJ/Il2obg8iMTFC9DWhUmnF3B7K6lVOD5qkeXrl+IClS9k/y/pW GxS+chSlgMES1lPLquOZ+EBsNVXoKEh9abpvPr/fmCXReubbXVxzuLiAZmAYxSVN9UDk gm4Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=y7AjXGxB; 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-46767d37760si158088921cf.52.2024.12.13.09.33.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:33: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=y7AjXGxB; 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 1tM9XA-00071j-MC; Fri, 13 Dec 2024 12:33: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 1tM9Ws-0006sF-63 for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:32:43 -0500 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9Wk-0001RS-Tc for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:32:41 -0500 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-4361dc6322fso13669595e9.3 for ; Fri, 13 Dec 2024 09:32:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111153; x=1734715953; 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=xo0UYeexX9TkySsgN+7gPRXhELG1k0acVRq85YNwIwg=; b=y7AjXGxBybAEpDO+tZ/dy4p0ULbPXYihpiIWvrgtavTaUgU1+g7I3p1KuKke0SEaLk x95F1dwJk9YoRQuvPhbMfyW9NDGbwKyIINLi6NlvEpOgFefc61Gj//w7I9sZrLqZjLyJ BpYuP1Tjo0vliUgcrCbJSG+1BoRv9Dmhz356qEaHfuvAo9lZnWxuHZtWtObfp7/YV8hV 9BmcW8TxSlaKvd5QxxUy8ZzRo7KtJYTv1Y+1ZAHKLKJmHivfJ71WhUfp2FT25mOJxzau 9p7JLDLyffPnWrGt4Ot7nlQrZgzTFMgqXMdJ2ymHnQvs59WX4LlkWMa5nIiDqOb4mCm0 3uRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111153; x=1734715953; 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=xo0UYeexX9TkySsgN+7gPRXhELG1k0acVRq85YNwIwg=; b=Zl5RFdlTqTltLE4e3JpnOYLjOCyKvr+9l0JhROTvtJ433+eQEmNnYZzMTH2JP/LE6T UDL0abSKqtyfR1UWLU3fwNOy1e1oTp/DyINOgq59VF4mpPpRskhANwQdm1+Rno3+0IqY U7FguLIfcEal2RV1CfsqfYofrWqL4XbMduR2i376vuklPnZ5nPcfppDwrSdFWOAGkFyC qxjCH3x/o+E0IYJjbpmlG0wqvNbyI7y0VAyDrw7uZyrfvEOtfOyMx+YpDICfIDiPH/yt J9Wt4k+SW1Vqnohus/o7qCHblY9/sxoaYB00LLUCtbS21EFDlkCMlvbKjLxlTqHjkf/w P/Tw== X-Gm-Message-State: AOJu0Yzb91pc6YRcYm+tW6L4Qz6Ysef8EteCqchghVLvenxc3zZ4jsgX JcPF3fJkY0Rub9FwGYAiM/9kfeVUsULebgTAjdJiaykbRpLWOMxsOBvxpvPS21kOyQivNmKPoq3 c X-Gm-Gg: ASbGncuqD4SUeV3k33iev5fJtEzCsIy446Zyp94kfPHHVppqnw9YpxGpGrKl9RU1LdM zc8cFYyoQ4YkVmXg4JAraLDKEUucXfN8bgIVNdBcEXn/VebPW+zWOjp7JJARKYQ9Xv2WmqFr18T OprOsUKQKSo9cjBZjD1+jS1QzE/LtGL3zD1+k34s6O1ThJTCFlhjUA33bkm+rpebZNRB33KGhC3 tJQLqdtHu2YAFE1CQt+l0CrFotvtWNcvEPuAT8hN24CxuE7QjRPU35A1WbDnA== X-Received: by 2002:a05:600c:500a:b0:434:ff9d:a370 with SMTP id 5b1f17b1804b1-4362a98248emr33539935e9.0.1734111152782; Fri, 13 Dec 2024 09:32:32 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.32.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:32:32 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 01/85] target/arm: Add section labels for "Data Processing (register)" Date: Fri, 13 Dec 2024 17:31:05 +0000 Message-Id: <20241213173229.3308926-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32e.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: Richard Henderson At the same time, use ### to separate 3rd-level sections. We already use ### for 4.1.92 Data Processing (immediate), but not the two following two third-level sections: 4.1.93 Branches, and 4.1.94 Loads and stores. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-2-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 331a8e180c0..d28efb884df 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -161,7 +161,7 @@ UBFM . 10 100110 . ...... ...... ..... ..... @bitfield_32 EXTR 1 00 100111 1 0 rm:5 imm:6 rn:5 rd:5 &extract sf=1 EXTR 0 00 100111 0 0 rm:5 0 imm:5 rn:5 rd:5 &extract sf=0 -# Branches +### Branches %imm26 0:s26 !function=times_4 @branch . ..... .......................... &i imm=%imm26 @@ -291,7 +291,7 @@ HLT 1101 0100 010 ................ 000 00 @i16 # DCPS2 1101 0100 101 ................ 000 10 @i16 # DCPS3 1101 0100 101 ................ 000 11 @i16 -# Loads and stores +### Loads and stores &stxr rn rt rt2 rs sz lasr &stlr rn rt sz lasr @@ -649,6 +649,21 @@ CPYP 00 011 1 01000 ..... .... 01 ..... ..... @cpy CPYM 00 011 1 01010 ..... .... 01 ..... ..... @cpy CPYE 00 011 1 01100 ..... .... 01 ..... ..... @cpy +### Data Processing (register) + +# Data Processing (2-source) +# Data Processing (1-source) +# Logical (shifted reg) +# Add/subtract (shifted reg) +# Add/subtract (extended reg) +# Add/subtract (carry) +# Rotate right into flags +# Evaluate into flags +# Conditional compare (regster) +# Conditional compare (immediate) +# Conditional select +# Data Processing (3-source) + ### Cryptographic AES AESE 01001110 00 10100 00100 10 ..... ..... @r2r_q1e0 From patchwork Fri Dec 13 17:31:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850132 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1637661wry; Fri, 13 Dec 2024 09:33:21 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCX3nKAZN5c5mTOVLYA/dJKdXao7DnlBk4V5lV3zEdRjEqydvuoZ54bbqjH2I+7MLHJjfWdW0g==@linaro.org X-Google-Smtp-Source: AGHT+IGrDSevWCLxa2yGzzWLegtkJoQGnu2w4xKkT26lu2dabej3kG3CCtUl7Fm/nK7Z3BR4reDq X-Received: by 2002:a05:6122:21a1:b0:50d:35d9:ad60 with SMTP id 71dfb90a1353d-518ca3a68famr4332600e0c.5.1734111201337; Fri, 13 Dec 2024 09:33:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111201; cv=none; d=google.com; s=arc-20240605; b=TrbEPrVnaxku7t8oZoCM+zvAakzQ2cBZl/2eNa2gALcM+kb1PUCGm0tCrMn9M+5FK0 uPWoZuEGcNMZTSEipC8lSB/GYmh8oNUThSF27zkAmJMo0mAYJHEfxG8cteFhaPpIURcg kUIOkWgeC8F+yVyuf27cvCslT2R8GAfNKGG8/OjGH3YosxkaHjWSz5k2jQIUFuGb94kI Gdp8V4m3rhHdL4srX0IHPHVioRKgSXcSmqvY9p1Os3ymMwkqtttW1Qfh0KDfWuMkDI2v mrK8xSBCL2G8iv4QJa+n1hZB/4fSf3kAvscJclURZkyB+TBJnM2H0Sx0QJusEnObYVqA w+vg== 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=xRqNcB49wUmV6toPbS85zu415uBU5pRnCBAfEyn015o=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=czJgRMn0SwBXCVR+RI26gUmFxZk79yymWS38cEi1xjPMmN1phS8+xGV4CG1vA/2kBq een3nTMCwAoeolOtJcIgWXiVLCrj6CqjWilD/fKlUHe6K3DaainTAXPLVhWrQbwOcjz0 KYV99U13nq9MXRxjv6vaadtUitS0LRSAQGgFY12+nkdD1HvLoib3cLzYno3mEJ/zz5gz 9l6dPrPp1LZTn27lxrOpxU9TdUgp6Zj4haZya9GlDnHJlgczw2RfxpKmOTTgTQUEYzGv 7ZXu1zyGlfYa7P/IIngiV5BwpLBXc68w9nFALPfShE+hkS6zz0y3k9q5tDXvDww9+rCK iw8A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fHSNjQTT; 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 71dfb90a1353d-51622539361si2636209e0c.154.2024.12.13.09.33.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:33:21 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fHSNjQTT; 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 1tM9X3-0006xG-5N; Fri, 13 Dec 2024 12:32:53 -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 1tM9Wp-0006rQ-3I for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:32:40 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9Wl-0001Ra-OK for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:32:38 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-43618283dedso19157705e9.3 for ; Fri, 13 Dec 2024 09:32:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111154; x=1734715954; 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=xRqNcB49wUmV6toPbS85zu415uBU5pRnCBAfEyn015o=; b=fHSNjQTT5RjdkX+TezN856A2NenJX0SvGlDPvO1hSn0JdLNq4BRXAGthWaGl8Krpgy kK7aWHFiU3kVzCHQn/mrF+pIyZCfbVirLgNT/zm+PxUVoi3OaukiG4hKDNjIvxaOHLiI +n1Kc+z8bBW77igg/GIUfhAPpIqaLQopZA5tmBJZRUPzYM9ttfvtI68wU/zmcnH6Ly4L ARU6zDRJZtAFRNpKa0tQMb4j8zE7VTxBS9QkMBPSCYwbFc4n16Gt655Y38MT8h7Hl8DW EGLAhL3PBTnZM9Z+Psgkcrn2kf1irNFj7wLF02aVsUrrQfuJ8JfB36EG7SXtBqnCzPuz 0ptA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111154; x=1734715954; 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=xRqNcB49wUmV6toPbS85zu415uBU5pRnCBAfEyn015o=; b=LZBEH4PHGns5sEMlfe90pWKskENdfZIIPgHom7XVOa7K2A2fgxDw7OcLbDHd3zclFT XMqOyliPQs+U9ktyJescH1ZEtu78P3n7dEGg+sZTYGs6fPHJBnxaZ6Jun0OETWYj7XUS BpSl+gTmSIqOMqBwt/sBQIDZo4QqGutqqS1nYunRSgr6T6Xo4JFAEA+Jg1OXJFpCE335 X8FoIaJzmF7AhEjyqKigc72Q0aRmnPU3xCmt6wbFWVxxIX6MtpQvcRUIGUznRMLwnS6W hdbOnZD9chKTVBREDftd101V0BF0X+o5QhCaymF8CB5rW9sx3451DAyiOZJk6aLIacp8 qnxA== X-Gm-Message-State: AOJu0Yzvj0DX2NjTgyLZJT17qIb/CcEtdnom7EfUEW1BdxLCcI4zs1L9 mzqRDAlbe1cRNJtRLtWqlrGegEZsmhNegwslhXNvHK4PJtaLdcnCLJH9dlHxXqW5w5Tn3TWTzoF R X-Gm-Gg: ASbGncsKzLeybm60dtSoy7+rA0sGnvJlY6tBz1VnC2vpF1bhIBlTNMUcTfqoyXLIzUN CTJnyp1dux+5EcsnJFBsGdUIwGOioGiOVi8Fi/TyRL6o+uelCiPEGoo5blvMVkxnBCyd5LM4C34 cGz12KFhtdwCThtyzBftGwfsw0duF6tJGwSK6VpRYXVIKN7gOuDbiLFedsWY4tF9kmgOguJLLys SBhdyflIa79fJ7QNod/YeEALCadfBTyzZ6w/XbHOU0XziY76VAjgSMlfiYplg== X-Received: by 2002:a05:600c:1e8a:b0:434:f5d1:f10f with SMTP id 5b1f17b1804b1-4362aa52fa7mr33090445e9.17.1734111153980; Fri, 13 Dec 2024 09:32:33 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.32.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:32:33 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 02/85] target/arm: Convert UDIV, SDIV to decodetree Date: Fri, 13 Dec 2024 17:31:06 +0000 Message-Id: <20241213173229.3308926-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x332.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: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-3-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 7 ++++ target/arm/tcg/translate-a64.c | 64 +++++++++++++++++----------------- 2 files changed, 39 insertions(+), 32 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index d28efb884df..c218f6afbcc 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -28,6 +28,7 @@ &r rn &ri rd imm &rri_sf rd rn imm sf +&rrr_sf rd rn rm sf &i imm &rr_e rd rn esz &rri_e rd rn imm esz @@ -652,6 +653,12 @@ CPYE 00 011 1 01100 ..... .... 01 ..... ..... @cpy ### Data Processing (register) # Data Processing (2-source) + +@rrr_sf sf:1 .......... rm:5 ...... rn:5 rd:5 &rrr_sf + +UDIV . 00 11010110 ..... 00001 0 ..... ..... @rrr_sf +SDIV . 00 11010110 ..... 00001 1 ..... ..... @rrr_sf + # Data Processing (1-source) # Logical (shifted reg) # Add/subtract (shifted reg) diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index b2851ea5032..9f687ba840a 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -7485,6 +7485,36 @@ TRANS(UQRSHRN_si, do_scalar_shift_imm_narrow, a, uqrshrn_fns, 0, false) TRANS(SQSHRUN_si, do_scalar_shift_imm_narrow, a, sqshrun_fns, MO_SIGN, false) TRANS(SQRSHRUN_si, do_scalar_shift_imm_narrow, a, sqrshrun_fns, MO_SIGN, false) +static bool do_div(DisasContext *s, arg_rrr_sf *a, bool is_signed) +{ + TCGv_i64 tcg_n, tcg_m, tcg_rd; + tcg_rd = cpu_reg(s, a->rd); + + if (!a->sf && is_signed) { + tcg_n = tcg_temp_new_i64(); + tcg_m = tcg_temp_new_i64(); + tcg_gen_ext32s_i64(tcg_n, cpu_reg(s, a->rn)); + tcg_gen_ext32s_i64(tcg_m, cpu_reg(s, a->rm)); + } else { + tcg_n = read_cpu_reg(s, a->rn, a->sf); + tcg_m = read_cpu_reg(s, a->rm, a->sf); + } + + if (is_signed) { + gen_helper_sdiv64(tcg_rd, tcg_n, tcg_m); + } else { + gen_helper_udiv64(tcg_rd, tcg_n, tcg_m); + } + + if (!a->sf) { /* zero extend final result */ + tcg_gen_ext32u_i64(tcg_rd, tcg_rd); + } + return true; +} + +TRANS(SDIV, do_div, a, true) +TRANS(UDIV, do_div, a, false) + /* Shift a TCGv src by TCGv shift_amount, put result in dst. * Note that it is the caller's responsibility to ensure that the * shift amount is in range (ie 0..31 or 0..63) and provide the ARM @@ -8425,32 +8455,6 @@ static void disas_data_proc_1src(DisasContext *s, uint32_t insn) #undef MAP } -static void handle_div(DisasContext *s, bool is_signed, unsigned int sf, - unsigned int rm, unsigned int rn, unsigned int rd) -{ - TCGv_i64 tcg_n, tcg_m, tcg_rd; - tcg_rd = cpu_reg(s, rd); - - if (!sf && is_signed) { - tcg_n = tcg_temp_new_i64(); - tcg_m = tcg_temp_new_i64(); - tcg_gen_ext32s_i64(tcg_n, cpu_reg(s, rn)); - tcg_gen_ext32s_i64(tcg_m, cpu_reg(s, rm)); - } else { - tcg_n = read_cpu_reg(s, rn, sf); - tcg_m = read_cpu_reg(s, rm, sf); - } - - if (is_signed) { - gen_helper_sdiv64(tcg_rd, tcg_n, tcg_m); - } else { - gen_helper_udiv64(tcg_rd, tcg_n, tcg_m); - } - - if (!sf) { /* zero extend final result */ - tcg_gen_ext32u_i64(tcg_rd, tcg_rd); - } -} /* LSLV, LSRV, ASRV, RORV */ static void handle_shift_reg(DisasContext *s, @@ -8552,12 +8556,6 @@ static void disas_data_proc_2src(DisasContext *s, uint32_t insn) } } break; - case 2: /* UDIV */ - handle_div(s, false, sf, rm, rn, rd); - break; - case 3: /* SDIV */ - handle_div(s, true, sf, rm, rn, rd); - break; case 4: /* IRG */ if (sf == 0 || !dc_isar_feature(aa64_mte_insn_reg, s)) { goto do_unallocated; @@ -8616,6 +8614,8 @@ static void disas_data_proc_2src(DisasContext *s, uint32_t insn) } default: do_unallocated: + case 2: /* UDIV */ + case 3: /* SDIV */ unallocated_encoding(s); break; } From patchwork Fri Dec 13 17:31:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850166 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1640288wry; Fri, 13 Dec 2024 09:38:41 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXSHMUNtQh00eVhstOLIy+FZLWcyyyAMb/5FJ1z21NhhigrAjHn/OvN9KmoZS0tf8Ox6rO8yA==@linaro.org X-Google-Smtp-Source: AGHT+IGvK1ympf2hnQku+JFZjagCDFggmx7IayTQOw2Oyna0pLYtDVoB1Kh8v46XL3iNdVE3e3fz X-Received: by 2002:a17:907:3fa7:b0:aa6:9e40:ca66 with SMTP id a640c23a62f3a-aab779cd8f9mr324627166b.28.1734111520857; Fri, 13 Dec 2024 09:38:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111520; cv=none; d=google.com; s=arc-20240605; b=TIGcQe2mekI3OSlkXOQUqybdD/phmc2CKOmZKOXYqtWQcaggE68J7Rn+KzUYuVvc2B 5wANPhTpHy+wVEx0m++HYBdlZV/zd+cEemDJOf8mqDKHJoTPjPxMSNeCeNKOg46k0Eim AdhMvML+kPOQZZBgwVNZBtUWp4qsPfgZUswe14O86rh5WZcA7b5rMlO80VrdRbbcpVvG Xm6pgi0Y+wMBWLCZTHf0FDAoTam42ZAuunUuZjgTZy2X5Oht/BDU4JSXKBMFnuRDo18X vWuayad9azQfCSbMqO9T++QAcLt7f2NWk5LzYW1InKPkMgTfeIm2m7MdQdpW96jvUjIZ QYqg== 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=NYjZ2eKKmjmDMASfvcBpHWyNreYgkDcdayCJjG42kxI=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=Dk0GzdIn4M+1FkbSFQDhUlXy37sP6omr6H5dTCKkripNIHbg7Za38eFJyTEZfPLyT9 VrrrLkjTlloOFt5UTb99gkdXY8yyDxr4Re6K+NPg26Jo8H57Gn5dhGzSRAUDWU2A+XGV 2klXjYb604EaJ4+ASwwCzQvYCHu50+MuEQEaf9JzAR8dGFcRNCcenDi1Sfnb3vj5Ef+n UB1sl9GX2sA4JlVOpFjyzfuKWL9s6hxAchs7jwSYmfWG1tFC7qYmF0zBkBcpifmlY9+J j6oKLdLrDF3z9aOvsTXPS8K/AFhmzG6nZcND8HrMEwYRikyC+KK1nUodsTBejJTVmE1g OJYg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=t2ZbE9Tm; 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 a640c23a62f3a-aa6a299de8esi611894866b.927.2024.12.13.09.38.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:38:40 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=t2ZbE9Tm; 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 1tM9Xo-0007zF-9h; Fri, 13 Dec 2024 12:33: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 1tM9Wr-0006s8-Lk for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:32:43 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9Wo-0001Rj-VZ for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:32:40 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-4361fe642ddso20454645e9.2 for ; Fri, 13 Dec 2024 09:32:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111155; x=1734715955; 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=NYjZ2eKKmjmDMASfvcBpHWyNreYgkDcdayCJjG42kxI=; b=t2ZbE9TmK0jT7zAn8oMiDmypB0ocWT273SwHxHsazlPRrY6z02LAls4VpLazRg22oG h33c9EUkJRNbxM+7Eb3XVN73n4Hql+8rvOSi6hA5oxHj/zE7lAT7nPYOYBL6Kr+qfKO/ GPEgi5RPhllaxkGwpsQkoUn+kOd8qMB0qKyvQFRs5YJMnkataoULREN1TAtlBqImsueE 8RgcxhWKqSwb6T0GC7kCxnBqeOyFC/RkGAPhGHDh/KUjt/SuiXaGgnJAcSd+BsP+EXkx FWILuMP8QIaVPvCgxhcsTtkPU0epCQ5mygFdxqqZsCphX8wCFisknYilJuGkjFJCcdjN RFWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111155; x=1734715955; 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=NYjZ2eKKmjmDMASfvcBpHWyNreYgkDcdayCJjG42kxI=; b=S8aos3505x7pjXZvTbJIa5hp/M+wPn2+bHO1Ks2Yglv2lCCNaiRnYGRA6GtcgJviWK 9/1BTHUsBvybulVtB5gEw/6bzBfO7+F2wWFEOWHI9R5aigAunsr9n0Lm5fTA/Rl0wE0L 7oAH1EqexPBLlean523p+qXsEBO0WG/nwtiL2SyW2YY6iNxFWRUgJxD+3mOyHSxIVMLN onKuvXFTHec940cJEY+Z62H523DVQ9HbZ4L2SimfN3R0V1/DfkoL38B8W+3TteefGmAI AXJMBTCuUUxI2zzDkAhSJgiAXRcfryZcnQGbKJXEQgOJ0mnHMAcO1tWMh+6nLxYALtny 4PMA== X-Gm-Message-State: AOJu0YwtEdvId7GmJrr/CE2n60XycGZ13JSl8gmSjoP01wnaLBXZZrZi qQWRMU1z+cDKhHCKcUjJBNy8LAQG9b3+kDbF9GhuBVIaSy3mSeOh9ps9qqcGldoWQ/853JuuEkG P X-Gm-Gg: ASbGnct9jt4dRrzRtbS62KsedtjIzoltS0EGh6lspqV9vn/Kp8xUkOCxBjB0mGd7mz+ Yp9JFRetINx0zT8UfsK6fm7fkK6VE0e7KVCLO4QHtNYVHyuw2dP70Img7pu6GDYMY7jX4qHbWlg snYo7+xYsOdRuDKRLLxEgSRUuXV1ohydOb3Kl+5oU+D2jFCQ5eZtK3PdMq70uh9tK+wk0zHQSYZ +lMUNzU//klEo7Ikk7oSDAxFzc3hZ6m0CkRbZ8oWgtxmk3GqTZqT++FF5NElg== X-Received: by 2002:a05:6000:4b12:b0:385:fc70:7eb with SMTP id ffacd0b85a97d-38880ac252bmr3099003f8f.12.1734111155303; Fri, 13 Dec 2024 09:32:35 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.32.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:32:34 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 03/85] target/arm: Convert LSLV, LSRV, ASRV, RORV to decodetree Date: Fri, 13 Dec 2024 17:31:07 +0000 Message-Id: <20241213173229.3308926-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x331.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: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-4-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 4 +++ target/arm/tcg/translate-a64.c | 46 ++++++++++++++++------------------ 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index c218f6afbcc..3db55b78a65 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -658,6 +658,10 @@ CPYE 00 011 1 01100 ..... .... 01 ..... ..... @cpy UDIV . 00 11010110 ..... 00001 0 ..... ..... @rrr_sf SDIV . 00 11010110 ..... 00001 1 ..... ..... @rrr_sf +LSLV . 00 11010110 ..... 00100 0 ..... ..... @rrr_sf +LSRV . 00 11010110 ..... 00100 1 ..... ..... @rrr_sf +ASRV . 00 11010110 ..... 00101 0 ..... ..... @rrr_sf +RORV . 00 11010110 ..... 00101 1 ..... ..... @rrr_sf # Data Processing (1-source) # Logical (shifted reg) diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 9f687ba840a..8b7ca2c68ad 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -7575,6 +7575,23 @@ static void shift_reg_imm(TCGv_i64 dst, TCGv_i64 src, int sf, } } +static bool do_shift_reg(DisasContext *s, arg_rrr_sf *a, + enum a64_shift_type shift_type) +{ + TCGv_i64 tcg_shift = tcg_temp_new_i64(); + TCGv_i64 tcg_rd = cpu_reg(s, a->rd); + TCGv_i64 tcg_rn = read_cpu_reg(s, a->rn, a->sf); + + tcg_gen_andi_i64(tcg_shift, cpu_reg(s, a->rm), a->sf ? 63 : 31); + shift_reg(tcg_rd, tcg_rn, a->sf, shift_type, tcg_shift); + return true; +} + +TRANS(LSLV, do_shift_reg, a, A64_SHIFT_TYPE_LSL) +TRANS(LSRV, do_shift_reg, a, A64_SHIFT_TYPE_LSR) +TRANS(ASRV, do_shift_reg, a, A64_SHIFT_TYPE_ASR) +TRANS(RORV, do_shift_reg, a, A64_SHIFT_TYPE_ROR) + /* Logical (shifted register) * 31 30 29 28 24 23 22 21 20 16 15 10 9 5 4 0 * +----+-----+-----------+-------+---+------+--------+------+------+ @@ -8456,19 +8473,6 @@ static void disas_data_proc_1src(DisasContext *s, uint32_t insn) } -/* LSLV, LSRV, ASRV, RORV */ -static void handle_shift_reg(DisasContext *s, - enum a64_shift_type shift_type, unsigned int sf, - unsigned int rm, unsigned int rn, unsigned int rd) -{ - TCGv_i64 tcg_shift = tcg_temp_new_i64(); - TCGv_i64 tcg_rd = cpu_reg(s, rd); - TCGv_i64 tcg_rn = read_cpu_reg(s, rn, sf); - - tcg_gen_andi_i64(tcg_shift, cpu_reg(s, rm), sf ? 63 : 31); - shift_reg(tcg_rd, tcg_rn, sf, shift_type, tcg_shift); -} - /* CRC32[BHWX], CRC32C[BHWX] */ static void handle_crc32(DisasContext *s, unsigned int sf, unsigned int sz, bool crc32c, @@ -8579,18 +8583,6 @@ static void disas_data_proc_2src(DisasContext *s, uint32_t insn) tcg_gen_or_i64(cpu_reg(s, rd), cpu_reg(s, rm), t); } break; - case 8: /* LSLV */ - handle_shift_reg(s, A64_SHIFT_TYPE_LSL, sf, rm, rn, rd); - break; - case 9: /* LSRV */ - handle_shift_reg(s, A64_SHIFT_TYPE_LSR, sf, rm, rn, rd); - break; - case 10: /* ASRV */ - handle_shift_reg(s, A64_SHIFT_TYPE_ASR, sf, rm, rn, rd); - break; - case 11: /* RORV */ - handle_shift_reg(s, A64_SHIFT_TYPE_ROR, sf, rm, rn, rd); - break; case 12: /* PACGA */ if (sf == 0 || !dc_isar_feature(aa64_pauth, s)) { goto do_unallocated; @@ -8616,6 +8608,10 @@ static void disas_data_proc_2src(DisasContext *s, uint32_t insn) do_unallocated: case 2: /* UDIV */ case 3: /* SDIV */ + case 8: /* LSLV */ + case 9: /* LSRV */ + case 10: /* ASRV */ + case 11: /* RORV */ unallocated_encoding(s); break; } From patchwork Fri Dec 13 17:31:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850193 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1642445wry; Fri, 13 Dec 2024 09:43:24 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCX9jbhjB2ydQQd/n+pKw+52ZkQeyMojY5g+F0VMqMm0dbiQL/6ZrGrPHM2jwM05VuKVLYAsig==@linaro.org X-Google-Smtp-Source: AGHT+IHIK40qaUqOCe17pbaOMJdOtzWwJw2kwJL6l6YN33yLgR2u+q03AUAWSRtvkq7Fy6K60EZZ X-Received: by 2002:a17:907:7211:b0:aa6:7d82:5411 with SMTP id a640c23a62f3a-aab77e99761mr363199366b.40.1734111803945; Fri, 13 Dec 2024 09:43:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111803; cv=none; d=google.com; s=arc-20240605; b=Dk4dcKjiVwChoVefVwpN23tePPdV03+wuoj9sBfLy4ITsYyKzfQIzR78IJ3HiBWHWO XY+y+WSyQGIYL5/kfK9CWvHiTp0Vd4EuWDDhi+C/IQJZEvzCki8QLbxcOpAPDil6I+jI /4iKtqXtKNBPtqNO9U+oQ5dofaPzX30/VExYZ+JYxCv41HCibHQL4QcyQWXXUfMZ+3uT 4ccKKWgrpSMpUgwgigHkclrXOOMwjyoUL1pVYbc/q7X6tz+DeJBi6Moos/SxcxHcqIvr 6hnfTAXn29TCLXjV3O7tL0au0usmXKBYq6jDLycxi/tXJd66VL5I85TKAwKNUt7tP1hc w+yA== 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=r9qMi3+MxVuBbaoTU6RRcHd4XcWUlSJWEHe6/FZDEjs=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=Z21gw4B8cKepDkdzDcOs1Sl2h/S5IvhQYgSa2QyKcew1fJuFBj4k1f/EAZFAxqjgFL pAXciw/cK9ksysaGeYosFtPt+m/7OJ7d3igmQb+fMGfQ4PGkDiGN+MU9kZUd48yhg9Tz VozU8JBwQEV8JK5n1WmORwycMRVxxT8CocfLssm2EI721CIQrVhr+LLQC+ZbirRo6N9Z x/vvw58O56Ul9VjkL2jCm2s6htYyJDZ1RZO1136soEooxmRain0LOrgS+2TEhhW1suY+ D6cJ3LwzxrCat4xB2AdZbWUSpx+5xlhnP8Vtk2vRliH+zUYgDPBxgtV6y+huHOD3A2I3 JU/A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Sl04onK2; 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 a640c23a62f3a-aa6820ce908si838410966b.861.2024.12.13.09.43.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:43:23 -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=Sl04onK2; 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 1tM9XW-0007DS-BJ; Fri, 13 Dec 2024 12:33: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 1tM9Wt-0006si-75 for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:32:44 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9Wp-0001S1-FR for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:32:41 -0500 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-43622354a3eso14467305e9.1 for ; Fri, 13 Dec 2024 09:32:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111156; x=1734715956; 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=r9qMi3+MxVuBbaoTU6RRcHd4XcWUlSJWEHe6/FZDEjs=; b=Sl04onK2F1R/+CAO1WE4P86CyVebygATpUkLglWc/0DMAlVPVVpQ6vjSzZ2ooMhMwE e1OZ6JfXD6J/bnyjBlqMW0aY3Y69rDZ89LbmQ7BHhtqsREkHD19VonQrFQq4z5PK/rg3 Wof9WYz9fkVgiW8mNNQWkH741lAoUMIJgWFfdTWRrVTbLSOX9A1mEF7seULN6FS03scz yV2wSOzqGfrPyZ0ZW7Z2cAN9fB07IYC2ZXp/bU296oPMP2QAcku/xX+JU37232TivD8t AEOojPlJuYVMD2EcWyThmDtbhIwt4JmX2kVShaIfgtjThJf5VO7w7ZzFx1eR2ejeS+Fi bdrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111156; x=1734715956; 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=r9qMi3+MxVuBbaoTU6RRcHd4XcWUlSJWEHe6/FZDEjs=; b=mWUeMDK3s3YxYjduMIhp6eTMjC2tQhItHKRTnugke3820ms1U+IHAJwV3kdJD5JB04 DZojxxO4OeoLCxIDjBXeIO+KkTnvVIXjWRcAfaXlIhkevLVHiSfM4oZZJ67rjmaQzRE4 tJvrw/CGD/LhuXO4lOkX+d7VZf1LBd76TJOrDxtWqb7n3TNEAPMnJAuc32whLkT2gpga QM+bo+HT1sVplkC/GWhhpGeBkGGpjrJbcZM5odJAFzLAiDoahnu2QJHJJ3LSemIVTAEZ hUhKjDOCb8UjwNHjySt6hgfVuJwtUzz0jtNktM1W4hbra+mLdtydy5+Xz5bStVrBKW1E bc9Q== X-Gm-Message-State: AOJu0YyxWzDNCBPaWi7xZQyTCZVU+EQNNjMQmugL3066daBGuHXuEgTd KlqKp7iM0OfuzXDRe9G/QDJCV8fjgNyouP0Gce/a4A9WbLI+CGUtwZHvBNMrQxNBxv+Qth20hIo i X-Gm-Gg: ASbGncuL87dEXKgeKC4wVhbsnfIPAy0G09Xydf4IoRY3XNS+L7BOvPkPcx6dm9D0cRX WXdHdlbbyyWJfthpzQyhb7oT+8enhNzW0GjGQO3+NZAdrpGvnpT+VUjtX/SpiSB8JGRlOaDeJmV y2SCucoK7d1izv3Cue7m0RnnMUAFitWEk6JxP5RpIJDRrpWKdqy59Z7PSf4y7IWg2hANXxK/iF8 w/brXLWLQMLM2tE80Qi5/47cfUeXe/nFm9Bl+srQgFi0doRWqiYU9Z5zLonqw== X-Received: by 2002:a05:600c:468d:b0:434:feb1:adae with SMTP id 5b1f17b1804b1-4362aa2e4d7mr34315235e9.3.1734111156282; Fri, 13 Dec 2024 09:32:36 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.32.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:32:35 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 04/85] target/arm: Convert CRC32, CRC32C to decodetree Date: Fri, 13 Dec 2024 17:31:08 +0000 Message-Id: <20241213173229.3308926-5-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32d.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: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-5-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 12 ++++ target/arm/tcg/translate-a64.c | 101 +++++++++++++-------------------- 2 files changed, 53 insertions(+), 60 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 3db55b78a65..1664f4793c1 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -45,7 +45,9 @@ @rr_d ........ ... ..... ...... rn:5 rd:5 &rr_e esz=3 @rr_sd ........ ... ..... ...... rn:5 rd:5 &rr_e esz=%esz_sd +@rrr_b ........ ... rm:5 ...... rn:5 rd:5 &rrr_e esz=0 @rrr_h ........ ... rm:5 ...... rn:5 rd:5 &rrr_e esz=1 +@rrr_s ........ ... rm:5 ...... rn:5 rd:5 &rrr_e esz=2 @rrr_d ........ ... rm:5 ...... rn:5 rd:5 &rrr_e esz=3 @rrr_sd ........ ... rm:5 ...... rn:5 rd:5 &rrr_e esz=%esz_sd @rrr_hsd ........ ... rm:5 ...... rn:5 rd:5 &rrr_e esz=%esz_hsd @@ -663,6 +665,16 @@ LSRV . 00 11010110 ..... 00100 1 ..... ..... @rrr_sf ASRV . 00 11010110 ..... 00101 0 ..... ..... @rrr_sf RORV . 00 11010110 ..... 00101 1 ..... ..... @rrr_sf +CRC32 0 00 11010110 ..... 0100 00 ..... ..... @rrr_b +CRC32 0 00 11010110 ..... 0100 01 ..... ..... @rrr_h +CRC32 0 00 11010110 ..... 0100 10 ..... ..... @rrr_s +CRC32 1 00 11010110 ..... 0100 11 ..... ..... @rrr_d + +CRC32C 0 00 11010110 ..... 0101 00 ..... ..... @rrr_b +CRC32C 0 00 11010110 ..... 0101 01 ..... ..... @rrr_h +CRC32C 0 00 11010110 ..... 0101 10 ..... ..... @rrr_s +CRC32C 1 00 11010110 ..... 0101 11 ..... ..... @rrr_d + # Data Processing (1-source) # Logical (shifted reg) # Add/subtract (shifted reg) diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 8b7ca2c68ad..22594a1149d 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -7592,6 +7592,39 @@ TRANS(LSRV, do_shift_reg, a, A64_SHIFT_TYPE_LSR) TRANS(ASRV, do_shift_reg, a, A64_SHIFT_TYPE_ASR) TRANS(RORV, do_shift_reg, a, A64_SHIFT_TYPE_ROR) +static bool do_crc32(DisasContext *s, arg_rrr_e *a, bool crc32c) +{ + TCGv_i64 tcg_acc, tcg_val, tcg_rd; + TCGv_i32 tcg_bytes; + + switch (a->esz) { + case MO_8: + case MO_16: + case MO_32: + tcg_val = tcg_temp_new_i64(); + tcg_gen_extract_i64(tcg_val, cpu_reg(s, a->rm), 0, 8 << a->esz); + break; + case MO_64: + tcg_val = cpu_reg(s, a->rm); + break; + default: + g_assert_not_reached(); + } + tcg_acc = cpu_reg(s, a->rn); + tcg_bytes = tcg_constant_i32(1 << a->esz); + tcg_rd = cpu_reg(s, a->rd); + + if (crc32c) { + gen_helper_crc32c_64(tcg_rd, tcg_acc, tcg_val, tcg_bytes); + } else { + gen_helper_crc32_64(tcg_rd, tcg_acc, tcg_val, tcg_bytes); + } + return true; +} + +TRANS_FEAT(CRC32, aa64_crc32, do_crc32, a, false) +TRANS_FEAT(CRC32C, aa64_crc32, do_crc32, a, true) + /* Logical (shifted register) * 31 30 29 28 24 23 22 21 20 16 15 10 9 5 4 0 * +----+-----+-----------+-------+---+------+--------+------+------+ @@ -8473,52 +8506,6 @@ static void disas_data_proc_1src(DisasContext *s, uint32_t insn) } -/* CRC32[BHWX], CRC32C[BHWX] */ -static void handle_crc32(DisasContext *s, - unsigned int sf, unsigned int sz, bool crc32c, - unsigned int rm, unsigned int rn, unsigned int rd) -{ - TCGv_i64 tcg_acc, tcg_val; - TCGv_i32 tcg_bytes; - - if (!dc_isar_feature(aa64_crc32, s) - || (sf == 1 && sz != 3) - || (sf == 0 && sz == 3)) { - unallocated_encoding(s); - return; - } - - if (sz == 3) { - tcg_val = cpu_reg(s, rm); - } else { - uint64_t mask; - switch (sz) { - case 0: - mask = 0xFF; - break; - case 1: - mask = 0xFFFF; - break; - case 2: - mask = 0xFFFFFFFF; - break; - default: - g_assert_not_reached(); - } - tcg_val = tcg_temp_new_i64(); - tcg_gen_andi_i64(tcg_val, cpu_reg(s, rm), mask); - } - - tcg_acc = cpu_reg(s, rn); - tcg_bytes = tcg_constant_i32(1 << sz); - - if (crc32c) { - gen_helper_crc32c_64(cpu_reg(s, rd), tcg_acc, tcg_val, tcg_bytes); - } else { - gen_helper_crc32_64(cpu_reg(s, rd), tcg_acc, tcg_val, tcg_bytes); - } -} - /* Data-processing (2 source) * 31 30 29 28 21 20 16 15 10 9 5 4 0 * +----+---+---+-----------------+------+--------+------+------+ @@ -8590,20 +8577,6 @@ static void disas_data_proc_2src(DisasContext *s, uint32_t insn) gen_helper_pacga(cpu_reg(s, rd), tcg_env, cpu_reg(s, rn), cpu_reg_sp(s, rm)); break; - case 16: - case 17: - case 18: - case 19: - case 20: - case 21: - case 22: - case 23: /* CRC32 */ - { - int sz = extract32(opcode, 0, 2); - bool crc32c = extract32(opcode, 2, 1); - handle_crc32(s, sf, sz, crc32c, rm, rn, rd); - break; - } default: do_unallocated: case 2: /* UDIV */ @@ -8612,6 +8585,14 @@ static void disas_data_proc_2src(DisasContext *s, uint32_t insn) case 9: /* LSRV */ case 10: /* ASRV */ case 11: /* RORV */ + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: /* CRC32 */ unallocated_encoding(s); break; } From patchwork Fri Dec 13 17:31:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850169 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1640402wry; Fri, 13 Dec 2024 09:38:56 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUXkKNoGFAfU0RbenmmHvBvlK0Qd+J+KDiWqRVuLhu9CzkM5URh2oVacRpWt774MLT8YNYPcg==@linaro.org X-Google-Smtp-Source: AGHT+IG9cFrQk0Mvo98fqeQbtVhxdaOv09QAoL2TAl3lOo591Be+YJmcHvBAiOQ9WIxxLzoZYA5Q X-Received: by 2002:a17:906:311a:b0:aa6:a87e:f2df with SMTP id a640c23a62f3a-aab779a86a6mr371848566b.25.1734111536488; Fri, 13 Dec 2024 09:38:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111536; cv=none; d=google.com; s=arc-20240605; b=ExV4cNZYC6oA7h79fT4Ol0yFbUQ1YiUIPAfX1cyiJWxfUMF/MjNct5i3uCtmjEGuhf IoobMvgBO8KUEl2GlgfMsP44Qt4k4MhXhThcKYyOP0m7JYQtv94cf5JuehqmI0eHMkn8 J2QNTqEeW53xQdlWrsnTquS8/YxMD/Jgt9enplVjWLCp9P+e71BJLikzqCXioA4NyKg0 li/gmgD4owCngxE7NUc3Ky6L0jL635lUubsJTJDwV2b43mqOvyOnmYPQDKFWFWmlh6ED qFIYCFWq9GKOKePsoKvUWORWQyhM7Ukgw7rPGDZeJIAoNbDfqPalu9cxFLKrMZ3m8TFk 3axQ== 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=zyX98l1sgiigpgu1GmM5ikNVQf0pOEJ5j7Qe12nx3Rg=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=S8iWKnl9jp0tK+YpECPsqhwLyhV6b1B7mNGPKMDO057c/mwJ888IFCzL3IkhnkqRSC 5erVsz1k6/SiL95pDUAkybV+1KpvA3PqGu29U6p1fR06Rul7rtNstj/fj3S8kUaR6zn/ pSPt1GyuhswJOZKrbxr3g4F80hb53so56NdjC2kix5AunCpBwZCofHIKZkDosKFxa8t/ QARoYa5hU9HgAlsV+Gn9OTMqUVJO/OwO68SJLGECNCS6VWygo+ge9hB30hEAiPINoGjc MivjoE/mDL5TNE7hHGFIAWF5x9CFB3k7VzS6x3QWIF+xfByhCBCij7C0RB0LdEI7zc3o HRUw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=y2ZBNuxz; 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 a640c23a62f3a-aa6820ce908si837879766b.861.2024.12.13.09.38.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:38: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=y2ZBNuxz; 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 1tM9XO-0007BC-9E; Fri, 13 Dec 2024 12:33: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 1tM9Ws-0006sY-P1 for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:32:43 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9Wp-0001SD-Qx for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:32:42 -0500 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-3863494591bso1067566f8f.1 for ; Fri, 13 Dec 2024 09:32:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111157; x=1734715957; 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=zyX98l1sgiigpgu1GmM5ikNVQf0pOEJ5j7Qe12nx3Rg=; b=y2ZBNuxzdEHl2i/d/W5yAEwnsjvoCQOXuRuqjz5QWimzcFv1vB9sZR5Es4H1am8QeL 6bheXRYPtIrIswZVzhRYFJvaUtmLFS1n2agVHRpDW0sDp/C271aHy4j8K+ueyuEK1MMM jrKXI1fsPy9bKUmC/YNSxWcKIaQO7sDdU+ou/e0rkjVdD3950C/vmQvt/q3uHrHkgsQN 7T0NKiQrsgyYi7Qrd7VuwBMJjwiMYBFJaO1DPuZ6EEhYKXAjms1il25vrL5aF68pH8dN lbUdwm+DXW1oCdpzdy6lfrGtfChnkYg2m7/6h33GKv1+CH/z/Valis8lHNTLK3S+cQdw KquA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111157; x=1734715957; 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=zyX98l1sgiigpgu1GmM5ikNVQf0pOEJ5j7Qe12nx3Rg=; b=h9/A1fUz8WhoSXaN0rTyrg+o7Igbl9LqUC/D/s4+PMJeWaimAdzdJvdhBFALoxz0Be iaoJvhE7j/zd/AjnX3GpjUOnk2wjmW8yrqPnQavLuo3/g87kijji+2XqwGq1PL7VX4eb P9eVVNQADFqoBM7Z/43YOTwRel0lYAYoQqoOHaBIxZ8CRjpflf5ykIXIAps8Ev+c3wbs 7sRctu+A4ISScyTuAYHJtnjUE+p1QdyiOMCas2Mkv/3qpbNute0LjJMphShCDAyuA8+Z BfdTWpy5FDRSKlDuOVyxT2ik070lKRBnfLgYPB8g7c81PZu+nNIjGulpoAf+6wswkIrf Q/Fg== X-Gm-Message-State: AOJu0Ywtbddyd6i7reVGCJT33pVzcDbnCbgcz1tHg1+D2V68aZ6bwD+9 VtCfnCYhSpbTMOkznwQu8S9+2uEuUMEDQu3v9zEZCKGuo+2UvTcxxi1JA9xvLScoSvl4olomgfb p X-Gm-Gg: ASbGnctnNw9ilIQ1aCZYTTg5YHj26vremHbNJKBcdsj8gsr61SI9fizhMT+y5fJNTM0 pZWNXYK9Cof5mwI8VsDNj7pUAL5ZwVlr12tToVMn2mCsQHeRCWRQQaaw+RPirtgkZBx+HGaEq5U DYgf9pK4Qc+O48Aa/Kb8+S9OiTFOlpYHVT3esUZtUUOpSm/Sl1xFtTZj5Ck7xBJQX4JUcrtTOov fZhQ6d1IA68fy524PhvIstNsdAxOsEb7aNpX3FGbprQRElq8Y7rAE4TLm2SzA== X-Received: by 2002:a5d:64c3:0:b0:386:62f:cf18 with SMTP id ffacd0b85a97d-3888e0bf878mr2777831f8f.49.1734111157259; Fri, 13 Dec 2024 09:32:37 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.32.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:32:36 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 05/85] target/arm: Convert SUBP, IRG, GMI to decodetree Date: Fri, 13 Dec 2024 17:31:09 +0000 Message-Id: <20241213173229.3308926-6-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42c.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: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-6-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 7 +++ target/arm/tcg/translate-a64.c | 94 +++++++++++++++++++--------------- 2 files changed, 59 insertions(+), 42 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 1664f4793c1..f0a5ffb1cd8 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -26,6 +26,7 @@ %hlm 11:1 20:2 &r rn +&rrr rd rn rm &ri rd imm &rri_sf rd rn imm sf &rrr_sf rd rn rm sf @@ -656,6 +657,7 @@ CPYE 00 011 1 01100 ..... .... 01 ..... ..... @cpy # Data Processing (2-source) +@rrr . .......... rm:5 ...... rn:5 rd:5 &rrr @rrr_sf sf:1 .......... rm:5 ...... rn:5 rd:5 &rrr_sf UDIV . 00 11010110 ..... 00001 0 ..... ..... @rrr_sf @@ -675,6 +677,11 @@ CRC32C 0 00 11010110 ..... 0101 01 ..... ..... @rrr_h CRC32C 0 00 11010110 ..... 0101 10 ..... ..... @rrr_s CRC32C 1 00 11010110 ..... 0101 11 ..... ..... @rrr_d +SUBP 1 00 11010110 ..... 000000 ..... ..... @rrr +SUBPS 1 01 11010110 ..... 000000 ..... ..... @rrr +IRG 1 00 11010110 ..... 000100 ..... ..... @rrr +GMI 1 00 11010110 ..... 000101 ..... ..... @rrr + # Data Processing (1-source) # Logical (shifted reg) # Add/subtract (shifted reg) diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 22594a1149d..00e55d42ffd 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -7625,6 +7625,55 @@ static bool do_crc32(DisasContext *s, arg_rrr_e *a, bool crc32c) TRANS_FEAT(CRC32, aa64_crc32, do_crc32, a, false) TRANS_FEAT(CRC32C, aa64_crc32, do_crc32, a, true) +static bool do_subp(DisasContext *s, arg_rrr *a, bool setflag) +{ + TCGv_i64 tcg_n = read_cpu_reg_sp(s, a->rn, true); + TCGv_i64 tcg_m = read_cpu_reg_sp(s, a->rm, true); + TCGv_i64 tcg_d = cpu_reg(s, a->rd); + + tcg_gen_sextract_i64(tcg_n, tcg_n, 0, 56); + tcg_gen_sextract_i64(tcg_m, tcg_m, 0, 56); + + if (setflag) { + gen_sub_CC(true, tcg_d, tcg_n, tcg_m); + } else { + tcg_gen_sub_i64(tcg_d, tcg_n, tcg_m); + } + return true; +} + +TRANS_FEAT(SUBP, aa64_mte_insn_reg, do_subp, a, false) +TRANS_FEAT(SUBPS, aa64_mte_insn_reg, do_subp, a, true) + +static bool trans_IRG(DisasContext *s, arg_rrr *a) +{ + if (dc_isar_feature(aa64_mte_insn_reg, s)) { + TCGv_i64 tcg_rd = cpu_reg_sp(s, a->rd); + TCGv_i64 tcg_rn = cpu_reg_sp(s, a->rn); + + if (s->ata[0]) { + gen_helper_irg(tcg_rd, tcg_env, tcg_rn, cpu_reg(s, a->rm)); + } else { + gen_address_with_allocation_tag0(tcg_rd, tcg_rn); + } + return true; + } + return false; +} + +static bool trans_GMI(DisasContext *s, arg_rrr *a) +{ + if (dc_isar_feature(aa64_mte_insn_reg, s)) { + TCGv_i64 t = tcg_temp_new_i64(); + + tcg_gen_extract_i64(t, cpu_reg_sp(s, a->rn), 56, 4); + tcg_gen_shl_i64(t, tcg_constant_i64(1), t); + tcg_gen_or_i64(cpu_reg(s, a->rd), cpu_reg(s, a->rm), t); + return true; + } + return false; +} + /* Logical (shifted register) * 31 30 29 28 24 23 22 21 20 16 15 10 9 5 4 0 * +----+-----+-----------+-------+---+------+--------+------+------+ @@ -8528,48 +8577,6 @@ static void disas_data_proc_2src(DisasContext *s, uint32_t insn) } switch (opcode) { - case 0: /* SUBP(S) */ - if (sf == 0 || !dc_isar_feature(aa64_mte_insn_reg, s)) { - goto do_unallocated; - } else { - TCGv_i64 tcg_n, tcg_m, tcg_d; - - tcg_n = read_cpu_reg_sp(s, rn, true); - tcg_m = read_cpu_reg_sp(s, rm, true); - tcg_gen_sextract_i64(tcg_n, tcg_n, 0, 56); - tcg_gen_sextract_i64(tcg_m, tcg_m, 0, 56); - tcg_d = cpu_reg(s, rd); - - if (setflag) { - gen_sub_CC(true, tcg_d, tcg_n, tcg_m); - } else { - tcg_gen_sub_i64(tcg_d, tcg_n, tcg_m); - } - } - break; - case 4: /* IRG */ - if (sf == 0 || !dc_isar_feature(aa64_mte_insn_reg, s)) { - goto do_unallocated; - } - if (s->ata[0]) { - gen_helper_irg(cpu_reg_sp(s, rd), tcg_env, - cpu_reg_sp(s, rn), cpu_reg(s, rm)); - } else { - gen_address_with_allocation_tag0(cpu_reg_sp(s, rd), - cpu_reg_sp(s, rn)); - } - break; - case 5: /* GMI */ - if (sf == 0 || !dc_isar_feature(aa64_mte_insn_reg, s)) { - goto do_unallocated; - } else { - TCGv_i64 t = tcg_temp_new_i64(); - - tcg_gen_extract_i64(t, cpu_reg_sp(s, rn), 56, 4); - tcg_gen_shl_i64(t, tcg_constant_i64(1), t); - tcg_gen_or_i64(cpu_reg(s, rd), cpu_reg(s, rm), t); - } - break; case 12: /* PACGA */ if (sf == 0 || !dc_isar_feature(aa64_pauth, s)) { goto do_unallocated; @@ -8579,8 +8586,11 @@ static void disas_data_proc_2src(DisasContext *s, uint32_t insn) break; default: do_unallocated: + case 0: /* SUBP(S) */ case 2: /* UDIV */ case 3: /* SDIV */ + case 4: /* IRG */ + case 5: /* GMI */ case 8: /* LSLV */ case 9: /* LSRV */ case 10: /* ASRV */ From patchwork Fri Dec 13 17:31:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850134 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1637732wry; Fri, 13 Dec 2024 09:33:29 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVG5uxHHFTHykdZ8x1kppL9xA8Rk2Nbho7kGNhG1YfiPDik+BYjtB1Ovi5Kn36TpubCc4vQ4A==@linaro.org X-Google-Smtp-Source: AGHT+IEhJltxY/gr1eHFXy7IzXq03AJa2y64iriPygArNqjAKP2TxtMkFisRN2TPgy69dEK3tszB X-Received: by 2002:a05:622a:606:b0:467:53c8:7578 with SMTP id d75a77b69052e-467a577f318mr65900321cf.17.1734111209217; Fri, 13 Dec 2024 09:33:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111209; cv=none; d=google.com; s=arc-20240605; b=VPfdcFJQbsY40LmNb8XnLoT/S05RqGmHou3/j3QtVSIWl3qn0XkPSH3JyPSCQZccRL U2mNURoifWHhDKc1N2OYDGkfLyoZrn8jB/yrZFXKWk2TDkC+XDnOLbCyZLb2gINL80uD mVSq+IDBsUTJCFJ6ypzNkqEY/fIV3o04pSWh+BhlnndcRfNoGT5q0za2522j4u76ZPN8 jH93YGmzb8FSxJ0m2iWNmturFJ8lKIdVZd+9T1E3bZ6G3ChuuZcLjVvqjljGcIPT2OSp 9tapY+o1kVX9YXbepqSmbmNNp70BPZe7e2+rZRR6CWR5GkhAm4fsvZxNe/tB6f/S552U 7aSA== 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=q06RjwqfoGMqijUanpYdiBSZsyuy9j4pDBF+J1wv7+I=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=BsFAIt2kxZP8SiH4Dmt2FvUCKGm17zsE+T+H7PXL7T2JmH7CtXhasFuI8opf120x76 MG85iRmKzcVbFPjeZ8tP+BfZWxe+YKW6UuVILkKF/3xHtzOWI6JHEUAIxTGE6868Wr1+ LKv0a2cVgQ0abStP8Uhdi2ryaFSPiCq3B3bQjD0rjiTW36b52UNtgedNgseHfpyIBXFy r4loRr70+w6yAAXyFzA7y++XyWDNsHhe7sYc6a/MdCYUcTNllcNJNzYkcm6taHfILGuM v/SjQGLMiTvYWnB1deHB2WmDvOTRaVXh3D9A0BDi3QQQAsTTfM/k4Ya/LOtD0ao15km1 WD4g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IsI7w3kn; 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-46799efb4bbsi44353521cf.279.2024.12.13.09.33.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:33: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=IsI7w3kn; 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 1tM9XF-00075P-98; Fri, 13 Dec 2024 12:33: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 1tM9Wt-0006sn-Ax for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:32:45 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9Wp-0001SU-SH for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:32:43 -0500 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-3862d6d5765so1374595f8f.3 for ; Fri, 13 Dec 2024 09:32:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111158; x=1734715958; 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=q06RjwqfoGMqijUanpYdiBSZsyuy9j4pDBF+J1wv7+I=; b=IsI7w3kn/tLlhLu/uEo/yp+UJKIKeVVCoIkBNVcPRnLt1ncYjBo2x4pyZPdl2gCDmQ M2RBY48eZJ4dTkeAc5RrzHkjGK+tuOyxev4lDdSzfaHTy2pa64sxq7Zxj48armGUTBEu aMz4B7300iuk4WedtBaeZVFlFGbBrdHW6bM6NjSa4mEgcXdXuoRucn0v42C6LcM9b3Qf P+zibzkBtfhufMwRbQDTCbJq2TtF006vu6xzdfFVPl/TYlWmayucrTOMldw0TIcAPL/p lBTVkeLa4M2mGImxloUSMWe18HK4giWWz5iHAnbND0Ne/zlPsJs3ljQK6OUtP/g8Y41H m5JQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111158; x=1734715958; 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=q06RjwqfoGMqijUanpYdiBSZsyuy9j4pDBF+J1wv7+I=; b=bcsIgKLh834AeMcyiYiMXuWMseAWYxQMLEwXb0b1/2pdR6o4L28l8Gv3xOkeS+/IEZ aLadPpXIpf+sA9pXnGh+rQ2QZ3Rnb3GoRbW0p7bFvzKBQj1d3eXhndRe2ur0mi1tWljK YnaIU3C+Llid4qjsV5ZXqnk0lXihUM4DTovyig/ZleRIt80WRo7ge3YDh1jMnduaCbyl C0joaF+hsm8ciF6E/LsnOo8jX6JPix3CPhT+QGAlnmKW3hsXXkJnnfscs+3KYdRSf+5Y rrtnlKUunV5H9zfMNzJyD5b8PmTjOKeYFP+8MvfXzHjAjXkigen2FcIJcPmE8OJGxWa3 tVqQ== X-Gm-Message-State: AOJu0YyM7hcSdr3HdF0vEJUJaL1Z65ocBdmaVrGkGrigoiDZeGWGzXQL yg128eCUKcBEZs3UT/a6gFs9xRJP5NCfDWLcf4QkTv2qlmAfoqcIgs+JjodhDzPnzZyjazIbTUI + X-Gm-Gg: ASbGncsDxB/WuN18eEdunS5A2YTbI5F1O5WpjIj7HVFudInyKKgeWo7mvUZIoq1dS+c JtYe/p/3J83yeBIxCqNnj4x47tjPxRrTrAvriLMUb1hYJD1U8SGXv7R2Rv6ROdnfuabE/N/+aSx Xhzj8sZj30R6JIoytxclQ2w6b5wmJuZEb8C/0zM0K2RPerO9s7Or3HKEdqxh2hQQ5XoKqqIc8ff 43y2CBwwHvqBNThOWt+NJj6pnZvZYBajylefporlXcPllHxhAJY6UjER7dymg== X-Received: by 2002:a05:6000:1449:b0:382:4b43:c3a with SMTP id ffacd0b85a97d-38880abfc98mr2623030f8f.2.1734111158277; Fri, 13 Dec 2024 09:32:38 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.32.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:32:37 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 06/85] target/arm: Convert PACGA to decodetree Date: Fri, 13 Dec 2024 17:31:10 +0000 Message-Id: <20241213173229.3308926-7-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Remove disas_data_proc_2src, as this was the last insn decoded by that function. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-7-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 2 ++ target/arm/tcg/translate-a64.c | 65 ++++++---------------------------- 2 files changed, 13 insertions(+), 54 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index f0a5ffb1cd8..a23d6a6645b 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -682,6 +682,8 @@ SUBPS 1 01 11010110 ..... 000000 ..... ..... @rrr IRG 1 00 11010110 ..... 000100 ..... ..... @rrr GMI 1 00 11010110 ..... 000101 ..... ..... @rrr +PACGA 1 00 11010110 ..... 001100 ..... ..... @rrr + # Data Processing (1-source) # Logical (shifted reg) # Add/subtract (shifted reg) diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 00e55d42ffd..ca8b644dc7a 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -7674,6 +7674,16 @@ static bool trans_GMI(DisasContext *s, arg_rrr *a) return false; } +static bool trans_PACGA(DisasContext *s, arg_rrr *a) +{ + if (dc_isar_feature(aa64_pauth, s)) { + gen_helper_pacga(cpu_reg(s, a->rd), tcg_env, + cpu_reg(s, a->rn), cpu_reg_sp(s, a->rm)); + return true; + } + return false; +} + /* Logical (shifted register) * 31 30 29 28 24 23 22 21 20 16 15 10 9 5 4 0 * +----+-----+-----------+-------+---+------+--------+------+------+ @@ -8555,59 +8565,6 @@ static void disas_data_proc_1src(DisasContext *s, uint32_t insn) } -/* Data-processing (2 source) - * 31 30 29 28 21 20 16 15 10 9 5 4 0 - * +----+---+---+-----------------+------+--------+------+------+ - * | sf | 0 | S | 1 1 0 1 0 1 1 0 | Rm | opcode | Rn | Rd | - * +----+---+---+-----------------+------+--------+------+------+ - */ -static void disas_data_proc_2src(DisasContext *s, uint32_t insn) -{ - unsigned int sf, rm, opcode, rn, rd, setflag; - sf = extract32(insn, 31, 1); - setflag = extract32(insn, 29, 1); - rm = extract32(insn, 16, 5); - opcode = extract32(insn, 10, 6); - rn = extract32(insn, 5, 5); - rd = extract32(insn, 0, 5); - - if (setflag && opcode != 0) { - unallocated_encoding(s); - return; - } - - switch (opcode) { - case 12: /* PACGA */ - if (sf == 0 || !dc_isar_feature(aa64_pauth, s)) { - goto do_unallocated; - } - gen_helper_pacga(cpu_reg(s, rd), tcg_env, - cpu_reg(s, rn), cpu_reg_sp(s, rm)); - break; - default: - do_unallocated: - case 0: /* SUBP(S) */ - case 2: /* UDIV */ - case 3: /* SDIV */ - case 4: /* IRG */ - case 5: /* GMI */ - case 8: /* LSLV */ - case 9: /* LSRV */ - case 10: /* ASRV */ - case 11: /* RORV */ - case 16: - case 17: - case 18: - case 19: - case 20: - case 21: - case 22: - case 23: /* CRC32 */ - unallocated_encoding(s); - break; - } -} - /* * Data processing - register * 31 30 29 28 25 21 20 16 10 0 @@ -8674,7 +8631,7 @@ static void disas_data_proc_reg(DisasContext *s, uint32_t insn) if (op0) { /* (1 source) */ disas_data_proc_1src(s, insn); } else { /* (2 source) */ - disas_data_proc_2src(s, insn); + goto do_unallocated; } break; case 0x8 ... 0xf: /* (3 source) */ From patchwork Fri Dec 13 17:31:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850198 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1642477wry; Fri, 13 Dec 2024 09:43:27 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXGMSY4X7kL5W9/OCB15e+C9bIzqXefvE11+0x4l+78uW38hZCj2oMAlRlaP2sCm5Yawk9Akg==@linaro.org X-Google-Smtp-Source: AGHT+IG8OZWijXiHDxpvGsNLpVFQnUsezOgyAT5Eohp+GUFqqr3wMwUSahple5zF1pLMa7CgAa1T X-Received: by 2002:a17:907:6ea5:b0:aa6:423c:850e with SMTP id a640c23a62f3a-aab779ab54cmr325241566b.27.1734111807209; Fri, 13 Dec 2024 09:43:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111807; cv=none; d=google.com; s=arc-20240605; b=jJEVSydBGQ5miZzu2QJYW/SKU61nzbNSv+YFCbGeP8hNw429PhB7Kflht0R8afjNo0 LWDz9yCkCKwx8qOOQgKoOt8r+Oka77QbYFhKGV1AD9kpgUNpFus8/kWKbAOwXvJNWUV5 zT6QQzcwkEzN+Ck5mHBtm25AFdZv5LoNh5o5iKyfQ/IXWaTyxhvuzTTRph5UnMd0D7i0 w0iy/1JSA/BTVPV7hjkDbKS9h9lwqC+3TaVxHlT8YAq64Kux1Fwr1oa82xLhg6tY7wZ7 cEu0BE70WjqU9iSavNNSo3xE0AUR+l1xtfezW37Ey3WaEAW90lHsEz5EUX1le1JgT8h5 j4oQ== 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=2sM+UOA2cp8i3U3AHbd+sbKrYDIWz0dTXq1tSSSgIlU=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=lu31SpgHE1rHSrM3bvFkwx5kmwLbFYzsiUd8Jq7HKgMrNQ9Io9PX7uuwhDfMkmLBxT +M9cIP+JsV12vVc17XZG0AxUPSItwdKeQVnP5y0Eqjue2mY6ftGIQ8XEokJbPajnnC7n wjraHJ87nL9mmkGaUCJH99I+UDfqRdZSSuMthC1NkLKk3Mx0lKebCdEGjyCB+EzEoTBB 8bWmy5j/LZpCDnyv0xX9LErR0ot/1fsa8HR4ca+p5YOSRClgghZkxv8R73+6+v2F19jb gUn3S0jzjC7XwMoQE0kZ8Uhb6jZ0XbEuZboA1oazs37Clk8UFvwvXiVbw7+1yHuZJYpk fBIQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=F4Wa1DX2; 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 a640c23a62f3a-aa658614edcsi972893266b.620.2024.12.13.09.43.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:43: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=F4Wa1DX2; 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 1tM9XZ-0007O4-VA; Fri, 13 Dec 2024 12:33:26 -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 1tM9Wv-0006t5-Dv for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:32:48 -0500 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9Wt-0001Si-Fz for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:32:45 -0500 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-385ddcfc97bso1544693f8f.1 for ; Fri, 13 Dec 2024 09:32:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111159; x=1734715959; 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=2sM+UOA2cp8i3U3AHbd+sbKrYDIWz0dTXq1tSSSgIlU=; b=F4Wa1DX2TdHw+DSJE2R+7dFez2oCOS+xA7ppUClQ5/4JHC4bTEKMwTcejIgb6boaYM uhV1VKk+HBFdjc7SkufhCHLGd4WiStXiqezGxJxxPiNUKOHAfRyZi5x5hbeOn9ClJw+U bY18xugWDw/mAln6lgQC9277SSpYeSY9JO79fWpSw/MEJhHVKicdgMp5a0KX3k4thFkU A1p1wbCo4RLbTWuVJqqGX62IqoR9ywb9SVeZSfBzIjQDvq3AfQL5lgnrFQEvlq3FHjA9 Erheqavg+AS9IVO7g7zII0ocFWE992QFABzHRf657m8/T9cGUE8vGxCYrUp45yUd3kVF HwVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111159; x=1734715959; 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=2sM+UOA2cp8i3U3AHbd+sbKrYDIWz0dTXq1tSSSgIlU=; b=oaopO6Ppn3tYT19dcqTgXzqWbKkwClYT0g3xPErJBUsDCVnvdvSQ8JeufNoYovzA0i GAP8WaNBfzJMeS5fGCHUbUgpsfiCqb7Ay6vgEn0c53Xdmu6vyKWfn861Be2mPl4j7+FD i1lKFX/dSRmfegpmM2cTdSR1i0E9fbYjIavtfsCWvHe6/rYqZ0B8diEMv2DDtobNUeMW QXmmIRvnrHGYW4SafHTPabKJbqbLPRcpzWQcg/qIcmxspM05E5AjxDRrrfA3TGQ5caCo 1qg9rZdkNToVuvtyxyqcK9ZJ5796tJGopqfsTlsd5Zz3T0Fpv9JdoqulrB4WOsNjc9yB YHOg== X-Gm-Message-State: AOJu0YzTFXMBl8cZkGcKAki4B0K4gVAZQ/mrwSdQlwXyoy7/nr+j5+jR SnUp9NxT5/CAvU57SGqAeB7KD3k03GHX4jyG1HAtnRjQrdj7YvcPpHa4yvVzPTYL4UvWl8bFH2t P X-Gm-Gg: ASbGncu9NYjSaFs2RF8hHtqFg0ztSNptUGwPuO4sPQ8X+4YcIqeBfGrFqsjWBdNiiAC JUbXZYe6nm5nM2pLFTKO0o3qB+B6UYaUw6we04h2K8KBXPjaosd3Jse2zU5I1+J34dsJVG0nBXK 39urTzWXMn7JY3vhwTYHYz0rcELuHAGmfoolpxSnTyIJqx4Ih7nhOcpO3lLp3jSvNC6F+rBF0Jw 63ilIHPcMJtQNACxa27CP/EEw7AWckQBtJcrmYu2Wp3ho682KZmwKioFrzldg== X-Received: by 2002:a5d:5f52:0:b0:385:ec6e:e87a with SMTP id ffacd0b85a97d-3888e0f4784mr2536885f8f.43.1734111159509; Fri, 13 Dec 2024 09:32:39 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.32.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:32:38 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 07/85] target/arm: Convert RBIT, REV16, REV32, REV64 to decodetree Date: Fri, 13 Dec 2024 17:31:11 +0000 Message-Id: <20241213173229.3308926-8-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-8-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 11 +++ target/arm/tcg/translate-a64.c | 137 +++++++++++++++------------------ 2 files changed, 72 insertions(+), 76 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index a23d6a6645b..dd44651f340 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -28,6 +28,8 @@ &r rn &rrr rd rn rm &ri rd imm +&rr rd rn +&rr_sf rd rn sf &rri_sf rd rn imm sf &rrr_sf rd rn rm sf &i imm @@ -685,6 +687,15 @@ GMI 1 00 11010110 ..... 000101 ..... ..... @rrr PACGA 1 00 11010110 ..... 001100 ..... ..... @rrr # Data Processing (1-source) + +@rr . .......... ..... ...... rn:5 rd:5 &rr +@rr_sf sf:1 .......... ..... ...... rn:5 rd:5 &rr_sf + +RBIT . 10 11010110 00000 000000 ..... ..... @rr_sf +REV16 . 10 11010110 00000 000001 ..... ..... @rr_sf +REV32 . 10 11010110 00000 000010 ..... ..... @rr_sf +REV64 1 10 11010110 00000 000011 ..... ..... @rr + # Logical (shifted reg) # Add/subtract (shifted reg) # Add/subtract (extended reg) diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index ca8b644dc7a..1805d77f43c 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -7684,6 +7684,60 @@ static bool trans_PACGA(DisasContext *s, arg_rrr *a) return false; } +typedef void ArithOneOp(TCGv_i64, TCGv_i64); + +static bool gen_rr(DisasContext *s, int rd, int rn, ArithOneOp fn) +{ + fn(cpu_reg(s, rd), cpu_reg(s, rn)); + return true; +} + +static void gen_rbit32(TCGv_i64 tcg_rd, TCGv_i64 tcg_rn) +{ + TCGv_i32 t32 = tcg_temp_new_i32(); + + tcg_gen_extrl_i64_i32(t32, tcg_rn); + gen_helper_rbit(t32, t32); + tcg_gen_extu_i32_i64(tcg_rd, t32); +} + +static void gen_rev16_xx(TCGv_i64 tcg_rd, TCGv_i64 tcg_rn, TCGv_i64 mask) +{ + TCGv_i64 tcg_tmp = tcg_temp_new_i64(); + + tcg_gen_shri_i64(tcg_tmp, tcg_rn, 8); + tcg_gen_and_i64(tcg_rd, tcg_rn, mask); + tcg_gen_and_i64(tcg_tmp, tcg_tmp, mask); + tcg_gen_shli_i64(tcg_rd, tcg_rd, 8); + tcg_gen_or_i64(tcg_rd, tcg_rd, tcg_tmp); +} + +static void gen_rev16_32(TCGv_i64 tcg_rd, TCGv_i64 tcg_rn) +{ + gen_rev16_xx(tcg_rd, tcg_rn, tcg_constant_i64(0x00ff00ff)); +} + +static void gen_rev16_64(TCGv_i64 tcg_rd, TCGv_i64 tcg_rn) +{ + gen_rev16_xx(tcg_rd, tcg_rn, tcg_constant_i64(0x00ff00ff00ff00ffull)); +} + +static void gen_rev_32(TCGv_i64 tcg_rd, TCGv_i64 tcg_rn) +{ + tcg_gen_bswap32_i64(tcg_rd, tcg_rn, TCG_BSWAP_OZ); +} + +static void gen_rev32(TCGv_i64 tcg_rd, TCGv_i64 tcg_rn) +{ + tcg_gen_bswap64_i64(tcg_rd, tcg_rn); + tcg_gen_rotri_i64(tcg_rd, tcg_rd, 32); +} + +TRANS(RBIT, gen_rr, a->rd, a->rn, a->sf ? gen_helper_rbit64 : gen_rbit32) +TRANS(REV16, gen_rr, a->rd, a->rn, a->sf ? gen_rev16_64 : gen_rev16_32) +TRANS(REV32, gen_rr, a->rd, a->rn, a->sf ? gen_rev32 : gen_rev_32) +TRANS(REV64, gen_rr, a->rd, a->rn, tcg_gen_bswap64_i64) + /* Logical (shifted register) * 31 30 29 28 24 23 22 21 20 16 15 10 9 5 4 0 * +----+-----+-----------+-------+---+------+--------+------+------+ @@ -8302,67 +8356,6 @@ static void handle_cls(DisasContext *s, unsigned int sf, } } -static void handle_rbit(DisasContext *s, unsigned int sf, - unsigned int rn, unsigned int rd) -{ - TCGv_i64 tcg_rd, tcg_rn; - tcg_rd = cpu_reg(s, rd); - tcg_rn = cpu_reg(s, rn); - - if (sf) { - gen_helper_rbit64(tcg_rd, tcg_rn); - } else { - TCGv_i32 tcg_tmp32 = tcg_temp_new_i32(); - tcg_gen_extrl_i64_i32(tcg_tmp32, tcg_rn); - gen_helper_rbit(tcg_tmp32, tcg_tmp32); - tcg_gen_extu_i32_i64(tcg_rd, tcg_tmp32); - } -} - -/* REV with sf==1, opcode==3 ("REV64") */ -static void handle_rev64(DisasContext *s, unsigned int sf, - unsigned int rn, unsigned int rd) -{ - if (!sf) { - unallocated_encoding(s); - return; - } - tcg_gen_bswap64_i64(cpu_reg(s, rd), cpu_reg(s, rn)); -} - -/* REV with sf==0, opcode==2 - * REV32 (sf==1, opcode==2) - */ -static void handle_rev32(DisasContext *s, unsigned int sf, - unsigned int rn, unsigned int rd) -{ - TCGv_i64 tcg_rd = cpu_reg(s, rd); - TCGv_i64 tcg_rn = cpu_reg(s, rn); - - if (sf) { - tcg_gen_bswap64_i64(tcg_rd, tcg_rn); - tcg_gen_rotri_i64(tcg_rd, tcg_rd, 32); - } else { - tcg_gen_bswap32_i64(tcg_rd, tcg_rn, TCG_BSWAP_OZ); - } -} - -/* REV16 (opcode==1) */ -static void handle_rev16(DisasContext *s, unsigned int sf, - unsigned int rn, unsigned int rd) -{ - TCGv_i64 tcg_rd = cpu_reg(s, rd); - TCGv_i64 tcg_tmp = tcg_temp_new_i64(); - TCGv_i64 tcg_rn = read_cpu_reg(s, rn, sf); - TCGv_i64 mask = tcg_constant_i64(sf ? 0x00ff00ff00ff00ffull : 0x00ff00ff); - - tcg_gen_shri_i64(tcg_tmp, tcg_rn, 8); - tcg_gen_and_i64(tcg_rd, tcg_rn, mask); - tcg_gen_and_i64(tcg_tmp, tcg_tmp, mask); - tcg_gen_shli_i64(tcg_rd, tcg_rd, 8); - tcg_gen_or_i64(tcg_rd, tcg_rd, tcg_tmp); -} - /* Data-processing (1 source) * 31 30 29 28 21 20 16 15 10 9 5 4 0 * +----+---+---+-----------------+---------+--------+------+------+ @@ -8388,21 +8381,6 @@ static void disas_data_proc_1src(DisasContext *s, uint32_t insn) #define MAP(SF, O2, O1) ((SF) | (O1 << 1) | (O2 << 7)) switch (MAP(sf, opcode2, opcode)) { - case MAP(0, 0x00, 0x00): /* RBIT */ - case MAP(1, 0x00, 0x00): - handle_rbit(s, sf, rn, rd); - break; - case MAP(0, 0x00, 0x01): /* REV16 */ - case MAP(1, 0x00, 0x01): - handle_rev16(s, sf, rn, rd); - break; - case MAP(0, 0x00, 0x02): /* REV/REV32 */ - case MAP(1, 0x00, 0x02): - handle_rev32(s, sf, rn, rd); - break; - case MAP(1, 0x00, 0x03): /* REV64 */ - handle_rev64(s, sf, rn, rd); - break; case MAP(0, 0x00, 0x04): /* CLZ */ case MAP(1, 0x00, 0x04): handle_clz(s, sf, rn, rd); @@ -8557,6 +8535,13 @@ static void disas_data_proc_1src(DisasContext *s, uint32_t insn) break; default: do_unallocated: + case MAP(0, 0x00, 0x00): /* RBIT */ + case MAP(1, 0x00, 0x00): + case MAP(0, 0x00, 0x01): /* REV16 */ + case MAP(1, 0x00, 0x01): + case MAP(0, 0x00, 0x02): /* REV/REV32 */ + case MAP(1, 0x00, 0x02): + case MAP(1, 0x00, 0x03): /* REV64 */ unallocated_encoding(s); break; } From patchwork Fri Dec 13 17:31:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850150 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1638414wry; Fri, 13 Dec 2024 09:34:46 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVG5xO6DxMjrVgmgDJkd37yJnLQ+0pFVlHBaMiw2tzM/HTiiS9Quy8jc4h8Liu8fmFjpVOL7g==@linaro.org X-Google-Smtp-Source: AGHT+IEPev6a+x/VULGCOiVqGRuGTh3/slB4zqPbg60L70Runw59/o0roHpYa6Xsk7SKY737zhiE X-Received: by 2002:a05:6000:18a5:b0:386:3a8e:64bd with SMTP id ffacd0b85a97d-38880ad912fmr2988485f8f.22.1734111285838; Fri, 13 Dec 2024 09:34:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111285; cv=none; d=google.com; s=arc-20240605; b=FJVzk7V+LG0dDGU0a2PJQibDd7VnEvn5Xps/XEaxwKkcDVTLd4RJIsSDL0JIva+R1c 18rBc/K3TqimhU6qSQlgHsDDXuzhzA9XwPOcQXVv/79PUlFZpuUGLcxfYGPd4qDsxzGl YIN+K2wRE+1a36rEu4kDZnheto83EwsW4BNeicIBvM7cQmgPIxSCH1kQZl5Q7ZMYCUER Cfd9zqyfmH3xsKVwND3Uth9rpTJN4Oivi9JrAhqHn2YcGAgK5i7nbR4DuZ1KdMxkX+4X zf5JKPDl8FeNzivX5Uj+h+SDt0/1s/2qSZZh8INAUDd2xxDOT9MY9SKcx/lfhnO9Bg+Z H7+w== 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=rSouMkNKRgzvSW4AYEFfz23zzhUYufmzAA64c5qsrK8=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=SrTdziKuTShEPFkFm8sIvJvdO5LQCXOdLEfkQILigglBGA1iqUaCAv5eraW7wh2Alg Qf8ip5o7/hjyygLPDHvXPvEnyPgqBVLJ2WV3wN/rJkuD4As4ld76UkmEzz9cvWGinZ2u 43yQQw6GuHiMebXmn7iPIM7oczaB2gAzX8GEJbcocNBYW+C6Yx8glCobfGarIJH6et2O rFKGWujROBZcT52UPvrO5wiHnZhKp1KW4VucON9TjJ4vprQ7Ji/kMRgIpmB+Mn4dqsv7 CLPeD6mTokMsH1wtD0/WOCODvvGdk/vlSG56Pu6w2ARgI578aW7VPj7bfHuRfTsMDjPq sdFA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RuzGa8fd; 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 5b1f17b1804b1-4362580f9c4si22538745e9.195.2024.12.13.09.34.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:34:45 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RuzGa8fd; 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 1tM9XY-0007Kw-2y; Fri, 13 Dec 2024 12:33:24 -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 1tM9Wu-0006ss-1c for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:32:46 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9Ws-0001Sq-5Y for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:32:43 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-435004228c0so24456375e9.0 for ; Fri, 13 Dec 2024 09:32:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111160; x=1734715960; 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=rSouMkNKRgzvSW4AYEFfz23zzhUYufmzAA64c5qsrK8=; b=RuzGa8fd3SFow1wBGMsc3SfPnYUSOPY3nOFlng/xS2aZmz8YI47q2dqj/IdvqWOmJ6 GhWyueFoA0dB7WhJXEaIAbhvAAqh7WMlckN8faNRyzp0LKzE+1LmLVSC5iEEMMprd0Wa c+c96Kd5MWGoXCWCaf/LC2To0bgeZg9EPkXZIW3AK5pP4qwxu/GoK4GGY78zrqOT9AaG /2nq5ip0Kl8QjxEH6WCkG6Aiay83NMFZ8vPPQELFMh6FL4qgInQGHaKZyKC33a9nJ1lA z9RDA/ZzeScOgqE7ptIrnWI6vDDq+T/jcdgO4XRtjZinUjBJ6INJjVEfx11vEGAMwhVT ZRKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111160; x=1734715960; 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=rSouMkNKRgzvSW4AYEFfz23zzhUYufmzAA64c5qsrK8=; b=CBRGMALfL5kgSQzINSLVqi8LYdaPm4Ay+CqK6NI/3u457dYvoTSu13dgIPyD8CiICl k/7HdAujiz+6bYoIy2SxIlNI1wNorIG0N7Pq7fXidOdbO3m1tWYjX9uZQL4HP7NjmgoR UiRdUw65/BWO67uL7IOhNgZPdkTCOba04aN7tFM/YkaTlOLzFzu8CeM8n/zvYD4IZQ+h p/51rsyyMncYxojWuSHjaGheV7374d0Ol5e7B0Vq2kEl+3Enit9Aj4rPl3MN4AMCQdvl 7M5wBSEHDrPb6jDD1uQUUqwK7axp/F1HPfXuQ61zyjIje5GeI4RA9tu2KgrT7ZG/Soox 6bNw== X-Gm-Message-State: AOJu0Yxd6pnHo+iolv7cGE5aKE/10GYr8U0Qlh8SePnD0atLJ4j0G+m+ a1c8bSc/GOt0IaS456j1wfWJr/pDmQS71SOYGmjbCa8stk2/9EU68wlM88MwUe1RPeLzCetTD1i H X-Gm-Gg: ASbGncuXTX9UkAtKuWgFBWqGVDJwnR1qCwjBWyTe5OK6chSrmYLqVOYJQtUyrO3vIps wSwInK/5v8uHt7qaG8bibLL91nt3UuSZJc4qj+oJhTZETNFXEPf3I8jQZGiYqnSP4tCqSCr/JRo W5Zil2zh+6btWgWkLXznVNCLol67oDD78tW0F7fZty8y2n6LSTvvci1G8FJbY2pYejpakELucgU C11YeRrAQZgMhCA3yaecppKwYAxos/jBsR7cNf6n6Lc0NaHX3i6N5ZEG7OL3w== X-Received: by 2002:a05:6000:18a5:b0:386:3a8e:64bd with SMTP id ffacd0b85a97d-38880ad912fmr2982634f8f.22.1734111160579; Fri, 13 Dec 2024 09:32:40 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.32.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:32:39 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 08/85] target/arm: Convert CLZ, CLS to decodetree Date: Fri, 13 Dec 2024 17:31:12 +0000 Message-Id: <20241213173229.3308926-9-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x335.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: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-9-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 3 ++ target/arm/tcg/translate-a64.c | 72 ++++++++++++++-------------------- 2 files changed, 33 insertions(+), 42 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index dd44651f340..410eaa9333a 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -696,6 +696,9 @@ REV16 . 10 11010110 00000 000001 ..... ..... @rr_sf REV32 . 10 11010110 00000 000010 ..... ..... @rr_sf REV64 1 10 11010110 00000 000011 ..... ..... @rr +CLZ . 10 11010110 00000 000100 ..... ..... @rr_sf +CLS . 10 11010110 00000 000101 ..... ..... @rr_sf + # Logical (shifted reg) # Add/subtract (shifted reg) # Add/subtract (extended reg) diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 1805d77f43c..552b45b4e25 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -7738,6 +7738,32 @@ TRANS(REV16, gen_rr, a->rd, a->rn, a->sf ? gen_rev16_64 : gen_rev16_32) TRANS(REV32, gen_rr, a->rd, a->rn, a->sf ? gen_rev32 : gen_rev_32) TRANS(REV64, gen_rr, a->rd, a->rn, tcg_gen_bswap64_i64) +static void gen_clz32(TCGv_i64 tcg_rd, TCGv_i64 tcg_rn) +{ + TCGv_i32 t32 = tcg_temp_new_i32(); + + tcg_gen_extrl_i64_i32(t32, tcg_rn); + tcg_gen_clzi_i32(t32, t32, 32); + tcg_gen_extu_i32_i64(tcg_rd, t32); +} + +static void gen_clz64(TCGv_i64 tcg_rd, TCGv_i64 tcg_rn) +{ + tcg_gen_clzi_i64(tcg_rd, tcg_rn, 64); +} + +static void gen_cls32(TCGv_i64 tcg_rd, TCGv_i64 tcg_rn) +{ + TCGv_i32 t32 = tcg_temp_new_i32(); + + tcg_gen_extrl_i64_i32(t32, tcg_rn); + tcg_gen_clrsb_i32(t32, t32); + tcg_gen_extu_i32_i64(tcg_rd, t32); +} + +TRANS(CLZ, gen_rr, a->rd, a->rn, a->sf ? gen_clz64 : gen_clz32) +TRANS(CLS, gen_rr, a->rd, a->rn, a->sf ? tcg_gen_clrsb_i64 : gen_cls32) + /* Logical (shifted register) * 31 30 29 28 24 23 22 21 20 16 15 10 9 5 4 0 * +----+-----+-----------+-------+---+------+--------+------+------+ @@ -8322,40 +8348,6 @@ static void disas_cond_select(DisasContext *s, uint32_t insn) } } -static void handle_clz(DisasContext *s, unsigned int sf, - unsigned int rn, unsigned int rd) -{ - TCGv_i64 tcg_rd, tcg_rn; - tcg_rd = cpu_reg(s, rd); - tcg_rn = cpu_reg(s, rn); - - if (sf) { - tcg_gen_clzi_i64(tcg_rd, tcg_rn, 64); - } else { - TCGv_i32 tcg_tmp32 = tcg_temp_new_i32(); - tcg_gen_extrl_i64_i32(tcg_tmp32, tcg_rn); - tcg_gen_clzi_i32(tcg_tmp32, tcg_tmp32, 32); - tcg_gen_extu_i32_i64(tcg_rd, tcg_tmp32); - } -} - -static void handle_cls(DisasContext *s, unsigned int sf, - unsigned int rn, unsigned int rd) -{ - TCGv_i64 tcg_rd, tcg_rn; - tcg_rd = cpu_reg(s, rd); - tcg_rn = cpu_reg(s, rn); - - if (sf) { - tcg_gen_clrsb_i64(tcg_rd, tcg_rn); - } else { - TCGv_i32 tcg_tmp32 = tcg_temp_new_i32(); - tcg_gen_extrl_i64_i32(tcg_tmp32, tcg_rn); - tcg_gen_clrsb_i32(tcg_tmp32, tcg_tmp32); - tcg_gen_extu_i32_i64(tcg_rd, tcg_tmp32); - } -} - /* Data-processing (1 source) * 31 30 29 28 21 20 16 15 10 9 5 4 0 * +----+---+---+-----------------+---------+--------+------+------+ @@ -8381,14 +8373,6 @@ static void disas_data_proc_1src(DisasContext *s, uint32_t insn) #define MAP(SF, O2, O1) ((SF) | (O1 << 1) | (O2 << 7)) switch (MAP(sf, opcode2, opcode)) { - case MAP(0, 0x00, 0x04): /* CLZ */ - case MAP(1, 0x00, 0x04): - handle_clz(s, sf, rn, rd); - break; - case MAP(0, 0x00, 0x05): /* CLS */ - case MAP(1, 0x00, 0x05): - handle_cls(s, sf, rn, rd); - break; case MAP(1, 0x01, 0x00): /* PACIA */ if (s->pauth_active) { tcg_rd = cpu_reg(s, rd); @@ -8542,6 +8526,10 @@ static void disas_data_proc_1src(DisasContext *s, uint32_t insn) case MAP(0, 0x00, 0x02): /* REV/REV32 */ case MAP(1, 0x00, 0x02): case MAP(1, 0x00, 0x03): /* REV64 */ + case MAP(0, 0x00, 0x04): /* CLZ */ + case MAP(1, 0x00, 0x04): + case MAP(0, 0x00, 0x05): /* CLS */ + case MAP(1, 0x00, 0x05): unallocated_encoding(s); break; } From patchwork Fri Dec 13 17:31:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850189 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1641853wry; Fri, 13 Dec 2024 09:42:04 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXyyryKOCl7G5BHnrZBjgwHbnARDRnynaLj3a2L0VZIvgWut9qVxoJFK08nmjskB6XpgsB+EA==@linaro.org X-Google-Smtp-Source: AGHT+IHnI5UIz/qdh8uh46afrX731ZJESS9X6tw8BW7DxWSn/L3VtWCAAHT83isrbtjoSC9AmEKT X-Received: by 2002:a05:6000:788:b0:382:38e6:1eb3 with SMTP id ffacd0b85a97d-3888e0b8dfemr2720358f8f.30.1734111724192; Fri, 13 Dec 2024 09:42:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111724; cv=none; d=google.com; s=arc-20240605; b=Q+UJHgt5fwouL8QIro98w7yHaX5hdgJc/c3m1Cs8mSobHSvgBxhocAyTDlDZNzgs4o vz09li7P6B8IwITixyCIAwqYz8mYNzkapYxcImbKbUlq9GMMBHhrT7qZ90ThnjND3koq BoVUrOAYotye9rwWzY3VPv2pSq221TiDD4h/NN25nWLMfI7voChFwjUFMq0dpvT0nXZ9 UWzn52v13QCU8XRXrjPQUCRAxSqr9zUVDhumVAdmei7vYa35KYKWHzMmS3PwL1p/ScuD mya+flK1XJC4zH0eoioQkXvUKjJW8N1ze37e0dh3Fqo1dK6cXudtmfPpsgWSlGs69JlB sOWA== 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=EBSmh2JvbG3lqDA5UwswMxC5/gv97mG/gQWeUl8yalg=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=Qgg2FpKLZxHtjvdmM6Uyup8mJc4RgaUOFlEKBqxZeYfKAq6D1+jijh38/4zAV1pJJv gbgTxGfqavI2RwxCnVEJPkTT8dvvEwT4WOD5VshNEdYzOKVWvzkLxDKdFlE/SJJ3SPUJ nbebayNeu361181GZuVvPW2Og/EkpgQXJD1ptWGZRNIbzYSEf0y/OJ53pyPuHOp1HGGn EoDe1IAYmgCQ3KAmKzVk73rzqHQRQVMqzEhI1a4GH8Mn7X7vxPIfk/46LyFlK1edjukt U3tWCXd5aSjgBTUYw9NftzD/a/L07drAxLbTHM4zuHKAnTXcXgQ9AiO525vBcTVRQxCj zbhg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IbWKLbsw; 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 ffacd0b85a97d-388c8062825si37544f8f.579.2024.12.13.09.42.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:42:04 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IbWKLbsw; 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 1tM9XZ-0007Nv-JC; Fri, 13 Dec 2024 12:33:25 -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 1tM9Wy-0006ty-Ux for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:32:51 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9Wt-0001TI-Jh for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:32:48 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-4361f65ca01so19204775e9.1 for ; Fri, 13 Dec 2024 09:32:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111162; x=1734715962; 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=EBSmh2JvbG3lqDA5UwswMxC5/gv97mG/gQWeUl8yalg=; b=IbWKLbsw0O6A9QUm+2nnQt7nsWDP3FeLh3u7pkX5zF72PohGtgrl43UXgHoRpPTqs5 Gt6nVZNiisLMtgfGPETiWFiYUHNBwRFyQ0X9qF82TiHEUfOXjgGJNeNcgf05WHZzPwxG uvcw7pOJzkS9ZfX09SgaqNcy5ygA7fZohxflxKt/B/1KY/5ivtL5doXwyu7Gq+I6G6JA i1U154/ocGwwzQNx9moRTL4qkINX9u5saqzagF1G/14DX6oZ32C20FZQeirqfiADQs+T WArwOe8GM9orlTKvbaKvYeImMqpnvwaXkZotXpJyI+CtHbR+9vIMKPTlmY1zgkzBwAAC MIpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111162; x=1734715962; 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=EBSmh2JvbG3lqDA5UwswMxC5/gv97mG/gQWeUl8yalg=; b=f4iovKPxlSBbrJa+HHrGkAuWt0EPuQKsj61SWWYHBksCgfZYN/w1G2jETd7c1x61UV 8jPEwm/4XbUjIu6HFaPQOsvcikgP92q57ieQl2XrPcpUGaNNbeJdOYtZszV/Wog5Wjn2 XZg2VJXxXTBRHuACqmNf9/hJdzjYaGhRqC6TjtnddcL873kE9id1wQljg042CxX39+jZ k0jb4psQ7ufLzRuwBzBdYmS3b1xY1ZTM5Sfseal9e10u2ZQzMwOj+J82x0NHDpIdM5jU gFTD0FNZozVAGeolxoiTyI8ps0uNi1lGIltsHIgl+7gtdiTrhqmvkt87odB6bdbgw/x+ 4FpQ== X-Gm-Message-State: AOJu0YycBWut5EHBXUjMoW6X9qFdo9x+MXgz2dO6ziqSfuVzHnwW993h WK3hwQiMzpAr4WV7ZzfhKDmhWVlAyn4AEBu3xb4yCZ51ba1WlO6mifXegQ9qmw9Mmt+KiyWlW3J u X-Gm-Gg: ASbGnctSaGho1opuNeC2ra9wSg2USEablP2mK86KqdrlNfRhF/7n1aNoruVBjbWJY7N 4tv0RpHMQ2Sv39MZ0CC+heQlzMx5CIhnVHZ33b/lhIgFp4on3qbpDA1rRV284Xh3q8tmQFFDK9X do0jbRPQoHqbOuy/KshGJv2LQeGs2k3qFFTWqs1VyfYUkxmEvpcN6ZeMXYTGzS9vzgnH8FkGziZ tYxia8ZdbODDATf5FSSaN8s3yBDHUNzaiv/D/Kls4B4O8zYLqncllfHcPaLig== X-Received: by 2002:a05:600c:4f86:b0:434:f9ad:7238 with SMTP id 5b1f17b1804b1-4362aa9de1bmr25038005e9.22.1734111161723; Fri, 13 Dec 2024 09:32:41 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.32.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:32:40 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 09/85] target/arm: Convert PAC[ID]*, AUT[ID]* to decodetree Date: Fri, 13 Dec 2024 17:31:13 +0000 Message-Id: <20241213173229.3308926-10-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x334.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: Richard Henderson This includes PACIA, PACIZA, PACIB, PACIZB, PACDA, PACDZA, PACDB, PACDZB, AUTIA, AUTIZA, AUTIB, AUTIZB, AUTDA, AUTDZA, AUTDB, AUTDZB. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-10-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 13 +++ target/arm/tcg/translate-a64.c | 173 +++++++++------------------------ 2 files changed, 58 insertions(+), 128 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 410eaa9333a..9083ac4ac30 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -699,6 +699,19 @@ REV64 1 10 11010110 00000 000011 ..... ..... @rr CLZ . 10 11010110 00000 000100 ..... ..... @rr_sf CLS . 10 11010110 00000 000101 ..... ..... @rr_sf +&pacaut rd rn z +@pacaut . .. ........ ..... .. z:1 ... rn:5 rd:5 &pacaut + +PACIA 1 10 11010110 00001 00.000 ..... ..... @pacaut +PACIB 1 10 11010110 00001 00.001 ..... ..... @pacaut +PACDA 1 10 11010110 00001 00.010 ..... ..... @pacaut +PACDB 1 10 11010110 00001 00.011 ..... ..... @pacaut + +AUTIA 1 10 11010110 00001 00.100 ..... ..... @pacaut +AUTIB 1 10 11010110 00001 00.101 ..... ..... @pacaut +AUTDA 1 10 11010110 00001 00.110 ..... ..... @pacaut +AUTDB 1 10 11010110 00001 00.111 ..... ..... @pacaut + # Logical (shifted reg) # Add/subtract (shifted reg) # Add/subtract (extended reg) diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 552b45b4e25..852545dfcc2 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -7764,6 +7764,35 @@ static void gen_cls32(TCGv_i64 tcg_rd, TCGv_i64 tcg_rn) TRANS(CLZ, gen_rr, a->rd, a->rn, a->sf ? gen_clz64 : gen_clz32) TRANS(CLS, gen_rr, a->rd, a->rn, a->sf ? tcg_gen_clrsb_i64 : gen_cls32) +static bool gen_pacaut(DisasContext *s, arg_pacaut *a, NeonGenTwo64OpEnvFn fn) +{ + TCGv_i64 tcg_rd, tcg_rn; + + if (a->z) { + if (a->rn != 31) { + return false; + } + tcg_rn = tcg_constant_i64(0); + } else { + tcg_rn = cpu_reg_sp(s, a->rn); + } + if (s->pauth_active) { + tcg_rd = cpu_reg(s, a->rd); + fn(tcg_rd, tcg_env, tcg_rd, tcg_rn); + } + return true; +} + +TRANS_FEAT(PACIA, aa64_pauth, gen_pacaut, a, gen_helper_pacia) +TRANS_FEAT(PACIB, aa64_pauth, gen_pacaut, a, gen_helper_pacib) +TRANS_FEAT(PACDA, aa64_pauth, gen_pacaut, a, gen_helper_pacda) +TRANS_FEAT(PACDB, aa64_pauth, gen_pacaut, a, gen_helper_pacdb) + +TRANS_FEAT(AUTIA, aa64_pauth, gen_pacaut, a, gen_helper_autia) +TRANS_FEAT(AUTIB, aa64_pauth, gen_pacaut, a, gen_helper_autib) +TRANS_FEAT(AUTDA, aa64_pauth, gen_pacaut, a, gen_helper_autda) +TRANS_FEAT(AUTDB, aa64_pauth, gen_pacaut, a, gen_helper_autdb) + /* Logical (shifted register) * 31 30 29 28 24 23 22 21 20 16 15 10 9 5 4 0 * +----+-----+-----------+-------+---+------+--------+------+------+ @@ -8373,134 +8402,6 @@ static void disas_data_proc_1src(DisasContext *s, uint32_t insn) #define MAP(SF, O2, O1) ((SF) | (O1 << 1) | (O2 << 7)) switch (MAP(sf, opcode2, opcode)) { - case MAP(1, 0x01, 0x00): /* PACIA */ - if (s->pauth_active) { - tcg_rd = cpu_reg(s, rd); - gen_helper_pacia(tcg_rd, tcg_env, tcg_rd, cpu_reg_sp(s, rn)); - } else if (!dc_isar_feature(aa64_pauth, s)) { - goto do_unallocated; - } - break; - case MAP(1, 0x01, 0x01): /* PACIB */ - if (s->pauth_active) { - tcg_rd = cpu_reg(s, rd); - gen_helper_pacib(tcg_rd, tcg_env, tcg_rd, cpu_reg_sp(s, rn)); - } else if (!dc_isar_feature(aa64_pauth, s)) { - goto do_unallocated; - } - break; - case MAP(1, 0x01, 0x02): /* PACDA */ - if (s->pauth_active) { - tcg_rd = cpu_reg(s, rd); - gen_helper_pacda(tcg_rd, tcg_env, tcg_rd, cpu_reg_sp(s, rn)); - } else if (!dc_isar_feature(aa64_pauth, s)) { - goto do_unallocated; - } - break; - case MAP(1, 0x01, 0x03): /* PACDB */ - if (s->pauth_active) { - tcg_rd = cpu_reg(s, rd); - gen_helper_pacdb(tcg_rd, tcg_env, tcg_rd, cpu_reg_sp(s, rn)); - } else if (!dc_isar_feature(aa64_pauth, s)) { - goto do_unallocated; - } - break; - case MAP(1, 0x01, 0x04): /* AUTIA */ - if (s->pauth_active) { - tcg_rd = cpu_reg(s, rd); - gen_helper_autia(tcg_rd, tcg_env, tcg_rd, cpu_reg_sp(s, rn)); - } else if (!dc_isar_feature(aa64_pauth, s)) { - goto do_unallocated; - } - break; - case MAP(1, 0x01, 0x05): /* AUTIB */ - if (s->pauth_active) { - tcg_rd = cpu_reg(s, rd); - gen_helper_autib(tcg_rd, tcg_env, tcg_rd, cpu_reg_sp(s, rn)); - } else if (!dc_isar_feature(aa64_pauth, s)) { - goto do_unallocated; - } - break; - case MAP(1, 0x01, 0x06): /* AUTDA */ - if (s->pauth_active) { - tcg_rd = cpu_reg(s, rd); - gen_helper_autda(tcg_rd, tcg_env, tcg_rd, cpu_reg_sp(s, rn)); - } else if (!dc_isar_feature(aa64_pauth, s)) { - goto do_unallocated; - } - break; - case MAP(1, 0x01, 0x07): /* AUTDB */ - if (s->pauth_active) { - tcg_rd = cpu_reg(s, rd); - gen_helper_autdb(tcg_rd, tcg_env, tcg_rd, cpu_reg_sp(s, rn)); - } else if (!dc_isar_feature(aa64_pauth, s)) { - goto do_unallocated; - } - break; - case MAP(1, 0x01, 0x08): /* PACIZA */ - if (!dc_isar_feature(aa64_pauth, s) || rn != 31) { - goto do_unallocated; - } else if (s->pauth_active) { - tcg_rd = cpu_reg(s, rd); - gen_helper_pacia(tcg_rd, tcg_env, tcg_rd, tcg_constant_i64(0)); - } - break; - case MAP(1, 0x01, 0x09): /* PACIZB */ - if (!dc_isar_feature(aa64_pauth, s) || rn != 31) { - goto do_unallocated; - } else if (s->pauth_active) { - tcg_rd = cpu_reg(s, rd); - gen_helper_pacib(tcg_rd, tcg_env, tcg_rd, tcg_constant_i64(0)); - } - break; - case MAP(1, 0x01, 0x0a): /* PACDZA */ - if (!dc_isar_feature(aa64_pauth, s) || rn != 31) { - goto do_unallocated; - } else if (s->pauth_active) { - tcg_rd = cpu_reg(s, rd); - gen_helper_pacda(tcg_rd, tcg_env, tcg_rd, tcg_constant_i64(0)); - } - break; - case MAP(1, 0x01, 0x0b): /* PACDZB */ - if (!dc_isar_feature(aa64_pauth, s) || rn != 31) { - goto do_unallocated; - } else if (s->pauth_active) { - tcg_rd = cpu_reg(s, rd); - gen_helper_pacdb(tcg_rd, tcg_env, tcg_rd, tcg_constant_i64(0)); - } - break; - case MAP(1, 0x01, 0x0c): /* AUTIZA */ - if (!dc_isar_feature(aa64_pauth, s) || rn != 31) { - goto do_unallocated; - } else if (s->pauth_active) { - tcg_rd = cpu_reg(s, rd); - gen_helper_autia(tcg_rd, tcg_env, tcg_rd, tcg_constant_i64(0)); - } - break; - case MAP(1, 0x01, 0x0d): /* AUTIZB */ - if (!dc_isar_feature(aa64_pauth, s) || rn != 31) { - goto do_unallocated; - } else if (s->pauth_active) { - tcg_rd = cpu_reg(s, rd); - gen_helper_autib(tcg_rd, tcg_env, tcg_rd, tcg_constant_i64(0)); - } - break; - case MAP(1, 0x01, 0x0e): /* AUTDZA */ - if (!dc_isar_feature(aa64_pauth, s) || rn != 31) { - goto do_unallocated; - } else if (s->pauth_active) { - tcg_rd = cpu_reg(s, rd); - gen_helper_autda(tcg_rd, tcg_env, tcg_rd, tcg_constant_i64(0)); - } - break; - case MAP(1, 0x01, 0x0f): /* AUTDZB */ - if (!dc_isar_feature(aa64_pauth, s) || rn != 31) { - goto do_unallocated; - } else if (s->pauth_active) { - tcg_rd = cpu_reg(s, rd); - gen_helper_autdb(tcg_rd, tcg_env, tcg_rd, tcg_constant_i64(0)); - } - break; case MAP(1, 0x01, 0x10): /* XPACI */ if (!dc_isar_feature(aa64_pauth, s) || rn != 31) { goto do_unallocated; @@ -8530,6 +8431,22 @@ static void disas_data_proc_1src(DisasContext *s, uint32_t insn) case MAP(1, 0x00, 0x04): case MAP(0, 0x00, 0x05): /* CLS */ case MAP(1, 0x00, 0x05): + case MAP(1, 0x01, 0x00): /* PACIA */ + case MAP(1, 0x01, 0x01): /* PACIB */ + case MAP(1, 0x01, 0x02): /* PACDA */ + case MAP(1, 0x01, 0x03): /* PACDB */ + case MAP(1, 0x01, 0x04): /* AUTIA */ + case MAP(1, 0x01, 0x05): /* AUTIB */ + case MAP(1, 0x01, 0x06): /* AUTDA */ + case MAP(1, 0x01, 0x07): /* AUTDB */ + case MAP(1, 0x01, 0x08): /* PACIZA */ + case MAP(1, 0x01, 0x09): /* PACIZB */ + case MAP(1, 0x01, 0x0a): /* PACDZA */ + case MAP(1, 0x01, 0x0b): /* PACDZB */ + case MAP(1, 0x01, 0x0c): /* AUTIZA */ + case MAP(1, 0x01, 0x0d): /* AUTIZB */ + case MAP(1, 0x01, 0x0e): /* AUTDZA */ + case MAP(1, 0x01, 0x0f): /* AUTDZB */ unallocated_encoding(s); break; } From patchwork Fri Dec 13 17:31:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850170 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1640445wry; Fri, 13 Dec 2024 09:39:01 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWP4e87U4uUAuA0mrcZQM1ZmEnIMZ4e0F7bBj3qBnsbmOhnsD8u97wXxZ+XlzhrYLAwjl1dYg==@linaro.org X-Google-Smtp-Source: AGHT+IHTHoIkgk1Rfb6h7c6/MK8TVxAIG+q+3aqJFsOMYSciI8wYNbAkfGDkIAF31k1fstjrbiLK X-Received: by 2002:a17:907:86a1:b0:aa6:7ab4:4597 with SMTP id a640c23a62f3a-aab77e8277bmr405333566b.39.1734111541798; Fri, 13 Dec 2024 09:39:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111541; cv=none; d=google.com; s=arc-20240605; b=PcgMbAajO9VXmJk7wHloexaZ/xLan7OpTptMughm9g3/pF6WrjlyEIF6qdrukw9tte pXAb7+IXEdsX99fiR2LiEoaFrhT6+/McrINMWXMTLfPfrr4BZ77EgTCChHXcKOltVY/K KbN68IEwKVsgHSmCejuIi24Pz2gLLrYjC4VAKYj8lexXZC6klTRW7Jq8TmjUK2tIQUN5 kWgjazHtSiY9Ip7bm7f61dTl74jZOipsx51h9hEPrHJlY/sNu3UkF/B9IB/p41UXAZwx pzYNZfYaibEx9MGfS7NM6qVNG4yFCN1/smu7Af66mFy5mwD/67+uuF1b5Nzelbzlzono eK4w== 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=0SEh1YhqeT/Prmk+UdNRkslDKNsy4cS4QQDVYqwULJc=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=Bs6cRdspvkC98ZruN0LiBlx4OqYjp1L99UwsHcbV1SpTfEtRYaranWKT7oQjjYETh1 5dO99WbuxrbSEX5abmml5KGvIRf7igWpLegyFQFXRViv7M+XvLgZap4buKeZtjxiuaQc qdgfarCzm8Jg/V7PYY5DOOXpcwHSYsyhVS7VO+x4QNlZKkLOeVbXlSjftr0Db5omM/kC AgsgjG3OcOo39XJxH3isSwq3gQNmq99An/sCHwGGozySx3nHG4i2JUFH8Pxm6n4w9oiy j7wg675nGkWv0vaX41AxlBe44/4QZ+bwNnVDf/JKZ3AlvpftBk9L0eiINVf0gc5YlcO5 QcfQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="nP/qcvOl"; 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 4fb4d7f45d1cf-5d652f2fd55si42256a12.201.2024.12.13.09.39.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:39: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="nP/qcvOl"; 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 1tM9Xb-0007Qm-0K; Fri, 13 Dec 2024 12:33:27 -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 1tM9X0-0006xi-T5 for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:32:52 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9Wx-0001Tb-Ky for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:32:49 -0500 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-43634b570c1so2402535e9.0 for ; Fri, 13 Dec 2024 09:32:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111163; x=1734715963; 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=0SEh1YhqeT/Prmk+UdNRkslDKNsy4cS4QQDVYqwULJc=; b=nP/qcvOl0ggPZeg+IyJkhnWECwnuH7TGmzCqmRPVQWIGNsrqXoC+tOCcJ6MhrHJNvh HitsrATKrjnoVSQAuWlqPq5dkV46lNoqtFctDXMvyZ1bYU10sszkUsDfvnxbrBI5Hbpb JsmMRxgC6lNH6atrZDO+DYW37xge+qEWIQvHVQRmMb7ReN7LCTVcFrcdX1XFtLrUQTfE oK1/zrdiL5qMSq0xMw7plD7+OcSUYUsxP5TT2JLbJFpfxd4oof8aQsHFURUc40VGGv79 m4W3RK13EEPvhFL10tjHVG80ayxBtf/zvJGtBXW1kbqmb44LkNo3niJbjsaV+JctFbug isdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111163; x=1734715963; 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=0SEh1YhqeT/Prmk+UdNRkslDKNsy4cS4QQDVYqwULJc=; b=QMfpKXIVptQdG3kTDLqJSNSvqYmnTByYKzwDkl7H0+uiJ7S1oq6Ma5dIhBYZawAwe3 tnO1K+du0xE5BMfKKAnshRVJj4mwN99zmWExXrBEKn/14BKy1Kgs2vW7uMspewXDqLkt OY6xO0jwxujFPGZUphICXz53IQToCNxCuWSd4LtUQTHYMosucF8cQRFSaCJGaSno+pwu 0UJhLu8PpDW1dnd5EHIKejo9cHwVxeZ/itjs2RuWUfKxfPPP4E6wC3PUkSza2k2aPKDs Mr0hjXaY5hOrKUE1hXYK/dizwXo39RimcPNU+/pJ6igHdJHTRFp1mlk7VIkBefExeJ3o Hzwg== X-Gm-Message-State: AOJu0YyCK5CB8xTUMWC+hlBzYkumTBg+GdU8gLwgiW2KnNOVWp3mB4gH /0bKABCbFYoYdvPB3afhaKUF34zKVqZyBRrjjps3WEpJGYr7qkaUI2ejRNur8dgi/ZKbzxX+mwh 5 X-Gm-Gg: ASbGncuo2MaHjhb3fvTIBEScmnjI9ChE/l2ku8644QeLUPSxc/hHTi4RsZz1nSnWUQb UPXigsnzF/pzqBHZC9Itf7TmUTyEMPISG3kmGuGYp8GCvuuE+Gz6NgRO9rYc1Y5T8YRCIqsQjqQ wyzxfNdUTSKKBRt3B7/u7UcuXJ08zdXa74DKaUJ2qEhAgsSduSt1oQGE2kNJXKRFO19U9Qi8m6b uDT654NEQWLjeEly/z+Sq9KTTDA601iX0bMvCP8TQNaKLu6uPpgglZJMBaKDw== X-Received: by 2002:a5d:6801:0:b0:388:c75c:e839 with SMTP id ffacd0b85a97d-388c75ce895mr527468f8f.42.1734111162737; Fri, 13 Dec 2024 09:32:42 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.32.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:32:42 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 10/85] target/arm: Convert XPAC[ID] to decodetree Date: Fri, 13 Dec 2024 17:31:14 +0000 Message-Id: <20241213173229.3308926-11-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32b.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: Richard Henderson Remove disas_data_proc_1src, as these were the last insns decoded by that function. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-11-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 3 ++ target/arm/tcg/translate-a64.c | 99 +++++----------------------------- 2 files changed, 16 insertions(+), 86 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 9083ac4ac30..0e04ab6ce45 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -712,6 +712,9 @@ AUTIB 1 10 11010110 00001 00.101 ..... ..... @pacaut AUTDA 1 10 11010110 00001 00.110 ..... ..... @pacaut AUTDB 1 10 11010110 00001 00.111 ..... ..... @pacaut +XPACI 1 10 11010110 00001 010000 11111 rd:5 +XPACD 1 10 11010110 00001 010001 11111 rd:5 + # Logical (shifted reg) # Add/subtract (shifted reg) # Add/subtract (extended reg) diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 852545dfcc2..d92fe682998 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -7793,6 +7793,18 @@ TRANS_FEAT(AUTIB, aa64_pauth, gen_pacaut, a, gen_helper_autib) TRANS_FEAT(AUTDA, aa64_pauth, gen_pacaut, a, gen_helper_autda) TRANS_FEAT(AUTDB, aa64_pauth, gen_pacaut, a, gen_helper_autdb) +static bool do_xpac(DisasContext *s, int rd, NeonGenOne64OpEnvFn *fn) +{ + if (s->pauth_active) { + TCGv_i64 tcg_rd = cpu_reg(s, rd); + fn(tcg_rd, tcg_env, tcg_rd); + } + return true; +} + +TRANS_FEAT(XPACI, aa64_pauth, do_xpac, a->rd, gen_helper_xpaci) +TRANS_FEAT(XPACD, aa64_pauth, do_xpac, a->rd, gen_helper_xpacd) + /* Logical (shifted register) * 31 30 29 28 24 23 22 21 20 16 15 10 9 5 4 0 * +----+-----+-----------+-------+---+------+--------+------+------+ @@ -8377,84 +8389,6 @@ static void disas_cond_select(DisasContext *s, uint32_t insn) } } -/* Data-processing (1 source) - * 31 30 29 28 21 20 16 15 10 9 5 4 0 - * +----+---+---+-----------------+---------+--------+------+------+ - * | sf | 1 | S | 1 1 0 1 0 1 1 0 | opcode2 | opcode | Rn | Rd | - * +----+---+---+-----------------+---------+--------+------+------+ - */ -static void disas_data_proc_1src(DisasContext *s, uint32_t insn) -{ - unsigned int sf, opcode, opcode2, rn, rd; - TCGv_i64 tcg_rd; - - if (extract32(insn, 29, 1)) { - unallocated_encoding(s); - return; - } - - sf = extract32(insn, 31, 1); - opcode = extract32(insn, 10, 6); - opcode2 = extract32(insn, 16, 5); - rn = extract32(insn, 5, 5); - rd = extract32(insn, 0, 5); - -#define MAP(SF, O2, O1) ((SF) | (O1 << 1) | (O2 << 7)) - - switch (MAP(sf, opcode2, opcode)) { - case MAP(1, 0x01, 0x10): /* XPACI */ - if (!dc_isar_feature(aa64_pauth, s) || rn != 31) { - goto do_unallocated; - } else if (s->pauth_active) { - tcg_rd = cpu_reg(s, rd); - gen_helper_xpaci(tcg_rd, tcg_env, tcg_rd); - } - break; - case MAP(1, 0x01, 0x11): /* XPACD */ - if (!dc_isar_feature(aa64_pauth, s) || rn != 31) { - goto do_unallocated; - } else if (s->pauth_active) { - tcg_rd = cpu_reg(s, rd); - gen_helper_xpacd(tcg_rd, tcg_env, tcg_rd); - } - break; - default: - do_unallocated: - case MAP(0, 0x00, 0x00): /* RBIT */ - case MAP(1, 0x00, 0x00): - case MAP(0, 0x00, 0x01): /* REV16 */ - case MAP(1, 0x00, 0x01): - case MAP(0, 0x00, 0x02): /* REV/REV32 */ - case MAP(1, 0x00, 0x02): - case MAP(1, 0x00, 0x03): /* REV64 */ - case MAP(0, 0x00, 0x04): /* CLZ */ - case MAP(1, 0x00, 0x04): - case MAP(0, 0x00, 0x05): /* CLS */ - case MAP(1, 0x00, 0x05): - case MAP(1, 0x01, 0x00): /* PACIA */ - case MAP(1, 0x01, 0x01): /* PACIB */ - case MAP(1, 0x01, 0x02): /* PACDA */ - case MAP(1, 0x01, 0x03): /* PACDB */ - case MAP(1, 0x01, 0x04): /* AUTIA */ - case MAP(1, 0x01, 0x05): /* AUTIB */ - case MAP(1, 0x01, 0x06): /* AUTDA */ - case MAP(1, 0x01, 0x07): /* AUTDB */ - case MAP(1, 0x01, 0x08): /* PACIZA */ - case MAP(1, 0x01, 0x09): /* PACIZB */ - case MAP(1, 0x01, 0x0a): /* PACDZA */ - case MAP(1, 0x01, 0x0b): /* PACDZB */ - case MAP(1, 0x01, 0x0c): /* AUTIZA */ - case MAP(1, 0x01, 0x0d): /* AUTIZB */ - case MAP(1, 0x01, 0x0e): /* AUTDZA */ - case MAP(1, 0x01, 0x0f): /* AUTDZB */ - unallocated_encoding(s); - break; - } - -#undef MAP -} - - /* * Data processing - register * 31 30 29 28 25 21 20 16 10 0 @@ -8464,7 +8398,6 @@ static void disas_data_proc_1src(DisasContext *s, uint32_t insn) */ static void disas_data_proc_reg(DisasContext *s, uint32_t insn) { - int op0 = extract32(insn, 30, 1); int op1 = extract32(insn, 28, 1); int op2 = extract32(insn, 21, 4); int op3 = extract32(insn, 10, 6); @@ -8517,19 +8450,13 @@ static void disas_data_proc_reg(DisasContext *s, uint32_t insn) disas_cond_select(s, insn); break; - case 0x6: /* Data-processing */ - if (op0) { /* (1 source) */ - disas_data_proc_1src(s, insn); - } else { /* (2 source) */ - goto do_unallocated; - } - break; case 0x8 ... 0xf: /* (3 source) */ disas_data_proc_3src(s, insn); break; default: do_unallocated: + case 0x6: /* Data-processing */ unallocated_encoding(s); break; } From patchwork Fri Dec 13 17:31:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850183 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1641456wry; Fri, 13 Dec 2024 09:41:12 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUxJnnptHLqofL8tHOga0t8qWRphmOagrwvs0IZho64Y6PzNL12OvaSkeF3t7Rat4ApgmgNTA==@linaro.org X-Google-Smtp-Source: AGHT+IHWP7PGUR6zqy7Jg3DgmkNOg0p97C8q+ZMYiDmEa/1MG6Id9lSIlPgKlSVDSnmiiwXEHhcA X-Received: by 2002:a5d:64ac:0:b0:386:37f8:451c with SMTP id ffacd0b85a97d-387887c24f0mr7442955f8f.1.1734111672166; Fri, 13 Dec 2024 09:41:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111672; cv=none; d=google.com; s=arc-20240605; b=SvxELXD93XtQ3LSMmhlWphdnQdoElT2p1VExipx7KQ4yVhDiJhIVUeL6MP0o6/7gYv 2slK7lIZY/zG88SmBSlwr77qQ4n2OPoTanm2QxxOl1v5oowCoIp9sA5QQ5VcgD7aH3ln e/Ol7zpxOfkyIp71URkO3dIF4VhYBrhuGmSav3aEumJr8Nx973dXKZk9J3xTUxptjgSD 8DEE0A9LHzwxjXjVnXe0CrgXKLtRhG5VOCL7T7nZEBiGkbJYtOP0S0tKDZBv2BMJmvk4 wD4ngo80gKZ7vL2JFpf+P/UjmJ28qLKvUEx6klFlHf67VgjAqbSHOqQs1YScqOWxCnmz BaRw== 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=nyg3hHWYvzMVHGHFrG6Pm7O2QdQHuSqbcEqkeJB/Av0=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=BP1CsHkGdu+HhJAifMVWdPdMXIAop4AXaUUc00ozzbbuAyTS7m95E3SLD4H50y1lJ6 5d4QLh/6MmJOtbwmTaRHDIFDZLcwiv3xvZhp1ay94RGTsRFtVJcouSvnScQVYsCEutnI +dT9+O3zB23Eajx7uaeVuOxqrY8tlU5jYFNct/ixVkGV0yvxXtboByUElLqr/nMUZCyq B/iWoFPb7CY7XZUkAckO0qlON+t/8+MA6S5iZXmaSlLU/SfYuNyiIfgrc9V4kQO8t62y OmYc71jKp0fhDE4YjPyX+3qhtUIBpmp9WAhFymQxdNBirTJE+FlPk6icMKSrw3Af8Uud pjGA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ByYRkmze; 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 ffacd0b85a97d-388c8011cf2si54384f8f.190.2024.12.13.09.41.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:41: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=ByYRkmze; 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 1tM9Y7-0008NR-8F; Fri, 13 Dec 2024 12:34: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 1tM9Wx-0006tb-Lr for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:32:49 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9Wv-0001Tp-AV for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:32:47 -0500 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-3862d16b4f5so1351483f8f.0 for ; Fri, 13 Dec 2024 09:32:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111164; x=1734715964; 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=nyg3hHWYvzMVHGHFrG6Pm7O2QdQHuSqbcEqkeJB/Av0=; b=ByYRkmzekkw645rN3OWKkNlZ99ilN/VMrVaovliz5S9W73C8jTYRMvCILNWQF1/Fz6 3HZbzJocK+dkIrE3qVlN8rsxxrG9ExvETG8gterrIzCpNIhcq2Y8hT0PDNs7fyT95x0m NtidPSntu4HbFuLKLS95QKwu3jxRyDSLXOJyL07Ze4TnaX3SEmnIEoJf0pzIbrDLsQv7 dK31D9aq76fqEiR3zaFk7oENVZO1jioR4Liy/OYR0hhnFsinp9d82dToX5Hw6P/YRGAb PbiDvBWA5NnZnlITQAFvGhxC7v0xmBzWPHrzIgFDm4Qs+cfSLVncWGdaiuag46RVfPyg a92w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111164; x=1734715964; 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=nyg3hHWYvzMVHGHFrG6Pm7O2QdQHuSqbcEqkeJB/Av0=; b=IGXvrj8XxcK5Iozew3714I5LgQ9MY6Nd2M97h6DrXLzD3iLYwunTopRze5s41FrIVF BHPhtqJV3HodhpOKRqxlf3yQtbDKSJOFmQp8bQtno+5CdyNxB1m8BoDTVIpzg/sH5CPJ hSI6dpfCJfDo+rK9Pj5RLEFxNT4n+XL6y+WGuRMM2Z3/+OhnbpRpKA15EcWbswF8F6Ux ++T203MFsLr7KReLgaQ5t/61FePiQ4eI4se5YPR3bi7MGu7nHHkt9yX/wrrJM9hwDd3d IFyzzLDY8Y9pForq3z6kmHgf8PNwc3VL0FVs/F64rarUIXz9Qy80iXFEsC34vwK7RDxr OKPw== X-Gm-Message-State: AOJu0YxDNhECuRkhbF9N1dtGhfc13ujViMQw72qsQV30AJC8wGs1TWl7 gHhqEENIc7aH6KrhdidunMPOZO7UQjnWK6NBpvKHVzmCmiC1lnZSy1i+D/+jcFkNdrV1MJYbqae E X-Gm-Gg: ASbGncv4I7Mp9fvNMhf0UczGxM9fscEkXo5GzSpo+acehOJQttRgXl3ofMYZIKV56PI 8AryUkoGncyaU4AUb3TxEVxZGyWAMiVpX0rKp5Fl9kn+DM3+4MtNVouoKUSs5nbEvbcdxpu+9+k qnPRq5F5Oa7+98wJVfVnwlrV8qo/UNtqQtPWDAnkxFs0TA3e3Nm6cCuB6MtIzY19FiPd3qr+zMv uePXdwnKWcRGMiX2STbLUwYM3vK/5XXrRCJ9Mg/+Yn8puMcSuJOAr5wKv3mfw== X-Received: by 2002:a5d:47c6:0:b0:386:37bb:ddf8 with SMTP id ffacd0b85a97d-387887b8642mr6746433f8f.6.1734111163726; Fri, 13 Dec 2024 09:32:43 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.32.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:32:43 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 11/85] target/arm: Convert disas_logic_reg to decodetree Date: Fri, 13 Dec 2024 17:31:15 +0000 Message-Id: <20241213173229.3308926-12-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson This includes AND, BIC, ORR, ORN, EOR, EON, ANDS, BICS (shifted reg). Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-12-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 9 +++ target/arm/tcg/translate-a64.c | 117 ++++++++++++--------------------- 2 files changed, 51 insertions(+), 75 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 0e04ab6ce45..8e2949d2361 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -716,6 +716,15 @@ XPACI 1 10 11010110 00001 010000 11111 rd:5 XPACD 1 10 11010110 00001 010001 11111 rd:5 # Logical (shifted reg) + +&logic_shift rd rn rm sf sa st n +@logic_shift sf:1 .. ..... st:2 n:1 rm:5 sa:6 rn:5 rd:5 &logic_shift + +AND_r . 00 01010 .. . ..... ...... ..... ..... @logic_shift +ORR_r . 01 01010 .. . ..... ...... ..... ..... @logic_shift +EOR_r . 10 01010 .. . ..... ...... ..... ..... @logic_shift +ANDS_r . 11 01010 .. . ..... ...... ..... ..... @logic_shift + # Add/subtract (shifted reg) # Add/subtract (extended reg) # Add/subtract (carry) diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index d92fe682998..ecc8899dd84 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -7805,96 +7805,65 @@ static bool do_xpac(DisasContext *s, int rd, NeonGenOne64OpEnvFn *fn) TRANS_FEAT(XPACI, aa64_pauth, do_xpac, a->rd, gen_helper_xpaci) TRANS_FEAT(XPACD, aa64_pauth, do_xpac, a->rd, gen_helper_xpacd) -/* Logical (shifted register) - * 31 30 29 28 24 23 22 21 20 16 15 10 9 5 4 0 - * +----+-----+-----------+-------+---+------+--------+------+------+ - * | sf | opc | 0 1 0 1 0 | shift | N | Rm | imm6 | Rn | Rd | - * +----+-----+-----------+-------+---+------+--------+------+------+ - */ -static void disas_logic_reg(DisasContext *s, uint32_t insn) +static bool do_logic_reg(DisasContext *s, arg_logic_shift *a, + ArithTwoOp *fn, ArithTwoOp *inv_fn, bool setflags) { TCGv_i64 tcg_rd, tcg_rn, tcg_rm; - unsigned int sf, opc, shift_type, invert, rm, shift_amount, rn, rd; - sf = extract32(insn, 31, 1); - opc = extract32(insn, 29, 2); - shift_type = extract32(insn, 22, 2); - invert = extract32(insn, 21, 1); - rm = extract32(insn, 16, 5); - shift_amount = extract32(insn, 10, 6); - rn = extract32(insn, 5, 5); - rd = extract32(insn, 0, 5); - - if (!sf && (shift_amount & (1 << 5))) { - unallocated_encoding(s); - return; + if (!a->sf && (a->sa & (1 << 5))) { + return false; } - tcg_rd = cpu_reg(s, rd); + tcg_rd = cpu_reg(s, a->rd); + tcg_rn = cpu_reg(s, a->rn); - if (opc == 1 && shift_amount == 0 && shift_type == 0 && rn == 31) { - /* Unshifted ORR and ORN with WZR/XZR is the standard encoding for - * register-register MOV and MVN, so it is worth special casing. - */ - tcg_rm = cpu_reg(s, rm); - if (invert) { + tcg_rm = read_cpu_reg(s, a->rm, a->sf); + if (a->sa) { + shift_reg_imm(tcg_rm, tcg_rm, a->sf, a->st, a->sa); + } + + (a->n ? inv_fn : fn)(tcg_rd, tcg_rn, tcg_rm); + if (!a->sf) { + tcg_gen_ext32u_i64(tcg_rd, tcg_rd); + } + if (setflags) { + gen_logic_CC(a->sf, tcg_rd); + } + return true; +} + +static bool trans_ORR_r(DisasContext *s, arg_logic_shift *a) +{ + /* + * Unshifted ORR and ORN with WZR/XZR is the standard encoding for + * register-register MOV and MVN, so it is worth special casing. + */ + if (a->sa == 0 && a->st == 0 && a->rn == 31) { + TCGv_i64 tcg_rd = cpu_reg(s, a->rd); + TCGv_i64 tcg_rm = cpu_reg(s, a->rm); + + if (a->n) { tcg_gen_not_i64(tcg_rd, tcg_rm); - if (!sf) { + if (!a->sf) { tcg_gen_ext32u_i64(tcg_rd, tcg_rd); } } else { - if (sf) { + if (a->sf) { tcg_gen_mov_i64(tcg_rd, tcg_rm); } else { tcg_gen_ext32u_i64(tcg_rd, tcg_rm); } } - return; + return true; } - tcg_rm = read_cpu_reg(s, rm, sf); - - if (shift_amount) { - shift_reg_imm(tcg_rm, tcg_rm, sf, shift_type, shift_amount); - } - - tcg_rn = cpu_reg(s, rn); - - switch (opc | (invert << 2)) { - case 0: /* AND */ - case 3: /* ANDS */ - tcg_gen_and_i64(tcg_rd, tcg_rn, tcg_rm); - break; - case 1: /* ORR */ - tcg_gen_or_i64(tcg_rd, tcg_rn, tcg_rm); - break; - case 2: /* EOR */ - tcg_gen_xor_i64(tcg_rd, tcg_rn, tcg_rm); - break; - case 4: /* BIC */ - case 7: /* BICS */ - tcg_gen_andc_i64(tcg_rd, tcg_rn, tcg_rm); - break; - case 5: /* ORN */ - tcg_gen_orc_i64(tcg_rd, tcg_rn, tcg_rm); - break; - case 6: /* EON */ - tcg_gen_eqv_i64(tcg_rd, tcg_rn, tcg_rm); - break; - default: - assert(FALSE); - break; - } - - if (!sf) { - tcg_gen_ext32u_i64(tcg_rd, tcg_rd); - } - - if (opc == 3) { - gen_logic_CC(sf, tcg_rd); - } + return do_logic_reg(s, a, tcg_gen_or_i64, tcg_gen_orc_i64, false); } +TRANS(AND_r, do_logic_reg, a, tcg_gen_and_i64, tcg_gen_andc_i64, false) +TRANS(ANDS_r, do_logic_reg, a, tcg_gen_and_i64, tcg_gen_andc_i64, true) +TRANS(EOR_r, do_logic_reg, a, tcg_gen_xor_i64, tcg_gen_eqv_i64, false) + /* * Add/subtract (extended register) * @@ -8411,11 +8380,9 @@ static void disas_data_proc_reg(DisasContext *s, uint32_t insn) /* Add/sub (shifted register) */ disas_add_sub_reg(s, insn); } - } else { - /* Logical (shifted register) */ - disas_logic_reg(s, insn); + return; } - return; + goto do_unallocated; } switch (op2) { From patchwork Fri Dec 13 17:31:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850148 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1638387wry; Fri, 13 Dec 2024 09:34:42 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXlTUXo52vUFIdBRwteUFcXKRv4Wg2peHa7Se+EOygtazJbTULGrZ7DyXOByLk6dtyds3sf4Q==@linaro.org X-Google-Smtp-Source: AGHT+IF8cI7VIcfeoJQybnjywhraxmVCuXhUtbhTNa6GRZ2VEb91evNLBkJsuQxiZvC6zVeI9o+B X-Received: by 2002:a05:6402:50d0:b0:5d0:9054:b119 with SMTP id 4fb4d7f45d1cf-5d63c3dc1d3mr6416750a12.21.1734111282098; Fri, 13 Dec 2024 09:34:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111282; cv=none; d=google.com; s=arc-20240605; b=BuI1x1L7tcsX0RMvXY0c4PBYKCLsTQslUZ2GDKqLRw23jo9+nEOfjphQHyFmUv0JWy 6fjx5MPKt32h/rs00rGDGjzDV15BHU8/PsAAHSCtErlMQGKAVRtVBQw3gthoiMIno2HR cllpGylYSe5nepZSdiaVb2zGendRZCGqZ5LCA9QHxviaHb8IOqzjRqzScOCAC7J2lgZx 4xcEOqBsxZB9zTKIPMrVeAIqQTxiuJ/l4F/lKcRW3IZ3k5ufT3QAOf3uMKlBPOZw4kgC ABywaO2cfJFlxsUCBPFllwICwjZVfBIrXOUyW8JkIVLcy0QZ62J5twzFzBdIsPG/e4/v os3g== 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=sFYMlM2q6ifWyTSOYq7MTYvofuvINKuts8GiQDOUAdE=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=YBEPKWH0TAOqA2GTPkFniDBSDDYK+bsN5g4dEhjNNeTG07hQCufgBpGYBzh+K3zIgf 5v1UEWmHruWCiv/onfh5yUeEkJe+gL+IJf+FpFGTGfoDcgNj8/CVOipmbl5wBgebl/Im hAMKdxLpEmML79kZoP7vWFNHhZDAxj8ZnyLdI8DbzjD1WHjhEWGdzB7qoyEVuAWydPco t9eEb4ZOd/xElw/wD8zjnK6B66sEUpW6W5mdRGc4fX9Xbd9dfU0RTS87oVW8R+PSvKCy BywBH3+y48XeMvgKyo2zwmCrj09coL0gzK9tEzJtL7PGpdjBh3upWj14HOyle5vStGjZ 6HUw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="ZR1R/NWG"; 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 a640c23a62f3a-aa6818fae28si841156966b.480.2024.12.13.09.34.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:34: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="ZR1R/NWG"; 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 1tM9XY-0007Lj-EW; Fri, 13 Dec 2024 12:33:24 -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 1tM9Wz-0006tz-1F for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:32:51 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9Ww-0001Ty-8e for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:32:48 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-435004228c0so24457205e9.0 for ; Fri, 13 Dec 2024 09:32:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111165; x=1734715965; 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=sFYMlM2q6ifWyTSOYq7MTYvofuvINKuts8GiQDOUAdE=; b=ZR1R/NWGCiD9CdvH9FjKsWVd/EZ8nkkuPlcud5uDS9jzEu4gPUMMTOJUI+XTV63bXE HHane3TKZkp1sdE87i+JgwsZ64Rkk17S7vgm/Pb2nglPif2AcuXZwMWuF1NWizVvpdJl GepDoYSMLdxjUa5QCi3o16gbKASe3EoKHvDvpncsGQaL7L1/5+cGllv85o+UiAxoGCi4 sQJitD+/rOqDpJtXfoXecHb5IUTgStGabQuyifdD1I2xGFKqPCq+uKUHY64zrfhOF474 PExCaBbVirqAOE5SOVuFVvJSX1rpPhCMXLTdFgfQX0HSxIbiFhtB4s5mZ794GGgAs4fq FJSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111165; x=1734715965; 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=sFYMlM2q6ifWyTSOYq7MTYvofuvINKuts8GiQDOUAdE=; b=XORMF2JB4G1/R0pPNsQ3gu0Af99cG8v65QhcJ+YNdXbVKDiQr24I8Egu+XNrDcIZu+ 7jDohFjX9DlmsBNUua+wp69VzCBfVpkSpmIuobkg46e6a+FXP/bUe5kZhT+CdfPGKcgw nYuvH7vYkURv8aUAfMyuBkISPVjyN09AfknP3TkyHcegeQpRHXjosiAQGZABBAyomhHs RIDb3j/dGGk3GkxMgprkVtWxxaaOE3J6xQ1nMF9B76fDfL26DOdTQOZIkY06XRlDes9k cmYWEYtPpjyhf7OnffRy2G6YX7NZAQD3HetxnHXZjiSgxOQK7KG3MQoBJQtDx1psE5Ky 8ayA== X-Gm-Message-State: AOJu0Ywv6TJrPXjqo9wpEaNlElRJXTIYLHOmMmEdXn6Woa8V5xDWFmMt aM8FAGIQ2N97BwVWZ35kHDEEwFGV1L9SjBNBiChGQWULvcWcGdARaASKLqzOzBAcJjME5XEUe+X K X-Gm-Gg: ASbGncvDxRo7co2Z3ByYc8VU6rpX8RgCbCon/7cy/kobhJWWQK+RrW+FBiv8q9fZUi1 usrfCuHUyHi+PGOikPm3bjyCaip0cVDxeMzLabJtdeq07MDqHBwq8hAV8EzvoecaB6zNO+moAcI vrPVXnJoHiEVmTgsDFMm5YnYA6QX4E0QCRixdb2RLb2c0S184uB6FmQk3jLrH/WulCYqTJBs/Dx 59uGQuNZAstIV08j2BOkiZMqJ06z/v9Y1dUlvOOPKT87NMVFO2GXbG1fty3WQ== X-Received: by 2002:a05:6000:1886:b0:385:fd31:ca23 with SMTP id ffacd0b85a97d-3888e0b877amr2941352f8f.40.1734111164694; Fri, 13 Dec 2024 09:32:44 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.32.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:32:44 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 12/85] target/arm: Convert disas_add_sub_ext_reg to decodetree Date: Fri, 13 Dec 2024 17:31:16 +0000 Message-Id: <20241213173229.3308926-13-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32f.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: Richard Henderson This includes ADD, SUB, ADDS, SUBS (extended register). Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-13-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 9 +++++ target/arm/tcg/translate-a64.c | 65 +++++++++++----------------------- 2 files changed, 29 insertions(+), 45 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 8e2949d2361..05396945062 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -727,6 +727,15 @@ ANDS_r . 11 01010 .. . ..... ...... ..... ..... @logic_shift # Add/subtract (shifted reg) # Add/subtract (extended reg) + +&addsub_ext rd rn rm sf sa st +@addsub_ext sf:1 .. ........ rm:5 st:3 sa:3 rn:5 rd:5 &addsub_ext + +ADD_ext . 00 01011001 ..... ... ... ..... ..... @addsub_ext +SUB_ext . 10 01011001 ..... ... ... ..... ..... @addsub_ext +ADDS_ext . 01 01011001 ..... ... ... ..... ..... @addsub_ext +SUBS_ext . 11 01011001 ..... ... ... ..... ..... @addsub_ext + # Add/subtract (carry) # Rotate right into flags # Evaluate into flags diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index ecc8899dd84..8f777875fe0 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -7864,57 +7864,27 @@ TRANS(AND_r, do_logic_reg, a, tcg_gen_and_i64, tcg_gen_andc_i64, false) TRANS(ANDS_r, do_logic_reg, a, tcg_gen_and_i64, tcg_gen_andc_i64, true) TRANS(EOR_r, do_logic_reg, a, tcg_gen_xor_i64, tcg_gen_eqv_i64, false) -/* - * Add/subtract (extended register) - * - * 31|30|29|28 24|23 22|21|20 16|15 13|12 10|9 5|4 0| - * +--+--+--+-----------+-----+--+-------+------+------+----+----+ - * |sf|op| S| 0 1 0 1 1 | opt | 1| Rm |option| imm3 | Rn | Rd | - * +--+--+--+-----------+-----+--+-------+------+------+----+----+ - * - * sf: 0 -> 32bit, 1 -> 64bit - * op: 0 -> add , 1 -> sub - * S: 1 -> set flags - * opt: 00 - * option: extension type (see DecodeRegExtend) - * imm3: optional shift to Rm - * - * Rd = Rn + LSL(extend(Rm), amount) - */ -static void disas_add_sub_ext_reg(DisasContext *s, uint32_t insn) +static bool do_addsub_ext(DisasContext *s, arg_addsub_ext *a, + bool sub_op, bool setflags) { - int rd = extract32(insn, 0, 5); - int rn = extract32(insn, 5, 5); - int imm3 = extract32(insn, 10, 3); - int option = extract32(insn, 13, 3); - int rm = extract32(insn, 16, 5); - int opt = extract32(insn, 22, 2); - bool setflags = extract32(insn, 29, 1); - bool sub_op = extract32(insn, 30, 1); - bool sf = extract32(insn, 31, 1); + TCGv_i64 tcg_rm, tcg_rn, tcg_rd, tcg_result; - TCGv_i64 tcg_rm, tcg_rn; /* temps */ - TCGv_i64 tcg_rd; - TCGv_i64 tcg_result; - - if (imm3 > 4 || opt != 0) { - unallocated_encoding(s); - return; + if (a->sa > 4) { + return false; } /* non-flag setting ops may use SP */ if (!setflags) { - tcg_rd = cpu_reg_sp(s, rd); + tcg_rd = cpu_reg_sp(s, a->rd); } else { - tcg_rd = cpu_reg(s, rd); + tcg_rd = cpu_reg(s, a->rd); } - tcg_rn = read_cpu_reg_sp(s, rn, sf); + tcg_rn = read_cpu_reg_sp(s, a->rn, a->sf); - tcg_rm = read_cpu_reg(s, rm, sf); - ext_and_shift_reg(tcg_rm, tcg_rm, option, imm3); + tcg_rm = read_cpu_reg(s, a->rm, a->sf); + ext_and_shift_reg(tcg_rm, tcg_rm, a->st, a->sa); tcg_result = tcg_temp_new_i64(); - if (!setflags) { if (sub_op) { tcg_gen_sub_i64(tcg_result, tcg_rn, tcg_rm); @@ -7923,19 +7893,25 @@ static void disas_add_sub_ext_reg(DisasContext *s, uint32_t insn) } } else { if (sub_op) { - gen_sub_CC(sf, tcg_result, tcg_rn, tcg_rm); + gen_sub_CC(a->sf, tcg_result, tcg_rn, tcg_rm); } else { - gen_add_CC(sf, tcg_result, tcg_rn, tcg_rm); + gen_add_CC(a->sf, tcg_result, tcg_rn, tcg_rm); } } - if (sf) { + if (a->sf) { tcg_gen_mov_i64(tcg_rd, tcg_result); } else { tcg_gen_ext32u_i64(tcg_rd, tcg_result); } + return true; } +TRANS(ADD_ext, do_addsub_ext, a, false, false) +TRANS(SUB_ext, do_addsub_ext, a, true, false) +TRANS(ADDS_ext, do_addsub_ext, a, false, true) +TRANS(SUBS_ext, do_addsub_ext, a, true, true) + /* * Add/subtract (shifted register) * @@ -8374,8 +8350,7 @@ static void disas_data_proc_reg(DisasContext *s, uint32_t insn) if (!op1) { if (op2 & 8) { if (op2 & 1) { - /* Add/sub (extended register) */ - disas_add_sub_ext_reg(s, insn); + goto do_unallocated; } else { /* Add/sub (shifted register) */ disas_add_sub_reg(s, insn); From patchwork Fri Dec 13 17:31:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850136 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1637993wry; Fri, 13 Dec 2024 09:34:00 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWt0nlwUhGMiEElVKlktwvxaAdY3ikYrSXTQPhOfS4DsjfeyxoVEHCG6wonjbtVFKHOgbdFtw==@linaro.org X-Google-Smtp-Source: AGHT+IHhH4yFIRAM251XzZd8XH4eFYCj/lVZFHOSm5dAcPP9Xp2tuh0yDCfR2v7omwJEYu1VJf9c X-Received: by 2002:a05:6102:3e85:b0:4b2:48d2:a48c with SMTP id ada2fe7eead31-4b25d9db488mr3740006137.13.1734111240159; Fri, 13 Dec 2024 09:34:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111240; cv=none; d=google.com; s=arc-20240605; b=jE/zObW/Uv9Qb8oJx1Jxb6rLnyxC2thJGr2cdDUs8Zpv4x0AWTxiReBsH7uCk5qKKt /mNbIZnNYyORkJU8SCRPt3SBf7fRxXhXsA6Be7Q/Xxt0ip7UZPhCGJa2pAgi3aU+7M1V rDc1Qh1Q7dKCQc4dGgWLjWdHHHmhZtz2cS5D1aGitmYu20DTzbiTgpbInwLb6nPZSO3K moXt1YLU8Lc5AQGpWP/TA5zB/QwPUju9E+KR5OJnR4T1qx6dQWxxbY8QsIhuC7NdNZno PUhEc7nWK0FbJPJwQoVKEciZ8CTGPLgunRMyXtwJvl+6tSK37YgBFzUwMioFeWp8J8yy t0zQ== 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=mGrNgxcstODmyTVtIUWdTSuI8DC92TSEcEt0qgRJw8A=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=gY4Fq7kXlvaGhC6RWQXshvkfF9Ufrrf8OtcnK84NdhQlS5/wdBZPKbPwO9ozQcJEty jHCxwrJw5qt2f6Foj+ebz4mnQahMYG8KuWB5IzNMoj8vlg+p77we6ICMcAUbPTApUjOe jRT6uCiEXAF+pCTen3vBTqvEPdlgA8ujWbvj9y8kHt3Uayb4iSYii2+ssPePiFHJ2Dwy nVlzgz63QdnBkR2FtdKUIz3ztNHMPWv2vLhA0wPak1znHfslsCiS/CVLD7aB3OwgzExX kxpbVFVacq5SGMeBFX0oDFveyO3PhnX/MPe0NU6tHRGZ91vdZmB2bfZO7RBZc6XWqrDq Zdkg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sOmscSEe; 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 ada2fe7eead31-4afbc68f18esi5252831137.221.2024.12.13.09.33.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:34:00 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sOmscSEe; 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 1tM9XI-00078u-CF; Fri, 13 Dec 2024 12:33:09 -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 1tM9X2-0006xu-4B for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:32:53 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9Wx-0001U7-Ky for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:32:50 -0500 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-385d7b4da2bso1894175f8f.1 for ; Fri, 13 Dec 2024 09:32:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111166; x=1734715966; 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=mGrNgxcstODmyTVtIUWdTSuI8DC92TSEcEt0qgRJw8A=; b=sOmscSEeBypVPl9ZudqKSnIuS5Gy2/4pFnsfGXIVk6XIT4balFlW2qOjmt5e56VA2s hKNOPnLxHbBevHPo2n2S6PQf2MDe5C9rJh/a8AKK6pwaTKpCItdfp5Qc98bmQk0mO/Gf ucnm2dQvsM3AzwtT/5gwmfKR3J9epi1YUHEpc6Xcg+Inbk8tSYkl2CIplDRXKsfWL4Jt UKlnjd2FnqHC+tBek5iMWxDb7iNW2GH37jCZpbQO0XCV16Vmv69tZwyp2hVsUrvmNQSj UUTCzyRZuPlgCTICHNovTgZdccnybQ4+6L8JH2rgf3o8TeTHnrmnhTrsBINeU/AjXidX 9bXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111166; x=1734715966; 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=mGrNgxcstODmyTVtIUWdTSuI8DC92TSEcEt0qgRJw8A=; b=EMld+W1ND5mpHQ3N2gyWKeEzDCgSE57mr80D2EgUkZ8+ZBr1O2nE8UadEHaDRrXrAA KzXxx1cTOZKKJi9parUKpAVdp5/2CVGZrNNhj6BgIG3zT+tg9hZXYeVB/XnlPb3no5ZK HHKztkNMvnsfkrryho8l0QlzjATxu4xE+3XYVwTKk/TdTZxASPQ514eX30LloB5fWKVy Fqud6O0ePXgci3nCIIUD3kHaLSSOQpaK80fUuDQmkME+RrUXEWz+kJK59Ap4ymWP43Es vBBz14Tl5KXx7SIQA5LwxJDyFrCePRwZEhjv7Jx7w8OvYHI1nBHa7SvV2rcOBuTI+ABa Uf1g== X-Gm-Message-State: AOJu0Yzua27b6j6vienRA5WxeUtkMDgtiX+ADLnwl2FxsjdPaL2nIWno PWTp5N/3moaCbdzjZetdEzcBTHZ3SBZIBm+hGvwAPxPGLSfhtVODAt8H/nij1vx+VsRC2pP+DYT G X-Gm-Gg: ASbGncu932OeDsweAEtwbQ6fd6Fr6o833wkiXzqFSHLmcxXBndUGJ5dbBIUEyKkIUaU Y8echP8cKJmG3SMz4HD1edEX8RSkBpBf2cs/hCjqI9oj3IXRASgEAs9fg+gUxGetMrOqSxrgVkf Po3ZOKGCl8tvpdm6D6mnw49mQU/Y1k2MFzHtulhzejMKSlQIqlnD1ywHXLvTDHAFCzte9xyD4aw I6dkV+IMG1GbKecwvbqwKALUe5hCxaRtVWbVU2FdD4qXSXABUoONDFdeUfs6w== X-Received: by 2002:a05:6000:1f83:b0:386:3213:5ba1 with SMTP id ffacd0b85a97d-38880ad9288mr3274898f8f.24.1734111165661; Fri, 13 Dec 2024 09:32:45 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.32.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:32:44 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 13/85] target/arm: Convert disas_add_sub_reg to decodetree Date: Fri, 13 Dec 2024 17:31:17 +0000 Message-Id: <20241213173229.3308926-14-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42c.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: Richard Henderson This includes ADD, SUB, ADDS, SUBS (shifted register). Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-14-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 9 +++++ target/arm/tcg/translate-a64.c | 64 ++++++++++------------------------ 2 files changed, 27 insertions(+), 46 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 05396945062..27a3101bc69 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -726,6 +726,15 @@ EOR_r . 10 01010 .. . ..... ...... ..... ..... @logic_shift ANDS_r . 11 01010 .. . ..... ...... ..... ..... @logic_shift # Add/subtract (shifted reg) + +&addsub_shift rd rn rm sf sa st +@addsub_shift sf:1 .. ..... st:2 . rm:5 sa:6 rn:5 rd:5 &addsub_shift + +ADD_r . 00 01011 .. 0 ..... ...... ..... ..... @addsub_shift +SUB_r . 10 01011 .. 0 ..... ...... ..... ..... @addsub_shift +ADDS_r . 01 01011 .. 0 ..... ...... ..... ..... @addsub_shift +SUBS_r . 11 01011 .. 0 ..... ...... ..... ..... @addsub_shift + # Add/subtract (extended reg) &addsub_ext rd rn rm sf sa st diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 8f777875fe0..d570bbb6969 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -7912,47 +7912,22 @@ TRANS(SUB_ext, do_addsub_ext, a, true, false) TRANS(ADDS_ext, do_addsub_ext, a, false, true) TRANS(SUBS_ext, do_addsub_ext, a, true, true) -/* - * Add/subtract (shifted register) - * - * 31 30 29 28 24 23 22 21 20 16 15 10 9 5 4 0 - * +--+--+--+-----------+-----+--+-------+---------+------+------+ - * |sf|op| S| 0 1 0 1 1 |shift| 0| Rm | imm6 | Rn | Rd | - * +--+--+--+-----------+-----+--+-------+---------+------+------+ - * - * sf: 0 -> 32bit, 1 -> 64bit - * op: 0 -> add , 1 -> sub - * S: 1 -> set flags - * shift: 00 -> LSL, 01 -> LSR, 10 -> ASR, 11 -> RESERVED - * imm6: Shift amount to apply to Rm before the add/sub - */ -static void disas_add_sub_reg(DisasContext *s, uint32_t insn) +static bool do_addsub_reg(DisasContext *s, arg_addsub_shift *a, + bool sub_op, bool setflags) { - int rd = extract32(insn, 0, 5); - int rn = extract32(insn, 5, 5); - int imm6 = extract32(insn, 10, 6); - int rm = extract32(insn, 16, 5); - int shift_type = extract32(insn, 22, 2); - bool setflags = extract32(insn, 29, 1); - bool sub_op = extract32(insn, 30, 1); - bool sf = extract32(insn, 31, 1); + TCGv_i64 tcg_rd, tcg_rn, tcg_rm, tcg_result; - TCGv_i64 tcg_rd = cpu_reg(s, rd); - TCGv_i64 tcg_rn, tcg_rm; - TCGv_i64 tcg_result; - - if ((shift_type == 3) || (!sf && (imm6 > 31))) { - unallocated_encoding(s); - return; + if (a->st == 3 || (!a->sf && (a->sa & 32))) { + return false; } - tcg_rn = read_cpu_reg(s, rn, sf); - tcg_rm = read_cpu_reg(s, rm, sf); + tcg_rd = cpu_reg(s, a->rd); + tcg_rn = read_cpu_reg(s, a->rn, a->sf); + tcg_rm = read_cpu_reg(s, a->rm, a->sf); - shift_reg_imm(tcg_rm, tcg_rm, sf, shift_type, imm6); + shift_reg_imm(tcg_rm, tcg_rm, a->sf, a->st, a->sa); tcg_result = tcg_temp_new_i64(); - if (!setflags) { if (sub_op) { tcg_gen_sub_i64(tcg_result, tcg_rn, tcg_rm); @@ -7961,19 +7936,25 @@ static void disas_add_sub_reg(DisasContext *s, uint32_t insn) } } else { if (sub_op) { - gen_sub_CC(sf, tcg_result, tcg_rn, tcg_rm); + gen_sub_CC(a->sf, tcg_result, tcg_rn, tcg_rm); } else { - gen_add_CC(sf, tcg_result, tcg_rn, tcg_rm); + gen_add_CC(a->sf, tcg_result, tcg_rn, tcg_rm); } } - if (sf) { + if (a->sf) { tcg_gen_mov_i64(tcg_rd, tcg_result); } else { tcg_gen_ext32u_i64(tcg_rd, tcg_result); } + return true; } +TRANS(ADD_r, do_addsub_reg, a, false, false) +TRANS(SUB_r, do_addsub_reg, a, true, false) +TRANS(ADDS_r, do_addsub_reg, a, false, true) +TRANS(SUBS_r, do_addsub_reg, a, true, true) + /* Data-processing (3 source) * * 31 30 29 28 24 23 21 20 16 15 14 10 9 5 4 0 @@ -8348,15 +8329,6 @@ static void disas_data_proc_reg(DisasContext *s, uint32_t insn) int op3 = extract32(insn, 10, 6); if (!op1) { - if (op2 & 8) { - if (op2 & 1) { - goto do_unallocated; - } else { - /* Add/sub (shifted register) */ - disas_add_sub_reg(s, insn); - } - return; - } goto do_unallocated; } From patchwork Fri Dec 13 17:31:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850143 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1638152wry; Fri, 13 Dec 2024 09:34:16 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUS7LCUYkWo0FQ8T4e3ET+aIcQYXdzszNGyIoOZTOS32IL+PJJ5xvpv99TTVgwZicxhNh0TSg==@linaro.org X-Google-Smtp-Source: AGHT+IG4mK6TvwldOpjIxU8KR9eJvJHJzTKNzkPmdMRBPlhwRPYpnuwpQ1i32IGAe95xRSNhEbtB X-Received: by 2002:a05:6102:b0d:b0:4af:3973:6b22 with SMTP id ada2fe7eead31-4b25db0825bmr4381525137.22.1734111255799; Fri, 13 Dec 2024 09:34:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111255; cv=none; d=google.com; s=arc-20240605; b=AzScERBAwrZeCYjnFWZy+Tb0ejrY0ib7EP6AbrkxF4+4RuBYcUuL3r9OciB0SbvwYE +KQuYxHamGAftH763M77EL/uPx7/N2BxGPbA9TS83FuacuzULe4DUZBmb765InwYdFSO POwqzme4fZJkiPaKOkkc3xRDJR8a+cg+yZv5h2yrgE5SgIS3sthm3YwDWxVDCVp5arxI m0xUz0+GXgVfCGdfzcPnXj8YyO1do+CsEWDgS8+ivl2/8K7ixYDWj3q4RWn8T/bWX46J e5FFAB+cV863SjypXGke2p5KmfR+8sAs5nQN0SLWH9D7cHav1YaaiMsKJHvrca3kPaxN qOaA== 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=GqR7pFZ36L9c+PvgFmJuy5KCLU07AL9j8+oh3b6+uIo=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=PDPr1WLr66dOeDVyLlVP/tWmo4kSFwiLoGO/Wv5+7oWHLfmX+5wMeZtc1cMAFlfzou dpKJP/jyoq9osshau3ipi7k+/s/Iry7VcvpyVeFiJdVGSJXQnqrKTF+aD+LyndouUq2i moJMH6w8WO91vmUVhtP5BgLvOi8Hc33XNWOVKcOfAQHtH+J/nEQZDfQej0E5Zpw9sL1m IoW33jzzfR+fmJW8PKWhqHfYNR2ih2niX6/xyHDb7D0euKAQdAqJgQOTlLqSV0mwBILv Zbt1QF/urBKagOg2IDj3QtEi+MKir9hJhFuGzHFsMRpMOx8dahhiqiijDT8fvcNXpV5r +ZgQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gcM+EKdr; 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 ada2fe7eead31-4afdcfc0561si4997775137.373.2024.12.13.09.34.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:34: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=gcM+EKdr; 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 1tM9Xk-0007oX-Jw; Fri, 13 Dec 2024 12:33:36 -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 1tM9X2-0006xv-5n for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:32:53 -0500 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9Wy-0001UF-6N for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:32:50 -0500 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-4361d5dcf5bso21146565e9.3 for ; Fri, 13 Dec 2024 09:32:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111167; x=1734715967; 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=GqR7pFZ36L9c+PvgFmJuy5KCLU07AL9j8+oh3b6+uIo=; b=gcM+EKdrqcLnWvJKqM5S0LW7bfyLrfCEeyFZY6QsCpnjHAyz52NmxT89Q0GLhL4NmY enpDIZi+h+IGuRqoaSMHsz0pbotI/A7PWQjjXLl/iqxganWw+G2wLQd3vC4KQkYUpXh1 l1tyF6OgQWXRIdfvIeUMGOqqi40tAtDgpZryfI0r620DzbazHrMEKD1QueilDlRXhrea /lKdeIOnpz4JINw46rF9b8nnq+6JwbSe4pY9DkxvZt5uNJXJeOzWKkic+kDnrYB66FrA HNgTmCc3tWd/7dLWs8u/3qG3Qwl8mD/cpJRzH4VXOwuGkD5AlVpwltgZXChqQ2h3vffn QiPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111167; x=1734715967; 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=GqR7pFZ36L9c+PvgFmJuy5KCLU07AL9j8+oh3b6+uIo=; b=DHzx7oLCKhM/lCi50jlW/g8Isjdn2BTweU3QbUX8WrUvH4Gq8DBMRquuoRJPUc7Z7t 2X5JldR3vFZYmNv8eQdiwFnh/tvRQk2txUJfVOe+sITv7JunaZAwbLO0UCl+KimZxm1F bTvIG8UABQvRVDLh0B07H/p5STJdhjgqEMBPzj1PBjO8bZc13+xGIDuEqgoKfmngob+u 4k/ac2NjrAmXlzXRCoV/zVobeD3mh8tLA8vmw7STHsfCLdvEx9nWffJGtPt2D4jL2qr8 05n4D9UK1G6dp3uO2C7aGfVbaCnhip+rloYo3pHNA9osv66P7aUJQrUFKQ+GIK+TfkOt LRPw== X-Gm-Message-State: AOJu0YzqyjccfgHu3HZEX/qq5wnQgr8qDMolr29E4Jq+MfRnINY2SO8X eYl3tqLCqAwk/qY4xP+5O+ES9sh5NnA8YU8TECg1R6PuXnAb4/c6Bq01dhA1FoVgc/leg0mHHT4 e X-Gm-Gg: ASbGncsy/FfuHDAp/c/2y33bhBN5jQhxPkGW/sKPTIiJzwN1ZR+blwcRUvaK6qki+Yq wa8/VWBvdVT1ptt9PYH/yvG/cHt/w7mvseYeeC1Kq9kkl0PwaiJi14wmizJIGwpfzsdDm7sblvH oK9GQ/N9GmI+jx1oIePVvI+alZtW93UCxtNJEE2OyfDbAtfPyM7T8H0Nqf9Z+3ZFcIUzxwITok8 qSIpYM5fKBIsqvIt1ymxUDV9IvDwq8hxAQtR6Csh59iKPYwx49cOcdnvfcA/A== X-Received: by 2002:a05:600c:35c6:b0:434:a781:f5d5 with SMTP id 5b1f17b1804b1-4362aa9fd76mr32598675e9.30.1734111166624; Fri, 13 Dec 2024 09:32:46 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.32.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:32:45 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 14/85] target/arm: Convert disas_data_proc_3src to decodetree Date: Fri, 13 Dec 2024 17:31:18 +0000 Message-Id: <20241213173229.3308926-15-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32e.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: Richard Henderson This includes MADD, MSUB, SMADDL, SMSUBL, UMADDL, UMSUBL, SMULH, UMULH. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-15-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 16 +++++ target/arm/tcg/translate-a64.c | 119 ++++++++++++--------------------- 2 files changed, 59 insertions(+), 76 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 27a3101bc69..b0cc8bd476e 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -753,6 +753,22 @@ SUBS_ext . 11 01011001 ..... ... ... ..... ..... @addsub_ext # Conditional select # Data Processing (3-source) +&rrrr rd rn rm ra +@rrrr . .. ........ rm:5 . ra:5 rn:5 rd:5 &rrrr + +MADD_w 0 00 11011000 ..... 0 ..... ..... ..... @rrrr +MSUB_w 0 00 11011000 ..... 1 ..... ..... ..... @rrrr +MADD_x 1 00 11011000 ..... 0 ..... ..... ..... @rrrr +MSUB_x 1 00 11011000 ..... 1 ..... ..... ..... @rrrr + +SMADDL 1 00 11011001 ..... 0 ..... ..... ..... @rrrr +SMSUBL 1 00 11011001 ..... 1 ..... ..... ..... @rrrr +UMADDL 1 00 11011101 ..... 0 ..... ..... ..... @rrrr +UMSUBL 1 00 11011101 ..... 1 ..... ..... ..... @rrrr + +SMULH 1 00 11011010 ..... 0 11111 ..... ..... @rrr +UMULH 1 00 11011110 ..... 0 11111 ..... ..... @rrr + ### Cryptographic AES AESE 01001110 00 10100 00100 10 ..... ..... @r2r_q1e0 diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index d570bbb6969..99ff787c61f 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -7955,98 +7955,68 @@ TRANS(SUB_r, do_addsub_reg, a, true, false) TRANS(ADDS_r, do_addsub_reg, a, false, true) TRANS(SUBS_r, do_addsub_reg, a, true, true) -/* Data-processing (3 source) - * - * 31 30 29 28 24 23 21 20 16 15 14 10 9 5 4 0 - * +--+------+-----------+------+------+----+------+------+------+ - * |sf| op54 | 1 1 0 1 1 | op31 | Rm | o0 | Ra | Rn | Rd | - * +--+------+-----------+------+------+----+------+------+------+ - */ -static void disas_data_proc_3src(DisasContext *s, uint32_t insn) +static bool do_mulh(DisasContext *s, arg_rrr *a, + void (*fn)(TCGv_i64, TCGv_i64, TCGv_i64, TCGv_i64)) { - int rd = extract32(insn, 0, 5); - int rn = extract32(insn, 5, 5); - int ra = extract32(insn, 10, 5); - int rm = extract32(insn, 16, 5); - int op_id = (extract32(insn, 29, 3) << 4) | - (extract32(insn, 21, 3) << 1) | - extract32(insn, 15, 1); - bool sf = extract32(insn, 31, 1); - bool is_sub = extract32(op_id, 0, 1); - bool is_high = extract32(op_id, 2, 1); - bool is_signed = false; - TCGv_i64 tcg_op1; - TCGv_i64 tcg_op2; - TCGv_i64 tcg_tmp; + TCGv_i64 discard = tcg_temp_new_i64(); + TCGv_i64 tcg_rd = cpu_reg(s, a->rd); + TCGv_i64 tcg_rn = cpu_reg(s, a->rn); + TCGv_i64 tcg_rm = cpu_reg(s, a->rm); - /* Note that op_id is sf:op54:op31:o0 so it includes the 32/64 size flag */ - switch (op_id) { - case 0x42: /* SMADDL */ - case 0x43: /* SMSUBL */ - case 0x44: /* SMULH */ - is_signed = true; - break; - case 0x0: /* MADD (32bit) */ - case 0x1: /* MSUB (32bit) */ - case 0x40: /* MADD (64bit) */ - case 0x41: /* MSUB (64bit) */ - case 0x4a: /* UMADDL */ - case 0x4b: /* UMSUBL */ - case 0x4c: /* UMULH */ - break; - default: - unallocated_encoding(s); - return; - } + fn(discard, tcg_rd, tcg_rn, tcg_rm); + return true; +} - if (is_high) { - TCGv_i64 low_bits = tcg_temp_new_i64(); /* low bits discarded */ - TCGv_i64 tcg_rd = cpu_reg(s, rd); - TCGv_i64 tcg_rn = cpu_reg(s, rn); - TCGv_i64 tcg_rm = cpu_reg(s, rm); +TRANS(SMULH, do_mulh, a, tcg_gen_muls2_i64) +TRANS(UMULH, do_mulh, a, tcg_gen_mulu2_i64) - if (is_signed) { - tcg_gen_muls2_i64(low_bits, tcg_rd, tcg_rn, tcg_rm); - } else { - tcg_gen_mulu2_i64(low_bits, tcg_rd, tcg_rn, tcg_rm); - } - return; - } +static bool do_muladd(DisasContext *s, arg_rrrr *a, + bool sf, bool is_sub, MemOp mop) +{ + TCGv_i64 tcg_rd = cpu_reg(s, a->rd); + TCGv_i64 tcg_op1, tcg_op2; - tcg_op1 = tcg_temp_new_i64(); - tcg_op2 = tcg_temp_new_i64(); - tcg_tmp = tcg_temp_new_i64(); - - if (op_id < 0x42) { - tcg_gen_mov_i64(tcg_op1, cpu_reg(s, rn)); - tcg_gen_mov_i64(tcg_op2, cpu_reg(s, rm)); + if (mop == MO_64) { + tcg_op1 = cpu_reg(s, a->rn); + tcg_op2 = cpu_reg(s, a->rm); } else { - if (is_signed) { - tcg_gen_ext32s_i64(tcg_op1, cpu_reg(s, rn)); - tcg_gen_ext32s_i64(tcg_op2, cpu_reg(s, rm)); - } else { - tcg_gen_ext32u_i64(tcg_op1, cpu_reg(s, rn)); - tcg_gen_ext32u_i64(tcg_op2, cpu_reg(s, rm)); - } + tcg_op1 = tcg_temp_new_i64(); + tcg_op2 = tcg_temp_new_i64(); + tcg_gen_ext_i64(tcg_op1, cpu_reg(s, a->rn), mop); + tcg_gen_ext_i64(tcg_op2, cpu_reg(s, a->rm), mop); } - if (ra == 31 && !is_sub) { + if (a->ra == 31 && !is_sub) { /* Special-case MADD with rA == XZR; it is the standard MUL alias */ - tcg_gen_mul_i64(cpu_reg(s, rd), tcg_op1, tcg_op2); + tcg_gen_mul_i64(tcg_rd, tcg_op1, tcg_op2); } else { + TCGv_i64 tcg_tmp = tcg_temp_new_i64(); + TCGv_i64 tcg_ra = cpu_reg(s, a->ra); + tcg_gen_mul_i64(tcg_tmp, tcg_op1, tcg_op2); if (is_sub) { - tcg_gen_sub_i64(cpu_reg(s, rd), cpu_reg(s, ra), tcg_tmp); + tcg_gen_sub_i64(tcg_rd, tcg_ra, tcg_tmp); } else { - tcg_gen_add_i64(cpu_reg(s, rd), cpu_reg(s, ra), tcg_tmp); + tcg_gen_add_i64(tcg_rd, tcg_ra, tcg_tmp); } } if (!sf) { - tcg_gen_ext32u_i64(cpu_reg(s, rd), cpu_reg(s, rd)); + tcg_gen_ext32u_i64(tcg_rd, tcg_rd); } + return true; } +TRANS(MADD_w, do_muladd, a, false, false, MO_64) +TRANS(MSUB_w, do_muladd, a, false, true, MO_64) +TRANS(MADD_x, do_muladd, a, true, false, MO_64) +TRANS(MSUB_x, do_muladd, a, true, true, MO_64) + +TRANS(SMADDL, do_muladd, a, true, false, MO_SL) +TRANS(SMSUBL, do_muladd, a, true, true, MO_SL) +TRANS(UMADDL, do_muladd, a, true, false, MO_UL) +TRANS(UMSUBL, do_muladd, a, true, true, MO_UL) + /* Add/subtract (with carry) * 31 30 29 28 27 26 25 24 23 22 21 20 16 15 10 9 5 4 0 * +--+--+--+------------------------+------+-------------+------+-----+ @@ -8364,13 +8334,10 @@ static void disas_data_proc_reg(DisasContext *s, uint32_t insn) disas_cond_select(s, insn); break; - case 0x8 ... 0xf: /* (3 source) */ - disas_data_proc_3src(s, insn); - break; - default: do_unallocated: case 0x6: /* Data-processing */ + case 0x8 ... 0xf: /* (3 source) */ unallocated_encoding(s); break; } From patchwork Fri Dec 13 17:31:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850133 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1637704wry; Fri, 13 Dec 2024 09:33:26 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUzyeeDijwRMAHch02jrK1ZHPPxoW7oImw175U8pVcO+dCiK+1kjiK1fQETS52GuIS1DSYk1A==@linaro.org X-Google-Smtp-Source: AGHT+IFhKfakZFNgcIms5/hh0eLMVHChGDvNMV7KmuJaaWGYKUv4EA5VtFnDSTUj2ujHVstwXAvm X-Received: by 2002:a05:622a:30a:b0:461:18f2:49be with SMTP id d75a77b69052e-467a575c0camr57706761cf.21.1734111206223; Fri, 13 Dec 2024 09:33:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111206; cv=none; d=google.com; s=arc-20240605; b=aaVmV7Xntvx8INS4gmJEl7eHevp9prARvwa4gRDoo9ufKeKpwQdVq1igTQgfNUQYtT 27mhfxGjQvDBxCuibRKtVR1Lsc9kA0cF8+RbuJND29pqPVPAbi793wKGz334LdCiH4wS CS1Z8b/OF1EQKgLTbkqTIK3hqBzVVze2IKy378/FGSiyUfSWytd1o8m+DZTLoQn19wch eYAIkD5rTls0I0gmJMYBja8WM8ni9U0LTpjBIkS4XVT3ki3WN/PGrNAOS6Go0AeiFsIz HD7MldaGRA1kyy90htJAgn8fOhb6wrBxzaXqoHRAHQ2MbKsfxKYK+vjM5NshLatq1zUT cpSA== 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=1Keb5Nej/LJZUnVN62xwMoD4AGB05WwZ2iHDeqJMuMI=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=hCPvX7Vbx4dPiMRA2KtnflBmUWWZsfLsH3KXBeVZHvr/Zp3vKtyYFDeXnDuNgNBJAW ObnSQuYn+JGPePfjTAX0z6GiQk2vBSODO8aL2v/G3ft8TffnoXz+XVLckeT/dDH+4SeE rkySbRzidO6UwEjmwfKBjdiZcspXG/MUxNSS6yWGpRIr3HH0KcNyIQ0Z0onhW+y+BvxF GJ2dYemtvrJG+tKwjOQSOjAD7MjXSBpOKuMFXRrwk6T/1j7fvI6uInbQjBVKn95LxoTU 5TuaAQ1ZBvrWMXB9pCYTZbMAVxzXennzYB9EdAfcHGS/82GjsQnNMnuKWE6ZTCA+xpZD 0gFQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IIg9gTU2; 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-467970511a2si52651721cf.206.2024.12.13.09.33.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:33:26 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IIg9gTU2; 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 1tM9XC-00073j-PI; Fri, 13 Dec 2024 12:33: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 1tM9X3-0006zI-TN for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:32:57 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9X0-0001UW-7H for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:32:53 -0500 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-436281c8a38so11936045e9.3 for ; Fri, 13 Dec 2024 09:32:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111167; x=1734715967; 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=1Keb5Nej/LJZUnVN62xwMoD4AGB05WwZ2iHDeqJMuMI=; b=IIg9gTU2ruEtR+g6YxlBuEOej+on0Rjvo9i44o3UXBGsX0RLa7uqE/avhpyxLoeqcl AUC3eHKdUmTo+dXsgPDK1GmvZ7oD8JjbhYaRcgGXngWIPcDEteEHWZRf2DWVFhC9VNyy Y7GOlPWBgoz5wDHw4hd+AFOYgLSQZSpivzHF2wvVEmY8oYyCQ+JB8YK7ZZKJfFUdrSTg Ps084o0rCp88N6xr5oXHcbISbaQgFcCyyQ8r8ZQNXSKYR9eo2D88kWzkxOIvEd/9Boa3 RFdzv+3YMKw3eGbfByMajS+yfjguJ0bn5SDirY1Fy+5J10eUOVhuqOCD1clb5wWUceKW OIBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111167; x=1734715967; 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=1Keb5Nej/LJZUnVN62xwMoD4AGB05WwZ2iHDeqJMuMI=; b=kMTM2WQTrlOl9SQjAFBe7fDZ74ywntIyvr1ncTclPExR4EUD4VbfJLgylRbw+vziyV Noxq5IkFnqoW0RBuLnFNRWANFeW0vZSMwXYWGmkjGEhXkRWNnihqsfkZHzPTbT7QL141 FQC2f1WTah6lTNveePMaVCrhQL+cwCMvSfvFHEUo5te6SbBIAlmaNwY5TeIj26AFzH95 YsdVqnxhnsWchgeKOswY6ny8lIQ3Y0TOIrd/f0FWfMy66rJiEXnLPrEJMGa1ckYQesqA Mak65OfqMxNNiI3JjIUjuA+CaNR7RAcJA1iXttUOdIb6ENCqLTiMCdlu8ODW6ORlNceZ gDYA== X-Gm-Message-State: AOJu0YzHLlooo5x44Y9v5nLiImEljzq9WdCNbvzM2KXL0mFzDpNOY/Tp 5e7ngyaVzDYjekqE94MxcwbPKuojhHZEE1r5LFvcuwpFSMllKXUDXNp9yq4xh1Ndxl0ykVW3MPe N X-Gm-Gg: ASbGncvq2JP9sOTvWsvbZSiaQQG3JviIbIb6KfCZdS9qNt4HNrKpuFpVLlCkEQOgK3R TYgq04mBOvUg0LWpwueh8cDDPCuo43qlukBvazc87W5BLHtI2XycXr1WL3ViGK0JSdzdFkbIlWd 4etWQAyL5SEI5r/CyYsY/yLoVDMa9VWkiIUPrODrx/0aAFHLQV/57F3fv54tNN2xpAnlRWmLYZP 2ylRWQ0CPd/Qqq5bI904z1xNPk/jIE1BIJ6bGwWLhh32LrZ3ThTH9In/o+SGg== X-Received: by 2002:a5d:6da2:0:b0:385:ec6e:e872 with SMTP id ffacd0b85a97d-3888e0b8c07mr2865062f8f.38.1734111167633; Fri, 13 Dec 2024 09:32:47 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.32.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:32:46 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 15/85] target/arm: Convert disas_adc_sbc to decodetree Date: Fri, 13 Dec 2024 17:31:19 +0000 Message-Id: <20241213173229.3308926-16-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x329.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: Richard Henderson This includes ADC, SBC, ADCS, SBCS. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-16-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 6 +++++ target/arm/tcg/translate-a64.c | 43 +++++++++++++--------------------- 2 files changed, 22 insertions(+), 27 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index b0cc8bd476e..7a40ca455e4 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -746,6 +746,12 @@ ADDS_ext . 01 01011001 ..... ... ... ..... ..... @addsub_ext SUBS_ext . 11 01011001 ..... ... ... ..... ..... @addsub_ext # Add/subtract (carry) + +ADC . 00 11010000 ..... 000000 ..... ..... @rrr_sf +ADCS . 01 11010000 ..... 000000 ..... ..... @rrr_sf +SBC . 10 11010000 ..... 000000 ..... ..... @rrr_sf +SBCS . 11 11010000 ..... 000000 ..... ..... @rrr_sf + # Rotate right into flags # Evaluate into flags # Conditional compare (regster) diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 99ff787c61f..d7747fcf575 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -8017,42 +8017,34 @@ TRANS(SMSUBL, do_muladd, a, true, true, MO_SL) TRANS(UMADDL, do_muladd, a, true, false, MO_UL) TRANS(UMSUBL, do_muladd, a, true, true, MO_UL) -/* Add/subtract (with carry) - * 31 30 29 28 27 26 25 24 23 22 21 20 16 15 10 9 5 4 0 - * +--+--+--+------------------------+------+-------------+------+-----+ - * |sf|op| S| 1 1 0 1 0 0 0 0 | rm | 0 0 0 0 0 0 | Rn | Rd | - * +--+--+--+------------------------+------+-------------+------+-----+ - */ - -static void disas_adc_sbc(DisasContext *s, uint32_t insn) +static bool do_adc_sbc(DisasContext *s, arg_rrr_sf *a, + bool is_sub, bool setflags) { - unsigned int sf, op, setflags, rm, rn, rd; TCGv_i64 tcg_y, tcg_rn, tcg_rd; - sf = extract32(insn, 31, 1); - op = extract32(insn, 30, 1); - setflags = extract32(insn, 29, 1); - rm = extract32(insn, 16, 5); - rn = extract32(insn, 5, 5); - rd = extract32(insn, 0, 5); + tcg_rd = cpu_reg(s, a->rd); + tcg_rn = cpu_reg(s, a->rn); - tcg_rd = cpu_reg(s, rd); - tcg_rn = cpu_reg(s, rn); - - if (op) { + if (is_sub) { tcg_y = tcg_temp_new_i64(); - tcg_gen_not_i64(tcg_y, cpu_reg(s, rm)); + tcg_gen_not_i64(tcg_y, cpu_reg(s, a->rm)); } else { - tcg_y = cpu_reg(s, rm); + tcg_y = cpu_reg(s, a->rm); } if (setflags) { - gen_adc_CC(sf, tcg_rd, tcg_rn, tcg_y); + gen_adc_CC(a->sf, tcg_rd, tcg_rn, tcg_y); } else { - gen_adc(sf, tcg_rd, tcg_rn, tcg_y); + gen_adc(a->sf, tcg_rd, tcg_rn, tcg_y); } + return true; } +TRANS(ADC, do_adc_sbc, a, false, false) +TRANS(SBC, do_adc_sbc, a, true, false) +TRANS(ADCS, do_adc_sbc, a, false, true) +TRANS(SBCS, do_adc_sbc, a, true, true) + /* * Rotate right into flags * 31 30 29 21 15 10 5 4 0 @@ -8305,10 +8297,6 @@ static void disas_data_proc_reg(DisasContext *s, uint32_t insn) switch (op2) { case 0x0: switch (op3) { - case 0x00: /* Add/subtract (with carry) */ - disas_adc_sbc(s, insn); - break; - case 0x01: /* Rotate right into flags */ case 0x21: disas_rotate_right_into_flags(s, insn); @@ -8322,6 +8310,7 @@ static void disas_data_proc_reg(DisasContext *s, uint32_t insn) break; default: + case 0x00: /* Add/subtract (with carry) */ goto do_unallocated; } break; From patchwork Fri Dec 13 17:31:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850178 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1640666wry; Fri, 13 Dec 2024 09:39:30 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXxnkilwN7TZDVGwCSul55f/FuiQkuYQoET8eju8gvRw5ywZByC11txIV7ws2BCkaqspVSqFw==@linaro.org X-Google-Smtp-Source: AGHT+IGeIFw6RCxepBUcg4VMRiKVqtnKZjjUmwnxVsWpOJFbU8ag5kdSqQzB9+oiVq3oqD26tuh6 X-Received: by 2002:a05:600c:450e:b0:434:f623:a004 with SMTP id 5b1f17b1804b1-4362aa3f7cdmr36170205e9.16.1734111570105; Fri, 13 Dec 2024 09:39:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111570; cv=none; d=google.com; s=arc-20240605; b=iL7KbQL9ETamaQxf+3hae9+2R8IAloBtylQTDHHLFJAXB08ZMuY/GYLPXyT4EN7kWS loGg07q19AITNZ0W9BS6V76ZPxwF+9S0hNZ1Vw4Hr9t6KAUIxa76prIl0VJKTVxrP9Vr xaF3T1fVJFyjxLyRjgIUWmOQLpAWSWgP6MBgJ8yse64+/7hT8EdktRJy+uaMK3i0DE3g 8UjlAlFsK2RITLn9L49AVing1iKFuiz6lwYtMwZei4AhJmNk+sW0anklSfYf/WJOVh6w y4doQVXP+mccI1t/xnrE+7WezToWv3oE9lwQRXklo32w6ouIDjraIX97jwtf0GU1+xtS O6+g== 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=BwDq0W+meAt5kc5H/cSi+hBv6OXqnPA2qE21LgjmUFw=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=ZAtq08XYe4h4/zveFRzvM3o4JGLUz3BZ7uO2EJ912cEPf5tHcnJLC82BnRZW+xc9yC d/qDjoYqP2xMiwOT9ZdP44rWX/C79+0YCMOC+X1Ugt3usdbFAf9fAqfolNb4K8UCwhLj TWf01Bu1O7V5ZW1nWnwcdbXONfuKJmISzndcryngOtZrgUnuKe//mLay328OHeJe2Do0 qPyJaqQ5lr7uiM51ShuEHGicEkevmh5qfIIw6LCca8Ahm5Zt6VxQQdxS8yVx/XNWb+sG OaqiW5HvkbI8QFu2IxJKMV/b5ti/Qh49TYrFybTdHWRyEdiG8uPIUOmCFi3RQF634vs6 fyuQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CunIteSf; 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 5b1f17b1804b1-4362570c194si22869535e9.158.2024.12.13.09.39.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:39:30 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CunIteSf; 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 1tM9Xb-0007Rp-Vz; Fri, 13 Dec 2024 12:33:28 -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 1tM9X3-0006zD-IP for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:32:57 -0500 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9X1-0001Uq-Jt for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:32:53 -0500 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-3863c36a731so1291127f8f.1 for ; Fri, 13 Dec 2024 09:32:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111169; x=1734715969; 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=BwDq0W+meAt5kc5H/cSi+hBv6OXqnPA2qE21LgjmUFw=; b=CunIteSfOVEugnEiGZ8c3fzBVUwit4aP+gbzuXR2z1MnmvDTfi2oKYfM4cPcBgTvW/ vHygm1mwhMSrSrgkzb4nMc7DjYYaMpDTwHVOr36nWkR1q43iPMKa3OaAJ4Gm7WkUyGa0 FZXEk5bsgZ/hGU9bIXhucCrbhXrIfnLFCfOVwK8Da54uQ4kotdrNOT7D3pdNLg9RhlMe g+Az1L/Uv/eRix3y7aW1A86s3B/bhrlmktEHmusHI7ZVHGpdawMuVEwwF/pDqHxJBjqN 9NHaiffgerkX2E8srvGGedXpsHZVM8pSXB0u9lRC9u02qJh1Crx8+sKbmDWlBTWZugiy mfUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111169; x=1734715969; 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=BwDq0W+meAt5kc5H/cSi+hBv6OXqnPA2qE21LgjmUFw=; b=vuBO7+5mGBThNTPR4gAm19+DaPGb7jInk3ZRxIE/jAGY0HC/KlUgNtMOcQbLtCjwDo m1yvDttF4+E6Mt3FLEWyFQ4u36mB+zTbAq/uqFUPgK7YTNHN+D8mJkieiqyu5LAwIIOv YlxYHqMjUt42l9j96dFiF6FsXok2je7xCYvbfo+wKqsuunAA4/s8fRVuGmVqfYqA+DVs QlhtHfLZmLi4QTTASL/OsMLhszBIL5fJHOabZrXFyeVLkofooEP88bhTSw2q4CaS9yOR SAM/Tkeu0A/0SREV6Ym7rC1aWuYWsTrU/qXatG9h41hJkJPHgHagOxQ3aJ91za/WN1FO QW3A== X-Gm-Message-State: AOJu0YycqtPu6OWjiLefrRODeWU97DtcZx7BHF0IdOYJWm+w3V6NKNDa 7u7LKBjslW3phsQnUmua2NN6zryQr7xLDtDx26j3/CVrtGrBfbeWztwxQACs/ugyfLA5DkQk2XF Q X-Gm-Gg: ASbGncuXTKXa/6dK7IFxVq8TG3skMfZN6u8ARt7EgGPsWUw38awofXbKBHeRhmUr62S l/lB8rYAqP8OmAqUDDNMVFQtaZrThR7UE6priQAWF2yqHxr3cVArt3SE5othNPu1VQ6GjO6OxZ+ +lfOn1xEu6hAqcXdB+mLM7xd9DfmkasO6lmwcFCjYRrl/cBY2n5+gnlrdk+GEZQ74OZT0/R93di SXViAwx8rZfRHPzc3nJBh8nTIAf0NIdQxCqNVX9nrqsHCQFpD4zxAhN7lYF5A== X-Received: by 2002:a5d:64af:0:b0:385:fb2c:6034 with SMTP id ffacd0b85a97d-3888e0b9e49mr2956210f8f.47.1734111168627; Fri, 13 Dec 2024 09:32:48 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.32.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:32:47 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 16/85] target/arm: Convert RMIF to decodetree Date: Fri, 13 Dec 2024 17:31:20 +0000 Message-Id: <20241213173229.3308926-17-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-17-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 3 +++ target/arm/tcg/translate-a64.c | 32 +++++++++----------------------- 2 files changed, 12 insertions(+), 23 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 7a40ca455e4..454494742e6 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -753,6 +753,9 @@ SBC . 10 11010000 ..... 000000 ..... ..... @rrr_sf SBCS . 11 11010000 ..... 000000 ..... ..... @rrr_sf # Rotate right into flags + +RMIF 1 01 11010000 imm:6 00001 rn:5 0 mask:4 + # Evaluate into flags # Conditional compare (regster) # Conditional compare (immediate) diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index d7747fcf575..1af41e22eb5 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -8045,30 +8045,18 @@ TRANS(SBC, do_adc_sbc, a, true, false) TRANS(ADCS, do_adc_sbc, a, false, true) TRANS(SBCS, do_adc_sbc, a, true, true) -/* - * Rotate right into flags - * 31 30 29 21 15 10 5 4 0 - * +--+--+--+-----------------+--------+-----------+------+--+------+ - * |sf|op| S| 1 1 0 1 0 0 0 0 | imm6 | 0 0 0 0 1 | Rn |o2| mask | - * +--+--+--+-----------------+--------+-----------+------+--+------+ - */ -static void disas_rotate_right_into_flags(DisasContext *s, uint32_t insn) +static bool trans_RMIF(DisasContext *s, arg_RMIF *a) { - int mask = extract32(insn, 0, 4); - int o2 = extract32(insn, 4, 1); - int rn = extract32(insn, 5, 5); - int imm6 = extract32(insn, 15, 6); - int sf_op_s = extract32(insn, 29, 3); + int mask = a->mask; TCGv_i64 tcg_rn; TCGv_i32 nzcv; - if (sf_op_s != 5 || o2 != 0 || !dc_isar_feature(aa64_condm_4, s)) { - unallocated_encoding(s); - return; + if (!dc_isar_feature(aa64_condm_4, s)) { + return false; } - tcg_rn = read_cpu_reg(s, rn, 1); - tcg_gen_rotri_i64(tcg_rn, tcg_rn, imm6); + tcg_rn = read_cpu_reg(s, a->rn, 1); + tcg_gen_rotri_i64(tcg_rn, tcg_rn, a->imm); nzcv = tcg_temp_new_i32(); tcg_gen_extrl_i64_i32(nzcv, tcg_rn); @@ -8086,6 +8074,7 @@ static void disas_rotate_right_into_flags(DisasContext *s, uint32_t insn) if (mask & 1) { /* V */ tcg_gen_shli_i32(cpu_VF, nzcv, 31 - 0); } + return true; } /* @@ -8297,11 +8286,6 @@ static void disas_data_proc_reg(DisasContext *s, uint32_t insn) switch (op2) { case 0x0: switch (op3) { - case 0x01: /* Rotate right into flags */ - case 0x21: - disas_rotate_right_into_flags(s, insn); - break; - case 0x02: /* Evaluate into flags */ case 0x12: case 0x22: @@ -8311,6 +8295,8 @@ static void disas_data_proc_reg(DisasContext *s, uint32_t insn) default: case 0x00: /* Add/subtract (with carry) */ + case 0x01: /* Rotate right into flags */ + case 0x21: goto do_unallocated; } break; From patchwork Fri Dec 13 17:31:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850187 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1641644wry; Fri, 13 Dec 2024 09:41:37 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXEUZg5kpWGnRLDsl6CDJpxc2l91V0bNcyPS6FJmxEM9qYaGsAYWZ2CNYu0bjrPyJ60USuS6A==@linaro.org X-Google-Smtp-Source: AGHT+IFcLxThzQ3BApLa//Nx7OiMaBPRclbmesJVQThz5SEt5qv5Vvls2IZz/qsLX4pC1kva4m9V X-Received: by 2002:a05:6000:470a:b0:385:e22e:288b with SMTP id ffacd0b85a97d-3888e0c08dfmr2819987f8f.59.1734111696807; Fri, 13 Dec 2024 09:41:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111696; cv=none; d=google.com; s=arc-20240605; b=bY6j8lntZadSZsWe8z4TGdtseo3SwwU0q5ZjXvut5hVwaFcrUYjTw/rpV9ol4DWubj Vg75QoNyJN/fcEuxpFSjshGNyEO67/lLWWqDOWDFfln4BiR8egqh6FZ5uiog3D0MuNgZ GdMeQRxuR7DgOozFbXR0XcDIW2575kujkB52IbzicIZyULu1mhEHe8cyJpRg3+A0zJ5A 78OC6hFy6nIukGwleE/JdAByUo/nmDGIih4eHl+FYkPMgCgxoUwWCq+WRoQQ6AbtFCvE LfjRe6DS8kCGtcJ9RoaKX0oM7QnrML4Vh8Moy9OVsD4/0ND6hLN2fbI/ofZe7OgEjcWe 8NaQ== 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=BZjeQ+Sa4YO/ce7b2afs7u8lMwFiQyyn1m0P7q0dhTc=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=MPGCB0EA1b1X1/Znrus6M+vZWT1WrJEphJ8iAdcM95q42zN+2CdFXGr4ZFCfZSeBjM DgoMufh+as2Fbh0oKmt2UoPONjEoFMBT0boFrkPlDX8kdR3nh6s6HxGAKLH+Wbn8QoqQ iUINfGoFWvy+sj+s8TBf3ve+lOTSl0MJk37g4Te9N0YThzpHmJDCzS1ezXKcvlzjTMWB vs9hXL3IraqbdMXvk9Lnd4BTEOCoKOAaujz/iguazuxhFOcrrEVlQ/AlydeVsHFRiXdg g2VtOoqzEEesz43VgyxI2M1tKtOTgxVLWSejoJf6KdiBuHwnjc5Ty6RMgQ98eiyOZMz2 azQQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="o3AA/S2N"; 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 ffacd0b85a97d-388c804ddcfsi39532f8f.393.2024.12.13.09.41.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:41:36 -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="o3AA/S2N"; 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 1tM9XD-000749-5C; Fri, 13 Dec 2024 12:33:04 -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 1tM9X5-0006zX-Hd for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:32:57 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9X1-0001Uz-SH for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:32:54 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-432d86a3085so13676895e9.2 for ; Fri, 13 Dec 2024 09:32:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111170; x=1734715970; 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=BZjeQ+Sa4YO/ce7b2afs7u8lMwFiQyyn1m0P7q0dhTc=; b=o3AA/S2NxWnPWvPx0RMFuPAgiPywv72pDx1YY5iR99+33d6VYj+i5mfU0bMP8uxUcr r6lcIB4yQyKedzXOnWijNF3O4+oVGn6zixxaR9U2c88JXhRPy4kH4luz9oSKkz7GQBrp uUR0N+/FigqOVpeF4pY41FRQMVywY6dMwkoaSnLxSM1qIfblkrMzzgk+BpEKRaelH8sN FwG++hYscls2jTiAzgp8BJfv7cerv7GFZIltDLQx3drKMXTWYH8+Z3lpPyA9ytKersRw sTHtvhGxDxkSFqg7oAzNmMgHmAx5Owu7EOUmbUySGNUQLAOBV+clKF+TuaO9yWCvFhff UNng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111170; x=1734715970; 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=BZjeQ+Sa4YO/ce7b2afs7u8lMwFiQyyn1m0P7q0dhTc=; b=jOoHjEsSKHnUEIw3iqA9Rho/sdbHguNUwKgiqQjbakq8S7ckYN/yjYLPyhiu4PHRKG R1Lj9QWuOT2mSHFN0rY4/LqlzItpdx5ySZ8em6bXxdys3+TKHOsOKCPdZMTy3fO+DzfB NFr8x1g+Op3IgsTrqnvDk2oaZCrrze+xUvPCXvba82oaqAostKjEplaeDTP9Lqb40A6k aHn857jfDYB+XzMvVZxK9KpEObfSwuFVfqNQCCl39nv8U0eYsRli6jIWkk+dvOxE2ngx GcoO2oErp1gqP84huxKQfKRSxeON4X1yF+SM+jU8nYdMm76+OXs04Ejz7tG3kQo4aeB0 YMmw== X-Gm-Message-State: AOJu0YzzpN2ZzrJGrX8zEjVbJksd7uyVAQNRj3mJvXTA/xvkEf8+pSmE QcbjJjcDWmCjHzeoExO7mdw3iFko0Sxv6EChIber3ZCBpUK1FrNK2wCKc9Awnd/8aC1Cg4PpuDV / X-Gm-Gg: ASbGncsZZE1WUGrAuwv7yQHPBVOkUx4o7YHsmxj+ZNyFAfmvMCqxrgyHjEP4NiUYktv bEqjfMSbsEyqM44c91b47xFT9WP4ckC5FEO72ryGduuNfcyFm5UIMGq/+tK+9N7U4JgM05owcGp wy4dckDk5OT3/Qf2qds2wNCD6Pt42I4t6X8eXsvAkQL6a3ziWew5ylW+z/ubzjVpipHzbu+YxdH C7jduWJup0ByklUoLpPiNwgV3JrxVr2IhbhI84jdASRkNSDnJLNpIxjjmHnsw== X-Received: by 2002:a5d:64a1:0:b0:385:df73:2f3a with SMTP id ffacd0b85a97d-38880ac7440mr2869787f8f.14.1734111169725; Fri, 13 Dec 2024 09:32:49 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.32.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:32:48 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 17/85] target/arm: Convert SETF8, SETF16 to decodetree Date: Fri, 13 Dec 2024 17:31:21 +0000 Message-Id: <20241213173229.3308926-18-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x331.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: Richard Henderson Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-18-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 4 +++ target/arm/tcg/translate-a64.c | 48 +++++----------------------------- 2 files changed, 11 insertions(+), 41 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 454494742e6..ae2c6831d77 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -757,6 +757,10 @@ SBCS . 11 11010000 ..... 000000 ..... ..... @rrr_sf RMIF 1 01 11010000 imm:6 00001 rn:5 0 mask:4 # Evaluate into flags + +SETF8 0 01 11010000 00000 000010 rn:5 01101 +SETF16 0 01 11010000 00000 010010 rn:5 01101 + # Conditional compare (regster) # Conditional compare (immediate) # Conditional select diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 1af41e22eb5..774689641d0 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -8077,38 +8077,21 @@ static bool trans_RMIF(DisasContext *s, arg_RMIF *a) return true; } -/* - * Evaluate into flags - * 31 30 29 21 15 14 10 5 4 0 - * +--+--+--+-----------------+---------+----+---------+------+--+------+ - * |sf|op| S| 1 1 0 1 0 0 0 0 | opcode2 | sz | 0 0 1 0 | Rn |o3| mask | - * +--+--+--+-----------------+---------+----+---------+------+--+------+ - */ -static void disas_evaluate_into_flags(DisasContext *s, uint32_t insn) +static bool do_setf(DisasContext *s, int rn, int shift) { - int o3_mask = extract32(insn, 0, 5); - int rn = extract32(insn, 5, 5); - int o2 = extract32(insn, 15, 6); - int sz = extract32(insn, 14, 1); - int sf_op_s = extract32(insn, 29, 3); - TCGv_i32 tmp; - int shift; + TCGv_i32 tmp = tcg_temp_new_i32(); - if (sf_op_s != 1 || o2 != 0 || o3_mask != 0xd || - !dc_isar_feature(aa64_condm_4, s)) { - unallocated_encoding(s); - return; - } - shift = sz ? 16 : 24; /* SETF16 or SETF8 */ - - tmp = tcg_temp_new_i32(); tcg_gen_extrl_i64_i32(tmp, cpu_reg(s, rn)); tcg_gen_shli_i32(cpu_NF, tmp, shift); tcg_gen_shli_i32(cpu_VF, tmp, shift - 1); tcg_gen_mov_i32(cpu_ZF, cpu_NF); tcg_gen_xor_i32(cpu_VF, cpu_VF, cpu_NF); + return true; } +TRANS_FEAT(SETF8, aa64_condm_4, do_setf, a->rn, 24) +TRANS_FEAT(SETF16, aa64_condm_4, do_setf, a->rn, 16) + /* Conditional compare (immediate / register) * 31 30 29 28 27 26 25 24 23 22 21 20 16 15 12 11 10 9 5 4 3 0 * +--+--+--+------------------------+--------+------+----+--+------+--+-----+ @@ -8277,30 +8260,12 @@ static void disas_data_proc_reg(DisasContext *s, uint32_t insn) { int op1 = extract32(insn, 28, 1); int op2 = extract32(insn, 21, 4); - int op3 = extract32(insn, 10, 6); if (!op1) { goto do_unallocated; } switch (op2) { - case 0x0: - switch (op3) { - case 0x02: /* Evaluate into flags */ - case 0x12: - case 0x22: - case 0x32: - disas_evaluate_into_flags(s, insn); - break; - - default: - case 0x00: /* Add/subtract (with carry) */ - case 0x01: /* Rotate right into flags */ - case 0x21: - goto do_unallocated; - } - break; - case 0x2: /* Conditional compare */ disas_cc(s, insn); /* both imm and reg forms */ break; @@ -8311,6 +8276,7 @@ static void disas_data_proc_reg(DisasContext *s, uint32_t insn) default: do_unallocated: + case 0x0: case 0x6: /* Data-processing */ case 0x8 ... 0xf: /* (3 source) */ unallocated_encoding(s); From patchwork Fri Dec 13 17:31:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850196 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1642469wry; Fri, 13 Dec 2024 09:43:26 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVaEz91IcxLXgHFAImTO+iPCazvG31jS+MM3jCrrL6upc46XJ/08u72ZBucchOTeW0SXzgbFA==@linaro.org X-Google-Smtp-Source: AGHT+IFvrRBYCKKGW1u23GyBwa1mXzJMAr4UfngfydiA6kfczHcg7Qq+4f5y89QbJPHvM3NI367s X-Received: by 2002:a05:600c:b95:b0:434:9c1b:b36a with SMTP id 5b1f17b1804b1-4362aa2e539mr32569735e9.13.1734111806608; Fri, 13 Dec 2024 09:43:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111806; cv=none; d=google.com; s=arc-20240605; b=M4uq2ndghlcXD3YryW/yOyEtGNs7imU8kxTQQTJoOBXXUqRPX4zbGNLYJjRaL6OjiS RwnIg28YPuzJT0TZrCBtQmftIxzrONdtXUFP3RxUzFPYpwb+xcDlfGLDjXIc36s7bFzW d+Fhx1VnwSrGwVDQDtE/h0LXyQ+jkqajawGbSzPrsnboeEsib4VkOOv/goU80qei+1l/ OEey1pumgQ6sqtyw6qSeaYroBd736TW7cmb9lbfgS8TSWuqxq4+AiHGWvxr1e/6HqAw7 zJCMla71vs/W4dLG16P978sit70otJarQfjVeh7NuVWGFs+sT0JmpDxeF/TAOk7BClvk brJQ== 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=ZvncCZGSa1vg6hVRE3miBkbSWKwyhFzzATKLnSY+0DA=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=TkWYNpCxBi1Iyf+yGDWlJ8xVWHP75i0p8eR3oAO5Jif4y6nFfj6CB7ObfScM+RaH3I UcSVDjdrC48O05oyNQir07mJ/Q6aqudijDaSL9PM3JMaIXDJtBFC0+Bjeu3SOWvMB+Lt VQUlFAKTJJu804XfUQtBljgZIMR9K+z1tSZObBsQLNwLOYhSuL+1AYPoMGEq9u38f5CB k+82oJlRIeLw+wKxDy/krywZaBv0OjNpdXLFF8xVVpAcRMZIwfaRtlmN7lmrY32wdJaA Snst2Q58qKZrOvIRVYDYPxKjeq9IzJ3F/r0tOJvzxqAuYt4MJ0nPFCSgGmhsjHySrnQ/ Xx/w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DJMT0N8O; 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 ffacd0b85a97d-388c8062a09si29604f8f.531.2024.12.13.09.43.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:43:26 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DJMT0N8O; 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 1tM9Xa-0007QR-QS; Fri, 13 Dec 2024 12:33:26 -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 1tM9X5-0006zY-Hi for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:32:57 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9X2-0001VC-Hk for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:32:54 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-43623f0c574so14319465e9.2 for ; Fri, 13 Dec 2024 09:32:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111171; x=1734715971; 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=ZvncCZGSa1vg6hVRE3miBkbSWKwyhFzzATKLnSY+0DA=; b=DJMT0N8OPSkUJ+ehJf7Bntvo38uUvyY6mBKOeB4TSHm0F6ONqv78/n+4UmaCQaVqcG WR5uyw3UUTyFpbaEwIZzc+6SfJydEQ+6AQnpYRX+u4uBv4Nb5ov1Cq6Vwe7Kp0CauUV3 GGdiuv/IyrGuDnRU+5IpYszqdnZPt0MUSpf6Ra6S0pyHBopPSV68K3YfAbvDXv0nWBAb No/MyKqgfqsQyh04b3j412i6tjKpc+8EqV2IkRkgZGvt90VKzxubTLsggkGyN3cFngLZ IzQimIDNByULEsNiPalKIlXrJzXKvOutWats265Dhvf5KiTH5pMjs7YQnfwWCw5lhLQL Cw3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111171; x=1734715971; 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=ZvncCZGSa1vg6hVRE3miBkbSWKwyhFzzATKLnSY+0DA=; b=J3hN5XgYInOAhCYqO9Wqhf1a/tmM65Q3JVlDXze/9zU/Z+SbDdOdAgkTocteoUniWs F+gYkZknsxp1d511b+5r+w+6euNNNEStyYvha0n4k7TrZ2JtDXlD0wpBbYaO+7vbrt4Y Y12v2QM/3dfB+8X15VzsugyMk2pz0MWMSVai84FTktUsv+PYWZ665Uh6S4H1rXWhHuk6 RyzXGcdThjeKJAbLxXoId5+ybA7ZTrvZEUrM9kcNQauP7jkHAaJAMIMWToFjHJHWs0nH Buyt2ZiVBBfY11Wtky1Dmvg0zBRiUNsbyr7CJPN0crPY/xBx7TaDTx5kYfYbuKWfZJTn JquA== X-Gm-Message-State: AOJu0YyOvwl1a2q2BS5wi+4d6C5U9ZskIbzqouLLWvSrME9Uk/MwMs8O AIfUTpdzjae/VQ3tj5qR0gCABStk+SOlDtYTAetp66ApH0NZBNgkFrbzoVNayscbufEJBpfKZns s X-Gm-Gg: ASbGncu5nWvfGS3NvGJ0KUTmfow1if+G6jA7aA+ujNEf/bFEZPuM4yOP9IJvymuEhpZ 65N7UAv3iYA+pWUIhdMWa1QvJEwzsYaKOPl3qT1WvbRr8L7TG8P7halB1KBXeRy2IjKpegeMAY1 S5GKqK7CDgIf9vk/+awhDmgQZtNMxbgaohNuei5tCGgtXRgCpkQOPkRNRAtxav4nxRHghG3z/O8 eAlB25xunQM4l6sAoOp1t8/yumlwx3gBWvHwmEF6me22DOoRiBhf8DMuBpc2w== X-Received: by 2002:a05:600c:3109:b0:434:f270:a4f0 with SMTP id 5b1f17b1804b1-4362aa94626mr30094175e9.21.1734111171055; Fri, 13 Dec 2024 09:32:51 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.32.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:32:50 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 18/85] target/arm: Convert CCMP, CCMN to decodetree Date: Fri, 13 Dec 2024 17:31:22 +0000 Message-Id: <20241213173229.3308926-19-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x331.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: Richard Henderson Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-19-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 6 ++-- target/arm/tcg/translate-a64.c | 66 +++++++++++----------------------- 2 files changed, 25 insertions(+), 47 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index ae2c6831d77..a9d7d571995 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -761,8 +761,10 @@ RMIF 1 01 11010000 imm:6 00001 rn:5 0 mask:4 SETF8 0 01 11010000 00000 000010 rn:5 01101 SETF16 0 01 11010000 00000 010010 rn:5 01101 -# Conditional compare (regster) -# Conditional compare (immediate) +# Conditional compare + +CCMP sf:1 op:1 1 11010010 y:5 cond:4 imm:1 0 rn:5 0 nzcv:4 + # Conditional select # Data Processing (3-source) diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 774689641d0..56a445a3c28 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -8092,68 +8092,46 @@ static bool do_setf(DisasContext *s, int rn, int shift) TRANS_FEAT(SETF8, aa64_condm_4, do_setf, a->rn, 24) TRANS_FEAT(SETF16, aa64_condm_4, do_setf, a->rn, 16) -/* Conditional compare (immediate / register) - * 31 30 29 28 27 26 25 24 23 22 21 20 16 15 12 11 10 9 5 4 3 0 - * +--+--+--+------------------------+--------+------+----+--+------+--+-----+ - * |sf|op| S| 1 1 0 1 0 0 1 0 |imm5/rm | cond |i/r |o2| Rn |o3|nzcv | - * +--+--+--+------------------------+--------+------+----+--+------+--+-----+ - * [1] y [0] [0] - */ -static void disas_cc(DisasContext *s, uint32_t insn) +/* CCMP, CCMN */ +static bool trans_CCMP(DisasContext *s, arg_CCMP *a) { - unsigned int sf, op, y, cond, rn, nzcv, is_imm; - TCGv_i32 tcg_t0, tcg_t1, tcg_t2; - TCGv_i64 tcg_tmp, tcg_y, tcg_rn; + TCGv_i32 tcg_t0 = tcg_temp_new_i32(); + TCGv_i32 tcg_t1 = tcg_temp_new_i32(); + TCGv_i32 tcg_t2 = tcg_temp_new_i32(); + TCGv_i64 tcg_tmp = tcg_temp_new_i64(); + TCGv_i64 tcg_rn, tcg_y; DisasCompare c; - - if (!extract32(insn, 29, 1)) { - unallocated_encoding(s); - return; - } - if (insn & (1 << 10 | 1 << 4)) { - unallocated_encoding(s); - return; - } - sf = extract32(insn, 31, 1); - op = extract32(insn, 30, 1); - is_imm = extract32(insn, 11, 1); - y = extract32(insn, 16, 5); /* y = rm (reg) or imm5 (imm) */ - cond = extract32(insn, 12, 4); - rn = extract32(insn, 5, 5); - nzcv = extract32(insn, 0, 4); + unsigned nzcv; /* Set T0 = !COND. */ - tcg_t0 = tcg_temp_new_i32(); - arm_test_cc(&c, cond); + arm_test_cc(&c, a->cond); tcg_gen_setcondi_i32(tcg_invert_cond(c.cond), tcg_t0, c.value, 0); /* Load the arguments for the new comparison. */ - if (is_imm) { - tcg_y = tcg_temp_new_i64(); - tcg_gen_movi_i64(tcg_y, y); + if (a->imm) { + tcg_y = tcg_constant_i64(a->y); } else { - tcg_y = cpu_reg(s, y); + tcg_y = cpu_reg(s, a->y); } - tcg_rn = cpu_reg(s, rn); + tcg_rn = cpu_reg(s, a->rn); /* Set the flags for the new comparison. */ - tcg_tmp = tcg_temp_new_i64(); - if (op) { - gen_sub_CC(sf, tcg_tmp, tcg_rn, tcg_y); + if (a->op) { + gen_sub_CC(a->sf, tcg_tmp, tcg_rn, tcg_y); } else { - gen_add_CC(sf, tcg_tmp, tcg_rn, tcg_y); + gen_add_CC(a->sf, tcg_tmp, tcg_rn, tcg_y); } - /* If COND was false, force the flags to #nzcv. Compute two masks + /* + * If COND was false, force the flags to #nzcv. Compute two masks * to help with this: T1 = (COND ? 0 : -1), T2 = (COND ? -1 : 0). * For tcg hosts that support ANDC, we can make do with just T1. * In either case, allow the tcg optimizer to delete any unused mask. */ - tcg_t1 = tcg_temp_new_i32(); - tcg_t2 = tcg_temp_new_i32(); tcg_gen_neg_i32(tcg_t1, tcg_t0); tcg_gen_subi_i32(tcg_t2, tcg_t0, 1); + nzcv = a->nzcv; if (nzcv & 8) { /* N */ tcg_gen_or_i32(cpu_NF, cpu_NF, tcg_t1); } else { @@ -8190,6 +8168,7 @@ static void disas_cc(DisasContext *s, uint32_t insn) tcg_gen_and_i32(cpu_VF, cpu_VF, tcg_t2); } } + return true; } /* Conditional select @@ -8266,10 +8245,6 @@ static void disas_data_proc_reg(DisasContext *s, uint32_t insn) } switch (op2) { - case 0x2: /* Conditional compare */ - disas_cc(s, insn); /* both imm and reg forms */ - break; - case 0x4: /* Conditional select */ disas_cond_select(s, insn); break; @@ -8277,6 +8252,7 @@ static void disas_data_proc_reg(DisasContext *s, uint32_t insn) default: do_unallocated: case 0x0: + case 0x2: /* Conditional compare */ case 0x6: /* Data-processing */ case 0x8 ... 0xf: /* (3 source) */ unallocated_encoding(s); From patchwork Fri Dec 13 17:31:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850152 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1639298wry; Fri, 13 Dec 2024 09:36:39 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV00849LyE1Nq36+1byG7/nbW4OcAH/fSD6RZCiZZwxQiL8/OmqJcEFDAdRdkFNrEVx5ZPi0A==@linaro.org X-Google-Smtp-Source: AGHT+IFBDg8hKVaIMD48EITBn4+TGq8Hadua19D+qKhT5t84sqzpPjwbJiul4gI/Msdva0s1G/tD X-Received: by 2002:a05:600c:3503:b0:434:ff25:19a0 with SMTP id 5b1f17b1804b1-4362aa94379mr30200345e9.21.1734111399600; Fri, 13 Dec 2024 09:36:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111399; cv=none; d=google.com; s=arc-20240605; b=lc2re9Ew1nbuit+2Z08lT7qegpOHq8egLw6nsf4XRJ7+hi6v7sA9I6Qhq+NI13MUE5 ftbwUqJeg10aUut3chrik0MyQX/0zFSoW9g0mF6VP44xwYUW60kQ3STO84llUo+dorr3 lHO4wglQgN4heih2xuyWAAXjzIflHZ43AnIGM53cW5oK3+XZJqNFadUPKBFWvhDhXcQT 3flvnZaoyXnutBDY0/L+3eKMiKpb3U+8J9qQLnPMKNeHJ0tWVw2Ac4vU9z/bc9SwxDqP OEDP1qi3YwOTjulm1DxH+vVYsDe0Oelcv6D6DMkLq5PUxA5TbgyRgCRxJMGjYd9s/rs6 FNbw== 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=UvCNc+SNol+mmfXe4nD22J5FvUFCfyVXPg9YYzFJKJI=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=X+xLkzmbUZ8N7oxZy+FUrRWwNXlwfmTfKzaJ0+YKaKLY3cTobdekCXhwC+RpsEhBUr 0ELveHl/Xidk+UerD1Mz4wtgPcZJLxShwJYMO3OEVGq/TZyFaASb6vQ3kQZuaIcJxhr0 fX4sxKMXxblaa21wH+5TC0TTECXEu9k7bSSwpTl2on9Dlr9wwoEjATJACclMHSJvy4Nd 5voZlHvFTELBINX5Pfz3l5YsLSf5117r179rnGu/eCGngFA2AbiIeYDe05QOzw17soGH AJ1JWC+/2HdyrvE7DyAVh+AYODL0cga+AM7zhEaPkdXmr6zwP1hE7SL57U0Mm9RYsGZK l8gA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Fx6nmKDc; 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 5b1f17b1804b1-436255b6ff8si23024345e9.137.2024.12.13.09.36.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:36:39 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Fx6nmKDc; 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 1tM9Xc-0007R7-FC; Fri, 13 Dec 2024 12:33:28 -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 1tM9X5-0006za-Sn for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:32:57 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9X3-0001Vo-MB for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:32:55 -0500 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-385deda28b3so1509819f8f.0 for ; Fri, 13 Dec 2024 09:32:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111172; x=1734715972; 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=UvCNc+SNol+mmfXe4nD22J5FvUFCfyVXPg9YYzFJKJI=; b=Fx6nmKDcTH5EW0MWRZYkzPfLbg6l7KewOy8D/R/ozTP7V0Cw4ZzYLIqfpujeXLQU/E GQCsmVzvd3A2/A5JQOO0QllRI+KdIXz6NQfw5seWeuA7SE4+2jTNjuYHrIdsHK5vUUt8 4F0t5tM4rx9r4i07OPTutz8YKxoedPYhF/fu9Wh1JUXIj8Tuz1X+pi8cG6/FFzf6sexb ZtbCp23i2XzJaAnQvJ9zv882ciZx7RiQbr2YbpP0JbnTBjYjSCWaDxADljM5NBdF5S9r 3WdLAuVyX2KNekbxrTV7GILjV7tO7XsR5r07BWVijK5GmU8owNuQMEzqgN+E0r4ZsWMv kmYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111172; x=1734715972; 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=UvCNc+SNol+mmfXe4nD22J5FvUFCfyVXPg9YYzFJKJI=; b=FBCbJY7UHjV3zOWJjrRhXwpB58XNxqlLct2+bc5Ve6bbttdzkirJdW0GIwIEyjS9Lz VwR6enJWzq2D+vTsf4HTrr2hArQyPtHAb6DWgNNSEgIiIDn+46eD3Zcfwa+tWiOTC3Hj HsbNC1gx0bCEoABKKLuqt+BtCN4/JYmjHz0oW1syrMwTSb8FZONDuLFllxoWKtwvN/99 uqopF2XEOhRUt2tgjgw2qyrCfI6kqWnBo9DzRFM38z/uLjCpfd3+i5uiyDffdukdVhjV TaX5ik6J/MhPhkBKRuPoGAPEQ/NPbiWa4wQ2q3a5KunNujaBcPl8BLcG0Nj1hfT1TUL7 4FJw== X-Gm-Message-State: AOJu0Yy8dZ7PQulTpC92gSqY5bIaZ++m9cHiSJyrOq/cFp9BKfLy/PtG RAct8F0bHAfjfsfBmmMSh3B15FUYwX/7+xR4HS5LLtMC0CsTUeTiIjCvY+x9T1/qcoQLRr2r870 e X-Gm-Gg: ASbGncuMrRhZWHMJmvm9OzESOIreJ2Vhym2KgZxfLauxGS42tS4ozrMoIMOFALr6yeE +czxlj+rtHsGhXTl5a2/HPgumHm60s6+rXqAaM0e/s3HgfzKFTmLaK5tUvKMnG6sJdAhLmoaGpp NqlZ3E5f8H8IPY3V6hq5/UHzJrPHVpnqBKTUhHAEjnUDcOUBbcry4FrabES24flIrTIM1q07fxP /yygg/71gUKbtAqhMEf9BsAoYTvHKPfsF9/lt0AuObYjI6igpPfGMpAFO8lSg== X-Received: by 2002:a05:6000:18ad:b0:386:3e65:5a58 with SMTP id ffacd0b85a97d-38880acd57bmr2855789f8f.20.1734111171995; Fri, 13 Dec 2024 09:32:51 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.32.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:32:51 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 19/85] target/arm: Convert disas_cond_select to decodetree Date: Fri, 13 Dec 2024 17:31:23 +0000 Message-Id: <20241213173229.3308926-20-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42c.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: Richard Henderson This includes CSEL, CSINC, CSINV, CSNEG. Remove disas_data_proc_reg, as these were the last insns decoded by that function. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-20-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 3 ++ target/arm/tcg/translate-a64.c | 84 ++++++---------------------------- 2 files changed, 17 insertions(+), 70 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index a9d7d571995..56708467681 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -766,6 +766,9 @@ SETF16 0 01 11010000 00000 010010 rn:5 01101 CCMP sf:1 op:1 1 11010010 y:5 cond:4 imm:1 0 rn:5 0 nzcv:4 # Conditional select + +CSEL sf:1 else_inv:1 011010100 rm:5 cond:4 0 else_inc:1 rn:5 rd:5 + # Data Processing (3-source) &rrrr rd rn rm ra diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 56a445a3c28..9c6365f5efc 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -8171,39 +8171,17 @@ static bool trans_CCMP(DisasContext *s, arg_CCMP *a) return true; } -/* Conditional select - * 31 30 29 28 21 20 16 15 12 11 10 9 5 4 0 - * +----+----+---+-----------------+------+------+-----+------+------+ - * | sf | op | S | 1 1 0 1 0 1 0 0 | Rm | cond | op2 | Rn | Rd | - * +----+----+---+-----------------+------+------+-----+------+------+ - */ -static void disas_cond_select(DisasContext *s, uint32_t insn) +static bool trans_CSEL(DisasContext *s, arg_CSEL *a) { - unsigned int sf, else_inv, rm, cond, else_inc, rn, rd; - TCGv_i64 tcg_rd, zero; + TCGv_i64 tcg_rd = cpu_reg(s, a->rd); + TCGv_i64 zero = tcg_constant_i64(0); DisasCompare64 c; - if (extract32(insn, 29, 1) || extract32(insn, 11, 1)) { - /* S == 1 or op2<1> == 1 */ - unallocated_encoding(s); - return; - } - sf = extract32(insn, 31, 1); - else_inv = extract32(insn, 30, 1); - rm = extract32(insn, 16, 5); - cond = extract32(insn, 12, 4); - else_inc = extract32(insn, 10, 1); - rn = extract32(insn, 5, 5); - rd = extract32(insn, 0, 5); + a64_test_cc(&c, a->cond); - tcg_rd = cpu_reg(s, rd); - - a64_test_cc(&c, cond); - zero = tcg_constant_i64(0); - - if (rn == 31 && rm == 31 && (else_inc ^ else_inv)) { + if (a->rn == 31 && a->rm == 31 && (a->else_inc ^ a->else_inv)) { /* CSET & CSETM. */ - if (else_inv) { + if (a->else_inv) { tcg_gen_negsetcond_i64(tcg_invert_cond(c.cond), tcg_rd, c.value, zero); } else { @@ -8211,53 +8189,23 @@ static void disas_cond_select(DisasContext *s, uint32_t insn) tcg_rd, c.value, zero); } } else { - TCGv_i64 t_true = cpu_reg(s, rn); - TCGv_i64 t_false = read_cpu_reg(s, rm, 1); - if (else_inv && else_inc) { + TCGv_i64 t_true = cpu_reg(s, a->rn); + TCGv_i64 t_false = read_cpu_reg(s, a->rm, 1); + + if (a->else_inv && a->else_inc) { tcg_gen_neg_i64(t_false, t_false); - } else if (else_inv) { + } else if (a->else_inv) { tcg_gen_not_i64(t_false, t_false); - } else if (else_inc) { + } else if (a->else_inc) { tcg_gen_addi_i64(t_false, t_false, 1); } tcg_gen_movcond_i64(c.cond, tcg_rd, c.value, zero, t_true, t_false); } - if (!sf) { + if (!a->sf) { tcg_gen_ext32u_i64(tcg_rd, tcg_rd); } -} - -/* - * Data processing - register - * 31 30 29 28 25 21 20 16 10 0 - * +--+---+--+---+-------+-----+-------+-------+---------+ - * | |op0| |op1| 1 0 1 | op2 | | op3 | | - * +--+---+--+---+-------+-----+-------+-------+---------+ - */ -static void disas_data_proc_reg(DisasContext *s, uint32_t insn) -{ - int op1 = extract32(insn, 28, 1); - int op2 = extract32(insn, 21, 4); - - if (!op1) { - goto do_unallocated; - } - - switch (op2) { - case 0x4: /* Conditional select */ - disas_cond_select(s, insn); - break; - - default: - do_unallocated: - case 0x0: - case 0x2: /* Conditional compare */ - case 0x6: /* Data-processing */ - case 0x8 ... 0xf: /* (3 source) */ - unallocated_encoding(s); - break; - } + return true; } static void handle_fp_compare(DisasContext *s, int size, @@ -11212,10 +11160,6 @@ static bool btype_destination_ok(uint32_t insn, bool bt, int btype) static void disas_a64_legacy(DisasContext *s, uint32_t insn) { switch (extract32(insn, 25, 4)) { - case 0x5: - case 0xd: /* Data processing - register */ - disas_data_proc_reg(s, insn); - break; case 0x7: case 0xf: /* Data processing - SIMD and floating point */ disas_data_proc_simd_fp(s, insn); From patchwork Fri Dec 13 17:31:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850139 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1638010wry; Fri, 13 Dec 2024 09:34:03 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWYo3TOVFI9XcsYIdaInBYHfoXDyCMPg9WLybug6d821uXMId1Oo2XrPwrx5eyuCUfigtqfpA==@linaro.org X-Google-Smtp-Source: AGHT+IHa/byiObjEzgHn6ijWOIcWHRvFf4TJ6dASPxyZnkl4VOMAvK4VvPePLUDNw8PN78kAaP1N X-Received: by 2002:a05:6102:c05:b0:4af:4adf:8d80 with SMTP id ada2fe7eead31-4b25dbe82ddmr4181881137.18.1734111242776; Fri, 13 Dec 2024 09:34:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111242; cv=none; d=google.com; s=arc-20240605; b=fAGcEV76qAgW6TmkTtGWsMnJLF/jjmkP38kNDgSZX0t77ORrdGIoxZzb0+GMXKKceJ Xy3ymn3IW4KwJpgJLU3U8EFoQ6zZwx9fD/KXMp5pRE29SGXoZAjEU/kEEcQ72ib4Opob vn5AhiLou6HZCWdOv9qQ2tgA0Ucp2XXsD35W+x+Q/ONNMfbWMdF6gPC94tGvVGyYHpKA CsHEMHk4QUvhabbPH4jgkCSuYJ3CCkWKOoJfRHmKpNXqcPeQJOODniKkTkXdsoWWTSOP G4yGgWtV39/TyyQvFSeVvX8z8Co9K4vJSFLOmFS52xwae/fsDcHdGRZtMfzib0IjrQy2 heMA== 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=Sp4roeRQL1fuJKdKDyKEq4BIrsgp9jAp7oXPidcX4dw=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=WAr98d5BQi1iXM53y3HTOL+vk7XonjapQtgjoXFpvuH2qUwc5Zpg1ekwHAvAS9Q5rs jqceSwUIUC0N8yxm/k54Y429JVdZIi6QzV0kq+WuTRCVbyfP9mYC+kzeXcB9pcFe0/17 TZYyAznhkFp8R4NhgP0EsSf5WQUvKF/3+NFiXkdLKfBM6HkjJlzdffpy8Q3aYw7S2GA1 2ya8k9Bw2mBM7MkjUVN6TkBB6V+LS0B/8F3X3hyrMAcDFcnQMXrHe4GqRpzMURUfoD1g S0oUcpe9XDie5vKjZ7ziK+OCP0wOwIUMCUz/VaEzzGvR22mliNnniWN1xBIBleCkqNto BAng==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cKVneeFF; 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 ada2fe7eead31-4afe59f1bf4si3602123137.527.2024.12.13.09.34.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09: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=cKVneeFF; 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 1tM9XI-00077j-BA; Fri, 13 Dec 2024 12:33: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 1tM9X7-0006zo-93 for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:32:58 -0500 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9X5-0001W8-Ag for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:32:57 -0500 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-385de9f789cso1543933f8f.2 for ; Fri, 13 Dec 2024 09:32:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111173; x=1734715973; 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=Sp4roeRQL1fuJKdKDyKEq4BIrsgp9jAp7oXPidcX4dw=; b=cKVneeFFkcdwJJSLwAgOgOMpVHotcTXpy7mK5OB8zF6ervLqbqZCKnBwVL44z4JUo1 bKOefGR6NqSI0U5W3CGD1pMnA4redChW1We/MNXppFRLS/0onufDzNDecoX5MsM63xmU z0BwS3g4LPPovw+mb4Xf7aQRQnSoYyTZBKgLR5caNFIiqcafcA8uCD7tcPwOkKSM7kaG /STvejZXbPNGQ6ll5xFvcRgNHZR0oPfp4HoGuanKa+UMN8KFkiL4z6EUCFsNk5xjxPtv EED/7KBho7/CihgefRypnJSDX23DkrWYfEAJGzNyx0gClaLdttMVInU9JO0cNCHzFl/6 3K1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111173; x=1734715973; 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=Sp4roeRQL1fuJKdKDyKEq4BIrsgp9jAp7oXPidcX4dw=; b=OW/Hep9YulgOaJCuoniaZZG8jmfxqGbbVLC81x4eBh5iaLN/dfrcCVuxjyk2SM7bR8 xjuRVSLEYE6pMjce2sTgcwCRAUKv3XExOTdD0ka6BOA/cIwgCqfZvKMt3lfceyEPcZUu WbP6wKQKdOsKavri3VobrKGzY9PfuRfcmTJXesPV7tXtasvFUwTpnQgovBwFIkORlMWa uxdxIgbPAj7vGlCaP2XuubftbffxMpVpJAdMIfaQ75qASa9D71Ar8T8db7Mip1qeWb+9 BqlKkWAqcQ/nf2HzDlxZBGEIbM7m/QKAyO0KpMMIrvh+F1fMv5qeN4Y+G8MAadpFNzMg 2dPg== X-Gm-Message-State: AOJu0YyxLTZDwqHriuxt6NSptIME5I6WDwFcBeJkv8DJ1OhUyh8Y9iy9 tTgKkB6zxIzGAPyb+aOZcaiTGOA2O79L4pYUZV+TT0kqqUA0MGEU7hjW926iFAamvDiiEEsWvxu N X-Gm-Gg: ASbGncvbMzcHIRFLoX3qbrFGa4hOOmTC9YqugMRslT/tjrzyzkrA/5frhTtBmGV1x8L TSqVeUONVH//+IZriYT/rLwrcKQjH5MrkmvDVRJbsGyvipionQqlucCDq/u2PRwCbdgYUIdyUMY xRk76RBp0ZwAH5JJomnktdA7wsYVj7vdF3XH9jdEUBPJE1SqPJ0u4j54nBu2KLWSgLCQHZ0pf2x Tkhm0DTjq4aoRcWCMaUV51D445CvNXr8zibK5g4ka/2UoH6kVdPynGn0h4xPQ== X-Received: by 2002:a5d:6f1d:0:b0:386:37f5:99e7 with SMTP id ffacd0b85a97d-3888e0bbaeemr3200362f8f.33.1734111173067; Fri, 13 Dec 2024 09:32:53 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.32.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:32:52 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 20/85] target/arm: Introduce fp_access_check_scalar_hsd Date: Fri, 13 Dec 2024 17:31:24 +0000 Message-Id: <20241213173229.3308926-21-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x431.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Provide a simple way to check for float64, float32, and float16 support, as well as the fpu enabled. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-21-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/translate-a64.c | 62 ++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 9c6365f5efc..4e47b8a8041 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -1239,6 +1239,27 @@ static bool fp_access_check(DisasContext *s) return true; } +/* + * Return <0 for non-supported element sizes, with MO_16 controlled by + * FEAT_FP16; return 0 for fp disabled; otherwise return >0 for success. + */ +static int fp_access_check_scalar_hsd(DisasContext *s, MemOp esz) +{ + switch (esz) { + case MO_64: + case MO_32: + break; + case MO_16: + if (!dc_isar_feature(aa64_fp16, s)) { + return -1; + } + break; + default: + return -1; + } + return fp_access_check(s); +} + /* * Check that SVE access is enabled. If it is, return true. * If not, emit code to generate an appropriate exception and return false. @@ -6628,22 +6649,10 @@ static bool trans_FCSEL(DisasContext *s, arg_FCSEL *a) { TCGv_i64 t_true, t_false; DisasCompare64 c; + int check = fp_access_check_scalar_hsd(s, a->esz); - switch (a->esz) { - case MO_32: - case MO_64: - break; - case MO_16: - if (!dc_isar_feature(aa64_fp16, s)) { - return false; - } - break; - default: - return false; - } - - if (!fp_access_check(s)) { - return true; + if (check <= 0) { + return check == 0; } /* Zero extend sreg & hreg inputs to 64 bits now. */ @@ -6894,22 +6903,15 @@ TRANS(FMINV_s, do_fp_reduction, a, gen_helper_vfp_mins) static bool trans_FMOVI_s(DisasContext *s, arg_FMOVI_s *a) { - switch (a->esz) { - case MO_32: - case MO_64: - break; - case MO_16: - if (!dc_isar_feature(aa64_fp16, s)) { - return false; - } - break; - default: - return false; - } - if (fp_access_check(s)) { - uint64_t imm = vfp_expand_imm(a->esz, a->imm); - write_fp_dreg(s, a->rd, tcg_constant_i64(imm)); + int check = fp_access_check_scalar_hsd(s, a->esz); + uint64_t imm; + + if (check <= 0) { + return check == 0; } + + imm = vfp_expand_imm(a->esz, a->imm); + write_fp_dreg(s, a->rd, tcg_constant_i64(imm)); return true; } From patchwork Fri Dec 13 17:31:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850212 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1643712wry; Fri, 13 Dec 2024 09:46:19 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUVnzt/bowx+CM8NuCQgroZiKJslkNJtS+gdM/Zs14AaLXunxjtNG9ddnL1/ggnUk93znd2HQ==@linaro.org X-Google-Smtp-Source: AGHT+IE6itzjnkPufRdfvbPnoIdLCawQ3yuuvcZE8zGOUrbpstlo1RSlRt7ITVnj7z3HalXZDsQe X-Received: by 2002:a05:600c:154c:b0:430:563a:b20a with SMTP id 5b1f17b1804b1-4362aa3e565mr29315355e9.11.1734111979606; Fri, 13 Dec 2024 09:46:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111979; cv=none; d=google.com; s=arc-20240605; b=iJyHY+KCadBPUBJ6+dlizfrZtUZmo72K++kTAregHO/NKWXs0DXijswGO81sNv5SZw WaltvHV6jMu9u1TQj5Jax9ht/VqDWC1Ex03zz9SDx3eb2lmtk0ZYJVAJy5a8HKcYosIV w8Yc1++ZhvpwmLMLqCSSpf66geAZXPKLDEpcAp+gDa1nK7UA37KZXDflnfVNxzX+s0YA FJM05CbRdQTmUYt/0Es/xuDHKQ17KXvzJxkj6d4Aa2ESlacCQpzgZeQk4T3e2a6kvkjf tuqSruSsHEe+0tupmeQlSxkv3eMiTY7SKac4lStAnSPzqH4P97sW+UBO1U5vFzbXjvG/ Qnvg== 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=PYN5citoB0ZF3IJroQ8ZdrrceU/Nk4XKS8mCIww2hmM=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=a2o0892v9bdkCOL9/l4aq6JMjO5Envemo3b+a8q1BRc6rR04jqIulJvq9sHF1G8Al1 7ztt5ed3HQ0opWKsPLa+cy6K55t0UFlDlLUUvKmY5F5qIBLIjAcA7wTB/P6xIqdE4yv4 SS5Fo/chJAI0QhRSXfS/OlmeoxU7nMbuhShVzr4/POoqqR4yNEY/pzoiew8uLTAir6eT czAkkP4JOX+ySvQ/G0WBoAw+sxQunrKAoN26xwdf75Vgv0wqWALTV2AnUVq8OCxlIJTp dcQ08uM2oMD5ecLLcmIOkMmttWHOSmiv107ZXl/8Oc8Kd8NMyksuYRtJgq4dsbhIU5nk NKjA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Px7eehZs; 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 5b1f17b1804b1-43625563c4bsi22994645e9.53.2024.12.13.09.46.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:46: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=Px7eehZs; 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 1tM9XW-0007DY-AC; Fri, 13 Dec 2024 12:33: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 1tM9X7-0006zp-EB for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:32:58 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9X5-0001WR-LF for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:32:57 -0500 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-4361a50e337so14505035e9.0 for ; Fri, 13 Dec 2024 09:32:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111174; x=1734715974; 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=PYN5citoB0ZF3IJroQ8ZdrrceU/Nk4XKS8mCIww2hmM=; b=Px7eehZs/njKPA+3nFtv7joWN7QZeBy+SAY0NVwzX9TTUyWhMIw8SuwCBsQKboLIF2 XWmWH0NPWo2kIxCiSN5hXmyKh9fo20pCaW9SvvssSU30G7uZD+eifn09IIO9yi1ao5Sy pMciNShmskSkdeL1NShun6swb0lC42VPQKr7qVV8f23dw2HACLrLxDXnBuzq0wVcwUZW DoTt7tm4LMOTTIC+/aulsHhm0dw76wjI1uxjDX69mJcEmKO4tDEr3gDgqcSkNCce6HMZ KyGV/U1qkpACYbU1EeOUETkdL30OuCPk+Yl5p1VsXoIN7wMmDM9PIq0Q3zz3p5JIg3J5 pU7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111174; x=1734715974; 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=PYN5citoB0ZF3IJroQ8ZdrrceU/Nk4XKS8mCIww2hmM=; b=rqgbIYrO39G7DMJnGulVSG3q17jDfTPHI+McMLdllu2AzgUl8W9OYZJuI03cQF8ciV YJ3mrM7Us41PFnYuoiWMpv332fEZv/c6KDfzA5xjx1tg/hQwWkXuvfSB1A1vRzVrkdSB vdZBgs/EL/+OsefK90QNr2cKm5H7MbApoiClFkgV6K48mM8Z9JUEJ4mgGHaxw12/HgdG Tsr9mkiMfnfhPaDbcVll70JaeG6VEe5yCYOJacVDM8ASnSeTVJY2Sq5vORqAnM9biKBs YqCjmAcvsZaQA260ofCwggtcYhm/0yo76MeycORPh6HR0ZIFoy2q8QMiiciQE9L3WB9b QA8Q== X-Gm-Message-State: AOJu0YzsV7pidvxuVKef4Lu3zun07ms82X90FQNuCSOm6BHQ5sddut11 J6mWPkqhiDTm8VnG5b6vcuW2QLCx3JsiBPGB8T9iPn98+srlZShrNNcydcd8x4RtgosoKxKNhEY g X-Gm-Gg: ASbGncvjdQN4md3TLEfMajFXNAK+6Z9O2kEx6R0QtYtKPfRBnj5hOqaLKqEon1lu/BO 12V9Acii3MFN7tJeaUE5aihzhgdmsUPnw42aHwp4UxQTsdN+SQ49u8Iq6ZXW6mfUb2jWgO3BaSp VdjPh+rXFdBQ63fH0Cmb/TZB3FLkDbopEuAR1Cj63zVJeD2DxakENyeFt+LRpbMaqCE3EIQbQfc nemuKNgPgp0+RDXSNqpBNvTMiqgpxW2K//9WlHNGMnzrkPG9LlaUdlitUkWSA== X-Received: by 2002:a05:600c:511c:b0:434:a7e3:db66 with SMTP id 5b1f17b1804b1-4362aaa9683mr23756105e9.26.1734111174017; Fri, 13 Dec 2024 09:32:54 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.32.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:32:53 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 21/85] target/arm: Introduce fp_access_check_vector_hsd Date: Fri, 13 Dec 2024 17:31:25 +0000 Message-Id: <20241213173229.3308926-22-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x329.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: Richard Henderson Provide a simple way to check for float64, float32, and float16 support vs vector width, as well as the fpu enabled. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-22-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/translate-a64.c | 135 +++++++++++++-------------------- 1 file changed, 54 insertions(+), 81 deletions(-) diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 4e47b8a8041..4611ae4ade9 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -1260,6 +1260,28 @@ static int fp_access_check_scalar_hsd(DisasContext *s, MemOp esz) return fp_access_check(s); } +/* Likewise, but vector MO_64 must have two elements. */ +static int fp_access_check_vector_hsd(DisasContext *s, bool is_q, MemOp esz) +{ + switch (esz) { + case MO_64: + if (!is_q) { + return -1; + } + break; + case MO_32: + break; + case MO_16: + if (!dc_isar_feature(aa64_fp16, s)) { + return -1; + } + break; + default: + return -1; + } + return fp_access_check(s); +} + /* * Check that SVE access is enabled. If it is, return true. * If not, emit code to generate an appropriate exception and return false. @@ -5420,27 +5442,14 @@ static bool do_fp3_vector(DisasContext *s, arg_qrrr_e *a, int data, gen_helper_gvec_3_ptr * const fns[3]) { MemOp esz = a->esz; + int check = fp_access_check_vector_hsd(s, a->q, esz); - switch (esz) { - case MO_64: - if (!a->q) { - return false; - } - break; - case MO_32: - break; - case MO_16: - if (!dc_isar_feature(aa64_fp16, s)) { - return false; - } - break; - default: - return false; - } - if (fp_access_check(s)) { - gen_gvec_op3_fpst(s, a->q, a->rd, a->rn, a->rm, - esz == MO_16, data, fns[esz - 1]); + if (check <= 0) { + return check == 0; } + + gen_gvec_op3_fpst(s, a->q, a->rd, a->rn, a->rm, + esz == MO_16, data, fns[esz - 1]); return true; } @@ -5768,34 +5777,24 @@ TRANS_FEAT(FCADD_270, aa64_fcma, do_fp3_vector, a, 1, f_vector_fcadd) static bool trans_FCMLA_v(DisasContext *s, arg_FCMLA_v *a) { - gen_helper_gvec_4_ptr *fn; + static gen_helper_gvec_4_ptr * const fn[] = { + [MO_16] = gen_helper_gvec_fcmlah, + [MO_32] = gen_helper_gvec_fcmlas, + [MO_64] = gen_helper_gvec_fcmlad, + }; + int check; if (!dc_isar_feature(aa64_fcma, s)) { return false; } - switch (a->esz) { - case MO_64: - if (!a->q) { - return false; - } - fn = gen_helper_gvec_fcmlad; - break; - case MO_32: - fn = gen_helper_gvec_fcmlas; - break; - case MO_16: - if (!dc_isar_feature(aa64_fp16, s)) { - return false; - } - fn = gen_helper_gvec_fcmlah; - break; - default: - return false; - } - if (fp_access_check(s)) { - gen_gvec_op4_fpst(s, a->q, a->rd, a->rn, a->rm, a->rd, - a->esz == MO_16, a->rot, fn); + + check = fp_access_check_vector_hsd(s, a->q, a->esz); + if (check <= 0) { + return check == 0; } + + gen_gvec_op4_fpst(s, a->q, a->rd, a->rn, a->rm, a->rd, + a->esz == MO_16, a->rot, fn[a->esz]); return true; } @@ -6337,27 +6336,14 @@ static bool do_fp3_vector_idx(DisasContext *s, arg_qrrx_e *a, gen_helper_gvec_3_ptr * const fns[3]) { MemOp esz = a->esz; + int check = fp_access_check_vector_hsd(s, a->q, esz); - switch (esz) { - case MO_64: - if (!a->q) { - return false; - } - break; - case MO_32: - break; - case MO_16: - if (!dc_isar_feature(aa64_fp16, s)) { - return false; - } - break; - default: - g_assert_not_reached(); - } - if (fp_access_check(s)) { - gen_gvec_op3_fpst(s, a->q, a->rd, a->rn, a->rm, - esz == MO_16, a->idx, fns[esz - 1]); + if (check <= 0) { + return check == 0; } + + gen_gvec_op3_fpst(s, a->q, a->rd, a->rn, a->rm, + esz == MO_16, a->idx, fns[esz - 1]); return true; } @@ -6383,28 +6369,15 @@ static bool do_fmla_vector_idx(DisasContext *s, arg_qrrx_e *a, bool neg) gen_helper_gvec_fmla_idx_d, }; MemOp esz = a->esz; + int check = fp_access_check_vector_hsd(s, a->q, esz); - switch (esz) { - case MO_64: - if (!a->q) { - return false; - } - break; - case MO_32: - break; - case MO_16: - if (!dc_isar_feature(aa64_fp16, s)) { - return false; - } - break; - default: - g_assert_not_reached(); - } - if (fp_access_check(s)) { - gen_gvec_op4_fpst(s, a->q, a->rd, a->rn, a->rm, a->rd, - esz == MO_16, (a->idx << 1) | neg, - fns[esz - 1]); + if (check <= 0) { + return check == 0; } + + gen_gvec_op4_fpst(s, a->q, a->rd, a->rn, a->rm, a->rd, + esz == MO_16, (a->idx << 1) | neg, + fns[esz - 1]); return true; } From patchwork Fri Dec 13 17:31:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850175 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1640530wry; Fri, 13 Dec 2024 09:39:11 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUNRCyq0OJ5Nr/7OvdBR8IgKnlxO2+wm7q1ervflubnJewHj9+wRwSYvQgRtWEUTy8z3K0klg==@linaro.org X-Google-Smtp-Source: AGHT+IF+a7rBYi4o/npu2pEozwbSe34wnrwctWo1zz8arjjEwNNX3KvD3ufJa8rknGHsM/539W2V X-Received: by 2002:a05:600c:5025:b0:436:1c0c:bfb6 with SMTP id 5b1f17b1804b1-4362aab0763mr32952665e9.27.1734111551319; Fri, 13 Dec 2024 09:39:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111551; cv=none; d=google.com; s=arc-20240605; b=eZiOa0ZS7Ub2FAUzUFBInyWe5/dW30OHQXP8E4ORm/V6UhjPZklVsufpMtjVk6ulqD FTjPpUjvqZL6Hb5iYheFjXLBIo3EK0RxSWYB1zNa8cLgGpTmJRLEw2eyv0N2nAgTn+bU yrcdXK1esPp6qIcjB8H+dYk8dgNpfwQhxTWcUZBU9G5W4nV2rMIaTorsomubTyEyqpRV eI/67YjQCv2PGnMlQ6uQfJtTFly2EuPH+NfiE/x180obNcCH7TSCtDzbK2rIFprRSnrs 0Ty2flxJ6vzBFy9Rjd2SMFdwOQAcWpxTROKouFBkMtAyYy6CHyp6qRxXRBMZ4vYbFXrN VLZg== 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=HvKVN0eNYR2Ji3llX0JaJuzMLboGsS744lfcra4L1yM=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=Ch8eNwuBGVj/s33hTFlOA0UAvq8ZHOa1U3eUUIu5m51uG0/OaC4GS04xjHp3m0JkP6 sYBWMBkdcsGQ6fRZwz0TMkGV3rJMRbHY53N2dato1VzizPCVxl7C6/NrWzwpFg/juI+T icS7NrTBlCBS1R1Y66/2dB9ww40MiYKNPU57uKfLp/vPUOKsA5b8U4ltC0ZxClDRXTmJ jvoPgQ3vVqt+GUpDy51imvfZk5rzq6dhHi6WfUPZJZGc/pkV9jzBoslN/kLZ8CN2Y6ei QwgX+gvkb9502FlJnXmbwa+VXGXHH2Riib+ekNmZuCyYrSDZXp89fkwUm+o5SxBkGC1Q Jv/w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="SgQoq/iD"; 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 ffacd0b85a97d-388c804d706si38429f8f.428.2024.12.13.09.39.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:39:11 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="SgQoq/iD"; 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 1tM9YG-0000no-Ed; Fri, 13 Dec 2024 12:34: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 1tM9XA-00072D-98 for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:00 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9X6-0001Wi-R8 for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:32:59 -0500 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-3862df95f92so1072337f8f.2 for ; Fri, 13 Dec 2024 09:32:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111175; x=1734715975; 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=HvKVN0eNYR2Ji3llX0JaJuzMLboGsS744lfcra4L1yM=; b=SgQoq/iDHyThh/h+fJEpTAAbM7jnYNkY9Z0Ol8Jes/PH5UuHrjTGHTVk5sw+lP7FpG 3VTWh30LCl0/pHsReGK+hKt1hpYiouJua96JwuZRKJfz9+HH8sJ2QQvQ3aTTVaNCr9BP hybfK28hHuKgdVSVasFSmqZ0VudAtewWjcu7s6E/FamX2FTcl9pYVZCmYirmhxTSQbuM By89KXTGyAICqkhw//fJDp37HwJfOihDlsz5A45SGL6+ZiS40Xtn71GLsZVjcnI+04V6 h65OGk3h9BtpQx+tf/7+UsEHUjBlKFKgJc/p1TvdSoaIAZ7d9VEO0Lgbas+V6abHrSxH KXjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111175; x=1734715975; 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=HvKVN0eNYR2Ji3llX0JaJuzMLboGsS744lfcra4L1yM=; b=cGJo80eWsKjkP69wo9siW0PjhxRXrRUtWjYicWL2lADmuYazeXLEa7XKj68wq4EkpI gieC/rObUgupbjyo7hAoWdr+cYWyxZLv84gSRrkegjlU1eEp7YkgFcvG+en/dp9cR+b6 0Rap/G/4sulw2ofc9a+EAmw2f0RFDQ2W7uJwKgVLl/DtfAqBYM0bh3XRG8xrrMhgQl+n oMSl52euDybqiKLbZbMrXHZ6W4SHfRh10wR3vXRS53hNrFKhguYbqoOqZ1nNhzWVEcVi RRjjPZr2WWv7glRO4uxAKhp6jPxqaM+uXqdOWcGiOJrB0l5TWIQWttT1KulfpylAwxFu T1DA== X-Gm-Message-State: AOJu0YzgOAjJdjU/f9GXlDq0dXDzTj/aUBvFJB+ANewgJaPeOMaVX0fa /sneOIsIjGdqDYmD7kHllOBbEEtMyGCFsacO6wTTLX7uSPgPYmXBmA73MmEyzg+aVa6YcBovHK0 + X-Gm-Gg: ASbGncvD9cIyTl3+Q7caY/QGY0eKPHqbJBe1ZqrcnAzxywwLMU7XK4MXwCR7mu41/vW WEi0DuZ9or5AqdHPTOGit696rNFhmjrp2DCAdYXlkZZsLQwoItm8VusqpLLz3jWZqIz3kIDoSRd o6qKNEpg0dF9wUkgPERUmsRFhZWXrvjThU4x5iNfUpCB9yU+86LDfJy+sQGZ9axbwu6FQG+VDRd mfEy/3+Gud7Uyax8ogdmUbjVxBLnsQn6mWMyzWQuupT1xAPYbH05SbXcdLJbg== X-Received: by 2002:a5d:6801:0:b0:388:c75c:e839 with SMTP id ffacd0b85a97d-388c75ce895mr527886f8f.42.1734111174987; Fri, 13 Dec 2024 09:32:54 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.32.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:32:54 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 22/85] target/arm: Convert FCMP, FCMPE, FCCMP, FCCMPE to decodetree Date: Fri, 13 Dec 2024 17:31:26 +0000 Message-Id: <20241213173229.3308926-23-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-23-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 8 + target/arm/tcg/translate-a64.c | 283 ++++++++++++--------------------- 2 files changed, 112 insertions(+), 179 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 56708467681..7868b1cb241 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -1325,6 +1325,14 @@ FMINV_s 0110 1110 10 11000 01111 10 ..... ..... @rr_q1e2 FMOVI_s 0001 1110 .. 1 imm:8 100 00000 rd:5 esz=%esz_hsd +# Floating-point Compare + +FCMP 00011110 .. 1 rm:5 001000 rn:5 e:1 z:1 000 esz=%esz_hsd + +# Floating-point Conditional Compare + +FCCMP 00011110 .. 1 rm:5 cond:4 01 rn:5 e:1 nzcv:4 esz=%esz_hsd + # Advanced SIMD Modified Immediate / Shift by Immediate %abcdefgh 16:3 5:5 diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 4611ae4ade9..a99f3d0d135 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -6888,6 +6888,106 @@ static bool trans_FMOVI_s(DisasContext *s, arg_FMOVI_s *a) return true; } +/* + * Floating point compare, conditional compare + */ + +static void handle_fp_compare(DisasContext *s, int size, + unsigned int rn, unsigned int rm, + bool cmp_with_zero, bool signal_all_nans) +{ + TCGv_i64 tcg_flags = tcg_temp_new_i64(); + TCGv_ptr fpst = fpstatus_ptr(size == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); + + if (size == MO_64) { + TCGv_i64 tcg_vn, tcg_vm; + + tcg_vn = read_fp_dreg(s, rn); + if (cmp_with_zero) { + tcg_vm = tcg_constant_i64(0); + } else { + tcg_vm = read_fp_dreg(s, rm); + } + if (signal_all_nans) { + gen_helper_vfp_cmped_a64(tcg_flags, tcg_vn, tcg_vm, fpst); + } else { + gen_helper_vfp_cmpd_a64(tcg_flags, tcg_vn, tcg_vm, fpst); + } + } else { + TCGv_i32 tcg_vn = tcg_temp_new_i32(); + TCGv_i32 tcg_vm = tcg_temp_new_i32(); + + read_vec_element_i32(s, tcg_vn, rn, 0, size); + if (cmp_with_zero) { + tcg_gen_movi_i32(tcg_vm, 0); + } else { + read_vec_element_i32(s, tcg_vm, rm, 0, size); + } + + switch (size) { + case MO_32: + if (signal_all_nans) { + gen_helper_vfp_cmpes_a64(tcg_flags, tcg_vn, tcg_vm, fpst); + } else { + gen_helper_vfp_cmps_a64(tcg_flags, tcg_vn, tcg_vm, fpst); + } + break; + case MO_16: + if (signal_all_nans) { + gen_helper_vfp_cmpeh_a64(tcg_flags, tcg_vn, tcg_vm, fpst); + } else { + gen_helper_vfp_cmph_a64(tcg_flags, tcg_vn, tcg_vm, fpst); + } + break; + default: + g_assert_not_reached(); + } + } + + gen_set_nzcv(tcg_flags); +} + +/* FCMP, FCMPE */ +static bool trans_FCMP(DisasContext *s, arg_FCMP *a) +{ + int check = fp_access_check_scalar_hsd(s, a->esz); + + if (check <= 0) { + return check == 0; + } + + handle_fp_compare(s, a->esz, a->rn, a->rm, a->z, a->e); + return true; +} + +/* FCCMP, FCCMPE */ +static bool trans_FCCMP(DisasContext *s, arg_FCCMP *a) +{ + TCGLabel *label_continue = NULL; + int check = fp_access_check_scalar_hsd(s, a->esz); + + if (check <= 0) { + return check == 0; + } + + if (a->cond < 0x0e) { /* not always */ + TCGLabel *label_match = gen_new_label(); + label_continue = gen_new_label(); + arm_gen_test_cc(a->cond, label_match); + /* nomatch: */ + gen_set_nzcv(tcg_constant_i64(a->nzcv << 28)); + tcg_gen_br(label_continue); + gen_set_label(label_match); + } + + handle_fp_compare(s, a->esz, a->rn, a->rm, false, a->e); + + if (label_continue) { + gen_set_label(label_continue); + } + return true; +} + /* * Advanced SIMD Modified Immediate */ @@ -8183,174 +8283,6 @@ static bool trans_CSEL(DisasContext *s, arg_CSEL *a) return true; } -static void handle_fp_compare(DisasContext *s, int size, - unsigned int rn, unsigned int rm, - bool cmp_with_zero, bool signal_all_nans) -{ - TCGv_i64 tcg_flags = tcg_temp_new_i64(); - TCGv_ptr fpst = fpstatus_ptr(size == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); - - if (size == MO_64) { - TCGv_i64 tcg_vn, tcg_vm; - - tcg_vn = read_fp_dreg(s, rn); - if (cmp_with_zero) { - tcg_vm = tcg_constant_i64(0); - } else { - tcg_vm = read_fp_dreg(s, rm); - } - if (signal_all_nans) { - gen_helper_vfp_cmped_a64(tcg_flags, tcg_vn, tcg_vm, fpst); - } else { - gen_helper_vfp_cmpd_a64(tcg_flags, tcg_vn, tcg_vm, fpst); - } - } else { - TCGv_i32 tcg_vn = tcg_temp_new_i32(); - TCGv_i32 tcg_vm = tcg_temp_new_i32(); - - read_vec_element_i32(s, tcg_vn, rn, 0, size); - if (cmp_with_zero) { - tcg_gen_movi_i32(tcg_vm, 0); - } else { - read_vec_element_i32(s, tcg_vm, rm, 0, size); - } - - switch (size) { - case MO_32: - if (signal_all_nans) { - gen_helper_vfp_cmpes_a64(tcg_flags, tcg_vn, tcg_vm, fpst); - } else { - gen_helper_vfp_cmps_a64(tcg_flags, tcg_vn, tcg_vm, fpst); - } - break; - case MO_16: - if (signal_all_nans) { - gen_helper_vfp_cmpeh_a64(tcg_flags, tcg_vn, tcg_vm, fpst); - } else { - gen_helper_vfp_cmph_a64(tcg_flags, tcg_vn, tcg_vm, fpst); - } - break; - default: - g_assert_not_reached(); - } - } - - gen_set_nzcv(tcg_flags); -} - -/* Floating point compare - * 31 30 29 28 24 23 22 21 20 16 15 14 13 10 9 5 4 0 - * +---+---+---+-----------+------+---+------+-----+---------+------+-------+ - * | M | 0 | S | 1 1 1 1 0 | type | 1 | Rm | op | 1 0 0 0 | Rn | op2 | - * +---+---+---+-----------+------+---+------+-----+---------+------+-------+ - */ -static void disas_fp_compare(DisasContext *s, uint32_t insn) -{ - unsigned int mos, type, rm, op, rn, opc, op2r; - int size; - - mos = extract32(insn, 29, 3); - type = extract32(insn, 22, 2); - rm = extract32(insn, 16, 5); - op = extract32(insn, 14, 2); - rn = extract32(insn, 5, 5); - opc = extract32(insn, 3, 2); - op2r = extract32(insn, 0, 3); - - if (mos || op || op2r) { - unallocated_encoding(s); - return; - } - - switch (type) { - case 0: - size = MO_32; - break; - case 1: - size = MO_64; - break; - case 3: - size = MO_16; - if (dc_isar_feature(aa64_fp16, s)) { - break; - } - /* fallthru */ - default: - unallocated_encoding(s); - return; - } - - if (!fp_access_check(s)) { - return; - } - - handle_fp_compare(s, size, rn, rm, opc & 1, opc & 2); -} - -/* Floating point conditional compare - * 31 30 29 28 24 23 22 21 20 16 15 12 11 10 9 5 4 3 0 - * +---+---+---+-----------+------+---+------+------+-----+------+----+------+ - * | M | 0 | S | 1 1 1 1 0 | type | 1 | Rm | cond | 0 1 | Rn | op | nzcv | - * +---+---+---+-----------+------+---+------+------+-----+------+----+------+ - */ -static void disas_fp_ccomp(DisasContext *s, uint32_t insn) -{ - unsigned int mos, type, rm, cond, rn, op, nzcv; - TCGLabel *label_continue = NULL; - int size; - - mos = extract32(insn, 29, 3); - type = extract32(insn, 22, 2); - rm = extract32(insn, 16, 5); - cond = extract32(insn, 12, 4); - rn = extract32(insn, 5, 5); - op = extract32(insn, 4, 1); - nzcv = extract32(insn, 0, 4); - - if (mos) { - unallocated_encoding(s); - return; - } - - switch (type) { - case 0: - size = MO_32; - break; - case 1: - size = MO_64; - break; - case 3: - size = MO_16; - if (dc_isar_feature(aa64_fp16, s)) { - break; - } - /* fallthru */ - default: - unallocated_encoding(s); - return; - } - - if (!fp_access_check(s)) { - return; - } - - if (cond < 0x0e) { /* not always */ - TCGLabel *label_match = gen_new_label(); - label_continue = gen_new_label(); - arm_gen_test_cc(cond, label_match); - /* nomatch: */ - gen_set_nzcv(tcg_constant_i64(nzcv << 28)); - tcg_gen_br(label_continue); - gen_set_label(label_match); - } - - handle_fp_compare(s, size, rn, rm, false, op); - - if (cond < 0x0e) { - gen_set_label(label_continue); - } -} - /* Floating-point data-processing (1 source) - half precision */ static void handle_fp_1src_half(DisasContext *s, int opcode, int rd, int rn) { @@ -9107,16 +9039,9 @@ static void disas_data_proc_fp(DisasContext *s, uint32_t insn) disas_fp_fixed_conv(s, insn); } else { switch (extract32(insn, 10, 2)) { - case 1: - /* Floating point conditional compare */ - disas_fp_ccomp(s, insn); - break; - case 2: - /* Floating point data-processing (2 source) */ - unallocated_encoding(s); /* in decodetree */ - break; - case 3: - /* Floating point conditional select */ + case 1: /* Floating point conditional compare */ + case 2: /* Floating point data-processing (2 source) */ + case 3: /* Floating point conditional select */ unallocated_encoding(s); /* in decodetree */ break; case 0: @@ -9127,7 +9052,7 @@ static void disas_data_proc_fp(DisasContext *s, uint32_t insn) break; case 1: /* [15:12] == xx10 */ /* Floating point compare */ - disas_fp_compare(s, insn); + unallocated_encoding(s); /* in decodetree */ break; case 2: /* [15:12] == x100 */ /* Floating point data-processing (1 source) */ From patchwork Fri Dec 13 17:31:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850141 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1638107wry; Fri, 13 Dec 2024 09:34:12 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXs7L1iwRX+Y02EuykdLmJsh6D5EoUQym8VT7sFiY7MrguD6B43gmfDPMQZP0n+oI62tVjyVg==@linaro.org X-Google-Smtp-Source: AGHT+IH5qnOFk2g6u30eEtPyU1Mh/Jw4ySoZRMRNHvwdYzQcbUnfQfopEIIg8WLm4NjEaCbOSAWp X-Received: by 2002:a05:620a:1a04:b0:7b6:e8d4:9b85 with SMTP id af79cd13be357-7b6fbf45006mr464545485a.61.1734111252542; Fri, 13 Dec 2024 09:34:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111252; cv=none; d=google.com; s=arc-20240605; b=ZLm14ItxWurtZ1o5uo7FG6s8ayK8Vtk6rp71XBzqN1hDCCle1t1wScUyvhYRIyBXQq w1y/WkrbW0h7CQawWqn2N1pBp/hDtRphzSU5NB2XGSA4v1YnaSYojlVvdo9Du1ZsezCd WmYWPE5OnYsJtRqLE9+hq4PJsZNzd72V8Ggctc87QY43QMOR9LURACor20kulqocCkY6 fk59vID2AkTthmxJjYzfxcSI1efMetY2RUDUtNlI2d45tZEhG1j7cWTb7fXr/lLs5/g8 joyJxDPehdIjBlRMf4xbaS2zaUj92nS9j/WpZwg2a81DQIgyJmR7boJKtQjAvDWe0kzR rvmg== 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=eaX6KljypzYLDCkXE/78gtp4RnXR8b1xmtguoFNogMg=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=AYvR2JqZImDNoSAvBzrawAfUGnz+9VAc+9h8NU1mhlZapi5sped587DROmgLm6TP3H Fa3ikiZ4lnMxoerB7AWMwz56U4WXkYnIheZ+qSEh4HB0k4F9LTqmEiF+eTRhz70kUZP2 74p7RDm8KUB84VX0MDP2Ol+eIaeVkR3EVXAnF9p7qw23HGYtYLcbDZNPhSP4zO1/RR6Z lX8+dJIwfv+yhf/sgBLNyNxVfg3GcXbkfh3VQ8zDFxIlIb8j+JrZ8vlPoftCmqE+URKX PNo/sXbCTOuqToz5t02eKsUp5+2JZEnXJFjsi4L7c2p/J4wYd8Eq3rUkU2bpt+G8BvoN dzKw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Unnyc63j; 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-7b6f3782300si542099385a.225.2024.12.13.09.34.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:34: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=Unnyc63j; 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 1tM9Y6-0008Mc-1h; Fri, 13 Dec 2024 12:33:58 -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 1tM9XA-00072C-8B for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:00 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9X7-0001Wv-Ei for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:32:58 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-436281c8a38so11937005e9.3 for ; Fri, 13 Dec 2024 09:32:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111176; x=1734715976; 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=eaX6KljypzYLDCkXE/78gtp4RnXR8b1xmtguoFNogMg=; b=Unnyc63jgLBZPO42xV5hX0GP9aWCTxw8wOakQSJU8jJuyGECA2XK4PjjmXP2/SjkzD sFU4rhHuOXjwJfYzt6cV/q27Dy4PHbhNu0+VhDQNkzSHtakxSBFCA2EI3RU4wvHF08jB 4pdFWqww0QkH/zOkNJPADxXY+ILIsf3ZjLrmi/f4+8+OuG4M9qIkZeeHyrrhaE4yUs3v +nR3FwAroitqJwWFZlERnWVS4eu9OabcFM8JJe7L/6Mf/P60naR2/21wwbH/rLQpMwRy yr0R3jkWRhjdD3Y5oyYUcCkbLdhveZM4yEYSnvbaVG7AnjnpbKBihsFyaOB5LT9Z2nf/ hI7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111176; x=1734715976; 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=eaX6KljypzYLDCkXE/78gtp4RnXR8b1xmtguoFNogMg=; b=Rz+1k+zVMAemzYBb7pevzgRcatg9RRVd5fjFerKiqlJoaKgxl6E5nbfUdMAmDXwhNE DtNzcyA77mabkmWoK1g5aKoGliHIZENtzVTutvLo0E92iBfqGMl5nqP638YSYJuAk3ba r/1T/rCgsVueJQPou/vPvocHlLZLC/ACbulM4m+XAJR+QFlcEUH6V8xHSESFlptrObv9 21iQ0cQKMHhQn4NQ7Ov5vJuW0Ov1fZkf2mOhhYCITFjEcKaXvmfy67gC90cYo3oR6+d3 lwP0gM8zDCGGy/u6+IXkPoDOvIYjSIZD3+NXaJ5WclYHU5FUDLdZgquksNRdBUoxl2X8 fgCA== X-Gm-Message-State: AOJu0YwglsJjfHmOzGGPYoPrNJ/1OGDVCXK5TL0vl+qPos3fNmVu4GYi oXGJMFyJwHVQ5ha8aBvFfLOu8wd3Ng6UL5quC7adlMKWCFuydJctv+qsMVxYgjEQ5Ue+Svw3eYa A X-Gm-Gg: ASbGncsXhEqa2NguHgRqs9yly+502S7Yy7uhIKQY/aR6nGQmpxoq2+knOLSp34fzRnN QUq4bH2LGivaFikhJ3knd4k+0z/kV943AM8asUBbPSB2G9lkEqukJylrNbSOWT95WqbkYpcS8K/ eNK9uuk/Tz4KVXpLWKThusHmCDMaRyZmS+2mYFaXAp4kGk5yZZzl5dljiMr7teY9POzF+sLEfF8 2mylImPBytRIghwaar7l8+gj/njSGu/w14hpwVmzxTtr2NpqMflyKDlbtxOAQ== X-Received: by 2002:a05:6000:4709:b0:386:3803:bbd8 with SMTP id ffacd0b85a97d-3888e0c4d35mr2809601f8f.59.1734111175963; Fri, 13 Dec 2024 09:32:55 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.32.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:32:55 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 23/85] target/arm: Fix decode of fp16 vector fabs, fneg, fsqrt Date: Fri, 13 Dec 2024 17:31:27 +0000 Message-Id: <20241213173229.3308926-24-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x333.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: Richard Henderson These opcodes are only supported as vector operations, not as advsimd scalar. Set only_in_vector, and remove the unreachable implementation of scalar fneg. Reported-by: Peter Maydell Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell Message-id: 20241211163036.2297116-24-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/translate-a64.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index a99f3d0d135..3c1784593a4 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -10816,10 +10816,13 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn) break; case 0x2f: /* FABS */ case 0x6f: /* FNEG */ + only_in_vector = true; need_fpst = false; break; case 0x7d: /* FRSQRTE */ + break; case 0x7f: /* FSQRT (vector) */ + only_in_vector = true; break; default: unallocated_encoding(s); @@ -10877,9 +10880,6 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn) case 0x7b: /* FCVTZU */ gen_helper_advsimd_f16touinth(tcg_res, tcg_op, tcg_fpstatus); break; - case 0x6f: /* FNEG */ - tcg_gen_xori_i32(tcg_res, tcg_op, 0x8000); - break; case 0x7d: /* FRSQRTE */ gen_helper_rsqrte_f16(tcg_res, tcg_op, tcg_fpstatus); break; From patchwork Fri Dec 13 17:31:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850149 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1638399wry; Fri, 13 Dec 2024 09:34:43 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUTFVmdiowhz78Uf5ryZHYA3lm6yXzhQF80URA2y2zUGeEUYXc5m9WUsnBST5kkAyrpH5usCw==@linaro.org X-Google-Smtp-Source: AGHT+IEBjgFYlx74cfyABEklFVLAj0QZavuaLCSSfSluiVyOTMRNitb79ULySN3KCRlnanLe/ZFb X-Received: by 2002:a17:906:4788:b0:aa6:75f4:20df with SMTP id a640c23a62f3a-aa6c40f8b8bmr709212566b.9.1734111283572; Fri, 13 Dec 2024 09:34:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111283; cv=none; d=google.com; s=arc-20240605; b=cz3V6vB8+V90exBpCBKtxpfprfiDMUoFKl1Yw+/xUtLljNQkiXx+zEG9DZ93R5fiwV fVv6D64B09YqwXqiV8el4jNP+xMWxs8YKXaJvomXFtO0/nVe1SSN/XDKyRVpIhz8ZXHU 1LXYscF2ZYiJVUsw4q7/mvdHvybcAWCGd3IRwUdzqe/+BBi187DvD+g8vQdB+6thhxhi M45WBobxgQA6icjHl5HZnt1GCHXg2vu5ZTtwdNVzDadHHgXhQE04NqMyHSr4OBEpWzg7 /x5ab1YYR6A+0bKRh7rLb3tbgVQRgaSG7vHJSZFunmT3E7/EJInAm/Prgyena1f7BJhz BRAQ== 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=54cqaTCZDwpJNs8EfB+g2AzvMa88o+LYRMX74oNfRfM=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=D+IMxK621o2zjfbDszdwq1xx+JuxyKNZXXqONxPPoEdD0PvyOxVnAG5BFlDsex/QPR D7Fxz/0En9RIvFBEkPG+IN/EmDIR1O35RYyaI8BY9NMiw8amK+O/7vx0zdOiZWDfenIt 70jpzAiJKOTf73gcw5Q44QmjPiI2S8wgy9/d4I3ITHj6L2l6t58to+24/gHWoL/bzEJl gP7ZU++JpB84Bu8nOSFDFdvxoerb/QSBglVtMqiAYcqKyweVp3bCA8I9GMNxe3Dy+uM7 6FYDZOb7q3nVF2w5AOyC3Zoa/fiHs17YxL6o2G9SLZENKr3BQir8b2Xrm9e4XgG6M7rg wCLQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ncn602QY; 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 a640c23a62f3a-aa68dd43c5asi741400666b.384.2024.12.13.09.34.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:34: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=Ncn602QY; 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 1tM9YJ-0001Cq-CV; Fri, 13 Dec 2024 12:34: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 1tM9XB-00073K-Ux for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:02 -0500 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9X9-0001XE-Vu for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:01 -0500 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-3862d16b4f5so1351628f8f.0 for ; Fri, 13 Dec 2024 09:32:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111177; x=1734715977; 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=54cqaTCZDwpJNs8EfB+g2AzvMa88o+LYRMX74oNfRfM=; b=Ncn602QYC96hpJKHX5Q5GVzMi/P+uqX/Ox5sH2Qe+3ggRfJ6Rceee1+Q43+mEpLWvg XwN/5tCopn2KnPQTKDi2dEXEdWPvSI+0wq4T0EO/zYQXG7MWMZ+NxwK0k6hiZZv7fjCM UzPH1sxhn8Q7Sp0jvNSUUwvNs0b+wwBTi4YUZwTQy1bav6iai/lAKNyaitx0BiIRNZ4C 2oTQxOJKb7PWa/ZRPACKHEmzwfIympE05kE9zGH9xSFJe/O2Q2tHIIa01YMAFMmkKQOT Eq3q+5NOdDnEZ8qVtnOlQcdNphRLKuFpdCtHFnJoGQcsgKI0avSWj/61qXaD53u5IdOJ Rnfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111177; x=1734715977; 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=54cqaTCZDwpJNs8EfB+g2AzvMa88o+LYRMX74oNfRfM=; b=WK95+a5hCwX4ZlJnfM9OmwfLeIW9ktOFmP2+3Hvd2kBxcVMLEpnFQQf+3L8S7Z8Ulm +VaEgNoTlQdjPSpHFF2QWq6oD4ajdhw/Nh/Gd1B9nnJK1MqjL9nnVPRMJKL2L4NbwHIz d5xfcut5zqzXsyRZvZcr6Qoo2N6l4/MqdQG7hgnSXR6YI3klDzzv6kW/yYLPwDcd1Xdj Tx5qARsUlmCrorUsUvlatmqMXhiEFLwalYJHXr2PHzTg1gDryJdTSC1wYq+DAFHjzhJy V8uITI2vkFc281wNLBeGxaz7ZmYpRoafbAa8q1qgGSzMPahb9gDiG6fyssw1rhfZYxOU xXDA== X-Gm-Message-State: AOJu0YzCn2MvRbSUyVurH2w/m3WArhKXhF4PS4zVU6p2j2Gn+pYRF5/T uDGq7AOtEqBKpMQY6o3xcLzlnl/4NUX+QylQIgi0VuT8ix3SEu2vE/iu16t+azJ08mEDgocqiZB Y X-Gm-Gg: ASbGnctIypfPoDfYJxWInuRkjn4u+4ox3Lw1GPpZegDaKC377xMemOroohlFH70WhJl k+Mj5SSp2ZDKKdvsV7mS7WlnyNzL2czB2Pp+cy53Z1v19xyXFEsRrj8mldxk67ZsywHYCT2oP4e iGugbzP8ixHawmfsCU86DfPQyz3RdfOknPr5pgzv0En1oytQsPmA9U3aLX68swEZhz4X4t8hUU3 vxB61e+0b7G7d+O78JbHgnCyvFDaHExKHmiID09WIC8rMJ4Fn6iR9pqF5Ik3A== X-Received: by 2002:a05:6000:186e:b0:385:df17:2148 with SMTP id ffacd0b85a97d-3878884747emr6883800f8f.20.1734111176974; Fri, 13 Dec 2024 09:32:56 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.32.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:32:56 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 24/85] target/arm: Convert FMOV, FABS, FNEG (scalar) to decodetree Date: Fri, 13 Dec 2024 17:31:28 +0000 Message-Id: <20241213173229.3308926-25-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x435.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-25-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 7 +++ target/arm/tcg/translate-a64.c | 105 +++++++++++++++++++++++---------- 2 files changed, 81 insertions(+), 31 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 7868b1cb241..b9cc8963da8 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -47,6 +47,7 @@ @rr_h ........ ... ..... ...... rn:5 rd:5 &rr_e esz=1 @rr_d ........ ... ..... ...... rn:5 rd:5 &rr_e esz=3 @rr_sd ........ ... ..... ...... rn:5 rd:5 &rr_e esz=%esz_sd +@rr_hsd ........ ... ..... ...... rn:5 rd:5 &rr_e esz=%esz_hsd @rrr_b ........ ... rm:5 ...... rn:5 rd:5 &rrr_e esz=0 @rrr_h ........ ... rm:5 ...... rn:5 rd:5 &rrr_e esz=1 @@ -1321,6 +1322,12 @@ FMAXV_s 0110 1110 00 11000 01111 10 ..... ..... @rr_q1e2 FMINV_h 0.00 1110 10 11000 01111 10 ..... ..... @qrr_h FMINV_s 0110 1110 10 11000 01111 10 ..... ..... @rr_q1e2 +# Floating-point data processing (1 source) + +FMOV_s 00011110 .. 1 000000 10000 ..... ..... @rr_hsd +FABS_s 00011110 .. 1 000001 10000 ..... ..... @rr_hsd +FNEG_s 00011110 .. 1 000010 10000 ..... ..... @rr_hsd + # Floating-point Immediate FMOVI_s 0001 1110 .. 1 imm:8 100 00000 rd:5 esz=%esz_hsd diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 3c1784593a4..ca2b95510e2 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -8283,6 +8283,67 @@ static bool trans_CSEL(DisasContext *s, arg_CSEL *a) return true; } +typedef struct FPScalar1Int { + void (*gen_h)(TCGv_i32, TCGv_i32); + void (*gen_s)(TCGv_i32, TCGv_i32); + void (*gen_d)(TCGv_i64, TCGv_i64); +} FPScalar1Int; + +static bool do_fp1_scalar_int(DisasContext *s, arg_rr_e *a, + const FPScalar1Int *f) +{ + switch (a->esz) { + case MO_64: + if (fp_access_check(s)) { + TCGv_i64 t = read_fp_dreg(s, a->rn); + f->gen_d(t, t); + write_fp_dreg(s, a->rd, t); + } + break; + case MO_32: + if (fp_access_check(s)) { + TCGv_i32 t = read_fp_sreg(s, a->rn); + f->gen_s(t, t); + write_fp_sreg(s, a->rd, t); + } + break; + case MO_16: + if (!dc_isar_feature(aa64_fp16, s)) { + return false; + } + if (fp_access_check(s)) { + TCGv_i32 t = read_fp_hreg(s, a->rn); + f->gen_h(t, t); + write_fp_sreg(s, a->rd, t); + } + break; + default: + return false; + } + return true; +} + +static const FPScalar1Int f_scalar_fmov = { + tcg_gen_mov_i32, + tcg_gen_mov_i32, + tcg_gen_mov_i64, +}; +TRANS(FMOV_s, do_fp1_scalar_int, a, &f_scalar_fmov) + +static const FPScalar1Int f_scalar_fabs = { + gen_vfp_absh, + gen_vfp_abss, + gen_vfp_absd, +}; +TRANS(FABS_s, do_fp1_scalar_int, a, &f_scalar_fabs) + +static const FPScalar1Int f_scalar_fneg = { + gen_vfp_negh, + gen_vfp_negs, + gen_vfp_negd, +}; +TRANS(FNEG_s, do_fp1_scalar_int, a, &f_scalar_fneg) + /* Floating-point data-processing (1 source) - half precision */ static void handle_fp_1src_half(DisasContext *s, int opcode, int rd, int rn) { @@ -8291,15 +8352,6 @@ static void handle_fp_1src_half(DisasContext *s, int opcode, int rd, int rn) TCGv_i32 tcg_res = tcg_temp_new_i32(); switch (opcode) { - case 0x0: /* FMOV */ - tcg_gen_mov_i32(tcg_res, tcg_op); - break; - case 0x1: /* FABS */ - gen_vfp_absh(tcg_res, tcg_op); - break; - case 0x2: /* FNEG */ - gen_vfp_negh(tcg_res, tcg_op); - break; case 0x3: /* FSQRT */ fpst = fpstatus_ptr(FPST_FPCR_F16); gen_helper_sqrt_f16(tcg_res, tcg_op, fpst); @@ -8327,6 +8379,9 @@ static void handle_fp_1src_half(DisasContext *s, int opcode, int rd, int rn) gen_helper_advsimd_rinth(tcg_res, tcg_op, fpst); break; default: + case 0x0: /* FMOV */ + case 0x1: /* FABS */ + case 0x2: /* FNEG */ g_assert_not_reached(); } @@ -8345,15 +8400,6 @@ static void handle_fp_1src_single(DisasContext *s, int opcode, int rd, int rn) tcg_res = tcg_temp_new_i32(); switch (opcode) { - case 0x0: /* FMOV */ - tcg_gen_mov_i32(tcg_res, tcg_op); - goto done; - case 0x1: /* FABS */ - gen_vfp_abss(tcg_res, tcg_op); - goto done; - case 0x2: /* FNEG */ - gen_vfp_negs(tcg_res, tcg_op); - goto done; case 0x3: /* FSQRT */ gen_helper_vfp_sqrts(tcg_res, tcg_op, tcg_env); goto done; @@ -8389,6 +8435,9 @@ static void handle_fp_1src_single(DisasContext *s, int opcode, int rd, int rn) gen_fpst = gen_helper_frint64_s; break; default: + case 0x0: /* FMOV */ + case 0x1: /* FABS */ + case 0x2: /* FNEG */ g_assert_not_reached(); } @@ -8413,22 +8462,10 @@ static void handle_fp_1src_double(DisasContext *s, int opcode, int rd, int rn) TCGv_ptr fpst; int rmode = -1; - switch (opcode) { - case 0x0: /* FMOV */ - gen_gvec_fn2(s, false, rd, rn, tcg_gen_gvec_mov, 0); - return; - } - tcg_op = read_fp_dreg(s, rn); tcg_res = tcg_temp_new_i64(); switch (opcode) { - case 0x1: /* FABS */ - gen_vfp_absd(tcg_res, tcg_op); - goto done; - case 0x2: /* FNEG */ - gen_vfp_negd(tcg_res, tcg_op); - goto done; case 0x3: /* FSQRT */ gen_helper_vfp_sqrtd(tcg_res, tcg_op, tcg_env); goto done; @@ -8461,6 +8498,9 @@ static void handle_fp_1src_double(DisasContext *s, int opcode, int rd, int rn) gen_fpst = gen_helper_frint64_d; break; default: + case 0x0: /* FMOV */ + case 0x1: /* FABS */ + case 0x2: /* FNEG */ g_assert_not_reached(); } @@ -8581,7 +8621,7 @@ static void disas_fp_1src(DisasContext *s, uint32_t insn) goto do_unallocated; } /* fall through */ - case 0x0 ... 0x3: + case 0x3: case 0x8 ... 0xc: case 0xe ... 0xf: /* 32-to-32 and 64-to-64 ops */ @@ -8631,6 +8671,9 @@ static void disas_fp_1src(DisasContext *s, uint32_t insn) default: do_unallocated: + case 0x0: /* FMOV */ + case 0x1: /* FABS */ + case 0x2: /* FNEG */ unallocated_encoding(s); break; } From patchwork Fri Dec 13 17:31:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850140 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1638097wry; Fri, 13 Dec 2024 09:34:11 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCX6oPgiV3Drewt8FmoxQ6vqy58aOo5MvQvhsDzHkfO1xULK9O8UTKrSmXqkhLDPuSPn9G8GxA==@linaro.org X-Google-Smtp-Source: AGHT+IHWT8Li7T40pqsB11MRymoVMORYY96ko+Q2LyvL4K5xJkqVBcugDuITuHs45vqfKlx1y+5y X-Received: by 2002:a05:6102:442a:b0:4b1:16f8:efc6 with SMTP id ada2fe7eead31-4b25dc8cd1bmr4704211137.7.1734111251101; Fri, 13 Dec 2024 09:34:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111251; cv=none; d=google.com; s=arc-20240605; b=knjAL5cgN6M6ne2JBOJbXqWMoW0uto2Ksk0zlkzRLj9hwZL5nMMOzyOYXR2Xas8lrs yhYfn7EjU+Yflk2EgPfgYpPtcD5IvT9c1dYmk0Wdct4TNjaM1pDU4fJG6mow8vjcAWWF AzhYAEx7XRH3HygZshW8s1uOQH5uTvyxDqyg//kaxuyjbUukmDnQwu0/bweSc1ArUuy+ Pqr5cftkjfzf/08qd5454XSH8MX+Z+/4JYfRQoTH1dtvURFVuBYiBNgwk+RoftS0FJ/n /LNd+D/M4pVWKEmxHTazj7m7Nq3qj9DHIU6+NhcV21gb/ucjPi8h4tRzp+GmA38awN4I rtJg== 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=SebYeO56jOAlUYYHC79zwogvEFSt4JEj+habP31pt+w=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=DmAiNp0t8aXRCNJVx56SLiCkBDKEhiKZXvJubQDULTrdmxZ67oJMmEaACYWvr2ctiW F4jc89aUKpEn/ZgK1JwRN8lMBv6HvrCUM8N9q4sUh223wVbYSrPvHjhCz2vnkQgQcMDd ihiUBfNOd6LNxW5mHft8Ugb614LMItuTzbsDPMNLqL8ZN3HYTViQsqy8oYyEHz7s2dfU /ip4/m6AvsI2NIdukeDcPStTpyKE1lf0s7z3LTzxeA9qN5IlqZJeVjphBZL3YzwGLuIq Tv1wBVIDYdCMU2uP2I/jdWehIFe5SzgUWpAYU13LJeNvCjcGbpT5LZROx4Va4rJo1Ekr HxOQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aNM7Y6dk; 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 ada2fe7eead31-4afdfce003asi745685137.488.2024.12.13.09.34.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:34:11 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aNM7Y6dk; 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 1tM9Xn-0007rh-FP; Fri, 13 Dec 2024 12:33:39 -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 1tM9XC-00074E-Ur for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:03 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9XA-0001XK-0n for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:02 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-4361815b96cso13698665e9.1 for ; Fri, 13 Dec 2024 09:32:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111178; x=1734715978; 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=SebYeO56jOAlUYYHC79zwogvEFSt4JEj+habP31pt+w=; b=aNM7Y6dkxpBDqnSWm64rLHC/87mBlWWhr8TB/+UenaRSnYo0aAyG5vVZU2H+s+oLi8 XXmrP1yGOEKZGae9k3ESBDpI4KMgrku170wMb0y808YWY8FFBEDeykQ2i40NW7u0vyhn MUpIc6sPJLpymPOIvFEE9vtAKcMf59HoXhtzh8X4gmP96iVRQYS2/Owqn+QzClVOyswz fq1n7wHWqumw5fu8WJ5oNtTnQpZ+LpcKKgJZfR6SzADOdmyXShsZGHrsANDvBmTFwdnM G6MGzrEScQLH1HqMZ0FWhlICbbKT7ulqfouf+e7xBi8PtRjQXvjbDpvFO7/XriHZxtAm HPMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111178; x=1734715978; 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=SebYeO56jOAlUYYHC79zwogvEFSt4JEj+habP31pt+w=; b=Jge8qE2x8UP66JjZ21eKz91+iWcN+sJ5yhVqZeGBVvfpBOn972nZBF/QaF9MfGqyXf 421NlWLl2EgvmmONXfWikbagTw9TGNLtOAVlx/yVh6z5c6yVwwB1J1rdqQDeF0nJ7wIA tFBUO6tgWSCvmy7eilpXQGMdCUQ5f9FYkB50VbXHZAnQ7omHeIiG51sooGUgIEv5sqtJ LCmEtTycpSI7A4nL2TcD1PGD8ayz6nmbezXOYr8LkZIUkcaX2IbUja5cS8GFSIH7tPBF xms5meRCxpRJkVJg2b5FHbw6yHekzZ044V11wsNZ/1yEot+m4gK4AFk7bD1UyqpN1lCl Y5Fw== X-Gm-Message-State: AOJu0Yy+t4UAr6NCFHdjqkfknpfBq9gsrta03j+BbNrsqDndNR6tFmP2 +UrPGXhRXR9oFogWpqF3D9xO4aSO903kzNXo0Wv19ngW+tFARTMdlTjBqzjPAipr+lTnDbOzSHf k X-Gm-Gg: ASbGncuVm5sCy1Uukt2sPFfivVO/uuZj4ys9giK12DtL5/YKYQPQvBi+jjrD1t4dwr4 fLh1bxQ6knHiFongJQCsu4mE/SajGnk+RyqkfYWhb5ZYZRFfaCDPFR5I0D9Eas2ie1WNNfTXGYG Jy9wmVgxb5X2bnmv89m3ohvSrtp7J7plBH7U8ROcHfi37Rbmd28N//wEnzPbl7Wy0FAlpSMhBUR jxtJ4z/UwLBuhMu1tZMcq/SdFwLkFa8v35kgzktuTEcN5FdpB2z5Dp8lWINpQ== X-Received: by 2002:a05:600c:4e10:b0:431:54d9:da57 with SMTP id 5b1f17b1804b1-4362aaa92ffmr32847205e9.30.1734111177963; Fri, 13 Dec 2024 09:32:57 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.32.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:32:57 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 25/85] target/arm: Pass fpstatus to vfp_sqrt* Date: Fri, 13 Dec 2024 17:31:29 +0000 Message-Id: <20241213173229.3308926-26-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x333.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: Richard Henderson Pass fpstatus not env, like most other fp helpers. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-26-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/helper.h | 6 +++--- target/arm/tcg/translate-a64.c | 15 +++++++-------- target/arm/tcg/translate-vfp.c | 6 +++--- target/arm/vfp_helper.c | 12 ++++++------ 4 files changed, 19 insertions(+), 20 deletions(-) diff --git a/target/arm/helper.h b/target/arm/helper.h index 58919b670ef..0a697e752bc 100644 --- a/target/arm/helper.h +++ b/target/arm/helper.h @@ -133,9 +133,9 @@ DEF_HELPER_3(vfp_maxnumd, f64, f64, f64, ptr) DEF_HELPER_3(vfp_minnumh, f16, f16, f16, ptr) DEF_HELPER_3(vfp_minnums, f32, f32, f32, ptr) DEF_HELPER_3(vfp_minnumd, f64, f64, f64, ptr) -DEF_HELPER_2(vfp_sqrth, f16, f16, env) -DEF_HELPER_2(vfp_sqrts, f32, f32, env) -DEF_HELPER_2(vfp_sqrtd, f64, f64, env) +DEF_HELPER_2(vfp_sqrth, f16, f16, ptr) +DEF_HELPER_2(vfp_sqrts, f32, f32, ptr) +DEF_HELPER_2(vfp_sqrtd, f64, f64, ptr) DEF_HELPER_3(vfp_cmph, void, f16, f16, env) DEF_HELPER_3(vfp_cmps, void, f32, f32, env) DEF_HELPER_3(vfp_cmpd, void, f64, f64, env) diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index ca2b95510e2..cfc73b8506d 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -8401,8 +8401,8 @@ static void handle_fp_1src_single(DisasContext *s, int opcode, int rd, int rn) switch (opcode) { case 0x3: /* FSQRT */ - gen_helper_vfp_sqrts(tcg_res, tcg_op, tcg_env); - goto done; + gen_fpst = gen_helper_vfp_sqrts; + break; case 0x6: /* BFCVT */ gen_fpst = gen_helper_bfcvt; break; @@ -8450,7 +8450,6 @@ static void handle_fp_1src_single(DisasContext *s, int opcode, int rd, int rn) gen_fpst(tcg_res, tcg_op, fpst); } - done: write_fp_sreg(s, rd, tcg_res); } @@ -8467,8 +8466,8 @@ static void handle_fp_1src_double(DisasContext *s, int opcode, int rd, int rn) switch (opcode) { case 0x3: /* FSQRT */ - gen_helper_vfp_sqrtd(tcg_res, tcg_op, tcg_env); - goto done; + gen_fpst = gen_helper_vfp_sqrtd; + break; case 0x8: /* FRINTN */ case 0x9: /* FRINTP */ case 0xa: /* FRINTM */ @@ -8513,7 +8512,6 @@ static void handle_fp_1src_double(DisasContext *s, int opcode, int rd, int rn) gen_fpst(tcg_res, tcg_op, fpst); } - done: write_fp_dreg(s, rd, tcg_res); } @@ -9459,7 +9457,7 @@ static void handle_2misc_64(DisasContext *s, int opcode, bool u, gen_vfp_negd(tcg_rd, tcg_rn); break; case 0x7f: /* FSQRT */ - gen_helper_vfp_sqrtd(tcg_rd, tcg_rn, tcg_env); + gen_helper_vfp_sqrtd(tcg_rd, tcg_rn, tcg_fpstatus); break; case 0x1a: /* FCVTNS */ case 0x1b: /* FCVTMS */ @@ -10402,6 +10400,7 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) handle_2misc_fcmp_zero(s, opcode, false, u, is_q, size, rn, rd); return; case 0x7f: /* FSQRT */ + need_fpstatus = true; if (size == 3 && !is_q) { unallocated_encoding(s); return; @@ -10631,7 +10630,7 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) gen_vfp_negs(tcg_res, tcg_op); break; case 0x7f: /* FSQRT */ - gen_helper_vfp_sqrts(tcg_res, tcg_op, tcg_env); + gen_helper_vfp_sqrts(tcg_res, tcg_op, tcg_fpstatus); break; case 0x1a: /* FCVTNS */ case 0x1b: /* FCVTMS */ diff --git a/target/arm/tcg/translate-vfp.c b/target/arm/tcg/translate-vfp.c index b6fa28a7bf6..c160a86e703 100644 --- a/target/arm/tcg/translate-vfp.c +++ b/target/arm/tcg/translate-vfp.c @@ -2424,17 +2424,17 @@ DO_VFP_2OP(VNEG, dp, gen_vfp_negd, aa32_fpdp_v2) static void gen_VSQRT_hp(TCGv_i32 vd, TCGv_i32 vm) { - gen_helper_vfp_sqrth(vd, vm, tcg_env); + gen_helper_vfp_sqrth(vd, vm, fpstatus_ptr(FPST_FPCR_F16)); } static void gen_VSQRT_sp(TCGv_i32 vd, TCGv_i32 vm) { - gen_helper_vfp_sqrts(vd, vm, tcg_env); + gen_helper_vfp_sqrts(vd, vm, fpstatus_ptr(FPST_FPCR)); } static void gen_VSQRT_dp(TCGv_i64 vd, TCGv_i64 vm) { - gen_helper_vfp_sqrtd(vd, vm, tcg_env); + gen_helper_vfp_sqrtd(vd, vm, fpstatus_ptr(FPST_FPCR)); } DO_VFP_2OP(VSQRT, hp, gen_VSQRT_hp, aa32_fp16_arith) diff --git a/target/arm/vfp_helper.c b/target/arm/vfp_helper.c index 62638d2b1f9..f24992c798a 100644 --- a/target/arm/vfp_helper.c +++ b/target/arm/vfp_helper.c @@ -314,19 +314,19 @@ VFP_BINOP(minnum) VFP_BINOP(maxnum) #undef VFP_BINOP -dh_ctype_f16 VFP_HELPER(sqrt, h)(dh_ctype_f16 a, CPUARMState *env) +dh_ctype_f16 VFP_HELPER(sqrt, h)(dh_ctype_f16 a, void *fpstp) { - return float16_sqrt(a, &env->vfp.fp_status_f16); + return float16_sqrt(a, fpstp); } -float32 VFP_HELPER(sqrt, s)(float32 a, CPUARMState *env) +float32 VFP_HELPER(sqrt, s)(float32 a, void *fpstp) { - return float32_sqrt(a, &env->vfp.fp_status); + return float32_sqrt(a, fpstp); } -float64 VFP_HELPER(sqrt, d)(float64 a, CPUARMState *env) +float64 VFP_HELPER(sqrt, d)(float64 a, void *fpstp) { - return float64_sqrt(a, &env->vfp.fp_status); + return float64_sqrt(a, fpstp); } static void softfloat_to_vfp_compare(CPUARMState *env, FloatRelation cmp) From patchwork Fri Dec 13 17:31:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850138 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1638005wry; Fri, 13 Dec 2024 09:34:02 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWR4VnmUE9YUF0GRm3eA56UCYCbxtE08L0fm/X8gK9LN1CZbQyOb68JLa/D0TWy6PKCr6w03A==@linaro.org X-Google-Smtp-Source: AGHT+IHHxwHdnGYvDHff3oJlyKAcd45SFIcnrUD/BLF//cIH9mmQCUhu+kBJ5emOE+6RFosTMTZ+ X-Received: by 2002:a05:622a:481b:b0:467:5e1c:1ab6 with SMTP id d75a77b69052e-467a578f2admr67426641cf.24.1734111242461; Fri, 13 Dec 2024 09:34:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111242; cv=none; d=google.com; s=arc-20240605; b=jSklzxdXK2D5gL4NN6xtxDv4qoD+yf5iqdcwdTJm7dWc2KCMXd2cet4X/F3m+znO5p xfo4CNFWSDNo1H4EtbrpG9/xd334d3S0HQ9JYLh2kOV9kyqKEu1CmY3mZOaH5DBtB+MO v3Q1H8IcH2fa3yc7cSwdbwfR2asiCw6UZ+VQ6yzOf3ohjw8i2miMcEryEy0aNdqf/2c1 zrYbhGkQWX4GYS86Rn9SSud6OpSzE6mREkv+RwVeOBLyjwN1+9+WB+0mThbPOPGdcYsd hulTXDvZR3BYHllcIYtjwSscPSOC5aFiryKxkRhthxPwZw0Cvub9iA2RWYMVQonCW62c HkHg== 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=Ua6+mxEWQ1r/2XhLkCgBi1H+Sl0jSzIsEgqRdsyvm3M=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=kKoY3B2sejX9gE0gzPdIu5/+z4NkS+o1+YWb4NyTTa4ouod58EhFB6NEr7vR9QmHfn Lcq0x+u7Q0UYVT37GWEq2hoG/PPlz6nTY/vQ/vZtFeXL+V8za5ExmbnaVdtGWwpfUmJb qwcouuqNe4E+u8Vopqc/ntw9Xffj8V57ZH+e9TY7vy/HLpknd9MQ8BLxD0rtW3WwcA47 F5FSX8C5iKeTCbxM4LC/lvay1bRaZ47qZbC2u7IXW7WF4/y4wQnTTSbuyMI3LMyGwUac +6SEbu917bGYNcsSR8zWcifUfyU6qU25yEKdoi7cEQ1hYYCAMI0NP3V6CM44nNLzeZrv a3Tg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=P9RuLjWs; 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-46796d2cf3fsi61982291cf.131.2024.12.13.09.34.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09: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=P9RuLjWs; 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 1tM9Xh-0007ir-4D; Fri, 13 Dec 2024 12:33:33 -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 1tM9XD-00074t-Fr for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:04 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9XA-0001XT-HE for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:03 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-4361c705434so14792435e9.3 for ; Fri, 13 Dec 2024 09:32:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111179; x=1734715979; 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=Ua6+mxEWQ1r/2XhLkCgBi1H+Sl0jSzIsEgqRdsyvm3M=; b=P9RuLjWs85451jV7rrCyban757iRrOxXqwp+l5/Jtc8ENjD8vad9GFz1m3Ki6F+SaR mBsQaU++yOIkDAogE02dc6jK5LsNwHlWR05FiQ15icl76Uaj7yPBKFmb/TfeufJ6G0YS JAGaBzU1V+dYMiMty3AOmbV1ZJdnFiQN3JrYGKG3XAEbiroi+z4VCFEqFTMVn8mTeI74 DifDPgY7LCQhN8t5j1PftaBNMbd+YoKBZbjKh7pd9XHU5BvrHEUq7WeLvSguVWURcnX7 w2Y0kBkvAquJ+BnScrohqXfguPnC5QTTLwTj8OQyszaOMAKRtJ4nTELQ90c52f4wEhDl EraA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111179; x=1734715979; 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=Ua6+mxEWQ1r/2XhLkCgBi1H+Sl0jSzIsEgqRdsyvm3M=; b=r/VwsnXKFQvtdUxNsjiYKquXP95+Dcgcw3EryqoWQjsBu2NX+x1xdYty08QNlTo1xb 1AxwkM+RedlMojr3AyJgb5b2ucb4TQYlwufEHiL7FTtXoiJ18FDt0dRWUnUYkwt8v7dB WKlgUfGbpEW2moUHVgQCla/tXXGanlc8zL9SZWzR0e2FSWfzjwgayjSYViElLngHSc2u oXebKoaklNYTiaM5S+mcmOmDUVtM2u/i9PTKj7iTdgISQFiRfpiq8ybcNTs+yf/9ioCQ RIBaVEIiBfKKWdit+CLwJZj+rmw3gJgPxysjRONuM+uuyUTF5ahXv9+OpWWYY7msCd9q IJqQ== X-Gm-Message-State: AOJu0YwQFFTBVY8phCJI5bonnz0WfaCDdlaMoeeE/KuspJLsgAA2uYuY tQD62qybFwbhzRSzr7xHf5UvAAiftuJpgJqN8kNcXBZgEmjgbLeW6BOO6m/DFt9WJMYv+0+j164 W X-Gm-Gg: ASbGncuOUEvzQ3SrPmp+EAV9oHI1iymy0+Zh3syXq/TSiQ+OWka11+Se8snext9Howt IRa0FS2SlmS//uyLskhPlzAtArECqhMWkuz4iFw9ZZpmtXar1dyXaPN9Zxp1aaGKT9GfptyYkRZ cu0j55pcuxp05bOHAmerOlkuDw1wWodlg4kQVm5LsZRXROeVN/n7jyz3aBoL5ShCra/iyzRTYAz 7J97ljmt5ZOVSM9EbHzCxnqLvXNT0mi6gu+aUj1HllIuEgetEhDjbELJUGMaA== X-Received: by 2002:a5d:5f43:0:b0:385:f5b6:9c9d with SMTP id ffacd0b85a97d-38880ae0fc4mr2558873f8f.33.1734111178884; Fri, 13 Dec 2024 09:32:58 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.32.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:32:58 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 26/85] target/arm: Remove helper_sqrt_f16 Date: Fri, 13 Dec 2024 17:31:30 +0000 Message-Id: <20241213173229.3308926-27-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x335.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: Richard Henderson This function is identical with helper_vfp_sqrth. Replace all uses. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-27-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/helper-a64.h | 1 - target/arm/tcg/helper-a64.c | 11 ----------- target/arm/tcg/translate-a64.c | 4 ++-- 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/target/arm/tcg/helper-a64.h b/target/arm/tcg/helper-a64.h index 481007bf397..203b7b7ac82 100644 --- a/target/arm/tcg/helper-a64.h +++ b/target/arm/tcg/helper-a64.h @@ -80,7 +80,6 @@ DEF_HELPER_2(advsimd_rinth_exact, f16, f16, ptr) DEF_HELPER_2(advsimd_rinth, f16, f16, ptr) DEF_HELPER_2(advsimd_f16tosinth, i32, f16, ptr) DEF_HELPER_2(advsimd_f16touinth, i32, f16, ptr) -DEF_HELPER_2(sqrt_f16, f16, f16, ptr) DEF_HELPER_2(exception_return, void, env, i64) DEF_HELPER_FLAGS_2(dc_zva, TCG_CALL_NO_WG, void, env, i64) diff --git a/target/arm/tcg/helper-a64.c b/target/arm/tcg/helper-a64.c index 8f42a28d07b..3f4d7b9aba6 100644 --- a/target/arm/tcg/helper-a64.c +++ b/target/arm/tcg/helper-a64.c @@ -915,17 +915,6 @@ illegal_return: "resuming execution at 0x%" PRIx64 "\n", cur_el, env->pc); } -/* - * Square Root and Reciprocal square root - */ - -uint32_t HELPER(sqrt_f16)(uint32_t a, void *fpstp) -{ - float_status *s = fpstp; - - return float16_sqrt(a, s); -} - void HELPER(dc_zva)(CPUARMState *env, uint64_t vaddr_in) { uintptr_t ra = GETPC(); diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index cfc73b8506d..2a5cb704752 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -8354,7 +8354,7 @@ static void handle_fp_1src_half(DisasContext *s, int opcode, int rd, int rn) switch (opcode) { case 0x3: /* FSQRT */ fpst = fpstatus_ptr(FPST_FPCR_F16); - gen_helper_sqrt_f16(tcg_res, tcg_op, fpst); + gen_helper_vfp_sqrth(tcg_res, tcg_op, fpst); break; case 0x8: /* FRINTN */ case 0x9: /* FRINTP */ @@ -10978,7 +10978,7 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn) gen_helper_rsqrte_f16(tcg_res, tcg_op, tcg_fpstatus); break; case 0x7f: /* FSQRT */ - gen_helper_sqrt_f16(tcg_res, tcg_op, tcg_fpstatus); + gen_helper_vfp_sqrth(tcg_res, tcg_op, tcg_fpstatus); break; default: g_assert_not_reached(); From patchwork Fri Dec 13 17:31:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850214 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1643786wry; Fri, 13 Dec 2024 09:46:29 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVjHwtJNPAWIQxwCSHqxSh43fExx9MkgXML156PQKL5BqxH59Dkdwrf3Z3TR3aclxWXd2oKHA==@linaro.org X-Google-Smtp-Source: AGHT+IGEvxSUgpy6sk1lay9TbMxPdLs6lTScb0wgVLaa9+o3pF31dKrHyjevh8YfnbwpHgmh+gZO X-Received: by 2002:a17:907:2da4:b0:aa6:23ba:d8c8 with SMTP id a640c23a62f3a-aab778c1e88mr415315566b.11.1734111989196; Fri, 13 Dec 2024 09:46:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111989; cv=none; d=google.com; s=arc-20240605; b=T3UYDzhjOwCNWPHzPxW6os4mcVtTko5uUOno+BEDw5EdksKkuXrN4fYVySHFLrz8nB WSoKXb9Ys+8LMnpLFLx0Ct+9YjQgiNBrhryNr9q+IvgYfEq7n9C+IGKV+MB2SDf+yRQ5 PgKt3hi0OgU1eNyQ8sZ5aA+I++34At5LBm6tbnpb9E1lt/eOrhbPmriAFfwkfwM+DSAW b60YQSzS6j/JFqWdEweVW1QGY+LlHomZWyAQAQpzYzysPrZpewc2fqdKeBEFGtOlvCt+ ybt5X7zZrPSgUjFTFi2x+Lvmh1cfdbGvO2klJcgkz/WhlpcF6+7mCOD+kQzIJI0D8oEZ wbTQ== 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=J70fG9zjVQ0I6Fr//x/raIzh21DkB5SQh0C3nL/+Ijk=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=VWeN1TOoKgNyEhmLbEru8G1CwNPRf3T6S+cWm7BeUw1XQ9PJQAugS3ih99yDpz1mrF xgkZistGVBXDbuXAE9NbtnWHGPWhMvKsyuUx0NzlN1R6dspBNiq5KBwzbuHQc6WybO03 5WodY1z89H/FCw3B+xfLed9fc6oeZ1LghUntE2aPN2OzkbANZkHvAYp6qPbgj68Ysu8i tNIa9hNVgTi/+USu34Ap7xBlAIJPMiDtgdBht30IqBUt/o50Y6JZcdry3Rve5c9H1w11 2Ef/RCUyXY9nvvjvT2xbjOJKbu3uOSp2X0Etk4ln38GzkczAcuLyVVqwXLJ5r1/LchQO zGRg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gP3f67xj; 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 a640c23a62f3a-aa67049d3dfsi919188266b.507.2024.12.13.09.46.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:46: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=gP3f67xj; 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 1tM9XZ-0007O3-Qy; Fri, 13 Dec 2024 12:33:25 -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 1tM9XD-00074w-OH for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:04 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9XB-0001Xt-LH for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:03 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-4361815b96cso13698935e9.1 for ; Fri, 13 Dec 2024 09:33:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111180; x=1734715980; 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=J70fG9zjVQ0I6Fr//x/raIzh21DkB5SQh0C3nL/+Ijk=; b=gP3f67xjEBm62xBAvCAlx/HYo/UMAMv2zvp70YeAs5IXd7LAoMmzZpAKUNkjrxmmB5 5LMp20AjBi9oVd9AkpIDaVuJUsJkZowg9DsYI2kPX9CKocYjIMRK84UkZ7HbCD3KDltz m9LkIV8Kt/33YTn7Q2O1hOcWP5QKrSSxl/rS8cd631QreuWU+gvPD3/q8wvgdrvH+3Le uwgjUAM660HpauJh06VXlpA07OdrYVNzil1iGQ+P5qFYbreJ6sunB7r0FRvgBRq6vl0v qzPjMRNF9V6FTmXnMIfEco1RxXzYn+TdncfTXa4GiECXVRzOkGbvVBAy+IpAYWmy4nB3 b5gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111180; x=1734715980; 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=J70fG9zjVQ0I6Fr//x/raIzh21DkB5SQh0C3nL/+Ijk=; b=NFCtCVVKDUUrvgu4KsHtcLlALXJWDCsWBRnzH0FVg9EXFTvH3Z9BS0SsB5UpBFIeLq j1iS9dNsZn1FV3d0BG2RRK+yPIm3CQUoCWb5XWOM0Kmi72jSjDYM+3bpURIPv0UWm6oA EBAQy52qli6zDn0y4rEGggcL0mus32S8t2oQ9lhWdLv57z5uhjnCpjERMmL0JbR7Svig nSMwhsw9zRhdXclDtSPm2IdfKyS+ZbwMWaSE+LQRA8vYk7mprhTWX3nB8tq9yt7WIwCx 6+VowKN9vyd7/4roaNHQBCTxQjPdryfeU8qmhoWh9hWZnvvuw/GE4PtZMnWgqvesN8Hg dorA== X-Gm-Message-State: AOJu0YxUlLUouQi32jumyvx6dVFUG8TYFVG0l+JvsyeK/s04Wjp9tQCM N2BOMRtYPfY/2YmxqqmF5GCk9QYdc4Q4hYcoba2d/I37bHj3qD+rugbESyH2NV2IdASKlh0D1YJ r X-Gm-Gg: ASbGncusPa0pSncrDKeLA+Qeyf2S5W9itFhScokqjt/FIB4JBDLlkmaxXU46cp3Qutk EqhVHM9DbXjikxmTg3CBUaEHn+U0adHJO6tPzG23YdQ7NksCz6PL8DRbXCmG4yB3IS0XFXbCFBs wLQCXyZ/+s/UOe4H90QpLaxyDrFMZKZiMivF+AOm2sCc0AxH6pV8+ZIBgMAJYwSJtabgtKU7Fu7 1R13XOsAuflVK4ocXT/Do7ECsHTJsp67tDebmmQPFyFSuDUJk30eoUgjXL6ew== X-Received: by 2002:a05:600c:1906:b0:434:f2f4:4c07 with SMTP id 5b1f17b1804b1-4362aa3e03dmr30737505e9.15.1734111179932; Fri, 13 Dec 2024 09:32:59 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.32.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:32:59 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 27/85] target/arm: Convert FSQRT (scalar) to decodetree Date: Fri, 13 Dec 2024 17:31:31 +0000 Message-Id: <20241213173229.3308926-28-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x335.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: Richard Henderson Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-28-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 1 + target/arm/tcg/translate-a64.c | 72 ++++++++++++++++++++++++++++------ 2 files changed, 62 insertions(+), 11 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index b9cc8963da8..3b1e8e07760 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -1327,6 +1327,7 @@ FMINV_s 0110 1110 10 11000 01111 10 ..... ..... @rr_q1e2 FMOV_s 00011110 .. 1 000000 10000 ..... ..... @rr_hsd FABS_s 00011110 .. 1 000001 10000 ..... ..... @rr_hsd FNEG_s 00011110 .. 1 000010 10000 ..... ..... @rr_hsd +FSQRT_s 00011110 .. 1 000011 10000 ..... ..... @rr_hsd # Floating-point Immediate diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 2a5cb704752..f3989246f9c 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -8344,6 +8344,63 @@ static const FPScalar1Int f_scalar_fneg = { }; TRANS(FNEG_s, do_fp1_scalar_int, a, &f_scalar_fneg) +typedef struct FPScalar1 { + void (*gen_h)(TCGv_i32, TCGv_i32, TCGv_ptr); + void (*gen_s)(TCGv_i32, TCGv_i32, TCGv_ptr); + void (*gen_d)(TCGv_i64, TCGv_i64, TCGv_ptr); +} FPScalar1; + +static bool do_fp1_scalar(DisasContext *s, arg_rr_e *a, + const FPScalar1 *f, int rmode) +{ + TCGv_i32 tcg_rmode = NULL; + TCGv_ptr fpst; + TCGv_i64 t64; + TCGv_i32 t32; + int check = fp_access_check_scalar_hsd(s, a->esz); + + if (check <= 0) { + return check == 0; + } + + fpst = fpstatus_ptr(a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); + if (rmode >= 0) { + tcg_rmode = gen_set_rmode(rmode, fpst); + } + + switch (a->esz) { + case MO_64: + t64 = read_fp_dreg(s, a->rn); + f->gen_d(t64, t64, fpst); + write_fp_dreg(s, a->rd, t64); + break; + case MO_32: + t32 = read_fp_sreg(s, a->rn); + f->gen_s(t32, t32, fpst); + write_fp_sreg(s, a->rd, t32); + break; + case MO_16: + t32 = read_fp_hreg(s, a->rn); + f->gen_h(t32, t32, fpst); + write_fp_sreg(s, a->rd, t32); + break; + default: + g_assert_not_reached(); + } + + if (rmode >= 0) { + gen_restore_rmode(tcg_rmode, fpst); + } + return true; +} + +static const FPScalar1 f_scalar_fsqrt = { + gen_helper_vfp_sqrth, + gen_helper_vfp_sqrts, + gen_helper_vfp_sqrtd, +}; +TRANS(FSQRT_s, do_fp1_scalar, a, &f_scalar_fsqrt, -1) + /* Floating-point data-processing (1 source) - half precision */ static void handle_fp_1src_half(DisasContext *s, int opcode, int rd, int rn) { @@ -8352,10 +8409,6 @@ static void handle_fp_1src_half(DisasContext *s, int opcode, int rd, int rn) TCGv_i32 tcg_res = tcg_temp_new_i32(); switch (opcode) { - case 0x3: /* FSQRT */ - fpst = fpstatus_ptr(FPST_FPCR_F16); - gen_helper_vfp_sqrth(tcg_res, tcg_op, fpst); - break; case 0x8: /* FRINTN */ case 0x9: /* FRINTP */ case 0xa: /* FRINTM */ @@ -8382,6 +8435,7 @@ static void handle_fp_1src_half(DisasContext *s, int opcode, int rd, int rn) case 0x0: /* FMOV */ case 0x1: /* FABS */ case 0x2: /* FNEG */ + case 0x3: /* FSQRT */ g_assert_not_reached(); } @@ -8400,9 +8454,6 @@ static void handle_fp_1src_single(DisasContext *s, int opcode, int rd, int rn) tcg_res = tcg_temp_new_i32(); switch (opcode) { - case 0x3: /* FSQRT */ - gen_fpst = gen_helper_vfp_sqrts; - break; case 0x6: /* BFCVT */ gen_fpst = gen_helper_bfcvt; break; @@ -8438,6 +8489,7 @@ static void handle_fp_1src_single(DisasContext *s, int opcode, int rd, int rn) case 0x0: /* FMOV */ case 0x1: /* FABS */ case 0x2: /* FNEG */ + case 0x3: /* FSQRT */ g_assert_not_reached(); } @@ -8465,9 +8517,6 @@ static void handle_fp_1src_double(DisasContext *s, int opcode, int rd, int rn) tcg_res = tcg_temp_new_i64(); switch (opcode) { - case 0x3: /* FSQRT */ - gen_fpst = gen_helper_vfp_sqrtd; - break; case 0x8: /* FRINTN */ case 0x9: /* FRINTP */ case 0xa: /* FRINTM */ @@ -8500,6 +8549,7 @@ static void handle_fp_1src_double(DisasContext *s, int opcode, int rd, int rn) case 0x0: /* FMOV */ case 0x1: /* FABS */ case 0x2: /* FNEG */ + case 0x3: /* FSQRT */ g_assert_not_reached(); } @@ -8619,7 +8669,6 @@ static void disas_fp_1src(DisasContext *s, uint32_t insn) goto do_unallocated; } /* fall through */ - case 0x3: case 0x8 ... 0xc: case 0xe ... 0xf: /* 32-to-32 and 64-to-64 ops */ @@ -8672,6 +8721,7 @@ static void disas_fp_1src(DisasContext *s, uint32_t insn) case 0x0: /* FMOV */ case 0x1: /* FABS */ case 0x2: /* FNEG */ + case 0x3: /* FSQRT */ unallocated_encoding(s); break; } From patchwork Fri Dec 13 17:31:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850186 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1641552wry; Fri, 13 Dec 2024 09:41:24 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXTjWkv8HChw5sOMhDDpJP6l9sX/VRmMIGmXVwLUtQ7k1V0DDinRKEqhptRV5c2jjHiwTj7lQ==@linaro.org X-Google-Smtp-Source: AGHT+IFUmoUPmxzkaKfutuWQvfEPRl/0D7tX3RJ43ZmztiA4r0fY5ovfhb3iTE2Cs1NhCvaCs+/K X-Received: by 2002:a05:6402:26c9:b0:5d0:c9e6:30b9 with SMTP id 4fb4d7f45d1cf-5d63c2f83e5mr3682825a12.3.1734111684785; Fri, 13 Dec 2024 09:41:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111684; cv=none; d=google.com; s=arc-20240605; b=IK9BwXfrDZkK1qV9m4c3mtnLjvJxw40iQ60S4AjVBEBPtlEx5RyxAqDatVFGJ8PfKt sOaGcmMd/emQ6NAONzC1hUCQh3Ba3XASPVm23+7U3VsHctPrRfLyyaqcFdhU4YT6z7G0 nvzuTmMs9SoycJgmP6f4VilGNcJE84/oyL4D+3kQei/akG0F2qGXTiSVwdeNLWpEFFIM gvYsslXl5BhJwq74+qfYqVm150TZKuBeGSF4ckv8RqiAu4WB9UMfkisYDDi2ITZKFX/l RxvwrnOAZHnIIFb7q6KW0NsD5q0ZvA88Bj2oOnr/3M9Lj9anep3F8zJJkk0gPpNRcN7i VbUQ== 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=D//O6XDkX742b9GaodjaS3JMRSMmgDBdq+AzZ965Trg=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=KZE9kWbwUJb4daXL911yx0UC2yALz0nXLK1qhO6LuD5gO6veF/zWUh7fGdFX0BYdDq pMUpbuDreKTuSqIJsod0h95FzH1WR6rUukDh2GO+emuU20SrZzpQRn6ISAIkudp04smQ bPH3Rtj0uCAFyBKMNwAR+cxA5zSzAT8Qv8Y4Qs0uiX8x/HmwJcy8bAWVB2I/XFgRIhvi wqZ7DhOv4FWO0CzKyYPFkB8q8yr+Uq94EmGGvIhPyEGyNLJq/Kb5Zf0nfvcUP4jk27Lq jS7pvZ1Spp6x/p3Q8uuxKb+KUFGrm1VH/0p5sLdxN6pjWghIyOW5EHZDetGsCnE9jv0Q wRKQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vx9cjzc3; 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 4fb4d7f45d1cf-5d652addadesi59456a12.74.2024.12.13.09.41.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:41:24 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vx9cjzc3; 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 1tM9YQ-00028n-6u; Fri, 13 Dec 2024 12:34: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 1tM9XH-00078k-H4 for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:08 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9XC-0001Y6-Mo for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:07 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-4362bae4d7dso6413825e9.1 for ; Fri, 13 Dec 2024 09:33:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111181; x=1734715981; 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=D//O6XDkX742b9GaodjaS3JMRSMmgDBdq+AzZ965Trg=; b=vx9cjzc3URtWNSy24vikh6vvc1giMAVdZaao3eXUJ4WIRDYeOE4qu4TW+Pq5blZL0I pSXaX9fdPe8N8TnJeXA4XtsKeD7O0tW4AFg3m7Xq4V+mkG5hHopmGjpsAZ9F1oSsmNMn 3ZlkaCrU3Fx5IkMBEpcjmTjdTPxJIgMtXG/82PYfNgH4F91VfkTMkkKpOrU9PznVgMo1 txw/2pabc71JnjVBCgJ3lty7WOB/12GioCuKO1Lsc1deAnZPX1gWYVX+BlEW3jN3+QQC jqfhZo2Wv0cT/Ej6hFn9EEMtFAsmRPTpXbVjfJLtXhp7N5YQUae/s8VgGBnEgmIUC5gd I2fQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111181; x=1734715981; 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=D//O6XDkX742b9GaodjaS3JMRSMmgDBdq+AzZ965Trg=; b=AympbkLWxnLNN8EASEuHv2LEIRxjKxFkclXd48ttqADNlMNgDXCb7BV/LsQvRWeHii WrLkvyqM/6nkUAaiZ7I8DZAFBwIQNTq/p/SZayD24TshZY1kNZbZtZ+I4rvvGanCKapm eOBSKeEVzXAWj8yRyD04b8G22lynpsLFQoagK9k4ePNnT1Ro+1eRmz4CcwFMm+5AgbhI eLeU+w4cWaOFV/638DVcI+OcuWGtnSgdZqqUzYilZ0ZF3BUppKYTinWgiWvvYAdfDBr5 54kN4OuTW2a/iSHI4yCGys8TDoaJ6C/SDMm+4AA3X6844L/xFY63/7wN8fb1PFKX4/Gn e8tg== X-Gm-Message-State: AOJu0YzZNhhM4nri8UgO4Luu1wy+ouVnMePQQUFAykAMdx9mI0hsNVK+ /4SSQAuM82Z07SXMQu6G6484FNss8XjFr7GTOTLXsbrUOfhWAREuhjAWwW68ag2cSWdybWZPMIt A X-Gm-Gg: ASbGnct9j7ELbxcX6gOv5V4Hk2a6PxZS7Nqxya5eOEytu384MVN6poUmJ1bkLmPqABW 7dqeG3KHBjHWiic7dBqiluMjxwoIaIbciLtQtJOVDKAVLO8ftC4VEMastCDxGcIlBUUumGzMZfR 3TXe3Fa06Qu7tDtgroxtL70hD2WF2OpWCXvkYv3z/PinEWYsjR5/RDEqnTyur0fPz5fYzqFUnr0 JpMQinTEB4B8gj5RlCKPJU9Hzb4Z0fTsNQgnal5Dtqs+q6kuNRUzQIOY9fCrQ== X-Received: by 2002:a05:600c:1906:b0:434:eb86:aeca with SMTP id 5b1f17b1804b1-4362aa42b9bmr41144875e9.10.1734111181005; Fri, 13 Dec 2024 09:33:01 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:00 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 28/85] target/arm: Convert FRINT[NPMSAXI] (scalar) to decodetree Date: Fri, 13 Dec 2024 17:31:32 +0000 Message-Id: <20241213173229.3308926-29-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x332.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: Richard Henderson Remove handle_fp_1src_half as these were the last insns decoded by that function. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-29-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 8 +++ target/arm/tcg/translate-a64.c | 117 +++++++++++---------------------- 2 files changed, 46 insertions(+), 79 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 3b1e8e07760..9d2f099c9ca 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -1329,6 +1329,14 @@ FABS_s 00011110 .. 1 000001 10000 ..... ..... @rr_hsd FNEG_s 00011110 .. 1 000010 10000 ..... ..... @rr_hsd FSQRT_s 00011110 .. 1 000011 10000 ..... ..... @rr_hsd +FRINTN_s 00011110 .. 1 001000 10000 ..... ..... @rr_hsd +FRINTP_s 00011110 .. 1 001001 10000 ..... ..... @rr_hsd +FRINTM_s 00011110 .. 1 001010 10000 ..... ..... @rr_hsd +FRINTZ_s 00011110 .. 1 001011 10000 ..... ..... @rr_hsd +FRINTA_s 00011110 .. 1 001100 10000 ..... ..... @rr_hsd +FRINTX_s 00011110 .. 1 001110 10000 ..... ..... @rr_hsd +FRINTI_s 00011110 .. 1 001111 10000 ..... ..... @rr_hsd + # Floating-point Immediate FMOVI_s 0001 1110 .. 1 imm:8 100 00000 rd:5 esz=%esz_hsd diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index f3989246f9c..5a347bece37 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -8401,46 +8401,24 @@ static const FPScalar1 f_scalar_fsqrt = { }; TRANS(FSQRT_s, do_fp1_scalar, a, &f_scalar_fsqrt, -1) -/* Floating-point data-processing (1 source) - half precision */ -static void handle_fp_1src_half(DisasContext *s, int opcode, int rd, int rn) -{ - TCGv_ptr fpst = NULL; - TCGv_i32 tcg_op = read_fp_hreg(s, rn); - TCGv_i32 tcg_res = tcg_temp_new_i32(); +static const FPScalar1 f_scalar_frint = { + gen_helper_advsimd_rinth, + gen_helper_rints, + gen_helper_rintd, +}; +TRANS(FRINTN_s, do_fp1_scalar, a, &f_scalar_frint, FPROUNDING_TIEEVEN) +TRANS(FRINTP_s, do_fp1_scalar, a, &f_scalar_frint, FPROUNDING_POSINF) +TRANS(FRINTM_s, do_fp1_scalar, a, &f_scalar_frint, FPROUNDING_NEGINF) +TRANS(FRINTZ_s, do_fp1_scalar, a, &f_scalar_frint, FPROUNDING_ZERO) +TRANS(FRINTA_s, do_fp1_scalar, a, &f_scalar_frint, FPROUNDING_TIEAWAY) +TRANS(FRINTI_s, do_fp1_scalar, a, &f_scalar_frint, -1) - switch (opcode) { - case 0x8: /* FRINTN */ - case 0x9: /* FRINTP */ - case 0xa: /* FRINTM */ - case 0xb: /* FRINTZ */ - case 0xc: /* FRINTA */ - { - TCGv_i32 tcg_rmode; - - fpst = fpstatus_ptr(FPST_FPCR_F16); - tcg_rmode = gen_set_rmode(opcode & 7, fpst); - gen_helper_advsimd_rinth(tcg_res, tcg_op, fpst); - gen_restore_rmode(tcg_rmode, fpst); - break; - } - case 0xe: /* FRINTX */ - fpst = fpstatus_ptr(FPST_FPCR_F16); - gen_helper_advsimd_rinth_exact(tcg_res, tcg_op, fpst); - break; - case 0xf: /* FRINTI */ - fpst = fpstatus_ptr(FPST_FPCR_F16); - gen_helper_advsimd_rinth(tcg_res, tcg_op, fpst); - break; - default: - case 0x0: /* FMOV */ - case 0x1: /* FABS */ - case 0x2: /* FNEG */ - case 0x3: /* FSQRT */ - g_assert_not_reached(); - } - - write_fp_sreg(s, rd, tcg_res); -} +static const FPScalar1 f_scalar_frintx = { + gen_helper_advsimd_rinth_exact, + gen_helper_rints_exact, + gen_helper_rintd_exact, +}; +TRANS(FRINTX_s, do_fp1_scalar, a, &f_scalar_frintx, -1) /* Floating-point data-processing (1 source) - single precision */ static void handle_fp_1src_single(DisasContext *s, int opcode, int rd, int rn) @@ -8457,20 +8435,6 @@ static void handle_fp_1src_single(DisasContext *s, int opcode, int rd, int rn) case 0x6: /* BFCVT */ gen_fpst = gen_helper_bfcvt; break; - case 0x8: /* FRINTN */ - case 0x9: /* FRINTP */ - case 0xa: /* FRINTM */ - case 0xb: /* FRINTZ */ - case 0xc: /* FRINTA */ - rmode = opcode & 7; - gen_fpst = gen_helper_rints; - break; - case 0xe: /* FRINTX */ - gen_fpst = gen_helper_rints_exact; - break; - case 0xf: /* FRINTI */ - gen_fpst = gen_helper_rints; - break; case 0x10: /* FRINT32Z */ rmode = FPROUNDING_ZERO; gen_fpst = gen_helper_frint32_s; @@ -8490,6 +8454,13 @@ static void handle_fp_1src_single(DisasContext *s, int opcode, int rd, int rn) case 0x1: /* FABS */ case 0x2: /* FNEG */ case 0x3: /* FSQRT */ + case 0x8: /* FRINTN */ + case 0x9: /* FRINTP */ + case 0xa: /* FRINTM */ + case 0xb: /* FRINTZ */ + case 0xc: /* FRINTA */ + case 0xe: /* FRINTX */ + case 0xf: /* FRINTI */ g_assert_not_reached(); } @@ -8517,20 +8488,6 @@ static void handle_fp_1src_double(DisasContext *s, int opcode, int rd, int rn) tcg_res = tcg_temp_new_i64(); switch (opcode) { - case 0x8: /* FRINTN */ - case 0x9: /* FRINTP */ - case 0xa: /* FRINTM */ - case 0xb: /* FRINTZ */ - case 0xc: /* FRINTA */ - rmode = opcode & 7; - gen_fpst = gen_helper_rintd; - break; - case 0xe: /* FRINTX */ - gen_fpst = gen_helper_rintd_exact; - break; - case 0xf: /* FRINTI */ - gen_fpst = gen_helper_rintd; - break; case 0x10: /* FRINT32Z */ rmode = FPROUNDING_ZERO; gen_fpst = gen_helper_frint32_d; @@ -8550,6 +8507,13 @@ static void handle_fp_1src_double(DisasContext *s, int opcode, int rd, int rn) case 0x1: /* FABS */ case 0x2: /* FNEG */ case 0x3: /* FSQRT */ + case 0x8: /* FRINTN */ + case 0x9: /* FRINTP */ + case 0xa: /* FRINTM */ + case 0xb: /* FRINTZ */ + case 0xc: /* FRINTA */ + case 0xe: /* FRINTX */ + case 0xf: /* FRINTI */ g_assert_not_reached(); } @@ -8668,9 +8632,6 @@ static void disas_fp_1src(DisasContext *s, uint32_t insn) if (type > 1 || !dc_isar_feature(aa64_frint, s)) { goto do_unallocated; } - /* fall through */ - case 0x8 ... 0xc: - case 0xe ... 0xf: /* 32-to-32 and 64-to-64 ops */ switch (type) { case 0: @@ -8686,15 +8647,6 @@ static void disas_fp_1src(DisasContext *s, uint32_t insn) handle_fp_1src_double(s, opcode, rd, rn); break; case 3: - if (!dc_isar_feature(aa64_fp16, s)) { - goto do_unallocated; - } - - if (!fp_access_check(s)) { - return; - } - handle_fp_1src_half(s, opcode, rd, rn); - break; default: goto do_unallocated; } @@ -8722,6 +8674,13 @@ static void disas_fp_1src(DisasContext *s, uint32_t insn) case 0x1: /* FABS */ case 0x2: /* FNEG */ case 0x3: /* FSQRT */ + case 0x8: /* FRINTN */ + case 0x9: /* FRINTP */ + case 0xa: /* FRINTM */ + case 0xb: /* FRINTZ */ + case 0xc: /* FRINTA */ + case 0xe: /* FRINTX */ + case 0xf: /* FRINTI */ unallocated_encoding(s); break; } From patchwork Fri Dec 13 17:31:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850147 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1638349wry; Fri, 13 Dec 2024 09:34:36 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXuZWx0gWUAL2GFwM2qrIqnVXUCLy9FWo4D9U5Ui4hay8RRJNmdp3RU/7TNvXpK7oXEhSe+Rw==@linaro.org X-Google-Smtp-Source: AGHT+IEfO0qdDmAVwR2PfICloo4Hu70rYZs1RYnhBmozJwjs3QCaIfAf2G5eLsEYCm+YcYLY5tu8 X-Received: by 2002:ac8:5e54:0:b0:467:8017:4e85 with SMTP id d75a77b69052e-467a5757b45mr60287241cf.19.1734111276109; Fri, 13 Dec 2024 09:34:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111276; cv=none; d=google.com; s=arc-20240605; b=IatQLJw25ARCpewi66TFzJWK3ZNXs/svVGk8iCRmcLFepVFNUoLND5Q0j7W5b/8gb3 LTEzg9E/KsW7z2GqsZ57qMBoyKEHZwI3AbFFv4YfOuckGkuMb8LRH8Oo2ovxH3A1fwKu sl970pBDANtReD06ZXtQ7KZICBAOxjwuoHiFdRceVK0BZUYTmyx2dDoiZtxoz7S5DN1J EleDinDkdFgQmWGAPfG3PwwNoXWOtGnrfz7GgRHspa2ZhXW6qOHI/J6fzEx2xHQtDjjg xapOL/AzCgzHoTuqAYohqsyFavHHXGaIvqMWIXaUKADps06pWc2wuy4Wn92k5HRhYaQN lMqw== 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=nOwJkFpCYPBbxu4BEzK9jmh/7u4NOfmJpDTTNygl1i4=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=eocUdecMi2fCF6FwKXCVmaQgbTkX4SLnKvCunjdkpc+PgRWG9kvwhVL8wNFZgEXTwB 7tJ8tXDjGvErNxAocwNp+FpqNSG4ko5qfGMfVihPqQJ42guBEI0zAM4ZtjrLNnVwzqhU JVAvso0VFBcHXIaKe7VxTLBXVxsqZCWspMByCxYz6xd3t6RnFxhcLatwTjw2XoSGfwx8 wqirbTFCOqVr+YAfq4i1al2sve7fdVvWg6prmxKNel4mELO7tKDFigUE+7DTB+2GVSTR fxBlgivMgW8huE4FLrIoy05qYuDTQoHq8ih3pzcWYI5gLf6WtW0CKJb5roh7vABeZ/t+ HQtQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yqDMf2qD; 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-46788bf728asi16915181cf.296.2024.12.13.09.34.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:34:36 -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=yqDMf2qD; 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 1tM9YM-0001kW-W7; Fri, 13 Dec 2024 12:34: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 1tM9XF-00076m-Q3 for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:06 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9XD-0001YO-NO for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:05 -0500 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-436281c8a38so11937655e9.3 for ; Fri, 13 Dec 2024 09:33:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111182; x=1734715982; 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=nOwJkFpCYPBbxu4BEzK9jmh/7u4NOfmJpDTTNygl1i4=; b=yqDMf2qDPMkjT957s6xoFBx8eVahZqrR16HN9hmmc8qLWeEqKY39xE/MvY0a5K811g JErMrC5LGeQGjR+T6rW/4YCuWkgR77YXQxk52s9iTq5CjwjlDSYnz/eH/Wbyl/Glt1Iq Fm8OELIxTQA+nYmFD8O76o8aZ1H9s+WrOkykrO2OFkfUG4o3SD0zOJBcBQeGpnwF2NOg SgCWkUIz5n3ZTPL+o8NNK84RoG95naiW1/of2xcIXv6pAFuD1AqXYo+wxgAVKUgEAj8l PC/Y0vD8w895oIHFc4NQsIsk1Zk4AkVfaEh46XYGEYoqtKMLy8G5bMLvBm4UO1aV6mdO LF4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111182; x=1734715982; 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=nOwJkFpCYPBbxu4BEzK9jmh/7u4NOfmJpDTTNygl1i4=; b=wy04FmuKCnYgooEDbSO8UwSQTqThb2d8Wkz6xk+b1tqOxf/j8DgTKC6OVEoTEMml1Q 8H/xpKaz5wLM+RXQ33mphPcdC+yU2uofjE/HLNmA92z8bUXipdv6s7SQ9f6otVmZEvG0 80kJNLYRxuIjdXM6Y5ZTJgITBll+MpJFf1Ub/nlKwUkeXQ309126KfBCchZsWZpJ8jYJ Oi0zTOIm7Km9sQjhlECpaYYPGshTuDA4qLYCD/KsNJRLQ6iqGY2TIZn6CuWLlrI+x8L8 JZMECKXmI/8urcZik2gl80oblUPmqT7jgEvSMkF6HyLQ1oDVwIhdY3m4KZiO7GpcNBgB KVVQ== X-Gm-Message-State: AOJu0Yx86phpSpUvG9SYM94XvUsD9oM42YwrSwX/3Itsh1lGD4WaSaxl rin/cKwg2bXOcr+wU18PAjc8c33m990/TIGgcMlNd6KwsoUy7Nq13qEfYz4W/vSXM8JuZcdVymp O X-Gm-Gg: ASbGncuE+Ox1mFZJv9xFfgysJ8Fb3EN1EzsLsm0XcYSlKTYT7xvGwQmaE9/Vynu9tws 6P52P4U3T6mx4vvKKkxvVsyvVCUoN9gVgJe6g2GOlWGfCE7PFeLVls6ZCLa29qPK0U38uKkJ3iR 2yX7I8usVEMF4PzuUUjobzEYuYZP3i606uBg3cP+PBU3k/Too4A/kCsaGlUSAIXhWFCeTC7Y8/8 e+jy9ytG4FPsRPQ+3DgutgxCDp5urNf/T1h4+NzUSUuKAjuEerdvhU+tjOtqw== X-Received: by 2002:a5d:598b:0:b0:382:5aae:87c7 with SMTP id ffacd0b85a97d-38880adaaadmr2289721f8f.31.1734111182184; Fri, 13 Dec 2024 09:33:02 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:01 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 29/85] target/arm: Convert BFCVT to decodetree Date: Fri, 13 Dec 2024 17:31:33 +0000 Message-Id: <20241213173229.3308926-30-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x329.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: Richard Henderson Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-30-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 3 +++ target/arm/tcg/translate-a64.c | 26 +++++++------------------- 2 files changed, 10 insertions(+), 19 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 9d2f099c9ca..4a48fcff1dc 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -45,6 +45,7 @@ &qrrrr_e q rd rn rm ra esz @rr_h ........ ... ..... ...... rn:5 rd:5 &rr_e esz=1 +@rr_s ........ ... ..... ...... rn:5 rd:5 &rr_e esz=2 @rr_d ........ ... ..... ...... rn:5 rd:5 &rr_e esz=3 @rr_sd ........ ... ..... ...... rn:5 rd:5 &rr_e esz=%esz_sd @rr_hsd ........ ... ..... ...... rn:5 rd:5 &rr_e esz=%esz_hsd @@ -1337,6 +1338,8 @@ FRINTA_s 00011110 .. 1 001100 10000 ..... ..... @rr_hsd FRINTX_s 00011110 .. 1 001110 10000 ..... ..... @rr_hsd FRINTI_s 00011110 .. 1 001111 10000 ..... ..... @rr_hsd +BFCVT_s 00011110 01 1 000110 10000 ..... ..... @rr_s + # Floating-point Immediate FMOVI_s 0001 1110 .. 1 imm:8 100 00000 rd:5 esz=%esz_hsd diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 5a347bece37..5b30b4cacac 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -8420,6 +8420,11 @@ static const FPScalar1 f_scalar_frintx = { }; TRANS(FRINTX_s, do_fp1_scalar, a, &f_scalar_frintx, -1) +static const FPScalar1 f_scalar_bfcvt = { + .gen_s = gen_helper_bfcvt, +}; +TRANS_FEAT(BFCVT_s, aa64_bf16, do_fp1_scalar, a, &f_scalar_bfcvt, -1) + /* Floating-point data-processing (1 source) - single precision */ static void handle_fp_1src_single(DisasContext *s, int opcode, int rd, int rn) { @@ -8432,9 +8437,6 @@ static void handle_fp_1src_single(DisasContext *s, int opcode, int rd, int rn) tcg_res = tcg_temp_new_i32(); switch (opcode) { - case 0x6: /* BFCVT */ - gen_fpst = gen_helper_bfcvt; - break; case 0x10: /* FRINT32Z */ rmode = FPROUNDING_ZERO; gen_fpst = gen_helper_frint32_s; @@ -8454,6 +8456,7 @@ static void handle_fp_1src_single(DisasContext *s, int opcode, int rd, int rn) case 0x1: /* FABS */ case 0x2: /* FNEG */ case 0x3: /* FSQRT */ + case 0x6: /* BFCVT */ case 0x8: /* FRINTN */ case 0x9: /* FRINTP */ case 0xa: /* FRINTM */ @@ -8652,28 +8655,13 @@ static void disas_fp_1src(DisasContext *s, uint32_t insn) } break; - case 0x6: - switch (type) { - case 1: /* BFCVT */ - if (!dc_isar_feature(aa64_bf16, s)) { - goto do_unallocated; - } - if (!fp_access_check(s)) { - return; - } - handle_fp_1src_single(s, opcode, rd, rn); - break; - default: - goto do_unallocated; - } - break; - default: do_unallocated: case 0x0: /* FMOV */ case 0x1: /* FABS */ case 0x2: /* FNEG */ case 0x3: /* FSQRT */ + case 0x6: /* BFCVT */ case 0x8: /* FRINTN */ case 0x9: /* FRINTP */ case 0xa: /* FRINTM */ From patchwork Fri Dec 13 17:31:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850209 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1643511wry; Fri, 13 Dec 2024 09:45:57 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWghK6LPQoP5nsURYbjznJMpQ+6dbHwtCrPOVeNblHeB/E7EpCdhMRedLbDviFe2MvktyJ6dA==@linaro.org X-Google-Smtp-Source: AGHT+IFIlVt5PDGogdfQlnJIEgFU2oGsT42WwMwB3XtpZl9nJHSdmAgBNBZXlTK0nUS0ERBJdceu X-Received: by 2002:a17:906:25c4:b0:aa6:5eae:7ece with SMTP id a640c23a62f3a-aab77e7ba08mr378555066b.43.1734111957292; Fri, 13 Dec 2024 09:45:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111957; cv=none; d=google.com; s=arc-20240605; b=Co8O9zhxzc1fbCHo5pxpxOby3c935YbOHWNuhp5QS5QqSdIuTIxDiDXcCGH/XIJK+5 l0T8RN+2zEeYdpTimx3L0mcUmVqNgrpdPHKtYJzZzxLnhyh4JrJlHyA4Ph54qaEyTpth dS6lSOuSV26jL+rtRE/lFS63aq4Zm090hY10yhzQ2U9Uhm4+MIWYC/b7IQK1jQF8U78U aCR35d7cnE2CC4XFsJMrSrt/EW/GXMmbRMg3cTEo5RbzC+ITc0QDL27jn5ncUy15l3bZ tNIZt0Ir7sv2eiBMUxP99ZAadvudyiRGGafGl24xjY5g6eV3UHFPz13oXpq8y7aC+ni7 Y9rQ== 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=pxqeEqK5xe+iFA9/sNUO2IfLug2C1fWvs977/dJQRE0=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=ZZqn4qaLE4f2L5VfLsmzFSB0xHlIaZP82ugN7eGBkUKqi3tusdP9K7Vf8Tr48DZsXg Jq/x3qjvpwjFZVOzZ59qoG3uL2xz1GlOa2x6khKC6ZM7COq0CN8aC8w1m4c+Wkn1l9wp rzKDV99XoBpMVaBguDxwrCRVaR3oMlRclIu43LHGJYBTAPq3yWwlYWqbWl5014AW0PM6 Drdji+Ze+dhcw0buseE8rYo9VH/737ZmNfA16eAs1heaozif2KDwWde6fAccgoNOmRZf YcLQaNBPknVtpx5TK0KtozgsFaJIrc6zKmFlGlWKeRFlc01pmOgoiEWrQuSLs47NdS0f yEKA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hjwXpILL; 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 a640c23a62f3a-aa6741628a9si881087966b.748.2024.12.13.09.45.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:45:57 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hjwXpILL; 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 1tM9Xf-0007ee-KG; Fri, 13 Dec 2024 12:33:31 -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 1tM9XI-00077q-1P for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:08 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9XE-0001Yu-Sz for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:06 -0500 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-3863494591bso1067813f8f.1 for ; Fri, 13 Dec 2024 09:33:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111183; x=1734715983; 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=pxqeEqK5xe+iFA9/sNUO2IfLug2C1fWvs977/dJQRE0=; b=hjwXpILLi2xaxZs88+6d2zPMej/dLjJoUudOhVJHtiPP/CIEY6EUKjfHB8tn+yf8vj S1WiydtMCXZjcv0OXUXaZF5juGX4zyBBGig31OuP6CdxIDlkU8KbMbIfuMSeqFkVgV3P O7HxZUzT5DGg7rTO4+WRyrrgrMyv0ou90QYwTUS5D2hUMmc7I/VKN4oUG8ljVwdGgmqB ihzNSUCkJpRQHdqDnuUezoffCIFsxPmyWxHmEid5t3r3vhR7lD3ipggjlXH3Us60Aqu8 3qORV9IuF+sFDxFTaMvLlozOmzYmlV2JAnGReBpIpCXYiP7ELa4cuEHiUcMvU7ss/IS4 Gs8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111183; x=1734715983; 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=pxqeEqK5xe+iFA9/sNUO2IfLug2C1fWvs977/dJQRE0=; b=MEvmRQpm65BmvB0H7CM2yl7E29xxBJqpvDtg0Dh1R94eVTWmO/0hptB0TpiBvyFD0b RkKX2nqIbt0cFLoWJdbOZoUZ/tSx9AAx3JwuEu6/fYwSZiCECA3Lekjqe+HLu7zLUa0+ SnhYID5dY8dOwC9h8BzVeqexl75goUBKyfxKWsixbyDDaJrsqi866c7oArLquH68WMLh o/yh1wFzNlGNBVXY0fgDwEKuXPrenw5woUfEtMtkzAQwKhLyAmXg3LYZIoMiWq20O654 LVL3NcMbnxkf8cSbSdGGUShZRx5SySa3Ve9Okzo6q/ZpA6N7sx0WewXnTxcJ9psIBZRW O3cw== X-Gm-Message-State: AOJu0YwaAM+p6No5WlTfVf8T97H7EpQFkzVikDHkvFDeXrQUyfQWUDM1 zzuCaTSyEYknH6xWhgZ/QNvhrC23OO5H3redeyEKgXBv7HdAEbMS+UQs5vJ78Cv/H6shjjiDPJ3 Q X-Gm-Gg: ASbGnctEn/TaBo6EydHNTkuHP2Ujq9XOMXHLccmrWZIuTUCSRYVnGXNXgxXlYtMofSS 1OMKC2rDqgNhLp0wks+Q8hQRXOTH1uzWZkS9NWo3bXq5ZlRqqo3d09dIrexhUsPwEDE0CBY4XlO HNSzTWKRovW27u+GTvZmQ0/X2T6TVUZX+K1OaYQlztl2VJUoVibQWaJuaZ1SonRKzNKxKcqNh9o q7KK7tK5SBH5MxNniaOjzIIoeAoE+Np54i4MEOJlXtZiBczJ1fEAxKoXrAUqg== X-Received: by 2002:a05:6000:4b02:b0:386:37bb:dde3 with SMTP id ffacd0b85a97d-38880abfbb7mr2861200f8f.12.1734111183250; Fri, 13 Dec 2024 09:33:03 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:02 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 30/85] target/arm: Convert FRINT{32, 64}[ZX] (scalar) to decodetree Date: Fri, 13 Dec 2024 17:31:34 +0000 Message-Id: <20241213173229.3308926-31-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Remove handle_fp_1src_single and handle_fp_1src_double as these were the last insns decoded by those functions. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-31-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 5 ++ target/arm/tcg/translate-a64.c | 146 ++++----------------------------- 2 files changed, 22 insertions(+), 129 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 4a48fcff1dc..4f7b3ee3d95 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -1340,6 +1340,11 @@ FRINTI_s 00011110 .. 1 001111 10000 ..... ..... @rr_hsd BFCVT_s 00011110 01 1 000110 10000 ..... ..... @rr_s +FRINT32Z_s 00011110 0. 1 010000 10000 ..... ..... @rr_sd +FRINT32X_s 00011110 0. 1 010001 10000 ..... ..... @rr_sd +FRINT64Z_s 00011110 0. 1 010010 10000 ..... ..... @rr_sd +FRINT64X_s 00011110 0. 1 010011 10000 ..... ..... @rr_sd + # Floating-point Immediate FMOVI_s 0001 1110 .. 1 imm:8 100 00000 rd:5 esz=%esz_hsd diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 5b30b4cacac..e48dd308fcc 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -8425,112 +8425,23 @@ static const FPScalar1 f_scalar_bfcvt = { }; TRANS_FEAT(BFCVT_s, aa64_bf16, do_fp1_scalar, a, &f_scalar_bfcvt, -1) -/* Floating-point data-processing (1 source) - single precision */ -static void handle_fp_1src_single(DisasContext *s, int opcode, int rd, int rn) -{ - void (*gen_fpst)(TCGv_i32, TCGv_i32, TCGv_ptr); - TCGv_i32 tcg_op, tcg_res; - TCGv_ptr fpst; - int rmode = -1; +static const FPScalar1 f_scalar_frint32 = { + NULL, + gen_helper_frint32_s, + gen_helper_frint32_d, +}; +TRANS_FEAT(FRINT32Z_s, aa64_frint, do_fp1_scalar, a, + &f_scalar_frint32, FPROUNDING_ZERO) +TRANS_FEAT(FRINT32X_s, aa64_frint, do_fp1_scalar, a, &f_scalar_frint32, -1) - tcg_op = read_fp_sreg(s, rn); - tcg_res = tcg_temp_new_i32(); - - switch (opcode) { - case 0x10: /* FRINT32Z */ - rmode = FPROUNDING_ZERO; - gen_fpst = gen_helper_frint32_s; - break; - case 0x11: /* FRINT32X */ - gen_fpst = gen_helper_frint32_s; - break; - case 0x12: /* FRINT64Z */ - rmode = FPROUNDING_ZERO; - gen_fpst = gen_helper_frint64_s; - break; - case 0x13: /* FRINT64X */ - gen_fpst = gen_helper_frint64_s; - break; - default: - case 0x0: /* FMOV */ - case 0x1: /* FABS */ - case 0x2: /* FNEG */ - case 0x3: /* FSQRT */ - case 0x6: /* BFCVT */ - case 0x8: /* FRINTN */ - case 0x9: /* FRINTP */ - case 0xa: /* FRINTM */ - case 0xb: /* FRINTZ */ - case 0xc: /* FRINTA */ - case 0xe: /* FRINTX */ - case 0xf: /* FRINTI */ - g_assert_not_reached(); - } - - fpst = fpstatus_ptr(FPST_FPCR); - if (rmode >= 0) { - TCGv_i32 tcg_rmode = gen_set_rmode(rmode, fpst); - gen_fpst(tcg_res, tcg_op, fpst); - gen_restore_rmode(tcg_rmode, fpst); - } else { - gen_fpst(tcg_res, tcg_op, fpst); - } - - write_fp_sreg(s, rd, tcg_res); -} - -/* Floating-point data-processing (1 source) - double precision */ -static void handle_fp_1src_double(DisasContext *s, int opcode, int rd, int rn) -{ - void (*gen_fpst)(TCGv_i64, TCGv_i64, TCGv_ptr); - TCGv_i64 tcg_op, tcg_res; - TCGv_ptr fpst; - int rmode = -1; - - tcg_op = read_fp_dreg(s, rn); - tcg_res = tcg_temp_new_i64(); - - switch (opcode) { - case 0x10: /* FRINT32Z */ - rmode = FPROUNDING_ZERO; - gen_fpst = gen_helper_frint32_d; - break; - case 0x11: /* FRINT32X */ - gen_fpst = gen_helper_frint32_d; - break; - case 0x12: /* FRINT64Z */ - rmode = FPROUNDING_ZERO; - gen_fpst = gen_helper_frint64_d; - break; - case 0x13: /* FRINT64X */ - gen_fpst = gen_helper_frint64_d; - break; - default: - case 0x0: /* FMOV */ - case 0x1: /* FABS */ - case 0x2: /* FNEG */ - case 0x3: /* FSQRT */ - case 0x8: /* FRINTN */ - case 0x9: /* FRINTP */ - case 0xa: /* FRINTM */ - case 0xb: /* FRINTZ */ - case 0xc: /* FRINTA */ - case 0xe: /* FRINTX */ - case 0xf: /* FRINTI */ - g_assert_not_reached(); - } - - fpst = fpstatus_ptr(FPST_FPCR); - if (rmode >= 0) { - TCGv_i32 tcg_rmode = gen_set_rmode(rmode, fpst); - gen_fpst(tcg_res, tcg_op, fpst); - gen_restore_rmode(tcg_rmode, fpst); - } else { - gen_fpst(tcg_res, tcg_op, fpst); - } - - write_fp_dreg(s, rd, tcg_res); -} +static const FPScalar1 f_scalar_frint64 = { + NULL, + gen_helper_frint64_s, + gen_helper_frint64_d, +}; +TRANS_FEAT(FRINT64Z_s, aa64_frint, do_fp1_scalar, a, + &f_scalar_frint64, FPROUNDING_ZERO) +TRANS_FEAT(FRINT64X_s, aa64_frint, do_fp1_scalar, a, &f_scalar_frint64, -1) static void handle_fp_fcvt(DisasContext *s, int opcode, int rd, int rn, int dtype, int ntype) @@ -8631,30 +8542,6 @@ static void disas_fp_1src(DisasContext *s, uint32_t insn) break; } - case 0x10 ... 0x13: /* FRINT{32,64}{X,Z} */ - if (type > 1 || !dc_isar_feature(aa64_frint, s)) { - goto do_unallocated; - } - /* 32-to-32 and 64-to-64 ops */ - switch (type) { - case 0: - if (!fp_access_check(s)) { - return; - } - handle_fp_1src_single(s, opcode, rd, rn); - break; - case 1: - if (!fp_access_check(s)) { - return; - } - handle_fp_1src_double(s, opcode, rd, rn); - break; - case 3: - default: - goto do_unallocated; - } - break; - default: do_unallocated: case 0x0: /* FMOV */ @@ -8669,6 +8556,7 @@ static void disas_fp_1src(DisasContext *s, uint32_t insn) case 0xc: /* FRINTA */ case 0xe: /* FRINTX */ case 0xf: /* FRINTI */ + case 0x10 ... 0x13: /* FRINT{32,64}{X,Z} */ unallocated_encoding(s); break; } From patchwork Fri Dec 13 17:31:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850185 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1641547wry; Fri, 13 Dec 2024 09:41:24 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXJG2T4jY+6GY0tc26Q6QGHl6C9OKF7osbQeta0yxIOg7xQioCUsXPnfxL64RCIXYFGV+Gb0g==@linaro.org X-Google-Smtp-Source: AGHT+IELAJUjlH6cmHIespLeqgIH2/MvYaOndFwstXLbcuKYSe9IZUlhUtwiNZgPdbQsimWckDKE X-Received: by 2002:a17:906:31c1:b0:aa6:8935:ae71 with SMTP id a640c23a62f3a-aab778c1e2dmr346656966b.12.1734111684218; Fri, 13 Dec 2024 09:41:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111684; cv=none; d=google.com; s=arc-20240605; b=WdvxurAoKQv9hXraQY6h+yL4aNCFWMCVskErHQs6s9bkv6aSTYdX9XvNaHX0g5jN14 hx9DAPFxltxGCV0tkoKGC1wencCu9kpRIV+Hx6PpMemPNp2mMQndItC3jTEOefHBJC0W 9qJ1r9VE8RGJjERCmI7uK/AQagQo0vfR6rYFC5vHr9Etdv3DhwDGyBInWe8udKyyhz/x PWP4IxACkUBDGPf9QsYfUUZQbb6LuA7/iPrVTY43/UqP6ICwn/HDKsDdGUeTsV75oIlP teBOPMpfGCAuLDZkmv8pmpNFWGE81ki3cMHhnnsE8zCggPedc4XQYbgWCaQFamMhZWil Ppww== 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=SucRKYZ0IbGK727p84X7hM39EEFZy2kqJF/NE/PFhFA=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=F1cJvKZSNq6aMNpHB82r7x6UOkXh4DWxTlFYt4VeU6VQ4+u5ttTp3iovnaePQRBH6I Y+/qrJ/1ZMz/E+5S5n3Ju8H9NwqFQ+oXyvlVcLai29yTwxSACMLwiNLu7jcKy6K+ALFI hUNJH+6aPgx6askJUJH+yj/SzMt01h5sNTIo8ind3Hdxs7+W0CW1T4EfuSok+ScTD2qQ 4HN7gilcrtPvTCz1RophBB51g91zzIpL43Ck4rJJe07/jHK6TI5nu4juQk0g3QOv5Eoi 20//eUlqUZo/v1V3uKkWuGBYac9QxAqapinbTBh5a0Ws132crzD+zXMHdXfSB6RLQvM1 wIFA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qVUZ1oya; 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 a640c23a62f3a-aa6707a5170si954230366b.488.2024.12.13.09.41.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:41:24 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qVUZ1oya; 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 1tM9YW-0002gJ-3n; Fri, 13 Dec 2024 12:34:24 -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 1tM9XI-00079Q-0t for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:08 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9XF-0001Z2-Vu for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:07 -0500 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-385e06af753so1091445f8f.2 for ; Fri, 13 Dec 2024 09:33:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111184; x=1734715984; 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=SucRKYZ0IbGK727p84X7hM39EEFZy2kqJF/NE/PFhFA=; b=qVUZ1oyaFC0GR2RUw7LVMvYIBRiHYc9Htqd4GkcIv1rm/qLbC7iZx2nMtwqJSAfKJc iiFRzSqG9Xy/1JngvktcQmHw6P8MODWeiBkDtTvbzMiMC64/PlP3aKrP+0y/ByoCvD2p Ua/0JESLUWdr+OvBByX0yn64zetqfCVTgTgYC6RshPp2ejrRZZB513MPCpYszx9HwWn3 xgEN00k2/+XTvf7nIwAyeRkTuFxYeTVGAEoWBQN4dLIDxUQ2Ha8K1aBHcRLMbT336U6X rkkX4fsYN0jGBR60yD+WrVOOj5J+8RkGnZIF8VynzKoyedKA03v94RBsmHYhJICihkNY Twbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111184; x=1734715984; 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=SucRKYZ0IbGK727p84X7hM39EEFZy2kqJF/NE/PFhFA=; b=vF+Bl2IFBU9q2Gp7UgEIu+72lts1aOWJbZVGRR9xH3yoTPwUrlXf2NcW/WywuY/hDp NpxfRS0vkH/rvzzJxLRe5S7VILV8r8Bx07I7mZBWh/zYBts0fbZtY5gbXMiboy71A9TN /MXYF8To4ns2Gt/4hrn5qyJ8gsXAtC+DQqVu+S5ZyPNS2bkuGwdrbVTrPAvm2BsIXwB+ 9E4ErwzqmllCVDMxPaWCzMUnMD3DZAVHzImriHVut/php3fpbIdEP0yRjtHlnkUeu5VT eVxNtJF+bdMmmk8+PEISt2s8vPstIuRk6R0l0no4X6oZeKWzMEBu0QV5Czc9Wgj6o1Qe pwUg== X-Gm-Message-State: AOJu0YwFNQNLU7AqDgvJetzTU/0/dihR3/E/HwzIDYdBZllLXz8rtrET HaIY0GUsUJ0wVVfXSJsWa26OjMgKCEeV/NOmbvGKg4O3PRTKKfAJK6yEaQxSxSlPS6QSn3BZ87J r X-Gm-Gg: ASbGncuwDhtvRJWW+kkBW5PFaq4ROVo4Y7ApKKKOa8SH92vCZ7Exrk7aote3GYfG43f pticL9os2RGlDmcsGAfActg35lVKwcyaITUqcJtTnT5iB7BQxzrhrkTmXXuHZ2aegwByGUjZuc6 /jsdJFfNn6/jpaAJgib2ig75XFIOV0Qm/d5ijOFaKaiWIFFMdOzG4tRJSPuE9kMW79q0kCSFMlM 1qsFd2GBwQu1hBVhg72DPl5ROplYEjm01O3GEbxIxEVEskv+puCttsca3sC+g== X-Received: by 2002:a05:6000:154c:b0:382:4f9e:711f with SMTP id ffacd0b85a97d-38880af1600mr2870967f8f.6.1734111184201; Fri, 13 Dec 2024 09:33:04 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:03 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 31/85] target/arm: Convert FCVT (scalar) to decodetree Date: Fri, 13 Dec 2024 17:31:35 +0000 Message-Id: <20241213173229.3308926-32-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Remove handle_fp_fcvt and disas_fp_1src as these were the last insns decoded by those functions. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-32-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 7 ++ target/arm/tcg/translate-a64.c | 172 +++++++++++++-------------------- 2 files changed, 74 insertions(+), 105 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 4f7b3ee3d95..211346c4d90 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -1345,6 +1345,13 @@ FRINT32X_s 00011110 0. 1 010001 10000 ..... ..... @rr_sd FRINT64Z_s 00011110 0. 1 010010 10000 ..... ..... @rr_sd FRINT64X_s 00011110 0. 1 010011 10000 ..... ..... @rr_sd +FCVT_s_ds 00011110 00 1 000101 10000 ..... ..... @rr +FCVT_s_hs 00011110 00 1 000111 10000 ..... ..... @rr +FCVT_s_sd 00011110 01 1 000100 10000 ..... ..... @rr +FCVT_s_hd 00011110 01 1 000111 10000 ..... ..... @rr +FCVT_s_sh 00011110 11 1 000100 10000 ..... ..... @rr +FCVT_s_dh 00011110 11 1 000101 10000 ..... ..... @rr + # Floating-point Immediate FMOVI_s 0001 1110 .. 1 imm:8 100 00000 rd:5 esz=%esz_hsd diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index e48dd308fcc..b31a6d4dff3 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -8443,123 +8443,85 @@ TRANS_FEAT(FRINT64Z_s, aa64_frint, do_fp1_scalar, a, &f_scalar_frint64, FPROUNDING_ZERO) TRANS_FEAT(FRINT64X_s, aa64_frint, do_fp1_scalar, a, &f_scalar_frint64, -1) -static void handle_fp_fcvt(DisasContext *s, int opcode, - int rd, int rn, int dtype, int ntype) +static bool trans_FCVT_s_ds(DisasContext *s, arg_rr *a) { - switch (ntype) { - case 0x0: - { - TCGv_i32 tcg_rn = read_fp_sreg(s, rn); - if (dtype == 1) { - /* Single to double */ - TCGv_i64 tcg_rd = tcg_temp_new_i64(); - gen_helper_vfp_fcvtds(tcg_rd, tcg_rn, tcg_env); - write_fp_dreg(s, rd, tcg_rd); - } else { - /* Single to half */ - TCGv_i32 tcg_rd = tcg_temp_new_i32(); - TCGv_i32 ahp = get_ahp_flag(); - TCGv_ptr fpst = fpstatus_ptr(FPST_FPCR); + if (fp_access_check(s)) { + TCGv_i32 tcg_rn = read_fp_sreg(s, a->rn); + TCGv_i64 tcg_rd = tcg_temp_new_i64(); - gen_helper_vfp_fcvt_f32_to_f16(tcg_rd, tcg_rn, fpst, ahp); - /* write_fp_sreg is OK here because top half of tcg_rd is zero */ - write_fp_sreg(s, rd, tcg_rd); - } - break; - } - case 0x1: - { - TCGv_i64 tcg_rn = read_fp_dreg(s, rn); - TCGv_i32 tcg_rd = tcg_temp_new_i32(); - if (dtype == 0) { - /* Double to single */ - gen_helper_vfp_fcvtsd(tcg_rd, tcg_rn, tcg_env); - } else { - TCGv_ptr fpst = fpstatus_ptr(FPST_FPCR); - TCGv_i32 ahp = get_ahp_flag(); - /* Double to half */ - gen_helper_vfp_fcvt_f64_to_f16(tcg_rd, tcg_rn, fpst, ahp); - /* write_fp_sreg is OK here because top half of tcg_rd is zero */ - } - write_fp_sreg(s, rd, tcg_rd); - break; - } - case 0x3: - { - TCGv_i32 tcg_rn = read_fp_sreg(s, rn); - TCGv_ptr tcg_fpst = fpstatus_ptr(FPST_FPCR); - TCGv_i32 tcg_ahp = get_ahp_flag(); - tcg_gen_ext16u_i32(tcg_rn, tcg_rn); - if (dtype == 0) { - /* Half to single */ - TCGv_i32 tcg_rd = tcg_temp_new_i32(); - gen_helper_vfp_fcvt_f16_to_f32(tcg_rd, tcg_rn, tcg_fpst, tcg_ahp); - write_fp_sreg(s, rd, tcg_rd); - } else { - /* Half to double */ - TCGv_i64 tcg_rd = tcg_temp_new_i64(); - gen_helper_vfp_fcvt_f16_to_f64(tcg_rd, tcg_rn, tcg_fpst, tcg_ahp); - write_fp_dreg(s, rd, tcg_rd); - } - break; - } - default: - g_assert_not_reached(); + gen_helper_vfp_fcvtds(tcg_rd, tcg_rn, tcg_env); + write_fp_dreg(s, a->rd, tcg_rd); } + return true; } -/* Floating point data-processing (1 source) - * 31 30 29 28 24 23 22 21 20 15 14 10 9 5 4 0 - * +---+---+---+-----------+------+---+--------+-----------+------+------+ - * | M | 0 | S | 1 1 1 1 0 | type | 1 | opcode | 1 0 0 0 0 | Rn | Rd | - * +---+---+---+-----------+------+---+--------+-----------+------+------+ - */ -static void disas_fp_1src(DisasContext *s, uint32_t insn) +static bool trans_FCVT_s_hs(DisasContext *s, arg_rr *a) { - int mos = extract32(insn, 29, 3); - int type = extract32(insn, 22, 2); - int opcode = extract32(insn, 15, 6); - int rn = extract32(insn, 5, 5); - int rd = extract32(insn, 0, 5); + if (fp_access_check(s)) { + TCGv_i32 tmp = read_fp_sreg(s, a->rn); + TCGv_i32 ahp = get_ahp_flag(); + TCGv_ptr fpst = fpstatus_ptr(FPST_FPCR); - if (mos) { - goto do_unallocated; + gen_helper_vfp_fcvt_f32_to_f16(tmp, tmp, fpst, ahp); + /* write_fp_sreg is OK here because top half of result is zero */ + write_fp_sreg(s, a->rd, tmp); } + return true; +} - switch (opcode) { - case 0x4: case 0x5: case 0x7: - { - /* FCVT between half, single and double precision */ - int dtype = extract32(opcode, 0, 2); - if (type == 2 || dtype == type) { - goto do_unallocated; - } - if (!fp_access_check(s)) { - return; - } +static bool trans_FCVT_s_sd(DisasContext *s, arg_rr *a) +{ + if (fp_access_check(s)) { + TCGv_i64 tcg_rn = read_fp_dreg(s, a->rn); + TCGv_i32 tcg_rd = tcg_temp_new_i32(); - handle_fp_fcvt(s, opcode, rd, rn, dtype, type); - break; + gen_helper_vfp_fcvtsd(tcg_rd, tcg_rn, tcg_env); + write_fp_sreg(s, a->rd, tcg_rd); } + return true; +} - default: - do_unallocated: - case 0x0: /* FMOV */ - case 0x1: /* FABS */ - case 0x2: /* FNEG */ - case 0x3: /* FSQRT */ - case 0x6: /* BFCVT */ - case 0x8: /* FRINTN */ - case 0x9: /* FRINTP */ - case 0xa: /* FRINTM */ - case 0xb: /* FRINTZ */ - case 0xc: /* FRINTA */ - case 0xe: /* FRINTX */ - case 0xf: /* FRINTI */ - case 0x10 ... 0x13: /* FRINT{32,64}{X,Z} */ - unallocated_encoding(s); - break; +static bool trans_FCVT_s_hd(DisasContext *s, arg_rr *a) +{ + if (fp_access_check(s)) { + TCGv_i64 tcg_rn = read_fp_dreg(s, a->rn); + TCGv_i32 tcg_rd = tcg_temp_new_i32(); + TCGv_i32 ahp = get_ahp_flag(); + TCGv_ptr fpst = fpstatus_ptr(FPST_FPCR); + + gen_helper_vfp_fcvt_f64_to_f16(tcg_rd, tcg_rn, fpst, ahp); + /* write_fp_sreg is OK here because top half of tcg_rd is zero */ + write_fp_sreg(s, a->rd, tcg_rd); } + return true; +} + +static bool trans_FCVT_s_sh(DisasContext *s, arg_rr *a) +{ + if (fp_access_check(s)) { + TCGv_i32 tcg_rn = read_fp_hreg(s, a->rn); + TCGv_i32 tcg_rd = tcg_temp_new_i32(); + TCGv_ptr tcg_fpst = fpstatus_ptr(FPST_FPCR); + TCGv_i32 tcg_ahp = get_ahp_flag(); + + gen_helper_vfp_fcvt_f16_to_f32(tcg_rd, tcg_rn, tcg_fpst, tcg_ahp); + write_fp_sreg(s, a->rd, tcg_rd); + } + return true; +} + +static bool trans_FCVT_s_dh(DisasContext *s, arg_rr *a) +{ + if (fp_access_check(s)) { + TCGv_i32 tcg_rn = read_fp_hreg(s, a->rn); + TCGv_i64 tcg_rd = tcg_temp_new_i64(); + TCGv_ptr tcg_fpst = fpstatus_ptr(FPST_FPCR); + TCGv_i32 tcg_ahp = get_ahp_flag(); + + gen_helper_vfp_fcvt_f16_to_f64(tcg_rd, tcg_rn, tcg_fpst, tcg_ahp); + write_fp_dreg(s, a->rd, tcg_rd); + } + return true; } /* Handle floating point <=> fixed point conversions. Note that we can @@ -8982,7 +8944,7 @@ static void disas_data_proc_fp(DisasContext *s, uint32_t insn) break; case 2: /* [15:12] == x100 */ /* Floating point data-processing (1 source) */ - disas_fp_1src(s, insn); + unallocated_encoding(s); /* in decodetree */ break; case 3: /* [15:12] == 1000 */ unallocated_encoding(s); From patchwork Fri Dec 13 17:31:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850145 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1638182wry; Fri, 13 Dec 2024 09:34:18 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVpGTM5l9CEbjJGLQKaeyOwht+TUFNbwgfzsVCad0YKdFJgSuSmtC3TNv8q53monaFnkAfC1g==@linaro.org X-Google-Smtp-Source: AGHT+IF2ARs/rHYD2c8BnIWCk49/0WY6UsnlLFO+PBCXQE7bTST5laplkzZZ7VI6MNaZQhj+Z0dM X-Received: by 2002:a05:6122:920:b0:518:7c13:d191 with SMTP id 71dfb90a1353d-518ca2af698mr4282318e0c.8.1734111258110; Fri, 13 Dec 2024 09:34:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111258; cv=none; d=google.com; s=arc-20240605; b=L4q5cpeAv0HeaXf08SgGZUXHCs0NCrGluP+J92nYG7pWXImjrit2hE2PLYJS1kZY40 X25BFqEQnW8fKZHHkl5FCfdmqflNTfvTq4sqXnM6Cz5dz15ZOPavfkqOe6NBDj7HFIhk tA0mBSKhTGTDNMHWpFfthESCRoBjLTJgbTguCryArpDtcc4btdeyHMjCxK30XIl6DNit MpJc7ut90RvxZ+sSNNJsadRw00MdH8zMTM+l5qakihLYCv97coXyVOR9RTSHscJE9Yra 8LIgKXCJlTuQveAC0zV6z3bFvqZKyy6zPycboxkRhVLDcwPwdKv+DFi09mDy2RLo8BSJ aMHw== 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=iMzXhFrSqeJeJ1IC5x6epH+AF8QtsnesEkYCY/pLSp8=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=djDrWyO1ckuYChJ1DNxMdP8pp7iG2RWR1kgJW+JbyOX1+rYwBnPT5Iaj0h/Dp1vgpk wkFIMa4dUf2LW7/MLofT65oVGirBWYbv5uBKyWgr//OOnETvPcqXjwmjhgCDCoEC74Jv BKfE99D/s8i9xqUp0O1IUWDMgnMt1Zw9zssErtfs6pnuNExc27LGm++ZPeZF9l6GNvq0 YG/n+Pvj105Wemy3XkcE8IYQWYjlc/4cLGAQo/z6F7Y7OdslhKddlEWnYfL1ZR5KKlDb FSuUxVvEraWS4n5qIgDwRfFBap1XNA8EyCQ1/0r7+AI/Fy8KN5R5IDwA+4y0n+yi5NBi k3dw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="ZY1d2/sQ"; 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 71dfb90a1353d-519e30ee9f0si756e0c.4.2024.12.13.09.34.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:34:18 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="ZY1d2/sQ"; 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 1tM9Y9-00009o-6K; Fri, 13 Dec 2024 12:34: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 1tM9XM-0007BT-5N for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:14 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9XI-0001ZP-Q4 for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:11 -0500 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-436281c8a38so11938015e9.3 for ; Fri, 13 Dec 2024 09:33:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111185; x=1734715985; 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=iMzXhFrSqeJeJ1IC5x6epH+AF8QtsnesEkYCY/pLSp8=; b=ZY1d2/sQKs2OIXrODHw54F74cmbUTllr3RjftxDJHjcSgr6ALpc2O/J3I3NS8OdScu dhZ3c/9Rf0AHoOat2Harp2JGx1iKySrcseVSqTi0xkqwXb+qiS2tYb87qx4nSlxmX+2Z /TplqI5sRMFp3XbHTioOjhg7rKmoKCA6YX8sDHkLatkRqewSIomwe6imswWKett1b1VA jl/RJJoxn3xbkiZNhfaRlkM61IMzK3yKM6QNcV/VQiMy2z4JNrXiWNIEnx1lnQLdR6Lx pvOiFmjW4xKdiuYoTrIJIwwAjSrBsEp0KoWEI2p5Ihzqg0ck5norOiUKDzEpVLuQm9V6 d6nA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111185; x=1734715985; 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=iMzXhFrSqeJeJ1IC5x6epH+AF8QtsnesEkYCY/pLSp8=; b=tlEkpEAAr67AvJWKOWIhVFPrinvQbQgtvQwC17TL99T+DXbou7pTwWmBEa9o/fCqS2 QBDGTmRyN0N9feLwRCDjxAFjv7ljHtgmrhDMAk6BnuTZHTQWNk0qfdJZh2/qvQmujs2V 3mY4FyIxIHtZZU1Jx79jKSvlyJuB3pkNabpXoQFVMtCLWcDsSdvVTubb82+Hf2aiUYg2 T7m573e2JrMjxe17HTEPwIx+yAwOgPbjmXC7z+mr8xXjc3tB55x4b4lA1b696OaI014l WMsyWyVOQlMxwR+EAYbbTC1aD1cKY2/FM2Mfm6aRNa2oTtbyX9LxE8OKhhj4rxx6YU96 /uZA== X-Gm-Message-State: AOJu0YyM/8YkDTYmrWRzds4brBE8sX3LRDwfhLYY+PI6ohZcBZkKQnOo 25vvNTF8hbIhhGNN2+lJcRi4cqBKuK+A4TD9iQaRV0IMcHUX4ZoFA2PIUWHDDHdkYewizWfeI9+ h X-Gm-Gg: ASbGnctJrjQpCt43DaLRrEMGgxNv2FwYDn/YBqFVaGm3R9Pmpm9yWuRTR3ZZ6va4agU WXdU07zsPX3gsq5kvTzaVFDMB2YQt8ALdDLv71gmdPqzzmbDgQTAIkqgMCb8eGKa7wRlKuGRJDL 3oqGn+UHDopg2FhubyT0LIQv8H94xbGrC4UKTBAR6MtzPdEazjdw2ewsOA3CjErBuyuICN7U9bZ z3+1RSlVEDaxs+o0yTT+QNgh45R6AjacoMkD/nMn6l8SgvDQChlkaUoJIMgDQ== X-Received: by 2002:a05:600c:4e4e:b0:435:192:63ca with SMTP id 5b1f17b1804b1-4362aaa4969mr32525055e9.21.1734111185229; Fri, 13 Dec 2024 09:33:05 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:04 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 32/85] target/arm: Convert handle_fpfpcvt to decodetree Date: Fri, 13 Dec 2024 17:31:36 +0000 Message-Id: <20241213173229.3308926-33-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32b.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: Richard Henderson This includes SCVTF, UCVTF, FCVT{N,P,M,Z,A}{S,U}. Remove disas_fp_fixed_conv as those were the last insns decoded by that function. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-33-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 40 ++++ target/arm/tcg/translate-a64.c | 391 ++++++++++++++------------------- 2 files changed, 209 insertions(+), 222 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 211346c4d90..5e170cec7a8 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -1323,6 +1323,46 @@ FMAXV_s 0110 1110 00 11000 01111 10 ..... ..... @rr_q1e2 FMINV_h 0.00 1110 10 11000 01111 10 ..... ..... @qrr_h FMINV_s 0110 1110 10 11000 01111 10 ..... ..... @rr_q1e2 +# Conversion between floating-point and fixed-point (general register) + +&fcvt rd rn esz sf shift +%fcvt_shift32 10:5 !function=rsub_32 +%fcvt_shift64 10:6 !function=rsub_64 + +@fcvt32 0 ....... .. ...... 1..... rn:5 rd:5 \ + &fcvt sf=0 esz=%esz_hsd shift=%fcvt_shift32 +@fcvt64 1 ....... .. ...... ...... rn:5 rd:5 \ + &fcvt sf=1 esz=%esz_hsd shift=%fcvt_shift64 + +SCVTF_g . 0011110 .. 000010 ...... ..... ..... @fcvt32 +SCVTF_g . 0011110 .. 000010 ...... ..... ..... @fcvt64 +UCVTF_g . 0011110 .. 000011 ...... ..... ..... @fcvt32 +UCVTF_g . 0011110 .. 000011 ...... ..... ..... @fcvt64 + +FCVTZS_g . 0011110 .. 011000 ...... ..... ..... @fcvt32 +FCVTZS_g . 0011110 .. 011000 ...... ..... ..... @fcvt64 +FCVTZU_g . 0011110 .. 011001 ...... ..... ..... @fcvt32 +FCVTZU_g . 0011110 .. 011001 ...... ..... ..... @fcvt64 + +# Conversion between floating-point and integer (general register) + +@icvt sf:1 ....... .. ...... ...... rn:5 rd:5 \ + &fcvt esz=%esz_hsd shift=0 + +SCVTF_g . 0011110 .. 100010 000000 ..... ..... @icvt +UCVTF_g . 0011110 .. 100011 000000 ..... ..... @icvt + +FCVTNS_g . 0011110 .. 100000 000000 ..... ..... @icvt +FCVTNU_g . 0011110 .. 100001 000000 ..... ..... @icvt +FCVTPS_g . 0011110 .. 101000 000000 ..... ..... @icvt +FCVTPU_g . 0011110 .. 101001 000000 ..... ..... @icvt +FCVTMS_g . 0011110 .. 110000 000000 ..... ..... @icvt +FCVTMU_g . 0011110 .. 110001 000000 ..... ..... @icvt +FCVTZS_g . 0011110 .. 111000 000000 ..... ..... @icvt +FCVTZU_g . 0011110 .. 111001 000000 ..... ..... @icvt +FCVTAS_g . 0011110 .. 100100 000000 ..... ..... @icvt +FCVTAU_g . 0011110 .. 100101 000000 ..... ..... @icvt + # Floating-point data processing (1 source) FMOV_s 00011110 .. 1 000000 10000 ..... ..... @rr_hsd diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index b31a6d4dff3..67227e26767 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -8524,227 +8524,196 @@ static bool trans_FCVT_s_dh(DisasContext *s, arg_rr *a) return true; } -/* Handle floating point <=> fixed point conversions. Note that we can - * also deal with fp <=> integer conversions as a special case (scale == 64) - * OPTME: consider handling that special case specially or at least skipping - * the call to scalbn in the helpers for zero shifts. - */ -static void handle_fpfpcvt(DisasContext *s, int rd, int rn, int opcode, - bool itof, int rmode, int scale, int sf, int type) +static bool do_cvtf_scalar(DisasContext *s, MemOp esz, int rd, int shift, + TCGv_i64 tcg_int, bool is_signed) { - bool is_signed = !(opcode & 1); TCGv_ptr tcg_fpstatus; TCGv_i32 tcg_shift, tcg_single; TCGv_i64 tcg_double; - tcg_fpstatus = fpstatus_ptr(type == 3 ? FPST_FPCR_F16 : FPST_FPCR); + tcg_fpstatus = fpstatus_ptr(esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); + tcg_shift = tcg_constant_i32(shift); - tcg_shift = tcg_constant_i32(64 - scale); - - if (itof) { - TCGv_i64 tcg_int = cpu_reg(s, rn); - if (!sf) { - TCGv_i64 tcg_extend = tcg_temp_new_i64(); - - if (is_signed) { - tcg_gen_ext32s_i64(tcg_extend, tcg_int); - } else { - tcg_gen_ext32u_i64(tcg_extend, tcg_int); - } - - tcg_int = tcg_extend; + switch (esz) { + case MO_64: + tcg_double = tcg_temp_new_i64(); + if (is_signed) { + gen_helper_vfp_sqtod(tcg_double, tcg_int, tcg_shift, tcg_fpstatus); + } else { + gen_helper_vfp_uqtod(tcg_double, tcg_int, tcg_shift, tcg_fpstatus); } + write_fp_dreg(s, rd, tcg_double); + break; - switch (type) { - case 1: /* float64 */ - tcg_double = tcg_temp_new_i64(); - if (is_signed) { - gen_helper_vfp_sqtod(tcg_double, tcg_int, - tcg_shift, tcg_fpstatus); - } else { - gen_helper_vfp_uqtod(tcg_double, tcg_int, - tcg_shift, tcg_fpstatus); - } - write_fp_dreg(s, rd, tcg_double); - break; - - case 0: /* float32 */ - tcg_single = tcg_temp_new_i32(); - if (is_signed) { - gen_helper_vfp_sqtos(tcg_single, tcg_int, - tcg_shift, tcg_fpstatus); - } else { - gen_helper_vfp_uqtos(tcg_single, tcg_int, - tcg_shift, tcg_fpstatus); - } - write_fp_sreg(s, rd, tcg_single); - break; - - case 3: /* float16 */ - tcg_single = tcg_temp_new_i32(); - if (is_signed) { - gen_helper_vfp_sqtoh(tcg_single, tcg_int, - tcg_shift, tcg_fpstatus); - } else { - gen_helper_vfp_uqtoh(tcg_single, tcg_int, - tcg_shift, tcg_fpstatus); - } - write_fp_sreg(s, rd, tcg_single); - break; - - default: - g_assert_not_reached(); + case MO_32: + tcg_single = tcg_temp_new_i32(); + if (is_signed) { + gen_helper_vfp_sqtos(tcg_single, tcg_int, tcg_shift, tcg_fpstatus); + } else { + gen_helper_vfp_uqtos(tcg_single, tcg_int, tcg_shift, tcg_fpstatus); } - } else { - TCGv_i64 tcg_int = cpu_reg(s, rd); - TCGv_i32 tcg_rmode; + write_fp_sreg(s, rd, tcg_single); + break; - if (extract32(opcode, 2, 1)) { - /* There are too many rounding modes to all fit into rmode, - * so FCVTA[US] is a special case. - */ - rmode = FPROUNDING_TIEAWAY; + case MO_16: + tcg_single = tcg_temp_new_i32(); + if (is_signed) { + gen_helper_vfp_sqtoh(tcg_single, tcg_int, tcg_shift, tcg_fpstatus); + } else { + gen_helper_vfp_uqtoh(tcg_single, tcg_int, tcg_shift, tcg_fpstatus); } + write_fp_sreg(s, rd, tcg_single); + break; - tcg_rmode = gen_set_rmode(rmode, tcg_fpstatus); - - switch (type) { - case 1: /* float64 */ - tcg_double = read_fp_dreg(s, rn); - if (is_signed) { - if (!sf) { - gen_helper_vfp_tosld(tcg_int, tcg_double, - tcg_shift, tcg_fpstatus); - } else { - gen_helper_vfp_tosqd(tcg_int, tcg_double, - tcg_shift, tcg_fpstatus); - } - } else { - if (!sf) { - gen_helper_vfp_tould(tcg_int, tcg_double, - tcg_shift, tcg_fpstatus); - } else { - gen_helper_vfp_touqd(tcg_int, tcg_double, - tcg_shift, tcg_fpstatus); - } - } - if (!sf) { - tcg_gen_ext32u_i64(tcg_int, tcg_int); - } - break; - - case 0: /* float32 */ - tcg_single = read_fp_sreg(s, rn); - if (sf) { - if (is_signed) { - gen_helper_vfp_tosqs(tcg_int, tcg_single, - tcg_shift, tcg_fpstatus); - } else { - gen_helper_vfp_touqs(tcg_int, tcg_single, - tcg_shift, tcg_fpstatus); - } - } else { - TCGv_i32 tcg_dest = tcg_temp_new_i32(); - if (is_signed) { - gen_helper_vfp_tosls(tcg_dest, tcg_single, - tcg_shift, tcg_fpstatus); - } else { - gen_helper_vfp_touls(tcg_dest, tcg_single, - tcg_shift, tcg_fpstatus); - } - tcg_gen_extu_i32_i64(tcg_int, tcg_dest); - } - break; - - case 3: /* float16 */ - tcg_single = read_fp_sreg(s, rn); - if (sf) { - if (is_signed) { - gen_helper_vfp_tosqh(tcg_int, tcg_single, - tcg_shift, tcg_fpstatus); - } else { - gen_helper_vfp_touqh(tcg_int, tcg_single, - tcg_shift, tcg_fpstatus); - } - } else { - TCGv_i32 tcg_dest = tcg_temp_new_i32(); - if (is_signed) { - gen_helper_vfp_toslh(tcg_dest, tcg_single, - tcg_shift, tcg_fpstatus); - } else { - gen_helper_vfp_toulh(tcg_dest, tcg_single, - tcg_shift, tcg_fpstatus); - } - tcg_gen_extu_i32_i64(tcg_int, tcg_dest); - } - break; - - default: - g_assert_not_reached(); - } - - gen_restore_rmode(tcg_rmode, tcg_fpstatus); + default: + g_assert_not_reached(); } + return true; } -/* Floating point <-> fixed point conversions - * 31 30 29 28 24 23 22 21 20 19 18 16 15 10 9 5 4 0 - * +----+---+---+-----------+------+---+-------+--------+-------+------+------+ - * | sf | 0 | S | 1 1 1 1 0 | type | 0 | rmode | opcode | scale | Rn | Rd | - * +----+---+---+-----------+------+---+-------+--------+-------+------+------+ - */ -static void disas_fp_fixed_conv(DisasContext *s, uint32_t insn) +static bool do_cvtf_g(DisasContext *s, arg_fcvt *a, bool is_signed) { - int rd = extract32(insn, 0, 5); - int rn = extract32(insn, 5, 5); - int scale = extract32(insn, 10, 6); - int opcode = extract32(insn, 16, 3); - int rmode = extract32(insn, 19, 2); - int type = extract32(insn, 22, 2); - bool sbit = extract32(insn, 29, 1); - bool sf = extract32(insn, 31, 1); - bool itof; + TCGv_i64 tcg_int; + int check = fp_access_check_scalar_hsd(s, a->esz); - if (sbit || (!sf && scale < 32)) { - unallocated_encoding(s); - return; + if (check <= 0) { + return check == 0; } - switch (type) { - case 0: /* float32 */ - case 1: /* float64 */ - break; - case 3: /* float16 */ - if (dc_isar_feature(aa64_fp16, s)) { - break; + if (a->sf) { + tcg_int = cpu_reg(s, a->rn); + } else { + tcg_int = read_cpu_reg(s, a->rn, true); + if (is_signed) { + tcg_gen_ext32s_i64(tcg_int, tcg_int); + } else { + tcg_gen_ext32u_i64(tcg_int, tcg_int); } - /* fallthru */ - default: - unallocated_encoding(s); - return; } - - switch ((rmode << 3) | opcode) { - case 0x2: /* SCVTF */ - case 0x3: /* UCVTF */ - itof = true; - break; - case 0x18: /* FCVTZS */ - case 0x19: /* FCVTZU */ - itof = false; - break; - default: - unallocated_encoding(s); - return; - } - - if (!fp_access_check(s)) { - return; - } - - handle_fpfpcvt(s, rd, rn, opcode, itof, FPROUNDING_ZERO, scale, sf, type); + return do_cvtf_scalar(s, a->esz, a->rd, a->shift, tcg_int, is_signed); } +TRANS(SCVTF_g, do_cvtf_g, a, true) +TRANS(UCVTF_g, do_cvtf_g, a, false) + +static void do_fcvt_scalar(DisasContext *s, MemOp out, MemOp esz, + TCGv_i64 tcg_out, int shift, int rn, + ARMFPRounding rmode) +{ + TCGv_ptr tcg_fpstatus; + TCGv_i32 tcg_shift, tcg_rmode, tcg_single; + + tcg_fpstatus = fpstatus_ptr(esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); + tcg_shift = tcg_constant_i32(shift); + tcg_rmode = gen_set_rmode(rmode, tcg_fpstatus); + + switch (esz) { + case MO_64: + read_vec_element(s, tcg_out, rn, 0, MO_64); + switch (out) { + case MO_64 | MO_SIGN: + gen_helper_vfp_tosqd(tcg_out, tcg_out, tcg_shift, tcg_fpstatus); + break; + case MO_64: + gen_helper_vfp_touqd(tcg_out, tcg_out, tcg_shift, tcg_fpstatus); + break; + case MO_32 | MO_SIGN: + gen_helper_vfp_tosld(tcg_out, tcg_out, tcg_shift, tcg_fpstatus); + break; + case MO_32: + gen_helper_vfp_tould(tcg_out, tcg_out, tcg_shift, tcg_fpstatus); + break; + default: + g_assert_not_reached(); + } + break; + + case MO_32: + tcg_single = read_fp_sreg(s, rn); + switch (out) { + case MO_64 | MO_SIGN: + gen_helper_vfp_tosqs(tcg_out, tcg_single, tcg_shift, tcg_fpstatus); + break; + case MO_64: + gen_helper_vfp_touqs(tcg_out, tcg_single, tcg_shift, tcg_fpstatus); + break; + case MO_32 | MO_SIGN: + gen_helper_vfp_tosls(tcg_single, tcg_single, + tcg_shift, tcg_fpstatus); + tcg_gen_extu_i32_i64(tcg_out, tcg_single); + break; + case MO_32: + gen_helper_vfp_touls(tcg_single, tcg_single, + tcg_shift, tcg_fpstatus); + tcg_gen_extu_i32_i64(tcg_out, tcg_single); + break; + default: + g_assert_not_reached(); + } + break; + + case MO_16: + tcg_single = read_fp_hreg(s, rn); + switch (out) { + case MO_64 | MO_SIGN: + gen_helper_vfp_tosqh(tcg_out, tcg_single, tcg_shift, tcg_fpstatus); + break; + case MO_64: + gen_helper_vfp_touqh(tcg_out, tcg_single, tcg_shift, tcg_fpstatus); + break; + case MO_32 | MO_SIGN: + gen_helper_vfp_toslh(tcg_single, tcg_single, + tcg_shift, tcg_fpstatus); + tcg_gen_extu_i32_i64(tcg_out, tcg_single); + break; + case MO_32: + gen_helper_vfp_toulh(tcg_single, tcg_single, + tcg_shift, tcg_fpstatus); + tcg_gen_extu_i32_i64(tcg_out, tcg_single); + break; + default: + g_assert_not_reached(); + } + break; + + default: + g_assert_not_reached(); + } + + gen_restore_rmode(tcg_rmode, tcg_fpstatus); +} + +static bool do_fcvt_g(DisasContext *s, arg_fcvt *a, + ARMFPRounding rmode, bool is_signed) +{ + TCGv_i64 tcg_int; + int check = fp_access_check_scalar_hsd(s, a->esz); + + if (check <= 0) { + return check == 0; + } + + tcg_int = cpu_reg(s, a->rd); + do_fcvt_scalar(s, (a->sf ? MO_64 : MO_32) | (is_signed ? MO_SIGN : 0), + a->esz, tcg_int, a->shift, a->rn, rmode); + + if (!a->sf) { + tcg_gen_ext32u_i64(tcg_int, tcg_int); + } + return true; +} + +TRANS(FCVTNS_g, do_fcvt_g, a, FPROUNDING_TIEEVEN, true) +TRANS(FCVTNU_g, do_fcvt_g, a, FPROUNDING_TIEEVEN, false) +TRANS(FCVTPS_g, do_fcvt_g, a, FPROUNDING_POSINF, true) +TRANS(FCVTPU_g, do_fcvt_g, a, FPROUNDING_POSINF, false) +TRANS(FCVTMS_g, do_fcvt_g, a, FPROUNDING_NEGINF, true) +TRANS(FCVTMU_g, do_fcvt_g, a, FPROUNDING_NEGINF, false) +TRANS(FCVTZS_g, do_fcvt_g, a, FPROUNDING_ZERO, true) +TRANS(FCVTZU_g, do_fcvt_g, a, FPROUNDING_ZERO, false) +TRANS(FCVTAS_g, do_fcvt_g, a, FPROUNDING_TIEAWAY, true) +TRANS(FCVTAU_g, do_fcvt_g, a, FPROUNDING_TIEAWAY, false) + static void handle_fmov(DisasContext *s, int rd, int rn, int type, bool itof) { /* FMOV: gpr to or from float, double, or top half of quad fp reg, @@ -8844,33 +8813,11 @@ static void disas_fp_int_conv(DisasContext *s, uint32_t insn) switch (opcode) { case 2: /* SCVTF */ case 3: /* UCVTF */ - itof = true; - /* fallthru */ case 4: /* FCVTAS */ case 5: /* FCVTAU */ - if (rmode != 0) { - goto do_unallocated; - } - /* fallthru */ case 0: /* FCVT[NPMZ]S */ case 1: /* FCVT[NPMZ]U */ - switch (type) { - case 0: /* float32 */ - case 1: /* float64 */ - break; - case 3: /* float16 */ - if (!dc_isar_feature(aa64_fp16, s)) { - goto do_unallocated; - } - break; - default: - goto do_unallocated; - } - if (!fp_access_check(s)) { - return; - } - handle_fpfpcvt(s, rd, rn, opcode, itof, rmode, 64, sf, type); - break; + goto do_unallocated; default: switch (sf << 7 | type << 5 | rmode << 3 | opcode) { @@ -8924,7 +8871,7 @@ static void disas_data_proc_fp(DisasContext *s, uint32_t insn) unallocated_encoding(s); /* in decodetree */ } else if (extract32(insn, 21, 1) == 0) { /* Floating point to fixed point conversions */ - disas_fp_fixed_conv(s, insn); + unallocated_encoding(s); /* in decodetree */ } else { switch (extract32(insn, 10, 2)) { case 1: /* Floating point conditional compare */ From patchwork Fri Dec 13 17:31:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850202 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1643080wry; Fri, 13 Dec 2024 09:44:58 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWxNE43aD4txrOblD2Ou8/NeL4N30zYZYa3Tuw3GrB3m1eJwFxBllSQDGOXb0Lsz6/2g28K/g==@linaro.org X-Google-Smtp-Source: AGHT+IFbCG5MJZ3lXVJ63olat0kfSvUq7mKK4s0vz2zpbeilrFvEDfaRyU5Yh5zldUdv2RdaCHcw X-Received: by 2002:a17:906:b5b:b0:aab:9145:30a8 with SMTP id a640c23a62f3a-aab9145311emr103459866b.50.1734111897950; Fri, 13 Dec 2024 09:44:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111897; cv=none; d=google.com; s=arc-20240605; b=AYiWiCY3a8uru/cG1rySLCOq1fxXZyAWceQLdjxEpcQ2l3te8C3PKKqB4bpfU4IYmf XCrK8KbK/yew3MnxpaUQnbnjEi7S8l3OtA9VcEfpGnslKfyZdaNmSIumE0w1bo5s9zmj SqzhIGx5KZCU2uNhQ3dxKlE78YofZeDrSnummEXN2cam9aAxiu2Xkp9jwj2LCLoaXY4+ xw/2J3s4MNPLkfniP2GdfpG59t36u9MKfmwhbV0J8TAuhRQMUEuZhjOzK3MLhwr69g07 wUVv46Y5zFuiGtYGYHdLqnK397cBy9Ytli2V7YOCPssGQeIPS+a+z4rDpjWiKQitnuyP lXtg== 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=K6tFM8RqNXAp8SOBzyhkiiQ54MPDAGBytFPbzLtpuXE=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=bSAq8RoyfifFaKmAZJcuttijNyFMlV0mcGfUCCxvMBf+l0xQLFC+HlPHSsVOXA8nw6 Blylz1RVLfaOUVHzA1XNoy0GKEW9UR0J5X8Gx/q59avitCbMwFDGGxyT1V/DdmHgZh6P xn+wUEP+xYwbd/8CXR9jFgkrfXQkqetvqZWNjwkY/U5Lysx0Cgc5Srj+T2aIg/okDESl 5QgD3jhxSdFDy61zz/CRaz68i+mFNB7W0rMPJH5moudlmiEJdzlgGCEw5/oaub3XzRUs OSkuCerNQOLSh+6csYattyVnxBvdW1TANZHtzNMQ0O5vcn8/X/ElN7G1Ndr1CczYwvP5 GwLQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WlNpwxzb; 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 a640c23a62f3a-aa6261d4843si1297933966b.786.2024.12.13.09.44.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:44:57 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WlNpwxzb; 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 1tM9Xi-0007lU-0v; Fri, 13 Dec 2024 12:33:34 -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 1tM9XK-0007BO-Sn for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:12 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9XI-0001Zl-SX for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:10 -0500 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-38632b8ae71so1477163f8f.0 for ; Fri, 13 Dec 2024 09:33:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111186; x=1734715986; 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=K6tFM8RqNXAp8SOBzyhkiiQ54MPDAGBytFPbzLtpuXE=; b=WlNpwxzbpZjDU4AhOZS3f/+kcM24JD+DbCYvDGspPgHP4ORzfwRBTvWzPROnvxCvhu bXt04cg/yvXjxWBGny8cnscoe1psKpJM66PxiCjXEKjruoFth6QpBV7giWka/BIxRRxP dl2jO0LlrYraVBVsLk8J7uMCp2doMxl7R9Hch6IxS7KYj1dnrk9tYuUSIJSz1dEv66dd O5A1wXOGHPY4MNa9VRuu1V5BdKcVCGw0y5+EY8GlZ1UjWUvlgYyvwFm3LXIIzSsmnnSF dG5N5qAtrsKoE0yzuzlBzuQG6xqOYgv8jkGlbg4IRz7sqkA1LNw9xlzFRirx3fP2T/SK M5Xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111186; x=1734715986; 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=K6tFM8RqNXAp8SOBzyhkiiQ54MPDAGBytFPbzLtpuXE=; b=V6kz+7Dr7M8c3LCEyb84bGtfrgLLhK1xAzMRA4MWqMsoYh4mh2k9hOJ5P0Mm0sFMFJ Cw0pzHLduv9m+AGlRkcxDuvtpNA+m38JLFZvuUgeXkE3BS5pLpyFKPwFEMrofz0mzW5e 88o43/4HdwqD6ZxkFczJcwRGNf4YyAvnA9rpe+5VKSTv7oof0/VZ5aF/WnfNLwKvGXKS MqByaPABfjv1Lvps5+xeg5Aij8ZbCHz6dz6Q/MUCZKYeg4spTdPNQjKrxn4m8Dnf0Ev3 7NkEo9+JWy0mOs66VLDfQ/2GoWPXpX7/VrOXfD3UhTSpkI+Vogq0Jsu98Rk4GhHTA2VL 2Ejw== X-Gm-Message-State: AOJu0YwbQyNgJqWBEzQ1UAXYU1UO1YEQYDbt8Y3V1XPEqpG018oM2dPI Jk5kS48hbbk62xnKrvFBGaH6XIg4KOJ7vcdvqAGxhPLrFeAIvVcbaaZ1zwcFtxhtG2G4TLghP1g p X-Gm-Gg: ASbGnctkXt+Q8tF8HLF7VHFXJYa5LOZ3gCQgbpOAfMd3Q7q42EwpiACV7Zjgi0rL7Cs PVQCLhOvbRYymhdmzfu+lzA2NINUcF93yMJwVTdUATdn1p7ogr2FR9JZAhEX8OoZnxMI/FMdPbT 59tvsk9ydTtpSUOhxKidDOtiDZnBefkOyK8MPh3YVt8FV3fBau8wEMrkTGyhDS2xjQZ0wENBfGZ QGxlIU3tuOJ00JPCfKGazfx2dSUasTszDC8Ik7pYuGNZvXHCAYK/8a0T/wBtQ== X-Received: by 2002:a05:6000:4012:b0:385:ecdf:a30a with SMTP id ffacd0b85a97d-38880adb32cmr3273864f8f.33.1734111186486; Fri, 13 Dec 2024 09:33:06 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:05 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 33/85] target/arm: Convert FJCVTZS to decodetree Date: Fri, 13 Dec 2024 17:31:37 +0000 Message-Id: <20241213173229.3308926-34-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-34-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 2 ++ target/arm/tcg/translate-a64.c | 41 +++++++++++++++++----------------- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 5e170cec7a8..cd109616184 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -1363,6 +1363,8 @@ FCVTZU_g . 0011110 .. 111001 000000 ..... ..... @icvt FCVTAS_g . 0011110 .. 100100 000000 ..... ..... @icvt FCVTAU_g . 0011110 .. 100101 000000 ..... ..... @icvt +FJCVTZS 0 0011110 01 111110 000000 ..... ..... @rr + # Floating-point data processing (1 source) FMOV_s 00011110 .. 1 000000 10000 ..... ..... @rr_hsd diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 67227e26767..d260b45ddb2 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -8714,6 +8714,26 @@ TRANS(FCVTZU_g, do_fcvt_g, a, FPROUNDING_ZERO, false) TRANS(FCVTAS_g, do_fcvt_g, a, FPROUNDING_TIEAWAY, true) TRANS(FCVTAU_g, do_fcvt_g, a, FPROUNDING_TIEAWAY, false) +static bool trans_FJCVTZS(DisasContext *s, arg_FJCVTZS *a) +{ + if (!dc_isar_feature(aa64_jscvt, s)) { + return false; + } + if (fp_access_check(s)) { + TCGv_i64 t = read_fp_dreg(s, a->rn); + TCGv_ptr fpstatus = fpstatus_ptr(FPST_FPCR); + + gen_helper_fjcvtzs(t, t, fpstatus); + + tcg_gen_ext32u_i64(cpu_reg(s, a->rd), t); + tcg_gen_extrh_i64_i32(cpu_ZF, t); + tcg_gen_movi_i32(cpu_CF, 0); + tcg_gen_movi_i32(cpu_NF, 0); + tcg_gen_movi_i32(cpu_VF, 0); + } + return true; +} + static void handle_fmov(DisasContext *s, int rd, int rn, int type, bool itof) { /* FMOV: gpr to or from float, double, or top half of quad fp reg, @@ -8775,20 +8795,6 @@ static void handle_fmov(DisasContext *s, int rd, int rn, int type, bool itof) } } -static void handle_fjcvtzs(DisasContext *s, int rd, int rn) -{ - TCGv_i64 t = read_fp_dreg(s, rn); - TCGv_ptr fpstatus = fpstatus_ptr(FPST_FPCR); - - gen_helper_fjcvtzs(t, t, fpstatus); - - tcg_gen_ext32u_i64(cpu_reg(s, rd), t); - tcg_gen_extrh_i64_i32(cpu_ZF, t); - tcg_gen_movi_i32(cpu_CF, 0); - tcg_gen_movi_i32(cpu_NF, 0); - tcg_gen_movi_i32(cpu_VF, 0); -} - /* Floating point <-> integer conversions * 31 30 29 28 24 23 22 21 20 19 18 16 15 10 9 5 4 0 * +----+---+---+-----------+------+---+-------+-----+-------------+----+----+ @@ -8843,13 +8849,6 @@ static void disas_fp_int_conv(DisasContext *s, uint32_t insn) break; case 0b00111110: /* FJCVTZS */ - if (!dc_isar_feature(aa64_jscvt, s)) { - goto do_unallocated; - } else if (fp_access_check(s)) { - handle_fjcvtzs(s, rd, rn); - } - break; - default: do_unallocated: unallocated_encoding(s); From patchwork Fri Dec 13 17:31:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850167 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1640290wry; Fri, 13 Dec 2024 09:38:41 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW8i24SixK7/VV2FR2lDFZSM8I/APd8MVA1B4s39VjMK76MxT3lZNQHMVNoY0dtB2YEe0mlYA==@linaro.org X-Google-Smtp-Source: AGHT+IGYeFo6k7F71ecsqs7prXWjwBBcUVgvhBfkN18qyFQ+9DCskQSKJkidU5G+k6wuje0lcQoo X-Received: by 2002:a17:906:18a1:b0:aa6:50ee:d44c with SMTP id a640c23a62f3a-aab7b75deeamr279596366b.15.1734111521218; Fri, 13 Dec 2024 09:38:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111521; cv=none; d=google.com; s=arc-20240605; b=Wkm+OrCEjS4bWfRBycpt74ONBqbiOwRW0OpBQ7Uy+Zu1Yz4je7R47m11dbcIU14U1p xwWnB952NyDr71QQuHqX/iDiYwI3ASoKqML0+upc9N2nLhyKLiJxPp5HZ5UyD71j7xsw azMAc8YEjy7cCgAj5GI6uODZvuOEq5Zne3+OkrSeWfPFVWtmD579xNeOqGqo/5WsuS99 7qnDVX7z1zXwB5dROK4YTpdmNsqZl/ki5juZhkycyol6Qo5S5ituUhfkex/QKk+g8jhY wUbDY48pofb7ILQdpZCb+F7MEijdG2HO3fejBOUSkxdjJ0YErvUnmZtNVchUsx8CmJEI hG0Q== 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=LDPvY/4x2x/zg4XB6lWRJCId24qIA0dFyIRDjM2FUnk=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=huodJWFxSPEGUMkt8CtcfJX+OO8d2aQfxOYlivQvvy8fLoJT+R7MZ2WV50vscLkWus ywLCcUNOhr9V7rwIL+sop4V3xLC6fafAKTzG5DDahuLsRY9I5nY0eW7Yh+0y09KbUjBB WPfmRmXoFg3WgU5vNJVTG3cCY0IxwcnD+MMNmJR6gW6FwsmBWT1j+rR/d/6ytSbZyzKH Kp/yTdl6qAOrH9Sjh2sWHyfDvuK0xTLAELCgNLyQZEnFC3ayhBezuGTnTHTfSkAYlKHu Saq7ppCy/ITrMtwQEhI/EwUeb95sJyUFCj4NpQdNn1xjxyZJKvK7W461v3R8/sO72SKI aHww==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RkB7BeIF; 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 a640c23a62f3a-aa675d62b34si868252866b.225.2024.12.13.09.38.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:38:41 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RkB7BeIF; 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 1tM9Xc-0007S6-AX; Fri, 13 Dec 2024 12:33:28 -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 1tM9XM-0007BV-8T for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:14 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9XJ-0001aE-H4 for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:12 -0500 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-4361b6f9faeso12759075e9.1 for ; Fri, 13 Dec 2024 09:33:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111187; x=1734715987; 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=LDPvY/4x2x/zg4XB6lWRJCId24qIA0dFyIRDjM2FUnk=; b=RkB7BeIFWT3nAe3KhwMe+V8Wbsgzf7IAwxfT5GpMRjQyIqiR9FMy1aWeI5K3Svc9NZ 3ytACBbwyVc4shEB205s6v3eXjhGQRTAC7H+S8zV2daEfdPJ4lPK3sTA/Ea6xp4DUTyh cYqcceReOAK6H4Y7OfKrqZdp759yI3jTQz3KHHbzUHOS5Mwb13vSEye/3yXOASDNQJCs 5SbwiCMY+NhtE1CHapf1N5kWKSsKvakofvhziDCY+thx6bjjP8K7+NtmaY7Q+fZ990Sy Hd7wG1n+TaZWYCr5nQJ5A45B9QggYiFTY7Hm2BTUFKMadbtxNuS+ZLf3+t6kzED97+/H FmuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111187; x=1734715987; 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=LDPvY/4x2x/zg4XB6lWRJCId24qIA0dFyIRDjM2FUnk=; b=W8ksJPT2uTSHWW8CoNJ9ZFHL5xtqDPHdQZD0bTFnUg2uEzOzBP7ocdL1hWDYjurY3y LiDA+Yf+HpK4wleJDnMVzRSrGhTSkY2CWgoCzD18uMc+imZOzC6db6zm0B1x16wigBe8 Yn9T5nM0yjyZntEITH2rDr14Ysy6/6RY8gJJY25myPCHprlA0OqKAvS9+pbMHRizzLrT EXpvX9XT39AVzIefHNl03pxrH+F86UYdlp6w8nd4Dt/WAr7nD/0LXwHw5q6OrKRBeJ4I nYMXHj7prMu83WmtJCSt87z0jY6RWuz0P6b2j69H2MjAg6xSzVmvsrGWGqKKAZv9Dhix 57RA== X-Gm-Message-State: AOJu0YzLhOqLOLS5GhlCHLXCSGo/rO8etEg/itr44rEBJQhRCKgm/D+h 9jhCvX0wiXv8F6y044o0/OOsPsntNHbNspPj5bkUCntaakGm4iT5b0QXmTLbeeQ73v5r+QddcXB v X-Gm-Gg: ASbGnctEDgnSRc2qDd5RpLlLWvLZrGDOqS90VfRPkI+hYmgUzxExdaz96UCpjbE3hkJ fKTw6rE/iBk/+HAO4kPDUyXdE8bZMjLhnAq/v80Ub3CSMuxLFvR92mJH9wsdjeXzR1beo9h3/tm HezEo+jiqa/fB/CNEUAmhHRVY89YMKqmvMhjVM0yqCDoGEAQ1u/cpvVyi7fus6Yjf+zqbnbgH7w QkQnE67KFkPxubs/tnO8mqUDCtIXpTaLjZ145wMJykW1mDzeDS6eqRRffAfhg== X-Received: by 2002:a05:600c:c19:b0:434:e69c:d338 with SMTP id 5b1f17b1804b1-4362b10f875mr25451165e9.5.1734111187428; Fri, 13 Dec 2024 09:33:07 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:06 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 34/85] target/arm: Convert handle_fmov to decodetree Date: Fri, 13 Dec 2024 17:31:38 +0000 Message-Id: <20241213173229.3308926-35-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32b.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: Richard Henderson Remove disas_fp_int_conv and disas_data_proc_fp as these were the last insns decoded by those functions. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-35-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 14 ++ target/arm/tcg/translate-a64.c | 232 ++++++++++----------------------- 2 files changed, 86 insertions(+), 160 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index cd109616184..5b9f7caa7fb 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -1365,6 +1365,20 @@ FCVTAU_g . 0011110 .. 100101 000000 ..... ..... @icvt FJCVTZS 0 0011110 01 111110 000000 ..... ..... @rr +FMOV_ws 0 0011110 00 100110 000000 ..... ..... @rr +FMOV_sw 0 0011110 00 100111 000000 ..... ..... @rr + +FMOV_xd 1 0011110 01 100110 000000 ..... ..... @rr +FMOV_dx 1 0011110 01 100111 000000 ..... ..... @rr + +# Move to/from upper half of 128-bit +FMOV_xu 1 0011110 10 101110 000000 ..... ..... @rr +FMOV_ux 1 0011110 10 101111 000000 ..... ..... @rr + +# Half-precision allows both sf=0 and sf=1 with identical results +FMOV_xh - 0011110 11 100110 000000 ..... ..... @rr +FMOV_hx - 0011110 11 100111 000000 ..... ..... @rr + # Floating-point data processing (1 source) FMOV_s 00011110 .. 1 000000 10000 ..... ..... @rr_hsd diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index d260b45ddb2..95bb2b1ca9e 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -8734,175 +8734,87 @@ static bool trans_FJCVTZS(DisasContext *s, arg_FJCVTZS *a) return true; } -static void handle_fmov(DisasContext *s, int rd, int rn, int type, bool itof) +static bool trans_FMOV_hx(DisasContext *s, arg_rr *a) { - /* FMOV: gpr to or from float, double, or top half of quad fp reg, - * without conversion. - */ - - if (itof) { - TCGv_i64 tcg_rn = cpu_reg(s, rn); - TCGv_i64 tmp; - - switch (type) { - case 0: - /* 32 bit */ - tmp = tcg_temp_new_i64(); - tcg_gen_ext32u_i64(tmp, tcg_rn); - write_fp_dreg(s, rd, tmp); - break; - case 1: - /* 64 bit */ - write_fp_dreg(s, rd, tcg_rn); - break; - case 2: - /* 64 bit to top half. */ - tcg_gen_st_i64(tcg_rn, tcg_env, fp_reg_hi_offset(s, rd)); - clear_vec_high(s, true, rd); - break; - case 3: - /* 16 bit */ - tmp = tcg_temp_new_i64(); - tcg_gen_ext16u_i64(tmp, tcg_rn); - write_fp_dreg(s, rd, tmp); - break; - default: - g_assert_not_reached(); - } - } else { - TCGv_i64 tcg_rd = cpu_reg(s, rd); - - switch (type) { - case 0: - /* 32 bit */ - tcg_gen_ld32u_i64(tcg_rd, tcg_env, fp_reg_offset(s, rn, MO_32)); - break; - case 1: - /* 64 bit */ - tcg_gen_ld_i64(tcg_rd, tcg_env, fp_reg_offset(s, rn, MO_64)); - break; - case 2: - /* 64 bits from top half */ - tcg_gen_ld_i64(tcg_rd, tcg_env, fp_reg_hi_offset(s, rn)); - break; - case 3: - /* 16 bit */ - tcg_gen_ld16u_i64(tcg_rd, tcg_env, fp_reg_offset(s, rn, MO_16)); - break; - default: - g_assert_not_reached(); - } + if (!dc_isar_feature(aa64_fp16, s)) { + return false; } + if (fp_access_check(s)) { + TCGv_i64 tcg_rn = cpu_reg(s, a->rn); + TCGv_i64 tmp = tcg_temp_new_i64(); + tcg_gen_ext16u_i64(tmp, tcg_rn); + write_fp_dreg(s, a->rd, tmp); + } + return true; } -/* Floating point <-> integer conversions - * 31 30 29 28 24 23 22 21 20 19 18 16 15 10 9 5 4 0 - * +----+---+---+-----------+------+---+-------+-----+-------------+----+----+ - * | sf | 0 | S | 1 1 1 1 0 | type | 1 | rmode | opc | 0 0 0 0 0 0 | Rn | Rd | - * +----+---+---+-----------+------+---+-------+-----+-------------+----+----+ - */ -static void disas_fp_int_conv(DisasContext *s, uint32_t insn) +static bool trans_FMOV_sw(DisasContext *s, arg_rr *a) { - int rd = extract32(insn, 0, 5); - int rn = extract32(insn, 5, 5); - int opcode = extract32(insn, 16, 3); - int rmode = extract32(insn, 19, 2); - int type = extract32(insn, 22, 2); - bool sbit = extract32(insn, 29, 1); - bool sf = extract32(insn, 31, 1); - bool itof = false; - - if (sbit) { - goto do_unallocated; - } - - switch (opcode) { - case 2: /* SCVTF */ - case 3: /* UCVTF */ - case 4: /* FCVTAS */ - case 5: /* FCVTAU */ - case 0: /* FCVT[NPMZ]S */ - case 1: /* FCVT[NPMZ]U */ - goto do_unallocated; - - default: - switch (sf << 7 | type << 5 | rmode << 3 | opcode) { - case 0b01100110: /* FMOV half <-> 32-bit int */ - case 0b01100111: - case 0b11100110: /* FMOV half <-> 64-bit int */ - case 0b11100111: - if (!dc_isar_feature(aa64_fp16, s)) { - goto do_unallocated; - } - /* fallthru */ - case 0b00000110: /* FMOV 32-bit */ - case 0b00000111: - case 0b10100110: /* FMOV 64-bit */ - case 0b10100111: - case 0b11001110: /* FMOV top half of 128-bit */ - case 0b11001111: - if (!fp_access_check(s)) { - return; - } - itof = opcode & 1; - handle_fmov(s, rd, rn, type, itof); - break; - - case 0b00111110: /* FJCVTZS */ - default: - do_unallocated: - unallocated_encoding(s); - return; - } - break; + if (fp_access_check(s)) { + TCGv_i64 tcg_rn = cpu_reg(s, a->rn); + TCGv_i64 tmp = tcg_temp_new_i64(); + tcg_gen_ext32u_i64(tmp, tcg_rn); + write_fp_dreg(s, a->rd, tmp); } + return true; } -/* FP-specific subcases of table C3-6 (SIMD and FP data processing) - * 31 30 29 28 25 24 0 - * +---+---+---+---------+-----------------------------+ - * | | 0 | | 1 1 1 1 | | - * +---+---+---+---------+-----------------------------+ - */ -static void disas_data_proc_fp(DisasContext *s, uint32_t insn) +static bool trans_FMOV_dx(DisasContext *s, arg_rr *a) { - if (extract32(insn, 24, 1)) { - unallocated_encoding(s); /* in decodetree */ - } else if (extract32(insn, 21, 1) == 0) { - /* Floating point to fixed point conversions */ - unallocated_encoding(s); /* in decodetree */ - } else { - switch (extract32(insn, 10, 2)) { - case 1: /* Floating point conditional compare */ - case 2: /* Floating point data-processing (2 source) */ - case 3: /* Floating point conditional select */ - unallocated_encoding(s); /* in decodetree */ - break; - case 0: - switch (ctz32(extract32(insn, 12, 4))) { - case 0: /* [15:12] == xxx1 */ - /* Floating point immediate */ - unallocated_encoding(s); /* in decodetree */ - break; - case 1: /* [15:12] == xx10 */ - /* Floating point compare */ - unallocated_encoding(s); /* in decodetree */ - break; - case 2: /* [15:12] == x100 */ - /* Floating point data-processing (1 source) */ - unallocated_encoding(s); /* in decodetree */ - break; - case 3: /* [15:12] == 1000 */ - unallocated_encoding(s); - break; - default: /* [15:12] == 0000 */ - /* Floating point <-> integer conversions */ - disas_fp_int_conv(s, insn); - break; - } - break; - } + if (fp_access_check(s)) { + TCGv_i64 tcg_rn = cpu_reg(s, a->rn); + write_fp_dreg(s, a->rd, tcg_rn); } + return true; +} + +static bool trans_FMOV_ux(DisasContext *s, arg_rr *a) +{ + if (fp_access_check(s)) { + TCGv_i64 tcg_rn = cpu_reg(s, a->rn); + tcg_gen_st_i64(tcg_rn, tcg_env, fp_reg_hi_offset(s, a->rd)); + clear_vec_high(s, true, a->rd); + } + return true; +} + +static bool trans_FMOV_xh(DisasContext *s, arg_rr *a) +{ + if (!dc_isar_feature(aa64_fp16, s)) { + return false; + } + if (fp_access_check(s)) { + TCGv_i64 tcg_rd = cpu_reg(s, a->rd); + tcg_gen_ld16u_i64(tcg_rd, tcg_env, fp_reg_offset(s, a->rn, MO_16)); + } + return true; +} + +static bool trans_FMOV_ws(DisasContext *s, arg_rr *a) +{ + if (fp_access_check(s)) { + TCGv_i64 tcg_rd = cpu_reg(s, a->rd); + tcg_gen_ld32u_i64(tcg_rd, tcg_env, fp_reg_offset(s, a->rn, MO_32)); + } + return true; +} + +static bool trans_FMOV_xd(DisasContext *s, arg_rr *a) +{ + if (fp_access_check(s)) { + TCGv_i64 tcg_rd = cpu_reg(s, a->rd); + tcg_gen_ld_i64(tcg_rd, tcg_env, fp_reg_offset(s, a->rn, MO_64)); + } + return true; +} + +static bool trans_FMOV_xu(DisasContext *s, arg_rr *a) +{ + if (fp_access_check(s)) { + TCGv_i64 tcg_rd = cpu_reg(s, a->rd); + tcg_gen_ld_i64(tcg_rd, tcg_env, fp_reg_hi_offset(s, a->rn)); + } + return true; } /* Common vector code for handling integer to FP conversion */ @@ -10821,7 +10733,7 @@ static void disas_data_proc_simd(DisasContext *s, uint32_t insn) static void disas_data_proc_simd_fp(DisasContext *s, uint32_t insn) { if (extract32(insn, 28, 1) == 1 && extract32(insn, 30, 1) == 0) { - disas_data_proc_fp(s, insn); + unallocated_encoding(s); /* in decodetree */ } else { /* SIMD, including crypto */ disas_data_proc_simd(s, insn); From patchwork Fri Dec 13 17:31:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850155 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1639627wry; Fri, 13 Dec 2024 09:37:21 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWVrLO7KGWJDuI6GM7xrvteLaBDfdi+mhehimWTVDbN1ZNrbjcfR4AOdzTP6PT6jdXl2BqPsQ==@linaro.org X-Google-Smtp-Source: AGHT+IHEiRwsYa+78nRwVyYFBZBTKLapYVAfUGnoQ2Q9Z5Dm+dnP4RnMwiZE00aZkOXzkj2mA/FE X-Received: by 2002:a05:600c:511c:b0:434:fbda:1f36 with SMTP id 5b1f17b1804b1-4362aaa9cb5mr26940525e9.20.1734111441005; Fri, 13 Dec 2024 09:37:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111440; cv=none; d=google.com; s=arc-20240605; b=DZ05JSzTUMAVLn8GEg2faW+EusajDPxltoSUalaQ5p0wkszX+w0oNWUJSJsTX80+b0 VNjmVt+KHTrCFoFLw7SObEgt1IulCCa9GxTdoXhNDaDYHlqLcaNL/8+bm62FrmnMTtB2 eUlltWdV4NxkLBZtIxDbK4KlRYHtuD5d6yM6OoILty4KlUmPKXDBRNctq/QZWMFs4KQH 9Lz9DtU76Gt2/cVjiFCDL5a+PoLosS5OGlO5pPadbOs4nYk/aOhbe37S9TzD8PyR4Ulz zaOt59R86koIp1zHn6a5LFYdURtOdvl7UQtiw6cjpZi+uznxmfF82V+GGxYpeqj34/gW EnLg== 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=DCQB6BPKkO4wRdcs1RI2PINATLxFcMWBk80QRmMqCso=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=BGbhWbtj6+XOXxoJoyXufO8QBG+VC769WQdRM+veupB35QCVeTnGivCdBkMN3Mb6s0 OSgFRsFiXqHsijyU3tOoHBSuYGjDw2PbYNt0Eu9QUQfJP7n8CEWwkQHYT40i2i9FXBu5 g0ZSLnJ+eyEJGON3qEk8HlsyQr7XMO2fEzUCVGJ+P8WxJxth97yEZkiCSVj+w9sks/7n q4hyqFKlnMcwqWP/r8qAXBVc4X/WYZgO4IXyyHB0euredl5bMwtlcrOOpRixC9czUusO rLTsxWYezCQNWX0k3CV8yFFeWR3qXUxLcclnSiiFvOEct+YkBnQq+JPZGnTCSFGGGjnQ D+9A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KEk9W75V; 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 5b1f17b1804b1-4362580fa73si22825895e9.189.2024.12.13.09.37.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:37: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=KEk9W75V; 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 1tM9Xe-0007cR-OG; Fri, 13 Dec 2024 12:33:30 -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 1tM9XM-0007BZ-H9 for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:14 -0500 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9XK-0001aa-4O for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:12 -0500 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-385d7f19f20so992517f8f.1 for ; Fri, 13 Dec 2024 09:33:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111188; x=1734715988; 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=DCQB6BPKkO4wRdcs1RI2PINATLxFcMWBk80QRmMqCso=; b=KEk9W75VUmiHvKsTggRZ2Fcyj0wRy2j2hrKAZhP0eiT7qnq/IboaUiEf672i2oUfbQ FTS5um1W5AecWRy8teKIlbf+soeTMBO+zNsgX7uQANB++0NJ5kztGPxQEcAJ0LpvEPTQ Ai+A/4IjWP/O5C54D572iPdH5sfJ8TW1ShkggRcQCoZVaoyaPR+X7pED0erij5RBLNnf zwkYCpbTnOhuAu2JYzjgE9ebvFgGC+WdR/CRHKktITtGAV+CCIc1fs00xvEAK4rfXkOX Bx0p/1mD71TUmUKm1b3qSFK/axBoVmAJ2T9r0KNOQZ9wU/swX1h7EX60p9kVT1qtX1ms 08qQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111188; x=1734715988; 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=DCQB6BPKkO4wRdcs1RI2PINATLxFcMWBk80QRmMqCso=; b=JMoGdiAwgd0PVcq70utyZtMhgGqgbBfjBAGmfkrYBeHRcQCXd9kVhyPFA5ejw8kyVT GgWbrS6s0W2mWGesKMSGk9ng1RQp4zFf9uXcEdEzH6wj/ACFxukNcZ2OSLxNqTuHMpA8 xz1/HDhmq4REEgiuIxKvpaP4z/tZe4YE4AuS/YU590mlWvB7FEP54/O+P0mLP9QYNY4m XZblEpnZciX+I4YPySYW27NRBoulonX5uYVB912tFJooePThYmmVyToefu5KM2MpGYOU T2RGW3Zu1HslKro0t8fl2O31zIuoAUzOsD2gBRwM3Pe7+5XJvpPqNwK4P6OtjpgjyB4O oAUw== X-Gm-Message-State: AOJu0Yw5rJVW82StjT0gO4DjTPry28hvfeJYCeea9eP0NWGUknLSxCv/ f0HbGppck1q7xluqgFtBiTA5kUhmHaGB25bFMimWbNor/pAUQFW3Gv8hZwEvTI0w4e8NNHVpYuB G X-Gm-Gg: ASbGncscIbrs3jAe8ofvQm4UzCF+3wVUVFy4vkLAepZPkCrO9xLCHKcied6nWggOcKZ z/cuFBPY3LPTRjhLBgXbJc2fzhdh+hQVBmQzSISOBRDuic16mZAqI3NI8frdyqaOd7tG1Z52Avs s0u3bo7HPDc4G79CKcfZaOV8jVTRY0eq80c3gy3KSJjc3OinceZPl3TBa2yBbCX+aq/rGC+grls w54+rIZg/mte8XwKNnPlQsXMKE59ynk4sP82i46kMElnuNnVJDj7wMXn2dlNQ== X-Received: by 2002:a05:6000:791:b0:385:f44a:a64 with SMTP id ffacd0b85a97d-38880ad1d01mr3044083f8f.24.1734111188366; Fri, 13 Dec 2024 09:33:08 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:07 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 35/85] target/arm: Convert SQABS, SQNEG to decodetree Date: Fri, 13 Dec 2024 17:31:39 +0000 Message-Id: <20241213173229.3308926-36-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x431.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-36-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 11 +++ target/arm/tcg/translate-a64.c | 123 +++++++++++++++++++++------------ 2 files changed, 89 insertions(+), 45 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 5b9f7caa7fb..17ecdac9dbd 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -47,6 +47,7 @@ @rr_h ........ ... ..... ...... rn:5 rd:5 &rr_e esz=1 @rr_s ........ ... ..... ...... rn:5 rd:5 &rr_e esz=2 @rr_d ........ ... ..... ...... rn:5 rd:5 &rr_e esz=3 +@rr_e ........ esz:2 . ..... ...... rn:5 rd:5 &rr_e @rr_sd ........ ... ..... ...... rn:5 rd:5 &rr_e esz=%esz_sd @rr_hsd ........ ... ..... ...... rn:5 rd:5 &rr_e esz=%esz_hsd @@ -1626,3 +1627,13 @@ UQRSHRN_si 0111 11110 .... ... 10011 1 ..... ..... @shri_s SQRSHRUN_si 0111 11110 .... ... 10001 1 ..... ..... @shri_b SQRSHRUN_si 0111 11110 .... ... 10001 1 ..... ..... @shri_h SQRSHRUN_si 0111 11110 .... ... 10001 1 ..... ..... @shri_s + +# Advanced SIMD scalar two-register miscellaneous + +SQABS_s 0101 1110 ..1 00000 01111 0 ..... ..... @rr_e +SQNEG_s 0111 1110 ..1 00000 01111 0 ..... ..... @rr_e + +# Advanced SIMD two-register miscellaneous + +SQABS_v 0.00 1110 ..1 00000 01111 0 ..... ..... @qrr_e +SQNEG_v 0.10 1110 ..1 00000 01111 0 ..... ..... @qrr_e diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 95bb2b1ca9e..9bb9668d111 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -8817,6 +8817,78 @@ static bool trans_FMOV_xu(DisasContext *s, arg_rr *a) return true; } +typedef struct ENVScalar1 { + NeonGenOneOpEnvFn *gen_bhs[3]; + NeonGenOne64OpEnvFn *gen_d; +} ENVScalar1; + +static bool do_env_scalar1(DisasContext *s, arg_rr_e *a, const ENVScalar1 *f) +{ + if (!fp_access_check(s)) { + return true; + } + if (a->esz == MO_64) { + TCGv_i64 t = read_fp_dreg(s, a->rn); + f->gen_d(t, tcg_env, t); + write_fp_dreg(s, a->rd, t); + } else { + TCGv_i32 t = tcg_temp_new_i32(); + + read_vec_element_i32(s, t, a->rn, 0, a->esz); + f->gen_bhs[a->esz](t, tcg_env, t); + write_fp_sreg(s, a->rd, t); + } + return true; +} + +static bool do_env_vector1(DisasContext *s, arg_qrr_e *a, const ENVScalar1 *f) +{ + if (a->esz == MO_64 && !a->q) { + return false; + } + if (!fp_access_check(s)) { + return true; + } + if (a->esz == MO_64) { + TCGv_i64 t = tcg_temp_new_i64(); + + for (int i = 0; i < 2; ++i) { + read_vec_element(s, t, a->rn, i, MO_64); + f->gen_d(t, tcg_env, t); + write_vec_element(s, t, a->rd, i, MO_64); + } + } else { + TCGv_i32 t = tcg_temp_new_i32(); + int n = (a->q ? 16 : 8) >> a->esz; + + for (int i = 0; i < n; ++i) { + read_vec_element_i32(s, t, a->rn, i, a->esz); + f->gen_bhs[a->esz](t, tcg_env, t); + write_vec_element_i32(s, t, a->rd, i, a->esz); + } + } + clear_vec_high(s, a->q, a->rd); + return true; +} + +static const ENVScalar1 f_scalar_sqabs = { + { gen_helper_neon_qabs_s8, + gen_helper_neon_qabs_s16, + gen_helper_neon_qabs_s32 }, + gen_helper_neon_qabs_s64, +}; +TRANS(SQABS_s, do_env_scalar1, a, &f_scalar_sqabs) +TRANS(SQABS_v, do_env_vector1, a, &f_scalar_sqabs) + +static const ENVScalar1 f_scalar_sqneg = { + { gen_helper_neon_qneg_s8, + gen_helper_neon_qneg_s16, + gen_helper_neon_qneg_s32 }, + gen_helper_neon_qneg_s64, +}; +TRANS(SQNEG_s, do_env_scalar1, a, &f_scalar_sqneg) +TRANS(SQNEG_v, do_env_vector1, a, &f_scalar_sqneg) + /* Common vector code for handling integer to FP conversion */ static void handle_simd_intfp_conv(DisasContext *s, int rd, int rn, int elements, int is_signed, @@ -9129,13 +9201,6 @@ static void handle_2misc_64(DisasContext *s, int opcode, bool u, */ tcg_gen_not_i64(tcg_rd, tcg_rn); break; - case 0x7: /* SQABS, SQNEG */ - if (u) { - gen_helper_neon_qneg_s64(tcg_rd, tcg_env, tcg_rn); - } else { - gen_helper_neon_qabs_s64(tcg_rd, tcg_env, tcg_rn); - } - break; case 0xa: /* CMLT */ cond = TCG_COND_LT; do_cmop: @@ -9198,6 +9263,7 @@ static void handle_2misc_64(DisasContext *s, int opcode, bool u, gen_helper_frint64_d(tcg_rd, tcg_rn, tcg_fpstatus); break; default: + case 0x7: /* SQABS, SQNEG */ g_assert_not_reached(); } } @@ -9540,8 +9606,6 @@ static void disas_simd_scalar_two_reg_misc(DisasContext *s, uint32_t insn) TCGv_ptr tcg_fpstatus; switch (opcode) { - case 0x7: /* SQABS / SQNEG */ - break; case 0xa: /* CMLT */ if (u) { unallocated_encoding(s); @@ -9640,6 +9704,7 @@ static void disas_simd_scalar_two_reg_misc(DisasContext *s, uint32_t insn) break; default: case 0x3: /* USQADD / SUQADD */ + case 0x7: /* SQABS / SQNEG */ unallocated_encoding(s); return; } @@ -9669,18 +9734,6 @@ static void disas_simd_scalar_two_reg_misc(DisasContext *s, uint32_t insn) read_vec_element_i32(s, tcg_rn, rn, 0, size); switch (opcode) { - case 0x7: /* SQABS, SQNEG */ - { - NeonGenOneOpEnvFn *genfn; - static NeonGenOneOpEnvFn * const fns[3][2] = { - { gen_helper_neon_qabs_s8, gen_helper_neon_qneg_s8 }, - { gen_helper_neon_qabs_s16, gen_helper_neon_qneg_s16 }, - { gen_helper_neon_qabs_s32, gen_helper_neon_qneg_s32 }, - }; - genfn = fns[size][u]; - genfn(tcg_rd, tcg_env, tcg_rn); - break; - } case 0x1a: /* FCVTNS */ case 0x1b: /* FCVTMS */ case 0x1c: /* FCVTAS */ @@ -9698,6 +9751,7 @@ static void disas_simd_scalar_two_reg_misc(DisasContext *s, uint32_t insn) tcg_fpstatus); break; default: + case 0x7: /* SQABS, SQNEG */ g_assert_not_reached(); } @@ -10055,12 +10109,6 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) return; } break; - case 0x7: /* SQABS, SQNEG */ - if (size == 3 && !is_q) { - unallocated_encoding(s); - return; - } - break; case 0xc ... 0xf: case 0x16 ... 0x1f: { @@ -10231,6 +10279,7 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) } default: case 0x3: /* SUQADD, USQADD */ + case 0x7: /* SQABS, SQNEG */ unallocated_encoding(s); return; } @@ -10321,13 +10370,6 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) tcg_gen_clrsb_i32(tcg_res, tcg_op); } break; - case 0x7: /* SQABS, SQNEG */ - if (u) { - gen_helper_neon_qneg_s32(tcg_res, tcg_env, tcg_op); - } else { - gen_helper_neon_qabs_s32(tcg_res, tcg_env, tcg_op); - } - break; case 0x2f: /* FABS */ gen_vfp_abss(tcg_res, tcg_op); break; @@ -10376,6 +10418,7 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) gen_helper_frint64_s(tcg_res, tcg_op, tcg_fpstatus); break; default: + case 0x7: /* SQABS, SQNEG */ g_assert_not_reached(); } } else { @@ -10391,17 +10434,6 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) gen_helper_neon_cnt_u8(tcg_res, tcg_op); } break; - case 0x7: /* SQABS, SQNEG */ - { - NeonGenOneOpEnvFn *genfn; - static NeonGenOneOpEnvFn * const fns[2][2] = { - { gen_helper_neon_qabs_s8, gen_helper_neon_qneg_s8 }, - { gen_helper_neon_qabs_s16, gen_helper_neon_qneg_s16 }, - }; - genfn = fns[size][u]; - genfn(tcg_res, tcg_env, tcg_op); - break; - } case 0x4: /* CLS, CLZ */ if (u) { if (size == 0) { @@ -10418,6 +10450,7 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) } break; default: + case 0x7: /* SQABS, SQNEG */ g_assert_not_reached(); } } From patchwork Fri Dec 13 17:31:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850163 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1639983wry; Fri, 13 Dec 2024 09:37:59 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXvUYECBAPKokQ8l+aGxdCX+xbeypBcURFW7LsmAY4N3RHi7gnL34nvjxkCB4iWSswgNRWK6Q==@linaro.org X-Google-Smtp-Source: AGHT+IHMr6YyA8/EBEe4lQPUCT66L2EZv8Nww7YaDSUS1hoMzwPNKaJZoArhvYpdmSTymIH4YBKR X-Received: by 2002:a17:907:720a:b0:aa6:7933:8b33 with SMTP id a640c23a62f3a-aab7795c732mr448284066b.15.1734111479427; Fri, 13 Dec 2024 09:37:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111479; cv=none; d=google.com; s=arc-20240605; b=YVm5riQ0Gbej1JasdWM5S55i6sUcrJCmQmjv2yaalCpWiEqR2Jn8fNaB8Ps6s7fJxO q/J8C8TYUyF7mzYnUDQ0IL/wZHC2LC8bn/BzZGwcXWFIvGAsAu7Lpmxj3Vt4pX3AwXEd V5deCN0jvkhGWor2wIXWbP3fOnbtoEtPWNgbCTNlwGEyVDXMyku4e71Jdtip/ZzSkC1f zrd8ZasrlCOwATipUXdyA8LooZKjc8g46pgWLPVwR7kWWr5HjFl3b3OB6mQmpaVUNE+E JdEpLU7hS0Nrn/2T6hCBgbWje8mG3rwttFcYSwV+0PHK7Guy/H7r3IlVsFklQ9QsfyHH glgQ== 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=vJNrCZs7jygffNDcKOHYLnUHgBAtLYIR4zuUaLi1yJo=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=i36IH1oXYkGcvQwdVFI8C13yzLmiYYIS5en2whoS3Zyv3YkkFUzrC1JlshM9HfeVlq UTK42s3nqXKjPlxmica3N//+3XM7rhaDPtHcLsVfOhieamy1+mjbpLndt/Zx/MggqOwt ImYyJ5WrwWhMt4aDooA8CEeCT8/lhfBtXOrAKUkI9/wCI8Pxl7h+Ew8sSy0rL4L0BHWM W0vkm73QPmXjOv9eMKy1dq9kPzqvMMEENn/NPf3/QhaN5A9G+QexK684mkZ3QTxBoCtC elGn2mLugT2b9nhl+A1poQhgehwcnQUyNmD+IPwOQkUWsMa/4QVw5Sw0apfnFa/+mkFx YeBg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="YkKBjBF/"; 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 a640c23a62f3a-aa69aaa0bf4si698482966b.911.2024.12.13.09.37.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:37:59 -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="YkKBjBF/"; 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 1tM9Xd-0007Yx-P5; Fri, 13 Dec 2024 12:33:29 -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 1tM9XN-0007Bv-Mw for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:14 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9XK-0001ao-SO for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:13 -0500 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-436249df846so14435345e9.3 for ; Fri, 13 Dec 2024 09:33:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111189; x=1734715989; 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=vJNrCZs7jygffNDcKOHYLnUHgBAtLYIR4zuUaLi1yJo=; b=YkKBjBF/lYrh29SvUvvzjQQlOAXJPO3a5ruuCFtZLi1GM5V03OV+lHZxQm/8JlrjKg VAaL1KgojS2KYvuRSN3LBWVvblwFUIx5jbg4TtvQvckAxAeegRA7qbq97tncMj4lQY7m sL1LqzixBMiE7FzUVBtLctEKeiiYlFnBhkSWNCxLp7DYWJf8vwgueTOgI7fIMflWLjAB D2F67r19p0XB+CzGhvWyEkNh17AUX2sBy/Gm76SMwGhNW/Bn9TImQqU/p4FQO1VY1LOL h71wjINF6M5K8aQwLHjYSAXvOUdkgo6rpa7PXVdSjI1ltmBm1tJq5FBfR0TI3A46StHQ oP+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111189; x=1734715989; 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=vJNrCZs7jygffNDcKOHYLnUHgBAtLYIR4zuUaLi1yJo=; b=w6dglel0kXgFC8fWM8P7iQLt2DBbKLRa9Tufmo5OpXhLdPPhGcgbsg3pqySuhNLU0W XRo6orIWCYpBFpaivfP4bkyjfMuF1WhLw1pcWBqt1I+Rk9P8AxPyFJmPseOwUJRuPYwJ 8zSHvToULYX9nx4jrjrCegk81iWZGhL59kKJL1Tz+Estl7A2SnfaQJ/hY1gL9QVmqQdU 1jhPe0RWAPj1IKYS1B/+GkBaMZR3rjZBMAk/GdRlxjKE9dkZ2flHhxqAiXHvT1Vv/zvb khGYsYgslLfugWiOsp0A3lSZ9ESP/GvfIQXcwg6AZsE0PIgy6p1qgp1rxN+TllRvRoQS gNAA== X-Gm-Message-State: AOJu0Yy1TfJTU6sUGDqOgtt0D1G3prNCgwGCViWMJjCXk9NYHxyuK80z iQFe9LPuQAcp87FvrWOGr+VMYikliMRqYbTDHBmiRstVGxO/czF6VS0juX1XyJ8s5gWPD+9tLws N X-Gm-Gg: ASbGncs57c/wZCmnU1kJJQraIEGC3iSEbkk3B9Cn5voVkrs2OlBPA0inf5GQ+mxCTv8 iJ4Yn5BDH6qfT8I0Bd5JvLgNn9kO7PCilp6oLuxm9ucNfYhYTMx7R1dS/37B3Usrb5kruoxORb8 Z3z8X3tppVCsUjXlC6vKkZXXt2Lx4rc7NdKEZn5wdvr6yQnsrkz7RgC7n3pC5EQsAfJHCLycb4R kYKrhlku4f6Oit+PA78bRVTDFdMCPOSENSHD0Y3wP1pRutH8pdCfvPc7iC20g== X-Received: by 2002:a05:6000:79e:b0:385:dfab:1644 with SMTP id ffacd0b85a97d-38880ae238amr3246521f8f.33.1734111189407; Fri, 13 Dec 2024 09:33:09 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:08 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 36/85] target/arm: Convert ABS, NEG to decodetree Date: Fri, 13 Dec 2024 17:31:40 +0000 Message-Id: <20241213173229.3308926-37-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x329.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: Richard Henderson Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-37-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 4 +++ target/arm/tcg/translate-a64.c | 46 +++++++++++++++++++++++----------- 2 files changed, 35 insertions(+), 15 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 17ecdac9dbd..f112951df72 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -1632,8 +1632,12 @@ SQRSHRUN_si 0111 11110 .... ... 10001 1 ..... ..... @shri_s SQABS_s 0101 1110 ..1 00000 01111 0 ..... ..... @rr_e SQNEG_s 0111 1110 ..1 00000 01111 0 ..... ..... @rr_e +ABS_s 0101 1110 111 00000 10111 0 ..... ..... @rr +NEG_s 0111 1110 111 00000 10111 0 ..... ..... @rr # Advanced SIMD two-register miscellaneous SQABS_v 0.00 1110 ..1 00000 01111 0 ..... ..... @qrr_e SQNEG_v 0.10 1110 ..1 00000 01111 0 ..... ..... @qrr_e +ABS_v 0.00 1110 ..1 00000 10111 0 ..... ..... @qrr_e +NEG_v 0.10 1110 ..1 00000 10111 0 ..... ..... @qrr_e diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 9bb9668d111..c697f0e9441 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -8889,6 +8889,33 @@ static const ENVScalar1 f_scalar_sqneg = { TRANS(SQNEG_s, do_env_scalar1, a, &f_scalar_sqneg) TRANS(SQNEG_v, do_env_vector1, a, &f_scalar_sqneg) +static bool do_scalar1_d(DisasContext *s, arg_rr *a, ArithOneOp *f) +{ + if (fp_access_check(s)) { + TCGv_i64 t = read_fp_dreg(s, a->rn); + f(t, t); + write_fp_dreg(s, a->rd, t); + } + return true; +} + +TRANS(ABS_s, do_scalar1_d, a, tcg_gen_abs_i64) +TRANS(NEG_s, do_scalar1_d, a, tcg_gen_neg_i64) + +static bool do_gvec_fn2(DisasContext *s, arg_qrr_e *a, GVecGen2Fn *fn) +{ + if (!a->q && a->esz == MO_64) { + return false; + } + if (fp_access_check(s)) { + gen_gvec_fn2(s, a->q, a->rd, a->rn, fn, a->esz); + } + return true; +} + +TRANS(ABS_v, do_gvec_fn2, a, tcg_gen_gvec_abs) +TRANS(NEG_v, do_gvec_fn2, a, tcg_gen_gvec_neg) + /* Common vector code for handling integer to FP conversion */ static void handle_simd_intfp_conv(DisasContext *s, int rd, int rn, int elements, int is_signed, @@ -9213,13 +9240,6 @@ static void handle_2misc_64(DisasContext *s, int opcode, bool u, case 0x9: /* CMEQ, CMLE */ cond = u ? TCG_COND_LE : TCG_COND_EQ; goto do_cmop; - case 0xb: /* ABS, NEG */ - if (u) { - tcg_gen_neg_i64(tcg_rd, tcg_rn); - } else { - tcg_gen_abs_i64(tcg_rd, tcg_rn); - } - break; case 0x2f: /* FABS */ gen_vfp_absd(tcg_rd, tcg_rn); break; @@ -9264,6 +9284,7 @@ static void handle_2misc_64(DisasContext *s, int opcode, bool u, break; default: case 0x7: /* SQABS, SQNEG */ + case 0xb: /* ABS, NEG */ g_assert_not_reached(); } } @@ -9614,7 +9635,6 @@ static void disas_simd_scalar_two_reg_misc(DisasContext *s, uint32_t insn) /* fall through */ case 0x8: /* CMGT, CMGE */ case 0x9: /* CMEQ, CMLE */ - case 0xb: /* ABS, NEG */ if (size != 3) { unallocated_encoding(s); return; @@ -9705,6 +9725,7 @@ static void disas_simd_scalar_two_reg_misc(DisasContext *s, uint32_t insn) default: case 0x3: /* USQADD / SUQADD */ case 0x7: /* SQABS / SQNEG */ + case 0xb: /* ABS, NEG */ unallocated_encoding(s); return; } @@ -10103,7 +10124,6 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) /* fall through */ case 0x8: /* CMGT, CMGE */ case 0x9: /* CMEQ, CMLE */ - case 0xb: /* ABS, NEG */ if (size == 3 && !is_q) { unallocated_encoding(s); return; @@ -10280,6 +10300,7 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) default: case 0x3: /* SUQADD, USQADD */ case 0x7: /* SQABS, SQNEG */ + case 0xb: /* ABS, NEG */ unallocated_encoding(s); return; } @@ -10324,12 +10345,7 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) gen_gvec_fn2(s, is_q, rd, rn, gen_gvec_clt0, size); return; case 0xb: - if (u) { /* ABS, NEG */ - gen_gvec_fn2(s, is_q, rd, rn, tcg_gen_gvec_neg, size); - } else { - gen_gvec_fn2(s, is_q, rd, rn, tcg_gen_gvec_abs, size); - } - return; + g_assert_not_reached(); } if (size == 3) { From patchwork Fri Dec 13 17:31:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850165 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1640252wry; Fri, 13 Dec 2024 09:38:33 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCX++QPY6BBn2T5CtL/wdgnk1zyi1sx6Ujr6zQ06nz+kk26ZZe8TaL/xC+4LD7HZ2sp6YuHA4w==@linaro.org X-Google-Smtp-Source: AGHT+IGCrKrT6s7XsGE7E0V2vgP41Ub2rNTMgx+M7MmpRHWEr0Q7oLFoc7O+sl6GPWYMx6d2sVDM X-Received: by 2002:a05:600c:3d15:b0:434:a1d3:a321 with SMTP id 5b1f17b1804b1-4362aa1b06cmr40426935e9.3.1734111513551; Fri, 13 Dec 2024 09:38:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111513; cv=none; d=google.com; s=arc-20240605; b=Wy12XPmv50y8nCFHsqKMcjux7Xil3bft1JgFRqPvYr8FV337bgspCSILPsu0EBPUIp SBTT2TPE4LkikB5DEHtbzOpmYN2mX2ZzM9aJsLKySKFV2gMB/eeJ2Wr6bjP0iBDyubmo 6nuKuUNHTX7JxTVx5qFr/fLPq1LJmegSY/4hm4tOZV+7v4MGCt7SY+b0ZvYKAvmGZfkM EgLTPVwFW5XnyqogsX8jfa/WXhxLtJ8JimYUuNSKWAm6EHJu4CxK/QAEqd57GabjGzct Kh/mHw1Q1Wf1GSD5GoP0P+EFbN2WKskx/hMbLnNZWObwD+2yAo6bjiMuAH42LKFV952Z BpUA== 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=vwJE9b7WCZuCYFg4jHXixdsKsYlZPKs8bvwJbKgKnCE=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=IGv4Y3D4fG1uEVJEKlbitauaAZwK04XAw6WE4fX/9XQWjFZ29Z0acE4CDRVpeNYJ8M eUQE+JbRPpMSUbrG5oFCeLLNiC5EJIgxjGU7rL9v2bRc/LUYhjf5FGCZBA+WzUhzDLY6 kdQxddJ38NUtkl0eaTWqyHxz9kkwm+bjaXet1UcBPXr0Fd26FcOcekpgYJL43IVE+siJ 0SaQ6STykjokUJ5tBaccFBuG6ieKY2PlooKHHPwjyNjUC2hbHnO+oPXeUD5OLSFSeevM yO02aP72/QBOoVoKWQfXTl55dYf+aLnuA0/NdjxMS2F9G61fUjwqQ/pTYR6qgxDrL95U eT/A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UHVBy5s9; 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 5b1f17b1804b1-43625557f54si22948265e9.45.2024.12.13.09.38.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:38:33 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UHVBy5s9; 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 1tM9Y6-0008Mx-92; Fri, 13 Dec 2024 12:33:58 -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 1tM9XO-0007Bx-5m for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:14 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9XM-0001b2-E0 for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:13 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-435004228c0so24462055e9.0 for ; Fri, 13 Dec 2024 09:33:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111191; x=1734715991; 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=vwJE9b7WCZuCYFg4jHXixdsKsYlZPKs8bvwJbKgKnCE=; b=UHVBy5s9pMlQf+pjAxtzotgLA7P095ps3Yym8HrNkktACImatr0Fn+3g22PD7zhUp6 lYxML4eu5kAiBr7EQSSSqZOALZDtKSevGgaufCSUG80+btrLFpLa2eOFkjatJsOzvtkN W8vVMbeXqW/ydJeOHWrmH5QVn6fyQgoWstI8sKOuDdTFCExKyegY3xO8mlIrVHQYupxo 1ne4waWi7lSt/ilPZivAGn6HaATPWZDeI9yYZ15sMX1TLxfcdSgpKUVS6VSCFpFNvlyL PNtV53sZaq4DXr4/MAtWixCz5LtNMRTloErUGXa9DrugmtqEn2DcH+zWNIMUCuBwZDnr jWaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111191; x=1734715991; 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=vwJE9b7WCZuCYFg4jHXixdsKsYlZPKs8bvwJbKgKnCE=; b=LuA9SpcS4Qj1XXiWysaNboCxLABeUgElBJXXvPmGhVH25FmIymjdkQJZwzePXDDyQw ETO9z+e/iU53AhilAsiNWAxi3815UFp6+pQemgUbKk9edBbaiJMYGMoECEt6q7uuuj56 F6WeovKZXdmYqUbb914wijup0owiCMmU6z4N4MHHm0xI+YhUfvf4XFB9jYspRTJS+TZf 7tjWaNDbsGGWQGRISdNQjB8DKEqubzkOXLoFvwfuaIeDjNnF3TutLsDr1jsxJUeKanm6 fKBF4L5H/nKtANZrgAnchrbBt/vevxKbuNwMuDTscJC3MPDO867oCe217FZC81gB1Lst +ouQ== X-Gm-Message-State: AOJu0YzPF+xYH5lYaoMGSkFtqm8iUpjBqJzt7XZe+6N7P1d0PAxN7P4s JPxUVJwWUSOtsIukdCI4E64SrqXbA4uIjDLXTlVUQHj9P5zle50NXhHvLISqeJFEUpVVY0Ti9PH w X-Gm-Gg: ASbGncv6JTczdq/pvew9sFNxd1lliE/KV7tu5QDLY8DakVYLEmEW4kEs7pTGQvpO09G HB8Y4co2SBdsn8CwdZFDnRFLDWIRww8W2X40A1cUbMaPVVyc5ccivYvUBvJr145GmwWoAHUo+Lx GEacZQ+BEHyHhDTUz1NoSgw/lSJCVqfomaoDHP2cFRznmwE2sXa+Bqm+kInnEARFMC2T0RY4pp9 wYeTZx3HVI4jmncKFxL/1bE1l0DpdL/2knS3XlyECQ5nWeEWiO2iMBn3qE5TA== X-Received: by 2002:a05:6000:4028:b0:385:e2d5:cdf2 with SMTP id ffacd0b85a97d-38880ad9012mr3345755f8f.19.1734111190867; Fri, 13 Dec 2024 09:33:10 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:09 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 37/85] target/arm: Introduce gen_gvec_cls, gen_gvec_clz Date: Fri, 13 Dec 2024 17:31:41 +0000 Message-Id: <20241213173229.3308926-38-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32c.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: Richard Henderson Add gvec interfaces for CLS and CLZ operations. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-38-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/translate.h | 5 +++++ target/arm/tcg/gengvec.c | 35 +++++++++++++++++++++++++++++++++ target/arm/tcg/translate-a64.c | 29 +++++++-------------------- target/arm/tcg/translate-neon.c | 29 ++------------------------- 4 files changed, 49 insertions(+), 49 deletions(-) diff --git a/target/arm/tcg/translate.h b/target/arm/tcg/translate.h index 20cd0e851c4..5c6c24f0575 100644 --- a/target/arm/tcg/translate.h +++ b/target/arm/tcg/translate.h @@ -578,6 +578,11 @@ void gen_gvec_umaxp(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs, void gen_gvec_uminp(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs, uint32_t rm_ofs, uint32_t opr_sz, uint32_t max_sz); +void gen_gvec_cls(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs, + uint32_t opr_sz, uint32_t max_sz); +void gen_gvec_clz(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs, + uint32_t opr_sz, uint32_t max_sz); + /* * Forward to the isar_feature_* tests given a DisasContext pointer. */ diff --git a/target/arm/tcg/gengvec.c b/target/arm/tcg/gengvec.c index f652520b652..834b2961c06 100644 --- a/target/arm/tcg/gengvec.c +++ b/target/arm/tcg/gengvec.c @@ -2358,3 +2358,38 @@ void gen_gvec_urhadd(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs, assert(vece <= MO_32); tcg_gen_gvec_3(rd_ofs, rn_ofs, rm_ofs, opr_sz, max_sz, &g[vece]); } + +void gen_gvec_cls(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs, + uint32_t opr_sz, uint32_t max_sz) +{ + static const GVecGen2 g[] = { + { .fni4 = gen_helper_neon_cls_s8, + .vece = MO_8 }, + { .fni4 = gen_helper_neon_cls_s16, + .vece = MO_16 }, + { .fni4 = tcg_gen_clrsb_i32, + .vece = MO_32 }, + }; + assert(vece <= MO_32); + tcg_gen_gvec_2(rd_ofs, rn_ofs, opr_sz, max_sz, &g[vece]); +} + +static void gen_clz32_i32(TCGv_i32 d, TCGv_i32 n) +{ + tcg_gen_clzi_i32(d, n, 32); +} + +void gen_gvec_clz(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs, + uint32_t opr_sz, uint32_t max_sz) +{ + static const GVecGen2 g[] = { + { .fni4 = gen_helper_neon_clz_u8, + .vece = MO_8 }, + { .fni4 = gen_helper_neon_clz_u16, + .vece = MO_16 }, + { .fni4 = gen_clz32_i32, + .vece = MO_32 }, + }; + assert(vece <= MO_32); + tcg_gen_gvec_2(rd_ofs, rn_ofs, opr_sz, max_sz, &g[vece]); +} diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index c697f0e9441..387bbbf906b 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -10321,6 +10321,13 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) } switch (opcode) { + case 0x4: /* CLZ, CLS */ + if (u) { + gen_gvec_fn2(s, is_q, rd, rn, gen_gvec_clz, size); + } else { + gen_gvec_fn2(s, is_q, rd, rn, gen_gvec_cls, size); + } + return; case 0x5: if (u && size == 0) { /* NOT */ gen_gvec_fn2(s, is_q, rd, rn, tcg_gen_gvec_not, 0); @@ -10379,13 +10386,6 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) if (size == 2) { /* Special cases for 32 bit elements */ switch (opcode) { - case 0x4: /* CLS */ - if (u) { - tcg_gen_clzi_i32(tcg_res, tcg_op, 32); - } else { - tcg_gen_clrsb_i32(tcg_res, tcg_op); - } - break; case 0x2f: /* FABS */ gen_vfp_abss(tcg_res, tcg_op); break; @@ -10450,21 +10450,6 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) gen_helper_neon_cnt_u8(tcg_res, tcg_op); } break; - case 0x4: /* CLS, CLZ */ - if (u) { - if (size == 0) { - gen_helper_neon_clz_u8(tcg_res, tcg_op); - } else { - gen_helper_neon_clz_u16(tcg_res, tcg_op); - } - } else { - if (size == 0) { - gen_helper_neon_cls_s8(tcg_res, tcg_op); - } else { - gen_helper_neon_cls_s16(tcg_res, tcg_op); - } - } - break; default: case 0x7: /* SQABS, SQNEG */ g_assert_not_reached(); diff --git a/target/arm/tcg/translate-neon.c b/target/arm/tcg/translate-neon.c index 9c8829ad7d2..1c89a532722 100644 --- a/target/arm/tcg/translate-neon.c +++ b/target/arm/tcg/translate-neon.c @@ -3120,6 +3120,8 @@ DO_2MISC_VEC(VCGT0, gen_gvec_cgt0) DO_2MISC_VEC(VCLE0, gen_gvec_cle0) DO_2MISC_VEC(VCGE0, gen_gvec_cge0) DO_2MISC_VEC(VCLT0, gen_gvec_clt0) +DO_2MISC_VEC(VCLS, gen_gvec_cls) +DO_2MISC_VEC(VCLZ, gen_gvec_clz) static bool trans_VMVN(DisasContext *s, arg_2misc *a) { @@ -3227,33 +3229,6 @@ static bool trans_VREV16(DisasContext *s, arg_2misc *a) return do_2misc(s, a, gen_rev16); } -static bool trans_VCLS(DisasContext *s, arg_2misc *a) -{ - static NeonGenOneOpFn * const fn[] = { - gen_helper_neon_cls_s8, - gen_helper_neon_cls_s16, - gen_helper_neon_cls_s32, - NULL, - }; - return do_2misc(s, a, fn[a->size]); -} - -static void do_VCLZ_32(TCGv_i32 rd, TCGv_i32 rm) -{ - tcg_gen_clzi_i32(rd, rm, 32); -} - -static bool trans_VCLZ(DisasContext *s, arg_2misc *a) -{ - static NeonGenOneOpFn * const fn[] = { - gen_helper_neon_clz_u8, - gen_helper_neon_clz_u16, - do_VCLZ_32, - NULL, - }; - return do_2misc(s, a, fn[a->size]); -} - static bool trans_VCNT(DisasContext *s, arg_2misc *a) { if (a->size != 0) { From patchwork Fri Dec 13 17:31:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850206 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1643405wry; Fri, 13 Dec 2024 09:45:46 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUb9PJZFp3nabA9NvHSMR9hLrQEb9LsPwenPuJT7aw+NUPhVk3PnGRHrx24+nL1d0G2TpEJIA==@linaro.org X-Google-Smtp-Source: AGHT+IEozp+shyT919+iTysgheMTbIZ3oYUfMvPeHiPd4goC/GQCbnwPVseOO0irP09DBJaoXMXg X-Received: by 2002:a05:6402:2387:b0:5d0:e570:508d with SMTP id 4fb4d7f45d1cf-5d63c33b9b1mr3037296a12.17.1734111946204; Fri, 13 Dec 2024 09:45:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111946; cv=none; d=google.com; s=arc-20240605; b=drgRgc5bPcv6IO0zbUDaHA43R76P90b+joncCDo0bnflRNLE8NpUer/64W0oSu19Sa O3doYAaZFKmLkO7lRFUKFEqFTPLuplhCfOhOPp1W0qkBuG3UMLG9MaLlgADU0cbAeDyw 8gFT+EaHGxfDoCW9os9L77CEVDBvCBP8uqp5KVLoWa8GLhJbm5lxMn3iO6XU2bafVxB6 iaQbZPLaWGHkEHz0JPwFMf/oeU4v3zgPQjlKige6zXXM2SAHfqaSUkACeLhYBnZqGV2l capv5t7XuKcGA7VfVMBSAb14rZ6psw9xL39shc2xBeOM/W7v47Jr4X6/LuHdvcRd3a8q R6Kg== 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=lZ7MqaY3Qm/rDAv4NgSeRnPhhcH+SNF8CM2XZWn6Fc8=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=SLi9reEprbU0elRmIjmu5dcdd/dwlzJgNsdKHb/nuMWqQnamymLLb/qdVtTIJ+KgsB iLk988Sw+Rr98Oj5ZpRJmxE1ydKog+dZRWoJM6tpL1izarmOxYIWo117UxeoFcR0UtQ+ GSP8EhVG1cZr7SUf6bscoBYEGlxbGnuec+Wsu/y/dBqaMlWReFLaWvO10vCWy+1RJoK1 VfrZYalJeOA+I7qkfH+P3bUnAMI6rgTJVkmGH3WGEfF37R43D3nOykItsV+1b6/Y+OU7 VDukBhZ60c2gZcMWumP/EkganS0sMZ9u47vyiCooswCMMkY/XhmUnxb84ELvbqsZRSLN H+Ww==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lsIgNc74; 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 4fb4d7f45d1cf-5d653012f43si41187a12.609.2024.12.13.09.45.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:45:46 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lsIgNc74; 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 1tM9YZ-00038D-Ns; Fri, 13 Dec 2024 12:34:27 -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 1tM9XP-0007D7-Sy for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:17 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9XN-0001bS-Tg for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:15 -0500 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-43634b570c1so2405865e9.0 for ; Fri, 13 Dec 2024 09:33:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111192; x=1734715992; 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=lZ7MqaY3Qm/rDAv4NgSeRnPhhcH+SNF8CM2XZWn6Fc8=; b=lsIgNc74e5xJa3VBydEawqPhP07LFyFV0dsNDQogKNuVHuQeY/96kBRzsAAwvFQFgB EI3mwH2Imemq6NnOaILnGJxTNypPXb336HdKApHsNT+xoPtNo8c8qSxP8tp1yLjkbBS4 bLlU7YHIFLLLqZI5WpbUFUq++ZUG5U45RP7qi7rXEMR3ocxq5DHD0aji9XJeYBM5kZR7 KUrIZ2TcI3cLrjEgDWGA2GjlqXJJY/XfgDc86cZ4RwDrvXVzGTFyetSJ2NTlbovr7+g9 s/O1KBZvGXV38MXdOTVaWy6oT983Hii7tCcv6TP4Jhs7T3WIA5qTyJQB0WFo+/e39rER hjLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111192; x=1734715992; 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=lZ7MqaY3Qm/rDAv4NgSeRnPhhcH+SNF8CM2XZWn6Fc8=; b=D/dwDWLBrssmvaa9JdPNFgyEOO0zGtWyDXa3xUB7+uo12ELqYjMTKXFyIYgJv61LDD dJdDY4o/2Q2omh3CJJuM7/RidAdTFJ8iMFNorRZnrE8H/9kvGgnD1jk32RhgQQY4Frzc NZV8QMNknHVHKqmpYq6ubVLdURwqvhnqtfn9F2f0aw3Plasu7kqNkKx03yBSCvm8oTrr 35FYjIcB4QqGJcRoD8NYeDKfZIzMm0ABcxGTHssQ9YYYhbduaDaCde3LY2LffRIvWLTE ZV177mLa1QHyBeFXbtkJRYN5rj0Z265aQRZ6XGt7QCj9vJ3OEk1oTyqb/ezNMWldE1uI FtSQ== X-Gm-Message-State: AOJu0Yx75dTPI9mK9mJLkufTEBzQSr4yibGtCovTfSCi2RL1TqYnEaMK OBpYB8WOaznwV7upg5vMvvPDHTk8Z9gqGEI1exwgTehM4UvxUYgkgJZlg5KPPPBy8YiDgQ50g4W Y X-Gm-Gg: ASbGnculfyTb6TnLh/CGDsWhIbb4ukwKlKY/JqOM6VV1ghvf6IutnFGpB/EZWZGa9JH elUCaeANqY03qf9MdhFZnlE7v9o1b3O+DL9BpXwaHGfa1WmsPOTKssTgBndNfShsg3IZqZoVV2j HswVNhrbVqe6Q2qJrJ2Pa/3goJ1+cW6IfzqRAsL15l6FbHe37sKt25+Abbigkl0o37k18mpE3Ol dNZTnjUr8/7+okLk9Wo28rcsK+VU6RSsoE2DIqNWobNrpU0y9I+m2jrxL9VUQ== X-Received: by 2002:a5d:6d03:0:b0:385:dc45:ea26 with SMTP id ffacd0b85a97d-38880ac244fmr2870102f8f.12.1734111192403; Fri, 13 Dec 2024 09:33:12 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:11 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 38/85] target/arm: Convert CLS, CLZ (vector) to decodetree Date: Fri, 13 Dec 2024 17:31:42 +0000 Message-Id: <20241213173229.3308926-39-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x330.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: Richard Henderson Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-39-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 2 ++ target/arm/tcg/translate-a64.c | 37 ++++++++++++++++------------------ 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index f112951df72..32355ee6331 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -1641,3 +1641,5 @@ SQABS_v 0.00 1110 ..1 00000 01111 0 ..... ..... @qrr_e SQNEG_v 0.10 1110 ..1 00000 01111 0 ..... ..... @qrr_e ABS_v 0.00 1110 ..1 00000 10111 0 ..... ..... @qrr_e NEG_v 0.10 1110 ..1 00000 10111 0 ..... ..... @qrr_e +CLS_v 0.00 1110 ..1 00000 01001 0 ..... ..... @qrr_e +CLZ_v 0.10 1110 ..1 00000 01001 0 ..... ..... @qrr_e diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 387bbbf906b..ecb45789986 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -8916,6 +8916,20 @@ static bool do_gvec_fn2(DisasContext *s, arg_qrr_e *a, GVecGen2Fn *fn) TRANS(ABS_v, do_gvec_fn2, a, tcg_gen_gvec_abs) TRANS(NEG_v, do_gvec_fn2, a, tcg_gen_gvec_neg) +static bool do_gvec_fn2_bhs(DisasContext *s, arg_qrr_e *a, GVecGen2Fn *fn) +{ + if (a->esz == MO_64) { + return false; + } + if (fp_access_check(s)) { + gen_gvec_fn2(s, a->q, a->rd, a->rn, fn, a->esz); + } + return true; +} + +TRANS(CLS_v, do_gvec_fn2_bhs, a, gen_gvec_cls) +TRANS(CLZ_v, do_gvec_fn2_bhs, a, gen_gvec_clz) + /* Common vector code for handling integer to FP conversion */ static void handle_simd_intfp_conv(DisasContext *s, int rd, int rn, int elements, int is_signed, @@ -9215,13 +9229,6 @@ static void handle_2misc_64(DisasContext *s, int opcode, bool u, TCGCond cond; switch (opcode) { - case 0x4: /* CLS, CLZ */ - if (u) { - tcg_gen_clzi_i64(tcg_rd, tcg_rn, 64); - } else { - tcg_gen_clrsb_i64(tcg_rd, tcg_rn); - } - break; case 0x5: /* NOT */ /* This opcode is shared with CNT and RBIT but we have earlier * enforced that size == 3 if and only if this is the NOT insn. @@ -9283,6 +9290,7 @@ static void handle_2misc_64(DisasContext *s, int opcode, bool u, gen_helper_frint64_d(tcg_rd, tcg_rn, tcg_fpstatus); break; default: + case 0x4: /* CLS, CLZ */ case 0x7: /* SQABS, SQNEG */ case 0xb: /* ABS, NEG */ g_assert_not_reached(); @@ -10089,12 +10097,6 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) handle_2misc_narrow(s, false, opcode, u, is_q, size, rn, rd); return; - case 0x4: /* CLS, CLZ */ - if (size == 3) { - unallocated_encoding(s); - return; - } - break; case 0x2: /* SADDLP, UADDLP */ case 0x6: /* SADALP, UADALP */ if (size == 3) { @@ -10299,6 +10301,7 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) } default: case 0x3: /* SUQADD, USQADD */ + case 0x4: /* CLS, CLZ */ case 0x7: /* SQABS, SQNEG */ case 0xb: /* ABS, NEG */ unallocated_encoding(s); @@ -10321,13 +10324,6 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) } switch (opcode) { - case 0x4: /* CLZ, CLS */ - if (u) { - gen_gvec_fn2(s, is_q, rd, rn, gen_gvec_clz, size); - } else { - gen_gvec_fn2(s, is_q, rd, rn, gen_gvec_cls, size); - } - return; case 0x5: if (u && size == 0) { /* NOT */ gen_gvec_fn2(s, is_q, rd, rn, tcg_gen_gvec_not, 0); @@ -10351,6 +10347,7 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) case 0xa: /* CMLT */ gen_gvec_fn2(s, is_q, rd, rn, gen_gvec_clt0, size); return; + case 0x4: /* CLZ, CLS */ case 0xb: g_assert_not_reached(); } From patchwork Fri Dec 13 17:31:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850135 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1637896wry; Fri, 13 Dec 2024 09:33:49 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUfjCQ/87BiLFCBXCiMeGnvYOtFwsImrDCpsYqTw83LriHxrcxVH5g5WalACPQblfMlhLIl0A==@linaro.org X-Google-Smtp-Source: AGHT+IFkmKF7ID0CRq0iK+TycEhSEOusoSFf25Nl8Ccbz12pv441/vCeJiiDu/+1PROd7AfQxJbQ X-Received: by 2002:a05:622a:1454:b0:467:6283:3c9d with SMTP id d75a77b69052e-467a575608amr70003451cf.13.1734111229295; Fri, 13 Dec 2024 09:33:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111229; cv=none; d=google.com; s=arc-20240605; b=ViwBSyFuHbN6JFkItyhWYACE2N6Ul7MF9TCShwHO6P/9X/vMiNkdgD87+Hg8sP1pwf wcIz+TrwYhB5Zryt1vOW7xgMKZTDfTARfRGsJD6tcY4HVq4fXmCQQ9Of4S40nwHFG+h6 4FOJii1HsCWbtk3m6cM69KL5e0waXpkdMXQ9pBYKFu+JAWxNgjfg7L5b4H/GEOKyt1ZG bumJkql9anchAQ81QhJq8Pk2+qaC9JVut/0+ZiB8iCCMmWFZQ9daBlJ2+Ph+/zkKJy2i FsCdkG9W8ScPkQC+fzXEFAMj4qjg99btZtzlxt6Ar437T8aUWaX0dYRC+f72mqDKfJWr sHdQ== 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=3dd4VoDW1FyBGxT270NBBei9W/ZPxIE9A7qqZiiNJek=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=F5NblyY/FfxhJZCPCQHEDOpac6hlYHBJ830/Ogy/h2uP+uUW76gipA++AGh/pm3Dqj GAurIFWRpaz68mg8u4lQrUw1JR70xKhO6P2jnoJfkZgVko8mAk5D808Gel/JT0JLgZC3 zGteo5ruvh8xwXEZw32kkXvHYmgZHtdgNwS0CvY5VDWBZFHz93wb7xfuT9gi5soHOGhd E8LDiKtygH04fhBIUap2NSanYWkuGsjMPA1MbRVkGZtgicYLVuZQ34nS6Pk98PNgVWk5 LjBZk1VJbLnJblVTaFQqVDH4rx1kKsJTcqUJRaSHvskve2GzLFtrBtla+3nI7vouXNPh NfYg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RokJS0vf; 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-46793b149c8si74453061cf.661.2024.12.13.09.33.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:33:49 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RokJS0vf; 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 1tM9Xn-0007rj-FY; Fri, 13 Dec 2024 12:33:39 -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 1tM9XT-0007EF-4q for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:22 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9XQ-0001bl-D7 for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:18 -0500 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-385eed29d17so1082502f8f.0 for ; Fri, 13 Dec 2024 09:33:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111194; x=1734715994; 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=3dd4VoDW1FyBGxT270NBBei9W/ZPxIE9A7qqZiiNJek=; b=RokJS0vf/1oyn+4xai87+Y0diqp1fl2HzcKTn0A09dp19Stmz5bHo8DY9wsqJMiZkZ 5xRgrjkbCS8Mf4eysb0P35mM+zBjNYqU4oDyW+tq2Bfk2zmMwxLL2JbSO1ox6nBdcoX6 l91UQxvqZjbf/UKgIuZJT9eaXuuPR3sc0e1CABz3izqPAXEEmomzfwBR3upnOficSwHn yO10PAlXVFNODpYap9+q9sl8gaacJMVtEiUy0zOw+4R5YPQfQhMyI2P3uehIgAclf1FI W2xA4dOP6LzjOi6ttTkwaxoiqOUTgBE/1z/1UUAfkIWoeOnIbh69yUVd8J3e65Rd1Lyq 7QXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111194; x=1734715994; 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=3dd4VoDW1FyBGxT270NBBei9W/ZPxIE9A7qqZiiNJek=; b=azhbOlUioXMfcY/bCcLRMddy9zTMgOY1dNoZr8BzyX9sHOnm9/M8m8b36TXN8+4m14 M8ppWjyaAuagVM1qDrODEzVCkNuEZEgcCiI4OGmRlDcY19opt+Ux1i2OFeZRYu7cEVZ+ K/f/YhJYEk5/89fJl6Dn/w+sB1HAZADh63dP6V1oEdBrNdf0fssdhL4jPmfsCLcuukMN INUGxXO+UKxASgQcN3gam18e8fqK7ne8gKWJ0zs8HsYoWCi8rGUtEn15BMb865vpqc0U hIaJar0uqf1XHJmnqebRa7hcsjTpvMXpWoOfqAPOJZ4VlKmdaM/E9QBvpqZtLqD1hc1M jQOA== X-Gm-Message-State: AOJu0Yxfar/yBisd3RBOjwCo25ANXwe2ZHNmUCKtNXSfOnVT4sHaFRkV oRHYQO0FOEGLssgNJ2gH4vxFb2M+S1tBZBbMYR5ZbwWC8BOyOmvptAsDDWya9SGx31S8vEbhGPf / X-Gm-Gg: ASbGnctijwPrvXAuKCACIVR2t/XxsPnO0A68ecCyvWPyrqYF67D4BQvp+aprX6sDcyQ v+9Of/oP5jILi01DyBEaZ5qY+tvv9jASA91mBn/yfR8wG3VOm6L9B4jNqS+35FMw4wTEhtGHRyK fGEiZEafEmt9WEZ3YIYxa2A5DL5sw/iufG0ie5hqUx4W2HKx+O8F7FUQ4eCLc1RwEpfMMBh8992 Asca+xqq9PwnWwEf4hDfgdI48WvzAEWFcO6CFtkYiCyr+G8eeJ4DM6x8T+4dQ== X-Received: by 2002:a05:6000:1ac8:b0:386:3e48:f732 with SMTP id ffacd0b85a97d-38880acd52fmr2664394f8f.16.1734111193613; Fri, 13 Dec 2024 09:33:13 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:12 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 39/85] target/arm: Introduce gen_gvec_cnt, gen_gvec_rbit Date: Fri, 13 Dec 2024 17:31:43 +0000 Message-Id: <20241213173229.3308926-40-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Add gvec interfaces for CNT and RBIT operations. Use ctpop8 for CNT and revbit+bswap for RBIT. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-40-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/helper.h | 4 ++-- target/arm/tcg/translate.h | 4 ++++ target/arm/tcg/gengvec.c | 16 ++++++++++++++++ target/arm/tcg/neon_helper.c | 21 --------------------- target/arm/tcg/translate-a64.c | 32 +++++++++----------------------- target/arm/tcg/translate-neon.c | 16 ++++++++-------- target/arm/tcg/vec_helper.c | 24 ++++++++++++++++++++++++ 7 files changed, 63 insertions(+), 54 deletions(-) diff --git a/target/arm/helper.h b/target/arm/helper.h index 0a697e752bc..167e331a83e 100644 --- a/target/arm/helper.h +++ b/target/arm/helper.h @@ -363,8 +363,8 @@ DEF_HELPER_1(neon_clz_u16, i32, i32) DEF_HELPER_1(neon_cls_s8, i32, i32) DEF_HELPER_1(neon_cls_s16, i32, i32) DEF_HELPER_1(neon_cls_s32, i32, i32) -DEF_HELPER_1(neon_cnt_u8, i32, i32) -DEF_HELPER_FLAGS_1(neon_rbit_u8, TCG_CALL_NO_RWG_SE, i32, i32) +DEF_HELPER_FLAGS_3(gvec_cnt_b, TCG_CALL_NO_RWG, void, ptr, ptr, i32) +DEF_HELPER_FLAGS_3(gvec_rbit_b, TCG_CALL_NO_RWG, void, ptr, ptr, i32) DEF_HELPER_3(neon_qdmulh_s16, i32, env, i32, i32) DEF_HELPER_3(neon_qrdmulh_s16, i32, env, i32, i32) diff --git a/target/arm/tcg/translate.h b/target/arm/tcg/translate.h index 5c6c24f0575..cb8e1b2586a 100644 --- a/target/arm/tcg/translate.h +++ b/target/arm/tcg/translate.h @@ -582,6 +582,10 @@ void gen_gvec_cls(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs, uint32_t opr_sz, uint32_t max_sz); void gen_gvec_clz(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs, uint32_t opr_sz, uint32_t max_sz); +void gen_gvec_cnt(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs, + uint32_t opr_sz, uint32_t max_sz); +void gen_gvec_rbit(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs, + uint32_t opr_sz, uint32_t max_sz); /* * Forward to the isar_feature_* tests given a DisasContext pointer. diff --git a/target/arm/tcg/gengvec.c b/target/arm/tcg/gengvec.c index 834b2961c06..85a0b504960 100644 --- a/target/arm/tcg/gengvec.c +++ b/target/arm/tcg/gengvec.c @@ -2393,3 +2393,19 @@ void gen_gvec_clz(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs, assert(vece <= MO_32); tcg_gen_gvec_2(rd_ofs, rn_ofs, opr_sz, max_sz, &g[vece]); } + +void gen_gvec_cnt(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs, + uint32_t opr_sz, uint32_t max_sz) +{ + assert(vece == MO_8); + tcg_gen_gvec_2_ool(rd_ofs, rn_ofs, opr_sz, max_sz, 0, + gen_helper_gvec_cnt_b); +} + +void gen_gvec_rbit(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs, + uint32_t opr_sz, uint32_t max_sz) +{ + assert(vece == MO_8); + tcg_gen_gvec_2_ool(rd_ofs, rn_ofs, opr_sz, max_sz, 0, + gen_helper_gvec_rbit_b); +} diff --git a/target/arm/tcg/neon_helper.c b/target/arm/tcg/neon_helper.c index 93b2076c64f..4e501925dec 100644 --- a/target/arm/tcg/neon_helper.c +++ b/target/arm/tcg/neon_helper.c @@ -525,27 +525,6 @@ uint32_t HELPER(neon_cls_s32)(uint32_t x) return count - 1; } -/* Bit count. */ -uint32_t HELPER(neon_cnt_u8)(uint32_t x) -{ - x = (x & 0x55555555) + ((x >> 1) & 0x55555555); - x = (x & 0x33333333) + ((x >> 2) & 0x33333333); - x = (x & 0x0f0f0f0f) + ((x >> 4) & 0x0f0f0f0f); - return x; -} - -/* Reverse bits in each 8 bit word */ -uint32_t HELPER(neon_rbit_u8)(uint32_t x) -{ - x = ((x & 0xf0f0f0f0) >> 4) - | ((x & 0x0f0f0f0f) << 4); - x = ((x & 0x88888888) >> 3) - | ((x & 0x44444444) >> 1) - | ((x & 0x22222222) << 1) - | ((x & 0x11111111) << 3); - return x; -} - #define NEON_QDMULH16(dest, src1, src2, round) do { \ uint32_t tmp = (int32_t)(int16_t) src1 * (int16_t) src2; \ if ((tmp ^ (tmp << 1)) & SIGNBIT) { \ diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index ecb45789986..3e0c061b3c0 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -10324,12 +10324,15 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) } switch (opcode) { - case 0x5: - if (u && size == 0) { /* NOT */ + case 0x5: /* CNT, NOT, RBIT */ + if (!u) { + gen_gvec_fn2(s, is_q, rd, rn, gen_gvec_cnt, 0); + } else if (size) { + gen_gvec_fn2(s, is_q, rd, rn, gen_gvec_rbit, 0); + } else { gen_gvec_fn2(s, is_q, rd, rn, tcg_gen_gvec_not, 0); - return; } - break; + return; case 0x8: /* CMGT, CMGE */ if (u) { gen_gvec_fn2(s, is_q, rd, rn, gen_gvec_cge0, size); @@ -10374,13 +10377,14 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) } else { int pass; + assert(size == 2); for (pass = 0; pass < (is_q ? 4 : 2); pass++) { TCGv_i32 tcg_op = tcg_temp_new_i32(); TCGv_i32 tcg_res = tcg_temp_new_i32(); read_vec_element_i32(s, tcg_op, rn, pass, MO_32); - if (size == 2) { + { /* Special cases for 32 bit elements */ switch (opcode) { case 0x2f: /* FABS */ @@ -10434,25 +10438,7 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) case 0x7: /* SQABS, SQNEG */ g_assert_not_reached(); } - } else { - /* Use helpers for 8 and 16 bit elements */ - switch (opcode) { - case 0x5: /* CNT, RBIT */ - /* For these two insns size is part of the opcode specifier - * (handled earlier); they always operate on byte elements. - */ - if (u) { - gen_helper_neon_rbit_u8(tcg_res, tcg_op); - } else { - gen_helper_neon_cnt_u8(tcg_res, tcg_op); - } - break; - default: - case 0x7: /* SQABS, SQNEG */ - g_assert_not_reached(); - } } - write_vec_element_i32(s, tcg_res, rd, pass, MO_32); } } diff --git a/target/arm/tcg/translate-neon.c b/target/arm/tcg/translate-neon.c index 1c89a532722..50d0bf77531 100644 --- a/target/arm/tcg/translate-neon.c +++ b/target/arm/tcg/translate-neon.c @@ -3131,6 +3131,14 @@ static bool trans_VMVN(DisasContext *s, arg_2misc *a) return do_2misc_vec(s, a, tcg_gen_gvec_not); } +static bool trans_VCNT(DisasContext *s, arg_2misc *a) +{ + if (a->size != 0) { + return false; + } + return do_2misc_vec(s, a, gen_gvec_cnt); +} + #define WRAP_2M_3_OOL_FN(WRAPNAME, FUNC, DATA) \ static void WRAPNAME(unsigned vece, uint32_t rd_ofs, \ uint32_t rm_ofs, uint32_t oprsz, \ @@ -3229,14 +3237,6 @@ static bool trans_VREV16(DisasContext *s, arg_2misc *a) return do_2misc(s, a, gen_rev16); } -static bool trans_VCNT(DisasContext *s, arg_2misc *a) -{ - if (a->size != 0) { - return false; - } - return do_2misc(s, a, gen_helper_neon_cnt_u8); -} - static void gen_VABS_F(unsigned vece, uint32_t rd_ofs, uint32_t rm_ofs, uint32_t oprsz, uint32_t maxsz) { diff --git a/target/arm/tcg/vec_helper.c b/target/arm/tcg/vec_helper.c index ad6f26545ac..91a9130641f 100644 --- a/target/arm/tcg/vec_helper.c +++ b/target/arm/tcg/vec_helper.c @@ -3066,3 +3066,27 @@ DO_CLAMP(gvec_uclamp_b, uint8_t) DO_CLAMP(gvec_uclamp_h, uint16_t) DO_CLAMP(gvec_uclamp_s, uint32_t) DO_CLAMP(gvec_uclamp_d, uint64_t) + +/* Bit count in each 8-bit word. */ +void HELPER(gvec_cnt_b)(void *vd, void *vn, uint32_t desc) +{ + intptr_t i, opr_sz = simd_oprsz(desc); + uint8_t *d = vd, *n = vn; + + for (i = 0; i < opr_sz; ++i) { + d[i] = ctpop8(n[i]); + } + clear_tail(d, opr_sz, simd_maxsz(desc)); +} + +/* Reverse bits in each 8 bit word */ +void HELPER(gvec_rbit_b)(void *vd, void *vn, uint32_t desc) +{ + intptr_t i, opr_sz = simd_oprsz(desc); + uint64_t *d = vd, *n = vn; + + for (i = 0; i < opr_sz / 8; ++i) { + d[i] = revbit64(bswap64(n[i])); + } + clear_tail(d, opr_sz, simd_maxsz(desc)); +} From patchwork Fri Dec 13 17:31:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850137 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1638001wry; Fri, 13 Dec 2024 09:34:02 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWVz6q6A7eDB/yDeGsHokStD0SyCvLaTmxfUWM+7c8JAdN8Jpa8c5MSKnIBjDpRnpVvWEozwQ==@linaro.org X-Google-Smtp-Source: AGHT+IHF1CDDRg6FVnm2xj+chzCZrbj5QHEjQ1WViB4QvNeL3+y68hMbdbovMBmiYhH1SS8tutQL X-Received: by 2002:ac8:7fc2:0:b0:466:a7d8:fd21 with SMTP id d75a77b69052e-467a57895d6mr61994171cf.24.1734111241998; Fri, 13 Dec 2024 09:34:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111241; cv=none; d=google.com; s=arc-20240605; b=XRHxrZjsK1Yt997WEVnckClwnHVkCzdBKe/MlE7lf5BtUgdh3L7Qz3Uo/SiA8RmY4T ntYOlPGFzEhoJLq2cU9foQHNWmIkptwzUR6owEG54hDHkwjS9q0PjPFd7VVBpffxKLOd 3qoDXq0pnGRgEHyfMtjiqNaxf+U3MrBWwoRQ8ttpahm66M6iEEOVEFafC7vOLa7b2bHF YcqA3RAc7WySaR9gSb6frYhRdvQakwj6qOfsBoPBl9fiiqVkqkPE98z6WKARqAM70Nja NWPei6OBQi5t6VPbfJVDLqSaQWWHzyhPr8nyclw1LPK3QoHkN4r2D2o3Z2yn3k9TV2wu gbUQ== 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=fDdtnlLPu66cn6d1r0KkSZdgC2ryDDOvIhyzfjEy2GE=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=AozQYl95rHv6nKaWex7+AdhxW47drWYLyILJTXSVD8gppL7zNqZeWTxUnutZBDIYGU q6P7icE/ovxFcWE0Fu6LQc6OWqWs5xtv7pjlJJomX17DbNDLWyfdiVnplNmqAzmB5K6s cbfkkxpYq+5eFi3IbdhEajHQLKTF2sjoBbSwmnrVynEFy/8Q08JRZsAkS+3X8r9FxFF9 S6nTGOJ6aYR7sSY/4+HVUO5Dl4Et6nzvDZVCC1XKJaD+7Zq5NoOAjtOisZo98VWR9jFG U6Xx9fk43pnX0Njs2T5pKLQy09mPLiI2teGTf/l/vFSGbJjE3w/zsOaO1gfhScjHSNEX mqCg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LFJzy0c1; 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-4679c819fdbsi38851491cf.414.2024.12.13.09.34.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:34: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=LFJzy0c1; 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 1tM9Xk-0007p4-OL; Fri, 13 Dec 2024 12:33:36 -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 1tM9XS-0007Dj-Qm for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:21 -0500 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9XQ-0001bw-Cx for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:18 -0500 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-3862b40a6e0so1128323f8f.0 for ; Fri, 13 Dec 2024 09:33:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111194; x=1734715994; 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=fDdtnlLPu66cn6d1r0KkSZdgC2ryDDOvIhyzfjEy2GE=; b=LFJzy0c1z3G7PH08aRUaCT2iREeWDngV6hI8jdRM3IbG9EaWZ3dVlIQ3BW6Amk2a8Q BVlAbS0qzk8jTPQn+awj7YCNcJqyWznysDlyCrB99ys1JXz2CwonNGx6QNJRVJe/mIRo 6rpXF9m5FChXreunvx35hTgQ01ZD0/5FUCz87yU1k4lrRPeyVSSkPNRYC0SmTM1xhx6r kVdz8+0WFQtQSh1vfwrYLmq9Rc/CTFbuqHmggBELCAjuxeH4eKQbtMlwlO6FTi6tLu7I pW5qul1XZZ9MOihi4GPBt0fOLIsO9EOEHxgfKRPrycPtGuxYwFyEJHCrYisKDkIgOnvI kO9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111194; x=1734715994; 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=fDdtnlLPu66cn6d1r0KkSZdgC2ryDDOvIhyzfjEy2GE=; b=s7TFxWb9f9oNLMefpSlaJiX7MA+jq5oS5668Y3tihRKmrVhdO+Jaqwri4LcOSUSBjf NekLxBfehMBp88l3qaFrHOXz6FslNw3QgouSOjav6UyCsQoYuQeOQ7hb5nnhObay7C0E NaOXrB1GpAiTPbr3e6buDM4ZHP5i9yrwORkp+4tomkGW4DQpt32f9vjxdbm2THRFbGBK FqO1j8/pyW8DpCz9XHz1nF1hVezmFHHexSjRVxIFjc//1P6TSuJ3GFGIL6aDt8iXwq0/ rNTzwV2r6uKouy287SB1ZddJ138EQmoAzm5JsB7hABHAYc8WwchZvFfpGtCkfZZQEbzw tpYA== X-Gm-Message-State: AOJu0YwjQQbeUJ7kkL9VrIbd786cXwIzQd6331tJSCNhGEH8pzgkYVvu V1y0sTpmKymQlK1LfgRwt1h7tl1PErvCiz/Cu1mgkc36ePHmJOs+envupi5t55RiSWQdpLuQ515 l X-Gm-Gg: ASbGncsR8z9bI8ObbJs0re2Z0GtRrbUDCjBv+XtLXPOhbssk6LZL78xCQNlH3JOtWwF KAZLfCJabrq3ITutKWHuyVGGuntk4iEYsqranRfT0gONdsGHTa+pFjinksb1JQRMcxiMi0982Vm uZnwFrhrsDtkMv8NVseIekqTyRIIaUS2r504ZZEuQ4P2OP4NvrZG7U6EzRJxTTkzyJZLOGBXj5M Q34sAAyONQxZMgNnVLxP/Qo7x4lI4IzfcvZ0LDcK5/mP53rAKopX9bkDrdXpQ== X-Received: by 2002:a05:6000:2ad:b0:385:ee59:44eb with SMTP id ffacd0b85a97d-3888e0bd28amr3270071f8f.33.1734111194640; Fri, 13 Dec 2024 09:33:14 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:13 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 40/85] target/arm: Convert CNT, NOT, RBIT (vector) to decodetree Date: Fri, 13 Dec 2024 17:31:44 +0000 Message-Id: <20241213173229.3308926-41-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x435.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-41-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 4 ++++ target/arm/tcg/translate-a64.c | 34 ++++++---------------------------- 2 files changed, 10 insertions(+), 28 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 32355ee6331..bac81eec7e6 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -71,6 +71,7 @@ @rrr_q1e3 ........ ... rm:5 ...... rn:5 rd:5 &qrrr_e q=1 esz=3 @rrrr_q1e3 ........ ... rm:5 . ra:5 rn:5 rd:5 &qrrrr_e q=1 esz=3 +@qrr_b . q:1 ...... .. ...... ...... rn:5 rd:5 &qrr_e esz=0 @qrr_h . q:1 ...... .. ...... ...... rn:5 rd:5 &qrr_e esz=1 @qrr_e . q:1 ...... esz:2 ...... ...... rn:5 rd:5 &qrr_e @@ -1643,3 +1644,6 @@ ABS_v 0.00 1110 ..1 00000 10111 0 ..... ..... @qrr_e NEG_v 0.10 1110 ..1 00000 10111 0 ..... ..... @qrr_e CLS_v 0.00 1110 ..1 00000 01001 0 ..... ..... @qrr_e CLZ_v 0.10 1110 ..1 00000 01001 0 ..... ..... @qrr_e +CNT_v 0.00 1110 001 00000 01011 0 ..... ..... @qrr_b +NOT_v 0.10 1110 001 00000 01011 0 ..... ..... @qrr_b +RBIT_v 0.10 1110 011 00000 01011 0 ..... ..... @qrr_b diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 3e0c061b3c0..aff1984a224 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -8915,6 +8915,9 @@ static bool do_gvec_fn2(DisasContext *s, arg_qrr_e *a, GVecGen2Fn *fn) TRANS(ABS_v, do_gvec_fn2, a, tcg_gen_gvec_abs) TRANS(NEG_v, do_gvec_fn2, a, tcg_gen_gvec_neg) +TRANS(NOT_v, do_gvec_fn2, a, tcg_gen_gvec_not) +TRANS(CNT_v, do_gvec_fn2, a, gen_gvec_cnt) +TRANS(RBIT_v, do_gvec_fn2, a, gen_gvec_rbit) static bool do_gvec_fn2_bhs(DisasContext *s, arg_qrr_e *a, GVecGen2Fn *fn) { @@ -9229,12 +9232,6 @@ static void handle_2misc_64(DisasContext *s, int opcode, bool u, TCGCond cond; switch (opcode) { - case 0x5: /* NOT */ - /* This opcode is shared with CNT and RBIT but we have earlier - * enforced that size == 3 if and only if this is the NOT insn. - */ - tcg_gen_not_i64(tcg_rd, tcg_rn); - break; case 0xa: /* CMLT */ cond = TCG_COND_LT; do_cmop: @@ -9291,6 +9288,7 @@ static void handle_2misc_64(DisasContext *s, int opcode, bool u, break; default: case 0x4: /* CLS, CLZ */ + case 0x5: /* NOT */ case 0x7: /* SQABS, SQNEG */ case 0xb: /* ABS, NEG */ g_assert_not_reached(); @@ -10072,19 +10070,6 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) case 0x1: /* REV16 */ handle_rev(s, opcode, u, is_q, size, rn, rd); return; - case 0x5: /* CNT, NOT, RBIT */ - if (u && size == 0) { - /* NOT */ - break; - } else if (u && size == 1) { - /* RBIT */ - break; - } else if (!u && size == 0) { - /* CNT */ - break; - } - unallocated_encoding(s); - return; case 0x12: /* XTN, XTN2, SQXTUN, SQXTUN2 */ case 0x14: /* SQXTN, SQXTN2, UQXTN, UQXTN2 */ if (size == 3) { @@ -10302,6 +10287,7 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) default: case 0x3: /* SUQADD, USQADD */ case 0x4: /* CLS, CLZ */ + case 0x5: /* CNT, NOT, RBIT */ case 0x7: /* SQABS, SQNEG */ case 0xb: /* ABS, NEG */ unallocated_encoding(s); @@ -10324,15 +10310,6 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) } switch (opcode) { - case 0x5: /* CNT, NOT, RBIT */ - if (!u) { - gen_gvec_fn2(s, is_q, rd, rn, gen_gvec_cnt, 0); - } else if (size) { - gen_gvec_fn2(s, is_q, rd, rn, gen_gvec_rbit, 0); - } else { - gen_gvec_fn2(s, is_q, rd, rn, tcg_gen_gvec_not, 0); - } - return; case 0x8: /* CMGT, CMGE */ if (u) { gen_gvec_fn2(s, is_q, rd, rn, gen_gvec_cge0, size); @@ -10351,6 +10328,7 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) gen_gvec_fn2(s, is_q, rd, rn, gen_gvec_clt0, size); return; case 0x4: /* CLZ, CLS */ + case 0x5: /* CNT, NOT, RBIT */ case 0xb: g_assert_not_reached(); } From patchwork Fri Dec 13 17:31:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850144 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1638161wry; Fri, 13 Dec 2024 09:34:16 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV5ZzpzQk0flQEBJ3n0wyP1LdlPdQmOp3yyB8etKhKhX31Q9WBiT+23OI2+sQqxkqghHv/I3Q==@linaro.org X-Google-Smtp-Source: AGHT+IEguPiReRqzLhWSSp02Fajx3evn++NdAJkGTNNZcTyM4lFM4BADVISZ9683seq0euvcoB+1 X-Received: by 2002:a05:620a:438b:b0:7a9:a356:a5dd with SMTP id af79cd13be357-7b6fbf43d9fmr578988185a.20.1734111256636; Fri, 13 Dec 2024 09:34:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111256; cv=none; d=google.com; s=arc-20240605; b=YcsVvRXFyK/l8FqXXeb7XsGY14FO7Bp2Bsihh7UpK1XaWt3sibQ9XJLcPZU4D29Ibb QavFOx6y/ayjrmEUq2aqPfSaLqwKyBN4vf6p3l1onSNTb3qq29O14Giihv0b9c1NJzIA JMSt3T+l+/ojPnZRR5vSiGvxw8vselayiMpN3VXMYZfXwzGSNmbgbcARz8/bSLRtUZpz zuaz9RQVZMXdgXURWECEgFjgZHJ6/SmJv9XtGUYW+36rJYk6u2DSD5fwcj9vdeJ5lPCb ZGQPkoPmn6MjaHyi7la3waYxl3Hu58tjxn63gmlWbGdk4Vy8n/4uph7mkc6WxftHaW3T 853A== 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=keiI1XrwT1F2BdgbQwqF8VW3k075qrpgYZgXkqhkRoc=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=jbF0Td3b1DzG0D9qwhVAZWnR6KgxPxFiOoT66CBjc+4KCIOHurxbdW6oxDwV6eT9hP /N1EjuyvY6Gz8BWhOJTCS2fNKS6nxcOIyI94ZVXOLUH8yM+uu6NcYhODyl4b1x0jp2H8 GmzW6ucUW0lsnFDSAcPU+UTkil8SWKnggHCUuKOvL4s1f/k/onwpmLeUNpR+fFTAqWTk 3BdP6DQ1FVLVrmqDvYVxjCrjhtE21H0adVYb7lVrr7skFfSsi01/H4vq5pKDjLQ6I3kV Na4FAYz4HgLZlcG+RxI1Ne53czWB+duq7rlgqVMg2Dyemtf69VUoRe0yGcXN+OFUaMw8 8WEw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=O88QUqQ3; 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-7b6d2d71e9csi1369883585a.697.2024.12.13.09.34.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:34:16 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=O88QUqQ3; 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 1tM9Xg-0007g9-0S; Fri, 13 Dec 2024 12:33:32 -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 1tM9XU-0007EP-Db for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:22 -0500 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9XS-0001cC-Gf for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:20 -0500 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-385ed7f6605so1059144f8f.3 for ; Fri, 13 Dec 2024 09:33:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111196; x=1734715996; 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=keiI1XrwT1F2BdgbQwqF8VW3k075qrpgYZgXkqhkRoc=; b=O88QUqQ3UKJKafWN73DLLgWiHYuooUneoDScrSjqtrltsFALfuEvv/gS7ELwnGIczD RjvsslSGSC4egQVM5X1bR61ZD2RxhWX3shi+0DI5/IvKgKqX2GWXZtxOQbc8cNc7544N Lz0IE5POPDCEjTQgSV31GE3khfbFcfNxbRDbRtM1YslIFFWehxdh61rEgYCE9Omppadl zWgpLV5ARoo+JEEOiRM4YwdpUNQfPtjqF1Vcj354CR1t/Kwtw9sa2sjdybyxr/d5b8qv WZSlm3t1Hluf4mUxfIwUSJLgETIvfb0OEsuGtVnnmLux20g/NApIXoPMziSwAekfQHGh gBHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111196; x=1734715996; 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=keiI1XrwT1F2BdgbQwqF8VW3k075qrpgYZgXkqhkRoc=; b=upIiweijRowbjk7tr36MShw8RnBDksefQj1n5sTBxlExRpRM/OjEnECVJGT7Dw/2/G cNOCUPooeAYZJKA+VayGujdxW2D3twX6XMdwcKIq1Jrn7s+cXaA/8SuC9mPsJDGRrApa FfMZGTLvnjF6G3ouPGYOKoUoenc3ZSmPAm34hTGlFmk8mMrblBz4pL/6iYJ26wrd0vk8 zJbCsGfdLf4PmigeRq18CBXf2XfPug9MoZXllR81TovHhsfzxowuP7TCAVXWw3QW0eyr sebyMjzPTBC48BAJdBLUTyuOKcReNiuOBy36Te2wQUTKIW84EqcMNpk4DyqeqGKK0LEs +PeQ== X-Gm-Message-State: AOJu0YymZuaoX+TsjNp9oB1aTUjWUDdI7Qr2DQT/tWdOa+vkcCI9XYW6 gyLKQxBwfToclOQsLORdd/T0r8YCF0Y4XlvA2jQWFvnVTHdc9OnqQLpuMhXN6GtNxDEnqREht/v N X-Gm-Gg: ASbGnctuj1xSUo0kJ8akQMOI4h8IbJArwI588knrCcTbATvlvmW1jjQZkszjgBof057 gxMqJg7M2f3gYtaVR1GR8sP+jKIOFjTwBmv6a9qCOvZRfi2PW6qLOtPV3+3a8ja0L4rTn579ypv tj+OVI35SZThFU9WJCtfARfRDf94klUu46YXMcVsz/jGPwjrkOaJjxvXPDtOFQQL96hKjiZ3AA1 6K6Y4RKjOc2Ixlm+ujf160gMnolxVZ1ideoRVwVP8P/6aMO9fyshSyBe4S2Uw== X-Received: by 2002:a05:6000:1882:b0:385:e0d6:fb73 with SMTP id ffacd0b85a97d-38880ad7765mr2987009f8f.15.1734111195643; Fri, 13 Dec 2024 09:33:15 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:14 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 41/85] target/arm: Convert CMGT, CMGE, GMLT, GMLE, CMEQ (zero) to decodetree Date: Fri, 13 Dec 2024 17:31:45 +0000 Message-Id: <20241213173229.3308926-42-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x435.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-42-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 10 ++++ target/arm/tcg/translate-a64.c | 94 +++++++++++----------------------- 2 files changed, 40 insertions(+), 64 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index bac81eec7e6..247d3a7bda4 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -1635,6 +1635,11 @@ SQABS_s 0101 1110 ..1 00000 01111 0 ..... ..... @rr_e SQNEG_s 0111 1110 ..1 00000 01111 0 ..... ..... @rr_e ABS_s 0101 1110 111 00000 10111 0 ..... ..... @rr NEG_s 0111 1110 111 00000 10111 0 ..... ..... @rr +CMGT0_s 0101 1110 111 00000 10001 0 ..... ..... @rr +CMGE0_s 0111 1110 111 00000 10001 0 ..... ..... @rr +CMEQ0_s 0101 1110 111 00000 10011 0 ..... ..... @rr +CMLE0_s 0111 1110 111 00000 10011 0 ..... ..... @rr +CMLT0_s 0101 1110 111 00000 10101 0 ..... ..... @rr # Advanced SIMD two-register miscellaneous @@ -1647,3 +1652,8 @@ CLZ_v 0.10 1110 ..1 00000 01001 0 ..... ..... @qrr_e CNT_v 0.00 1110 001 00000 01011 0 ..... ..... @qrr_b NOT_v 0.10 1110 001 00000 01011 0 ..... ..... @qrr_b RBIT_v 0.10 1110 011 00000 01011 0 ..... ..... @qrr_b +CMGT0_v 0.00 1110 ..1 00000 10001 0 ..... ..... @qrr_e +CMGE0_v 0.10 1110 ..1 00000 10001 0 ..... ..... @qrr_e +CMEQ0_v 0.00 1110 ..1 00000 10011 0 ..... ..... @qrr_e +CMLE0_v 0.10 1110 ..1 00000 10011 0 ..... ..... @qrr_e +CMLT0_v 0.00 1110 ..1 00000 10101 0 ..... ..... @qrr_e diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index aff1984a224..547c6dc5cc0 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -8902,6 +8902,22 @@ static bool do_scalar1_d(DisasContext *s, arg_rr *a, ArithOneOp *f) TRANS(ABS_s, do_scalar1_d, a, tcg_gen_abs_i64) TRANS(NEG_s, do_scalar1_d, a, tcg_gen_neg_i64) +static bool do_cmop0_d(DisasContext *s, arg_rr *a, TCGCond cond) +{ + if (fp_access_check(s)) { + TCGv_i64 t = read_fp_dreg(s, a->rn); + tcg_gen_negsetcond_i64(cond, t, t, tcg_constant_i64(0)); + write_fp_dreg(s, a->rd, t); + } + return true; +} + +TRANS(CMGT0_s, do_cmop0_d, a, TCG_COND_GT) +TRANS(CMGE0_s, do_cmop0_d, a, TCG_COND_GE) +TRANS(CMLE0_s, do_cmop0_d, a, TCG_COND_LE) +TRANS(CMLT0_s, do_cmop0_d, a, TCG_COND_LT) +TRANS(CMEQ0_s, do_cmop0_d, a, TCG_COND_EQ) + static bool do_gvec_fn2(DisasContext *s, arg_qrr_e *a, GVecGen2Fn *fn) { if (!a->q && a->esz == MO_64) { @@ -8918,6 +8934,11 @@ TRANS(NEG_v, do_gvec_fn2, a, tcg_gen_gvec_neg) TRANS(NOT_v, do_gvec_fn2, a, tcg_gen_gvec_not) TRANS(CNT_v, do_gvec_fn2, a, gen_gvec_cnt) TRANS(RBIT_v, do_gvec_fn2, a, gen_gvec_rbit) +TRANS(CMGT0_v, do_gvec_fn2, a, gen_gvec_cgt0) +TRANS(CMGE0_v, do_gvec_fn2, a, gen_gvec_cge0) +TRANS(CMLT0_v, do_gvec_fn2, a, gen_gvec_clt0) +TRANS(CMLE0_v, do_gvec_fn2, a, gen_gvec_cle0) +TRANS(CMEQ0_v, do_gvec_fn2, a, gen_gvec_ceq0) static bool do_gvec_fn2_bhs(DisasContext *s, arg_qrr_e *a, GVecGen2Fn *fn) { @@ -9229,21 +9250,7 @@ static void handle_2misc_64(DisasContext *s, int opcode, bool u, * The caller only need provide tcg_rmode and tcg_fpstatus if the op * requires them. */ - TCGCond cond; - switch (opcode) { - case 0xa: /* CMLT */ - cond = TCG_COND_LT; - do_cmop: - /* 64 bit integer comparison against zero, result is test ? -1 : 0. */ - tcg_gen_negsetcond_i64(cond, tcg_rd, tcg_rn, tcg_constant_i64(0)); - break; - case 0x8: /* CMGT, CMGE */ - cond = u ? TCG_COND_GE : TCG_COND_GT; - goto do_cmop; - case 0x9: /* CMEQ, CMLE */ - cond = u ? TCG_COND_LE : TCG_COND_EQ; - goto do_cmop; case 0x2f: /* FABS */ gen_vfp_absd(tcg_rd, tcg_rn); break; @@ -9290,6 +9297,9 @@ static void handle_2misc_64(DisasContext *s, int opcode, bool u, case 0x4: /* CLS, CLZ */ case 0x5: /* NOT */ case 0x7: /* SQABS, SQNEG */ + case 0x8: /* CMGT, CMGE */ + case 0x9: /* CMEQ, CMLE */ + case 0xa: /* CMLT */ case 0xb: /* ABS, NEG */ g_assert_not_reached(); } @@ -9633,19 +9643,6 @@ static void disas_simd_scalar_two_reg_misc(DisasContext *s, uint32_t insn) TCGv_ptr tcg_fpstatus; switch (opcode) { - case 0xa: /* CMLT */ - if (u) { - unallocated_encoding(s); - return; - } - /* fall through */ - case 0x8: /* CMGT, CMGE */ - case 0x9: /* CMEQ, CMLE */ - if (size != 3) { - unallocated_encoding(s); - return; - } - break; case 0x12: /* SQXTUN */ if (!u) { unallocated_encoding(s); @@ -9731,6 +9728,9 @@ static void disas_simd_scalar_two_reg_misc(DisasContext *s, uint32_t insn) default: case 0x3: /* USQADD / SUQADD */ case 0x7: /* SQABS / SQNEG */ + case 0x8: /* CMGT, CMGE */ + case 0x9: /* CMEQ, CMLE */ + case 0xa: /* CMLT */ case 0xb: /* ABS, NEG */ unallocated_encoding(s); return; @@ -10103,19 +10103,6 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) } handle_shll(s, is_q, size, rn, rd); return; - case 0xa: /* CMLT */ - if (u == 1) { - unallocated_encoding(s); - return; - } - /* fall through */ - case 0x8: /* CMGT, CMGE */ - case 0x9: /* CMEQ, CMLE */ - if (size == 3 && !is_q) { - unallocated_encoding(s); - return; - } - break; case 0xc ... 0xf: case 0x16 ... 0x1f: { @@ -10289,6 +10276,9 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) case 0x4: /* CLS, CLZ */ case 0x5: /* CNT, NOT, RBIT */ case 0x7: /* SQABS, SQNEG */ + case 0x8: /* CMGT, CMGE */ + case 0x9: /* CMEQ, CMLE */ + case 0xa: /* CMLT */ case 0xb: /* ABS, NEG */ unallocated_encoding(s); return; @@ -10309,30 +10299,6 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) tcg_rmode = NULL; } - switch (opcode) { - case 0x8: /* CMGT, CMGE */ - if (u) { - gen_gvec_fn2(s, is_q, rd, rn, gen_gvec_cge0, size); - } else { - gen_gvec_fn2(s, is_q, rd, rn, gen_gvec_cgt0, size); - } - return; - case 0x9: /* CMEQ, CMLE */ - if (u) { - gen_gvec_fn2(s, is_q, rd, rn, gen_gvec_cle0, size); - } else { - gen_gvec_fn2(s, is_q, rd, rn, gen_gvec_ceq0, size); - } - return; - case 0xa: /* CMLT */ - gen_gvec_fn2(s, is_q, rd, rn, gen_gvec_clt0, size); - return; - case 0x4: /* CLZ, CLS */ - case 0x5: /* CNT, NOT, RBIT */ - case 0xb: - g_assert_not_reached(); - } - if (size == 3) { /* All 64-bit element operations can be shared with scalar 2misc */ int pass; From patchwork Fri Dec 13 17:31:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850164 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1639994wry; Fri, 13 Dec 2024 09:38:00 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWUT6oEkHyqN347pnLxGhXwmifVkT0CSC/dvG1Z+JSH9S4ZZYAD/hV6NkiI2GIS/NrOFXGmDg==@linaro.org X-Google-Smtp-Source: AGHT+IFdA60N3j5VqyvicbpfQdq8CLA5o8azFDG7F1Pan1e4CMyg/tesn8iza5Acu9ipJJTkxzSd X-Received: by 2002:a05:6402:3815:b0:5d0:cca6:233a with SMTP id 4fb4d7f45d1cf-5d63c304267mr3764890a12.10.1734111480016; Fri, 13 Dec 2024 09:38:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111479; cv=none; d=google.com; s=arc-20240605; b=LPwTqs9X82qK4Z2VshW2NAm+RgG3thh5jyAeH9wtFtTG7Bi/XXi2DMPUwI7EfH87uy 1U4Pg4ftBexs/wHdRkNpZtuP+wUBnCYNeV/xcdb6+hC7lACUdZOcWnjxO6UNCGnalgXI W4augc9OFiGzuBYiYoaqiUbBaknbPdRQLiQ0C4x6VPGhWERcQvdrY0JLP4cXNoRY6wqE ec6D7FuMZzNZNRz2Jw/Q8N1TIKrhPRTOsBMdCdcmFhftXteIVwjQHSXyEVKELrg4eom2 MXrD9WmOXLWHk0HevE3AGARaZ3hDiljsxyHVnhmeaHzKPLLP+lkW+BvR0IJS6KiHrFNL tNUg== 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=GXSaw+3kLrlZyJ9p0fZlTKT0DF9Yt+Kmo3k1MijYscI=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=fxlFtapHvaSHNSFLz1M7z7FjZfgBKYrqgcSrHQmcMHAso/eybVqG2iF8RDJj+yhRLT d4jvO273auExewxg10YqiqYX6W2aDV7EdivBZBMPr9laPMfA+L3oWBoKp+0ktguNx4xA JXxhnuWE0kfzgpgZiwhiUHAJdjfPNi46MGCOLUUhdQP+1LCyBKwfkENgYo1qgfmHM5AU sdWgazZjfXx0HyOwNnx8pRWrtEypI5VdIK/IuSwMM04PJzQ0h1dL+8X9RLxXD4w9Tcv/ 7gK5GEhS0xzWL/Vzkjv95Buu8Hp3oWAblQdvVIzJ6Icjauuhm6UwNesV0AU48xHcbsep yFLw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zeDx3vyN; 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 4fb4d7f45d1cf-5d652add950si55905a12.60.2024.12.13.09.37.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:37:59 -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=zeDx3vyN; 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 1tM9YI-0000tA-6b; Fri, 13 Dec 2024 12:34: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 1tM9XU-0007G2-K8 for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:22 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9XS-0001cI-Gh for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:20 -0500 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-4361e89b6daso14311815e9.3 for ; Fri, 13 Dec 2024 09:33:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111197; x=1734715997; 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=GXSaw+3kLrlZyJ9p0fZlTKT0DF9Yt+Kmo3k1MijYscI=; b=zeDx3vyNw4+opz/jn+3FCnHbJZu+L30VEAtZY83pFpzs/KXS9PND50gRi1HuZWo3jf /j1a55BQngAFuZ8Muvxtx1t9zBFJk8BI7m19hKQN/bSR9IZ1h/cRpmdccKdSiLUC1C5E w6y08m3ylTW9OZQSFeYenXj/J6r7shnSKqvPcjdZ6wFie0nlZz0ELHQ7vbmCQ+4Bt2u6 t7JjhkJ/3X0EcEKz7NT3yBqvYeUO2BKv8Qe2B0w2/hpdlVK4uvJYDQrqqwsf1+QfTffj r2zTw2su3jk4Cd04dUcSm9kj+BD4qzu9v69EiCt7Fw+DZwkcIAV93tH4oSu//NfvhBO0 Twhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111197; x=1734715997; 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=GXSaw+3kLrlZyJ9p0fZlTKT0DF9Yt+Kmo3k1MijYscI=; b=nKw4JT02KFQovz9ybkMHI6XeqOdyMcO6eirAVBQp5tUt+dhegnr/NUdL8Ie/wf8nb6 aaedHEF6KR1b05fu0yzhhUkW6tbPfnMXZpWLa9ygzUHf/c8H23tIalo3fZt/35F3e5TA 0UQTTzXumONUvG4oT/d4a561pCb4sXUIpaNqYCkZURKypz9Q81pqx2w0yoWyZ4oknGZz JS54X2mjbLAAYoUsd+tjaflUt1ph6qsUn6qc7l01htLPDMw89h1anAa++twYf7EdLDDh B7ml9PV7HFhNJMCvQg8yLb+8qzgP9dHS/eQYXvFP+pIcTnNOjws+avHMTNC2mYVJ7EK2 2wbw== X-Gm-Message-State: AOJu0Yz2W13DzFgXjKRiKjZh45cx1L3Gl9SWWIAY2Xygchp7kIh6Oxjp Is4UGHHjpOIAfrn4O01DBKs5c78ahzcu2U7ZhNOfyNzARMIdhCTXouQLEvvr4y9lLtEvRbqK6ju z X-Gm-Gg: ASbGnctLFPKA4cCkNkhftQ7eZCny7vKdpuaxniyIIRCp3VSvGQOlDHDKMeTtsVc6Vsq /9Lk9YXZRK0n/7cI8jtac0QQfxdmFtY45oqS4VUQZBXumB9j/d+KErrKPeCGoW578eQtAMhYYuA MeVo8zvq1HPxRttjxMjb2MA98rfS7KZYKU5uIqa3ouEjFfIfklE23KYMKiueOyvuBdoyxyFI9n/ 6EdfCkifmD17dzhou8yIQWT5QKuokSUhAS4zQu4qt3DQNGINtyeDnu6QmYHow== X-Received: by 2002:a05:6000:18a3:b0:386:3e3c:ef1 with SMTP id ffacd0b85a97d-3888e0bd48fmr2358803f8f.35.1734111196800; Fri, 13 Dec 2024 09:33:16 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:16 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 42/85] target/arm: Introduce gen_gvec_rev{16,32,64} Date: Fri, 13 Dec 2024 17:31:46 +0000 Message-Id: <20241213173229.3308926-43-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x329.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: Richard Henderson Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-43-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/translate.h | 6 +++ target/arm/tcg/gengvec.c | 58 ++++++++++++++++++++++ target/arm/tcg/translate-neon.c | 88 +++++++-------------------------- 3 files changed, 81 insertions(+), 71 deletions(-) diff --git a/target/arm/tcg/translate.h b/target/arm/tcg/translate.h index cb8e1b2586a..342ebedafcb 100644 --- a/target/arm/tcg/translate.h +++ b/target/arm/tcg/translate.h @@ -586,6 +586,12 @@ void gen_gvec_cnt(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs, uint32_t opr_sz, uint32_t max_sz); void gen_gvec_rbit(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs, uint32_t opr_sz, uint32_t max_sz); +void gen_gvec_rev16(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs, + uint32_t opr_sz, uint32_t max_sz); +void gen_gvec_rev32(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs, + uint32_t opr_sz, uint32_t max_sz); +void gen_gvec_rev64(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs, + uint32_t opr_sz, uint32_t max_sz); /* * Forward to the isar_feature_* tests given a DisasContext pointer. diff --git a/target/arm/tcg/gengvec.c b/target/arm/tcg/gengvec.c index 85a0b504960..33c0a949581 100644 --- a/target/arm/tcg/gengvec.c +++ b/target/arm/tcg/gengvec.c @@ -2409,3 +2409,61 @@ void gen_gvec_rbit(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs, tcg_gen_gvec_2_ool(rd_ofs, rn_ofs, opr_sz, max_sz, 0, gen_helper_gvec_rbit_b); } + +void gen_gvec_rev16(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs, + uint32_t opr_sz, uint32_t max_sz) +{ + assert(vece == MO_8); + tcg_gen_gvec_rotli(MO_16, rd_ofs, rn_ofs, 8, opr_sz, max_sz); +} + +static void gen_bswap32_i64(TCGv_i64 d, TCGv_i64 n) +{ + tcg_gen_bswap64_i64(d, n); + tcg_gen_rotli_i64(d, d, 32); +} + +void gen_gvec_rev32(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs, + uint32_t opr_sz, uint32_t max_sz) +{ + static const GVecGen2 g = { + .fni8 = gen_bswap32_i64, + .fni4 = tcg_gen_bswap32_i32, + .prefer_i64 = TCG_TARGET_REG_BITS == 64, + .vece = MO_32 + }; + + switch (vece) { + case MO_16: + tcg_gen_gvec_rotli(MO_32, rd_ofs, rn_ofs, 16, opr_sz, max_sz); + break; + case MO_8: + tcg_gen_gvec_2(rd_ofs, rn_ofs, opr_sz, max_sz, &g); + break; + default: + g_assert_not_reached(); + } +} + +void gen_gvec_rev64(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs, + uint32_t opr_sz, uint32_t max_sz) +{ + static const GVecGen2 g[] = { + { .fni8 = tcg_gen_bswap64_i64, + .vece = MO_64 }, + { .fni8 = tcg_gen_hswap_i64, + .vece = MO_64 }, + }; + + switch (vece) { + case MO_32: + tcg_gen_gvec_rotli(MO_64, rd_ofs, rn_ofs, 32, opr_sz, max_sz); + break; + case MO_8: + case MO_16: + tcg_gen_gvec_2(rd_ofs, rn_ofs, opr_sz, max_sz, &g[vece]); + break; + default: + g_assert_not_reached(); + } +} diff --git a/target/arm/tcg/translate-neon.c b/target/arm/tcg/translate-neon.c index 50d0bf77531..ca6f5578b4f 100644 --- a/target/arm/tcg/translate-neon.c +++ b/target/arm/tcg/translate-neon.c @@ -2565,58 +2565,6 @@ static bool trans_VDUP_scalar(DisasContext *s, arg_VDUP_scalar *a) return true; } -static bool trans_VREV64(DisasContext *s, arg_VREV64 *a) -{ - int pass, half; - TCGv_i32 tmp[2]; - - if (!arm_dc_feature(s, ARM_FEATURE_NEON)) { - return false; - } - - /* UNDEF accesses to D16-D31 if they don't exist. */ - if (!dc_isar_feature(aa32_simd_r32, s) && - ((a->vd | a->vm) & 0x10)) { - return false; - } - - if ((a->vd | a->vm) & a->q) { - return false; - } - - if (a->size == 3) { - return false; - } - - if (!vfp_access_check(s)) { - return true; - } - - tmp[0] = tcg_temp_new_i32(); - tmp[1] = tcg_temp_new_i32(); - - for (pass = 0; pass < (a->q ? 2 : 1); pass++) { - for (half = 0; half < 2; half++) { - read_neon_element32(tmp[half], a->vm, pass * 2 + half, MO_32); - switch (a->size) { - case 0: - tcg_gen_bswap32_i32(tmp[half], tmp[half]); - break; - case 1: - gen_swap_half(tmp[half], tmp[half]); - break; - case 2: - break; - default: - g_assert_not_reached(); - } - } - write_neon_element32(tmp[1], a->vd, pass * 2, MO_32); - write_neon_element32(tmp[0], a->vd, pass * 2 + 1, MO_32); - } - return true; -} - static bool do_2misc_pairwise(DisasContext *s, arg_2misc *a, NeonGenWidenFn *widenfn, NeonGenTwo64OpFn *opfn, @@ -3122,6 +3070,7 @@ DO_2MISC_VEC(VCGE0, gen_gvec_cge0) DO_2MISC_VEC(VCLT0, gen_gvec_clt0) DO_2MISC_VEC(VCLS, gen_gvec_cls) DO_2MISC_VEC(VCLZ, gen_gvec_clz) +DO_2MISC_VEC(VREV64, gen_gvec_rev64) static bool trans_VMVN(DisasContext *s, arg_2misc *a) { @@ -3139,6 +3088,22 @@ static bool trans_VCNT(DisasContext *s, arg_2misc *a) return do_2misc_vec(s, a, gen_gvec_cnt); } +static bool trans_VREV16(DisasContext *s, arg_2misc *a) +{ + if (a->size != 0) { + return false; + } + return do_2misc_vec(s, a, gen_gvec_rev16); +} + +static bool trans_VREV32(DisasContext *s, arg_2misc *a) +{ + if (a->size != 0 && a->size != 1) { + return false; + } + return do_2misc_vec(s, a, gen_gvec_rev32); +} + #define WRAP_2M_3_OOL_FN(WRAPNAME, FUNC, DATA) \ static void WRAPNAME(unsigned vece, uint32_t rd_ofs, \ uint32_t rm_ofs, uint32_t oprsz, \ @@ -3218,25 +3183,6 @@ static bool do_2misc(DisasContext *s, arg_2misc *a, NeonGenOneOpFn *fn) return true; } -static bool trans_VREV32(DisasContext *s, arg_2misc *a) -{ - static NeonGenOneOpFn * const fn[] = { - tcg_gen_bswap32_i32, - gen_swap_half, - NULL, - NULL, - }; - return do_2misc(s, a, fn[a->size]); -} - -static bool trans_VREV16(DisasContext *s, arg_2misc *a) -{ - if (a->size != 0) { - return false; - } - return do_2misc(s, a, gen_rev16); -} - static void gen_VABS_F(unsigned vece, uint32_t rd_ofs, uint32_t rm_ofs, uint32_t oprsz, uint32_t maxsz) { From patchwork Fri Dec 13 17:31:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850142 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1638148wry; Fri, 13 Dec 2024 09:34:15 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUDQoA598ea/V4n5BqAaJbRUxZFpDLlkErwWS7WeD197hpAuhi09gewfzSuR5owZRzgS5dMtA==@linaro.org X-Google-Smtp-Source: AGHT+IFbXPHYyQsz6hICjRaNXEJBHyrO7Yuq/y8D2/CMYdfVEO8hDRszCN83hd8ZxcIe6P94IOeo X-Received: by 2002:a05:622a:4188:b0:467:7208:8eeb with SMTP id d75a77b69052e-467a583bbc8mr61552391cf.37.1734111255528; Fri, 13 Dec 2024 09:34:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111255; cv=none; d=google.com; s=arc-20240605; b=c6wXIicC7Q9NyphltCKZeNcxOL+jy/+tR+GpCrZrRyPaBvNwCbrg/yDsuAOpGZqzRZ I6Ru47zmHe8YX9fO1KFcyKaYcYYLXsjcEY/dx6wQYj0sWMsWp+OiCnks6vcLcRNb1k6L Kqv4nxTBmaEgjjoYDZ7ZY1ON/2EjSc3une0rNbVWeRk5qaDK1w2MVCNZwC7qQwTtlc6K OCLwSE0pY05uUs3Fnrpq5MhT5ix5H686gjpbUZU19jdQPjkIdpiHAwdYjtYOnhARBZjs 95/PeEH6XaNmC4Owh3SmrIWoeYgC6HXTECNIN1BP8vzx052fda/C2EW8wrInrG4xNjdq 2ecg== 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=Ia/Pwyy3pQUlvdfiW40J5tPZza+afz7n1+/d2AeByV0=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=kLL6wsJJCMBCkJQzzUacRRAFeuVjxsgrHOcpg3B4Fh9fgCOOf7WBa8EOCE0YEJUv2X P/GpENqEgESl3gtAp0ZU7MKjv6L0nO9PHe2GHSP7f4U4GbCwmDx3/SptDYbgp7pJOCQO OVblLCmNs5dDhfsQBlwEYvf6Zz98qoi6Hq5vB15dftIwllHgi+KpwYPyYl8/6W1RwsFv PYize0rB7/dlxVFBXqGcKGnJ3m4ec4H6dAeHO//1wHaijD21Hc7g9/4/E6fBtLCCHi/N 1m+mBlus1pGCBXvk5Zjb4iZ9BQ/KnRltbJ60oo2m2PH4y+tjJBmX0W4BKFaxfm/q+Nlo nGDw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KU0jO4+z; 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-46787395256si85052611cf.600.2024.12.13.09.34.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:34: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=KU0jO4+z; 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 1tM9Xk-0007pR-Si; Fri, 13 Dec 2024 12:33:36 -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 1tM9XX-0007Kd-Re for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:23 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9XW-0001cQ-0T for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:23 -0500 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-385df53e559so1604073f8f.3 for ; Fri, 13 Dec 2024 09:33:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111198; x=1734715998; 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=Ia/Pwyy3pQUlvdfiW40J5tPZza+afz7n1+/d2AeByV0=; b=KU0jO4+zhKWVEd/ohJUM8pdtiZ+5bwwVytbHMzDkBnF98EE5U7Vysu8/XjtvhkfJOK eG/Co/o3OKAS7j+LOPA/4y7+R4UUPBdakH0trapHrL3+zn4wQwBe5AdwQr6/DZd5a4WM IgOBPeb0PRUlvaImJtuceBH/yLv+v2EWQ33chK1rgi1f9r/yNi0I+8ZOulbz5VUG30Sk 1Y/kNMQzSyp6zk+nFu30M3KDLJ82BgoSxU3bozf+76oyCTn1w4cyGRIkWZBlPtDeHqoe 89EY4/fHLgX0HTJrjS+9Vgm8kzpKNR+dbVDl9XfX88WC9haEtLOGnehf94zd5r80dXOL 48vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111198; x=1734715998; 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=Ia/Pwyy3pQUlvdfiW40J5tPZza+afz7n1+/d2AeByV0=; b=SZT0wMf5f5/FEaRHFIbUu7IANEntVRFyj2KOW4XbozvT2V6tFBnLyL+UTJENOvoWu8 TazHbZ0HMUcLWPf2WwPIfX0ygLM7nnhPCaWS3I+kYLWDZEHvLXn+yDsxQN7+RLBbmKU7 HQWmlCYqofA4EVePPrWNUcHyGl+DObHZwZFPFRcQOdfqcPPVUnPPNmANfpWoeX2QMDLv OeSqjmhajSSPvBGHT0EfBKpapg60M5bBbhUCCkE2uDZl81Vdj9+XE82VYzsiYMz/RhUV Vb9YWXet762xoeoSCvg5p1KrN7VNFg/MtbJccw+1oNt7XtSw5abU8gQbzPF9FAsBfUpV EBRw== X-Gm-Message-State: AOJu0YwPad237Ch6yICPT2+oxsObIVd8C7qq3rsHTVIZJXt+lCXvY1Bv XorltC9xIatmY2wvO8hV7GwhKRh+1Khj7x29aK/JDTyUjCJquR0pc9rKCriOx2ygOhqkjl2txbL 4 X-Gm-Gg: ASbGncsEQyd8ePLoLgmj0C+3TZNWGDfnJrQsP+Sg5vJj2OFM34TVrDjDGTKsBWy6lp2 hKeL5HjfCckD0yLLSgswoP2eYR2VDbrO6tRpxGx8Z5ShGE4N56+4aQGua814Vbbn+67n2nxl43J piAqzCwQIL6KKABrtCzbvd6Bm7wwWIW3Nmz+F1bvnFuzfZpWsz0V9808b+DMZBgRXnLkGUqr/vI Hlo/ImIdFwAvWyxxhtrER8KWdqe2fDj2MWJDWsK1J69wqPB2embIFrmZmJJ8w== X-Received: by 2002:a5d:6c66:0:b0:385:f44a:a53 with SMTP id ffacd0b85a97d-38880af133amr3037422f8f.4.1734111197763; Fri, 13 Dec 2024 09:33:17 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:17 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 43/85] target/arm: Convert handle_rev to decodetree Date: Fri, 13 Dec 2024 17:31:47 +0000 Message-Id: <20241213173229.3308926-44-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x434.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson This includes REV16, REV32, REV64. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-44-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 5 +++ target/arm/tcg/translate-a64.c | 79 +++------------------------------- 2 files changed, 10 insertions(+), 74 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 247d3a7bda4..05f1bc99b52 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -73,6 +73,7 @@ @qrr_b . q:1 ...... .. ...... ...... rn:5 rd:5 &qrr_e esz=0 @qrr_h . q:1 ...... .. ...... ...... rn:5 rd:5 &qrr_e esz=1 +@qrr_bh . q:1 ...... . esz:1 ...... ...... rn:5 rd:5 &qrr_e @qrr_e . q:1 ...... esz:2 ...... ...... rn:5 rd:5 &qrr_e @qrrr_b . q:1 ...... ... rm:5 ...... rn:5 rd:5 &qrrr_e esz=0 @@ -1657,3 +1658,7 @@ CMGE0_v 0.10 1110 ..1 00000 10001 0 ..... ..... @qrr_e CMEQ0_v 0.00 1110 ..1 00000 10011 0 ..... ..... @qrr_e CMLE0_v 0.10 1110 ..1 00000 10011 0 ..... ..... @qrr_e CMLT0_v 0.00 1110 ..1 00000 10101 0 ..... ..... @qrr_e + +REV16_v 0.00 1110 001 00000 00011 0 ..... ..... @qrr_b +REV32_v 0.10 1110 0.1 00000 00001 0 ..... ..... @qrr_bh +REV64_v 0.00 1110 ..1 00000 00001 0 ..... ..... @qrr_e diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 547c6dc5cc0..f57b5e28556 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -8939,6 +8939,8 @@ TRANS(CMGE0_v, do_gvec_fn2, a, gen_gvec_cge0) TRANS(CMLT0_v, do_gvec_fn2, a, gen_gvec_clt0) TRANS(CMLE0_v, do_gvec_fn2, a, gen_gvec_cle0) TRANS(CMEQ0_v, do_gvec_fn2, a, gen_gvec_ceq0) +TRANS(REV16_v, do_gvec_fn2, a, gen_gvec_rev16) +TRANS(REV32_v, do_gvec_fn2, a, gen_gvec_rev32) static bool do_gvec_fn2_bhs(DisasContext *s, arg_qrr_e *a, GVecGen2Fn *fn) { @@ -8953,6 +8955,7 @@ static bool do_gvec_fn2_bhs(DisasContext *s, arg_qrr_e *a, GVecGen2Fn *fn) TRANS(CLS_v, do_gvec_fn2_bhs, a, gen_gvec_cls) TRANS(CLZ_v, do_gvec_fn2_bhs, a, gen_gvec_clz) +TRANS(REV64_v, do_gvec_fn2_bhs, a, gen_gvec_rev64) /* Common vector code for handling integer to FP conversion */ static void handle_simd_intfp_conv(DisasContext *s, int rd, int rn, @@ -9882,76 +9885,6 @@ static void handle_2misc_widening(DisasContext *s, int opcode, bool is_q, } } -static void handle_rev(DisasContext *s, int opcode, bool u, - bool is_q, int size, int rn, int rd) -{ - int op = (opcode << 1) | u; - int opsz = op + size; - int grp_size = 3 - opsz; - int dsize = is_q ? 128 : 64; - int i; - - if (opsz >= 3) { - unallocated_encoding(s); - return; - } - - if (!fp_access_check(s)) { - return; - } - - if (size == 0) { - /* Special case bytes, use bswap op on each group of elements */ - int groups = dsize / (8 << grp_size); - - for (i = 0; i < groups; i++) { - TCGv_i64 tcg_tmp = tcg_temp_new_i64(); - - read_vec_element(s, tcg_tmp, rn, i, grp_size); - switch (grp_size) { - case MO_16: - tcg_gen_bswap16_i64(tcg_tmp, tcg_tmp, TCG_BSWAP_IZ); - break; - case MO_32: - tcg_gen_bswap32_i64(tcg_tmp, tcg_tmp, TCG_BSWAP_IZ); - break; - case MO_64: - tcg_gen_bswap64_i64(tcg_tmp, tcg_tmp); - break; - default: - g_assert_not_reached(); - } - write_vec_element(s, tcg_tmp, rd, i, grp_size); - } - clear_vec_high(s, is_q, rd); - } else { - int revmask = (1 << grp_size) - 1; - int esize = 8 << size; - int elements = dsize / esize; - TCGv_i64 tcg_rn = tcg_temp_new_i64(); - TCGv_i64 tcg_rd[2]; - - for (i = 0; i < 2; i++) { - tcg_rd[i] = tcg_temp_new_i64(); - tcg_gen_movi_i64(tcg_rd[i], 0); - } - - for (i = 0; i < elements; i++) { - int e_rev = (i & 0xf) ^ revmask; - int w = (e_rev * esize) / 64; - int o = (e_rev * esize) % 64; - - read_vec_element(s, tcg_rn, rn, i, size); - tcg_gen_deposit_i64(tcg_rd[w], tcg_rd[w], tcg_rn, o, esize); - } - - for (i = 0; i < 2; i++) { - write_vec_element(s, tcg_rd[i], rd, i, MO_64); - } - clear_vec_high(s, true, rd); - } -} - static void handle_2misc_pairwise(DisasContext *s, int opcode, bool u, bool is_q, int size, int rn, int rd) { @@ -10066,10 +9999,6 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) TCGv_ptr tcg_fpstatus; switch (opcode) { - case 0x0: /* REV64, REV32 */ - case 0x1: /* REV16 */ - handle_rev(s, opcode, u, is_q, size, rn, rd); - return; case 0x12: /* XTN, XTN2, SQXTUN, SQXTUN2 */ case 0x14: /* SQXTN, SQXTN2, UQXTN, UQXTN2 */ if (size == 3) { @@ -10272,6 +10201,8 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) break; } default: + case 0x0: /* REV64, REV32 */ + case 0x1: /* REV16 */ case 0x3: /* SUQADD, USQADD */ case 0x4: /* CLS, CLZ */ case 0x5: /* CNT, NOT, RBIT */ From patchwork Fri Dec 13 17:31:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850192 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1642444wry; Fri, 13 Dec 2024 09:43:23 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWcv/9snMBijdtpMhfRg37ALASrX1BAS1cl/TjsfX6e2qxraQw8wnSA2wrHX6755jJGgG+u5g==@linaro.org X-Google-Smtp-Source: AGHT+IFQ74l8wAZrwAeANlPgGdlN/2CQO4S5SjX/Xar1RRNw1fDYKKnorlTLhNmTc1ynL/uqJZdz X-Received: by 2002:a05:6000:1ac9:b0:385:f7ea:eb86 with SMTP id ffacd0b85a97d-38880af1463mr2867625f8f.7.1734111803721; Fri, 13 Dec 2024 09:43:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111803; cv=none; d=google.com; s=arc-20240605; b=QsGlRgNhjKJneSKn/ygvJHIPCUxrKW8/AeLwCrNBCdRUQGiAOc+Ecmxa2OEBSKM7k0 STYoCNgXGMWlVVlxVkVTD1E1H+GrcD6rVxfjCh/eWfx75OWuf2SbN7ScnW64qCBuL74z BF10s20MWNWO0PYGa4A9KnveEpi4Ez7v7zMX0hZFK/0Mhum5lNnzNLCWCTe30A/hhgR5 tnea0iyBKpNwKeqJk079N0n9GvfGbrNtVw10ycESavyxRA0RmhIr4WW0RbQsbpZpIaty s1uTEYqyPoCCyQp2s/ItwRaA70/dqRFW6YGiaTP7j4IeU9eQTZj8m1hCgLxYuRUnt/GC vKlA== 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=NSpguoVKHkEY8yFMot0pfTmRRiiKpZjSQlyw+H/MBlc=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=Mj6doyznsLs7vI6HsePKS5+eJitQbc7Jsh/Fujek/u7xKAX43B3VnHmjOYQ8DSob/f h2/5bXK1h8GXRqy4H8Wh/7e1LYpsGaqKMBCICsdOPqNm8iS7d3XlSWUFpVl0Z9jyVZkI o+msKxDn4dwyMmEbWeBwATZsXFSqBIgbe+B9uqCsRDVl1EWhmAfN3t8K5mmBBOdUF4Tw yNgL3q5apfHZKl7D4hl69IAXXRqS9NeoZ9Yr7JCOyG5oKkYDQrhfayZkhu9RCdZzMXh+ I2ts7ZeogtxjLpkkN1TGQV2zAdpyn+v9NITmJkO1x+ZFnkG0i2INnl6Jde0n82JMBMaz dnoQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=M683dYCo; 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 ffacd0b85a97d-388c804db71si41296f8f.446.2024.12.13.09.43.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:43:23 -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=M683dYCo; 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 1tM9YE-0000MA-Fi; Fri, 13 Dec 2024 12:34:06 -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 1tM9Xb-0007Rc-OC for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:27 -0500 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9XV-0001d0-7c for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:27 -0500 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-385de9f789cso1544283f8f.2 for ; Fri, 13 Dec 2024 09:33:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111199; x=1734715999; 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=NSpguoVKHkEY8yFMot0pfTmRRiiKpZjSQlyw+H/MBlc=; b=M683dYCo2qCy23JGyH6xoUGwuvOTRi0hGqM6GuF7Zt3bOlyip/tdCnGTmtJfDb5WfI e70hiK/GcyLpJ/QRcFQRWFktmYbDzHcpg6uYHn/cxppbu8ofN2jAzP4PW/BpEqbzI6NH 71qiw2ln0xNiQeRisr/ooUff8mDoUCZFpAdOQQvVgUpB17LhljMAf3BRaYH9CPAvrGc2 vnzzQHMDUN/dyssyscrGSNp67/jpm4xX1t64g9rcc4MV7kqpZNUBhG/X+qbe7NVY/FAq dCEK34azGYilqMNNlB5sr684kgmJUl1NuJTWLQLVzTqoOpgN71hAWTap801d8ZIu8W1W fiOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111199; x=1734715999; 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=NSpguoVKHkEY8yFMot0pfTmRRiiKpZjSQlyw+H/MBlc=; b=dWpg7T5d4hArrGSZI7nd0xh/y2SX2PkFWJau5FgE+QW0LtBXV1ZEK/evEWF1jr8PSJ yTZPGZBcGx/Qw/pz0doUjTu/X66KM/buKHK8lGjWnqhkqihNP4DuRqD1KJaYBHWNwWTn OMIwHE9kVls+KLLcFcBwERqm4Gu5xC8jGVnl76xtEc6fCjlkBaunAvKMhpTYAoGmbrqA JfacCWysG5uZkqXkEXmk4Phpm/k/lZoY0vOXw+1ky+MxHO8bb8a8HqITMCcXH1bqqA9H 7aE5pEEZO9LZeigybdkf6TqqV7vT3DJMXqOUt8KOOkcKvgD6ZBjRntbzlAUE1yoGV2nd 22EA== X-Gm-Message-State: AOJu0YxuujQeNf527fsp5gzGgSRg4Yj2sbMH7fgQmKpFBq7iEUXHrqYC oQ9okHpTszll4rohEVR8JRc8k44BGeYv+dLFyg8yVBd6VhtABrN2lH28VioKsBR4fkRzu5DUZ7e W X-Gm-Gg: ASbGncukGxkLsFuvwgxQcrbFYZJLOZ44NS/rYboPd8CPS7cIukdHBfQz19fgWqrPo3v c8lChcq0Nz1y44fXL0QodE9SDIGFJSvAB9wwtMi1SS0f6ogUxdLfGhV3z+fZobftdwmTZHA/YKU jHbtG5AoJKv9Du5YfSs0ZszTWOUtlhe5DJw1uFHvYRfPMgb/Y9UeW+xNKOn4DEvzG02gsi2d6+X RX4WCZWP8SinXsNlXAs7vKYWLvf5709sLlm5PgB99ITuplaVomskmRhWIUhKw== X-Received: by 2002:a05:6000:4b12:b0:385:fa26:f0d9 with SMTP id ffacd0b85a97d-3886c725060mr3508365f8f.0.1734111199342; Fri, 13 Dec 2024 09:33:19 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:18 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 44/85] target/arm: Move helper_neon_addlp_{s8, s16} to neon_helper.c Date: Fri, 13 Dec 2024 17:31:48 +0000 Message-Id: <20241213173229.3308926-45-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x429.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Move from helper-a64.c to neon_helper.c so that these functions are available for arm32 code as well. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-45-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/helper.h | 2 ++ target/arm/tcg/helper-a64.h | 2 -- target/arm/tcg/helper-a64.c | 43 ------------------------------------ target/arm/tcg/neon_helper.c | 43 ++++++++++++++++++++++++++++++++++++ 4 files changed, 45 insertions(+), 45 deletions(-) diff --git a/target/arm/helper.h b/target/arm/helper.h index 167e331a83e..57e0ce387bb 100644 --- a/target/arm/helper.h +++ b/target/arm/helper.h @@ -399,6 +399,8 @@ DEF_HELPER_2(neon_addl_u16, i64, i64, i64) DEF_HELPER_2(neon_addl_u32, i64, i64, i64) DEF_HELPER_2(neon_paddl_u16, i64, i64, i64) DEF_HELPER_2(neon_paddl_u32, i64, i64, i64) +DEF_HELPER_FLAGS_1(neon_addlp_s8, TCG_CALL_NO_RWG_SE, i64, i64) +DEF_HELPER_FLAGS_1(neon_addlp_s16, TCG_CALL_NO_RWG_SE, i64, i64) DEF_HELPER_2(neon_subl_u16, i64, i64, i64) DEF_HELPER_2(neon_subl_u32, i64, i64, i64) DEF_HELPER_3(neon_addl_saturate_s32, i64, env, i64, i64) diff --git a/target/arm/tcg/helper-a64.h b/target/arm/tcg/helper-a64.h index 203b7b7ac82..f811bb85dcb 100644 --- a/target/arm/tcg/helper-a64.h +++ b/target/arm/tcg/helper-a64.h @@ -41,9 +41,7 @@ DEF_HELPER_FLAGS_3(recpsf_f64, TCG_CALL_NO_RWG, f64, f64, f64, ptr) DEF_HELPER_FLAGS_3(rsqrtsf_f16, TCG_CALL_NO_RWG, f16, f16, f16, ptr) DEF_HELPER_FLAGS_3(rsqrtsf_f32, TCG_CALL_NO_RWG, f32, f32, f32, ptr) DEF_HELPER_FLAGS_3(rsqrtsf_f64, TCG_CALL_NO_RWG, f64, f64, f64, ptr) -DEF_HELPER_FLAGS_1(neon_addlp_s8, TCG_CALL_NO_RWG_SE, i64, i64) DEF_HELPER_FLAGS_1(neon_addlp_u8, TCG_CALL_NO_RWG_SE, i64, i64) -DEF_HELPER_FLAGS_1(neon_addlp_s16, TCG_CALL_NO_RWG_SE, i64, i64) DEF_HELPER_FLAGS_1(neon_addlp_u16, TCG_CALL_NO_RWG_SE, i64, i64) DEF_HELPER_FLAGS_2(frecpx_f64, TCG_CALL_NO_RWG, f64, f64, ptr) DEF_HELPER_FLAGS_2(frecpx_f32, TCG_CALL_NO_RWG, f32, f32, ptr) diff --git a/target/arm/tcg/helper-a64.c b/target/arm/tcg/helper-a64.c index 3f4d7b9aba6..9b3c407be3c 100644 --- a/target/arm/tcg/helper-a64.c +++ b/target/arm/tcg/helper-a64.c @@ -306,39 +306,6 @@ float64 HELPER(rsqrtsf_f64)(float64 a, float64 b, void *fpstp) return float64_muladd(a, b, float64_three, float_muladd_halve_result, fpst); } -/* Pairwise long add: add pairs of adjacent elements into - * double-width elements in the result (eg _s8 is an 8x8->16 op) - */ -uint64_t HELPER(neon_addlp_s8)(uint64_t a) -{ - uint64_t nsignmask = 0x0080008000800080ULL; - uint64_t wsignmask = 0x8000800080008000ULL; - uint64_t elementmask = 0x00ff00ff00ff00ffULL; - uint64_t tmp1, tmp2; - uint64_t res, signres; - - /* Extract odd elements, sign extend each to a 16 bit field */ - tmp1 = a & elementmask; - tmp1 ^= nsignmask; - tmp1 |= wsignmask; - tmp1 = (tmp1 - nsignmask) ^ wsignmask; - /* Ditto for the even elements */ - tmp2 = (a >> 8) & elementmask; - tmp2 ^= nsignmask; - tmp2 |= wsignmask; - tmp2 = (tmp2 - nsignmask) ^ wsignmask; - - /* calculate the result by summing bits 0..14, 16..22, etc, - * and then adjusting the sign bits 15, 23, etc manually. - * This ensures the addition can't overflow the 16 bit field. - */ - signres = (tmp1 ^ tmp2) & wsignmask; - res = (tmp1 & ~wsignmask) + (tmp2 & ~wsignmask); - res ^= signres; - - return res; -} - uint64_t HELPER(neon_addlp_u8)(uint64_t a) { uint64_t tmp; @@ -348,16 +315,6 @@ uint64_t HELPER(neon_addlp_u8)(uint64_t a) return tmp; } -uint64_t HELPER(neon_addlp_s16)(uint64_t a) -{ - int32_t reslo, reshi; - - reslo = (int32_t)(int16_t)a + (int32_t)(int16_t)(a >> 16); - reshi = (int32_t)(int16_t)(a >> 32) + (int32_t)(int16_t)(a >> 48); - - return (uint32_t)reslo | (((uint64_t)reshi) << 32); -} - uint64_t HELPER(neon_addlp_u16)(uint64_t a) { uint64_t tmp; diff --git a/target/arm/tcg/neon_helper.c b/target/arm/tcg/neon_helper.c index 4e501925dec..b92ddd4914d 100644 --- a/target/arm/tcg/neon_helper.c +++ b/target/arm/tcg/neon_helper.c @@ -866,6 +866,49 @@ uint64_t HELPER(neon_paddl_u32)(uint64_t a, uint64_t b) return low + ((uint64_t)high << 32); } +/* Pairwise long add: add pairs of adjacent elements into + * double-width elements in the result (eg _s8 is an 8x8->16 op) + */ +uint64_t HELPER(neon_addlp_s8)(uint64_t a) +{ + uint64_t nsignmask = 0x0080008000800080ULL; + uint64_t wsignmask = 0x8000800080008000ULL; + uint64_t elementmask = 0x00ff00ff00ff00ffULL; + uint64_t tmp1, tmp2; + uint64_t res, signres; + + /* Extract odd elements, sign extend each to a 16 bit field */ + tmp1 = a & elementmask; + tmp1 ^= nsignmask; + tmp1 |= wsignmask; + tmp1 = (tmp1 - nsignmask) ^ wsignmask; + /* Ditto for the even elements */ + tmp2 = (a >> 8) & elementmask; + tmp2 ^= nsignmask; + tmp2 |= wsignmask; + tmp2 = (tmp2 - nsignmask) ^ wsignmask; + + /* calculate the result by summing bits 0..14, 16..22, etc, + * and then adjusting the sign bits 15, 23, etc manually. + * This ensures the addition can't overflow the 16 bit field. + */ + signres = (tmp1 ^ tmp2) & wsignmask; + res = (tmp1 & ~wsignmask) + (tmp2 & ~wsignmask); + res ^= signres; + + return res; +} + +uint64_t HELPER(neon_addlp_s16)(uint64_t a) +{ + int32_t reslo, reshi; + + reslo = (int32_t)(int16_t)a + (int32_t)(int16_t)(a >> 16); + reshi = (int32_t)(int16_t)(a >> 32) + (int32_t)(int16_t)(a >> 48); + + return (uint32_t)reslo | (((uint64_t)reshi) << 32); +} + uint64_t HELPER(neon_subl_u16)(uint64_t a, uint64_t b) { uint64_t mask; From patchwork Fri Dec 13 17:31:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850158 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1639903wry; Fri, 13 Dec 2024 09:37:51 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVMieoCu92+Pava8JZDT7weLBuu9o9Nu63k2631btE9/blavQcTMqcOUR7FbZ2D1D50EyaHWw==@linaro.org X-Google-Smtp-Source: AGHT+IEf+iEtQICEuNzXV8Sqa/3mq6LkqVNgdnv8NPwwj6IpzQ2eoLwecriEe5ziWvimWNJawN+F X-Received: by 2002:a17:907:7da0:b0:aa5:b1bb:10db with SMTP id a640c23a62f3a-aa6c40bd748mr766273966b.1.1734111471706; Fri, 13 Dec 2024 09:37:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111471; cv=none; d=google.com; s=arc-20240605; b=Rr8y3e8eNiFZjyxpyMhKXSgSxuVkheFj697Wdw1uuGiLqxGltYi9pxO/gRoFcgLHr7 9gpcpB3A9TvlDl2nhKPXVwoTPRIxGLwwDbspjH1tbBSqgr3OxydMXSzgDkeSWVzsvmb0 lWlSZSlGMPt+Uh1SZ3xgx7MpoT18JMt5J+X7rg7i+0OP/BPByXfwAMjUvDaZcv6+0s2T iyJAV4KaTJgCGrNM0UFI1aWgu4pMl0ysIk70nKD9my0YfgVnCYbszNjx39qDu9t9Qrft RyO0ldSqJIFHbp7UhszUXprj0up/tr9d+R6DG332vQcSNmJNpzEAmQhglKCTCPE57MKS fv2A== 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=KV2itz7dcsIBmBVqUMDklJX+m7gDYSi6vqrsd0bJU1o=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=daTaDrjU5czPS5/5IxhJEZPtJBoUUHsnB2J9iOCLWhCO9KeyUMSPzamO0sTb67ZFYA BUSfE3TtK9Tn5wwq8J5aRYktDgdfJvXBi3lz7P1Sa85WBFqBYx5lROtJvNzHkYooND5i Cf/0fXIJjrYyAOzOxWA53gY2bUiCR6EMK0hMFBS13SUZjo1/rKBrTdTNTqAzPBTxr5R4 dxnU+Cb6BQLdOZjdD4k21j29jpIrQhDqBD/Cgg9LC9wCGcSU/twzHEae9X20JHhkKTDj u+EfR0VPHHBcgMB4G2lC7K6PEbM7hHIqo0Tcf+D4AnfM8KQuWHBCX3xv3hlpF4sIjcST ZO/w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ur2vzLBU; 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 a640c23a62f3a-aa67dad42a2si875958766b.953.2024.12.13.09.37.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:37:51 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ur2vzLBU; 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 1tM9Yq-0005OF-Sm; Fri, 13 Dec 2024 12:34:45 -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 1tM9Xb-0007R2-2o for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:27 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9XY-0001dF-Dd for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:26 -0500 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-3862d16b4f5so1351840f8f.0 for ; Fri, 13 Dec 2024 09:33:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111201; x=1734716001; 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=KV2itz7dcsIBmBVqUMDklJX+m7gDYSi6vqrsd0bJU1o=; b=ur2vzLBUDq9OwbQV/gSYYqEcX85vkc7Fkm86aK0wC9TbS9daRay3LTNui03qn9Xx44 bZ6OjWieLlKF9J112HV6OjwkIih/rx5pInAUlx6I542t8UHCMuZauHSpp3WoaKa/Dm1D iDvbrqVOK13i/bj0X/PuTfM2vXVztzSFBUoJ1sLQ4Z2uQ2elk4W0ECs5xO4vojwghPig ODwEbmq+8LGfAjW0ewGnPnqdVfqwQpyhx0Tc996VmeJsbbFPpB0GfXQS3ZNuGjMZ2Ogb zOGcwU/SW5UMkxREbQfUDEtpZkjBaawNn/ya59QN4SOM2fWgFQHis+WJVD9snG5aGhE2 dJew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111201; x=1734716001; 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=KV2itz7dcsIBmBVqUMDklJX+m7gDYSi6vqrsd0bJU1o=; b=A36sVrzDJHYaw4/ejKg4M4HgQgqXJc1wK5NVqlNF4B/74DcXLgJuUK6/R3LWGUbT3K btMEusmffvfTi5RWWX/7GX+IpKS2tiK488LS3d7mHB+44FuwLNUcR0v8HMKB08uKXT07 4q4SfLnRh9jziqAXVgNEy1MjtOTqaoQLtjXptkQKdwSUO5EdTSlBnD4zWQfL2WW8t/29 FiquKR4CyUZ8ecOtSyarNcTbvX/Ml0FH+w8moLJTp3VvIzugBszVrUhJ0F7S5Sw/OM79 a7jrH+J6+fwdo6VD3YD62sF51d23Futpw30NYeG6fnvLPK68BxpSh/uaVqXXzBJ44CsF Yzwg== X-Gm-Message-State: AOJu0YyCaR73EyW8ujhRqIG9BR7RdVtmmFEgz+agT3npJIMApT3aAivZ U5m3YCkYcvkmkjJqJwlNCMD/znIb+dr8Zp7ITD5Fefd2kvvafcuQb0cNazP3FeZgKho9+BChN1f f X-Gm-Gg: ASbGncucr4G2ceB4dPhQy4+wHYXgS3hSJJn5w6I1wj1Jf+kygMppa1RDysJ+OtIci6S AuFBdvyiliwNNNS+xW2SxuCZzigjhrLp9PqSRkfoH7kP599GwcijgcQGUYhk6VNHxRf/5PJa/8t QvrYDUvZij4aKNSFhaYWrSS9VQJAxLa5p2Fe4+I7MaHlPM+VhRkEw6gWjcz4/o3wKwUBIbEAfUL WCoHsp7RXyJSlhwYAbmZNaxvG2lE3iR8OcSawAzvIo1oWHEzCvjDg3DdET3YQ== X-Received: by 2002:a05:6000:1543:b0:386:2e8c:e26d with SMTP id ffacd0b85a97d-3878840808emr6807990f8f.0.1734111200659; Fri, 13 Dec 2024 09:33:20 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:19 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 45/85] target/arm: Introduce gen_gvec_{s,u}{add,ada}lp Date: Fri, 13 Dec 2024 17:31:49 +0000 Message-Id: <20241213173229.3308926-46-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x432.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Pairwise addition with and without accumulation. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-46-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/helper.h | 2 - target/arm/tcg/translate.h | 9 ++ target/arm/tcg/gengvec.c | 230 ++++++++++++++++++++++++++++++++ target/arm/tcg/neon_helper.c | 22 --- target/arm/tcg/translate-neon.c | 150 +-------------------- 5 files changed, 243 insertions(+), 170 deletions(-) diff --git a/target/arm/helper.h b/target/arm/helper.h index 57e0ce387bb..6369d07d053 100644 --- a/target/arm/helper.h +++ b/target/arm/helper.h @@ -397,8 +397,6 @@ DEF_HELPER_1(neon_widen_s16, i64, i32) DEF_HELPER_2(neon_addl_u16, i64, i64, i64) DEF_HELPER_2(neon_addl_u32, i64, i64, i64) -DEF_HELPER_2(neon_paddl_u16, i64, i64, i64) -DEF_HELPER_2(neon_paddl_u32, i64, i64, i64) DEF_HELPER_FLAGS_1(neon_addlp_s8, TCG_CALL_NO_RWG_SE, i64, i64) DEF_HELPER_FLAGS_1(neon_addlp_s16, TCG_CALL_NO_RWG_SE, i64, i64) DEF_HELPER_2(neon_subl_u16, i64, i64, i64) diff --git a/target/arm/tcg/translate.h b/target/arm/tcg/translate.h index 342ebedafcb..edd775d5640 100644 --- a/target/arm/tcg/translate.h +++ b/target/arm/tcg/translate.h @@ -593,6 +593,15 @@ void gen_gvec_rev32(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs, void gen_gvec_rev64(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs, uint32_t opr_sz, uint32_t max_sz); +void gen_gvec_saddlp(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs, + uint32_t opr_sz, uint32_t max_sz); +void gen_gvec_sadalp(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs, + uint32_t opr_sz, uint32_t max_sz); +void gen_gvec_uaddlp(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs, + uint32_t opr_sz, uint32_t max_sz); +void gen_gvec_uadalp(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs, + uint32_t opr_sz, uint32_t max_sz); + /* * Forward to the isar_feature_* tests given a DisasContext pointer. */ diff --git a/target/arm/tcg/gengvec.c b/target/arm/tcg/gengvec.c index 33c0a949581..2755da8ac71 100644 --- a/target/arm/tcg/gengvec.c +++ b/target/arm/tcg/gengvec.c @@ -2467,3 +2467,233 @@ void gen_gvec_rev64(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs, g_assert_not_reached(); } } + +static void gen_saddlp_vec(unsigned vece, TCGv_vec d, TCGv_vec n) +{ + int half = 4 << vece; + TCGv_vec t = tcg_temp_new_vec_matching(d); + + tcg_gen_shli_vec(vece, t, n, half); + tcg_gen_sari_vec(vece, d, n, half); + tcg_gen_sari_vec(vece, t, t, half); + tcg_gen_add_vec(vece, d, d, t); +} + +static void gen_saddlp_s_i64(TCGv_i64 d, TCGv_i64 n) +{ + TCGv_i64 t = tcg_temp_new_i64(); + + tcg_gen_ext32s_i64(t, n); + tcg_gen_sari_i64(d, n, 32); + tcg_gen_add_i64(d, d, t); +} + +void gen_gvec_saddlp(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs, + uint32_t opr_sz, uint32_t max_sz) +{ + static const TCGOpcode vecop_list[] = { + INDEX_op_sari_vec, INDEX_op_shli_vec, INDEX_op_add_vec, 0 + }; + static const GVecGen2 g[] = { + { .fniv = gen_saddlp_vec, + .fni8 = gen_helper_neon_addlp_s8, + .opt_opc = vecop_list, + .vece = MO_16 }, + { .fniv = gen_saddlp_vec, + .fni8 = gen_helper_neon_addlp_s16, + .opt_opc = vecop_list, + .vece = MO_32 }, + { .fniv = gen_saddlp_vec, + .fni8 = gen_saddlp_s_i64, + .opt_opc = vecop_list, + .vece = MO_64 }, + }; + assert(vece <= MO_32); + tcg_gen_gvec_2(rd_ofs, rn_ofs, opr_sz, max_sz, &g[vece]); +} + +static void gen_sadalp_vec(unsigned vece, TCGv_vec d, TCGv_vec n) +{ + TCGv_vec t = tcg_temp_new_vec_matching(d); + + gen_saddlp_vec(vece, t, n); + tcg_gen_add_vec(vece, d, d, t); +} + +static void gen_sadalp_b_i64(TCGv_i64 d, TCGv_i64 n) +{ + TCGv_i64 t = tcg_temp_new_i64(); + + gen_helper_neon_addlp_s8(t, n); + tcg_gen_vec_add16_i64(d, d, t); +} + +static void gen_sadalp_h_i64(TCGv_i64 d, TCGv_i64 n) +{ + TCGv_i64 t = tcg_temp_new_i64(); + + gen_helper_neon_addlp_s16(t, n); + tcg_gen_vec_add32_i64(d, d, t); +} + +static void gen_sadalp_s_i64(TCGv_i64 d, TCGv_i64 n) +{ + TCGv_i64 t = tcg_temp_new_i64(); + + gen_saddlp_s_i64(t, n); + tcg_gen_add_i64(d, d, t); +} + +void gen_gvec_sadalp(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs, + uint32_t opr_sz, uint32_t max_sz) +{ + static const TCGOpcode vecop_list[] = { + INDEX_op_sari_vec, INDEX_op_shli_vec, INDEX_op_add_vec, 0 + }; + static const GVecGen2 g[] = { + { .fniv = gen_sadalp_vec, + .fni8 = gen_sadalp_b_i64, + .opt_opc = vecop_list, + .load_dest = true, + .vece = MO_16 }, + { .fniv = gen_sadalp_vec, + .fni8 = gen_sadalp_h_i64, + .opt_opc = vecop_list, + .load_dest = true, + .vece = MO_32 }, + { .fniv = gen_sadalp_vec, + .fni8 = gen_sadalp_s_i64, + .opt_opc = vecop_list, + .load_dest = true, + .vece = MO_64 }, + }; + assert(vece <= MO_32); + tcg_gen_gvec_2(rd_ofs, rn_ofs, opr_sz, max_sz, &g[vece]); +} + +static void gen_uaddlp_vec(unsigned vece, TCGv_vec d, TCGv_vec n) +{ + int half = 4 << vece; + TCGv_vec t = tcg_temp_new_vec_matching(d); + TCGv_vec m = tcg_constant_vec_matching(d, vece, MAKE_64BIT_MASK(0, half)); + + tcg_gen_shri_vec(vece, t, n, half); + tcg_gen_and_vec(vece, d, n, m); + tcg_gen_add_vec(vece, d, d, t); +} + +static void gen_uaddlp_b_i64(TCGv_i64 d, TCGv_i64 n) +{ + TCGv_i64 t = tcg_temp_new_i64(); + TCGv_i64 m = tcg_constant_i64(dup_const(MO_16, 0xff)); + + tcg_gen_shri_i64(t, n, 8); + tcg_gen_and_i64(d, n, m); + tcg_gen_and_i64(t, t, m); + /* No carry between widened unsigned elements. */ + tcg_gen_add_i64(d, d, t); +} + +static void gen_uaddlp_h_i64(TCGv_i64 d, TCGv_i64 n) +{ + TCGv_i64 t = tcg_temp_new_i64(); + TCGv_i64 m = tcg_constant_i64(dup_const(MO_32, 0xffff)); + + tcg_gen_shri_i64(t, n, 16); + tcg_gen_and_i64(d, n, m); + tcg_gen_and_i64(t, t, m); + /* No carry between widened unsigned elements. */ + tcg_gen_add_i64(d, d, t); +} + +static void gen_uaddlp_s_i64(TCGv_i64 d, TCGv_i64 n) +{ + TCGv_i64 t = tcg_temp_new_i64(); + + tcg_gen_ext32u_i64(t, n); + tcg_gen_shri_i64(d, n, 32); + tcg_gen_add_i64(d, d, t); +} + +void gen_gvec_uaddlp(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs, + uint32_t opr_sz, uint32_t max_sz) +{ + static const TCGOpcode vecop_list[] = { + INDEX_op_shri_vec, INDEX_op_add_vec, 0 + }; + static const GVecGen2 g[] = { + { .fniv = gen_uaddlp_vec, + .fni8 = gen_uaddlp_b_i64, + .opt_opc = vecop_list, + .vece = MO_16 }, + { .fniv = gen_uaddlp_vec, + .fni8 = gen_uaddlp_h_i64, + .opt_opc = vecop_list, + .vece = MO_32 }, + { .fniv = gen_uaddlp_vec, + .fni8 = gen_uaddlp_s_i64, + .opt_opc = vecop_list, + .vece = MO_64 }, + }; + assert(vece <= MO_32); + tcg_gen_gvec_2(rd_ofs, rn_ofs, opr_sz, max_sz, &g[vece]); +} + +static void gen_uadalp_vec(unsigned vece, TCGv_vec d, TCGv_vec n) +{ + TCGv_vec t = tcg_temp_new_vec_matching(d); + + gen_uaddlp_vec(vece, t, n); + tcg_gen_add_vec(vece, d, d, t); +} + +static void gen_uadalp_b_i64(TCGv_i64 d, TCGv_i64 n) +{ + TCGv_i64 t = tcg_temp_new_i64(); + + gen_uaddlp_b_i64(t, n); + tcg_gen_vec_add16_i64(d, d, t); +} + +static void gen_uadalp_h_i64(TCGv_i64 d, TCGv_i64 n) +{ + TCGv_i64 t = tcg_temp_new_i64(); + + gen_uaddlp_h_i64(t, n); + tcg_gen_vec_add32_i64(d, d, t); +} + +static void gen_uadalp_s_i64(TCGv_i64 d, TCGv_i64 n) +{ + TCGv_i64 t = tcg_temp_new_i64(); + + gen_uaddlp_s_i64(t, n); + tcg_gen_add_i64(d, d, t); +} + +void gen_gvec_uadalp(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs, + uint32_t opr_sz, uint32_t max_sz) +{ + static const TCGOpcode vecop_list[] = { + INDEX_op_shri_vec, INDEX_op_add_vec, 0 + }; + static const GVecGen2 g[] = { + { .fniv = gen_uadalp_vec, + .fni8 = gen_uadalp_b_i64, + .load_dest = true, + .opt_opc = vecop_list, + .vece = MO_16 }, + { .fniv = gen_uadalp_vec, + .fni8 = gen_uadalp_h_i64, + .load_dest = true, + .opt_opc = vecop_list, + .vece = MO_32 }, + { .fniv = gen_uadalp_vec, + .fni8 = gen_uadalp_s_i64, + .load_dest = true, + .opt_opc = vecop_list, + .vece = MO_64 }, + }; + assert(vece <= MO_32); + tcg_gen_gvec_2(rd_ofs, rn_ofs, opr_sz, max_sz, &g[vece]); +} diff --git a/target/arm/tcg/neon_helper.c b/target/arm/tcg/neon_helper.c index b92ddd4914d..1a22857b5eb 100644 --- a/target/arm/tcg/neon_helper.c +++ b/target/arm/tcg/neon_helper.c @@ -844,28 +844,6 @@ uint64_t HELPER(neon_addl_u32)(uint64_t a, uint64_t b) return (a + b) ^ mask; } -uint64_t HELPER(neon_paddl_u16)(uint64_t a, uint64_t b) -{ - uint64_t tmp; - uint64_t tmp2; - - tmp = a & 0x0000ffff0000ffffull; - tmp += (a >> 16) & 0x0000ffff0000ffffull; - tmp2 = b & 0xffff0000ffff0000ull; - tmp2 += (b << 16) & 0xffff0000ffff0000ull; - return ( tmp & 0xffff) - | ((tmp >> 16) & 0xffff0000ull) - | ((tmp2 << 16) & 0xffff00000000ull) - | ( tmp2 & 0xffff000000000000ull); -} - -uint64_t HELPER(neon_paddl_u32)(uint64_t a, uint64_t b) -{ - uint32_t low = a + (a >> 32); - uint32_t high = b + (b >> 32); - return low + ((uint64_t)high << 32); -} - /* Pairwise long add: add pairs of adjacent elements into * double-width elements in the result (eg _s8 is an 8x8->16 op) */ diff --git a/target/arm/tcg/translate-neon.c b/target/arm/tcg/translate-neon.c index ca6f5578b4f..19a18018f1a 100644 --- a/target/arm/tcg/translate-neon.c +++ b/target/arm/tcg/translate-neon.c @@ -2565,152 +2565,6 @@ static bool trans_VDUP_scalar(DisasContext *s, arg_VDUP_scalar *a) return true; } -static bool do_2misc_pairwise(DisasContext *s, arg_2misc *a, - NeonGenWidenFn *widenfn, - NeonGenTwo64OpFn *opfn, - NeonGenTwo64OpFn *accfn) -{ - /* - * Pairwise long operations: widen both halves of the pair, - * combine the pairs with the opfn, and then possibly accumulate - * into the destination with the accfn. - */ - int pass; - - if (!arm_dc_feature(s, ARM_FEATURE_NEON)) { - return false; - } - - /* UNDEF accesses to D16-D31 if they don't exist. */ - if (!dc_isar_feature(aa32_simd_r32, s) && - ((a->vd | a->vm) & 0x10)) { - return false; - } - - if ((a->vd | a->vm) & a->q) { - return false; - } - - if (!widenfn) { - return false; - } - - if (!vfp_access_check(s)) { - return true; - } - - for (pass = 0; pass < a->q + 1; pass++) { - TCGv_i32 tmp; - TCGv_i64 rm0_64, rm1_64, rd_64; - - rm0_64 = tcg_temp_new_i64(); - rm1_64 = tcg_temp_new_i64(); - rd_64 = tcg_temp_new_i64(); - - tmp = tcg_temp_new_i32(); - read_neon_element32(tmp, a->vm, pass * 2, MO_32); - widenfn(rm0_64, tmp); - read_neon_element32(tmp, a->vm, pass * 2 + 1, MO_32); - widenfn(rm1_64, tmp); - - opfn(rd_64, rm0_64, rm1_64); - - if (accfn) { - TCGv_i64 tmp64 = tcg_temp_new_i64(); - read_neon_element64(tmp64, a->vd, pass, MO_64); - accfn(rd_64, tmp64, rd_64); - } - write_neon_element64(rd_64, a->vd, pass, MO_64); - } - return true; -} - -static bool trans_VPADDL_S(DisasContext *s, arg_2misc *a) -{ - static NeonGenWidenFn * const widenfn[] = { - gen_helper_neon_widen_s8, - gen_helper_neon_widen_s16, - tcg_gen_ext_i32_i64, - NULL, - }; - static NeonGenTwo64OpFn * const opfn[] = { - gen_helper_neon_paddl_u16, - gen_helper_neon_paddl_u32, - tcg_gen_add_i64, - NULL, - }; - - return do_2misc_pairwise(s, a, widenfn[a->size], opfn[a->size], NULL); -} - -static bool trans_VPADDL_U(DisasContext *s, arg_2misc *a) -{ - static NeonGenWidenFn * const widenfn[] = { - gen_helper_neon_widen_u8, - gen_helper_neon_widen_u16, - tcg_gen_extu_i32_i64, - NULL, - }; - static NeonGenTwo64OpFn * const opfn[] = { - gen_helper_neon_paddl_u16, - gen_helper_neon_paddl_u32, - tcg_gen_add_i64, - NULL, - }; - - return do_2misc_pairwise(s, a, widenfn[a->size], opfn[a->size], NULL); -} - -static bool trans_VPADAL_S(DisasContext *s, arg_2misc *a) -{ - static NeonGenWidenFn * const widenfn[] = { - gen_helper_neon_widen_s8, - gen_helper_neon_widen_s16, - tcg_gen_ext_i32_i64, - NULL, - }; - static NeonGenTwo64OpFn * const opfn[] = { - gen_helper_neon_paddl_u16, - gen_helper_neon_paddl_u32, - tcg_gen_add_i64, - NULL, - }; - static NeonGenTwo64OpFn * const accfn[] = { - gen_helper_neon_addl_u16, - gen_helper_neon_addl_u32, - tcg_gen_add_i64, - NULL, - }; - - return do_2misc_pairwise(s, a, widenfn[a->size], opfn[a->size], - accfn[a->size]); -} - -static bool trans_VPADAL_U(DisasContext *s, arg_2misc *a) -{ - static NeonGenWidenFn * const widenfn[] = { - gen_helper_neon_widen_u8, - gen_helper_neon_widen_u16, - tcg_gen_extu_i32_i64, - NULL, - }; - static NeonGenTwo64OpFn * const opfn[] = { - gen_helper_neon_paddl_u16, - gen_helper_neon_paddl_u32, - tcg_gen_add_i64, - NULL, - }; - static NeonGenTwo64OpFn * const accfn[] = { - gen_helper_neon_addl_u16, - gen_helper_neon_addl_u32, - tcg_gen_add_i64, - NULL, - }; - - return do_2misc_pairwise(s, a, widenfn[a->size], opfn[a->size], - accfn[a->size]); -} - typedef void ZipFn(TCGv_ptr, TCGv_ptr); static bool do_zip_uzp(DisasContext *s, arg_2misc *a, @@ -3071,6 +2925,10 @@ DO_2MISC_VEC(VCLT0, gen_gvec_clt0) DO_2MISC_VEC(VCLS, gen_gvec_cls) DO_2MISC_VEC(VCLZ, gen_gvec_clz) DO_2MISC_VEC(VREV64, gen_gvec_rev64) +DO_2MISC_VEC(VPADDL_S, gen_gvec_saddlp) +DO_2MISC_VEC(VPADDL_U, gen_gvec_uaddlp) +DO_2MISC_VEC(VPADAL_S, gen_gvec_sadalp) +DO_2MISC_VEC(VPADAL_U, gen_gvec_uadalp) static bool trans_VMVN(DisasContext *s, arg_2misc *a) { From patchwork Fri Dec 13 17:31:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850190 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1642038wry; Fri, 13 Dec 2024 09:42:29 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW2Ek/W4O+gLt84MdsR7TeUhUXrdXR5/4mz7rBGswjOQ1cKVZjT6hXThrIZkHSM5kDqv/UtGA==@linaro.org X-Google-Smtp-Source: AGHT+IFDuvWWK2e1d8shgFj4EUBvu4QvTSF3FVl7+Hmb5L1lGsOQSafaCETGrFJG6XDhTNjVcFLZ X-Received: by 2002:a05:600c:1da9:b0:434:f131:1e64 with SMTP id 5b1f17b1804b1-4362aa371d4mr34431035e9.9.1734111749015; Fri, 13 Dec 2024 09:42:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111749; cv=none; d=google.com; s=arc-20240605; b=NC8vuzJ/5F33eF1UPdFF/v6guxkWb5yYhqRlAI6t2znXzyVCbEn0lzEzxAo9b9U7uz sY1Kc9u9gBTCdBcBSZHV6d14/s8+DaIR+gtiYUhY8GtVthSAjJQ9zHiNkLrYip5lvMbq s8cNGKpTKOyGgeF7EK4JOt43RERincV1EPRj/DOD+jLESqqKCjxBUuFWJvBFk8rvOo/m vslUkDQVQ3SU/UaAQQ+kG8RRLN2ilEcZNuZ6kM7+Zum+eeXCx0Ww23ZO4WU2m3X3NF0k CRfkLC8JD54CQojTJ7l2CZQPXClimQa42IWYsmFVUvhypue4u0I1HaUPmO8AXRjeCmwy NLkQ== 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=d89BbV9A2k7+Tc7rnQBt5e6N0ahmp3Fl8imvF/4J++k=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=asaDdesnRhU/SQ8rPtDbe1IgwEBHrS48TG++yf4aStk9I4cdtgWDV3JVFBJRQSixql XMX+zgZHemUXga0yvVMUOXi/lwpKvi+Sd4OfZtMFsMs9HSUVksLmxdc1x8AVW+GhEiAH PJdewg2vSG3QglE+XsDVUq67hu0ZJOMGQZRe1SA30CJ0iPE+k6qwJw0fpULduKZUkGa5 fXXtc5dxjrNE1lx9vq7eLsC0zc/V2ncoh1ASNgpv7AeecFXag8qraWocRLFlmcNSCbfZ F7OE5vcj/Ib2Df9h7P02pn9TPg3j+pJioWqZ5gxMYcryHSqkbySE497wJEkplcTtlRhj 1tJw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SK6DW8Pz; 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 ffacd0b85a97d-388c8078cb1si28537f8f.949.2024.12.13.09.42.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:42:28 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SK6DW8Pz; 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 1tM9YT-0002HT-2p; Fri, 13 Dec 2024 12:34:21 -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 1tM9Xd-0007YV-H1 for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:29 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9XY-0001dV-CS for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:29 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-4361c705434so14794695e9.3 for ; Fri, 13 Dec 2024 09:33:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111202; x=1734716002; 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=d89BbV9A2k7+Tc7rnQBt5e6N0ahmp3Fl8imvF/4J++k=; b=SK6DW8PzGKIZMq552B6OFVf9dmLfiWkac/Zvy9ElJRRffnsNIDSAmbQLKqQoVVMDF3 AIZmGGMt/GIcArGME4rrc+JZaAzBHUc+z+87ZeGqGSBYFDT9clJGgrk3UsyxTWYa3T90 SiE88eVBW2DnMnVh2ZSUSQGvdzeD3+6fabK4nA++Ke3uX6N0NTvddio42G2N9piE+IJ4 Cgvu3sdF5QV7p/EalGuaFjrTZGHQyM/gc+sh7oW2Ymu/o5NRV2BszofcqdMdwgdnP6iA 2xXyiuZSp/6QFXvysIyuMmtl4EY4AufwlGYWuoa5V0kewzaUxGlmQeqr4keVBxe/+fNl cM9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111202; x=1734716002; 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=d89BbV9A2k7+Tc7rnQBt5e6N0ahmp3Fl8imvF/4J++k=; b=hEa3KEOjFD2h7PSP2SYbzInk7L8SF3CmW3msqjWp/t0FHsmA33Vv7jfTwjJuNZtWva cMA1mMFDVk0hIHYeKRiVPYYT1eUyt6lFIuISHllcXbOLTUJTaz1VKb5KVd5f2hL4qThb j3HwIdvBsRVn9u+i7yjfToMAOu1JS/vs1v2gLNS1j+DpyBHnhceCaSbvact3Rr7bUP7Q qV7LI40Dy1cC61ASCgcsZPX1+T6kchpSCjC7ddAGB6g1vccR8/9swaRfISNaFmA9klro zEr8JIr7nhhhDBcdH5Fv28xYpfqVH1WDzXf/d6X4TlwYwxZCK+fvo6L8ej5EzUtMRk6s ZZxg== X-Gm-Message-State: AOJu0YzqWnhj0KhiN3uvkTdwMn2Fv7urW7ik0gbBpjfwpQHCCwzR6cFt C5ux8EeujE6yBDIBq+veatvU+FqLUPlN85l9pjCJYT/bDXzrvhwTShECB/Wv2m4vBv/BHFEEr1y r X-Gm-Gg: ASbGncurwVYniCSa0xVzchEY48TNZTO0lBg5B82TcFBgLt3SXF+aLDr+0dc84gcySj1 uWbdDeOWXc82v5231jB7Iz2DkrxslgAj7lgd/hM1VKLXuJ028XSBoaVg310CedFsoAplsing1H4 Eb5ZMZgoEOQiiLfcrET3CYlce4li5qZxTD1F9UvWYq7LgC534wqoX7+5XNbZaxNzU/HIZy7HxJF MvhZA31gvtJqzw4x6Gz1aQRbKS7VsXQ2iMfe5iSOadS2XS8kv9vU6BO2MzZYA== X-Received: by 2002:a5d:588f:0:b0:386:3403:7b63 with SMTP id ffacd0b85a97d-3888e0b5adamr2858106f8f.36.1734111201669; Fri, 13 Dec 2024 09:33:21 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:20 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 46/85] target/arm: Convert handle_2misc_pairwise to decodetree Date: Fri, 13 Dec 2024 17:31:50 +0000 Message-Id: <20241213173229.3308926-47-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x334.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, T_SPF_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson This includes SADDLP, UADDLP, SADALP, UADALP. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-47-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/helper-a64.h | 2 - target/arm/tcg/a64.decode | 5 ++ target/arm/tcg/helper-a64.c | 18 -------- target/arm/tcg/translate-a64.c | 84 +++------------------------------- 4 files changed, 11 insertions(+), 98 deletions(-) diff --git a/target/arm/tcg/helper-a64.h b/target/arm/tcg/helper-a64.h index f811bb85dcb..ac7ca190fac 100644 --- a/target/arm/tcg/helper-a64.h +++ b/target/arm/tcg/helper-a64.h @@ -41,8 +41,6 @@ DEF_HELPER_FLAGS_3(recpsf_f64, TCG_CALL_NO_RWG, f64, f64, f64, ptr) DEF_HELPER_FLAGS_3(rsqrtsf_f16, TCG_CALL_NO_RWG, f16, f16, f16, ptr) DEF_HELPER_FLAGS_3(rsqrtsf_f32, TCG_CALL_NO_RWG, f32, f32, f32, ptr) DEF_HELPER_FLAGS_3(rsqrtsf_f64, TCG_CALL_NO_RWG, f64, f64, f64, ptr) -DEF_HELPER_FLAGS_1(neon_addlp_u8, TCG_CALL_NO_RWG_SE, i64, i64) -DEF_HELPER_FLAGS_1(neon_addlp_u16, TCG_CALL_NO_RWG_SE, i64, i64) DEF_HELPER_FLAGS_2(frecpx_f64, TCG_CALL_NO_RWG, f64, f64, ptr) DEF_HELPER_FLAGS_2(frecpx_f32, TCG_CALL_NO_RWG, f32, f32, ptr) DEF_HELPER_FLAGS_2(frecpx_f16, TCG_CALL_NO_RWG, f16, f16, ptr) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 05f1bc99b52..f3488766b21 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -1662,3 +1662,8 @@ CMLT0_v 0.00 1110 ..1 00000 10101 0 ..... ..... @qrr_e REV16_v 0.00 1110 001 00000 00011 0 ..... ..... @qrr_b REV32_v 0.10 1110 0.1 00000 00001 0 ..... ..... @qrr_bh REV64_v 0.00 1110 ..1 00000 00001 0 ..... ..... @qrr_e + +SADDLP_v 0.00 1110 ..1 00000 00101 0 ..... ..... @qrr_e +UADDLP_v 0.10 1110 ..1 00000 00101 0 ..... ..... @qrr_e +SADALP_v 0.00 1110 ..1 00000 01101 0 ..... ..... @qrr_e +UADALP_v 0.10 1110 ..1 00000 01101 0 ..... ..... @qrr_e diff --git a/target/arm/tcg/helper-a64.c b/target/arm/tcg/helper-a64.c index 9b3c407be3c..3de564e0fef 100644 --- a/target/arm/tcg/helper-a64.c +++ b/target/arm/tcg/helper-a64.c @@ -306,24 +306,6 @@ float64 HELPER(rsqrtsf_f64)(float64 a, float64 b, void *fpstp) return float64_muladd(a, b, float64_three, float_muladd_halve_result, fpst); } -uint64_t HELPER(neon_addlp_u8)(uint64_t a) -{ - uint64_t tmp; - - tmp = a & 0x00ff00ff00ff00ffULL; - tmp += (a >> 8) & 0x00ff00ff00ff00ffULL; - return tmp; -} - -uint64_t HELPER(neon_addlp_u16)(uint64_t a) -{ - uint64_t tmp; - - tmp = a & 0x0000ffff0000ffffULL; - tmp += (a >> 16) & 0x0000ffff0000ffffULL; - return tmp; -} - /* Floating-point reciprocal exponent - see FPRecpX in ARM ARM */ uint32_t HELPER(frecpx_f16)(uint32_t a, void *fpstp) { diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index f57b5e28556..717d30dd5b9 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -8956,6 +8956,10 @@ static bool do_gvec_fn2_bhs(DisasContext *s, arg_qrr_e *a, GVecGen2Fn *fn) TRANS(CLS_v, do_gvec_fn2_bhs, a, gen_gvec_cls) TRANS(CLZ_v, do_gvec_fn2_bhs, a, gen_gvec_clz) TRANS(REV64_v, do_gvec_fn2_bhs, a, gen_gvec_rev64) +TRANS(SADDLP_v, do_gvec_fn2_bhs, a, gen_gvec_saddlp) +TRANS(UADDLP_v, do_gvec_fn2_bhs, a, gen_gvec_uaddlp) +TRANS(SADALP_v, do_gvec_fn2_bhs, a, gen_gvec_sadalp) +TRANS(UADALP_v, do_gvec_fn2_bhs, a, gen_gvec_uadalp) /* Common vector code for handling integer to FP conversion */ static void handle_simd_intfp_conv(DisasContext *s, int rd, int rn, @@ -9885,73 +9889,6 @@ static void handle_2misc_widening(DisasContext *s, int opcode, bool is_q, } } -static void handle_2misc_pairwise(DisasContext *s, int opcode, bool u, - bool is_q, int size, int rn, int rd) -{ - /* Implement the pairwise operations from 2-misc: - * SADDLP, UADDLP, SADALP, UADALP. - * These all add pairs of elements in the input to produce a - * double-width result element in the output (possibly accumulating). - */ - bool accum = (opcode == 0x6); - int maxpass = is_q ? 2 : 1; - int pass; - TCGv_i64 tcg_res[2]; - - if (size == 2) { - /* 32 + 32 -> 64 op */ - MemOp memop = size + (u ? 0 : MO_SIGN); - - for (pass = 0; pass < maxpass; pass++) { - TCGv_i64 tcg_op1 = tcg_temp_new_i64(); - TCGv_i64 tcg_op2 = tcg_temp_new_i64(); - - tcg_res[pass] = tcg_temp_new_i64(); - - read_vec_element(s, tcg_op1, rn, pass * 2, memop); - read_vec_element(s, tcg_op2, rn, pass * 2 + 1, memop); - tcg_gen_add_i64(tcg_res[pass], tcg_op1, tcg_op2); - if (accum) { - read_vec_element(s, tcg_op1, rd, pass, MO_64); - tcg_gen_add_i64(tcg_res[pass], tcg_res[pass], tcg_op1); - } - } - } else { - for (pass = 0; pass < maxpass; pass++) { - TCGv_i64 tcg_op = tcg_temp_new_i64(); - NeonGenOne64OpFn *genfn; - static NeonGenOne64OpFn * const fns[2][2] = { - { gen_helper_neon_addlp_s8, gen_helper_neon_addlp_u8 }, - { gen_helper_neon_addlp_s16, gen_helper_neon_addlp_u16 }, - }; - - genfn = fns[size][u]; - - tcg_res[pass] = tcg_temp_new_i64(); - - read_vec_element(s, tcg_op, rn, pass, MO_64); - genfn(tcg_res[pass], tcg_op); - - if (accum) { - read_vec_element(s, tcg_op, rd, pass, MO_64); - if (size == 0) { - gen_helper_neon_addl_u16(tcg_res[pass], - tcg_res[pass], tcg_op); - } else { - gen_helper_neon_addl_u32(tcg_res[pass], - tcg_res[pass], tcg_op); - } - } - } - } - if (!is_q) { - tcg_res[1] = tcg_constant_i64(0); - } - for (pass = 0; pass < 2; pass++) { - write_vec_element(s, tcg_res[pass], rd, pass, MO_64); - } -} - static void handle_shll(DisasContext *s, bool is_q, int size, int rn, int rd) { /* Implement SHLL and SHLL2 */ @@ -10011,17 +9948,6 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) handle_2misc_narrow(s, false, opcode, u, is_q, size, rn, rd); return; - case 0x2: /* SADDLP, UADDLP */ - case 0x6: /* SADALP, UADALP */ - if (size == 3) { - unallocated_encoding(s); - return; - } - if (!fp_access_check(s)) { - return; - } - handle_2misc_pairwise(s, opcode, u, is_q, size, rn, rd); - return; case 0x13: /* SHLL, SHLL2 */ if (u == 0 || size == 3) { unallocated_encoding(s); @@ -10203,9 +10129,11 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) default: case 0x0: /* REV64, REV32 */ case 0x1: /* REV16 */ + case 0x2: /* SADDLP, UADDLP */ case 0x3: /* SUQADD, USQADD */ case 0x4: /* CLS, CLZ */ case 0x5: /* CNT, NOT, RBIT */ + case 0x6: /* SADALP, UADALP */ case 0x7: /* SQABS, SQNEG */ case 0x8: /* CMGT, CMGE */ case 0x9: /* CMEQ, CMLE */ From patchwork Fri Dec 13 17:31:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850159 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1639909wry; Fri, 13 Dec 2024 09:37:52 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCX0KIX8RjosLawDyWBcWd+TOUAIWDN2vGDkGV6qyYcopgRluJIMX0ryz/qsloDhj0qkW22hCA==@linaro.org X-Google-Smtp-Source: AGHT+IGDu/6OQfuRiP49LN/bRDY3Zpb55LCsHyGuQon9X/uUDj80zdWr1ae8GmD3S164MZngu/Hw X-Received: by 2002:a05:6402:270f:b0:5d0:8f1c:d9d7 with SMTP id 4fb4d7f45d1cf-5d63c3007e4mr7426184a12.4.1734111471902; Fri, 13 Dec 2024 09:37:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111471; cv=none; d=google.com; s=arc-20240605; b=KXdd+SAzlOJAYrYiT1BNft5O5idruYpETE7Vq4WE8tvd59FsrZL5MJpB8AoLNaw1k0 4h3G2+Tq3K8tGcp0nNgOFFqb66E2lByINjiJ7OkokuXtTjX214YKXQPoy0kbfFl5J4N9 16RkncXgLNJxB/3ylvl54qYlV9kavyqsvdRbLbCK9CcIH0BZ++2u5llQGg6bl802adby Wp+NQQKYWjYzi3//An1B1WzpIKFtQcXpDYC6OEiy3tbvJhTfxjkgNTT29Ja2b5B5RQMg +GWoPkisWcsqwqm2WoBMG3qaMbmnwI8wrhXgpvJwGZ9ORtlqIUD/ns/VYr7ASSkTfthe x3zA== 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=WK+Z64alPo67E0gxwuqk0uYvI1XoxQYQ14C8cyJtCPA=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=XYc9sJSUCfkfjLPn4BeYMBMUqmuQLns4BMgg0KnbmcG5H2a4VDwFeCoubXY1dy6tn2 PAvTEoD0aBeD6rLRvJtRHD/qu69rzVihQ0Wzgl+xwi7104n0HAYzDy3sMU29ynq0uYqA m8tDvUZiNF34uuIoVasSLNV+8gp67bhdPSuzgpy+tvY6yDiQZA0twIQJCxVfbP/UZo4q +I61jg/1E+XEn8EBVOqwtWlePS+0Zrl5U0siij5MWnFDNf/CSHqy4cKYjTJxPaPxvQUi VrTP/PlPYer+X7C+DFzNaLyuV4FnwBE3h5c24VbFIbnen/1FqzLs+HVFbQJhSNiHIncU S3Ng==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="CGXq2vP/"; 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 a640c23a62f3a-aa65d7078f7si969169666b.777.2024.12.13.09.37.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:37:51 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="CGXq2vP/"; 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 1tM9YL-0001TW-Cu; Fri, 13 Dec 2024 12:34: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 1tM9Xb-0007R0-1m for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:27 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9XZ-0001dk-4U for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:26 -0500 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-435004228c0so24464155e9.0 for ; Fri, 13 Dec 2024 09:33:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111202; x=1734716002; 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=WK+Z64alPo67E0gxwuqk0uYvI1XoxQYQ14C8cyJtCPA=; b=CGXq2vP/TXmmy0mjyzlIStGtzCj+dsmbZgd/vDQcYMiSMsrzrCcTqNqrPsyJtPCrde WuAmKgsq+wvg/FKLyHiGg/dIsdvee8aozpHShwEajVh6+x4aeaCfXSN++3+LYppE25/1 8EWi3JpzYWZ4S2R5IvaKJChPX5sDhS+Qdu2jeYemKI5yTieR0W1iLwgysM7d25NDdTbX optK/U7deo6J7sjrMDpPqWBLps9j0mbX2AFq6x/ui9KEQkYqgHJDQpq+zmTdyx7duSXH P1EnLBCPJxS60ucT4OB4iSZ5Rserp0oKgg8k8Gi3rf+XJYmhQACHVCJ8tWPyf5DC8p9Q Q52A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111202; x=1734716002; 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=WK+Z64alPo67E0gxwuqk0uYvI1XoxQYQ14C8cyJtCPA=; b=QzZZ0EOZazZD6v/2e08rjFSyDO0gnEbxc5IdtEH62Hsog0gxswXC8n32Fje7MlWn4H JBq5o/QQA4HjULEfmJAR2vx9yq7HmUahNBOER/s8zZAi+5Qsidu9JJhsM9PcfyQ1K7KF 59sb3hVDvOFO0AeROnJKxbKBQ4jLSRoB+KmyN3g/3QUWDuGOOWh4FvcBGQCkaRulga9v GQ/JjOeE/bHh2+T+Qjnqfq/XESonOxtxPEec3Vqh0OM4YjKyw2RExCKSo27pLW5WZRPk dOr2Q+W9cYsX39mlHqWiE/UNii5FKeHe6uJ93nFzGvJHSPJx8bfhqmDoi9KkQ/X/rHYg HVfw== X-Gm-Message-State: AOJu0YwheO5daNt89hI06K37eQX/C7eZLG3XvJaKdJyretYyFXahx8YK Qp7q3e7lHnGZKxHmfDvOdpLp3qfiOvADiQsW86iM7e4KUT8btHNn4F62cV5SQn3oPhLiBpRGv+C R X-Gm-Gg: ASbGncszsavereqayUzgXEnrQWHSPCXFLZFVF4tmE3oY/NVoIu0ff6NUtLcBXmAncax QC48aOCgOf6x0WhceURfap3XwbfG04MzfOyVlswaFsIGRLLTgSpcQwet+GtYIJHR85aDqsOcZ0O uIzLUinxyQNXHJQUFLW3vRtF6lyMYT5tPOE21jXRXeUbAFKd0QEpOAX7gmmy3Ye7+12fi/64OKF nwRTMGT3ouAJhyzY07X9cfJhYW6CsiuFf+WnpIO1y4VWVuD1m6oSWLWZ7sqZA== X-Received: by 2002:a05:6000:4615:b0:386:605:77e with SMTP id ffacd0b85a97d-3888e0bfb19mr3227471f8f.49.1734111202617; Fri, 13 Dec 2024 09:33:22 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:21 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 47/85] target/arm: Remove helper_neon_{add,sub}l_u{16,32} Date: Fri, 13 Dec 2024 17:31:51 +0000 Message-Id: <20241213173229.3308926-48-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32a.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: Richard Henderson These have generic equivalents: tcg_gen_vec_{add,sub}{16,32}_i64. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-48-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/helper.h | 4 ---- target/arm/tcg/neon_helper.c | 36 --------------------------------- target/arm/tcg/translate-neon.c | 22 ++++++++++---------- 3 files changed, 11 insertions(+), 51 deletions(-) diff --git a/target/arm/helper.h b/target/arm/helper.h index 6369d07d053..04e422ab081 100644 --- a/target/arm/helper.h +++ b/target/arm/helper.h @@ -395,12 +395,8 @@ DEF_HELPER_1(neon_widen_s8, i64, i32) DEF_HELPER_1(neon_widen_u16, i64, i32) DEF_HELPER_1(neon_widen_s16, i64, i32) -DEF_HELPER_2(neon_addl_u16, i64, i64, i64) -DEF_HELPER_2(neon_addl_u32, i64, i64, i64) DEF_HELPER_FLAGS_1(neon_addlp_s8, TCG_CALL_NO_RWG_SE, i64, i64) DEF_HELPER_FLAGS_1(neon_addlp_s16, TCG_CALL_NO_RWG_SE, i64, i64) -DEF_HELPER_2(neon_subl_u16, i64, i64, i64) -DEF_HELPER_2(neon_subl_u32, i64, i64, i64) DEF_HELPER_3(neon_addl_saturate_s32, i64, env, i64, i64) DEF_HELPER_3(neon_addl_saturate_s64, i64, env, i64, i64) DEF_HELPER_2(neon_abdl_u16, i64, i32, i32) diff --git a/target/arm/tcg/neon_helper.c b/target/arm/tcg/neon_helper.c index 1a22857b5eb..c687e882ad9 100644 --- a/target/arm/tcg/neon_helper.c +++ b/target/arm/tcg/neon_helper.c @@ -826,24 +826,6 @@ uint64_t HELPER(neon_widen_s16)(uint32_t x) return ((uint32_t)(int16_t)x) | (high << 32); } -uint64_t HELPER(neon_addl_u16)(uint64_t a, uint64_t b) -{ - uint64_t mask; - mask = (a ^ b) & 0x8000800080008000ull; - a &= ~0x8000800080008000ull; - b &= ~0x8000800080008000ull; - return (a + b) ^ mask; -} - -uint64_t HELPER(neon_addl_u32)(uint64_t a, uint64_t b) -{ - uint64_t mask; - mask = (a ^ b) & 0x8000000080000000ull; - a &= ~0x8000000080000000ull; - b &= ~0x8000000080000000ull; - return (a + b) ^ mask; -} - /* Pairwise long add: add pairs of adjacent elements into * double-width elements in the result (eg _s8 is an 8x8->16 op) */ @@ -887,24 +869,6 @@ uint64_t HELPER(neon_addlp_s16)(uint64_t a) return (uint32_t)reslo | (((uint64_t)reshi) << 32); } -uint64_t HELPER(neon_subl_u16)(uint64_t a, uint64_t b) -{ - uint64_t mask; - mask = (a ^ ~b) & 0x8000800080008000ull; - a |= 0x8000800080008000ull; - b &= ~0x8000800080008000ull; - return (a - b) ^ mask; -} - -uint64_t HELPER(neon_subl_u32)(uint64_t a, uint64_t b) -{ - uint64_t mask; - mask = (a ^ ~b) & 0x8000000080000000ull; - a |= 0x8000000080000000ull; - b &= ~0x8000000080000000ull; - return (a - b) ^ mask; -} - uint64_t HELPER(neon_addl_saturate_s32)(CPUARMState *env, uint64_t a, uint64_t b) { uint32_t x, y; diff --git a/target/arm/tcg/translate-neon.c b/target/arm/tcg/translate-neon.c index 19a18018f1a..0821f10fad5 100644 --- a/target/arm/tcg/translate-neon.c +++ b/target/arm/tcg/translate-neon.c @@ -1560,8 +1560,8 @@ static bool do_prewiden_3d(DisasContext *s, arg_3diff *a, NULL, NULL, \ }; \ static NeonGenTwo64OpFn * const addfn[] = { \ - gen_helper_neon_##OP##l_u16, \ - gen_helper_neon_##OP##l_u32, \ + tcg_gen_vec_##OP##16_i64, \ + tcg_gen_vec_##OP##32_i64, \ tcg_gen_##OP##_i64, \ NULL, \ }; \ @@ -1639,8 +1639,8 @@ static bool do_narrow_3d(DisasContext *s, arg_3diff *a, static bool trans_##INSN##_3d(DisasContext *s, arg_3diff *a) \ { \ static NeonGenTwo64OpFn * const addfn[] = { \ - gen_helper_neon_##OP##l_u16, \ - gen_helper_neon_##OP##l_u32, \ + tcg_gen_vec_##OP##16_i64, \ + tcg_gen_vec_##OP##32_i64, \ tcg_gen_##OP##_i64, \ NULL, \ }; \ @@ -1761,8 +1761,8 @@ static bool trans_VABAL_S_3d(DisasContext *s, arg_3diff *a) NULL, }; static NeonGenTwo64OpFn * const addfn[] = { - gen_helper_neon_addl_u16, - gen_helper_neon_addl_u32, + tcg_gen_vec_add16_i64, + tcg_gen_vec_add32_i64, tcg_gen_add_i64, NULL, }; @@ -1779,8 +1779,8 @@ static bool trans_VABAL_U_3d(DisasContext *s, arg_3diff *a) NULL, }; static NeonGenTwo64OpFn * const addfn[] = { - gen_helper_neon_addl_u16, - gen_helper_neon_addl_u32, + tcg_gen_vec_add16_i64, + tcg_gen_vec_add32_i64, tcg_gen_add_i64, NULL, }; @@ -1840,8 +1840,8 @@ static bool trans_VMULL_U_3d(DisasContext *s, arg_3diff *a) NULL, \ }; \ static NeonGenTwo64OpFn * const accfn[] = { \ - gen_helper_neon_##ACC##l_u16, \ - gen_helper_neon_##ACC##l_u32, \ + tcg_gen_vec_##ACC##16_i64, \ + tcg_gen_vec_##ACC##32_i64, \ tcg_gen_##ACC##_i64, \ NULL, \ }; \ @@ -2371,7 +2371,7 @@ static bool trans_VMULL_U_2sc(DisasContext *s, arg_2scalar *a) }; \ static NeonGenTwo64OpFn * const accfn[] = { \ NULL, \ - gen_helper_neon_##ACC##l_u32, \ + tcg_gen_vec_##ACC##32_i64, \ tcg_gen_##ACC##_i64, \ NULL, \ }; \ From patchwork Fri Dec 13 17:31:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850203 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1643095wry; Fri, 13 Dec 2024 09:44:59 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW07ecJ1F+xETmtAvcxINkHijazCzE0tpQ59yi4V+do6TR5SakL+9UCQBCdCzaQVExEyBlblw==@linaro.org X-Google-Smtp-Source: AGHT+IEs68bZbPxeIj/9rERlxUZje9P5Zr6mFwBJBE7FbAZ0moRuGMFzt/vWTHgQlnqdFrgRjlOo X-Received: by 2002:a05:6402:5109:b0:5d0:bcdd:ff90 with SMTP id 4fb4d7f45d1cf-5d63c2f82bfmr2900424a12.2.1734111899359; Fri, 13 Dec 2024 09:44:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111899; cv=none; d=google.com; s=arc-20240605; b=c4jHbL0zW7hZA4pDjUGqKuVxusmXkC/Z3qu0RjnAusYv1Njvw4ocNpf+YnX6ASZWj1 Kncdp3SPUTAtWTWDBZt50rDNlvTMXlT58BAUizRfWMgf9X/2RxS4YTHdJJPBTMNx6brZ aizVJoVq055XPvvn+k0BLVI9oFlU0MCFlnqDUE2TeA5Xz2+6J4/OTQdhBHcu3mFpp9bO xfMpIliYWdPQzwQuNbI+MVuyTMjv6xEpBcCQaA+BUWTKCbUiyUTSd0BXLNfHHZRGk5yA SBC8uKywgF1dOYwx0+EsMg65o/n10PR+uVNtR1s7F64KAaKO7FfVU0As0JG2BDv1Wr5N HFtQ== 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=KC67yHdo6eZv8smMWuemE2zxBvf5Ux7ZXfjP+6tNWtQ=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=V6liip5Q/Dj9uEPEM6LCd+vIbkT5ZXMcn69x574pow3AAYaObGePPhMRZ4vIzk4oK6 0laALlJRM7bg1gByy8eXWUmTjU4aWuO+1fyRPkxsDa+5jfjwpKnlWHuv56aTepwpytq/ 1AWBJKOhlmNDPNQQDmnTRXuYKTuNcIySlof0gHvziwHF7y4+p+v4FHEC9Mmr/R7zmJ28 Oot1UvX7qmH+0TQPp4MC4SljM9YfoWPWSibfg/nbp2pc9w9PD9DiE9sswRu6vAb50DtW 4zKGS4rT4HrWpA8/jKvvLQUfgdZOslYothX0Q69EZvg9/d8BtKcjYVKyOAt28cP/lpZf A7NA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Rz0ljPnM; 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 4fb4d7f45d1cf-5d652add923si61380a12.88.2024.12.13.09.44.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:44:59 -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=Rz0ljPnM; 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 1tM9YZ-0003BO-RP; Fri, 13 Dec 2024 12:34:28 -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 1tM9Xf-0007fg-Kj for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:31 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9Xa-0001dw-RR for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:31 -0500 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-385f06d0c8eso1020885f8f.0 for ; Fri, 13 Dec 2024 09:33:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111203; x=1734716003; 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=KC67yHdo6eZv8smMWuemE2zxBvf5Ux7ZXfjP+6tNWtQ=; b=Rz0ljPnMIqwRIJDwk3MJk+Pyd6aP5aJGCtkBIW/3BH2HLxVzSAi2Q+QOGn4f+Q2QiD H3iBfhXWf54IvNkjsgcGF4S14RrLizJAv9e4bpZctYxlPrZwMT2myz4gZjp/mra9KPU3 Yx/ZPVlq4DdQfLOClA91AtfMNe6ui3wkBvohmXobASRyGoFZnlxtAp05BcjiMLJi+P5u M71FsrGTneQAr+gufdGBMfyJIGCPXxQHa0lVIV4Gcyds9KRVCTrga347vrG80NI/8pXc ungmOZt0WyuCTlkFBMmpWz1ZPF6xPhlVR6u8sdF3YAxcmhN6PAcSg5bZm/P6PaG8u/r9 TWyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111203; x=1734716003; 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=KC67yHdo6eZv8smMWuemE2zxBvf5Ux7ZXfjP+6tNWtQ=; b=LfnwN6rkiwOGYwQLwrHEijXRbRsAqzEzYMybwz4kgHjZvaojSgncUgM/MjbIYSG4PA Dbz70fzKBR/vP0ickbR0mkNEseuNtXBU+4qeCU5WcU5/m3dGhY/Ir0MEiRVQO9XggTcn pUhVm7P8acuUz7BgKlpuJFICOIHtSiYAkwF3hW/CyeUOXojINmhYZB2JzKqRtvsXUCug yGmkr4vmHv+oWa9uKi5JrLgIQu7g/Y3cWvi4EbP6r93vYUDyR9s4lEjxm/onp18veuF0 xyfibF8akDU/OXG0QE9zGPl+4egWwtjPB2Xp67hBsLuKCKon+Bb3c2nJ9E5aOx0Ha/Uz 6dAA== X-Gm-Message-State: AOJu0Ywn7BggA1BwTVo4H56r9HcHQ3E2ir5kikMehNkdLbTgbKe6yxic 39oJi75R8OIOSZDpAcE3CHFEEjpzpoEE39NpdDMUaJXdh1v10Bil+AkXySjOh4eBo5W6cQhunqK D X-Gm-Gg: ASbGnctaBDmP/u3DLGE2wXI/ecqO8KS4JQmE859CWihbULy+Bs/5eDRUgvlfKikSE2u vuVXKM9YwwF5QPz8wQzInQxdpJit9EXj4H4mabxojlCe4/sz2OJywQX/5/kp4LAfNpFs2wvkXm9 pNt7Ctz6ekYHd0oV7dLLU9Rwhe+39heLoAZqAUwcho2rdsP9uXaE7J3W/UInNcthmUti60oH9mD xRVS/dbGl44aIcO09oYXDwe3MVRjXtwMrToR8GnJDUh2/w3Z+UUfstBEEUpxQ== X-Received: by 2002:a5d:6487:0:b0:382:5088:9372 with SMTP id ffacd0b85a97d-3888e0b88afmr3095664f8f.43.1734111203440; Fri, 13 Dec 2024 09:33:23 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:22 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 48/85] target/arm: Introduce clear_vec Date: Fri, 13 Dec 2024 17:31:52 +0000 Message-Id: <20241213173229.3308926-49-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson In a couple of places, clearing the entire vector before storing one element is the easiest solution. Wrap that into a helper function. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-49-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/translate-a64.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 717d30dd5b9..0e8e8670582 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -628,7 +628,16 @@ static TCGv_i32 read_fp_hreg(DisasContext *s, int reg) return v; } -/* Clear the bits above an N-bit vector, for N = (is_q ? 128 : 64). +static void clear_vec(DisasContext *s, int rd) +{ + unsigned ofs = fp_reg_offset(s, rd, MO_64); + unsigned vsz = vec_full_reg_size(s); + + tcg_gen_gvec_dup_imm(MO_64, ofs, vsz, vsz, 0); +} + +/* + * Clear the bits above an N-bit vector, for N = (is_q ? 128 : 64). * If SVE is not enabled, then there are only 128 bits in the vector. */ static void clear_vec_high(DisasContext *s, bool is_q, int rd) @@ -4851,7 +4860,6 @@ static bool trans_SM3SS1(DisasContext *s, arg_SM3SS1 *a) TCGv_i32 tcg_op2 = tcg_temp_new_i32(); TCGv_i32 tcg_op3 = tcg_temp_new_i32(); TCGv_i32 tcg_res = tcg_temp_new_i32(); - unsigned vsz, dofs; read_vec_element_i32(s, tcg_op1, a->rn, 3, MO_32); read_vec_element_i32(s, tcg_op2, a->rm, 3, MO_32); @@ -4863,9 +4871,7 @@ static bool trans_SM3SS1(DisasContext *s, arg_SM3SS1 *a) tcg_gen_rotri_i32(tcg_res, tcg_res, 25); /* Clear the whole register first, then store bits [127:96]. */ - vsz = vec_full_reg_size(s); - dofs = vec_full_reg_offset(s, a->rd); - tcg_gen_gvec_dup_imm(MO_64, dofs, vsz, vsz, 0); + clear_vec(s, a->rd); write_vec_element_i32(s, tcg_res, a->rd, 3, MO_32); } return true; @@ -6307,7 +6313,6 @@ static bool do_scalar_muladd_widening_idx(DisasContext *s, arg_rrx_e *a, TCGv_i64 t0 = tcg_temp_new_i64(); TCGv_i64 t1 = tcg_temp_new_i64(); TCGv_i64 t2 = tcg_temp_new_i64(); - unsigned vsz, dofs; if (acc) { read_vec_element(s, t0, a->rd, 0, a->esz + 1); @@ -6317,9 +6322,7 @@ static bool do_scalar_muladd_widening_idx(DisasContext *s, arg_rrx_e *a, fn(t0, t1, t2); /* Clear the whole register first, then store scalar. */ - vsz = vec_full_reg_size(s); - dofs = vec_full_reg_offset(s, a->rd); - tcg_gen_gvec_dup_imm(MO_64, dofs, vsz, vsz, 0); + clear_vec(s, a->rd); write_vec_element(s, t0, a->rd, 0, a->esz + 1); } return true; From patchwork Fri Dec 13 17:31:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850156 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1639878wry; Fri, 13 Dec 2024 09:37:48 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWMl92cwX4DBI6OWdbMMz5SqEqjQqc3q5c/tIE5QjHb2t1Mi9D1626kPUW1V7uGjfSey5hI4A==@linaro.org X-Google-Smtp-Source: AGHT+IGMdMf+fM7vIbmvCAzcxvbsrqm2e/1GyqrRCslCHBkumSoguMa7enCYCjaom7U/ZFXGVIZA X-Received: by 2002:a5d:5f53:0:b0:385:faec:d94d with SMTP id ffacd0b85a97d-3888e0c0777mr2702836f8f.51.1734111467766; Fri, 13 Dec 2024 09:37:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111467; cv=none; d=google.com; s=arc-20240605; b=lUr1jJ8yEFDhsO1SnmX1Z3oFqIqY0HYqkmofF52ONvlSzKEjP1lrCStF44/+oiLFCi XcAxTGXxsYibTzvQQ28IM5HAToMHOjHpWhS+HZ2x+rI4V5cHhufeGzbMBk7yc71p41qc NDSSsXn83bfi464D8dJw2tWESx58EIFpl1M0q0KeGUX8+USw4YJ6hyRAFsleSGxIrK+y mpk/I6e/Kwx61VXA5gbC2tLuzYlj3s759wzq3XpwsJUO+aokWLAaUfQKSXof3a3JFyVW Mm5ctVT1McvjWjBBQm5pkltG0SA9D5a3HCu8XiHXEy9J1AybBfa1zh7I1SKHK1iFaxZG WrxA== 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=Z9x+S9fuo7ZRjCW8SqS6FnyIn7ZG87oRP6R1u9y80i4=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=kn2aXYvS50851qdUonHM5yca2t6frSN2fnPnFdIODO8Ie56D3jH2jri0c55tT1rLoM Bl9fMvj/vcxBVh8qMIKq1//yeMiuHAwPs5kafturtXAtSxEbmkDrZ5N+MuU8Rnse4Lkd 5b8wyoeaorxW+2OCiAtS3BmjqkAjJhZbL+jwYmrY+uuSUWyYAo1DvOCgV7CUXo9nzYfV UxvB08GlpxTf5wFzuejtMH+Pb2Dw8o34ToToI76aPViz+X2rqxnxT6t6nAdshQcfOrgG 3Y8Ag34GczRqj5gBCngGlcKKfa1oeamaet6cz8bk93wGMw26E9pb0T5MMrCyWpShI+K1 jENQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=g7cqNizn; 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 ffacd0b85a97d-388c8074be8si24715f8f.896.2024.12.13.09.37.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:37: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=g7cqNizn; 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 1tM9YO-0001tU-Qk; Fri, 13 Dec 2024 12:34:17 -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 1tM9Xc-0007S5-1l for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:28 -0500 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9XZ-0001eA-St for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:27 -0500 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-3862df95f92so1072553f8f.2 for ; Fri, 13 Dec 2024 09:33:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111204; x=1734716004; 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=Z9x+S9fuo7ZRjCW8SqS6FnyIn7ZG87oRP6R1u9y80i4=; b=g7cqNiznjlNfHMlrpzIx5yqZAepHjqKlgxvuRx/Wu57uqF55mhtIveNHIvr++op0H+ bd0jMLCg+RjxRmbDFxgDqK4M2KmoU3iCw+8ELez20OV5t910QZVqaQx7PLGBI0ti+cC3 9y2BWgenac0zKv8pywhvw0GKd0cuGH+MuX3v/G2cBGKiF0bRlFWFtilqJ5XqVRDJKjja oJ0v1jFj7VPBZViwRdqUMFPSzpeikjFSexdZDnUeMlmfn6PpfPNVJBAGZKcp6cJM48Qa CvsCrCi+uA5k4NfAg+S1JY1d8J6lEAm/S3QOLcpON0hi8X9W4nvbiD+x+cpRLNG3vq0k Mv+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111204; x=1734716004; 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=Z9x+S9fuo7ZRjCW8SqS6FnyIn7ZG87oRP6R1u9y80i4=; b=RvVdAFsxFcWyDzBgKpYeLl6ncSIyqLROtzJ1QA7mENBCKUabFiS9zkEf7RD3oLDOww 7TjkEB3WswjLlOCIjBGtafkRr6TBQ2Xr1vaZRwdBzMMOlfAl3iiQDIuTEWJxs/Tu94SD cgEC4+6JRZ2UUefie+vFDvkAQXHEtPbg3VGxk99JTD87QiqWp7pi/31t+vQGX7H4wwd3 c4oFHYLzyE4BW2On7KoUC2PJzR50hdsivmsDUDzs4dj5mpTKAGdJJ22XkXkb82c9kLOg SkSDq/kegahR/IPQCtG1hqId6VljFXTGAoUY8ZKYyFQoODy3Q1QJPG1GqBwyJR49tUey 3sfA== X-Gm-Message-State: AOJu0YwcMtcBcGSQqDrUDTkjuw3fievQTM2izVGI45jRmCe9tgUd2Z1p akpV0cc0NGoQV1HRpLNLpvUJTYCkywRpGwuWNZ3FRW3x7MmNzuQnflXUwoh4FhpV2SJsi+zESsk u X-Gm-Gg: ASbGnctpnvk/Iu6I32sUd0n/vfoVO8BIjHU6hVl3MaH+5oCmXKNUug3/dQ0CLygPFGz pMCalndyIjg/N59RxxeXc+Dh4W3x3ZDyXESdFUGylfCAkKI1ovX6HHoC/nttRsg82azX3HY5gLd 9ymRpVjGlcor+29xc2iVfNofYPs//vrhU1qgzmtg23P6Vt/PXVwctzBd5ZijY2QQ8IFF2tO9fg9 U/0R3KGhrtfJ9GbZA1l1MUY6lwILar/5mIKWEKAe0ECvp7zfA5YUgJ7W8HvPw== X-Received: by 2002:a5d:47a2:0:b0:385:f470:c2e1 with SMTP id ffacd0b85a97d-38880ac2400mr2624039f8f.2.1734111204362; Fri, 13 Dec 2024 09:33:24 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:23 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 49/85] target/arm: Convert XTN, SQXTUN, SQXTN, UQXTN to decodetree Date: Fri, 13 Dec 2024 17:31:53 +0000 Message-Id: <20241213173229.3308926-50-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x429.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-50-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 9 ++ target/arm/tcg/translate-a64.c | 153 ++++++++++++++++++++------------- 2 files changed, 102 insertions(+), 60 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index f3488766b21..295329448f1 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -1642,6 +1642,10 @@ CMEQ0_s 0101 1110 111 00000 10011 0 ..... ..... @rr CMLE0_s 0111 1110 111 00000 10011 0 ..... ..... @rr CMLT0_s 0101 1110 111 00000 10101 0 ..... ..... @rr +SQXTUN_s 0111 1110 ..1 00001 00101 0 ..... ..... @rr_e +SQXTN_s 0101 1110 ..1 00001 01001 0 ..... ..... @rr_e +UQXTN_s 0111 1110 ..1 00001 01001 0 ..... ..... @rr_e + # Advanced SIMD two-register miscellaneous SQABS_v 0.00 1110 ..1 00000 01111 0 ..... ..... @qrr_e @@ -1667,3 +1671,8 @@ SADDLP_v 0.00 1110 ..1 00000 00101 0 ..... ..... @qrr_e UADDLP_v 0.10 1110 ..1 00000 00101 0 ..... ..... @qrr_e SADALP_v 0.00 1110 ..1 00000 01101 0 ..... ..... @qrr_e UADALP_v 0.10 1110 ..1 00000 01101 0 ..... ..... @qrr_e + +XTN 0.00 1110 ..1 00001 00101 0 ..... ..... @qrr_e +SQXTUN_v 0.10 1110 ..1 00001 00101 0 ..... ..... @qrr_e +SQXTN_v 0.00 1110 ..1 00001 01001 0 ..... ..... @qrr_e +UQXTN_v 0.10 1110 ..1 00001 01001 0 ..... ..... @qrr_e diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 0e8e8670582..7b76945b0ac 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -8921,6 +8921,62 @@ TRANS(CMLE0_s, do_cmop0_d, a, TCG_COND_LE) TRANS(CMLT0_s, do_cmop0_d, a, TCG_COND_LT) TRANS(CMEQ0_s, do_cmop0_d, a, TCG_COND_EQ) +static bool do_2misc_narrow_scalar(DisasContext *s, arg_rr_e *a, + ArithOneOp * const fn[3]) +{ + if (a->esz == MO_64) { + return false; + } + if (fp_access_check(s)) { + TCGv_i64 t = tcg_temp_new_i64(); + + read_vec_element(s, t, a->rn, 0, a->esz + 1); + fn[a->esz](t, t); + clear_vec(s, a->rd); + write_vec_element(s, t, a->rd, 0, a->esz); + } + return true; +} + +#define WRAP_ENV(NAME) \ + static void gen_##NAME(TCGv_i64 d, TCGv_i64 n) \ + { gen_helper_##NAME(d, tcg_env, n); } + +WRAP_ENV(neon_unarrow_sat8) +WRAP_ENV(neon_unarrow_sat16) +WRAP_ENV(neon_unarrow_sat32) + +static ArithOneOp * const f_scalar_sqxtun[] = { + gen_neon_unarrow_sat8, + gen_neon_unarrow_sat16, + gen_neon_unarrow_sat32, +}; +TRANS(SQXTUN_s, do_2misc_narrow_scalar, a, f_scalar_sqxtun) + +WRAP_ENV(neon_narrow_sat_s8) +WRAP_ENV(neon_narrow_sat_s16) +WRAP_ENV(neon_narrow_sat_s32) + +static ArithOneOp * const f_scalar_sqxtn[] = { + gen_neon_narrow_sat_s8, + gen_neon_narrow_sat_s16, + gen_neon_narrow_sat_s32, +}; +TRANS(SQXTN_s, do_2misc_narrow_scalar, a, f_scalar_sqxtn) + +WRAP_ENV(neon_narrow_sat_u8) +WRAP_ENV(neon_narrow_sat_u16) +WRAP_ENV(neon_narrow_sat_u32) + +static ArithOneOp * const f_scalar_uqxtn[] = { + gen_neon_narrow_sat_u8, + gen_neon_narrow_sat_u16, + gen_neon_narrow_sat_u32, +}; +TRANS(UQXTN_s, do_2misc_narrow_scalar, a, f_scalar_uqxtn) + +#undef WRAP_ENV + static bool do_gvec_fn2(DisasContext *s, arg_qrr_e *a, GVecGen2Fn *fn) { if (!a->q && a->esz == MO_64) { @@ -8964,6 +9020,37 @@ TRANS(UADDLP_v, do_gvec_fn2_bhs, a, gen_gvec_uaddlp) TRANS(SADALP_v, do_gvec_fn2_bhs, a, gen_gvec_sadalp) TRANS(UADALP_v, do_gvec_fn2_bhs, a, gen_gvec_uadalp) +static bool do_2misc_narrow_vector(DisasContext *s, arg_qrr_e *a, + ArithOneOp * const fn[3]) +{ + if (a->esz == MO_64) { + return false; + } + if (fp_access_check(s)) { + TCGv_i64 t0 = tcg_temp_new_i64(); + TCGv_i64 t1 = tcg_temp_new_i64(); + + read_vec_element(s, t0, a->rn, 0, MO_64); + read_vec_element(s, t1, a->rn, 1, MO_64); + fn[a->esz](t0, t0); + fn[a->esz](t1, t1); + write_vec_element(s, t0, a->rd, a->q ? 2 : 0, MO_32); + write_vec_element(s, t1, a->rd, a->q ? 3 : 1, MO_32); + clear_vec_high(s, a->q, a->rd); + } + return true; +} + +static ArithOneOp * const f_scalar_xtn[] = { + gen_helper_neon_narrow_u8, + gen_helper_neon_narrow_u16, + tcg_gen_ext32u_i64, +}; +TRANS(XTN, do_2misc_narrow_vector, a, f_scalar_xtn) +TRANS(SQXTUN_v, do_2misc_narrow_vector, a, f_scalar_sqxtun) +TRANS(SQXTN_v, do_2misc_narrow_vector, a, f_scalar_sqxtn) +TRANS(UQXTN_v, do_2misc_narrow_vector, a, f_scalar_uqxtn) + /* Common vector code for handling integer to FP conversion */ static void handle_simd_intfp_conv(DisasContext *s, int rd, int rn, int elements, int is_signed, @@ -9546,38 +9633,6 @@ static void handle_2misc_narrow(DisasContext *s, bool scalar, tcg_res[pass] = tcg_temp_new_i64(); switch (opcode) { - case 0x12: /* XTN, SQXTUN */ - { - static NeonGenOne64OpFn * const xtnfns[3] = { - gen_helper_neon_narrow_u8, - gen_helper_neon_narrow_u16, - tcg_gen_ext32u_i64, - }; - static NeonGenOne64OpEnvFn * const sqxtunfns[3] = { - gen_helper_neon_unarrow_sat8, - gen_helper_neon_unarrow_sat16, - gen_helper_neon_unarrow_sat32, - }; - if (u) { - genenvfn = sqxtunfns[size]; - } else { - genfn = xtnfns[size]; - } - break; - } - case 0x14: /* SQXTN, UQXTN */ - { - static NeonGenOne64OpEnvFn * const fns[3][2] = { - { gen_helper_neon_narrow_sat_s8, - gen_helper_neon_narrow_sat_u8 }, - { gen_helper_neon_narrow_sat_s16, - gen_helper_neon_narrow_sat_u16 }, - { gen_helper_neon_narrow_sat_s32, - gen_helper_neon_narrow_sat_u32 }, - }; - genenvfn = fns[size][u]; - break; - } case 0x16: /* FCVTN, FCVTN2 */ /* 32 bit to 16 bit or 64 bit to 32 bit float conversion */ if (size == 2) { @@ -9618,6 +9673,8 @@ static void handle_2misc_narrow(DisasContext *s, bool scalar, } break; default: + case 0x12: /* XTN, SQXTUN */ + case 0x14: /* SQXTN, UQXTN */ g_assert_not_reached(); } @@ -9653,22 +9710,6 @@ static void disas_simd_scalar_two_reg_misc(DisasContext *s, uint32_t insn) TCGv_ptr tcg_fpstatus; switch (opcode) { - case 0x12: /* SQXTUN */ - if (!u) { - unallocated_encoding(s); - return; - } - /* fall through */ - case 0x14: /* SQXTN, UQXTN */ - if (size == 3) { - unallocated_encoding(s); - return; - } - if (!fp_access_check(s)) { - return; - } - handle_2misc_narrow(s, true, opcode, u, false, size, rn, rd); - return; case 0xc ... 0xf: case 0x16 ... 0x1d: case 0x1f: @@ -9742,6 +9783,8 @@ static void disas_simd_scalar_two_reg_misc(DisasContext *s, uint32_t insn) case 0x9: /* CMEQ, CMLE */ case 0xa: /* CMLT */ case 0xb: /* ABS, NEG */ + case 0x12: /* SQXTUN */ + case 0x14: /* SQXTN, UQXTN */ unallocated_encoding(s); return; } @@ -9939,18 +9982,6 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) TCGv_ptr tcg_fpstatus; switch (opcode) { - case 0x12: /* XTN, XTN2, SQXTUN, SQXTUN2 */ - case 0x14: /* SQXTN, SQXTN2, UQXTN, UQXTN2 */ - if (size == 3) { - unallocated_encoding(s); - return; - } - if (!fp_access_check(s)) { - return; - } - - handle_2misc_narrow(s, false, opcode, u, is_q, size, rn, rd); - return; case 0x13: /* SHLL, SHLL2 */ if (u == 0 || size == 3) { unallocated_encoding(s); @@ -10142,6 +10173,8 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) case 0x9: /* CMEQ, CMLE */ case 0xa: /* CMLT */ case 0xb: /* ABS, NEG */ + case 0x12: /* XTN, XTN2, SQXTUN, SQXTUN2 */ + case 0x14: /* SQXTN, SQXTN2, UQXTN, UQXTN2 */ unallocated_encoding(s); return; } From patchwork Fri Dec 13 17:31:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850216 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1643818wry; Fri, 13 Dec 2024 09:46:34 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXLtb5flVZP1sOqcLH79b9eJJ1BxsDf5wVcNcRNs/gSA2dyM4jHoDw+7J0PJMv9rbJ/qhNtyQ==@linaro.org X-Google-Smtp-Source: AGHT+IGm1prgsxlp8nfHwsVVHv0Tfy20bwWqp/Hx9CuE3IiprN9tmkx0SxmK2IuSIvyy3ReLRvOT X-Received: by 2002:a05:600c:348d:b0:42f:7e87:3438 with SMTP id 5b1f17b1804b1-4362a981141mr36471805e9.0.1734111994591; Fri, 13 Dec 2024 09:46:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111994; cv=none; d=google.com; s=arc-20240605; b=D4ME7ZslyCjNE3sdKhQgqzrZLm6UtHAooYTIAsIu0WejYASS/xGJcNHgY9hQysBgug FQmhfmHxRul8xrZL7NszdiCj2Jcn1D0pakvjbbM3kWh9G1uZgCNdOKqYnky79M4YlEYp rnru95XqognBr1EThOYGttDQXb47YAoael3E6TSJ2oWj5ZFnPkrKZMPvrqcQ4PshgoJf 4Hxr7HgS/AixZBPKG8sXVhn3zkZQwC5GBswfRxlB9MPULPEGJqRs7WdMYwvRBjV0BlQw JBu/US9CAU9Hy3RKgVeak+k6Y9W3nvd19Q0pEKBwzXe2SwF1mShqXcZqEp3jXJ/i0SKM jYkQ== 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=Q5D537/TkN0iatJV/r504lV14FuBKX7MulHaFGn4dqY=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=J5x+/GBjpKdk0ufOfP59HcQ49uATxgzHpjRohp/j8gcwvPzIrvCDAmKP0NrxZWqsYX ZuM/JC3iX0uPeQKsDlGSeXtB9rMmCox/sRN6ouohSFzSXtQMWm8jkG2pH/j8qeSraKuA iplTDaAv9CShfoROrYQyXM/7hUSTSq4c2F8N+tPzfK0pbxIltYvPhECGsHLtV3DuXBqI Qz+Dn3Fwa4RGAZIrUo172ABstfimYai3tntjfze6npUuCjNU7yCTi7JY8WTpSHZpkXOp O7pQ1M0LQ+cXJdXV6Uifb5kpwEqwyouIOdmYCn/jJxIJ7WlJnLg4fjxWI+2wpwN3Da8z fx5Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DPJZcIWn; 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 5b1f17b1804b1-43636015691si166235e9.11.2024.12.13.09.46.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:46:34 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DPJZcIWn; 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 1tM9YX-0002rb-Gl; Fri, 13 Dec 2024 12:34:25 -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 1tM9Xf-0007eb-BB for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:31 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9Xc-0001eI-DD for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:31 -0500 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-385eed29d17so1082593f8f.0 for ; Fri, 13 Dec 2024 09:33:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111205; x=1734716005; 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=Q5D537/TkN0iatJV/r504lV14FuBKX7MulHaFGn4dqY=; b=DPJZcIWnDNpDp6AiFbK3FPYw3jW+HzIV2EmpBI4s3UqjQlD6jTvxC88eGfg0ErpiYY Idldnq8yFlezonNil+Wu6BgWsQ1NFWviIxPNor+/5+rrt2Ei9d8tJjmPTqyUxBGfeI2t sAW+FbozffHuBykl9otMtlXQ+zHeZHGkPK/OsVA4AyqsfN7zTo8VNTW3QR3wDAwAsmNH ezTu/5esqXosDoE0RQuQxGysW9MDHmnSjdGWMM+zQP4+kRAeX4FCgrFloFCtWlomj5FS v/fJqpmcP6GHb+7HsJv8h2Fymu3aeBFM/rhzUpb7nuTo/KRW6rCne56q9tydEDcNikl9 mS8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111205; x=1734716005; 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=Q5D537/TkN0iatJV/r504lV14FuBKX7MulHaFGn4dqY=; b=py2+NxFFefRFRiBO85uRFfLmf9M/OfBrvGm7+T7E3Orhg9Wv8nnuYFVfZQLLoJdzDN fQ7R9oKZR/juoSln3N2rsdggB8uD65sHMaiLHSnKpfwa4PgZXeKEq1sNX/t9fbAwQpTP hoiridBOPPYSvfMqggp2uQFeGGJox5d8/tP9wFmZkOisCYQRxhnH8IY5QoQny/CEdprY IXy+TbzHcNLvKucipGBxrbfZQhpdWgIPGA+XJraqTvj0FpJqQk47zaUCTl3YOKs88qVj Nj71E6XNBYtLD+QPFzekNYgcDJCOQ+vKtzV04MdpnKqrCykIPq/Key2rVTBO6Rm4PFO5 G2dA== X-Gm-Message-State: AOJu0YzoxvSkT/JSifFpPo/6PRt2qMat1li/CG4Imf12uwO8emFmwaWU Yy34aU44MihWVDjvvhWychTCg4YPnbJ38dQLbkvV4H+GMZ5EioXal98gZKP9nFxUgByNMTbACS9 X X-Gm-Gg: ASbGnctPc/CORlszfzwteYr2PgU4MT4dohaFGkKkROse+rk9hpCXKq5CIzvuvDj6eoq Mj0bd2/lsgJarZkf0lg34++5e1UEh4DsQjuc08CEo1/DSGtm1SeYDLUB3MxAUJq1CW3S6H+6K4b ocrhAM0K1LgJkSsMCVNWLZaQXssIHQcJtl1ShWyGveaMVHkEAox9Lz+rAP4Xn2DbWrMAsOf6zFY 546AThPsmi+w1E2oxKb7C47HyezkdAB/hTfXcj5HbAZnalD1D6jfMNArvV6gQ== X-Received: by 2002:a05:6000:4b0b:b0:386:32ca:1672 with SMTP id ffacd0b85a97d-38880ac218bmr3080089f8f.4.1734111205289; Fri, 13 Dec 2024 09:33:25 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:24 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 50/85] target/arm: Convert FCVTN, BFCVTN to decodetree Date: Fri, 13 Dec 2024 17:31:54 +0000 Message-Id: <20241213173229.3308926-51-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-51-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 5 ++ target/arm/tcg/translate-a64.c | 89 ++++++++++++++++++---------------- 2 files changed, 52 insertions(+), 42 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 295329448f1..456912cd7ca 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -21,6 +21,7 @@ %rd 0:5 %esz_sd 22:1 !function=plus_2 +%esz_hs 22:1 !function=plus_1 %esz_hsd 22:2 !function=xor_2 %hl 11:1 21:1 %hlm 11:1 20:2 @@ -74,6 +75,7 @@ @qrr_b . q:1 ...... .. ...... ...... rn:5 rd:5 &qrr_e esz=0 @qrr_h . q:1 ...... .. ...... ...... rn:5 rd:5 &qrr_e esz=1 @qrr_bh . q:1 ...... . esz:1 ...... ...... rn:5 rd:5 &qrr_e +@qrr_hs . q:1 ...... .. ...... ...... rn:5 rd:5 &qrr_e esz=%esz_hs @qrr_e . q:1 ...... esz:2 ...... ...... rn:5 rd:5 &qrr_e @qrrr_b . q:1 ...... ... rm:5 ...... rn:5 rd:5 &qrrr_e esz=0 @@ -1676,3 +1678,6 @@ XTN 0.00 1110 ..1 00001 00101 0 ..... ..... @qrr_e SQXTUN_v 0.10 1110 ..1 00001 00101 0 ..... ..... @qrr_e SQXTN_v 0.00 1110 ..1 00001 01001 0 ..... ..... @qrr_e UQXTN_v 0.10 1110 ..1 00001 01001 0 ..... ..... @qrr_e + +FCVTN_v 0.00 1110 0.1 00001 01101 0 ..... ..... @qrr_hs +BFCVTN_v 0.00 1110 101 00001 01101 0 ..... ..... @qrr_h diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 7b76945b0ac..d4d19c9caaf 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -9051,6 +9051,49 @@ TRANS(SQXTUN_v, do_2misc_narrow_vector, a, f_scalar_sqxtun) TRANS(SQXTN_v, do_2misc_narrow_vector, a, f_scalar_sqxtn) TRANS(UQXTN_v, do_2misc_narrow_vector, a, f_scalar_uqxtn) +static void gen_fcvtn_hs(TCGv_i64 d, TCGv_i64 n) +{ + TCGv_i32 tcg_lo = tcg_temp_new_i32(); + TCGv_i32 tcg_hi = tcg_temp_new_i32(); + TCGv_ptr fpst = fpstatus_ptr(FPST_FPCR); + TCGv_i32 ahp = get_ahp_flag(); + + tcg_gen_extr_i64_i32(tcg_lo, tcg_hi, n); + gen_helper_vfp_fcvt_f32_to_f16(tcg_lo, tcg_lo, fpst, ahp); + gen_helper_vfp_fcvt_f32_to_f16(tcg_hi, tcg_hi, fpst, ahp); + tcg_gen_deposit_i32(tcg_lo, tcg_lo, tcg_hi, 16, 16); + tcg_gen_extu_i32_i64(d, tcg_lo); +} + +static void gen_fcvtn_sd(TCGv_i64 d, TCGv_i64 n) +{ + TCGv_i32 tmp = tcg_temp_new_i32(); + gen_helper_vfp_fcvtsd(tmp, n, tcg_env); + tcg_gen_extu_i32_i64(d, tmp); +} + +static ArithOneOp * const f_vector_fcvtn[] = { + NULL, + gen_fcvtn_hs, + gen_fcvtn_sd, +}; +TRANS(FCVTN_v, do_2misc_narrow_vector, a, f_vector_fcvtn) + +static void gen_bfcvtn_hs(TCGv_i64 d, TCGv_i64 n) +{ + TCGv_ptr fpst = fpstatus_ptr(FPST_FPCR); + TCGv_i32 tmp = tcg_temp_new_i32(); + gen_helper_bfcvt_pair(tmp, n, fpst); + tcg_gen_extu_i32_i64(d, tmp); +} + +static ArithOneOp * const f_vector_bfcvtn[] = { + NULL, + gen_bfcvtn_hs, + NULL, +}; +TRANS_FEAT(BFCVTN_v, aa64_bf16, do_2misc_narrow_vector, a, f_vector_bfcvtn) + /* Common vector code for handling integer to FP conversion */ static void handle_simd_intfp_conv(DisasContext *s, int rd, int rn, int elements, int is_signed, @@ -9633,33 +9676,6 @@ static void handle_2misc_narrow(DisasContext *s, bool scalar, tcg_res[pass] = tcg_temp_new_i64(); switch (opcode) { - case 0x16: /* FCVTN, FCVTN2 */ - /* 32 bit to 16 bit or 64 bit to 32 bit float conversion */ - if (size == 2) { - TCGv_i32 tmp = tcg_temp_new_i32(); - gen_helper_vfp_fcvtsd(tmp, tcg_op, tcg_env); - tcg_gen_extu_i32_i64(tcg_res[pass], tmp); - } else { - TCGv_i32 tcg_lo = tcg_temp_new_i32(); - TCGv_i32 tcg_hi = tcg_temp_new_i32(); - TCGv_ptr fpst = fpstatus_ptr(FPST_FPCR); - TCGv_i32 ahp = get_ahp_flag(); - - tcg_gen_extr_i64_i32(tcg_lo, tcg_hi, tcg_op); - gen_helper_vfp_fcvt_f32_to_f16(tcg_lo, tcg_lo, fpst, ahp); - gen_helper_vfp_fcvt_f32_to_f16(tcg_hi, tcg_hi, fpst, ahp); - tcg_gen_deposit_i32(tcg_lo, tcg_lo, tcg_hi, 16, 16); - tcg_gen_extu_i32_i64(tcg_res[pass], tcg_lo); - } - break; - case 0x36: /* BFCVTN, BFCVTN2 */ - { - TCGv_ptr fpst = fpstatus_ptr(FPST_FPCR); - TCGv_i32 tmp = tcg_temp_new_i32(); - gen_helper_bfcvt_pair(tmp, tcg_op, fpst); - tcg_gen_extu_i32_i64(tcg_res[pass], tmp); - } - break; case 0x56: /* FCVTXN, FCVTXN2 */ { /* @@ -9675,6 +9691,8 @@ static void handle_2misc_narrow(DisasContext *s, bool scalar, default: case 0x12: /* XTN, SQXTUN */ case 0x14: /* SQXTN, UQXTN */ + case 0x16: /* FCVTN, FCVTN2 */ + case 0x36: /* BFCVTN, BFCVTN2 */ g_assert_not_reached(); } @@ -10088,21 +10106,6 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) unallocated_encoding(s); return; } - /* fall through */ - case 0x16: /* FCVTN, FCVTN2 */ - /* handle_2misc_narrow does a 2*size -> size operation, but these - * instructions encode the source size rather than dest size. - */ - if (!fp_access_check(s)) { - return; - } - handle_2misc_narrow(s, false, opcode, 0, is_q, size - 1, rn, rd); - return; - case 0x36: /* BFCVTN, BFCVTN2 */ - if (!dc_isar_feature(aa64_bf16, s) || size != 2) { - unallocated_encoding(s); - return; - } if (!fp_access_check(s)) { return; } @@ -10155,6 +10158,8 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) } break; default: + case 0x16: /* FCVTN, FCVTN2 */ + case 0x36: /* BFCVTN, BFCVTN2 */ unallocated_encoding(s); return; } From patchwork Fri Dec 13 17:31:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850174 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1640518wry; Fri, 13 Dec 2024 09:39:09 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUKX3gKB1cz4Y/EznoE23hwJjn0K9QPdNWTXZDCRZnohk+usCslvfZonpsJC9aTu0hUB2/6Rw==@linaro.org X-Google-Smtp-Source: AGHT+IEHScMCHTf2ys6yo46tkDhHGfsQn6z6Zb8XGCshAIj9MxY2rTBXnJTYSc+1BIBWtBdDmXgU X-Received: by 2002:a17:906:6a08:b0:aa6:9e0f:d985 with SMTP id a640c23a62f3a-aab779c7673mr324261566b.35.1734111549182; Fri, 13 Dec 2024 09:39:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111549; cv=none; d=google.com; s=arc-20240605; b=dvslbC+ujghXN16bZTny4JUK3/6gTWYCPXo685zoXfxG4PiopNwGZ0QhbE7w9OY/KW /prXKC+03dSYqVBDtFmGqzxRIG/e4pfMT+l2tdCrpCaNifJS6phGL6oNw0qtApHbi5oN R2Wy429J1uvkR83ZjI+mKBCzM37uFmmfpaexHeUF4MaiHGREasE4wH55JBFZ5U7E4KEv Zre/KIrFBvO2OVm1njG+TConkMslcVp4iWXbWeW4QNy4Ot+th6iwzQLPMU7qMDPGLbqq y8bGh9dJnrWYAFYq23sR2e5uKhR5mN7MkXAeZbSEIF/YRwAXZhBWebOd19LnrBXD3q9s Krsw== 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=lGbtCRWoydk8pPXUYUd7BrLc4u+jFF25VA+zygABZmk=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=GqQ+OcObpWD5iC0CT0y5M5mXW8C0SH8VhcgnNIb4ZjKrwepaP/602lEEWCD8vy+79+ vpTg+nGCRV2ID1apDHP5PoCCT0Uh29F6T74htdfzy+lPQXXHlwcGUmKlhl247Qvuyb0W +ydP2vx00rPgBdSJQSO552MRnuD8qftDzm1k/ZJAfxdo97VAOfm7x9bsIH6LtCkpane9 ciP3d5t9PkGjxtiwfRocXNIJT/lhfLy6ad4LCES2iVKGt6u+5Davw0xjYIXcquvYHfYu ZEBrBmvWIL70siwUZtG3dSQoiEExbbDJzJLeiCzom0S/NrzUM8PQVV0dRryr11o3f4t5 h2VQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OM3Qsu6Z; 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 a640c23a62f3a-aa6261d4843si1297281466b.786.2024.12.13.09.39.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:39:09 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OM3Qsu6Z; 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 1tM9YL-0001TQ-HS; Fri, 13 Dec 2024 12:34: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 1tM9Xg-0007jc-P5 for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:32 -0500 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9Xd-0001eP-Rm for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:32 -0500 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-385e1fcb0e1so1096628f8f.2 for ; Fri, 13 Dec 2024 09:33:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111206; x=1734716006; 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=lGbtCRWoydk8pPXUYUd7BrLc4u+jFF25VA+zygABZmk=; b=OM3Qsu6Z777ZbqmarPit+48k3ysrmx8Y5Vtwa5OoiWi0342Qse98JVMpdO0E6ijBI4 gK6AcnbYTaP4vO+eIGLMTNn45Vui/CI3RskTNp4uvfMsv8kq/ZTluLX0S+ovyVSFPrKa MlhISJyVlyanJLKsQkIy5dqvdKUP5BqjZ2D5qOaXRS4MoC/sxv0hKJOzWx24+choDbng jDgFCPp8DvYfP5E+2eFjrKjUgI+dXp4P5yzOLn4I3XqfqWzEYmLpXRHTJMiM6nVfV6q8 SnczAK3ArIybVkMkfIh5tKdwZwIV4u/YjsNJuek5d10fBwxkJyB5Eqs2ddtwvDmtOGmF BWkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111206; x=1734716006; 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=lGbtCRWoydk8pPXUYUd7BrLc4u+jFF25VA+zygABZmk=; b=j6jVDit6Vrs5ykjuiLufL68l6qFr8oOAaUACRuNj3vrV1tiimUqYZL+Os1yQkZpTEZ W9as4d44Emlm9j1DNeKuDoAbFcDTYUCsVdU/tI5a87KMQel2c24y6qwDgY0TCUJEAfxS oShylN6F2h3mmFIByAz/jgwVlk3eeNuRF0jN+UpqoBVXugwxAv830zpELQ0Ui/lt4YPF 0bEo5EYrNMR9JnTZV7vRD21EdnLbZL31ltjon2yn2+2I3c+spePSg0JZk6fAc3+ZV57h oynNK8WkisEetCXk2djEBg7s64IMH2koKsK4ouGfTcADcxSA3XncVg+e+SjVmJ0dfgMd W8pw== X-Gm-Message-State: AOJu0YwcjjRgwPDFHc/q944q29OHYbXDLhBhatMpPBPF3pl07lM4sijt 4ui+DKcdoW7FtwkN7KPjmwfGQhJ4EgSBDMscXvPuAcYXnREhCyO3xO+DPZI2NvgpUo/q0yY/WTJ n X-Gm-Gg: ASbGnctA0tXNZs97Gtlxq2+ePwH4L0dKec16uKjGpC7Sz5bmv7ZkhQIEZf6tYd2PYpF 5EuUPI3Gz4KUdilZBqveagbfVqzosiIBhkz6ycj7v+jOrZXNnQqkfIPQJXYSDeZs/sM3ysqpb7n K3T/7QCAVJ+NdE+dDshgYmr9pIjWfoaoJ3lF9wjTHZ1zD6CdBzBvh2mADMjWo1LTFY4NCaa/lRT z9L2ufnW56PXRMIlFmZeCDf+ytk4aiI0u/yYwCkpoKOLBN1/9cSzZHPTeXT2g== X-Received: by 2002:a05:6000:2ad:b0:385:df6b:7ef6 with SMTP id ffacd0b85a97d-3888e0be442mr2454999f8f.51.1734111206322; Fri, 13 Dec 2024 09:33:26 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:25 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 51/85] target/arm: Convert FCVTXN to decodetree Date: Fri, 13 Dec 2024 17:31:55 +0000 Message-Id: <20241213173229.3308926-52-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x430.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Remove handle_2misc_narrow as this was the last insn decoded by that function. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-52-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 4 ++ target/arm/tcg/translate-a64.c | 101 +++++++-------------------------- 2 files changed, 24 insertions(+), 81 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 456912cd7ca..d8902dfb226 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -74,6 +74,7 @@ @qrr_b . q:1 ...... .. ...... ...... rn:5 rd:5 &qrr_e esz=0 @qrr_h . q:1 ...... .. ...... ...... rn:5 rd:5 &qrr_e esz=1 +@qrr_s . q:1 ...... .. ...... ...... rn:5 rd:5 &qrr_e esz=2 @qrr_bh . q:1 ...... . esz:1 ...... ...... rn:5 rd:5 &qrr_e @qrr_hs . q:1 ...... .. ...... ...... rn:5 rd:5 &qrr_e esz=%esz_hs @qrr_e . q:1 ...... esz:2 ...... ...... rn:5 rd:5 &qrr_e @@ -1648,6 +1649,8 @@ SQXTUN_s 0111 1110 ..1 00001 00101 0 ..... ..... @rr_e SQXTN_s 0101 1110 ..1 00001 01001 0 ..... ..... @rr_e UQXTN_s 0111 1110 ..1 00001 01001 0 ..... ..... @rr_e +FCVTXN_s 0111 1110 011 00001 01101 0 ..... ..... @rr_s + # Advanced SIMD two-register miscellaneous SQABS_v 0.00 1110 ..1 00000 01111 0 ..... ..... @qrr_e @@ -1680,4 +1683,5 @@ SQXTN_v 0.00 1110 ..1 00001 01001 0 ..... ..... @qrr_e UQXTN_v 0.10 1110 ..1 00001 01001 0 ..... ..... @qrr_e FCVTN_v 0.00 1110 0.1 00001 01101 0 ..... ..... @qrr_hs +FCVTXN_v 0.10 1110 011 00001 01101 0 ..... ..... @qrr_s BFCVTN_v 0.00 1110 101 00001 01101 0 ..... ..... @qrr_h diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index d4d19c9caaf..1c454a37f41 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -8975,6 +8975,24 @@ static ArithOneOp * const f_scalar_uqxtn[] = { }; TRANS(UQXTN_s, do_2misc_narrow_scalar, a, f_scalar_uqxtn) +static void gen_fcvtxn_sd(TCGv_i64 d, TCGv_i64 n) +{ + /* + * 64 bit to 32 bit float conversion + * with von Neumann rounding (round to odd) + */ + TCGv_i32 tmp = tcg_temp_new_i32(); + gen_helper_fcvtx_f64_to_f32(tmp, n, tcg_env); + tcg_gen_extu_i32_i64(d, tmp); +} + +static ArithOneOp * const f_scalar_fcvtxn[] = { + NULL, + NULL, + gen_fcvtxn_sd, +}; +TRANS(FCVTXN_s, do_2misc_narrow_scalar, a, f_scalar_fcvtxn) + #undef WRAP_ENV static bool do_gvec_fn2(DisasContext *s, arg_qrr_e *a, GVecGen2Fn *fn) @@ -9078,6 +9096,7 @@ static ArithOneOp * const f_vector_fcvtn[] = { gen_fcvtn_sd, }; TRANS(FCVTN_v, do_2misc_narrow_vector, a, f_vector_fcvtn) +TRANS(FCVTXN_v, do_2misc_narrow_vector, a, f_scalar_fcvtxn) static void gen_bfcvtn_hs(TCGv_i64 d, TCGv_i64 n) { @@ -9647,68 +9666,6 @@ static void handle_2misc_reciprocal(DisasContext *s, int opcode, } } -static void handle_2misc_narrow(DisasContext *s, bool scalar, - int opcode, bool u, bool is_q, - int size, int rn, int rd) -{ - /* Handle 2-reg-misc ops which are narrowing (so each 2*size element - * in the source becomes a size element in the destination). - */ - int pass; - TCGv_i64 tcg_res[2]; - int destelt = is_q ? 2 : 0; - int passes = scalar ? 1 : 2; - - if (scalar) { - tcg_res[1] = tcg_constant_i64(0); - } - - for (pass = 0; pass < passes; pass++) { - TCGv_i64 tcg_op = tcg_temp_new_i64(); - NeonGenOne64OpFn *genfn = NULL; - NeonGenOne64OpEnvFn *genenvfn = NULL; - - if (scalar) { - read_vec_element(s, tcg_op, rn, pass, size + 1); - } else { - read_vec_element(s, tcg_op, rn, pass, MO_64); - } - tcg_res[pass] = tcg_temp_new_i64(); - - switch (opcode) { - case 0x56: /* FCVTXN, FCVTXN2 */ - { - /* - * 64 bit to 32 bit float conversion - * with von Neumann rounding (round to odd) - */ - TCGv_i32 tmp = tcg_temp_new_i32(); - assert(size == 2); - gen_helper_fcvtx_f64_to_f32(tmp, tcg_op, tcg_env); - tcg_gen_extu_i32_i64(tcg_res[pass], tmp); - } - break; - default: - case 0x12: /* XTN, SQXTUN */ - case 0x14: /* SQXTN, UQXTN */ - case 0x16: /* FCVTN, FCVTN2 */ - case 0x36: /* BFCVTN, BFCVTN2 */ - g_assert_not_reached(); - } - - if (genfn) { - genfn(tcg_res[pass], tcg_op); - } else if (genenvfn) { - genenvfn(tcg_res[pass], tcg_env, tcg_op); - } - } - - for (pass = 0; pass < 2; pass++) { - write_vec_element(s, tcg_res[pass], rd, destelt + pass, MO_32); - } - clear_vec_high(s, is_q, rd); -} - /* AdvSIMD scalar two reg misc * 31 30 29 28 24 23 22 21 17 16 12 11 10 9 5 4 0 * +-----+---+-----------+------+-----------+--------+-----+------+------+ @@ -9780,15 +9737,6 @@ static void disas_simd_scalar_two_reg_misc(DisasContext *s, uint32_t insn) rmode = FPROUNDING_TIEAWAY; break; case 0x56: /* FCVTXN, FCVTXN2 */ - if (size == 2) { - unallocated_encoding(s); - return; - } - if (!fp_access_check(s)) { - return; - } - handle_2misc_narrow(s, true, opcode, u, false, size - 1, rn, rd); - return; default: unallocated_encoding(s); return; @@ -10101,16 +10049,6 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) } handle_2misc_reciprocal(s, opcode, false, u, is_q, size, rn, rd); return; - case 0x56: /* FCVTXN, FCVTXN2 */ - if (size == 2) { - unallocated_encoding(s); - return; - } - if (!fp_access_check(s)) { - return; - } - handle_2misc_narrow(s, false, opcode, 0, is_q, size - 1, rn, rd); - return; case 0x17: /* FCVTL, FCVTL2 */ if (!fp_access_check(s)) { return; @@ -10160,6 +10098,7 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) default: case 0x16: /* FCVTN, FCVTN2 */ case 0x36: /* BFCVTN, BFCVTN2 */ + case 0x56: /* FCVTXN, FCVTXN2 */ unallocated_encoding(s); return; } From patchwork Fri Dec 13 17:31:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850151 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1638663wry; Fri, 13 Dec 2024 09:35:20 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXWULkEC/unIYR1o8PmTpWu5425Rh0S0rRKYo8UUPuThv+yfFdXjqXH/4FosztAjMQvdZJsUA==@linaro.org X-Google-Smtp-Source: AGHT+IETKhIAccKQNrwD9TvzSTzsI09FWixekOEoQLUUIzmaN1/5BuYtfuI1i3PLWiFY0L6CPU6g X-Received: by 2002:a05:6000:4b12:b0:385:f17b:de54 with SMTP id ffacd0b85a97d-38880ac4d2bmr3330595f8f.5.1734111320743; Fri, 13 Dec 2024 09:35:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111320; cv=none; d=google.com; s=arc-20240605; b=bhGdi85fUH4SjjMWoO6K7ySxL/u04GvV8VXnkBRoXuwiX3k00gMy0/TZHFe4pvk7d2 kFRLTSKLrUR5yDvcMWgweoxNasMFd51PZaLI7+oT38cxHSpXUEL0FBPtSroqbBRi+Glg g4LOypS8EA1PE8MhOqGaMsKCP5fFD9tsodzpYulWTOUR1btm4kEzhylK09S9uB8XzMD2 +tps8mQn5r62bc3HBzZ6ViPDOxAwc8M0pmtLLYvc6pECKCCgTgVhTXyjF0x31o4NWxoB dY6bznorR9gkjetdSfg1KLcokwcWl3idmYbO9JejFGDubSRuS8niyX+KeB2CylMP25Ep rrOA== 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=r+6irQsu7a7MfQTQOqsZKNWF1gh530qvy8WNteFOOF8=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=S/40gjyU3fVkBiCKIMulckB3D/9DibT7mafUkYES6mM95Su6f6rW/HxCoIsHc5ihYs /gXjwsi9gnPdDPsMzD8BJlfE+KbYnkxNn6jFFJXEuqiHTTohASYtrClxgne+jwWQHWy2 /vUNL2V+pmyPEPGZcDuTLKpwSOPy7l4oeI+arxtibXq6bUx7ZhzlSYij3eo0//XeKLXk OAhih83JqSHhV4E6rOL3x+vv2xaHKFNFD4sc0Wcd7krZI+JunVXlsp1LdJ07c9mfpzEI zeLeo2m8vVblKgAPhL7ZAlDL40UPeLKPS6+qo2fPwOHG2ge8e/9jrP7pdWLtBdJamjh1 14Ng==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qrsYcKs5; 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 ffacd0b85a97d-388c80161f4si49467f8f.255.2024.12.13.09.35.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:35: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=qrsYcKs5; 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 1tM9YI-0000zM-3z; Fri, 13 Dec 2024 12:34: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 1tM9Xf-0007eP-2f for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:31 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9Xd-0001ej-6B for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:30 -0500 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-38637614567so945274f8f.3 for ; Fri, 13 Dec 2024 09:33:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111207; x=1734716007; 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=r+6irQsu7a7MfQTQOqsZKNWF1gh530qvy8WNteFOOF8=; b=qrsYcKs5amSeM4aPSzTAM0SjoaoBl20byve0i64G6Wgs2zsgPGzlaZxmTbruxUNZqF I1id+Zra5adtB2K4xKyUJGQq61jmUisMq1ooh/rJQpwD25MLMR1VHIYgbwPhJIym4y/F 3FYfmc2RRSGhnzvL2B/vKCQsU+e5//GHfXKBWNMNsv81pMte8aH79khU57TLK9/WtzDA Ziq2at+zsX/yJ67oL/dyoOJf8TLilgrTFIhutQbenTIDPIdH+m4o+xM/9yO2Aodj8kGV Y4zN98kuMKMWfCBVXgJw9xy6bAzofagXQx7s75cFyW25elm1mW9cAxIhVl8pFhwOJisw KoEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111207; x=1734716007; 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=r+6irQsu7a7MfQTQOqsZKNWF1gh530qvy8WNteFOOF8=; b=PZHF0rU7VqKRdb7N9qklSTuGmqBuv5eC7XN7Eq2q/Lw5Jo4TflPzpdssslT/IQBNyk zniNuef0gcJ2DDeSeptkAIm6PUbQu56Bak9R+/wJRl/6E3VBZ4HyzmTizZ4d0z0K3dK9 SM2xp/X5pDm3i4pPLXf9XwWc24pKqfTdSMnGr8MEp5jaMvkgrPWzE4Le90go+5YrwHeq SOuiBPw2TyCpGfIDYG1BXCU+WSau5sHzjaij8wvfRTntdacVlp9gHDBIsrkkd68IR2BN l2WxgqtdJcPdR8ip+BBgp+kOkEysNDZC42OkihtlAWbj39xzq4quZNKk34YE9wS4r7o9 aOFQ== X-Gm-Message-State: AOJu0Yy0uLFVqJ9UFUG0W2RuWF3ZlNaPmX4Mo71RghIE5U5rSJOBnAl6 7gHkF2VuTpTQ1u7zKiAjdiiuS4uO1Q/eZkaW/vVAOvQ3aCGPjn0Ks8sq9BVYunbBB8VB4zyNUyE m X-Gm-Gg: ASbGncuOV35ZfzxLxf9Iu7DAwKfS9EXvWn8ows/1xj0o+g6vWnwKFyQ3fd3tkaAPyUC ij2x51Kv+3lXhQmFPs0bJx+RMqCk99lBgogf594ZcD294SIOlk0vjEyhooVW0oFRVc/fYLTsw0A taOlNx0Pz1mw5ZQQXBF0enFJ7/mWZwu7VW6dG0fKIpQ+Awsro/SI+/Gh5bi4nhpzTZmet/dze7N c6HWo5Jew3GB2js3zC/ZWiTLP+S8wL5dUhDTBpX7UHpLo7yS209OR3McuTJ/g== X-Received: by 2002:a05:6000:471d:b0:385:f271:a22c with SMTP id ffacd0b85a97d-3888e0c23c2mr2385639f8f.59.1734111207257; Fri, 13 Dec 2024 09:33:27 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:26 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 52/85] target/arm: Convert SHLL to decodetree Date: Fri, 13 Dec 2024 17:31:56 +0000 Message-Id: <20241213173229.3308926-53-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x434.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-53-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 2 + target/arm/tcg/translate-a64.c | 75 +++++++++++++++++----------------- 2 files changed, 40 insertions(+), 37 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index d8902dfb226..ec0d46a563c 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -1685,3 +1685,5 @@ UQXTN_v 0.10 1110 ..1 00001 01001 0 ..... ..... @qrr_e FCVTN_v 0.00 1110 0.1 00001 01101 0 ..... ..... @qrr_hs FCVTXN_v 0.10 1110 011 00001 01101 0 ..... ..... @qrr_s BFCVTN_v 0.00 1110 101 00001 01101 0 ..... ..... @qrr_h + +SHLL_v 0.10 1110 ..1 00001 00111 0 ..... ..... @qrr_e diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 1c454a37f41..c5d456de3be 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -9113,6 +9113,43 @@ static ArithOneOp * const f_vector_bfcvtn[] = { }; TRANS_FEAT(BFCVTN_v, aa64_bf16, do_2misc_narrow_vector, a, f_vector_bfcvtn) +static bool trans_SHLL_v(DisasContext *s, arg_qrr_e *a) +{ + static NeonGenWidenFn * const widenfns[3] = { + gen_helper_neon_widen_u8, + gen_helper_neon_widen_u16, + tcg_gen_extu_i32_i64, + }; + NeonGenWidenFn *widenfn; + TCGv_i64 tcg_res[2]; + TCGv_i32 tcg_op; + int part, pass; + + if (a->esz == MO_64) { + return false; + } + if (!fp_access_check(s)) { + return true; + } + + tcg_op = tcg_temp_new_i32(); + widenfn = widenfns[a->esz]; + part = a->q ? 2 : 0; + + for (pass = 0; pass < 2; pass++) { + read_vec_element_i32(s, tcg_op, a->rn, part + pass, MO_32); + tcg_res[pass] = tcg_temp_new_i64(); + widenfn(tcg_res[pass], tcg_op); + tcg_gen_shli_i64(tcg_res[pass], tcg_res[pass], 8 << a->esz); + } + + for (pass = 0; pass < 2; pass++) { + write_vec_element(s, tcg_res[pass], a->rd, pass, MO_64); + } + return true; +} + + /* Common vector code for handling integer to FP conversion */ static void handle_simd_intfp_conv(DisasContext *s, int rd, int rn, int elements, int is_signed, @@ -9901,33 +9938,6 @@ static void handle_2misc_widening(DisasContext *s, int opcode, bool is_q, } } -static void handle_shll(DisasContext *s, bool is_q, int size, int rn, int rd) -{ - /* Implement SHLL and SHLL2 */ - int pass; - int part = is_q ? 2 : 0; - TCGv_i64 tcg_res[2]; - - for (pass = 0; pass < 2; pass++) { - static NeonGenWidenFn * const widenfns[3] = { - gen_helper_neon_widen_u8, - gen_helper_neon_widen_u16, - tcg_gen_extu_i32_i64, - }; - NeonGenWidenFn *widenfn = widenfns[size]; - TCGv_i32 tcg_op = tcg_temp_new_i32(); - - read_vec_element_i32(s, tcg_op, rn, part + pass, MO_32); - tcg_res[pass] = tcg_temp_new_i64(); - widenfn(tcg_res[pass], tcg_op); - tcg_gen_shli_i64(tcg_res[pass], tcg_res[pass], 8 << size); - } - - for (pass = 0; pass < 2; pass++) { - write_vec_element(s, tcg_res[pass], rd, pass, MO_64); - } -} - /* AdvSIMD two reg misc * 31 30 29 28 24 23 22 21 17 16 12 11 10 9 5 4 0 * +---+---+---+-----------+------+-----------+--------+-----+------+------+ @@ -9948,16 +9958,6 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) TCGv_ptr tcg_fpstatus; switch (opcode) { - case 0x13: /* SHLL, SHLL2 */ - if (u == 0 || size == 3) { - unallocated_encoding(s); - return; - } - if (!fp_access_check(s)) { - return; - } - handle_shll(s, is_q, size, rn, rd); - return; case 0xc ... 0xf: case 0x16 ... 0x1f: { @@ -10118,6 +10118,7 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) case 0xa: /* CMLT */ case 0xb: /* ABS, NEG */ case 0x12: /* XTN, XTN2, SQXTUN, SQXTUN2 */ + case 0x13: /* SHLL, SHLL2 */ case 0x14: /* SQXTN, SQXTN2, UQXTN, UQXTN2 */ unallocated_encoding(s); return; From patchwork Fri Dec 13 17:31:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850173 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1640513wry; Fri, 13 Dec 2024 09:39:08 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXD/LI22pahLPGt5mYyFTLmzFKWUZZoJurOV31VxebUES0XHzqGK2n3a3/FeJsSerhFWuFN5g==@linaro.org X-Google-Smtp-Source: AGHT+IHLmN3seiyNuRhVAFgP/J4yxdB6ijLl8ze2cYm/HuWtBRhXYWijxs9pKremvHasIRBAYNZT X-Received: by 2002:a05:6000:4b12:b0:385:fa26:f0d9 with SMTP id ffacd0b85a97d-3886c725060mr3523968f8f.0.1734111548706; Fri, 13 Dec 2024 09:39:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111548; cv=none; d=google.com; s=arc-20240605; b=NE/Sd/1yNhBxxY7jjmNstMREBNb6RMlSs0M050QPiF2fo93aUvIEwW54wXAciJG7p3 iwbbGVq/asVgJ6Y6Mfw++4YYpbbXs/nzwejB0DnEOX0pGYv1GK+gvJVnrTMBuHvm58ki G/Nw8Ch55V74Qsq8DgZP93oXEBcihccuc+oBPCe77yuSm9RUQKo2Ta26sUFVXwpiu7Dl xv7iSocwP8O0uQeRbXzgp569Tl+fE3b5Bf4+X7HVF3L41tZE9qBWFO3OA8B/cYmjO691 VS7JaiT6Op0ta09XuVoSESRY1tYfFZH9SlCSshwP3IEefEOqTBiUvjCmgo8GmhSgKgbh u3tw== 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=6CYlCkAXadMVLpj7YlTvLBxky39lmdyPLmwYujAWn20=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=QrLBp8UFBxNu8ZQBKmuS4pz3hGJWddKtVTfahvTWl8WNiYERzEGnmOb/58M3bCPv7s MadwDmHGDqD0xcmQI9nF+RcyAn3USKgICX4jK4+E/lw9ppa8oyGu/865fG/awEdgMbUE 0DSI/lkpcpFuNwbFzaCQVwRZMbUui3LcEtlsCHpqxPQ1eN4LoMP1Ioz3M0UX4em6y7i6 Ju7J8C/Hyj/7bJ1OnN+yle/ONo3CL+nBv321si3FauXmm8rLlem2Wln07W0nfTjBw71Y fXlBBL6awvf1JUV1u/h/kRGnh5QxrKzPYvKav40q/uwBu/0SbBNAEVyKUzsxwlj+4J85 Yl1g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NCqIMSlT; 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 ffacd0b85a97d-388c804de3bsi38934f8f.464.2024.12.13.09.39.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:39:08 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NCqIMSlT; 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 1tM9Yb-0003UK-Ty; Fri, 13 Dec 2024 12:34:30 -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 1tM9Xg-0007iI-Gc for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:33 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9Xd-0001es-Oa for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:32 -0500 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-385df53e559so1604215f8f.3 for ; Fri, 13 Dec 2024 09:33:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111208; x=1734716008; 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=6CYlCkAXadMVLpj7YlTvLBxky39lmdyPLmwYujAWn20=; b=NCqIMSlTM7rKSk4ZadzfFNM5fxixVLMSDHzyL4R/Yl5i7KLUCiUHzLGULijqfy2SN1 2j4e3Nq2gfI8WcRUUoUoYGTtnykVX2yYNDr2HmfAS0mBSPGmENw4WJtH9Yqo7/8kXsqT G3wMGg6k9NlcvrszA1wHXrAXX9iYeEHNDAAY3RQDDVkPC4sYYQHKyd+SHN7MchYZX6Ds jAYPYi1XPhHQqq7kVx7r00oCyeQiRZVOvqmbwHC/8fLM2lK3dwy23noG6vAkrVlA1XBK 7yIHzaZA2YrE+75OF+CDk+eX0AxUpyy3xh5UKWAYDP/ZcUq/2HMR5Wrq3n+pMErZ2gw1 J7Tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111208; x=1734716008; 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=6CYlCkAXadMVLpj7YlTvLBxky39lmdyPLmwYujAWn20=; b=BQOoFRPuVdx7PFpoUX+XpF4t8r3txNwK4vbChVyFixPLdBuZwSlaw9MG5auKBghJFp s1GDkJ6BGb48uMBdshgeN3bYQ4rS50pMp/4rDy7w1/LYDGbisB34CHzxfFMZPoYqScR/ 1R75fs49kJgwbIm2qyRWCNKRmIx7lopnkMLi9CslXYrygWXovji2IROlgaqdd1JWl+6S FAtSH6IjcbzPoqGXP1nX9W2SQHVZGToup3lztckQ2XHqdHr7ZZqFVlDpTzI6SaIrPYCG CvIycj4HNG1vselcqau18q5s1i/XjstQ/pOvzyfChalGou86LP9o6iov7hwNDorsKqJf Ua6Q== X-Gm-Message-State: AOJu0Yxk3b/iSlh0oCCu1LgKl/7pTB+tT8JxfoXwXLtRf+n6cD3lz3cg 9TC9QaSAMCjCPo51IV/Vx/+5kbED3tkUCKBTgKqjNrx/IqrKSA2GVn5CJI0+Fu4bwvbKay8WmQR I X-Gm-Gg: ASbGncvJ1MtucS6PK3/xF9gMLUihG4lm/zEsp1VSiFrlyilYYwaftGr/6vOETPXIg8C ACry12UFgUbt8LGwB00tbqFI1aO000TxylEVoIVYB7K/ZM4Icyvo/qamk3OqZwwk3QXByF7m6lw fRQzBb9nad9UdLnIBgj9QmE5HBni06UTDrng5QKqKswRFt0ao/4yFDUb58W8nCx90gxiiaR1qxV 0rezKmm2vstyxW05ilw1Zk1KSrqGus9f1kl6hxDjn84WI0Rbj3RZm2i5SSduQ== X-Received: by 2002:a05:6000:4609:b0:385:fac7:89b9 with SMTP id ffacd0b85a97d-3889ad37d7amr2725035f8f.59.1734111208195; Fri, 13 Dec 2024 09:33:28 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:27 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 53/85] target/arm: Implement gen_gvec_fabs, gen_gvec_fneg Date: Fri, 13 Dec 2024 17:31:57 +0000 Message-Id: <20241213173229.3308926-54-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Move the current implementation out of translate-neon.c, and extend to handle all element sizes. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-54-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/translate.h | 6 ++++++ target/arm/tcg/gengvec.c | 14 ++++++++++++++ target/arm/tcg/translate-neon.c | 20 ++------------------ 3 files changed, 22 insertions(+), 18 deletions(-) diff --git a/target/arm/tcg/translate.h b/target/arm/tcg/translate.h index edd775d5640..b996de2c156 100644 --- a/target/arm/tcg/translate.h +++ b/target/arm/tcg/translate.h @@ -602,6 +602,12 @@ void gen_gvec_uaddlp(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs, void gen_gvec_uadalp(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs, uint32_t opr_sz, uint32_t max_sz); +/* These exclusively manipulate the sign bit. */ +void gen_gvec_fabs(unsigned vece, uint32_t dofs, uint32_t aofs, + uint32_t oprsz, uint32_t maxsz); +void gen_gvec_fneg(unsigned vece, uint32_t dofs, uint32_t aofs, + uint32_t oprsz, uint32_t maxsz); + /* * Forward to the isar_feature_* tests given a DisasContext pointer. */ diff --git a/target/arm/tcg/gengvec.c b/target/arm/tcg/gengvec.c index 2755da8ac71..01c9d5436d4 100644 --- a/target/arm/tcg/gengvec.c +++ b/target/arm/tcg/gengvec.c @@ -2697,3 +2697,17 @@ void gen_gvec_uadalp(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs, assert(vece <= MO_32); tcg_gen_gvec_2(rd_ofs, rn_ofs, opr_sz, max_sz, &g[vece]); } + +void gen_gvec_fabs(unsigned vece, uint32_t dofs, uint32_t aofs, + uint32_t oprsz, uint32_t maxsz) +{ + uint64_t s_bit = 1ull << ((8 << vece) - 1); + tcg_gen_gvec_andi(vece, dofs, aofs, s_bit - 1, oprsz, maxsz); +} + +void gen_gvec_fneg(unsigned vece, uint32_t dofs, uint32_t aofs, + uint32_t oprsz, uint32_t maxsz) +{ + uint64_t s_bit = 1ull << ((8 << vece) - 1); + tcg_gen_gvec_xori(vece, dofs, aofs, s_bit, oprsz, maxsz); +} diff --git a/target/arm/tcg/translate-neon.c b/target/arm/tcg/translate-neon.c index 0821f10fad5..b9b3d1c1fbc 100644 --- a/target/arm/tcg/translate-neon.c +++ b/target/arm/tcg/translate-neon.c @@ -3041,14 +3041,6 @@ static bool do_2misc(DisasContext *s, arg_2misc *a, NeonGenOneOpFn *fn) return true; } -static void gen_VABS_F(unsigned vece, uint32_t rd_ofs, uint32_t rm_ofs, - uint32_t oprsz, uint32_t maxsz) -{ - tcg_gen_gvec_andi(vece, rd_ofs, rm_ofs, - vece == MO_16 ? 0x7fff : 0x7fffffff, - oprsz, maxsz); -} - static bool trans_VABS_F(DisasContext *s, arg_2misc *a) { if (a->size == MO_16) { @@ -3058,15 +3050,7 @@ static bool trans_VABS_F(DisasContext *s, arg_2misc *a) } else if (a->size != MO_32) { return false; } - return do_2misc_vec(s, a, gen_VABS_F); -} - -static void gen_VNEG_F(unsigned vece, uint32_t rd_ofs, uint32_t rm_ofs, - uint32_t oprsz, uint32_t maxsz) -{ - tcg_gen_gvec_xori(vece, rd_ofs, rm_ofs, - vece == MO_16 ? 0x8000 : 0x80000000, - oprsz, maxsz); + return do_2misc_vec(s, a, gen_gvec_fabs); } static bool trans_VNEG_F(DisasContext *s, arg_2misc *a) @@ -3078,7 +3062,7 @@ static bool trans_VNEG_F(DisasContext *s, arg_2misc *a) } else if (a->size != MO_32) { return false; } - return do_2misc_vec(s, a, gen_VNEG_F); + return do_2misc_vec(s, a, gen_gvec_fneg); } static bool trans_VRECPE(DisasContext *s, arg_2misc *a) From patchwork Fri Dec 13 17:31:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850157 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1639896wry; Fri, 13 Dec 2024 09:37:51 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV7JZlpZPMuetrVv9aCE1dLjQVQVPZmZhM/BM5/GXrgdcDupIjRNMj4EGEJYLDvx16EiN2OOA==@linaro.org X-Google-Smtp-Source: AGHT+IFEP4CYU7wepXy4RgHDpaVv9U/49DCTWDbnIps1ZLSe2Y7GKtRjpRbsV73wNXXcu4OIILUV X-Received: by 2002:a05:6402:35c3:b0:5d2:7396:b0ed with SMTP id 4fb4d7f45d1cf-5d63c31e814mr8229624a12.14.1734111471113; Fri, 13 Dec 2024 09:37:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111471; cv=none; d=google.com; s=arc-20240605; b=JuHsPIGE5nF796xgV2zX0tT4JsZFlJSFjIxmJpYqGW6tj+bx0wVHLQWl1gtqm2qFPz Hki6wDb7GT9ReFgtk82ujdL0Fc3C6zq2ZbA6pxCfS7TH3fMSIPoDiUiot1ntOr1hXLfZ zFaVcgwXwQwJheXFEIkGV4Na+KHHtn1/wrKRFyj4wTHQpfm5achhLHKU1IXYwtwXs9YD 16lgm3OZ06y4rypxsgCH2w4mRj/or/S+K1G8yAf1BabkW2CTfBL5Gop4DgPgROSaeTWV 50MIbRCnZBh7YZcaGsBeC3DAKukRVAs2ewG+Kp4aoiKEkCXCJmNwBsM0MkAR73lvpwdu /ciQ== 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=1RVhb1E6KdPM5w5M3RKYCjBHFJdX2lNxNRf5tJorseo=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=RBDTuJ71yVphvMIZ26pbYzICGL8DQxJbpG8cpvJ6vzpS2k+dtdo//OKDCMrnAojBER bDFa/Pysto0QmYBxy9DUEvcu6IqotlsmS8XSgYpPoqHlB2QtYVWMCKDB9iB/8HrBQq2Y R1mB1dBIh1jlaDi+RNqtfzDdjlcJ2cXqgV/WEXSx0yxkoewdzQ+Z1Xwsg0V2NEu233UM PepDQDKVEvEVS/J69da0eFakgugyoy5VuJFRIS72KKkB3sO4V9EAW5hqL8zHx++rgmgt SjmFu6tBr9OfnrZpSE0yZpMu3E1XADaLCURA8jers3xlMyjqoc2YB5LBJ0cNVR0kKhU5 PraA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FPZLGozg; 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 a640c23a62f3a-aa66272db0bsi963391966b.946.2024.12.13.09.37.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:37:51 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FPZLGozg; 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 1tM9Yc-0003bn-U4; Fri, 13 Dec 2024 12:34:31 -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 1tM9Xg-0007jf-UF for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:32 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9Xe-0001f6-UX for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:32 -0500 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-3862ca8e0bbso1800750f8f.0 for ; Fri, 13 Dec 2024 09:33:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111209; x=1734716009; 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=1RVhb1E6KdPM5w5M3RKYCjBHFJdX2lNxNRf5tJorseo=; b=FPZLGozgI4zP6Sg5WY8n05Kow8pO2JnWbxGtkZloParqmZJmY+4BDNrhR4NWbj72jr gGnUI92wWPktmj3CH/H0bX0mjBuLDRPLmO9EaEDUae2iN1cp5MON6jprN5HlIEAhzo5W rRiSxSOegrBHZCyGPwEtWf5JPzcX1CbUHV8XXIskvBjcaiPiQbwMRXp+fZ/4Ye/qDoH7 sm4l0eD1oIz5KASxYrzr+DyYqXtXN6/IC/RtN+xq4vVPsZRW/r2TQSNFqKDjEnK0hgEa C3zuuHUrXxPjDmwG238EZZoWqlK7VKyomL4gqkExhmg35GNSZ8lNscvVwclYBPYfTQJj eI4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111209; x=1734716009; 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=1RVhb1E6KdPM5w5M3RKYCjBHFJdX2lNxNRf5tJorseo=; b=qKaIUGsSIu5akBNohgvwINRlXfE173i4xrfPxdeYROy5G5pPy3tTifDX9tHol8M/4C fzMz4ZsRFnrKPXEX+NzPQFqGxRzH6FeLiEejYRe0/14MYo83D9Zl0TSF/MdWd78WrOIG 7mCslrg1Dz/ZjH8SCcpXTHZOOCl6R/xIrx4BvQaKgSQ3uBhr19D6nIaCdaSdCtdnJwRO xSUspgzxvPE/WwiWMjEqnmyEmY3LD6wLntZkW2FDwwKYua4zfEaWtUumX5kIbXA/O3pY F1nGFxPVta5qkOfd7SsDHACrI+MwOhE9Tu8dBFlxmPuSgsp2aoNAhvwoqMI2b85vSt2F G0OQ== X-Gm-Message-State: AOJu0Yxdzcz9fbkrPijwW/F6zS/3mI/JJy0PVumMHrBZ6QWhmds9nANu MOlsncW0Lieui+2KeT0Qeggs/WvUwJgQaWCPgOSySKr5a2HUQMh4o9oOhZOdegtDE+BExi/vmnf p X-Gm-Gg: ASbGncsOpFsemBEHc7KQxs2Ld9TgTJn8IU8V+r51OvYvSUrGmKjokJafgLHCkzUfqJ3 +k4KRKKs8Yj5Y2XlnXLBahtUyIkWdZIxnvSce1MM8N9OZtiI+EMS9kKDPPYbCEjzVJo2wE+83Iq iObUf0P+/CT5qd5MRvCVOjAgSUa930noRY4KqTjj3sVxOXYMCk6gr0nNgIUHER7VVdmom+cEImF lDkoiJ9VNwT5WjlJjz3YyhrH3WhzMMmBHEyzncTzofrHf6eL7MPDrC71BLKhg== X-Received: by 2002:a05:6000:78a:b0:385:fb40:e549 with SMTP id ffacd0b85a97d-3888e0bfca2mr3094697f8f.55.1734111209168; Fri, 13 Dec 2024 09:33:29 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:28 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 54/85] target/arm: Convert FABS, FNEG (vector) to decodetree Date: Fri, 13 Dec 2024 17:31:58 +0000 Message-Id: <20241213173229.3308926-55-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x434.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-55-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 7 +++++ target/arm/tcg/translate-a64.c | 54 +++++++++++++++------------------- 2 files changed, 31 insertions(+), 30 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index ec0d46a563c..f46bd1a715e 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -77,6 +77,7 @@ @qrr_s . q:1 ...... .. ...... ...... rn:5 rd:5 &qrr_e esz=2 @qrr_bh . q:1 ...... . esz:1 ...... ...... rn:5 rd:5 &qrr_e @qrr_hs . q:1 ...... .. ...... ...... rn:5 rd:5 &qrr_e esz=%esz_hs +@qrr_sd . q:1 ...... .. ...... ...... rn:5 rd:5 &qrr_e esz=%esz_sd @qrr_e . q:1 ...... esz:2 ...... ...... rn:5 rd:5 &qrr_e @qrrr_b . q:1 ...... ... rm:5 ...... rn:5 rd:5 &qrrr_e esz=0 @@ -1687,3 +1688,9 @@ FCVTXN_v 0.10 1110 011 00001 01101 0 ..... ..... @qrr_s BFCVTN_v 0.00 1110 101 00001 01101 0 ..... ..... @qrr_h SHLL_v 0.10 1110 ..1 00001 00111 0 ..... ..... @qrr_e + +FABS_v 0.00 1110 111 11000 11111 0 ..... ..... @qrr_h +FABS_v 0.00 1110 1.1 00000 11111 0 ..... ..... @qrr_sd + +FNEG_v 0.10 1110 111 11000 11111 0 ..... ..... @qrr_h +FNEG_v 0.10 1110 1.1 00000 11111 0 ..... ..... @qrr_sd diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index c5d456de3be..fd7f7ae7146 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -9149,6 +9149,20 @@ static bool trans_SHLL_v(DisasContext *s, arg_qrr_e *a) return true; } +static bool do_fabs_fneg_v(DisasContext *s, arg_qrr_e *a, GVecGen2Fn *fn) +{ + int check = fp_access_check_vector_hsd(s, a->q, a->esz); + + if (check <= 0) { + return check == 0; + } + + gen_gvec_fn2(s, a->q, a->rd, a->rn, fn, a->esz); + return true; +} + +TRANS(FABS_v, do_fabs_fneg_v, a, gen_gvec_fabs) +TRANS(FNEG_v, do_fabs_fneg_v, a, gen_gvec_fneg) /* Common vector code for handling integer to FP conversion */ static void handle_simd_intfp_conv(DisasContext *s, int rd, int rn, @@ -9447,12 +9461,6 @@ static void handle_2misc_64(DisasContext *s, int opcode, bool u, * requires them. */ switch (opcode) { - case 0x2f: /* FABS */ - gen_vfp_absd(tcg_rd, tcg_rn); - break; - case 0x6f: /* FNEG */ - gen_vfp_negd(tcg_rd, tcg_rn); - break; case 0x7f: /* FSQRT */ gen_helper_vfp_sqrtd(tcg_rd, tcg_rn, tcg_fpstatus); break; @@ -9497,6 +9505,8 @@ static void handle_2misc_64(DisasContext *s, int opcode, bool u, case 0x9: /* CMEQ, CMLE */ case 0xa: /* CMLT */ case 0xb: /* ABS, NEG */ + case 0x2f: /* FABS */ + case 0x6f: /* FNEG */ g_assert_not_reached(); } } @@ -9968,13 +9978,6 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) opcode |= (extract32(size, 1, 1) << 5) | (u << 6); size = is_double ? 3 : 2; switch (opcode) { - case 0x2f: /* FABS */ - case 0x6f: /* FNEG */ - if (size == 3 && !is_q) { - unallocated_encoding(s); - return; - } - break; case 0x1d: /* SCVTF */ case 0x5d: /* UCVTF */ { @@ -10099,6 +10102,8 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) case 0x16: /* FCVTN, FCVTN2 */ case 0x36: /* BFCVTN, BFCVTN2 */ case 0x56: /* FCVTXN, FCVTXN2 */ + case 0x2f: /* FABS */ + case 0x6f: /* FNEG */ unallocated_encoding(s); return; } @@ -10171,12 +10176,6 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) { /* Special cases for 32 bit elements */ switch (opcode) { - case 0x2f: /* FABS */ - gen_vfp_abss(tcg_res, tcg_op); - break; - case 0x6f: /* FNEG */ - gen_vfp_negs(tcg_res, tcg_op); - break; case 0x7f: /* FSQRT */ gen_helper_vfp_sqrts(tcg_res, tcg_op, tcg_fpstatus); break; @@ -10220,6 +10219,8 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) break; default: case 0x7: /* SQABS, SQNEG */ + case 0x2f: /* FABS */ + case 0x6f: /* FNEG */ g_assert_not_reached(); } } @@ -10362,17 +10363,14 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn) case 0x7b: /* FCVTZU */ rmode = FPROUNDING_ZERO; break; - case 0x2f: /* FABS */ - case 0x6f: /* FNEG */ - only_in_vector = true; - need_fpst = false; - break; case 0x7d: /* FRSQRTE */ break; case 0x7f: /* FSQRT (vector) */ only_in_vector = true; break; default: + case 0x2f: /* FABS */ + case 0x6f: /* FNEG */ unallocated_encoding(s); return; } @@ -10474,12 +10472,6 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn) case 0x59: /* FRINTX */ gen_helper_advsimd_rinth_exact(tcg_res, tcg_op, tcg_fpstatus); break; - case 0x2f: /* FABS */ - tcg_gen_andi_i32(tcg_res, tcg_op, 0x7fff); - break; - case 0x6f: /* FNEG */ - tcg_gen_xori_i32(tcg_res, tcg_op, 0x8000); - break; case 0x7d: /* FRSQRTE */ gen_helper_rsqrte_f16(tcg_res, tcg_op, tcg_fpstatus); break; @@ -10487,6 +10479,8 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn) gen_helper_vfp_sqrth(tcg_res, tcg_op, tcg_fpstatus); break; default: + case 0x2f: /* FABS */ + case 0x6f: /* FNEG */ g_assert_not_reached(); } From patchwork Fri Dec 13 17:31:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850197 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1642470wry; Fri, 13 Dec 2024 09:43:26 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWtevzuB/HGvPysleTsHrm2CnzM7Ui4hK/I3OYIC8zuyzFzLdfQKyiw97YwA2QKJ+8pt8oGcA==@linaro.org X-Google-Smtp-Source: AGHT+IFhl+CyHBelu676i5hn04TzMcS7k5jDAxJu19KWzwowqXsBKL9bTnzEs1bfQqexGMq9xUO4 X-Received: by 2002:a05:6000:1848:b0:385:f6de:6266 with SMTP id ffacd0b85a97d-3888e0ae4e6mr2703005f8f.24.1734111806561; Fri, 13 Dec 2024 09:43:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111806; cv=none; d=google.com; s=arc-20240605; b=jzRaDLdQaSsmbyNC//U6EHFTDigIxr7KKXhqPEtS9DJIJyn5H3Lgoo0mBFOpcT5drN Jbg45bZIz7lHaxEUTctVhYBjdCVTVMnxrBvUCGSti4AnZL6m79JtRY+RfFEyqSsswaSU eCGGRLtQ5G7SvntlZ6t3bPTDdWnFSLenCABPuLCLsUVwANmLomAPNy2nDR3zaI75fFHl /vzUUy360S7tUUdD8CaKQF/PX8fwphNTgmkW2VF0t+asTS5Wll42c/nnT6dH9BLDxbr2 GmSGFpgltVnR+xpJ8E74mpMcxH1pjVjwoaCUojZ2j+9VWPNTWeOXz5Yl/Zb0mvZ0Cr4Q T2pw== 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=4tifFC9D40iwr5FX6YfXLv5cKj82kQOZxP83JkYfn5I=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=bJJ8gtdB1VENMmyJMtxNaGYJEfOdZiGY6WqCett8MikRuejwWm1SWdlApPTeGaAj98 W7MNbMoxj/+f2PVrWn8+O246LaMt368QvE6xx8nlsLJgbTHYJCTKXT23ddkUVcUTlW2q 9TTibq/tn0QY5aDehW7jKToV5x4L/qH/9e4kRBtw8EDeoRhATCHgmLMtz8pXTuBxnbnA nXfTcxtv+ykMJpKo/yf+pNB+HwKw1Rd2t5YXvpM5l/xLGpnJEhn5FqJiIfhlgChxIh1x UfKkiYFgcoCB7hnnnEOEk+Atmd3xlKikoAH7+FfZmkD3gxmS2eWxC+gxLnHKKWAXhkhr 0g/Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QLOzqPY1; 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 ffacd0b85a97d-388c8011b6esi58502f8f.157.2024.12.13.09.43.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:43:26 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QLOzqPY1; 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 1tM9Yg-000457-8D; Fri, 13 Dec 2024 12:34:34 -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 1tM9Xk-0007pO-O1 for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:36 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9Xf-0001fI-LB for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:36 -0500 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-385df53e559so1604239f8f.3 for ; Fri, 13 Dec 2024 09:33:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111210; x=1734716010; 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=4tifFC9D40iwr5FX6YfXLv5cKj82kQOZxP83JkYfn5I=; b=QLOzqPY1Ryy0RIjU9SSJZULOOGFDy/mdHk6W91fxK9oNQ7MxF8cMHr0ucJUDhLY9uU JBIUq4J9pxSBs+hgLv1ywps1676h2hsrLg3ckexDOFsKpP1BkUqro2I8wgDvsYDehcPF eLRdenBuLVZgHR6fTJGVGN/q/2RuR582dgXDyWjrYWhXZNgEemI9IqUPJ1paNLO6viis M9IItZ977/1RVXTKjvva4a/3aS/PQ2McRScwkLZujHESR/sqrUinTvIO2wDmnK3W3VTc KVYribHCrRS88PHnRIbGYfkQWFFnabEzU+8iAzWqwE89StJQ7KM6X6UwschFZOFb2h0k e1Lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111210; x=1734716010; 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=4tifFC9D40iwr5FX6YfXLv5cKj82kQOZxP83JkYfn5I=; b=NcmjD4JgcsDd8S6BwG0oEK+8kz6ElrlKAUpYUORH6CgVXCgEjTUwglWWNP3M2JoeJH krD87QcMPJQw/DdZED1cf909Y+DfoALx3aSpv8yKuKkQA+R5Of0pUNwMzKhxGZ59hK4d 4zfp8LCIjJbSd8U3hGJI9FyX/afAWRLgC+TNQSejyIUKfbsdHVIKRXfnZ1jPf8qfDmx/ ZzO+K0hYbVAS1h1qqRskXK/6AG9Nmyz6t6wwCLoXUVUL+pNfPeY91izobo2YRs83/ytH kJTcX/Ufj6mt97Tyj9rev58FHTx74+mG0es0AbzKSYdxKE1mKbU5nsoHXUJ9axqfx4x+ mx0Q== X-Gm-Message-State: AOJu0YzRWQDlNJwinA8MEDbnDt2uoR2sANonm/VbKH9lPcfhGCy0vSdX 720CUqCvK7pjZbEger2iSdIQKSBT9c5qLxy2e0oGfAY2Han+TRHvI4d4rMsn+PAM1qHPo7Q8Ipm r X-Gm-Gg: ASbGncvoN38TpZeL6rEjjRg/NscLocjF6Ppf4uSBk8GlDiJgg5K1nQR88UDhTVj+YMs osPxd2Blat4O8IIJFiEkINYdyAeRBt36txh6nKXcQ8HNWhZZEG7PTEo2NHF1mmc7ouOoZlN7NLx 6eyzqoLnV8tdEXLhtxHskq1wERyb2Vyl1ZklIzDrqwpabFonMrpSLke+CLWPoCIrqoAnWoLPvGL X2md+pEOehDUZtdL9PLF1y7dvkLBmOPWSk0P/Jmv9BDhHtXuWJduXCpLRpjuw== X-Received: by 2002:a5d:64ef:0:b0:385:f4db:e336 with SMTP id ffacd0b85a97d-38880af1626mr2187353f8f.2.1734111210180; Fri, 13 Dec 2024 09:33:30 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:29 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 55/85] target/arm: Convert FSQRT (vector) to decodetree Date: Fri, 13 Dec 2024 17:31:59 +0000 Message-Id: <20241213173229.3308926-56-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x432.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-56-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 3 ++ target/arm/tcg/translate-a64.c | 69 ++++++++++++++++++++++++---------- 2 files changed, 53 insertions(+), 19 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index f46bd1a715e..1e0eb4a748e 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -1694,3 +1694,6 @@ FABS_v 0.00 1110 1.1 00000 11111 0 ..... ..... @qrr_sd FNEG_v 0.10 1110 111 11000 11111 0 ..... ..... @qrr_h FNEG_v 0.10 1110 1.1 00000 11111 0 ..... ..... @qrr_sd + +FSQRT_v 0.10 1110 111 11001 11111 0 ..... ..... @qrr_h +FSQRT_v 0.10 1110 1.1 00001 11111 0 ..... ..... @qrr_sd diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index fd7f7ae7146..287e9338a45 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -9164,6 +9164,51 @@ static bool do_fabs_fneg_v(DisasContext *s, arg_qrr_e *a, GVecGen2Fn *fn) TRANS(FABS_v, do_fabs_fneg_v, a, gen_gvec_fabs) TRANS(FNEG_v, do_fabs_fneg_v, a, gen_gvec_fneg) +static bool do_fp1_vector(DisasContext *s, arg_qrr_e *a, + const FPScalar1 *f, int rmode) +{ + TCGv_i32 tcg_rmode = NULL; + TCGv_ptr fpst; + int check = fp_access_check_vector_hsd(s, a->q, a->esz); + + if (check <= 0) { + return check == 0; + } + + fpst = fpstatus_ptr(a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); + if (rmode >= 0) { + tcg_rmode = gen_set_rmode(rmode, fpst); + } + + if (a->esz == MO_64) { + TCGv_i64 t64 = tcg_temp_new_i64(); + + for (int pass = 0; pass < 2; ++pass) { + read_vec_element(s, t64, a->rn, pass, MO_64); + f->gen_d(t64, t64, fpst); + write_vec_element(s, t64, a->rd, pass, MO_64); + } + } else { + TCGv_i32 t32 = tcg_temp_new_i32(); + void (*gen)(TCGv_i32, TCGv_i32, TCGv_ptr) + = (a->esz == MO_16 ? f->gen_h : f->gen_s); + + for (int pass = 0, n = (a->q ? 16 : 8) >> a->esz; pass < n; ++pass) { + read_vec_element_i32(s, t32, a->rn, pass, a->esz); + gen(t32, t32, fpst); + write_vec_element_i32(s, t32, a->rd, pass, a->esz); + } + } + clear_vec_high(s, a->q, a->rd); + + if (rmode >= 0) { + gen_restore_rmode(tcg_rmode, fpst); + } + return true; +} + +TRANS(FSQRT_v, do_fp1_vector, a, &f_scalar_fsqrt, -1) + /* Common vector code for handling integer to FP conversion */ static void handle_simd_intfp_conv(DisasContext *s, int rd, int rn, int elements, int is_signed, @@ -9461,9 +9506,6 @@ static void handle_2misc_64(DisasContext *s, int opcode, bool u, * requires them. */ switch (opcode) { - case 0x7f: /* FSQRT */ - gen_helper_vfp_sqrtd(tcg_rd, tcg_rn, tcg_fpstatus); - break; case 0x1a: /* FCVTNS */ case 0x1b: /* FCVTMS */ case 0x1c: /* FCVTAS */ @@ -9507,6 +9549,7 @@ static void handle_2misc_64(DisasContext *s, int opcode, bool u, case 0xb: /* ABS, NEG */ case 0x2f: /* FABS */ case 0x6f: /* FNEG */ + case 0x7f: /* FSQRT */ g_assert_not_reached(); } } @@ -10004,13 +10047,6 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) } handle_2misc_fcmp_zero(s, opcode, false, u, is_q, size, rn, rd); return; - case 0x7f: /* FSQRT */ - need_fpstatus = true; - if (size == 3 && !is_q) { - unallocated_encoding(s); - return; - } - break; case 0x1a: /* FCVTNS */ case 0x1b: /* FCVTMS */ case 0x3a: /* FCVTPS */ @@ -10104,6 +10140,7 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) case 0x56: /* FCVTXN, FCVTXN2 */ case 0x2f: /* FABS */ case 0x6f: /* FNEG */ + case 0x7f: /* FSQRT */ unallocated_encoding(s); return; } @@ -10176,9 +10213,6 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) { /* Special cases for 32 bit elements */ switch (opcode) { - case 0x7f: /* FSQRT */ - gen_helper_vfp_sqrts(tcg_res, tcg_op, tcg_fpstatus); - break; case 0x1a: /* FCVTNS */ case 0x1b: /* FCVTMS */ case 0x1c: /* FCVTAS */ @@ -10221,6 +10255,7 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) case 0x7: /* SQABS, SQNEG */ case 0x2f: /* FABS */ case 0x6f: /* FNEG */ + case 0x7f: /* FSQRT */ g_assert_not_reached(); } } @@ -10365,12 +10400,10 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn) break; case 0x7d: /* FRSQRTE */ break; - case 0x7f: /* FSQRT (vector) */ - only_in_vector = true; - break; default: case 0x2f: /* FABS */ case 0x6f: /* FNEG */ + case 0x7f: /* FSQRT (vector) */ unallocated_encoding(s); return; } @@ -10475,12 +10508,10 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn) case 0x7d: /* FRSQRTE */ gen_helper_rsqrte_f16(tcg_res, tcg_op, tcg_fpstatus); break; - case 0x7f: /* FSQRT */ - gen_helper_vfp_sqrth(tcg_res, tcg_op, tcg_fpstatus); - break; default: case 0x2f: /* FABS */ case 0x6f: /* FNEG */ + case 0x7f: /* FSQRT */ g_assert_not_reached(); } From patchwork Fri Dec 13 17:32:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850201 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1643067wry; Fri, 13 Dec 2024 09:44:55 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV4B6LYz/92gz+9+44n+kiMWhQoVyG0Tgu59xjWospZfS1nF6iJZ8m9n7KRRR7JskkL1/6CBg==@linaro.org X-Google-Smtp-Source: AGHT+IED/WdUQ/LDw5uPst3ZqyvqFgq5hLSP1yyoIIUst4lZKkKwN1AfkAWTMJs3jMxTxTAr/o9r X-Received: by 2002:a05:600c:4ed4:b0:434:a734:d268 with SMTP id 5b1f17b1804b1-4362aa589f0mr33523505e9.14.1734111895375; Fri, 13 Dec 2024 09:44:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111895; cv=none; d=google.com; s=arc-20240605; b=OI3AcN/kpn7MxLCl0inOClSCMPasBpn25Ryxgt+c4C+gevuhrAyfl6Sj3lcnWdWujH WllDf70s57SP8T1MJRzoAXFzKAHDYKLic7i6ph6iagAbU19C5xsrO1LEFiaPvwRwH1Fw 9juYgR0nkbverRFFSeu6Jaha7kXlaPNhXE/l5f9LZpCymyRd3YP6yT3seg3rlRTy/h50 a0J86c13K6AIISNv/iMQ4I6nDelnr6Pv/Ld9HRtc9MxxF85pzhp85M9EU3guvCgxqoqP Swvbvpt+cEAFYeRnv3It4J2I3WeoHf0A0AnxrWltURccpAIb3f1hUYNBEvEjm36QlB2w 3h7w== 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=V7uxB4CcHZe2ZEachsZ0tuLPAFTq4cpha72vkH9WMLY=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=MiShryl92xwkdR9QQtEL9PCh677xgY4UEUXyvV0biwyK6uT6WheeNecoBuIl49UXYd D+4LK9o/X5h59HaHwv2LqksAYDlc73x+tjhdfPLkSx+hGnHWRYbv67butsVqLRRSuj02 KZ6sqyGmUenJIPYFvLIzdNIVdEahQANq9VWra7jAZYS2m8pN09nSrsx6pf+g87H3foeM BJf+I6afOtkUJyqD9XXIwHk3dVFHrvmVSeFoqj6cKxlIpvmmSc3QXclcFAS3sxrmk8M+ KZk500Ex+c/3Qrar5g7CzGuUxM8Ei1il+eccJmegDF6SdHMHWevDVLS1uysGBiu/YcWx 2L+w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MVXo3Od3; 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 5b1f17b1804b1-43625589edesi23482765e9.90.2024.12.13.09.44.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:44:55 -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=MVXo3Od3; 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 1tM9Ym-0004uU-Ew; Fri, 13 Dec 2024 12:34:40 -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 1tM9Xj-0007nd-45 for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:35 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9Xg-0001fi-Lo for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:34 -0500 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-385e0e224cbso1079346f8f.2 for ; Fri, 13 Dec 2024 09:33:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111211; x=1734716011; 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=V7uxB4CcHZe2ZEachsZ0tuLPAFTq4cpha72vkH9WMLY=; b=MVXo3Od3sKbNP+C9kOgPFHceYV0/0anZTykYzv7mKh3Jgg15q53r/Po/rREiYbqwmA lAq78PMA+1rD6zTAORDuE+twAY44U+FfABBd/NTl2YIcB2fQNesTPDvWiHNrWFWKWbqj pF/WRh2sckirsw0ZXa9Iykx1Mndvf0oWjnQv/5Jp+dOoQwvz6XAr0hs/aleROoFAVBl4 jd7pO7MqjuSu0vzrZHuBvHz0WWhh+ct1GZ4TpgQRrI+d+FlIpCrK9FrgwBLv9pkFja2X V1uK8C7+j2lPeB4c110YmGtKzOfUBrUUMq5XiylFPoKh00gTkUEeKHRjMU00wVWjSFLW kbdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111211; x=1734716011; 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=V7uxB4CcHZe2ZEachsZ0tuLPAFTq4cpha72vkH9WMLY=; b=Wd8g0SZU5J+LnXVy7p5RiOXxLFO1WiCmH8zj+Cp/Tm9cQXjCUiCU3zbN0ynTzRWL0z 5ZpF03SFxOqOvgSQqUXF9iWaHo2vZ3j+Qn/96jSAt3F5Hcz3P/qZ/uihJvPL2DyPBe/s NhFRgHSBsgDPgOjWqi8OJF5mZ9UjdzWNNB93odUlpIZ26bZ7EmGEem3++8QvZSd5egCj 3BUK3gbiwkdoGD9gKUk6F3vDy9LhWmzlexWNYclprj5VRue9fg+TstQaJUoFw1a7B6ub t9eX4g3gVOFc5dSxHHbenrjUubcoIsYK/CeY36QQo+kWjDBw1yJQxvRonq3eC10dBI8I oVYQ== X-Gm-Message-State: AOJu0Yxt7+0CufT+2zq2RIwWTW4/LSG1L1Wv02SSODV0F/badlYbvclw BaW3ZMMaXVL21uzAav0TOCJUUaz/ocsXPvRK0rD4Wf9Sag6T7xVu8a908idVCGYKTMys4U/soDt + X-Gm-Gg: ASbGncvyOrH/d9oyOI6BrTGw2yE0LLgVlsAbxt8w3l0k1KC0RQpHTdtmtRbw99gdHWi X9DIxQduMKprJ8+i/Jg8I73iWBn3hmheHtqDyZ2kXKF722B9vZ0X62weeouUi3o6GuTh2278/J1 H+f9utdyH3Z2wyHTGKhWR1K+d/Roy9o3lNb+RqKgCTVS9eeC67LuigZ4vV+VWAZFxkWXZHXD0GS YpzqxorHqNwTlecxYQtYQFKNmoCCElyVQ7KZGLkPMEhFozqHh+s+n4zf3MPFg== X-Received: by 2002:a5d:5f55:0:b0:385:e303:8dd8 with SMTP id ffacd0b85a97d-38880ae11aemr2572008f8f.26.1734111211106; Fri, 13 Dec 2024 09:33:31 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:30 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 56/85] target/arm: Convert FRINT* (vector) to decodetree Date: Fri, 13 Dec 2024 17:32:00 +0000 Message-Id: <20241213173229.3308926-57-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-57-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 26 +++++ target/arm/tcg/translate-a64.c | 176 ++++++++++++--------------------- 2 files changed, 88 insertions(+), 114 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 1e0eb4a748e..5e02144f651 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -1697,3 +1697,29 @@ FNEG_v 0.10 1110 1.1 00000 11111 0 ..... ..... @qrr_sd FSQRT_v 0.10 1110 111 11001 11111 0 ..... ..... @qrr_h FSQRT_v 0.10 1110 1.1 00001 11111 0 ..... ..... @qrr_sd + +FRINTN_v 0.00 1110 011 11001 10001 0 ..... ..... @qrr_h +FRINTN_v 0.00 1110 0.1 00001 10001 0 ..... ..... @qrr_sd + +FRINTM_v 0.00 1110 011 11001 10011 0 ..... ..... @qrr_h +FRINTM_v 0.00 1110 0.1 00001 10011 0 ..... ..... @qrr_sd + +FRINTP_v 0.00 1110 111 11001 10001 0 ..... ..... @qrr_h +FRINTP_v 0.00 1110 1.1 00001 10001 0 ..... ..... @qrr_sd + +FRINTZ_v 0.00 1110 111 11001 10011 0 ..... ..... @qrr_h +FRINTZ_v 0.00 1110 1.1 00001 10011 0 ..... ..... @qrr_sd + +FRINTA_v 0.10 1110 011 11001 10001 0 ..... ..... @qrr_h +FRINTA_v 0.10 1110 0.1 00001 10001 0 ..... ..... @qrr_sd + +FRINTX_v 0.10 1110 011 11001 10011 0 ..... ..... @qrr_h +FRINTX_v 0.10 1110 0.1 00001 10011 0 ..... ..... @qrr_sd + +FRINTI_v 0.10 1110 111 11001 10011 0 ..... ..... @qrr_h +FRINTI_v 0.10 1110 1.1 00001 10011 0 ..... ..... @qrr_sd + +FRINT32Z_v 0.00 1110 0.1 00001 11101 0 ..... ..... @qrr_sd +FRINT32X_v 0.10 1110 0.1 00001 11101 0 ..... ..... @qrr_sd +FRINT64Z_v 0.00 1110 0.1 00001 11111 0 ..... ..... @qrr_sd +FRINT64X_v 0.10 1110 0.1 00001 11111 0 ..... ..... @qrr_sd diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 287e9338a45..0f924b07dcd 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -9209,6 +9209,21 @@ static bool do_fp1_vector(DisasContext *s, arg_qrr_e *a, TRANS(FSQRT_v, do_fp1_vector, a, &f_scalar_fsqrt, -1) +TRANS(FRINTN_v, do_fp1_vector, a, &f_scalar_frint, FPROUNDING_TIEEVEN) +TRANS(FRINTP_v, do_fp1_vector, a, &f_scalar_frint, FPROUNDING_POSINF) +TRANS(FRINTM_v, do_fp1_vector, a, &f_scalar_frint, FPROUNDING_NEGINF) +TRANS(FRINTZ_v, do_fp1_vector, a, &f_scalar_frint, FPROUNDING_ZERO) +TRANS(FRINTA_v, do_fp1_vector, a, &f_scalar_frint, FPROUNDING_TIEAWAY) +TRANS(FRINTI_v, do_fp1_vector, a, &f_scalar_frint, -1) +TRANS(FRINTX_v, do_fp1_vector, a, &f_scalar_frintx, -1) + +TRANS_FEAT(FRINT32Z_v, aa64_frint, do_fp1_vector, a, + &f_scalar_frint32, FPROUNDING_ZERO) +TRANS_FEAT(FRINT32X_v, aa64_frint, do_fp1_vector, a, &f_scalar_frint32, -1) +TRANS_FEAT(FRINT64Z_v, aa64_frint, do_fp1_vector, a, + &f_scalar_frint64, FPROUNDING_ZERO) +TRANS_FEAT(FRINT64X_v, aa64_frint, do_fp1_vector, a, &f_scalar_frint64, -1) + /* Common vector code for handling integer to FP conversion */ static void handle_simd_intfp_conv(DisasContext *s, int rd, int rn, int elements, int is_signed, @@ -9520,25 +9535,6 @@ static void handle_2misc_64(DisasContext *s, int opcode, bool u, case 0x7b: /* FCVTZU */ gen_helper_vfp_touqd(tcg_rd, tcg_rn, tcg_constant_i32(0), tcg_fpstatus); break; - case 0x18: /* FRINTN */ - case 0x19: /* FRINTM */ - case 0x38: /* FRINTP */ - case 0x39: /* FRINTZ */ - case 0x58: /* FRINTA */ - case 0x79: /* FRINTI */ - gen_helper_rintd(tcg_rd, tcg_rn, tcg_fpstatus); - break; - case 0x59: /* FRINTX */ - gen_helper_rintd_exact(tcg_rd, tcg_rn, tcg_fpstatus); - break; - case 0x1e: /* FRINT32Z */ - case 0x5e: /* FRINT32X */ - gen_helper_frint32_d(tcg_rd, tcg_rn, tcg_fpstatus); - break; - case 0x1f: /* FRINT64Z */ - case 0x5f: /* FRINT64X */ - gen_helper_frint64_d(tcg_rd, tcg_rn, tcg_fpstatus); - break; default: case 0x4: /* CLS, CLZ */ case 0x5: /* NOT */ @@ -9550,6 +9546,17 @@ static void handle_2misc_64(DisasContext *s, int opcode, bool u, case 0x2f: /* FABS */ case 0x6f: /* FNEG */ case 0x7f: /* FSQRT */ + case 0x18: /* FRINTN */ + case 0x19: /* FRINTM */ + case 0x38: /* FRINTP */ + case 0x39: /* FRINTZ */ + case 0x58: /* FRINTA */ + case 0x79: /* FRINTI */ + case 0x59: /* FRINTX */ + case 0x1e: /* FRINT32Z */ + case 0x5e: /* FRINT32X */ + case 0x1f: /* FRINT64Z */ + case 0x5f: /* FRINT64X */ g_assert_not_reached(); } } @@ -10094,46 +10101,12 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) } handle_2misc_widening(s, opcode, is_q, size, rn, rd); return; - case 0x18: /* FRINTN */ - case 0x19: /* FRINTM */ - case 0x38: /* FRINTP */ - case 0x39: /* FRINTZ */ - rmode = extract32(opcode, 5, 1) | (extract32(opcode, 0, 1) << 1); - /* fall through */ - case 0x59: /* FRINTX */ - case 0x79: /* FRINTI */ - need_fpstatus = true; - if (size == 3 && !is_q) { - unallocated_encoding(s); - return; - } - break; - case 0x58: /* FRINTA */ - rmode = FPROUNDING_TIEAWAY; - need_fpstatus = true; - if (size == 3 && !is_q) { - unallocated_encoding(s); - return; - } - break; case 0x7c: /* URSQRTE */ if (size == 3) { unallocated_encoding(s); return; } break; - case 0x1e: /* FRINT32Z */ - case 0x1f: /* FRINT64Z */ - rmode = FPROUNDING_ZERO; - /* fall through */ - case 0x5e: /* FRINT32X */ - case 0x5f: /* FRINT64X */ - need_fpstatus = true; - if ((size == 3 && !is_q) || !dc_isar_feature(aa64_frint, s)) { - unallocated_encoding(s); - return; - } - break; default: case 0x16: /* FCVTN, FCVTN2 */ case 0x36: /* BFCVTN, BFCVTN2 */ @@ -10141,6 +10114,17 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) case 0x2f: /* FABS */ case 0x6f: /* FNEG */ case 0x7f: /* FSQRT */ + case 0x18: /* FRINTN */ + case 0x19: /* FRINTM */ + case 0x38: /* FRINTP */ + case 0x39: /* FRINTZ */ + case 0x59: /* FRINTX */ + case 0x79: /* FRINTI */ + case 0x58: /* FRINTA */ + case 0x1e: /* FRINT32Z */ + case 0x1f: /* FRINT64Z */ + case 0x5e: /* FRINT32X */ + case 0x5f: /* FRINT64X */ unallocated_encoding(s); return; } @@ -10229,33 +10213,25 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) gen_helper_vfp_touls(tcg_res, tcg_op, tcg_constant_i32(0), tcg_fpstatus); break; - case 0x18: /* FRINTN */ - case 0x19: /* FRINTM */ - case 0x38: /* FRINTP */ - case 0x39: /* FRINTZ */ - case 0x58: /* FRINTA */ - case 0x79: /* FRINTI */ - gen_helper_rints(tcg_res, tcg_op, tcg_fpstatus); - break; - case 0x59: /* FRINTX */ - gen_helper_rints_exact(tcg_res, tcg_op, tcg_fpstatus); - break; case 0x7c: /* URSQRTE */ gen_helper_rsqrte_u32(tcg_res, tcg_op); break; - case 0x1e: /* FRINT32Z */ - case 0x5e: /* FRINT32X */ - gen_helper_frint32_s(tcg_res, tcg_op, tcg_fpstatus); - break; - case 0x1f: /* FRINT64Z */ - case 0x5f: /* FRINT64X */ - gen_helper_frint64_s(tcg_res, tcg_op, tcg_fpstatus); - break; default: case 0x7: /* SQABS, SQNEG */ case 0x2f: /* FABS */ case 0x6f: /* FNEG */ case 0x7f: /* FSQRT */ + case 0x18: /* FRINTN */ + case 0x19: /* FRINTM */ + case 0x38: /* FRINTP */ + case 0x39: /* FRINTZ */ + case 0x58: /* FRINTA */ + case 0x79: /* FRINTI */ + case 0x59: /* FRINTX */ + case 0x1e: /* FRINT32Z */ + case 0x5e: /* FRINT32X */ + case 0x1f: /* FRINT64Z */ + case 0x5f: /* FRINT64X */ g_assert_not_reached(); } } @@ -10289,7 +10265,6 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn) int rn, rd; bool is_q; bool is_scalar; - bool only_in_vector = false; int pass; TCGv_i32 tcg_rmode = NULL; @@ -10343,31 +10318,6 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn) case 0x3d: /* FRECPE */ case 0x3f: /* FRECPX */ break; - case 0x18: /* FRINTN */ - only_in_vector = true; - rmode = FPROUNDING_TIEEVEN; - break; - case 0x19: /* FRINTM */ - only_in_vector = true; - rmode = FPROUNDING_NEGINF; - break; - case 0x38: /* FRINTP */ - only_in_vector = true; - rmode = FPROUNDING_POSINF; - break; - case 0x39: /* FRINTZ */ - only_in_vector = true; - rmode = FPROUNDING_ZERO; - break; - case 0x58: /* FRINTA */ - only_in_vector = true; - rmode = FPROUNDING_TIEAWAY; - break; - case 0x59: /* FRINTX */ - case 0x79: /* FRINTI */ - only_in_vector = true; - /* current rounding mode */ - break; case 0x1a: /* FCVTNS */ rmode = FPROUNDING_TIEEVEN; break; @@ -10404,6 +10354,13 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn) case 0x2f: /* FABS */ case 0x6f: /* FNEG */ case 0x7f: /* FSQRT (vector) */ + case 0x18: /* FRINTN */ + case 0x19: /* FRINTM */ + case 0x38: /* FRINTP */ + case 0x39: /* FRINTZ */ + case 0x58: /* FRINTA */ + case 0x59: /* FRINTX */ + case 0x79: /* FRINTI */ unallocated_encoding(s); return; } @@ -10415,11 +10372,6 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn) unallocated_encoding(s); return; } - /* FRINTxx is only in the vector form */ - if (only_in_vector) { - unallocated_encoding(s); - return; - } } if (!fp_access_check(s)) { @@ -10494,17 +10446,6 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn) case 0x7b: /* FCVTZU */ gen_helper_advsimd_f16touinth(tcg_res, tcg_op, tcg_fpstatus); break; - case 0x18: /* FRINTN */ - case 0x19: /* FRINTM */ - case 0x38: /* FRINTP */ - case 0x39: /* FRINTZ */ - case 0x58: /* FRINTA */ - case 0x79: /* FRINTI */ - gen_helper_advsimd_rinth(tcg_res, tcg_op, tcg_fpstatus); - break; - case 0x59: /* FRINTX */ - gen_helper_advsimd_rinth_exact(tcg_res, tcg_op, tcg_fpstatus); - break; case 0x7d: /* FRSQRTE */ gen_helper_rsqrte_f16(tcg_res, tcg_op, tcg_fpstatus); break; @@ -10512,6 +10453,13 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn) case 0x2f: /* FABS */ case 0x6f: /* FNEG */ case 0x7f: /* FSQRT */ + case 0x18: /* FRINTN */ + case 0x19: /* FRINTM */ + case 0x38: /* FRINTP */ + case 0x39: /* FRINTZ */ + case 0x58: /* FRINTA */ + case 0x79: /* FRINTI */ + case 0x59: /* FRINTX */ g_assert_not_reached(); } From patchwork Fri Dec 13 17:32:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850181 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1641360wry; Fri, 13 Dec 2024 09:41:01 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVc8qYEuH9CMHyQFtHk7CF2hotd19n7OrKB6AUHAM2XkJO91EUPS5aVr8Kee7rF4iWt7K2oPw==@linaro.org X-Google-Smtp-Source: AGHT+IFs3Y58ayS8Et0jcQsn5yYTguuuD0Kvi6nFpOyhaNJeCgAOKQ27IKA5gtnDmPsjWJfpviXx X-Received: by 2002:a05:600c:b95:b0:434:9c1b:b36a with SMTP id 5b1f17b1804b1-4362aa2e539mr32511885e9.13.1734111661802; Fri, 13 Dec 2024 09:41:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111661; cv=none; d=google.com; s=arc-20240605; b=e5V6t4dAMa6wHCAxwm1behohLGhzginGmfrzH40TwNvx4RHxNkSC2x3uFhLdmg4k7+ 9HkDT0uDdaMPqHkJexhnhxbr/Nu103ZTsuMKr/75sQs8WOZl41w2BRmdMnVqd7ceGSRN QLUqnqmjSEvd9tiM8f8TlCMIhyOrCjGpCIxNsDrG2cgTOczt1KL3bSPWHxhmunXJe68g C4N0uq8bAbHxEeVrMvOpawyurlIZJ8pAtuZ9CcuhhdkFVUc1tyO5lB6+AVqmgfu/EdN+ vV61XSuMWoyLzmvK0fEd5o5iTE0754FviMkpKJaVEkyCACvURe1L1rKvfDObpbEd2a8p OUfA== 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=Pn78mn1Agyf2nTOFl8VtgeWSdcy/50LqPHioFwhttS0=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=GPlLsAiB4yF+RarEbttW/Z+xtI1IoKZEEpcojV6oTl1EamOd7Wx2/uk4aOdXe1yqlO pJ7Zg6i3I1H1uN7aEEe6wBNp3ra6Dsn9DsXfCQjiQXzIK0XJxHRH53P7UGRxtbvNBval YUikKJWygPD0Tt7ZDzS2HrnIgBmbeT9y8eVMkOq1ldnil0BZxjYd7tjHk9fLzJY23Kao O4KQZ9wcrAARyX8bh7tPWb9p/EKKOJ5BmedYPKNurbGqPCs5Kqw8PbUt5+zq7OPjlgGf 7KGZkAqZ3VvvPwJ/z86QRXMSllMC9qLcoAS2u6HPELv6dnd/PTdpDnjNbQU2+jFnbI4l Z/7A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=G3fqECKe; 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 5b1f17b1804b1-4362580fa73si22858095e9.189.2024.12.13.09.41.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:41: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=G3fqECKe; 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 1tM9Yr-0005eQ-TF; Fri, 13 Dec 2024 12:34:48 -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 1tM9Xj-0007nw-Iy for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:35 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9Xh-0001gJ-Jm for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:35 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-434e3953b65so14348455e9.1 for ; Fri, 13 Dec 2024 09:33:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111212; x=1734716012; 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=Pn78mn1Agyf2nTOFl8VtgeWSdcy/50LqPHioFwhttS0=; b=G3fqECKekdFM0jOG2biKDoqcM+MKdk1WizcHeQxqqU5SSXYH+t1KGPeO7BPDzrUlKM i8Gges+FqoKTGmjAcPNQwSDhSKgfoVKJm9IcBeji228eIp0IiB83EM949JHgB23KHdGi U44YUtqsu8iw+m0HMcSVpfOoaRPnESFS6E4G3bZc3ffP5nsXxWXUPXc0YvciC9wc2laN xVbSlaXTeRuRfyTF7L9GExx9UcjO0Gv67r//BTdRbhTD3UBoRmL77HEcwVOXCGe5Yq8d uUHoZCd3iqAh0HAH1r/5qYtgtPWUorzrbSccwMrQdC5q0AOIU4yrUkQibYBb0Ot0s7tq gz7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111212; x=1734716012; 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=Pn78mn1Agyf2nTOFl8VtgeWSdcy/50LqPHioFwhttS0=; b=gDXvxp5TrGFjlY8D92QR9KCYyaW+bmVxS8CSP0TbtAzMROmrrCNXBvYejkgPn1DtPj yI0Nso6w9+kK2s5Z0Y6Kh5+yLuf0Rd5fJ53jz4C+TxfjiTq5RIEIXuKWx7NSJwQy/Ioo eUCwoeE4tkwR6hKpUuC0UyK3Db7mOBG0+rM/NyVAiydEBCb9L62P3pDbIXL4vUZDfEK0 vueyEeznrLIdbwXqXyN84sLRd0WNaFd34LpxeuWRLdRct5oW6vQY5xfNX9CH94od7E7s 2AJtwuOY/TKp4reBdZY3rTXGFwGw6hWZHEn6VmySYPUb6eLi/2Zaug6fqFzfVLLRTRjh NSmw== X-Gm-Message-State: AOJu0YymxuJlN8IDQg673PsXzdVU3If8zqNh7BNcQSrwSkTUDX/8T4Ri tKNUrjKiBs8Y4tmVfFnHJNbaXMLbnWVTqKbHpldrr3khQJ2bPgsmEgwPiogj3ujnL9zsSL4q2pM a X-Gm-Gg: ASbGnctJ5aCLk15qmNdrhzEcNH7TEOffwCr/15l19sVfFWUi2riy4cG0h3vJGTCOGP1 t1AN+a6PLRZ2gUizMfzpCMqumG4gjDOSJ/4CECB+BopDW9hJLqiQkAnSO6gUQljcvku+X9OqCy2 4sRNLCoroeGUqSv/G+YM8WAewkpkkwZf4nAyMisQ7JVRUMACjK9JwKUg0BWuxK6TB9UNpxDpiEh XAB4PpaVB5/5Nq1jeJzE1D8XNR07rHc980/0GoPgOkQ22HqncOsjplP5O7hmg== X-Received: by 2002:a05:600c:378f:b0:436:1b7a:c0b4 with SMTP id 5b1f17b1804b1-4362aa1475cmr27008095e9.1.1734111212157; Fri, 13 Dec 2024 09:33:32 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:31 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 57/85] target/arm: Convert FCVT* (vector, integer) scalar to decodetree Date: Fri, 13 Dec 2024 17:32:01 +0000 Message-Id: <20241213173229.3308926-58-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x333.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: Richard Henderson Arm silliness with naming, the scalar insns described as part of the vector instructions, as separate from the "regular" scalar insns which output to general registers. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-58-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 30 ++++++++ target/arm/tcg/translate-a64.c | 133 ++++++++++++++------------------- 2 files changed, 86 insertions(+), 77 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 5e02144f651..f7fcc32adc5 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -1652,6 +1652,36 @@ UQXTN_s 0111 1110 ..1 00001 01001 0 ..... ..... @rr_e FCVTXN_s 0111 1110 011 00001 01101 0 ..... ..... @rr_s +@icvt_h . ....... .. ...... ...... rn:5 rd:5 \ + &fcvt sf=0 esz=1 shift=0 +@icvt_sd . ....... .. ...... ...... rn:5 rd:5 \ + &fcvt sf=0 esz=%esz_sd shift=0 + +FCVTNS_f 0101 1110 011 11001 10101 0 ..... ..... @icvt_h +FCVTNS_f 0101 1110 0.1 00001 10101 0 ..... ..... @icvt_sd +FCVTNU_f 0111 1110 011 11001 10101 0 ..... ..... @icvt_h +FCVTNU_f 0111 1110 0.1 00001 10101 0 ..... ..... @icvt_sd + +FCVTPS_f 0101 1110 111 11001 10101 0 ..... ..... @icvt_h +FCVTPS_f 0101 1110 1.1 00001 10101 0 ..... ..... @icvt_sd +FCVTPU_f 0111 1110 111 11001 10101 0 ..... ..... @icvt_h +FCVTPU_f 0111 1110 1.1 00001 10101 0 ..... ..... @icvt_sd + +FCVTMS_f 0101 1110 011 11001 10111 0 ..... ..... @icvt_h +FCVTMS_f 0101 1110 0.1 00001 10111 0 ..... ..... @icvt_sd +FCVTMU_f 0111 1110 011 11001 10111 0 ..... ..... @icvt_h +FCVTMU_f 0111 1110 0.1 00001 10111 0 ..... ..... @icvt_sd + +FCVTZS_f 0101 1110 111 11001 10111 0 ..... ..... @icvt_h +FCVTZS_f 0101 1110 1.1 00001 10111 0 ..... ..... @icvt_sd +FCVTZU_f 0111 1110 111 11001 10111 0 ..... ..... @icvt_h +FCVTZU_f 0111 1110 1.1 00001 10111 0 ..... ..... @icvt_sd + +FCVTAS_f 0101 1110 011 11001 11001 0 ..... ..... @icvt_h +FCVTAS_f 0101 1110 0.1 00001 11001 0 ..... ..... @icvt_sd +FCVTAU_f 0111 1110 011 11001 11001 0 ..... ..... @icvt_h +FCVTAU_f 0111 1110 0.1 00001 11001 0 ..... ..... @icvt_sd + # Advanced SIMD two-register miscellaneous SQABS_v 0.00 1110 ..1 00000 01111 0 ..... ..... @qrr_e diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 0f924b07dcd..71f1d6f7786 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -8674,6 +8674,16 @@ static void do_fcvt_scalar(DisasContext *s, MemOp out, MemOp esz, tcg_shift, tcg_fpstatus); tcg_gen_extu_i32_i64(tcg_out, tcg_single); break; + case MO_16 | MO_SIGN: + gen_helper_vfp_toshh(tcg_single, tcg_single, + tcg_shift, tcg_fpstatus); + tcg_gen_extu_i32_i64(tcg_out, tcg_single); + break; + case MO_16: + gen_helper_vfp_touhh(tcg_single, tcg_single, + tcg_shift, tcg_fpstatus); + tcg_gen_extu_i32_i64(tcg_out, tcg_single); + break; default: g_assert_not_reached(); } @@ -8717,6 +8727,42 @@ TRANS(FCVTZU_g, do_fcvt_g, a, FPROUNDING_ZERO, false) TRANS(FCVTAS_g, do_fcvt_g, a, FPROUNDING_TIEAWAY, true) TRANS(FCVTAU_g, do_fcvt_g, a, FPROUNDING_TIEAWAY, false) +/* + * FCVT* (vector), scalar version. + * Which sounds weird, but really just means output to fp register + * instead of output to general register. Input and output element + * size are always equal. + */ +static bool do_fcvt_f(DisasContext *s, arg_fcvt *a, + ARMFPRounding rmode, bool is_signed) +{ + TCGv_i64 tcg_int; + int check = fp_access_check_scalar_hsd(s, a->esz); + + if (check <= 0) { + return check == 0; + } + + tcg_int = tcg_temp_new_i64(); + do_fcvt_scalar(s, a->esz | (is_signed ? MO_SIGN : 0), + a->esz, tcg_int, a->shift, a->rn, rmode); + + clear_vec(s, a->rd); + write_vec_element(s, tcg_int, a->rd, 0, a->esz); + return true; +} + +TRANS(FCVTNS_f, do_fcvt_f, a, FPROUNDING_TIEEVEN, true) +TRANS(FCVTNU_f, do_fcvt_f, a, FPROUNDING_TIEEVEN, false) +TRANS(FCVTPS_f, do_fcvt_f, a, FPROUNDING_POSINF, true) +TRANS(FCVTPU_f, do_fcvt_f, a, FPROUNDING_POSINF, false) +TRANS(FCVTMS_f, do_fcvt_f, a, FPROUNDING_NEGINF, true) +TRANS(FCVTMU_f, do_fcvt_f, a, FPROUNDING_NEGINF, false) +TRANS(FCVTZS_f, do_fcvt_f, a, FPROUNDING_ZERO, true) +TRANS(FCVTZU_f, do_fcvt_f, a, FPROUNDING_ZERO, false) +TRANS(FCVTAS_f, do_fcvt_f, a, FPROUNDING_TIEAWAY, true) +TRANS(FCVTAU_f, do_fcvt_f, a, FPROUNDING_TIEAWAY, false) + static bool trans_FJCVTZS(DisasContext *s, arg_FJCVTZS *a) { if (!dc_isar_feature(aa64_jscvt, s)) { @@ -9776,10 +9822,6 @@ static void disas_simd_scalar_two_reg_misc(DisasContext *s, uint32_t insn) int opcode = extract32(insn, 12, 5); int size = extract32(insn, 22, 2); bool u = extract32(insn, 29, 1); - bool is_fcvt = false; - int rmode; - TCGv_i32 tcg_rmode; - TCGv_ptr tcg_fpstatus; switch (opcode) { case 0xc ... 0xf: @@ -9824,15 +9866,8 @@ static void disas_simd_scalar_two_reg_misc(DisasContext *s, uint32_t insn) case 0x5b: /* FCVTMU */ case 0x7a: /* FCVTPU */ case 0x7b: /* FCVTZU */ - is_fcvt = true; - rmode = extract32(opcode, 5, 1) | (extract32(opcode, 0, 1) << 1); - break; case 0x1c: /* FCVTAS */ case 0x5c: /* FCVTAU */ - /* TIEAWAY doesn't fit in the usual rounding mode encoding */ - is_fcvt = true; - rmode = FPROUNDING_TIEAWAY; - break; case 0x56: /* FCVTXN, FCVTXN2 */ default: unallocated_encoding(s); @@ -9851,59 +9886,7 @@ static void disas_simd_scalar_two_reg_misc(DisasContext *s, uint32_t insn) unallocated_encoding(s); return; } - - if (!fp_access_check(s)) { - return; - } - - if (is_fcvt) { - tcg_fpstatus = fpstatus_ptr(FPST_FPCR); - tcg_rmode = gen_set_rmode(rmode, tcg_fpstatus); - } else { - tcg_fpstatus = NULL; - tcg_rmode = NULL; - } - - if (size == 3) { - TCGv_i64 tcg_rn = read_fp_dreg(s, rn); - TCGv_i64 tcg_rd = tcg_temp_new_i64(); - - handle_2misc_64(s, opcode, u, tcg_rd, tcg_rn, tcg_rmode, tcg_fpstatus); - write_fp_dreg(s, rd, tcg_rd); - } else { - TCGv_i32 tcg_rn = tcg_temp_new_i32(); - TCGv_i32 tcg_rd = tcg_temp_new_i32(); - - read_vec_element_i32(s, tcg_rn, rn, 0, size); - - switch (opcode) { - case 0x1a: /* FCVTNS */ - case 0x1b: /* FCVTMS */ - case 0x1c: /* FCVTAS */ - case 0x3a: /* FCVTPS */ - case 0x3b: /* FCVTZS */ - gen_helper_vfp_tosls(tcg_rd, tcg_rn, tcg_constant_i32(0), - tcg_fpstatus); - break; - case 0x5a: /* FCVTNU */ - case 0x5b: /* FCVTMU */ - case 0x5c: /* FCVTAU */ - case 0x7a: /* FCVTPU */ - case 0x7b: /* FCVTZU */ - gen_helper_vfp_touls(tcg_rd, tcg_rn, tcg_constant_i32(0), - tcg_fpstatus); - break; - default: - case 0x7: /* SQABS, SQNEG */ - g_assert_not_reached(); - } - - write_fp_sreg(s, rd, tcg_rd); - } - - if (is_fcvt) { - gen_restore_rmode(tcg_rmode, tcg_fpstatus); - } + g_assert_not_reached(); } /* AdvSIMD shift by immediate @@ -10391,30 +10374,26 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn) TCGv_i32 tcg_res = tcg_temp_new_i32(); switch (fpop) { - case 0x1a: /* FCVTNS */ - case 0x1b: /* FCVTMS */ - case 0x1c: /* FCVTAS */ - case 0x3a: /* FCVTPS */ - case 0x3b: /* FCVTZS */ - gen_helper_advsimd_f16tosinth(tcg_res, tcg_op, tcg_fpstatus); - break; case 0x3d: /* FRECPE */ gen_helper_recpe_f16(tcg_res, tcg_op, tcg_fpstatus); break; case 0x3f: /* FRECPX */ gen_helper_frecpx_f16(tcg_res, tcg_op, tcg_fpstatus); break; + case 0x7d: /* FRSQRTE */ + gen_helper_rsqrte_f16(tcg_res, tcg_op, tcg_fpstatus); + break; + default: + case 0x1a: /* FCVTNS */ + case 0x1b: /* FCVTMS */ + case 0x1c: /* FCVTAS */ + case 0x3a: /* FCVTPS */ + case 0x3b: /* FCVTZS */ case 0x5a: /* FCVTNU */ case 0x5b: /* FCVTMU */ case 0x5c: /* FCVTAU */ case 0x7a: /* FCVTPU */ case 0x7b: /* FCVTZU */ - gen_helper_advsimd_f16touinth(tcg_res, tcg_op, tcg_fpstatus); - break; - case 0x7d: /* FRSQRTE */ - gen_helper_rsqrte_f16(tcg_res, tcg_op, tcg_fpstatus); - break; - default: g_assert_not_reached(); } From patchwork Fri Dec 13 17:32:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850180 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1640981wry; Fri, 13 Dec 2024 09:40:10 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWgRG+NKwf2ntnlE7/nw45Zq7AdveiXUigE1I+AH6EvEgJ4aE36Cyh7R6VTaJxfhZVs5Tt4jQ==@linaro.org X-Google-Smtp-Source: AGHT+IFL3yEsxPFWXb1AgK8d9kg/wrBycfTrRB00f0trks7pMGbZqzoHYRBxsy0yYX9E0Q32pknR X-Received: by 2002:a17:906:c146:b0:aa6:82e3:2103 with SMTP id a640c23a62f3a-aab779b7e12mr421640366b.32.1734111610464; Fri, 13 Dec 2024 09:40:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111610; cv=none; d=google.com; s=arc-20240605; b=Uo+ImHfBJkuryQv9TfOPAECQi2wEp2RFrgm/60xCiotH8TjJvWuSmeH7e9X6TJJiFh 27jnkfaruQZ/ZITqgTcObucqOl9EYvP28NOYw8FnmX0kXMtcWe3NhoF7Fcrv0/sjutJ4 jKCGsJmycQyW+kEqP5AWl1gKISqbLt2KUm4rlTIcJweP2ofJhrLkR1t501uD4JGJkJBy aXaNsLQBRUiZlntgNMEb5f1Y3nORkV0iY4PUYlqpVykH3kvnthK15+jbNTnVhrQbWIPt 6BgUX1Yuu1Q26JYNfWu76rQjLWzM74bQuIE/mYYFavMLV4vKPYoS3xBVH69La/+31FW5 w2rg== 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=3mdlWNNeHXJsgcTtnZPbD4pcaM8JSPdYHOgC0phOQbk=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=NhoMIVgH4lJlu0WOkitD54sjbj8FAJIrc5hTyi68e+O4O0IMmrDjQPdMPifSSEhSrL wGNPS5XOxfwYQYsqEAqZwH5V17nA8Rv25pf/HUZzkLtqJKwgrM6r8DIOUN8XU6JTU9j/ Trh6pVh69iedrpqXEyrD4/PersE6j/lDNq0aQdJxxWEAwbMjuZsuy2jbJYL/mrCrQoib I9EbnI7RUlPNBeklqO9FZ5pzZvmlDPUH2yWhldnFWU+VlU3LRN1Quxpz2t55M5PpJi1k 1Z6G3jfg9KoKCWadMYiO1FXvbNNabL01kYiVtmCpEUOE2LsQUQlC/FEWzVodDTQ9b4IF KDzA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IptiSBPR; 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 a640c23a62f3a-aa6752edd84si867188266b.416.2024.12.13.09.40.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:40: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=IptiSBPR; 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 1tM9a3-0008Ef-VL; Fri, 13 Dec 2024 12:36: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 1tM9Xn-0007rv-DO for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:39 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9Xi-0001gZ-PN for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:39 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-435f8f29f8aso14803935e9.2 for ; Fri, 13 Dec 2024 09:33:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111213; x=1734716013; 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=3mdlWNNeHXJsgcTtnZPbD4pcaM8JSPdYHOgC0phOQbk=; b=IptiSBPR0ymzk02ypTlb8p5MNI3QAaDq5dIm8DAwCK8xCiJwVz1rfnthn428Yocpsk gG6M3e94KRS+P3ZsiYtSuMzL1dme+dEpm6NKJhpoZ+EPZkOBawP/+zG1mcTI0Oh4Y95H Hh0qlPuZNbEb0BvUBYZDhE6QmvqcTKKTu1zlsUUAZAju0Ib5CDeJX2jX8DR8Hm14GKvj LC702eiQghcD0Yt55T4dpLzBcJ7Z6msofpo8dVFMFC/ZEmi9PcK7Po3Pt26xtC8zgpSi sTbn/ibK7sotHDXAf/fRZpjjII8RooH+XpDW0BpCfu0p8MGKr08mKe7hV1czrDIeEmr7 giqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111213; x=1734716013; 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=3mdlWNNeHXJsgcTtnZPbD4pcaM8JSPdYHOgC0phOQbk=; b=rmB1fjjeJ001uP5/7WKYP6EEAXHTWjOIR6WExTWbyf44FwGjovRRb+Vl+2S9t4Ncol 9JdO9X94Wh9afbibLWKO3w+2Tssr3T/QiJtOVsL+2Zvoi/twuW6PXNdDgcl//THD/vuI JrNoAOEyKD3Cgo90OG4tZ/IFZbQYkMV3UmHK9pUBVRQVCkzw6NBq4gTQY0q+7+Qa8WrY aTzV8BUtgNcx9V2o6c5bH/dgGm9cFullpcYDTMNyzA9zHgk4gK1awWs0//xlspTQOVL3 VBwNrs65daLOnqKD+7ihS3FT2DotyrzecHo6uKOWZg3efWqHiU9Hoceh8rUPjhSVgSE2 0q2w== X-Gm-Message-State: AOJu0Yxf7yuhkhL8ZuC8w+jSpMQVKneaiAxBS0g4eq0QH9kMiY5iEi3v meVLEIMVChtZjduFylTKYkVvt03KnZ6JgkSaoYyE2hVeFmSRjYbseCrVVDCgfGmC1TQdGN51g0r K X-Gm-Gg: ASbGnct4BbtRl9u50BKkoFVZAFU0saHWy/GAaRnO2Rr5OdylM6Abayd5FH9ilTS/qXf kRD5oj+v1Km58KbCQ2yD5NxVph5bO9iZyDglqdPmOqAhOGQ1eS/Y8YSlkQgZktQj1L6qojAJMgM 1rvefr944PUIbcQW+ggvEXSQPZmW/eShzJZP0OnDTUiA6yQLZU6vk5DYIIbjMG9QeaFB/1JruPu PGbMxlLdhjXRvrhcIdu7lINMfJIrxWJJI8rYWXojcLnCGabkaVOeMPqmVF1aA== X-Received: by 2002:a05:600c:1c1c:b0:434:f917:2b11 with SMTP id 5b1f17b1804b1-4362aaaa01dmr30117275e9.21.1734111213197; Fri, 13 Dec 2024 09:33:33 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:32 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 58/85] target/arm: Convert FCVT* (vector, fixed-point) scalar to decodetree Date: Fri, 13 Dec 2024 17:32:02 +0000 Message-Id: <20241213173229.3308926-59-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x334.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-59-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 19 +++++++++++++++++++ target/arm/tcg/translate-a64.c | 4 +--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index f7fcc32adc5..f66f62da4f0 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -1682,6 +1682,25 @@ FCVTAS_f 0101 1110 0.1 00001 11001 0 ..... ..... @icvt_sd FCVTAU_f 0111 1110 011 11001 11001 0 ..... ..... @icvt_h FCVTAU_f 0111 1110 0.1 00001 11001 0 ..... ..... @icvt_sd +%fcvt_f_sh_h 16:4 !function=rsub_16 +%fcvt_f_sh_s 16:5 !function=rsub_32 +%fcvt_f_sh_d 16:6 !function=rsub_64 + +@fcvt_fixed_h .... .... . 001 .... ...... rn:5 rd:5 \ + &fcvt sf=0 esz=1 shift=%fcvt_f_sh_h +@fcvt_fixed_s .... .... . 01 ..... ...... rn:5 rd:5 \ + &fcvt sf=0 esz=2 shift=%fcvt_f_sh_s +@fcvt_fixed_d .... .... . 1 ...... ...... rn:5 rd:5 \ + &fcvt sf=0 esz=3 shift=%fcvt_f_sh_d + +FCVTZS_f 0101 1111 0 ....... 111111 ..... ..... @fcvt_fixed_h +FCVTZS_f 0101 1111 0 ....... 111111 ..... ..... @fcvt_fixed_s +FCVTZS_f 0101 1111 0 ....... 111111 ..... ..... @fcvt_fixed_d + +FCVTZU_f 0111 1111 0 ....... 111111 ..... ..... @fcvt_fixed_h +FCVTZU_f 0111 1111 0 ....... 111111 ..... ..... @fcvt_fixed_s +FCVTZU_f 0111 1111 0 ....... 111111 ..... ..... @fcvt_fixed_d + # Advanced SIMD two-register miscellaneous SQABS_v 0.00 1110 ..1 00000 01111 0 ..... ..... @qrr_e diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 71f1d6f7786..894befef4dc 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -9535,9 +9535,6 @@ static void disas_simd_scalar_shift_imm(DisasContext *s, uint32_t insn) handle_simd_shift_intfp_conv(s, true, false, is_u, immh, immb, opcode, rn, rd); break; - case 0x1f: /* FCVTZS, FCVTZU */ - handle_simd_shift_fpint_conv(s, true, false, is_u, immh, immb, rn, rd); - break; default: case 0x00: /* SSHR / USHR */ case 0x02: /* SSRA / USRA */ @@ -9551,6 +9548,7 @@ static void disas_simd_scalar_shift_imm(DisasContext *s, uint32_t insn) case 0x11: /* SQRSHRUN */ case 0x12: /* SQSHRN, UQSHRN */ case 0x13: /* SQRSHRN, UQRSHRN */ + case 0x1f: /* FCVTZS, FCVTZU */ unallocated_encoding(s); break; } From patchwork Fri Dec 13 17:32:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850195 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1642456wry; Fri, 13 Dec 2024 09:43:25 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXJz00QeKisjpfeKPEghULiFDatDI3JZNKhhMU6KEAF5qpCKaSgzh2qCDsai2wQG1aK93dgwQ==@linaro.org X-Google-Smtp-Source: AGHT+IHWrdyLNDBy16u3WpFDGoulqtCkZd5SHaJzi+PswIPmrDq1po3ZbRZ/xh25MhNVsJm7myZv X-Received: by 2002:a17:906:309a:b0:aa6:7d76:f21b with SMTP id a640c23a62f3a-aab77ed38a6mr381550666b.51.1734111804993; Fri, 13 Dec 2024 09:43:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111804; cv=none; d=google.com; s=arc-20240605; b=Y8msQt0/7jfDJxLc90dk8h58B4yR4nMstOfnrIe7Gx0PMwVBfwPcwj+QRMCOIChBc+ 28QdhO0PKbulWCMWrOB6b9R9BfxKE9W/0zVW+AKqckJMsTNpWpgWavhu5Ru0NyGsnsOi XAYo2CkxRBRFhM0HU7hDz8E7wFOpeNnEBT/YqgkUoEmq0VYIxY8Al+DDo09nJ09bpPcR QOJiGpCXD7ahQegAlGY3VIGVpmUraZFgAj6ri2+dLNXjPAQ1QpChXyV/3ZXtlhVlxcN4 c8ANhHghmb5C1ZRi2FsprPEZQs63P8a2vcmN0ksUnTJGQZGBVUy17hjh7gv1WIDCfSUc t4QA== 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=yw8Z6Ug2TOPFOe+QLKdpRyCukCn8vbWCtqZg4s/IelY=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=LtaUjPqpFGyD0mWI10MbsRUufjWWfsexB2urjhIDMvSVUlkKiZzXqYF5yJtl1RskLl BDOQEBJJgtf5XC2jrf39xDm4BEhDrS7m6KLsbdImHUEJ7Aeu0S7grY0s9kmovGj5pDdf BkbkDMsCB3hKfPi1RW2e/HX5IFc63b3UahFTIp9cZXPhzHZWsNB7w9G0jD0YK1Yewc3b 614qSdou1z5VwWm7pIIxms4P1iTBaUk7kBrYOrtnumhvlpjPvysO3Z4hf/qjq1u2Ybrk UqbKzE4AlKn8hyrbxHurkzaKBveKhanv4cQnoCpvxTRi8xg2K9YXcaniDlaZqcjGE6Ue NiBg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=K+w0xqNh; 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 a640c23a62f3a-aa691f70a88si745040166b.867.2024.12.13.09.43.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:43:24 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=K+w0xqNh; 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 1tM9ZY-0006Yh-HM; Fri, 13 Dec 2024 12:35:28 -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 1tM9Xl-0007qj-Bn for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:37 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9Xj-0001gm-MW for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:37 -0500 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-38632b8ae71so1477481f8f.0 for ; Fri, 13 Dec 2024 09:33:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111214; x=1734716014; 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=yw8Z6Ug2TOPFOe+QLKdpRyCukCn8vbWCtqZg4s/IelY=; b=K+w0xqNhe3p2PBQTRwt6CUC1/h8zrXVsEZ2kMpvtqvALbX4hCXLQQxdgoCq80Vj33z 4xPt32tBLr+ikazfHGDbZ3Eh+pavaHh1s7QS5Nioh5YKE9oGQmrUIuGFv/W04CIs8GL0 ZBsQ1AHZlKQv+Udv0wl6DRL+3ydoBnBCVkbJJUjjYQ5GozB1psS17pwyoqbxWZKp6vjy zpQLa1KZMSMWULLwSN7o0uyWKZH56ceDWTEjz0yDTeSn9Ua+1FK1pllc15VzHwPJlb0k cju0pn9YA9+rjelKTPsKJTFOTpoStE1TK4BO7iW3XPs/UQdoK7He9wsyehM2a3QyknMN KE1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111214; x=1734716014; 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=yw8Z6Ug2TOPFOe+QLKdpRyCukCn8vbWCtqZg4s/IelY=; b=WhQv24RrD4217kEu2JgXGwIaa36ZWPykMal2/CX4ED780vo3wG29jn13Xcic6X/kCE f4T+fmGlmH0E+i/WkDRH4mg+rDXuYX8oUYWmFg3U2mE2jDGbX5ZL+NfTnZqUqyHGBj9X LAQD7+Ajb0FiRfqJSzUgViT8KXHddiIRdUK8beUgIr1dpUT+Dg5RuZG0fWmrWgMSBEFF pbGGVGWGHdRdUm1gts8IJDS1uCRjj+LvxZDceh9/78sfG6KFujxMCq1DEbciXCVlqOAB Ye6yIkTrBYCGbtF9ZAANwZtJ7iC+FW5KornN9Q4TutAXcVHjpLu2Zus1XVuXPAIfeekN 3m3g== X-Gm-Message-State: AOJu0Yz+iuCMoppKij2LwEI+FakmcfV5cCQWqJoar3j6PpDPlPhaj5Rk VenZwD9gFIAK8qgp/sx6t4BRtUWFiZJdWsGkSsbytzAfGK+bszDWalGrKtSsyx9zNB847B0aXwT p X-Gm-Gg: ASbGncsqQNtEs4MiBxdZpc5IrTabRTIh2WTeSbvsbt8nQXaPidK9Mw2atqT4vwwrCXk YkbtvH/B0UnUPiu6LiTaRPpE5PeFjs7kKMc4eeJJQkcAYDODVF52FzvaxNdgYeP2iL8s0Ly50KM fZ0IFl6pt0BQ4IXoZ1JI2izpyrB6cptj0epQCTvpkEzT/tmJXYTM2zPna9BC7aMIFje+dyEI3zF gYKABxQ5VUmuQ0wTSh35O5fzWF2BdjC6JfDphJI9b6MdCfzDTTgKytcrqy33A== X-Received: by 2002:a05:6000:1842:b0:386:37bb:ddc1 with SMTP id ffacd0b85a97d-3888e0c1863mr2609674f8f.56.1734111214238; Fri, 13 Dec 2024 09:33:34 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:33 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 59/85] target/arm: Convert [US]CVTF (vector, integer) scalar to decodetree Date: Fri, 13 Dec 2024 17:32:03 +0000 Message-Id: <20241213173229.3308926-60-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-60-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 6 ++++++ target/arm/tcg/translate-a64.c | 35 ++++++++++++++++++++++++---------- 2 files changed, 31 insertions(+), 10 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index f66f62da4f0..146500d9c4b 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -1657,6 +1657,12 @@ FCVTXN_s 0111 1110 011 00001 01101 0 ..... ..... @rr_s @icvt_sd . ....... .. ...... ...... rn:5 rd:5 \ &fcvt sf=0 esz=%esz_sd shift=0 +SCVTF_f 0101 1110 011 11001 11011 0 ..... ..... @icvt_h +SCVTF_f 0101 1110 0.1 00001 11011 0 ..... ..... @icvt_sd + +UCVTF_f 0111 1110 011 11001 11011 0 ..... ..... @icvt_h +UCVTF_f 0111 1110 0.1 00001 11011 0 ..... ..... @icvt_sd + FCVTNS_f 0101 1110 011 11001 10101 0 ..... ..... @icvt_h FCVTNS_f 0101 1110 0.1 00001 10101 0 ..... ..... @icvt_sd FCVTNU_f 0111 1110 011 11001 10101 0 ..... ..... @icvt_h diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 894befef4dc..6e9d040ebfb 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -8599,6 +8599,29 @@ static bool do_cvtf_g(DisasContext *s, arg_fcvt *a, bool is_signed) TRANS(SCVTF_g, do_cvtf_g, a, true) TRANS(UCVTF_g, do_cvtf_g, a, false) +/* + * [US]CVTF (vector), scalar version. + * Which sounds weird, but really just means input from fp register + * instead of input from general register. Input and output element + * size are always equal. + */ +static bool do_cvtf_f(DisasContext *s, arg_fcvt *a, bool is_signed) +{ + TCGv_i64 tcg_int; + int check = fp_access_check_scalar_hsd(s, a->esz); + + if (check <= 0) { + return check == 0; + } + + tcg_int = tcg_temp_new_i64(); + read_vec_element(s, tcg_int, a->rn, 0, a->esz | (is_signed ? MO_SIGN : 0)); + return do_cvtf_scalar(s, a->esz, a->rd, a->shift, tcg_int, is_signed); +} + +TRANS(SCVTF_f, do_cvtf_f, a, true) +TRANS(UCVTF_f, do_cvtf_f, a, false) + static void do_fcvt_scalar(DisasContext *s, MemOp out, MemOp esz, TCGv_i64 tcg_out, int shift, int rn, ARMFPRounding rmode) @@ -9838,16 +9861,6 @@ static void disas_simd_scalar_two_reg_misc(DisasContext *s, uint32_t insn) case 0x6d: /* FCMLE (zero) */ handle_2misc_fcmp_zero(s, opcode, true, u, true, size, rn, rd); return; - case 0x1d: /* SCVTF */ - case 0x5d: /* UCVTF */ - { - bool is_signed = (opcode == 0x1d); - if (!fp_access_check(s)) { - return; - } - handle_simd_intfp_conv(s, rd, rn, 1, is_signed, 0, size); - return; - } case 0x3d: /* FRECPE */ case 0x3f: /* FRECPX */ case 0x7d: /* FRSQRTE */ @@ -9867,6 +9880,8 @@ static void disas_simd_scalar_two_reg_misc(DisasContext *s, uint32_t insn) case 0x1c: /* FCVTAS */ case 0x5c: /* FCVTAU */ case 0x56: /* FCVTXN, FCVTXN2 */ + case 0x1d: /* SCVTF */ + case 0x5d: /* UCVTF */ default: unallocated_encoding(s); return; From patchwork Fri Dec 13 17:32:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850188 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1641832wry; Fri, 13 Dec 2024 09:42:01 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU51GlpCYSaJKsGIv2RK+IquYYnK1Sim1nAk2dkGjsbvCTkvCuTzOHkDd4H7n9sfSFHRwB6Lw==@linaro.org X-Google-Smtp-Source: AGHT+IEHsqxrbNx/mrTlHvZ/IvYZWBInNX+aNCUJ80V9BeEE+kzEkMxgaPOjFvHcy83BZPWxWqoi X-Received: by 2002:a05:6000:71d:b0:382:45db:6a1e with SMTP id ffacd0b85a97d-388c366d199mr2900927f8f.14.1734111721596; Fri, 13 Dec 2024 09:42:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111721; cv=none; d=google.com; s=arc-20240605; b=kXOPSEC7TZsKltTfjR3794lVm3vk0K0eo2/7L3k6hLV/etYjlA+8+HKw+qlGkE6zfU dxf0Gvh4qoVhHWM9RqQXC+LGwxjYLf0JDexw0mzJN+qk65SkTRj9HG4nS1MG8QG09m9J MPWwFCiqO1aYw09kyMZ38FFm/+AhqcBpqXx1OvfP6BE+JvGzGba9a7JNrxX5VrDya6If PGP3O+ngVbhV8334R1CEJP79fwLXYj3bIemt9RAmpJ5zkK3uYgGB9YE1TAOLtHHQaM2e 2r2uEg16KC4JuiDnSKt9zzpsncjQXwekc5txr3SQCCFcjKtFpJIdyGx0mlZPePsR4I9x rZxg== 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=59ZvNHRjbkXZRNQSQ5QVDZjUuqRFFa7W8p2pL9z93/k=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=aVq93J1nDPXKNJUp0NCB6K/IGG6iyq6lmT8m+L2r8D6PB2ygYO03WQJVUr3hEbaYxg gsmIdJ09itl0Mr61HfvBHyv1dNG/4NwlmRcw5mwC93XElNloIIl52ckAcA3NvcfmHNlh uKoy/SshsBEJTfG+7ci0xpteAZaykYPbrAuEFMK5ojnD3feXDmbzgPhWrmSgjcS7SyHX +x/nQMmQo8ji8JxHvnFvBmv1GcFBcTV8jsPTODR4x3ZhoTQyzQeChvChFYAD3LLYDJ0S JtGxBLzJl4akoXJUe9u1Yj8JY5ViYvjkLqo8/RdYiOyZnW3BogAm9578e9hJQghoN8/U GsDA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LHlbrTei; 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 ffacd0b85a97d-388c807b53asi27758f8f.984.2024.12.13.09.42.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:42: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=LHlbrTei; 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 1tM9Zc-0007CR-1Q; Fri, 13 Dec 2024 12:35:32 -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 1tM9Xm-0007rd-I2 for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:39 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9Xk-0001h3-Ov for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:38 -0500 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-3862d16b4f5so1352034f8f.0 for ; Fri, 13 Dec 2024 09:33:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111215; x=1734716015; 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=59ZvNHRjbkXZRNQSQ5QVDZjUuqRFFa7W8p2pL9z93/k=; b=LHlbrTei4tFAJmJiwrlX8p+3Qq9kv1Hj4DdZzT9w4toaIW4j16nmp0CsNBrYM9DCqc 3pI2GgS/F8g62KAxMnZMK8w8gShT3LqeNNtX54i0CpfgxSCBl0oZhnfuBLnU1br09nIw PJ6EL/D/bbD3r5VhQflHilK1yd7gl6JvTxCvbAnvw+4GfYQkbCbGT4LibxTA6SSHoPeU 8il9CaHVtjmFhu+XzqG7PYN8MxFgYM8ovDJJKHPmra7cCEpFm0Y9JNlbF7Pi3bHUsrTA MyZCcxLyU27bdm/YBYhxqVU3T1WBkpOFgxpPrMQHJJXBae1yQm83x3A91Cm9YccpZZFO ljDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111215; x=1734716015; 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=59ZvNHRjbkXZRNQSQ5QVDZjUuqRFFa7W8p2pL9z93/k=; b=nKpGCE+dHyZHNWrdmfhs7R48oSNJZzM9kqUNTkmb7ZUvYlktl+KynPvgK3++NTP2cE 8YDiIdL3js2tjc71HwL7i6Ah5GHsm8zArCKkmceG/z1sj+CsBn01yegXzMlc6lojQc9F MHMFTfC4vNmXWowjAPa54yWhtUpBAZ0xFykWl7i8yQ1xHtwHb0ZwwtykqJV34URfHpe7 ATI5MLJk+s0g4/FtFGG6FZ12Mp+ZaII+FaZiZHzW6pyGcRVNSacypg+xCxoMdeDQtbDa D6qL5aDGbAK/p3Vynv0kOp9aJOjHNoJXqeIhLmIU++b8PHH/s63RuHz0VjXRFu5mm1Cs xk2w== X-Gm-Message-State: AOJu0Yy5vBzpirf3irZ2aQYsfNO6oY5HtiHDnjCh77KXxDtkUAnpyPOY eBulNar8etAw2Y/Ohe6SGNb4H/hax4njXQtImkEQhbGfo8PLhodaOmpFYkAvxpAKQrQ0oPJKEcc A X-Gm-Gg: ASbGncs0HO8mBV32kBj7Ggq5v5RwnwZ5Eau8gdh41h7tqPssNmltgvGM2rQ0Ba+J6Ho nooljAEowp0S4FRTIwsz/uc+FNTeFk8qVfgvpXghj8ndfAVGDbd92QiiWXISy1TbIS0YiOgaLwS XuJvPxEi5YszV+2xrzihlTsyAsRaHEFiCqCTUZ9ua928KNofsUBQNpekUfJqGCqxeVF5MKsW4aS hgdpvygaq0q8Hj86MeWY3EqXY75XdubSuhe1a/mnPNuJDhVINSUAxOBKz4V7Q== X-Received: by 2002:a05:6000:1fad:b0:386:42b1:d7e4 with SMTP id ffacd0b85a97d-3878884729bmr6676477f8f.19.1734111215378; Fri, 13 Dec 2024 09:33:35 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:34 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 60/85] target/arm: Convert [US]CVTF (vector, fixed-point) scalar to decodetree Date: Fri, 13 Dec 2024 17:32:04 +0000 Message-Id: <20241213173229.3308926-61-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Remove disas_simd_scalar_shift_imm as these were the last insns decoded by that function. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-61-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 8 ++++++ target/arm/tcg/translate-a64.c | 47 ---------------------------------- 2 files changed, 8 insertions(+), 47 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 146500d9c4b..30e1834d998 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -1699,6 +1699,14 @@ FCVTAU_f 0111 1110 0.1 00001 11001 0 ..... ..... @icvt_sd @fcvt_fixed_d .... .... . 1 ...... ...... rn:5 rd:5 \ &fcvt sf=0 esz=3 shift=%fcvt_f_sh_d +SCVTF_f 0101 1111 0 ....... 111001 ..... ..... @fcvt_fixed_h +SCVTF_f 0101 1111 0 ....... 111001 ..... ..... @fcvt_fixed_s +SCVTF_f 0101 1111 0 ....... 111001 ..... ..... @fcvt_fixed_d + +UCVTF_f 0111 1111 0 ....... 111001 ..... ..... @fcvt_fixed_h +UCVTF_f 0111 1111 0 ....... 111001 ..... ..... @fcvt_fixed_s +UCVTF_f 0111 1111 0 ....... 111001 ..... ..... @fcvt_fixed_d + FCVTZS_f 0101 1111 0 ....... 111111 ..... ..... @fcvt_fixed_h FCVTZS_f 0101 1111 0 ....... 111111 ..... ..... @fcvt_fixed_s FCVTZS_f 0101 1111 0 ....... 111111 ..... ..... @fcvt_fixed_d diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 6e9d040ebfb..08f24908a45 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -9531,52 +9531,6 @@ static void handle_simd_shift_fpint_conv(DisasContext *s, bool is_scalar, gen_restore_rmode(tcg_rmode, tcg_fpstatus); } -/* AdvSIMD scalar shift by immediate - * 31 30 29 28 23 22 19 18 16 15 11 10 9 5 4 0 - * +-----+---+-------------+------+------+--------+---+------+------+ - * | 0 1 | U | 1 1 1 1 1 0 | immh | immb | opcode | 1 | Rn | Rd | - * +-----+---+-------------+------+------+--------+---+------+------+ - * - * This is the scalar version so it works on a fixed sized registers - */ -static void disas_simd_scalar_shift_imm(DisasContext *s, uint32_t insn) -{ - int rd = extract32(insn, 0, 5); - int rn = extract32(insn, 5, 5); - int opcode = extract32(insn, 11, 5); - int immb = extract32(insn, 16, 3); - int immh = extract32(insn, 19, 4); - bool is_u = extract32(insn, 29, 1); - - if (immh == 0) { - unallocated_encoding(s); - return; - } - - switch (opcode) { - case 0x1c: /* SCVTF, UCVTF */ - handle_simd_shift_intfp_conv(s, true, false, is_u, immh, immb, - opcode, rn, rd); - break; - default: - case 0x00: /* SSHR / USHR */ - case 0x02: /* SSRA / USRA */ - case 0x04: /* SRSHR / URSHR */ - case 0x06: /* SRSRA / URSRA */ - case 0x08: /* SRI */ - case 0x0a: /* SHL / SLI */ - case 0x0c: /* SQSHLU */ - case 0x0e: /* SQSHL, UQSHL */ - case 0x10: /* SQSHRUN */ - case 0x11: /* SQRSHRUN */ - case 0x12: /* SQSHRN, UQSHRN */ - case 0x13: /* SQRSHRN, UQRSHRN */ - case 0x1f: /* FCVTZS, FCVTZU */ - unallocated_encoding(s); - break; - } -} - static void handle_2misc_64(DisasContext *s, int opcode, bool u, TCGv_i64 tcg_rd, TCGv_i64 tcg_rn, TCGv_i32 tcg_rmode, TCGv_ptr tcg_fpstatus) @@ -10476,7 +10430,6 @@ static const AArch64DecodeTable data_proc_simd[] = { { 0x0e200800, 0x9f3e0c00, disas_simd_two_reg_misc }, { 0x0f000400, 0x9f800400, disas_simd_shift_imm }, { 0x5e200800, 0xdf3e0c00, disas_simd_scalar_two_reg_misc }, - { 0x5f000400, 0xdf800400, disas_simd_scalar_shift_imm }, { 0x0e780800, 0x8f7e0c00, disas_simd_two_reg_misc_fp16 }, { 0x00000000, 0x00000000, NULL } }; From patchwork Fri Dec 13 17:32:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850205 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1643407wry; Fri, 13 Dec 2024 09:45:46 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWncfmAdL4vAZyI8s+3U97n+yz8f0R7DJkQixXxx/R19sTFQzWMbDWt2igzlq+TT9r4Gcfr6Q==@linaro.org X-Google-Smtp-Source: AGHT+IFIyJJUXukqd0UOu6TdomqHG+//p5pC62TjfxWKq1yRurDtril3P9DizHOsma3pL3OmLVNL X-Received: by 2002:a17:907:9812:b0:aa6:997c:94e8 with SMTP id a640c23a62f3a-aab778f71b5mr357200366b.15.1734111946459; Fri, 13 Dec 2024 09:45:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111946; cv=none; d=google.com; s=arc-20240605; b=Old7A+NuWcSe4dLns4pGjGXMGmh52gXd0T4PZnF2uYjg5gwkFXANMPf0KtGlk/kJav 2+Zn141QM0FpZYk+FuEj5Hf092plPlGRIo3G30QFJSccpXMCY6igO85qnCN6M76QVuXz lk7n2NAh0N+p734Yn2Gz1Aky3Z9g3tWWOhSb2Gdbfdn3xrfLt7m8EVvVJs3OGD40Z9AQ HmQANKu1AU+WRgOUqibgRfNWFtdRg/O43zxryoEXaIhiuGv/bK7OG9fqkEgEJc7EQgvm XTfSMml2kcuvF0I52cx18J3EtggUq6vB01j3aZKB0bAzNNtGrpAX6w1LxfvX/+dBZXmi Qv+g== 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=S5Wm3RpvNF8IYsHZpf+XJ72p8A+XwA+4f5r+Dvitclo=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=PaJPiz2OnKgNwRZiNJ36Dcm0e5KhxQyeuHUsV1hupqKCm6i8k74nW4zeR8hcwEAdY5 tXPuq17KAEhodR5R4UIdYwGHUued0q+Ybx0r84082gpi98vFepB49OYcIclWpLrN+GWJ rU04LXHPgEWX9R4k8C5q1IzRPiq+OZfAtIu2cGwLUwlhlCHUYFWLXf9ZxjWJlDq98RpC h+PHCsJ7lpuedS9W5CHqBpATIrI5JKTnoKUw8PzN/dvbSapocnypoaIeQdzp4WNwgLFh IvQBX6rGx+0wMWs5citdg8XTaPf/URC/NfeyMp6pnDTevx3eDQQIjPqmRM68mRYaC/oO TsQw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vMQeWv9R; 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 a640c23a62f3a-aab77f5f5bfsi146615566b.669.2024.12.13.09.45.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:45:46 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vMQeWv9R; 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 1tM9ZM-0006Cn-Tv; Fri, 13 Dec 2024 12:35:19 -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 1tM9Xs-00086L-0v for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:44 -0500 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9Xl-0001hF-VG for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:42 -0500 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-385ef8b64b3so1689811f8f.0 for ; Fri, 13 Dec 2024 09:33:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111216; x=1734716016; 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=S5Wm3RpvNF8IYsHZpf+XJ72p8A+XwA+4f5r+Dvitclo=; b=vMQeWv9RM5lzj9to/AtvHw1AycCUJ1HDhie+6crPm3lW3LrLviGN/lwCx8Ea7LylRw ArY7aXM9qrOTYB9y4I2P0a+cT/jBOW5k4Qo6o9p9h/SK3b1h9ibjk3ulnkyleR/C32UA /6dSnDc0552f+YkqmeAMF3zAGCNba43PtwOq+Bufilstb+yhssgieoLiCfJtPfwFuADO LwvrJLdQe6o66eqVG5OZtiAj17boA+ztUi3oYuw0s5mq4Dg577z+OAqutOxYEpYlUiNG f7BaSIxmjajlNRHko20R5dIC4uBiFn6tZypJ1Q8Zeu/J1nrG5NZN0djz6aqeAxjO4e0E SMTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111216; x=1734716016; 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=S5Wm3RpvNF8IYsHZpf+XJ72p8A+XwA+4f5r+Dvitclo=; b=tMueYpUyHa+5Q2d6J0mwabPfdBxzdZBVG96jJcGdLVPFCabBaxu606373dAsAzs1mu k3ctuR78TSJxylOz/Quw0ROmm3Ae/87kLh+hLaLBDUmHxw+IEBLSx9yuqqHlfXodtZEt FadJvM8ZdVykKfItMr9l6GfIS6bBQ8oUXCzBBnHCZjsfzYwBQrdxvf0bsCX0l1gKU37n LF6PDBdDwa/YWFtoOCcTGc9njG0R4JHmaJoprrXqJROzriYOfB8gc0JKE5IQjFysAjU3 iYx6TZZnQWgPumAb8ZNCYST0SFC4vZU+UVjG02HwGAuc1rXGNsVxBX/1Cx0liZkOAOnc 9rqw== X-Gm-Message-State: AOJu0YwMNGjFMCRBBcI3fGMUty1fzFxZcuiMD/0evu0FtYjcXWexNVfQ bfUzegRwzr7uipDl4iDNvL+j8Ut8Wkh+Xqi16SbJVsvnuBbahJZsbA8ev8yh6ir7wOVkh4pGSnC i X-Gm-Gg: ASbGnct2BhCjY03vJNYWRKPfKGqaFtYt5KKn7TMgbIONrVVQPMvnGDhC8HqNiOYabNV RAIb9aVqbESAW39NU2444aVwfbOEe9cbeAm3mi/swGPfxEFcblzXw/aTsihhBqaODjvbzHRfjee yGoNgXRphVL0vdu2n82vYqfagKXnNjFPBIBslQIdGQUffOPYR9PKkzQGXrY3JTj8rZHwnnLqCgi 8RMvA5ylsbJBIPgbFTcHMAKp8eCUd5PC4o1iHM4Q+Lc5iSmyjwWdVqZT8KJ8Q== X-Received: by 2002:a05:6000:1a8a:b0:385:f89a:402e with SMTP id ffacd0b85a97d-3888dcd468amr2911417f8f.14.1734111216530; Fri, 13 Dec 2024 09:33:36 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:35 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 61/85] target/arm: Rename helper_gvec_vcvt_[hf][su] with _rz Date: Fri, 13 Dec 2024 17:32:05 +0000 Message-Id: <20241213173229.3308926-62-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x429.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Emphasize that these functions use round-to-zero mode. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-62-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/helper.h | 8 ++++---- target/arm/tcg/translate-neon.c | 8 ++++---- target/arm/tcg/vec_helper.c | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/target/arm/helper.h b/target/arm/helper.h index 04e422ab081..f2cfee40de3 100644 --- a/target/arm/helper.h +++ b/target/arm/helper.h @@ -650,13 +650,13 @@ DEF_HELPER_FLAGS_4(gvec_touizs, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(gvec_vcvt_sf, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(gvec_vcvt_uf, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_vcvt_fs, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_vcvt_fu, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_4(gvec_vcvt_rz_fs, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_4(gvec_vcvt_rz_fu, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(gvec_vcvt_sh, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(gvec_vcvt_uh, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_vcvt_hs, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_vcvt_hu, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_4(gvec_vcvt_rz_hs, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_4(gvec_vcvt_rz_hu, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(gvec_vcvt_rm_ss, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(gvec_vcvt_rm_us, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) diff --git a/target/arm/tcg/translate-neon.c b/target/arm/tcg/translate-neon.c index b9b3d1c1fbc..f9ca889beca 100644 --- a/target/arm/tcg/translate-neon.c +++ b/target/arm/tcg/translate-neon.c @@ -1409,13 +1409,13 @@ static bool do_fp_2sh(DisasContext *s, arg_2reg_shift *a, DO_FP_2SH(VCVT_SF, gen_helper_gvec_vcvt_sf) DO_FP_2SH(VCVT_UF, gen_helper_gvec_vcvt_uf) -DO_FP_2SH(VCVT_FS, gen_helper_gvec_vcvt_fs) -DO_FP_2SH(VCVT_FU, gen_helper_gvec_vcvt_fu) +DO_FP_2SH(VCVT_FS, gen_helper_gvec_vcvt_rz_fs) +DO_FP_2SH(VCVT_FU, gen_helper_gvec_vcvt_rz_fu) DO_FP_2SH(VCVT_SH, gen_helper_gvec_vcvt_sh) DO_FP_2SH(VCVT_UH, gen_helper_gvec_vcvt_uh) -DO_FP_2SH(VCVT_HS, gen_helper_gvec_vcvt_hs) -DO_FP_2SH(VCVT_HU, gen_helper_gvec_vcvt_hu) +DO_FP_2SH(VCVT_HS, gen_helper_gvec_vcvt_rz_hs) +DO_FP_2SH(VCVT_HU, gen_helper_gvec_vcvt_rz_hu) static bool do_1reg_imm(DisasContext *s, arg_1reg_imm *a, GVecGen2iFn *fn) diff --git a/target/arm/tcg/vec_helper.c b/target/arm/tcg/vec_helper.c index 91a9130641f..ec6b640fdad 100644 --- a/target/arm/tcg/vec_helper.c +++ b/target/arm/tcg/vec_helper.c @@ -2507,12 +2507,12 @@ DO_3OP_PAIR(gvec_uminp_s, MIN, uint32_t, H4) DO_VCVT_FIXED(gvec_vcvt_sf, helper_vfp_sltos, uint32_t) DO_VCVT_FIXED(gvec_vcvt_uf, helper_vfp_ultos, uint32_t) -DO_VCVT_FIXED(gvec_vcvt_fs, helper_vfp_tosls_round_to_zero, uint32_t) -DO_VCVT_FIXED(gvec_vcvt_fu, helper_vfp_touls_round_to_zero, uint32_t) +DO_VCVT_FIXED(gvec_vcvt_rz_fs, helper_vfp_tosls_round_to_zero, uint32_t) +DO_VCVT_FIXED(gvec_vcvt_rz_fu, helper_vfp_touls_round_to_zero, uint32_t) DO_VCVT_FIXED(gvec_vcvt_sh, helper_vfp_shtoh, uint16_t) DO_VCVT_FIXED(gvec_vcvt_uh, helper_vfp_uhtoh, uint16_t) -DO_VCVT_FIXED(gvec_vcvt_hs, helper_vfp_toshh_round_to_zero, uint16_t) -DO_VCVT_FIXED(gvec_vcvt_hu, helper_vfp_touhh_round_to_zero, uint16_t) +DO_VCVT_FIXED(gvec_vcvt_rz_hs, helper_vfp_toshh_round_to_zero, uint16_t) +DO_VCVT_FIXED(gvec_vcvt_rz_hu, helper_vfp_touhh_round_to_zero, uint16_t) #undef DO_VCVT_FIXED From patchwork Fri Dec 13 17:32:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850172 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1640505wry; Fri, 13 Dec 2024 09:39:08 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVXkRucmONSWJxXMFkSo26JhfFfhERe+EwG8flkd0TKTJr/fpKct3/PmrXJkwtg+xOUzu6Tgg==@linaro.org X-Google-Smtp-Source: AGHT+IEv6RUAMvZoUb96VFqvAAOrhn6kvwfNAkdDGaIX/qp3i2AtDNYhvBml1mVUqwJVm5kGcmpN X-Received: by 2002:a5d:47a7:0:b0:385:f2a2:50df with SMTP id ffacd0b85a97d-3888e0ae608mr2653520f8f.27.1734111547853; Fri, 13 Dec 2024 09:39:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111547; cv=none; d=google.com; s=arc-20240605; b=CUz+GAtFhqjeH+g76tiG6KKPX4lKll3PR788K1xVdGmQf0H6szxhYYoveNwHEE8dYZ lJgo6mkXsXV3hzLBjk2o4DZmnQcmFg06GLhwWMIlWNXnjddLre3NeMPrt5kzNYDO473k y98jsZ68dK0/zQ+DHG93zry36L2a6w28jAIRD/2ZXDfNpor5DK3G7CS6yMqxBgUFCRrK +7OdFR0zqqBldLVH1IIqcKvhwuybihz8d9AZNeEOlEZiskECk0pkDJv5723YbBqARnDR Cpd/o/+Mq02zagrQMIdFYe7jkQCSRJoHDeIFp6REZ1siqNYYJsbCo9dJsOZXai9Ymhn9 3r6A== 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=C+lmDUrMmLnFsjhqtBw6sFu4LOTBJyJP/pfhA57qrQQ=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=UfmaL8mTnHslWE72UCsVMl61mN+HRNUNrcOhD2BFBRkAR7I+iryWzTCTTlIE7sm4x5 uVfyuiuJAn8hrTRGT/L3l3CW/5KzDJhzT7syle4itLVoVLEEzSz3h1Su7HRWvrZtU84L iPPYyc09xAZHAn9oEyPpTqhot1Q3JDK2LVBIzg7T/Q3j04KvEMHSqsoM4Kcd9peR4tVk NoC9Rd+8acimUqWJZ1AUO1WEANNkZ/71eloxgyj+hx/7B5wKArGwmRFwWkX1BI095SZo Gxa0wTGI3He0/dV4GjgbyHjXfrn3J/YEKzWNUeaGgzKPgmY0lG9hJw/0J4+YBCMOAnF7 tOsA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wNXV3oSR; 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 ffacd0b85a97d-388c80616ecsi35084f8f.482.2024.12.13.09.39.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:39: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=wNXV3oSR; 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 1tM9Yb-0003M5-5p; Fri, 13 Dec 2024 12:34:29 -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 1tM9Xw-0008Bb-HM for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:49 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9Xp-0001hd-Le for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:48 -0500 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-4361e89b6daso14314015e9.3 for ; Fri, 13 Dec 2024 09:33:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111217; x=1734716017; 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=C+lmDUrMmLnFsjhqtBw6sFu4LOTBJyJP/pfhA57qrQQ=; b=wNXV3oSRFaJeVDOb1rQVlHyXYP0+jtMr6lZHjQ2Kcmto3zgrxYmAcGbqXP6GEyNN06 jUJoYfxLbCEhh4WWHex5L1pm21p3MTVWfu+1VxAZS/F/iBd23ByY1yPMji6WRhPlVpPR qxanWJZpp3uPfEbrOtIUr+T3epoCI7yWpUXjATUKc2jGz8Fvy0RjlatzRjVjAsNxgCJe 1WjhmBT8+3iRf2jnQSlpwfr5jqNYCoFfpw9lSpD/cfwxRG/jJhqdkwP4B/sDdbTZtMZF Mt9+1ZEfV4BcxMnTW8uMFn3/pi+5e1B0rJK0tdeKPYc0r3PMMVktcAH73YAAY3kEMRRY 6nsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111217; x=1734716017; 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=C+lmDUrMmLnFsjhqtBw6sFu4LOTBJyJP/pfhA57qrQQ=; b=gk2C1y+3+H9a/Rk5jStRn+Tpgd++FXshjagwGnBXZoQSdahXNKNrEggcrWrDd9REVE DIN+GdX9tuy6/rj0Lr65eSMQmPsPU5BfuT0fQCz+FzOmUoD+JPpKPteVR9GBpdd7hI6M mBDMUj0roJmmkvbk9C8SH00/Rrf1T8GL4OFIW2LIZ2nNxHBH4K7nZvqvSXq2GKpooQjP xjhXwtQuMATiN7eiZT3swNKL2rXpA7Wg7sWBf8fNDiisDlPSPdsCfhS3PTsEeJiNX9Y8 Q4zrw5p+VC4zsDgSzkuLwOhRSkjC7MwiOzfUiqcCfPUxfkJtIAwOa8RqBhLnpfDn50a8 v+Tg== X-Gm-Message-State: AOJu0YzHKFndUaGuK0PysUqLR1w6abZ03RKr56121FLYNWMi3SMJkGAZ WbM1HatVrtj2mE3aclrlLxsdmOWmYRVzdvcgnMpbBaxk5hJJl53ltU+mzgus2S5q1NHlb/PrxHm X X-Gm-Gg: ASbGnctOWWPfTNQ9c8XqAz5krr0IDc6NrbC2VpNRsaFa/4Mmcxj7kPXE0paoh0jN7Tp rVw8kNEvZqYxzALelrGCkz6Mb/cqI86gv4yQEj+sAx8jyQnSWpF32lyeMsVnNnuH/W33IG7SO0k GaejFZq6h+OcMTw7KoQ2tnSTzHVeGOAcCm2+TG68m4x/sbTRM/540+6wj8Rep9BLZJUTEY7JkVm eLm9BdqXhj1lAGXG1xjYy1pScWUtBPsoC9XN7Au/yz16STH01dktmfPxa9DLg== X-Received: by 2002:a05:6000:1f82:b0:385:ed16:cac with SMTP id ffacd0b85a97d-3889ad33ff4mr2292426f8f.56.1734111217564; Fri, 13 Dec 2024 09:33:37 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:36 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 62/85] target/arm: Convert [US]CVTF (vector) to decodetree Date: Fri, 13 Dec 2024 17:32:06 +0000 Message-Id: <20241213173229.3308926-63-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32b.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: Richard Henderson Remove handle_simd_intfp_conv and handle_simd_shift_intfp_conv as these were the last insns decoded by those functions. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-63-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/helper.h | 3 + target/arm/tcg/a64.decode | 22 ++++ target/arm/tcg/translate-a64.c | 201 ++++++--------------------------- target/arm/tcg/vec_helper.c | 7 +- 4 files changed, 66 insertions(+), 167 deletions(-) diff --git a/target/arm/helper.h b/target/arm/helper.h index f2cfee40de3..b227ac54d92 100644 --- a/target/arm/helper.h +++ b/target/arm/helper.h @@ -658,6 +658,9 @@ DEF_HELPER_FLAGS_4(gvec_vcvt_uh, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(gvec_vcvt_rz_hs, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(gvec_vcvt_rz_hu, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_4(gvec_vcvt_sd, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_4(gvec_vcvt_ud, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) + DEF_HELPER_FLAGS_4(gvec_vcvt_rm_ss, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(gvec_vcvt_rm_us, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(gvec_vcvt_rm_sh, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 30e1834d998..4f832e7a4c6 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -1786,3 +1786,25 @@ FRINT32Z_v 0.00 1110 0.1 00001 11101 0 ..... ..... @qrr_sd FRINT32X_v 0.10 1110 0.1 00001 11101 0 ..... ..... @qrr_sd FRINT64Z_v 0.00 1110 0.1 00001 11111 0 ..... ..... @qrr_sd FRINT64X_v 0.10 1110 0.1 00001 11111 0 ..... ..... @qrr_sd + +SCVTF_vi 0.00 1110 011 11001 11011 0 ..... ..... @qrr_h +SCVTF_vi 0.00 1110 0.1 00001 11011 0 ..... ..... @qrr_sd + +UCVTF_vi 0.10 1110 011 11001 11011 0 ..... ..... @qrr_h +UCVTF_vi 0.10 1110 0.1 00001 11011 0 ..... ..... @qrr_sd + +&fcvt_q rd rn esz q shift +@fcvtq_h . q:1 . ...... 001 .... ...... rn:5 rd:5 \ + &fcvt_q esz=1 shift=%fcvt_f_sh_h +@fcvtq_s . q:1 . ...... 01 ..... ...... rn:5 rd:5 \ + &fcvt_q esz=2 shift=%fcvt_f_sh_s +@fcvtq_d . q:1 . ...... 1 ...... ...... rn:5 rd:5 \ + &fcvt_q esz=3 shift=%fcvt_f_sh_d + +SCVTF_vf 0.00 11110 ....... 111001 ..... ..... @fcvtq_h +SCVTF_vf 0.00 11110 ....... 111001 ..... ..... @fcvtq_s +SCVTF_vf 0.00 11110 ....... 111001 ..... ..... @fcvtq_d + +UCVTF_vf 0.10 11110 ....... 111001 ..... ..... @fcvtq_h +UCVTF_vf 0.10 11110 ....... 111001 ..... ..... @fcvtq_s +UCVTF_vf 0.10 11110 ....... 111001 ..... ..... @fcvtq_d diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 08f24908a45..0f94fa4fdcb 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -9293,141 +9293,44 @@ TRANS_FEAT(FRINT64Z_v, aa64_frint, do_fp1_vector, a, &f_scalar_frint64, FPROUNDING_ZERO) TRANS_FEAT(FRINT64X_v, aa64_frint, do_fp1_vector, a, &f_scalar_frint64, -1) -/* Common vector code for handling integer to FP conversion */ -static void handle_simd_intfp_conv(DisasContext *s, int rd, int rn, - int elements, int is_signed, - int fracbits, int size) +static bool do_gvec_op2_fpst(DisasContext *s, MemOp esz, bool is_q, + int rd, int rn, int data, + gen_helper_gvec_2_ptr * const fns[3]) { - TCGv_ptr tcg_fpst = fpstatus_ptr(size == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); - TCGv_i32 tcg_shift = NULL; + int check = fp_access_check_vector_hsd(s, is_q, esz); + TCGv_ptr fpst; - MemOp mop = size | (is_signed ? MO_SIGN : 0); - int pass; - - if (fracbits || size == MO_64) { - tcg_shift = tcg_constant_i32(fracbits); + if (check <= 0) { + return check == 0; } - if (size == MO_64) { - TCGv_i64 tcg_int64 = tcg_temp_new_i64(); - TCGv_i64 tcg_double = tcg_temp_new_i64(); - - for (pass = 0; pass < elements; pass++) { - read_vec_element(s, tcg_int64, rn, pass, mop); - - if (is_signed) { - gen_helper_vfp_sqtod(tcg_double, tcg_int64, - tcg_shift, tcg_fpst); - } else { - gen_helper_vfp_uqtod(tcg_double, tcg_int64, - tcg_shift, tcg_fpst); - } - if (elements == 1) { - write_fp_dreg(s, rd, tcg_double); - } else { - write_vec_element(s, tcg_double, rd, pass, MO_64); - } - } - } else { - TCGv_i32 tcg_int32 = tcg_temp_new_i32(); - TCGv_i32 tcg_float = tcg_temp_new_i32(); - - for (pass = 0; pass < elements; pass++) { - read_vec_element_i32(s, tcg_int32, rn, pass, mop); - - switch (size) { - case MO_32: - if (fracbits) { - if (is_signed) { - gen_helper_vfp_sltos(tcg_float, tcg_int32, - tcg_shift, tcg_fpst); - } else { - gen_helper_vfp_ultos(tcg_float, tcg_int32, - tcg_shift, tcg_fpst); - } - } else { - if (is_signed) { - gen_helper_vfp_sitos(tcg_float, tcg_int32, tcg_fpst); - } else { - gen_helper_vfp_uitos(tcg_float, tcg_int32, tcg_fpst); - } - } - break; - case MO_16: - if (fracbits) { - if (is_signed) { - gen_helper_vfp_sltoh(tcg_float, tcg_int32, - tcg_shift, tcg_fpst); - } else { - gen_helper_vfp_ultoh(tcg_float, tcg_int32, - tcg_shift, tcg_fpst); - } - } else { - if (is_signed) { - gen_helper_vfp_sitoh(tcg_float, tcg_int32, tcg_fpst); - } else { - gen_helper_vfp_uitoh(tcg_float, tcg_int32, tcg_fpst); - } - } - break; - default: - g_assert_not_reached(); - } - - if (elements == 1) { - write_fp_sreg(s, rd, tcg_float); - } else { - write_vec_element_i32(s, tcg_float, rd, pass, size); - } - } - } - - clear_vec_high(s, elements << size == 16, rd); + fpst = fpstatus_ptr(esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); + tcg_gen_gvec_2_ptr(vec_full_reg_offset(s, rd), + vec_full_reg_offset(s, rn), fpst, + is_q ? 16 : 8, vec_full_reg_size(s), + data, fns[esz - 1]); + return true; } -/* UCVTF/SCVTF - Integer to FP conversion */ -static void handle_simd_shift_intfp_conv(DisasContext *s, bool is_scalar, - bool is_q, bool is_u, - int immh, int immb, int opcode, - int rn, int rd) -{ - int size, elements, fracbits; - int immhb = immh << 3 | immb; +static gen_helper_gvec_2_ptr * const f_scvtf_v[] = { + gen_helper_gvec_vcvt_sh, + gen_helper_gvec_vcvt_sf, + gen_helper_gvec_vcvt_sd, +}; +TRANS(SCVTF_vi, do_gvec_op2_fpst, + a->esz, a->q, a->rd, a->rn, 0, f_scvtf_v) +TRANS(SCVTF_vf, do_gvec_op2_fpst, + a->esz, a->q, a->rd, a->rn, a->shift, f_scvtf_v) - if (immh & 8) { - size = MO_64; - if (!is_scalar && !is_q) { - unallocated_encoding(s); - return; - } - } else if (immh & 4) { - size = MO_32; - } else if (immh & 2) { - size = MO_16; - if (!dc_isar_feature(aa64_fp16, s)) { - unallocated_encoding(s); - return; - } - } else { - /* immh == 0 would be a failure of the decode logic */ - g_assert(immh == 1); - unallocated_encoding(s); - return; - } - - if (is_scalar) { - elements = 1; - } else { - elements = (8 << is_q) >> size; - } - fracbits = (16 << size) - immhb; - - if (!fp_access_check(s)) { - return; - } - - handle_simd_intfp_conv(s, rd, rn, elements, !is_u, fracbits, size); -} +static gen_helper_gvec_2_ptr * const f_ucvtf_v[] = { + gen_helper_gvec_vcvt_uh, + gen_helper_gvec_vcvt_uf, + gen_helper_gvec_vcvt_ud, +}; +TRANS(UCVTF_vi, do_gvec_op2_fpst, + a->esz, a->q, a->rd, a->rn, 0, f_ucvtf_v) +TRANS(UCVTF_vf, do_gvec_op2_fpst, + a->esz, a->q, a->rd, a->rn, a->shift, f_ucvtf_v) /* FCVTZS, FVCVTZU - FP to fixedpoint conversion */ static void handle_simd_shift_fpint_conv(DisasContext *s, bool is_scalar, @@ -9878,10 +9781,6 @@ static void disas_simd_shift_imm(DisasContext *s, uint32_t insn) } switch (opcode) { - case 0x1c: /* SCVTF / UCVTF */ - handle_simd_shift_intfp_conv(s, false, is_q, is_u, immh, immb, - opcode, rn, rd); - break; case 0x1f: /* FCVTZS/ FCVTZU */ handle_simd_shift_fpint_conv(s, false, is_q, is_u, immh, immb, rn, rd); return; @@ -9899,6 +9798,7 @@ static void disas_simd_shift_imm(DisasContext *s, uint32_t insn) case 0x12: /* SQSHRN / UQSHRN */ case 0x13: /* SQRSHRN / UQRSHRN */ case 0x14: /* SSHLL / USHLL */ + case 0x1c: /* SCVTF / UCVTF */ unallocated_encoding(s); return; } @@ -9978,21 +9878,6 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) opcode |= (extract32(size, 1, 1) << 5) | (u << 6); size = is_double ? 3 : 2; switch (opcode) { - case 0x1d: /* SCVTF */ - case 0x5d: /* UCVTF */ - { - bool is_signed = (opcode == 0x1d) ? true : false; - int elements = is_double ? 2 : is_q ? 4 : 2; - if (is_double && !is_q) { - unallocated_encoding(s); - return; - } - if (!fp_access_check(s)) { - return; - } - handle_simd_intfp_conv(s, rd, rn, elements, is_signed, 0, size); - return; - } case 0x2c: /* FCMGT (zero) */ case 0x2d: /* FCMEQ (zero) */ case 0x2e: /* FCMLT (zero) */ @@ -10075,6 +9960,8 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) case 0x1f: /* FRINT64Z */ case 0x5e: /* FRINT32X */ case 0x5f: /* FRINT64X */ + case 0x1d: /* SCVTF */ + case 0x5d: /* UCVTF */ unallocated_encoding(s); return; } @@ -10240,24 +10127,6 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn) fpop = deposit32(fpop, 6, 1, u); switch (fpop) { - case 0x1d: /* SCVTF */ - case 0x5d: /* UCVTF */ - { - int elements; - - if (is_scalar) { - elements = 1; - } else { - elements = (is_q ? 8 : 4); - } - - if (!fp_access_check(s)) { - return; - } - handle_simd_intfp_conv(s, rd, rn, elements, !u, 0, MO_16); - return; - } - break; case 0x2c: /* FCMGT (zero) */ case 0x2d: /* FCMEQ (zero) */ case 0x2e: /* FCMLT (zero) */ @@ -10311,6 +10180,8 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn) case 0x58: /* FRINTA */ case 0x59: /* FRINTX */ case 0x79: /* FRINTI */ + case 0x1d: /* SCVTF */ + case 0x5d: /* UCVTF */ unallocated_encoding(s); return; } diff --git a/target/arm/tcg/vec_helper.c b/target/arm/tcg/vec_helper.c index ec6b640fdad..07f8d5f467a 100644 --- a/target/arm/tcg/vec_helper.c +++ b/target/arm/tcg/vec_helper.c @@ -2505,12 +2505,15 @@ DO_3OP_PAIR(gvec_uminp_s, MIN, uint32_t, H4) clear_tail(d, oprsz, simd_maxsz(desc)); \ } +DO_VCVT_FIXED(gvec_vcvt_sd, helper_vfp_sqtod, uint64_t) +DO_VCVT_FIXED(gvec_vcvt_ud, helper_vfp_uqtod, uint64_t) DO_VCVT_FIXED(gvec_vcvt_sf, helper_vfp_sltos, uint32_t) DO_VCVT_FIXED(gvec_vcvt_uf, helper_vfp_ultos, uint32_t) -DO_VCVT_FIXED(gvec_vcvt_rz_fs, helper_vfp_tosls_round_to_zero, uint32_t) -DO_VCVT_FIXED(gvec_vcvt_rz_fu, helper_vfp_touls_round_to_zero, uint32_t) DO_VCVT_FIXED(gvec_vcvt_sh, helper_vfp_shtoh, uint16_t) DO_VCVT_FIXED(gvec_vcvt_uh, helper_vfp_uhtoh, uint16_t) + +DO_VCVT_FIXED(gvec_vcvt_rz_fs, helper_vfp_tosls_round_to_zero, uint32_t) +DO_VCVT_FIXED(gvec_vcvt_rz_fu, helper_vfp_touls_round_to_zero, uint32_t) DO_VCVT_FIXED(gvec_vcvt_rz_hs, helper_vfp_toshh_round_to_zero, uint16_t) DO_VCVT_FIXED(gvec_vcvt_rz_hu, helper_vfp_touhh_round_to_zero, uint16_t) From patchwork Fri Dec 13 17:32:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850207 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1643416wry; Fri, 13 Dec 2024 09:45:47 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVSvxvTwLIGgouPU58M4gT0qs01XZ9hV2gAEFGQeihDeXWwkGytlsoxrwCVzNcgonNFX2NBSw==@linaro.org X-Google-Smtp-Source: AGHT+IGuQlZ0dwkI169LPZORGBq0Q9zeMN3Y5y2NazZsA3cZlraGet5JA4fRSHygk+Wx9o+L4v32 X-Received: by 2002:a5d:5986:0:b0:385:dea3:6059 with SMTP id ffacd0b85a97d-3889ad32e66mr2967197f8f.49.1734111947216; Fri, 13 Dec 2024 09:45:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111947; cv=none; d=google.com; s=arc-20240605; b=Xnjn1gTXu6pHl0qXmpAJ7APwNwn0Q3iu9+a5tNX5WiEegi8kgeul3GBXAc3Vj73BbK rKAAr9llhVTllpses7+w2sj/o3wB4+R+qkUmW3MHHBr3pNB7xg3pyeLoHqEa/80eZ54r gRylsNq+4mbZEaQftZ5dlbcbLofkCtJF3WereEk1VV0jEszInKwZKgi6/9tsxpA5tbfu 8Zjg9XCIiVrCPOafwuxbADDr3TOn5UXcOrbkw141kxU7tk0ekW+dAFrVCu5YQzlw24qj GWoiRSRfy7TTNE95TSot3MQ/Qzo7T7Bbecauof2e0UXu8eQcTkgiYt/68BuZD80aneQE Tn0Q== 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=DrOb7G+x5wrICqjleH3Ihe/BQVYZk17MYJ5JNKUJIEk=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=f7AlcQ4vlbGodWMhtkWHX2Qw8S0Z2S0TJqxssI30GDp6yrurs3b/QfQC2HtENoXmlS FyG0dzbYLe0+JsQq3ZTl4APC3zzZoidHGxTVACBstksbKZwHuCl19DKEtHY4mkEsiPIK ZG7FG8OXFlowjzqwa0rlZy6WR42AZ30DjHA2lr3JFPbrQLsNBV8vHet0p/hYn8oN7q6o gI3PC3vcAaVyHQ9zVa2jl2+5HHEncOHWDmmMOWoXB1b8sZ2xujmRRYtYAW+89A3nWcpB I2HFVU61fdhfj5xgHS4X6slB28g+HbcI3RsekWGhLN8T1QVIC7Ba8Lrne7k8DzKbBKEz t7KA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=A5M3UJnD; 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 ffacd0b85a97d-388c80627ebsi41436f8f.540.2024.12.13.09.45.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:45: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=A5M3UJnD; 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 1tM9ZZ-0006eg-2y; Fri, 13 Dec 2024 12:35:30 -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 1tM9Xs-00086M-1W for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:45 -0500 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9Xo-0001hk-FY for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:43 -0500 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-3862f32a33eso985716f8f.3 for ; Fri, 13 Dec 2024 09:33:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111219; x=1734716019; 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=DrOb7G+x5wrICqjleH3Ihe/BQVYZk17MYJ5JNKUJIEk=; b=A5M3UJnDAEFSZgfBIoYae3NreSTkqM6sjITVgkT+VRuhCrcJjUf5HdahUy3j3IUHU3 1FgZkjqEgo+dGNB1uELaO8WFRQoybP1adVh9h3M4BObhSwxdGYaobNS26DyiwszpAYO5 KtHV0nOqU8ZsX4Qc5H5I1uq4dKIFSNiAOI1M5DlkdDSj+DPEJdCE3D45XjpxipxOgKo5 ZzHn/ATl8b+3WXgfXv2Xyd9+rSex0Szx+YC2niN0RJ79fL3WbylYR+TLVNkYAQZmNVjR ZU7VA0Lx15MQz65G30amm596YZkvPP9syCEe94BIMYt1Hih+lxUmQwHbJDLdCimp2YYz 2cGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111219; x=1734716019; 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=DrOb7G+x5wrICqjleH3Ihe/BQVYZk17MYJ5JNKUJIEk=; b=d2uKVGMco6dofdMFD6YgJLTpxtbD/Y10VqmDXQdqw6oEwh+t7uVrnPYNQF57Jb9rot LDlB0nqwVaMFNJ+QSo2SmDoN13ZS/o/IKelvsKF4ZkMrbx8k/ZoDQmWR48gfba2kje8k mL49XVFa2bnH8KZJRzjvRgOG7OrzG9/53PczJTc7LxbPHVgV5uBvM0Ms2iQmz6IRp3hI VF50EGjgRzCbV9lGadPBaTIjp37Qfg65uf+zbSs26/UisAjl5mmyqRkakWpokQ7/rVwa y0pr1uyO1xQ+R241Xax/DfREBmr73TLGYp/OHNvy4FId6eGd89cBnlfD8GrBMzu7K3BI OKkQ== X-Gm-Message-State: AOJu0Yz4eC3AnNA183lPfJbizYELQcAG4KmjcZsIfGahDvtUBUlw3NR+ XKxa5vwKLO5M7swlHaCmTgbv8JUPMft2qbQYUKpbu4If2/JO17/ERMCJX2xeJOZ5gR+0btFpSFj C X-Gm-Gg: ASbGncsakfmctOJ6SX40p4vgXPYOV64u8C9hJZLKY2yu6htSfZuR4hC2yisxqQLor0f Yf4V9CaUahDM1WWmh5M5vze/wF2BrNTUgpNpcu4+0bZYqU/4kvRJSVg0E51EATuXghvomXxjScu 7xVlBgc7l/VkWjh1Shhky2wvjTfxB5KiBEOhrs9DDtrk1V3QqLCP09+QDSW8yulwV9dfIgkrLQj DMUSrGigV1n7QIL3NYnhAuw+NB7HzeuG8jSeh3g6yUK9zHnnH/eJmdgXjRT1g== X-Received: by 2002:a5d:47a7:0:b0:385:f2a2:50df with SMTP id ffacd0b85a97d-3888e0ae608mr2642917f8f.27.1734111218709; Fri, 13 Dec 2024 09:33:38 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:37 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 63/85] target/arm: Convert FCVTZ[SU] (vector, fixed-point) to decodetree Date: Fri, 13 Dec 2024 17:32:07 +0000 Message-Id: <20241213173229.3308926-64-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x429.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Remove handle_simd_shift_fpint_conv and disas_simd_shift_imm as these were the last insns decoded by those functions. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-64-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/helper.h | 4 + target/arm/tcg/a64.decode | 8 ++ target/arm/tcg/translate-a64.c | 160 +++------------------------------ target/arm/tcg/vec_helper.c | 2 + target/arm/vfp_helper.c | 4 + 5 files changed, 32 insertions(+), 146 deletions(-) diff --git a/target/arm/helper.h b/target/arm/helper.h index b227ac54d92..0c8a56c3ae4 100644 --- a/target/arm/helper.h +++ b/target/arm/helper.h @@ -178,8 +178,10 @@ DEF_HELPER_3(vfp_touhs_round_to_zero, i32, f32, i32, ptr) DEF_HELPER_3(vfp_touls_round_to_zero, i32, f32, i32, ptr) DEF_HELPER_3(vfp_toshd_round_to_zero, i64, f64, i32, ptr) DEF_HELPER_3(vfp_tosld_round_to_zero, i64, f64, i32, ptr) +DEF_HELPER_3(vfp_tosqd_round_to_zero, i64, f64, i32, ptr) DEF_HELPER_3(vfp_touhd_round_to_zero, i64, f64, i32, ptr) DEF_HELPER_3(vfp_tould_round_to_zero, i64, f64, i32, ptr) +DEF_HELPER_3(vfp_touqd_round_to_zero, i64, f64, i32, ptr) DEF_HELPER_3(vfp_touhh, i32, f16, i32, ptr) DEF_HELPER_3(vfp_toshh, i32, f16, i32, ptr) DEF_HELPER_3(vfp_toulh, i32, f16, i32, ptr) @@ -660,6 +662,8 @@ DEF_HELPER_FLAGS_4(gvec_vcvt_rz_hu, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(gvec_vcvt_sd, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(gvec_vcvt_ud, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_4(gvec_vcvt_rz_ds, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_4(gvec_vcvt_rz_du, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(gvec_vcvt_rm_ss, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(gvec_vcvt_rm_us, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 4f832e7a4c6..61d519b96a5 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -1808,3 +1808,11 @@ SCVTF_vf 0.00 11110 ....... 111001 ..... ..... @fcvtq_d UCVTF_vf 0.10 11110 ....... 111001 ..... ..... @fcvtq_h UCVTF_vf 0.10 11110 ....... 111001 ..... ..... @fcvtq_s UCVTF_vf 0.10 11110 ....... 111001 ..... ..... @fcvtq_d + +FCVTZS_vf 0.00 11110 ....... 111111 ..... ..... @fcvtq_h +FCVTZS_vf 0.00 11110 ....... 111111 ..... ..... @fcvtq_s +FCVTZS_vf 0.00 11110 ....... 111111 ..... ..... @fcvtq_d + +FCVTZU_vf 0.10 11110 ....... 111111 ..... ..... @fcvtq_h +FCVTZU_vf 0.10 11110 ....... 111111 ..... ..... @fcvtq_s +FCVTZU_vf 0.10 11110 ....... 111111 ..... ..... @fcvtq_d diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 0f94fa4fdcb..1c4e53770ba 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -9332,107 +9332,21 @@ TRANS(UCVTF_vi, do_gvec_op2_fpst, TRANS(UCVTF_vf, do_gvec_op2_fpst, a->esz, a->q, a->rd, a->rn, a->shift, f_ucvtf_v) -/* FCVTZS, FVCVTZU - FP to fixedpoint conversion */ -static void handle_simd_shift_fpint_conv(DisasContext *s, bool is_scalar, - bool is_q, bool is_u, - int immh, int immb, int rn, int rd) -{ - int immhb = immh << 3 | immb; - int pass, size, fracbits; - TCGv_ptr tcg_fpstatus; - TCGv_i32 tcg_rmode, tcg_shift; +static gen_helper_gvec_2_ptr * const f_fcvtzs_vf[] = { + gen_helper_gvec_vcvt_rz_hs, + gen_helper_gvec_vcvt_rz_fs, + gen_helper_gvec_vcvt_rz_ds, +}; +TRANS(FCVTZS_vf, do_gvec_op2_fpst, + a->esz, a->q, a->rd, a->rn, a->shift, f_fcvtzs_vf) - if (immh & 0x8) { - size = MO_64; - if (!is_scalar && !is_q) { - unallocated_encoding(s); - return; - } - } else if (immh & 0x4) { - size = MO_32; - } else if (immh & 0x2) { - size = MO_16; - if (!dc_isar_feature(aa64_fp16, s)) { - unallocated_encoding(s); - return; - } - } else { - /* Should have split out AdvSIMD modified immediate earlier. */ - assert(immh == 1); - unallocated_encoding(s); - return; - } - - if (!fp_access_check(s)) { - return; - } - - assert(!(is_scalar && is_q)); - - tcg_fpstatus = fpstatus_ptr(size == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); - tcg_rmode = gen_set_rmode(FPROUNDING_ZERO, tcg_fpstatus); - fracbits = (16 << size) - immhb; - tcg_shift = tcg_constant_i32(fracbits); - - if (size == MO_64) { - int maxpass = is_scalar ? 1 : 2; - - for (pass = 0; pass < maxpass; pass++) { - TCGv_i64 tcg_op = tcg_temp_new_i64(); - - read_vec_element(s, tcg_op, rn, pass, MO_64); - if (is_u) { - gen_helper_vfp_touqd(tcg_op, tcg_op, tcg_shift, tcg_fpstatus); - } else { - gen_helper_vfp_tosqd(tcg_op, tcg_op, tcg_shift, tcg_fpstatus); - } - write_vec_element(s, tcg_op, rd, pass, MO_64); - } - clear_vec_high(s, is_q, rd); - } else { - void (*fn)(TCGv_i32, TCGv_i32, TCGv_i32, TCGv_ptr); - int maxpass = is_scalar ? 1 : ((8 << is_q) >> size); - - switch (size) { - case MO_16: - if (is_u) { - fn = gen_helper_vfp_touhh; - } else { - fn = gen_helper_vfp_toshh; - } - break; - case MO_32: - if (is_u) { - fn = gen_helper_vfp_touls; - } else { - fn = gen_helper_vfp_tosls; - } - break; - default: - g_assert_not_reached(); - } - - for (pass = 0; pass < maxpass; pass++) { - TCGv_i32 tcg_op = tcg_temp_new_i32(); - - read_vec_element_i32(s, tcg_op, rn, pass, size); - fn(tcg_op, tcg_op, tcg_shift, tcg_fpstatus); - if (is_scalar) { - if (size == MO_16 && !is_u) { - tcg_gen_ext16u_i32(tcg_op, tcg_op); - } - write_fp_sreg(s, rd, tcg_op); - } else { - write_vec_element_i32(s, tcg_op, rd, pass, size); - } - } - if (!is_scalar) { - clear_vec_high(s, is_q, rd); - } - } - - gen_restore_rmode(tcg_rmode, tcg_fpstatus); -} +static gen_helper_gvec_2_ptr * const f_fcvtzu_vf[] = { + gen_helper_gvec_vcvt_rz_hu, + gen_helper_gvec_vcvt_rz_fu, + gen_helper_gvec_vcvt_rz_du, +}; +TRANS(FCVTZU_vf, do_gvec_op2_fpst, + a->esz, a->q, a->rd, a->rn, a->shift, f_fcvtzu_vf) static void handle_2misc_64(DisasContext *s, int opcode, bool u, TCGv_i64 tcg_rd, TCGv_i64 tcg_rn, @@ -9759,51 +9673,6 @@ static void disas_simd_scalar_two_reg_misc(DisasContext *s, uint32_t insn) g_assert_not_reached(); } -/* AdvSIMD shift by immediate - * 31 30 29 28 23 22 19 18 16 15 11 10 9 5 4 0 - * +---+---+---+-------------+------+------+--------+---+------+------+ - * | 0 | Q | U | 0 1 1 1 1 0 | immh | immb | opcode | 1 | Rn | Rd | - * +---+---+---+-------------+------+------+--------+---+------+------+ - */ -static void disas_simd_shift_imm(DisasContext *s, uint32_t insn) -{ - int rd = extract32(insn, 0, 5); - int rn = extract32(insn, 5, 5); - int opcode = extract32(insn, 11, 5); - int immb = extract32(insn, 16, 3); - int immh = extract32(insn, 19, 4); - bool is_u = extract32(insn, 29, 1); - bool is_q = extract32(insn, 30, 1); - - if (immh == 0) { - unallocated_encoding(s); - return; - } - - switch (opcode) { - case 0x1f: /* FCVTZS/ FCVTZU */ - handle_simd_shift_fpint_conv(s, false, is_q, is_u, immh, immb, rn, rd); - return; - default: - case 0x00: /* SSHR / USHR */ - case 0x02: /* SSRA / USRA (accumulate) */ - case 0x04: /* SRSHR / URSHR (rounding) */ - case 0x06: /* SRSRA / URSRA (accum + rounding) */ - case 0x08: /* SRI */ - case 0x0a: /* SHL / SLI */ - case 0x0c: /* SQSHLU */ - case 0x0e: /* SQSHL, UQSHL */ - case 0x10: /* SHRN / SQSHRUN */ - case 0x11: /* RSHRN / SQRSHRUN */ - case 0x12: /* SQSHRN / UQSHRN */ - case 0x13: /* SQRSHRN / UQRSHRN */ - case 0x14: /* SSHLL / USHLL */ - case 0x1c: /* SCVTF / UCVTF */ - unallocated_encoding(s); - return; - } -} - static void handle_2misc_widening(DisasContext *s, int opcode, bool is_q, int size, int rn, int rd) { @@ -10299,7 +10168,6 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn) static const AArch64DecodeTable data_proc_simd[] = { /* pattern , mask , fn */ { 0x0e200800, 0x9f3e0c00, disas_simd_two_reg_misc }, - { 0x0f000400, 0x9f800400, disas_simd_shift_imm }, { 0x5e200800, 0xdf3e0c00, disas_simd_scalar_two_reg_misc }, { 0x0e780800, 0x8f7e0c00, disas_simd_two_reg_misc_fp16 }, { 0x00000000, 0x00000000, NULL } diff --git a/target/arm/tcg/vec_helper.c b/target/arm/tcg/vec_helper.c index 07f8d5f467a..b5ab8d1e15f 100644 --- a/target/arm/tcg/vec_helper.c +++ b/target/arm/tcg/vec_helper.c @@ -2512,6 +2512,8 @@ DO_VCVT_FIXED(gvec_vcvt_uf, helper_vfp_ultos, uint32_t) DO_VCVT_FIXED(gvec_vcvt_sh, helper_vfp_shtoh, uint16_t) DO_VCVT_FIXED(gvec_vcvt_uh, helper_vfp_uhtoh, uint16_t) +DO_VCVT_FIXED(gvec_vcvt_rz_ds, helper_vfp_tosqd_round_to_zero, uint64_t) +DO_VCVT_FIXED(gvec_vcvt_rz_du, helper_vfp_touqd_round_to_zero, uint64_t) DO_VCVT_FIXED(gvec_vcvt_rz_fs, helper_vfp_tosls_round_to_zero, uint32_t) DO_VCVT_FIXED(gvec_vcvt_rz_fu, helper_vfp_touls_round_to_zero, uint32_t) DO_VCVT_FIXED(gvec_vcvt_rz_hs, helper_vfp_toshh_round_to_zero, uint16_t) diff --git a/target/arm/vfp_helper.c b/target/arm/vfp_helper.c index f24992c798a..5a19af509c3 100644 --- a/target/arm/vfp_helper.c +++ b/target/arm/vfp_helper.c @@ -495,6 +495,10 @@ VFP_CONV_FIX_A64(sq, h, 16, dh_ctype_f16, 64, int64) VFP_CONV_FIX(uh, h, 16, dh_ctype_f16, 32, uint16) VFP_CONV_FIX(ul, h, 16, dh_ctype_f16, 32, uint32) VFP_CONV_FIX_A64(uq, h, 16, dh_ctype_f16, 64, uint64) +VFP_CONV_FLOAT_FIX_ROUND(sq, d, 64, float64, 64, int64, + float_round_to_zero, _round_to_zero) +VFP_CONV_FLOAT_FIX_ROUND(uq, d, 64, float64, 64, uint64, + float_round_to_zero, _round_to_zero) #undef VFP_CONV_FIX #undef VFP_CONV_FIX_FLOAT From patchwork Fri Dec 13 17:32:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850199 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1642505wry; Fri, 13 Dec 2024 09:43:29 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVqRSK9xpmh68AB38aJq82x8CYv/PLn7iNr2G8zPOKgLRlg9Y8JJOfndSMOisghB97Ha2tjzg==@linaro.org X-Google-Smtp-Source: AGHT+IGEuCDC6kSBynoiyvqiJX59Al3jhJr4eGjNo8qfALdXRZKhLugw1Hzm78dCCq93LlrfWonE X-Received: by 2002:a17:907:1c21:b0:aab:75f1:e51a with SMTP id a640c23a62f3a-aab77e9d751mr420020666b.38.1734111809779; Fri, 13 Dec 2024 09:43:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111809; cv=none; d=google.com; s=arc-20240605; b=hiYOobIu4kb88R/kxtgUYUf6YJDTm/pqqMDw0RHxbkv4CjIoGsFuWbX4Y6BpIHh7KT QFxG6dYKMOZi02/QS0oja8ElGwqdKcop2iRZkDWlEsFxf3MFD2thVPaSQWfr9/cAIqPU BMlocZmaOlybeZloTeuW3EsE0/fYxGGgfqljzZpxAEZXhgSYJnomdm2P+6n55Hk/TlLx ea/hu+Fv5vHywifKVjwnmBKUbjF75kC52sc7gfhAB4FCpy6L3/OcXxmTyeNCwnVnYmvD TzY/Jluft3Dr2JuxzUVoSklxjkFk1xuh4aqGRENtxTASgoaQ7CNzA7ZzUvEVD9QrJp/s Mvow== 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=3izjLofebwkGwQPIm55FVTrETaiL7nkbyxLVjJN4lVg=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=Li/8ov0QeoSYjjDnmu1V4SkR16HMw3AywbS5wadwcqbAx9iZqDK82CBdtg0i2PX7lG U431ePJWQDBNz8JWniahOvMgpnp6s7zSl8ylAavalC5xY7LlJ9YI5ORpnmAIz0LEXd/6 87jn8w7ba1wK0+QHT1i1e97RmlLTZV1oD/zIIYxWM2IihiTt+NPrb2Ejo2Gv+KiHevZg wJvnU9DTlKe0xOvt7Ix8HNSIW8kG/k8PK2mB2ZmK+sP+K9rQaD9nakgIXAhXbK4Ix20N vFiKNW+wm2hL24sEmegKEX4AaQtQbJAcQWeS5Ru4zYpu8sceZLuSSME/gqQV/dkvHE1P Ijdw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=M9Ylhr0M; 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 a640c23a62f3a-aa690799067si749529866b.260.2024.12.13.09.43.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:43: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=M9Ylhr0M; 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 1tM9Ye-0003ki-0m; Fri, 13 Dec 2024 12:34:32 -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 1tM9Xy-0008Gu-Ql for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:55 -0500 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9Xp-0001i2-L0 for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:50 -0500 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-385ddcfc97bso1545518f8f.1 for ; Fri, 13 Dec 2024 09:33:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111220; x=1734716020; 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=3izjLofebwkGwQPIm55FVTrETaiL7nkbyxLVjJN4lVg=; b=M9Ylhr0MHu5+OKR7rdkNgEqEhGPZHspErkEPXPkOEj1iKXKqFDdXpEes3K8pO9a8hB YCrB51unFOVIbb5VYgzSzj8uLKcLphkAW7lDhl+J0lTvQEsN54QcLLRTdGw6ab7GfOaQ e+J1Mptp3Wdt25YrdKlAI/oMPwVb6hh3/wkxfElxAMm8p3jKSrymF28eC8c3EC+SnzJV CMkMfwYtGnD6j8fd5WgTzqHJbmvjivv19vg9MBAzZuW/cCZVVmho0++X4Gm/BUDduDFS leYZ61Hn7ZIop0fZiqPVyCpUFqo8lkEzopUUs9pyEJaBrzT40RawulQj2aFR9aVB8srx gItQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111220; x=1734716020; 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=3izjLofebwkGwQPIm55FVTrETaiL7nkbyxLVjJN4lVg=; b=Tew7d44mGG6QfYWdoyVA2aFN1SN9GY1ldLznyyoqErr1I2ExW+ogJMZMv9k4wTgZJH 5smRHm6WJEYn/VOQSUydBMlCqdzijtzP+7J05nj3XiuVZ9uhBhkI+A5vdViat3nGkVYy f0z9xwwNioUKeg/5CdVtnuIzWcoJ8IPK5py5nSxGsuon/0mdDcEeU9SIGS/kL64iGkGW KQB4HQfKIE32kYPHvHMX8zmsHD4P/cgktg8tO9/OON758jSAKKkEcV82VHIiNfCUCM0e FGXNZJiWVDM8XKpJWE0HOsGexuJJKsv116bBcR6S3u1+zSrfm+gntE8ECrB3IqJEyZfo tivQ== X-Gm-Message-State: AOJu0YzyOYmqGdzaMN55y9MC7SyCbyD07tQsNWomEjKdV/6MGYVEBbJT VRDyNNKsni9VtG1iBcD1mb71ydLabdUTXNojeO4DJ3BJnpD122PDrErfHOhJY4aafLxtKYEw0O7 Y X-Gm-Gg: ASbGncsN21OxOQQpYBgH+4LJiRlqE+HYWdWUXGaYypqDKCFvKkJgnRy9Yy5iEBtTbeG pcAMOKnfs7QfUgR9lTIpj5ICbpCD/AjKPGQHztDVLuVGwAncseXP8Pqr4QbBla5WIm1GjLksXbo QbjssAllPU8jk78yyYnj9K5ehYIhNI2dyrUC/RDXT73zOrFvbRd8wRBY/o3mjCLbhIK4TPUv9zJ Y7Nas0pgFGp90UQMzoc3fE3l75v+IhLhGkKRvn5uYwFVyIbVzC+wUClJ8UdAQ== X-Received: by 2002:a05:6000:4609:b0:385:fac7:89b9 with SMTP id ffacd0b85a97d-3889ad37d7amr2725725f8f.59.1734111219880; Fri, 13 Dec 2024 09:33:39 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:39 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 64/85] target/arm: Convert FCVT* (vector, integer) to decodetree Date: Fri, 13 Dec 2024 17:32:08 +0000 Message-Id: <20241213173229.3308926-65-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x431.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Remove handle_2misc_64 as these were the last insns decoded by that function. Remove helper_advsimd_f16to[su]inth as unused; we now always go through helper_vfp_to[su]hh or a specialized vector function instead. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-65-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/helper.h | 2 + target/arm/tcg/helper-a64.h | 2 - target/arm/tcg/a64.decode | 25 ++++ target/arm/tcg/helper-a64.c | 32 ----- target/arm/tcg/translate-a64.c | 227 +++++++++++---------------------- target/arm/tcg/vec_helper.c | 2 + 6 files changed, 102 insertions(+), 188 deletions(-) diff --git a/target/arm/helper.h b/target/arm/helper.h index 0c8a56c3ae4..64aa6034655 100644 --- a/target/arm/helper.h +++ b/target/arm/helper.h @@ -665,6 +665,8 @@ DEF_HELPER_FLAGS_4(gvec_vcvt_ud, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(gvec_vcvt_rz_ds, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(gvec_vcvt_rz_du, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_4(gvec_vcvt_rm_sd, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_4(gvec_vcvt_rm_ud, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(gvec_vcvt_rm_ss, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(gvec_vcvt_rm_us, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(gvec_vcvt_rm_sh, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) diff --git a/target/arm/tcg/helper-a64.h b/target/arm/tcg/helper-a64.h index ac7ca190fac..3c0774139b2 100644 --- a/target/arm/tcg/helper-a64.h +++ b/target/arm/tcg/helper-a64.h @@ -74,8 +74,6 @@ DEF_HELPER_3(advsimd_mulx2h, i32, i32, i32, ptr) DEF_HELPER_4(advsimd_muladd2h, i32, i32, i32, i32, ptr) DEF_HELPER_2(advsimd_rinth_exact, f16, f16, ptr) DEF_HELPER_2(advsimd_rinth, f16, f16, ptr) -DEF_HELPER_2(advsimd_f16tosinth, i32, f16, ptr) -DEF_HELPER_2(advsimd_f16touinth, i32, f16, ptr) DEF_HELPER_2(exception_return, void, env, i64) DEF_HELPER_FLAGS_2(dc_zva, TCG_CALL_NO_WG, void, env, i64) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 61d519b96a5..05a0b844161 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -1793,6 +1793,31 @@ SCVTF_vi 0.00 1110 0.1 00001 11011 0 ..... ..... @qrr_sd UCVTF_vi 0.10 1110 011 11001 11011 0 ..... ..... @qrr_h UCVTF_vi 0.10 1110 0.1 00001 11011 0 ..... ..... @qrr_sd +FCVTNS_vi 0.00 1110 011 11001 10101 0 ..... ..... @qrr_h +FCVTNS_vi 0.00 1110 0.1 00001 10101 0 ..... ..... @qrr_sd +FCVTNU_vi 0.10 1110 011 11001 10101 0 ..... ..... @qrr_h +FCVTNU_vi 0.10 1110 0.1 00001 10101 0 ..... ..... @qrr_sd + +FCVTPS_vi 0.00 1110 111 11001 10101 0 ..... ..... @qrr_h +FCVTPS_vi 0.00 1110 1.1 00001 10101 0 ..... ..... @qrr_sd +FCVTPU_vi 0.10 1110 111 11001 10101 0 ..... ..... @qrr_h +FCVTPU_vi 0.10 1110 1.1 00001 10101 0 ..... ..... @qrr_sd + +FCVTMS_vi 0.00 1110 011 11001 10111 0 ..... ..... @qrr_h +FCVTMS_vi 0.00 1110 0.1 00001 10111 0 ..... ..... @qrr_sd +FCVTMU_vi 0.10 1110 011 11001 10111 0 ..... ..... @qrr_h +FCVTMU_vi 0.10 1110 0.1 00001 10111 0 ..... ..... @qrr_sd + +FCVTZS_vi 0.00 1110 111 11001 10111 0 ..... ..... @qrr_h +FCVTZS_vi 0.00 1110 1.1 00001 10111 0 ..... ..... @qrr_sd +FCVTZU_vi 0.10 1110 111 11001 10111 0 ..... ..... @qrr_h +FCVTZU_vi 0.10 1110 1.1 00001 10111 0 ..... ..... @qrr_sd + +FCVTAS_vi 0.00 1110 011 11001 11001 0 ..... ..... @qrr_h +FCVTAS_vi 0.00 1110 0.1 00001 11001 0 ..... ..... @qrr_sd +FCVTAU_vi 0.10 1110 011 11001 11001 0 ..... ..... @qrr_h +FCVTAU_vi 0.10 1110 0.1 00001 11001 0 ..... ..... @qrr_sd + &fcvt_q rd rn esz q shift @fcvtq_h . q:1 . ...... 001 .... ...... rn:5 rd:5 \ &fcvt_q esz=1 shift=%fcvt_f_sh_h diff --git a/target/arm/tcg/helper-a64.c b/target/arm/tcg/helper-a64.c index 3de564e0fef..28de7468cd1 100644 --- a/target/arm/tcg/helper-a64.c +++ b/target/arm/tcg/helper-a64.c @@ -618,38 +618,6 @@ uint32_t HELPER(advsimd_rinth)(uint32_t x, void *fp_status) return ret; } -/* - * Half-precision floating point conversion functions - * - * There are a multitude of conversion functions with various - * different rounding modes. This is dealt with by the calling code - * setting the mode appropriately before calling the helper. - */ - -uint32_t HELPER(advsimd_f16tosinth)(uint32_t a, void *fpstp) -{ - float_status *fpst = fpstp; - - /* Invalid if we are passed a NaN */ - if (float16_is_any_nan(a)) { - float_raise(float_flag_invalid, fpst); - return 0; - } - return float16_to_int16(a, fpst); -} - -uint32_t HELPER(advsimd_f16touinth)(uint32_t a, void *fpstp) -{ - float_status *fpst = fpstp; - - /* Invalid if we are passed a NaN */ - if (float16_is_any_nan(a)) { - float_raise(float_flag_invalid, fpst); - return 0; - } - return float16_to_uint16(a, fpst); -} - static int el_from_spsr(uint32_t spsr) { /* Return the exception level that this SPSR is requesting a return to, diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 1c4e53770ba..ec1ce44c4b3 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -9348,56 +9348,38 @@ static gen_helper_gvec_2_ptr * const f_fcvtzu_vf[] = { TRANS(FCVTZU_vf, do_gvec_op2_fpst, a->esz, a->q, a->rd, a->rn, a->shift, f_fcvtzu_vf) -static void handle_2misc_64(DisasContext *s, int opcode, bool u, - TCGv_i64 tcg_rd, TCGv_i64 tcg_rn, - TCGv_i32 tcg_rmode, TCGv_ptr tcg_fpstatus) -{ - /* Handle 64->64 opcodes which are shared between the scalar and - * vector 2-reg-misc groups. We cover every integer opcode where size == 3 - * is valid in either group and also the double-precision fp ops. - * The caller only need provide tcg_rmode and tcg_fpstatus if the op - * requires them. - */ - switch (opcode) { - case 0x1a: /* FCVTNS */ - case 0x1b: /* FCVTMS */ - case 0x1c: /* FCVTAS */ - case 0x3a: /* FCVTPS */ - case 0x3b: /* FCVTZS */ - gen_helper_vfp_tosqd(tcg_rd, tcg_rn, tcg_constant_i32(0), tcg_fpstatus); - break; - case 0x5a: /* FCVTNU */ - case 0x5b: /* FCVTMU */ - case 0x5c: /* FCVTAU */ - case 0x7a: /* FCVTPU */ - case 0x7b: /* FCVTZU */ - gen_helper_vfp_touqd(tcg_rd, tcg_rn, tcg_constant_i32(0), tcg_fpstatus); - break; - default: - case 0x4: /* CLS, CLZ */ - case 0x5: /* NOT */ - case 0x7: /* SQABS, SQNEG */ - case 0x8: /* CMGT, CMGE */ - case 0x9: /* CMEQ, CMLE */ - case 0xa: /* CMLT */ - case 0xb: /* ABS, NEG */ - case 0x2f: /* FABS */ - case 0x6f: /* FNEG */ - case 0x7f: /* FSQRT */ - case 0x18: /* FRINTN */ - case 0x19: /* FRINTM */ - case 0x38: /* FRINTP */ - case 0x39: /* FRINTZ */ - case 0x58: /* FRINTA */ - case 0x79: /* FRINTI */ - case 0x59: /* FRINTX */ - case 0x1e: /* FRINT32Z */ - case 0x5e: /* FRINT32X */ - case 0x1f: /* FRINT64Z */ - case 0x5f: /* FRINT64X */ - g_assert_not_reached(); - } -} +static gen_helper_gvec_2_ptr * const f_fcvt_s_vi[] = { + gen_helper_gvec_vcvt_rm_sh, + gen_helper_gvec_vcvt_rm_ss, + gen_helper_gvec_vcvt_rm_sd, +}; + +static gen_helper_gvec_2_ptr * const f_fcvt_u_vi[] = { + gen_helper_gvec_vcvt_rm_uh, + gen_helper_gvec_vcvt_rm_us, + gen_helper_gvec_vcvt_rm_ud, +}; + +TRANS(FCVTNS_vi, do_gvec_op2_fpst, + a->esz, a->q, a->rd, a->rn, float_round_nearest_even, f_fcvt_s_vi) +TRANS(FCVTNU_vi, do_gvec_op2_fpst, + a->esz, a->q, a->rd, a->rn, float_round_nearest_even, f_fcvt_u_vi) +TRANS(FCVTPS_vi, do_gvec_op2_fpst, + a->esz, a->q, a->rd, a->rn, float_round_up, f_fcvt_s_vi) +TRANS(FCVTPU_vi, do_gvec_op2_fpst, + a->esz, a->q, a->rd, a->rn, float_round_up, f_fcvt_u_vi) +TRANS(FCVTMS_vi, do_gvec_op2_fpst, + a->esz, a->q, a->rd, a->rn, float_round_down, f_fcvt_s_vi) +TRANS(FCVTMU_vi, do_gvec_op2_fpst, + a->esz, a->q, a->rd, a->rn, float_round_down, f_fcvt_u_vi) +TRANS(FCVTZS_vi, do_gvec_op2_fpst, + a->esz, a->q, a->rd, a->rn, float_round_to_zero, f_fcvt_s_vi) +TRANS(FCVTZU_vi, do_gvec_op2_fpst, + a->esz, a->q, a->rd, a->rn, float_round_to_zero, f_fcvt_u_vi) +TRANS(FCVTAS_vi, do_gvec_op2_fpst, + a->esz, a->q, a->rd, a->rn, float_round_ties_away, f_fcvt_s_vi) +TRANS(FCVTAU_vi, do_gvec_op2_fpst, + a->esz, a->q, a->rd, a->rn, float_round_ties_away, f_fcvt_u_vi) static void handle_2misc_fcmp_zero(DisasContext *s, int opcode, bool is_scalar, bool is_u, bool is_q, @@ -9758,30 +9740,6 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) } handle_2misc_fcmp_zero(s, opcode, false, u, is_q, size, rn, rd); return; - case 0x1a: /* FCVTNS */ - case 0x1b: /* FCVTMS */ - case 0x3a: /* FCVTPS */ - case 0x3b: /* FCVTZS */ - case 0x5a: /* FCVTNU */ - case 0x5b: /* FCVTMU */ - case 0x7a: /* FCVTPU */ - case 0x7b: /* FCVTZU */ - need_fpstatus = true; - rmode = extract32(opcode, 5, 1) | (extract32(opcode, 0, 1) << 1); - if (size == 3 && !is_q) { - unallocated_encoding(s); - return; - } - break; - case 0x5c: /* FCVTAU */ - case 0x1c: /* FCVTAS */ - need_fpstatus = true; - rmode = FPROUNDING_TIEAWAY; - if (size == 3 && !is_q) { - unallocated_encoding(s); - return; - } - break; case 0x3c: /* URECPE */ if (size == 3) { unallocated_encoding(s); @@ -9831,6 +9789,16 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) case 0x5f: /* FRINT64X */ case 0x1d: /* SCVTF */ case 0x5d: /* UCVTF */ + case 0x1a: /* FCVTNS */ + case 0x1b: /* FCVTMS */ + case 0x3a: /* FCVTPS */ + case 0x3b: /* FCVTZS */ + case 0x5a: /* FCVTNU */ + case 0x5b: /* FCVTMU */ + case 0x7a: /* FCVTPU */ + case 0x7b: /* FCVTZU */ + case 0x5c: /* FCVTAU */ + case 0x1c: /* FCVTAS */ unallocated_encoding(s); return; } @@ -9871,26 +9839,7 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) tcg_rmode = NULL; } - if (size == 3) { - /* All 64-bit element operations can be shared with scalar 2misc */ - int pass; - - /* Coverity claims (size == 3 && !is_q) has been eliminated - * from all paths leading to here. - */ - tcg_debug_assert(is_q); - for (pass = 0; pass < 2; pass++) { - TCGv_i64 tcg_op = tcg_temp_new_i64(); - TCGv_i64 tcg_res = tcg_temp_new_i64(); - - read_vec_element(s, tcg_op, rn, pass, MO_64); - - handle_2misc_64(s, opcode, u, tcg_res, tcg_op, - tcg_rmode, tcg_fpstatus); - - write_vec_element(s, tcg_res, rd, pass, MO_64); - } - } else { + { int pass; assert(size == 2); @@ -9903,22 +9852,6 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) { /* Special cases for 32 bit elements */ switch (opcode) { - case 0x1a: /* FCVTNS */ - case 0x1b: /* FCVTMS */ - case 0x1c: /* FCVTAS */ - case 0x3a: /* FCVTPS */ - case 0x3b: /* FCVTZS */ - gen_helper_vfp_tosls(tcg_res, tcg_op, - tcg_constant_i32(0), tcg_fpstatus); - break; - case 0x5a: /* FCVTNU */ - case 0x5b: /* FCVTMU */ - case 0x5c: /* FCVTAU */ - case 0x7a: /* FCVTPU */ - case 0x7b: /* FCVTZU */ - gen_helper_vfp_touls(tcg_res, tcg_op, - tcg_constant_i32(0), tcg_fpstatus); - break; case 0x7c: /* URSQRTE */ gen_helper_rsqrte_u32(tcg_res, tcg_op); break; @@ -9938,6 +9871,16 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) case 0x5e: /* FRINT32X */ case 0x1f: /* FRINT64Z */ case 0x5f: /* FRINT64X */ + case 0x1a: /* FCVTNS */ + case 0x1b: /* FCVTMS */ + case 0x1c: /* FCVTAS */ + case 0x3a: /* FCVTPS */ + case 0x3b: /* FCVTZS */ + case 0x5a: /* FCVTNU */ + case 0x5b: /* FCVTMU */ + case 0x5c: /* FCVTAU */ + case 0x7a: /* FCVTPU */ + case 0x7b: /* FCVTZU */ g_assert_not_reached(); } } @@ -10006,36 +9949,6 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn) case 0x3d: /* FRECPE */ case 0x3f: /* FRECPX */ break; - case 0x1a: /* FCVTNS */ - rmode = FPROUNDING_TIEEVEN; - break; - case 0x1b: /* FCVTMS */ - rmode = FPROUNDING_NEGINF; - break; - case 0x1c: /* FCVTAS */ - rmode = FPROUNDING_TIEAWAY; - break; - case 0x3a: /* FCVTPS */ - rmode = FPROUNDING_POSINF; - break; - case 0x3b: /* FCVTZS */ - rmode = FPROUNDING_ZERO; - break; - case 0x5a: /* FCVTNU */ - rmode = FPROUNDING_TIEEVEN; - break; - case 0x5b: /* FCVTMU */ - rmode = FPROUNDING_NEGINF; - break; - case 0x5c: /* FCVTAU */ - rmode = FPROUNDING_TIEAWAY; - break; - case 0x7a: /* FCVTPU */ - rmode = FPROUNDING_POSINF; - break; - case 0x7b: /* FCVTZU */ - rmode = FPROUNDING_ZERO; - break; case 0x7d: /* FRSQRTE */ break; default: @@ -10051,6 +9964,16 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn) case 0x79: /* FRINTI */ case 0x1d: /* SCVTF */ case 0x5d: /* UCVTF */ + case 0x1a: /* FCVTNS */ + case 0x1b: /* FCVTMS */ + case 0x1c: /* FCVTAS */ + case 0x3a: /* FCVTPS */ + case 0x3b: /* FCVTZS */ + case 0x5a: /* FCVTNU */ + case 0x5b: /* FCVTMU */ + case 0x5c: /* FCVTAU */ + case 0x7a: /* FCVTPU */ + case 0x7b: /* FCVTZU */ unallocated_encoding(s); return; } @@ -10115,23 +10038,9 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn) read_vec_element_i32(s, tcg_op, rn, pass, MO_16); switch (fpop) { - case 0x1a: /* FCVTNS */ - case 0x1b: /* FCVTMS */ - case 0x1c: /* FCVTAS */ - case 0x3a: /* FCVTPS */ - case 0x3b: /* FCVTZS */ - gen_helper_advsimd_f16tosinth(tcg_res, tcg_op, tcg_fpstatus); - break; case 0x3d: /* FRECPE */ gen_helper_recpe_f16(tcg_res, tcg_op, tcg_fpstatus); break; - case 0x5a: /* FCVTNU */ - case 0x5b: /* FCVTMU */ - case 0x5c: /* FCVTAU */ - case 0x7a: /* FCVTPU */ - case 0x7b: /* FCVTZU */ - gen_helper_advsimd_f16touinth(tcg_res, tcg_op, tcg_fpstatus); - break; case 0x7d: /* FRSQRTE */ gen_helper_rsqrte_f16(tcg_res, tcg_op, tcg_fpstatus); break; @@ -10146,6 +10055,16 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn) case 0x58: /* FRINTA */ case 0x79: /* FRINTI */ case 0x59: /* FRINTX */ + case 0x1a: /* FCVTNS */ + case 0x1b: /* FCVTMS */ + case 0x1c: /* FCVTAS */ + case 0x3a: /* FCVTPS */ + case 0x3b: /* FCVTZS */ + case 0x5a: /* FCVTNU */ + case 0x5b: /* FCVTMU */ + case 0x5c: /* FCVTAU */ + case 0x7a: /* FCVTPU */ + case 0x7b: /* FCVTZU */ g_assert_not_reached(); } diff --git a/target/arm/tcg/vec_helper.c b/target/arm/tcg/vec_helper.c index b5ab8d1e15f..bc752ff988b 100644 --- a/target/arm/tcg/vec_helper.c +++ b/target/arm/tcg/vec_helper.c @@ -2537,6 +2537,8 @@ DO_VCVT_FIXED(gvec_vcvt_rz_hu, helper_vfp_touhh_round_to_zero, uint16_t) clear_tail(d, oprsz, simd_maxsz(desc)); \ } +DO_VCVT_RMODE(gvec_vcvt_rm_sd, helper_vfp_tosqd, uint64_t) +DO_VCVT_RMODE(gvec_vcvt_rm_ud, helper_vfp_touqd, uint64_t) DO_VCVT_RMODE(gvec_vcvt_rm_ss, helper_vfp_tosls, uint32_t) DO_VCVT_RMODE(gvec_vcvt_rm_us, helper_vfp_touls, uint32_t) DO_VCVT_RMODE(gvec_vcvt_rm_sh, helper_vfp_toshh, uint16_t) From patchwork Fri Dec 13 17:32:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850162 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1639975wry; Fri, 13 Dec 2024 09:37:58 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUntskh5aQ1S5Q/dMWd874WCb/Q2I0ZKv07BwQSCIZQ56ussJhXcPyKcHVGRrOYfnVGmvlp2w==@linaro.org X-Google-Smtp-Source: AGHT+IHjmDfW0x/NnKNdqGNhL7AEErMLdS7KmANVdd7cmMQHmxCpLbMSHptx2wLg+Y0U5D3knHmb X-Received: by 2002:a5d:588e:0:b0:385:df63:4c49 with SMTP id ffacd0b85a97d-3888e0ae5c3mr2414143f8f.25.1734111478217; Fri, 13 Dec 2024 09:37:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111478; cv=none; d=google.com; s=arc-20240605; b=SvoDdXy6Ek1j1sugDQRfh23ZDfBvYmxB6oJO3RTWyDd0fdiSlVt53fMvQDlTBy+9Ns JBgLcklyaeT1Yd9gwiOsTdCBZtiFuS9QaAaao9g+9vW3eraswzr+7WQM4lQG6knNN5mm jnTdd+q+LGrttYLLQRUEBPL01S2OVT0AKYukHjCAWxqWQpXFhHQOY5fEIPcbGKVUEU7W 2typQMumwR5A0FikR8Jtuvga9qkZQklJFBkWX/T3eAiudfyZuYA6wZKtoGznA6IBUSJg I7mxqyP2k1fNJUIIkrGSOnUe/Qlt7PU8Jx76jeo8/culHPksF+Jat/ZFcTS8Oimg9JdG pHEQ== 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=g1PAJ+d8UdzvWmvOdM++O7RIAodxM1LV8e64w1h0QTA=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=DtBp1k85zFKGwq61gLTE6PtO6H9Pak7mBvPTWB2hjHOMJ2/xJe3WUO4VXOoo07cL0H nXhTAq91V0+OLfozaz9ouzcfloffRchUtvSKo2/IrZLllaz5U8wLthVoUpQ9nHgpmjaS bFilWbNktrstu0QMt+VqELOoqB460VZ/6RGOzTgWnt1tokdetvanbkoj5m4JckcUmjDe LABZVgeAl1pgvHl/wic7E64FJZ8OaOfS267pX7zSvoLS7/nAVWzIsUxnbdRsVtsaRNAm PqGcM3eOpReCfoN4hjR0cuvO2ZvUnBfROn9TVQKwbp4GgaVenWknPB9wxEiJaD3H6DZ7 VGYg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GOiBtpAi; 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 5b1f17b1804b1-4362580fa80si23046645e9.194.2024.12.13.09.37.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:37: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=GOiBtpAi; 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 1tM9aJ-0000II-Oe; Fri, 13 Dec 2024 12:36: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 1tM9Y3-0008Hj-Mq for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:57 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9Xr-0001iA-Od for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:54 -0500 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-385de9f789cso1544552f8f.2 for ; Fri, 13 Dec 2024 09:33:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111221; x=1734716021; 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=g1PAJ+d8UdzvWmvOdM++O7RIAodxM1LV8e64w1h0QTA=; b=GOiBtpAiezYkW5w+8xBUnryyqrmVzfty066Qo5e6e4mnr6soTkHqgNWYmvcWuMzrgD 21ZIzvmem1Wpu/VMC2EbcierfXejnxIYbTWBT/d5/rE7UgaUXbpzR/TFo1CzfczPNXO6 sSzHu8NEhbmpNIO9uNfwNvIkb4+/p5O8GLZm8TOchpgnp/SMRgotqgB6bji+XXDp8+4m EPcx87lMCaVThJ5lEzT5P7iHenEZHr3kWCjVp1IS28MT68J/Rj7UfuzuPs1TVfcuXLjK ljypWHF6moT4SwFYrFCFWa9CJPhZiXB98sSHu7Vt2rFeL0qmQaKIshDu23vDo8lNNhlo vyIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111221; x=1734716021; 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=g1PAJ+d8UdzvWmvOdM++O7RIAodxM1LV8e64w1h0QTA=; b=RHFvk4f3m/PeGJoNObrZVEoZxN1w+1rW5EWnEso+wRxuN4mtpcyFC8zlNnEUcuIpf1 OGrmApxLRbmtjRaLedhx4Tt44wXqmV5OqsOoYUitayb31PkvhJKlPNvCRrwHEvJ//r/e 68m1pkVkX3+6OboF4onrLJex/SRH5Fq1Z4TKnhCtOwbazt2uD4AxzRsKlVJ7d8k2oqaL ggcU2XPYB5Lx4/XjxMGptKPTZq6kBLaJ6TDkR8Nscl5lMfaynx+bFngwRnNX6L9+UMiF Rj08cWvbvUDHEeAxdjg22FtHHEaFXLXnTmEzgrLUCBI8AUIftoUhft4ClRlpdwI05wKL Moqg== X-Gm-Message-State: AOJu0YwSY6DH9ny8YLF5wrmxzIQs0xk5wx1cjGgyNpzNIf/t+yyQ6mMM ZvpLKLc/lcW3qaLCsmQNeWS3nhHoxkmiTiADR7QyUjMIcfB7ArML2TWye2rSKxegmFF34Tbk5/k w X-Gm-Gg: ASbGncuRmBrA7g2F0lOTyaGjExpyzDhf08gSQWK1JAPBQTPrLO/UqMoboP0uX0VuIFh zWnAfeptwZURA0xd7ssj7uOi0b9qecO4mQQdOXColqRorKb1w/a+BIR8p5OOQ2nQQhoqn70pBug FUcq1nrIiZhppTm1IcRQ6ObUIHcQ/9xK5QaFyIYMMGh8i3ilmJsP8iA4od6sGAYM0CZdGAj6wk4 +jogXgx1kGNJzoFOjmm6wuRvlQqgp3erWUzflCC+SkTge/u4VllNUfEvxw+nQ== X-Received: by 2002:a5d:59af:0:b0:385:efc7:932d with SMTP id ffacd0b85a97d-3888e0f47femr2817485f8f.46.1734111220850; Fri, 13 Dec 2024 09:33:40 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:40 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 65/85] target/arm: Convert handle_2misc_fcmp_zero to decodetree Date: Fri, 13 Dec 2024 17:32:09 +0000 Message-Id: <20241213173229.3308926-66-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42c.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson This includes FCMEQ, FCMGT, FCMGE, FCMLT, FCMLE. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-66-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/helper.h | 5 + target/arm/tcg/a64.decode | 30 ++++ target/arm/tcg/translate-a64.c | 249 +++++++++++++-------------------- target/arm/tcg/vec_helper.c | 4 +- 4 files changed, 138 insertions(+), 150 deletions(-) diff --git a/target/arm/helper.h b/target/arm/helper.h index 64aa6034655..1132a5cab61 100644 --- a/target/arm/helper.h +++ b/target/arm/helper.h @@ -688,18 +688,23 @@ DEF_HELPER_FLAGS_4(gvec_frsqrte_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(gvec_fcgt0_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(gvec_fcgt0_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_4(gvec_fcgt0_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(gvec_fcge0_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(gvec_fcge0_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_4(gvec_fcge0_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(gvec_fceq0_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(gvec_fceq0_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_4(gvec_fceq0_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(gvec_fcle0_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(gvec_fcle0_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_4(gvec_fcle0_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(gvec_fclt0_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(gvec_fclt0_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_4(gvec_fclt0_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_5(gvec_fadd_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_5(gvec_fadd_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 05a0b844161..d1c4a330f2d 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -1652,6 +1652,21 @@ UQXTN_s 0111 1110 ..1 00001 01001 0 ..... ..... @rr_e FCVTXN_s 0111 1110 011 00001 01101 0 ..... ..... @rr_s +FCMGT0_s 0101 1110 111 11000 11001 0 ..... ..... @rr_h +FCMGT0_s 0101 1110 1.1 00000 11001 0 ..... ..... @rr_sd + +FCMGE0_s 0111 1110 111 11000 11001 0 ..... ..... @rr_h +FCMGE0_s 0111 1110 1.1 00000 11001 0 ..... ..... @rr_sd + +FCMEQ0_s 0101 1110 111 11000 11011 0 ..... ..... @rr_h +FCMEQ0_s 0101 1110 1.1 00000 11011 0 ..... ..... @rr_sd + +FCMLE0_s 0111 1110 111 11000 11011 0 ..... ..... @rr_h +FCMLE0_s 0111 1110 1.1 00000 11011 0 ..... ..... @rr_sd + +FCMLT0_s 0101 1110 111 11000 11101 0 ..... ..... @rr_h +FCMLT0_s 0101 1110 1.1 00000 11101 0 ..... ..... @rr_sd + @icvt_h . ....... .. ...... ...... rn:5 rd:5 \ &fcvt sf=0 esz=1 shift=0 @icvt_sd . ....... .. ...... ...... rn:5 rd:5 \ @@ -1818,6 +1833,21 @@ FCVTAS_vi 0.00 1110 0.1 00001 11001 0 ..... ..... @qrr_sd FCVTAU_vi 0.10 1110 011 11001 11001 0 ..... ..... @qrr_h FCVTAU_vi 0.10 1110 0.1 00001 11001 0 ..... ..... @qrr_sd +FCMGT0_v 0.00 1110 111 11000 11001 0 ..... ..... @qrr_h +FCMGT0_v 0.00 1110 1.1 00000 11001 0 ..... ..... @qrr_sd + +FCMGE0_v 0.10 1110 111 11000 11001 0 ..... ..... @qrr_h +FCMGE0_v 0.10 1110 1.1 00000 11001 0 ..... ..... @qrr_sd + +FCMEQ0_v 0.00 1110 111 11000 11011 0 ..... ..... @qrr_h +FCMEQ0_v 0.00 1110 1.1 00000 11011 0 ..... ..... @qrr_sd + +FCMLE0_v 0.10 1110 111 11000 11011 0 ..... ..... @qrr_h +FCMLE0_v 0.10 1110 1.1 00000 11011 0 ..... ..... @qrr_sd + +FCMLT0_v 0.00 1110 111 11000 11101 0 ..... ..... @qrr_h +FCMLT0_v 0.00 1110 1.1 00000 11101 0 ..... ..... @qrr_sd + &fcvt_q rd rn esz q shift @fcvtq_h . q:1 . ...... 001 .... ...... rn:5 rd:5 \ &fcvt_q esz=1 shift=%fcvt_f_sh_h diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index ec1ce44c4b3..1776862161a 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -5250,6 +5250,61 @@ static const FPScalar f_scalar_frsqrts = { }; TRANS(FRSQRTS_s, do_fp3_scalar, a, &f_scalar_frsqrts) +static bool do_fcmp0_s(DisasContext *s, arg_rr_e *a, + const FPScalar *f, bool swap) +{ + switch (a->esz) { + case MO_64: + if (fp_access_check(s)) { + TCGv_i64 t0 = read_fp_dreg(s, a->rn); + TCGv_i64 t1 = tcg_constant_i64(0); + if (swap) { + f->gen_d(t0, t1, t0, fpstatus_ptr(FPST_FPCR)); + } else { + f->gen_d(t0, t0, t1, fpstatus_ptr(FPST_FPCR)); + } + write_fp_dreg(s, a->rd, t0); + } + break; + case MO_32: + if (fp_access_check(s)) { + TCGv_i32 t0 = read_fp_sreg(s, a->rn); + TCGv_i32 t1 = tcg_constant_i32(0); + if (swap) { + f->gen_s(t0, t1, t0, fpstatus_ptr(FPST_FPCR)); + } else { + f->gen_s(t0, t0, t1, fpstatus_ptr(FPST_FPCR)); + } + write_fp_sreg(s, a->rd, t0); + } + break; + case MO_16: + if (!dc_isar_feature(aa64_fp16, s)) { + return false; + } + if (fp_access_check(s)) { + TCGv_i32 t0 = read_fp_hreg(s, a->rn); + TCGv_i32 t1 = tcg_constant_i32(0); + if (swap) { + f->gen_h(t0, t1, t0, fpstatus_ptr(FPST_FPCR_F16)); + } else { + f->gen_h(t0, t0, t1, fpstatus_ptr(FPST_FPCR_F16)); + } + write_fp_sreg(s, a->rd, t0); + } + break; + default: + return false; + } + return true; +} + +TRANS(FCMEQ0_s, do_fcmp0_s, a, &f_scalar_fcmeq, false) +TRANS(FCMGT0_s, do_fcmp0_s, a, &f_scalar_fcmgt, false) +TRANS(FCMGE0_s, do_fcmp0_s, a, &f_scalar_fcmge, false) +TRANS(FCMLT0_s, do_fcmp0_s, a, &f_scalar_fcmgt, true) +TRANS(FCMLE0_s, do_fcmp0_s, a, &f_scalar_fcmge, true) + static bool do_satacc_s(DisasContext *s, arg_rrr_e *a, MemOp sgn_n, MemOp sgn_m, void (*gen_bhs)(TCGv_i64, TCGv_i64, TCGv_i64, TCGv_i64, MemOp), @@ -9381,134 +9436,40 @@ TRANS(FCVTAS_vi, do_gvec_op2_fpst, TRANS(FCVTAU_vi, do_gvec_op2_fpst, a->esz, a->q, a->rd, a->rn, float_round_ties_away, f_fcvt_u_vi) -static void handle_2misc_fcmp_zero(DisasContext *s, int opcode, - bool is_scalar, bool is_u, bool is_q, - int size, int rn, int rd) -{ - bool is_double = (size == MO_64); - TCGv_ptr fpst; +static gen_helper_gvec_2_ptr * const f_fceq0[] = { + gen_helper_gvec_fceq0_h, + gen_helper_gvec_fceq0_s, + gen_helper_gvec_fceq0_d, +}; +TRANS(FCMEQ0_v, do_gvec_op2_fpst, a->esz, a->q, a->rd, a->rn, 0, f_fceq0) - if (!fp_access_check(s)) { - return; - } +static gen_helper_gvec_2_ptr * const f_fcgt0[] = { + gen_helper_gvec_fcgt0_h, + gen_helper_gvec_fcgt0_s, + gen_helper_gvec_fcgt0_d, +}; +TRANS(FCMGT0_v, do_gvec_op2_fpst, a->esz, a->q, a->rd, a->rn, 0, f_fcgt0) - fpst = fpstatus_ptr(size == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); +static gen_helper_gvec_2_ptr * const f_fcge0[] = { + gen_helper_gvec_fcge0_h, + gen_helper_gvec_fcge0_s, + gen_helper_gvec_fcge0_d, +}; +TRANS(FCMGE0_v, do_gvec_op2_fpst, a->esz, a->q, a->rd, a->rn, 0, f_fcge0) - if (is_double) { - TCGv_i64 tcg_op = tcg_temp_new_i64(); - TCGv_i64 tcg_zero = tcg_constant_i64(0); - TCGv_i64 tcg_res = tcg_temp_new_i64(); - NeonGenTwoDoubleOpFn *genfn; - bool swap = false; - int pass; +static gen_helper_gvec_2_ptr * const f_fclt0[] = { + gen_helper_gvec_fclt0_h, + gen_helper_gvec_fclt0_s, + gen_helper_gvec_fclt0_d, +}; +TRANS(FCMLT0_v, do_gvec_op2_fpst, a->esz, a->q, a->rd, a->rn, 0, f_fclt0) - switch (opcode) { - case 0x2e: /* FCMLT (zero) */ - swap = true; - /* fallthrough */ - case 0x2c: /* FCMGT (zero) */ - genfn = gen_helper_neon_cgt_f64; - break; - case 0x2d: /* FCMEQ (zero) */ - genfn = gen_helper_neon_ceq_f64; - break; - case 0x6d: /* FCMLE (zero) */ - swap = true; - /* fall through */ - case 0x6c: /* FCMGE (zero) */ - genfn = gen_helper_neon_cge_f64; - break; - default: - g_assert_not_reached(); - } - - for (pass = 0; pass < (is_scalar ? 1 : 2); pass++) { - read_vec_element(s, tcg_op, rn, pass, MO_64); - if (swap) { - genfn(tcg_res, tcg_zero, tcg_op, fpst); - } else { - genfn(tcg_res, tcg_op, tcg_zero, fpst); - } - write_vec_element(s, tcg_res, rd, pass, MO_64); - } - - clear_vec_high(s, !is_scalar, rd); - } else { - TCGv_i32 tcg_op = tcg_temp_new_i32(); - TCGv_i32 tcg_zero = tcg_constant_i32(0); - TCGv_i32 tcg_res = tcg_temp_new_i32(); - NeonGenTwoSingleOpFn *genfn; - bool swap = false; - int pass, maxpasses; - - if (size == MO_16) { - switch (opcode) { - case 0x2e: /* FCMLT (zero) */ - swap = true; - /* fall through */ - case 0x2c: /* FCMGT (zero) */ - genfn = gen_helper_advsimd_cgt_f16; - break; - case 0x2d: /* FCMEQ (zero) */ - genfn = gen_helper_advsimd_ceq_f16; - break; - case 0x6d: /* FCMLE (zero) */ - swap = true; - /* fall through */ - case 0x6c: /* FCMGE (zero) */ - genfn = gen_helper_advsimd_cge_f16; - break; - default: - g_assert_not_reached(); - } - } else { - switch (opcode) { - case 0x2e: /* FCMLT (zero) */ - swap = true; - /* fall through */ - case 0x2c: /* FCMGT (zero) */ - genfn = gen_helper_neon_cgt_f32; - break; - case 0x2d: /* FCMEQ (zero) */ - genfn = gen_helper_neon_ceq_f32; - break; - case 0x6d: /* FCMLE (zero) */ - swap = true; - /* fall through */ - case 0x6c: /* FCMGE (zero) */ - genfn = gen_helper_neon_cge_f32; - break; - default: - g_assert_not_reached(); - } - } - - if (is_scalar) { - maxpasses = 1; - } else { - int vector_size = 8 << is_q; - maxpasses = vector_size >> size; - } - - for (pass = 0; pass < maxpasses; pass++) { - read_vec_element_i32(s, tcg_op, rn, pass, size); - if (swap) { - genfn(tcg_res, tcg_zero, tcg_op, fpst); - } else { - genfn(tcg_res, tcg_op, tcg_zero, fpst); - } - if (is_scalar) { - write_fp_sreg(s, rd, tcg_res); - } else { - write_vec_element_i32(s, tcg_res, rd, pass, size); - } - } - - if (!is_scalar) { - clear_vec_high(s, is_q, rd); - } - } -} +static gen_helper_gvec_2_ptr * const f_fcle0[] = { + gen_helper_gvec_fcle0_h, + gen_helper_gvec_fcle0_s, + gen_helper_gvec_fcle0_d, +}; +TRANS(FCMLE0_v, do_gvec_op2_fpst, a->esz, a->q, a->rd, a->rn, 0, f_fcle0) static void handle_2misc_reciprocal(DisasContext *s, int opcode, bool is_scalar, bool is_u, bool is_q, @@ -9607,13 +9568,6 @@ static void disas_simd_scalar_two_reg_misc(DisasContext *s, uint32_t insn) opcode |= (extract32(size, 1, 1) << 5) | (u << 6); size = extract32(size, 0, 1) ? 3 : 2; switch (opcode) { - case 0x2c: /* FCMGT (zero) */ - case 0x2d: /* FCMEQ (zero) */ - case 0x2e: /* FCMLT (zero) */ - case 0x6c: /* FCMGE (zero) */ - case 0x6d: /* FCMLE (zero) */ - handle_2misc_fcmp_zero(s, opcode, true, u, true, size, rn, rd); - return; case 0x3d: /* FRECPE */ case 0x3f: /* FRECPX */ case 0x7d: /* FRSQRTE */ @@ -9635,6 +9589,11 @@ static void disas_simd_scalar_two_reg_misc(DisasContext *s, uint32_t insn) case 0x56: /* FCVTXN, FCVTXN2 */ case 0x1d: /* SCVTF */ case 0x5d: /* UCVTF */ + case 0x2c: /* FCMGT (zero) */ + case 0x2d: /* FCMEQ (zero) */ + case 0x2e: /* FCMLT (zero) */ + case 0x6c: /* FCMGE (zero) */ + case 0x6d: /* FCMLE (zero) */ default: unallocated_encoding(s); return; @@ -9729,17 +9688,6 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) opcode |= (extract32(size, 1, 1) << 5) | (u << 6); size = is_double ? 3 : 2; switch (opcode) { - case 0x2c: /* FCMGT (zero) */ - case 0x2d: /* FCMEQ (zero) */ - case 0x2e: /* FCMLT (zero) */ - case 0x6c: /* FCMGE (zero) */ - case 0x6d: /* FCMLE (zero) */ - if (size == 3 && !is_q) { - unallocated_encoding(s); - return; - } - handle_2misc_fcmp_zero(s, opcode, false, u, is_q, size, rn, rd); - return; case 0x3c: /* URECPE */ if (size == 3) { unallocated_encoding(s); @@ -9799,6 +9747,11 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) case 0x7b: /* FCVTZU */ case 0x5c: /* FCVTAU */ case 0x1c: /* FCVTAS */ + case 0x2c: /* FCMGT (zero) */ + case 0x2d: /* FCMEQ (zero) */ + case 0x2e: /* FCMLT (zero) */ + case 0x6c: /* FCMGE (zero) */ + case 0x6d: /* FCMLE (zero) */ unallocated_encoding(s); return; } @@ -9939,13 +9892,6 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn) fpop = deposit32(fpop, 6, 1, u); switch (fpop) { - case 0x2c: /* FCMGT (zero) */ - case 0x2d: /* FCMEQ (zero) */ - case 0x2e: /* FCMLT (zero) */ - case 0x6c: /* FCMGE (zero) */ - case 0x6d: /* FCMLE (zero) */ - handle_2misc_fcmp_zero(s, fpop, is_scalar, 0, is_q, MO_16, rn, rd); - return; case 0x3d: /* FRECPE */ case 0x3f: /* FRECPX */ break; @@ -9974,6 +9920,11 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn) case 0x5c: /* FCVTAU */ case 0x7a: /* FCVTPU */ case 0x7b: /* FCVTZU */ + case 0x2c: /* FCMGT (zero) */ + case 0x2d: /* FCMEQ (zero) */ + case 0x2e: /* FCMLT (zero) */ + case 0x6c: /* FCMGE (zero) */ + case 0x6d: /* FCMLE (zero) */ unallocated_encoding(s); return; } diff --git a/target/arm/tcg/vec_helper.c b/target/arm/tcg/vec_helper.c index bc752ff988b..ee847745173 100644 --- a/target/arm/tcg/vec_helper.c +++ b/target/arm/tcg/vec_helper.c @@ -1253,8 +1253,10 @@ DO_2OP(gvec_touszh, vfp_touszh, float16) #define DO_2OP_CMP0(FN, CMPOP, DIRN) \ WRAP_CMP0_##DIRN(FN, CMPOP, float16) \ WRAP_CMP0_##DIRN(FN, CMPOP, float32) \ + WRAP_CMP0_##DIRN(FN, CMPOP, float64) \ DO_2OP(gvec_f##FN##0_h, float16_##FN##0, float16) \ - DO_2OP(gvec_f##FN##0_s, float32_##FN##0, float32) + DO_2OP(gvec_f##FN##0_s, float32_##FN##0, float32) \ + DO_2OP(gvec_f##FN##0_d, float64_##FN##0, float64) DO_2OP_CMP0(cgt, cgt, FWD) DO_2OP_CMP0(cge, cge, FWD) From patchwork Fri Dec 13 17:32:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850168 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1640293wry; Fri, 13 Dec 2024 09:38:42 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV6Yy+ILFMB7JABbIbCgjiJPBANAXuLx2gsSv9WWKv9XY4G9tT1c1vdorrHmSNy4w+kPFfGkg==@linaro.org X-Google-Smtp-Source: AGHT+IGR4JYLJwpHJnd3shFeU8nhhZoj+KC6n6Tvs/n2CSFJ9xvwVwFKg+x25e+pikZZWBeaAESe X-Received: by 2002:a05:6402:2807:b0:5cf:c97c:8206 with SMTP id 4fb4d7f45d1cf-5d63c3ae6e1mr3321132a12.25.1734111522117; Fri, 13 Dec 2024 09:38:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111522; cv=none; d=google.com; s=arc-20240605; b=Zf1/BsCsz4bbG6CZ66xA0qxpxLRC2RJbErPnq+w6nKwpAhyvfe4Kpn2prpv0ZikSYm D5A0DrZ4k/FNvYKnZw4dybnASRsEO4WprjEHFS8qnXOyyoKeeGSXInCo0l4jkGuRggY2 oDLptJMvwM6/mkObHd0Cg0i2zCj7wjcIN0N9UtFHw/C4Sxf0XFffUs+Ro15Wf/3uselA Yjo1ZdIHuKG5QqtvFUs2TuEK1oyUoERT+Bme2BiHOMnchbZyGyRXteFN4rxTKa96HTHb R6Gi48WEnc9FpybwLzaPeI/D0cCpv4IfyhTOybxPxDwyFWuEXXd7GJUiEN0sIAz0+ytJ qNXw== 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=O+UDn0aAMuczaa4QpohakpRN/RqACfQ7Fq2tPcYSYVo=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=hO8toab6n8DPkMK0iDUsGgZi6ghswzEz3eYhC0V8C2uQI+JATy+/yWdXaK/zUUWmy7 hoLkhUW1Xgzehc8a7zo/+DZoj41QDsnh7EJB5pM29rZzJk/evD5rkmHJ9wJ7GBZBn+P9 J12wsu6TaeqAb1zhXG6DS75z6pnS+9ymQFMphZGX4YXbXnIjLuPIMhL+KDdeQ6IMnf9L syaY62XcmXcXBVIxFKoKy6rbt/vJeXCtTdcnHUX1WZQepGCz9sL8bpofXN0W5Qq4SNXt Vkqtnbe8omigXZCci1XW2cdcSCKZzFrQgHNUg9QI6AwVy6U4k2IrW0FVv5kF+dAzyhlJ QlUg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GD4Kifrc; 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 4fb4d7f45d1cf-5d653011ed0si31892a12.619.2024.12.13.09.38.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:38: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=GD4Kifrc; 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 1tM9aC-0008Fs-9p; Fri, 13 Dec 2024 12:36: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 1tM9Y1-0008HV-TT for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:57 -0500 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9Xr-0001iJ-P0 for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:53 -0500 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-385e0e224cbso1079433f8f.2 for ; Fri, 13 Dec 2024 09:33:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111222; x=1734716022; 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=O+UDn0aAMuczaa4QpohakpRN/RqACfQ7Fq2tPcYSYVo=; b=GD4Kifrcdj9jbx5ThJOpcNnphQQbRdxFSdfUiDTyVsmPjP+64EhWtYID98y/pMLZNK WYcP29EcfIJMxvurIWW8T+BRgFx/yiphYm6lij7QzQsYpo2C1SxeW7XgVmC3MOhyLAVY 27cGfWScb77awNI/nyzt1iEydlA4a2RG+x9fvu3mhwDA+rZjtHE3wdv2Tnu4lagzKF/X q0dF3fMhBtKM4RJYglD4IGE4eFfQQlJtNrzPENDPWTdj6N0oK/Elo2FyX2Ch4pd9cKBC sCQPaaxLdfgBiFFC+tcXRpPtmU7TOfgN4LRTHz7ksghD3HA7SJQD+Isvalz54ttoPeIb ZWzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111222; x=1734716022; 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=O+UDn0aAMuczaa4QpohakpRN/RqACfQ7Fq2tPcYSYVo=; b=HFaH3jUKTv9jiRZgo9nlHFjPRyU0yF8ncSuGtWyW24tWlJxEbYAE3WjMl4m530jbpY 69lEpjygrtGLrLTiOdvAoZNWQMe2XSzSGUNVe/okCNKwseMVgg1FHHVUmirB6f9o8aok 8Lv+4zsNs0rTKBx6k5Qb7tfSt3dZHo/mSuKiafgI8A5jI3VsBCgGWDDYyjwfhjPJStKu sOYDwQ6qEQ9vZ5fRT/6LM66rX+vb4KxjSqbCl5552wRVIXThv4ztR/a2T46e1QmZr9mI A18gGQPRLTTG57sSSUVE1EvY5/pMyPGN56NoXo7cy9OS5tegTVOAbK5wRyliEYiZtcZJ xiGA== X-Gm-Message-State: AOJu0YzDXiMq1l08eO5fSIjy9ljeaDgHXP8nsF1OG1lMc+wrlek0F0VJ 3xrrf7COvscXBqgZg6oMFIzJ/pXIisuy+f+frLQ/Er1hY/KN6TBHapJ7NTqX9q2VvL6PIGXo4pZ T X-Gm-Gg: ASbGncshe8ArS3OhpKk7bNjowGiYuaGdWGVd0MtM3ldk370HlslqU23Gw1/FkieL7nK 5HdEmCuHc/nRage2Vn9VJ4fstFd5a517L24iiVEcYuoDg8bTF4zGucwg5kUwL+GZLX0s2O11482 fMO7CUP0Lqo9PbKv6jktr90YUkS0CSMotOhuPo2N88oAOTjY3SX12kaLWJsY8UgPg+XhGfRPUiI PLXoeLlPZkgYFrO0xNqWjfUTQjgF3utoIxV/ZkaZ9i7q9orgYubwvv9HgkujA== X-Received: by 2002:adf:f545:0:b0:385:f409:b42 with SMTP id ffacd0b85a97d-3888e0c0831mr2435209f8f.53.1734111221936; Fri, 13 Dec 2024 09:33:41 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:41 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 66/85] target/arm: Convert FRECPE, FRECPX, FRSQRTE to decodetree Date: Fri, 13 Dec 2024 17:32:10 +0000 Message-Id: <20241213173229.3308926-67-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x431.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Remove disas_simd_scalar_two_reg_misc and disas_simd_two_reg_misc_fp16 as these were the last insns decoded by those functions. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-67-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 15 ++ target/arm/tcg/translate-a64.c | 329 ++++----------------------------- 2 files changed, 53 insertions(+), 291 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index d1c4a330f2d..9b3b09c3bb2 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -1667,6 +1667,15 @@ FCMLE0_s 0111 1110 1.1 00000 11011 0 ..... ..... @rr_sd FCMLT0_s 0101 1110 111 11000 11101 0 ..... ..... @rr_h FCMLT0_s 0101 1110 1.1 00000 11101 0 ..... ..... @rr_sd +FRECPE_s 0101 1110 111 11001 11011 0 ..... ..... @rr_h +FRECPE_s 0101 1110 1.1 00001 11011 0 ..... ..... @rr_sd + +FRECPX_s 0101 1110 111 11001 11111 0 ..... ..... @rr_h +FRECPX_s 0101 1110 1.1 00001 11111 0 ..... ..... @rr_sd + +FRSQRTE_s 0111 1110 111 11001 11011 0 ..... ..... @rr_h +FRSQRTE_s 0111 1110 1.1 00001 11011 0 ..... ..... @rr_sd + @icvt_h . ....... .. ...... ...... rn:5 rd:5 \ &fcvt sf=0 esz=1 shift=0 @icvt_sd . ....... .. ...... ...... rn:5 rd:5 \ @@ -1848,6 +1857,12 @@ FCMLE0_v 0.10 1110 1.1 00000 11011 0 ..... ..... @qrr_sd FCMLT0_v 0.00 1110 111 11000 11101 0 ..... ..... @qrr_h FCMLT0_v 0.00 1110 1.1 00000 11101 0 ..... ..... @qrr_sd +FRECPE_v 0.00 1110 111 11001 11011 0 ..... ..... @qrr_h +FRECPE_v 0.00 1110 1.1 00001 11011 0 ..... ..... @qrr_sd + +FRSQRTE_v 0.10 1110 111 11001 11011 0 ..... ..... @qrr_h +FRSQRTE_v 0.10 1110 1.1 00001 11011 0 ..... ..... @qrr_sd + &fcvt_q rd rn esz q shift @fcvtq_h . q:1 . ...... 001 .... ...... rn:5 rd:5 \ &fcvt_q esz=1 shift=%fcvt_f_sh_h diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 1776862161a..63cf25251b9 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -8501,6 +8501,27 @@ TRANS_FEAT(FRINT64Z_s, aa64_frint, do_fp1_scalar, a, &f_scalar_frint64, FPROUNDING_ZERO) TRANS_FEAT(FRINT64X_s, aa64_frint, do_fp1_scalar, a, &f_scalar_frint64, -1) +static const FPScalar1 f_scalar_frecpe = { + gen_helper_recpe_f16, + gen_helper_recpe_f32, + gen_helper_recpe_f64, +}; +TRANS(FRECPE_s, do_fp1_scalar, a, &f_scalar_frecpe, -1) + +static const FPScalar1 f_scalar_frecpx = { + gen_helper_frecpx_f16, + gen_helper_frecpx_f32, + gen_helper_frecpx_f64, +}; +TRANS(FRECPX_s, do_fp1_scalar, a, &f_scalar_frecpx, -1) + +static const FPScalar1 f_scalar_frsqrte = { + gen_helper_rsqrte_f16, + gen_helper_rsqrte_f32, + gen_helper_rsqrte_f64, +}; +TRANS(FRSQRTE_s, do_fp1_scalar, a, &f_scalar_frsqrte, -1) + static bool trans_FCVT_s_ds(DisasContext *s, arg_rr *a) { if (fp_access_check(s)) { @@ -9471,36 +9492,28 @@ static gen_helper_gvec_2_ptr * const f_fcle0[] = { }; TRANS(FCMLE0_v, do_gvec_op2_fpst, a->esz, a->q, a->rd, a->rn, 0, f_fcle0) +static gen_helper_gvec_2_ptr * const f_frecpe[] = { + gen_helper_gvec_frecpe_h, + gen_helper_gvec_frecpe_s, + gen_helper_gvec_frecpe_d, +}; +TRANS(FRECPE_v, do_gvec_op2_fpst, a->esz, a->q, a->rd, a->rn, 0, f_frecpe) + +static gen_helper_gvec_2_ptr * const f_frsqrte[] = { + gen_helper_gvec_frsqrte_h, + gen_helper_gvec_frsqrte_s, + gen_helper_gvec_frsqrte_d, +}; +TRANS(FRSQRTE_v, do_gvec_op2_fpst, a->esz, a->q, a->rd, a->rn, 0, f_frsqrte) + static void handle_2misc_reciprocal(DisasContext *s, int opcode, bool is_scalar, bool is_u, bool is_q, int size, int rn, int rd) { bool is_double = (size == 3); - TCGv_ptr fpst = fpstatus_ptr(FPST_FPCR); if (is_double) { - TCGv_i64 tcg_op = tcg_temp_new_i64(); - TCGv_i64 tcg_res = tcg_temp_new_i64(); - int pass; - - for (pass = 0; pass < (is_scalar ? 1 : 2); pass++) { - read_vec_element(s, tcg_op, rn, pass, MO_64); - switch (opcode) { - case 0x3d: /* FRECPE */ - gen_helper_recpe_f64(tcg_res, tcg_op, fpst); - break; - case 0x3f: /* FRECPX */ - gen_helper_frecpx_f64(tcg_res, tcg_op, fpst); - break; - case 0x7d: /* FRSQRTE */ - gen_helper_rsqrte_f64(tcg_res, tcg_op, fpst); - break; - default: - g_assert_not_reached(); - } - write_vec_element(s, tcg_res, rd, pass, MO_64); - } - clear_vec_high(s, !is_scalar, rd); + g_assert_not_reached(); } else { TCGv_i32 tcg_op = tcg_temp_new_i32(); TCGv_i32 tcg_res = tcg_temp_new_i32(); @@ -9520,14 +9533,8 @@ static void handle_2misc_reciprocal(DisasContext *s, int opcode, gen_helper_recpe_u32(tcg_res, tcg_op); break; case 0x3d: /* FRECPE */ - gen_helper_recpe_f32(tcg_res, tcg_op, fpst); - break; case 0x3f: /* FRECPX */ - gen_helper_frecpx_f32(tcg_res, tcg_op, fpst); - break; case 0x7d: /* FRSQRTE */ - gen_helper_rsqrte_f32(tcg_res, tcg_op, fpst); - break; default: g_assert_not_reached(); } @@ -9544,76 +9551,6 @@ static void handle_2misc_reciprocal(DisasContext *s, int opcode, } } -/* AdvSIMD scalar two reg misc - * 31 30 29 28 24 23 22 21 17 16 12 11 10 9 5 4 0 - * +-----+---+-----------+------+-----------+--------+-----+------+------+ - * | 0 1 | U | 1 1 1 1 0 | size | 1 0 0 0 0 | opcode | 1 0 | Rn | Rd | - * +-----+---+-----------+------+-----------+--------+-----+------+------+ - */ -static void disas_simd_scalar_two_reg_misc(DisasContext *s, uint32_t insn) -{ - int rd = extract32(insn, 0, 5); - int rn = extract32(insn, 5, 5); - int opcode = extract32(insn, 12, 5); - int size = extract32(insn, 22, 2); - bool u = extract32(insn, 29, 1); - - switch (opcode) { - case 0xc ... 0xf: - case 0x16 ... 0x1d: - case 0x1f: - /* Floating point: U, size[1] and opcode indicate operation; - * size[0] indicates single or double precision. - */ - opcode |= (extract32(size, 1, 1) << 5) | (u << 6); - size = extract32(size, 0, 1) ? 3 : 2; - switch (opcode) { - case 0x3d: /* FRECPE */ - case 0x3f: /* FRECPX */ - case 0x7d: /* FRSQRTE */ - if (!fp_access_check(s)) { - return; - } - handle_2misc_reciprocal(s, opcode, true, u, true, size, rn, rd); - return; - case 0x1a: /* FCVTNS */ - case 0x1b: /* FCVTMS */ - case 0x3a: /* FCVTPS */ - case 0x3b: /* FCVTZS */ - case 0x5a: /* FCVTNU */ - case 0x5b: /* FCVTMU */ - case 0x7a: /* FCVTPU */ - case 0x7b: /* FCVTZU */ - case 0x1c: /* FCVTAS */ - case 0x5c: /* FCVTAU */ - case 0x56: /* FCVTXN, FCVTXN2 */ - case 0x1d: /* SCVTF */ - case 0x5d: /* UCVTF */ - case 0x2c: /* FCMGT (zero) */ - case 0x2d: /* FCMEQ (zero) */ - case 0x2e: /* FCMLT (zero) */ - case 0x6c: /* FCMGE (zero) */ - case 0x6d: /* FCMLE (zero) */ - default: - unallocated_encoding(s); - return; - } - break; - default: - case 0x3: /* USQADD / SUQADD */ - case 0x7: /* SQABS / SQNEG */ - case 0x8: /* CMGT, CMGE */ - case 0x9: /* CMEQ, CMLE */ - case 0xa: /* CMLT */ - case 0xb: /* ABS, NEG */ - case 0x12: /* SQXTUN */ - case 0x14: /* SQXTN, UQXTN */ - unallocated_encoding(s); - return; - } - g_assert_not_reached(); -} - static void handle_2misc_widening(DisasContext *s, int opcode, bool is_q, int size, int rn, int rd) { @@ -9693,13 +9630,6 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) unallocated_encoding(s); return; } - /* fall through */ - case 0x3d: /* FRECPE */ - case 0x7d: /* FRSQRTE */ - if (size == 3 && !is_q) { - unallocated_encoding(s); - return; - } if (!fp_access_check(s)) { return; } @@ -9752,6 +9682,8 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) case 0x2e: /* FCMLT (zero) */ case 0x6c: /* FCMGE (zero) */ case 0x6d: /* FCMLE (zero) */ + case 0x3d: /* FRECPE */ + case 0x7d: /* FRSQRTE */ unallocated_encoding(s); return; } @@ -9847,189 +9779,6 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) } } -/* AdvSIMD [scalar] two register miscellaneous (FP16) - * - * 31 30 29 28 27 24 23 22 21 17 16 12 11 10 9 5 4 0 - * +---+---+---+---+---------+---+-------------+--------+-----+------+------+ - * | 0 | Q | U | S | 1 1 1 0 | a | 1 1 1 1 0 0 | opcode | 1 0 | Rn | Rd | - * +---+---+---+---+---------+---+-------------+--------+-----+------+------+ - * mask: 1000 1111 0111 1110 0000 1100 0000 0000 0x8f7e 0c00 - * val: 0000 1110 0111 1000 0000 1000 0000 0000 0x0e78 0800 - * - * This actually covers two groups where scalar access is governed by - * bit 28. A bunch of the instructions (float to integral) only exist - * in the vector form and are un-allocated for the scalar decode. Also - * in the scalar decode Q is always 1. - */ -static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn) -{ - int fpop, opcode, a, u; - int rn, rd; - bool is_q; - bool is_scalar; - - int pass; - TCGv_i32 tcg_rmode = NULL; - TCGv_ptr tcg_fpstatus = NULL; - bool need_fpst = true; - int rmode = -1; - - if (!dc_isar_feature(aa64_fp16, s)) { - unallocated_encoding(s); - return; - } - - rd = extract32(insn, 0, 5); - rn = extract32(insn, 5, 5); - - a = extract32(insn, 23, 1); - u = extract32(insn, 29, 1); - is_scalar = extract32(insn, 28, 1); - is_q = extract32(insn, 30, 1); - - opcode = extract32(insn, 12, 5); - fpop = deposit32(opcode, 5, 1, a); - fpop = deposit32(fpop, 6, 1, u); - - switch (fpop) { - case 0x3d: /* FRECPE */ - case 0x3f: /* FRECPX */ - break; - case 0x7d: /* FRSQRTE */ - break; - default: - case 0x2f: /* FABS */ - case 0x6f: /* FNEG */ - case 0x7f: /* FSQRT (vector) */ - case 0x18: /* FRINTN */ - case 0x19: /* FRINTM */ - case 0x38: /* FRINTP */ - case 0x39: /* FRINTZ */ - case 0x58: /* FRINTA */ - case 0x59: /* FRINTX */ - case 0x79: /* FRINTI */ - case 0x1d: /* SCVTF */ - case 0x5d: /* UCVTF */ - case 0x1a: /* FCVTNS */ - case 0x1b: /* FCVTMS */ - case 0x1c: /* FCVTAS */ - case 0x3a: /* FCVTPS */ - case 0x3b: /* FCVTZS */ - case 0x5a: /* FCVTNU */ - case 0x5b: /* FCVTMU */ - case 0x5c: /* FCVTAU */ - case 0x7a: /* FCVTPU */ - case 0x7b: /* FCVTZU */ - case 0x2c: /* FCMGT (zero) */ - case 0x2d: /* FCMEQ (zero) */ - case 0x2e: /* FCMLT (zero) */ - case 0x6c: /* FCMGE (zero) */ - case 0x6d: /* FCMLE (zero) */ - unallocated_encoding(s); - return; - } - - - /* Check additional constraints for the scalar encoding */ - if (is_scalar) { - if (!is_q) { - unallocated_encoding(s); - return; - } - } - - if (!fp_access_check(s)) { - return; - } - - if (rmode >= 0 || need_fpst) { - tcg_fpstatus = fpstatus_ptr(FPST_FPCR_F16); - } - - if (rmode >= 0) { - tcg_rmode = gen_set_rmode(rmode, tcg_fpstatus); - } - - if (is_scalar) { - TCGv_i32 tcg_op = read_fp_hreg(s, rn); - TCGv_i32 tcg_res = tcg_temp_new_i32(); - - switch (fpop) { - case 0x3d: /* FRECPE */ - gen_helper_recpe_f16(tcg_res, tcg_op, tcg_fpstatus); - break; - case 0x3f: /* FRECPX */ - gen_helper_frecpx_f16(tcg_res, tcg_op, tcg_fpstatus); - break; - case 0x7d: /* FRSQRTE */ - gen_helper_rsqrte_f16(tcg_res, tcg_op, tcg_fpstatus); - break; - default: - case 0x1a: /* FCVTNS */ - case 0x1b: /* FCVTMS */ - case 0x1c: /* FCVTAS */ - case 0x3a: /* FCVTPS */ - case 0x3b: /* FCVTZS */ - case 0x5a: /* FCVTNU */ - case 0x5b: /* FCVTMU */ - case 0x5c: /* FCVTAU */ - case 0x7a: /* FCVTPU */ - case 0x7b: /* FCVTZU */ - g_assert_not_reached(); - } - - /* limit any sign extension going on */ - tcg_gen_andi_i32(tcg_res, tcg_res, 0xffff); - write_fp_sreg(s, rd, tcg_res); - } else { - for (pass = 0; pass < (is_q ? 8 : 4); pass++) { - TCGv_i32 tcg_op = tcg_temp_new_i32(); - TCGv_i32 tcg_res = tcg_temp_new_i32(); - - read_vec_element_i32(s, tcg_op, rn, pass, MO_16); - - switch (fpop) { - case 0x3d: /* FRECPE */ - gen_helper_recpe_f16(tcg_res, tcg_op, tcg_fpstatus); - break; - case 0x7d: /* FRSQRTE */ - gen_helper_rsqrte_f16(tcg_res, tcg_op, tcg_fpstatus); - break; - default: - case 0x2f: /* FABS */ - case 0x6f: /* FNEG */ - case 0x7f: /* FSQRT */ - case 0x18: /* FRINTN */ - case 0x19: /* FRINTM */ - case 0x38: /* FRINTP */ - case 0x39: /* FRINTZ */ - case 0x58: /* FRINTA */ - case 0x79: /* FRINTI */ - case 0x59: /* FRINTX */ - case 0x1a: /* FCVTNS */ - case 0x1b: /* FCVTMS */ - case 0x1c: /* FCVTAS */ - case 0x3a: /* FCVTPS */ - case 0x3b: /* FCVTZS */ - case 0x5a: /* FCVTNU */ - case 0x5b: /* FCVTMU */ - case 0x5c: /* FCVTAU */ - case 0x7a: /* FCVTPU */ - case 0x7b: /* FCVTZU */ - g_assert_not_reached(); - } - - write_vec_element_i32(s, tcg_res, rd, pass, MO_16); - } - - clear_vec_high(s, is_q, rd); - } - - if (tcg_rmode) { - gen_restore_rmode(tcg_rmode, tcg_fpstatus); - } -} - /* C3.6 Data processing - SIMD, inc Crypto * * As the decode gets a little complex we are using a table based @@ -10038,8 +9787,6 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn) static const AArch64DecodeTable data_proc_simd[] = { /* pattern , mask , fn */ { 0x0e200800, 0x9f3e0c00, disas_simd_two_reg_misc }, - { 0x5e200800, 0xdf3e0c00, disas_simd_scalar_two_reg_misc }, - { 0x0e780800, 0x8f7e0c00, disas_simd_two_reg_misc_fp16 }, { 0x00000000, 0x00000000, NULL } }; From patchwork Fri Dec 13 17:32:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850177 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1640594wry; Fri, 13 Dec 2024 09:39:18 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUPgdVe3vclf88hd5CT6BfH5k6GL7WWSr/a5sKBoyvVWbpuT8w35wGgCHBnhHDy9cQRSiuyHQ==@linaro.org X-Google-Smtp-Source: AGHT+IEEWYEHsHXtUlSClN0dXoHF7FeE0atGGWHHUWrGp7vOUCK0ernXkvz13Nh7X4FTyov5Wgdc X-Received: by 2002:a17:906:4795:b0:aa6:73ae:b3b3 with SMTP id a640c23a62f3a-aab779b135amr305476466b.32.1734111558388; Fri, 13 Dec 2024 09:39:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111558; cv=none; d=google.com; s=arc-20240605; b=Dzpk/O58XFHVkAn+nKNEztjG2gM2NL6xtzCUC6X+hShpxLSUMvB2MiSNJhgNwNyY36 tIvsuJrZbZxTufOoY3wW/MpeepvxGMaRb9NFt9W+MHnxzci1TITKoFosbkB1JptpdyxX Yu4faBqWw147trBtxbxN3Ia6AqtM96IyMiQYnr94Z500qQcymxlBDoXJE8TbjrBBkxO5 j+nHxl/azYY2XxWI/fXYD4qeo/m7SVsWgTzotyNiFXxeIYPgwqoGOuGMTd7ucksHam8F kD/5nw9hGeez9S8brf3+Db9ZMsXdhUbrnfi53B2Js0daB71ywUouxB4tePo1A3t1k29f rhSg== 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=B0zNMUMDgnHepXnqq3jWRGeUDsJcd/C9LjIYSZ/w5Ro=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=PLkZPMVyPs4RZfcfsGmklVHk/GHlf+PMhseaMUQspeiMWE4h3NLYQElqMkGEoXKdio 2HbsVt+zpecUZTOuELcwkGJ8I4PdxU3QRKOxQP6tNbxPovpJ8xsrzHh6/DE5whL3xdS7 Ov5q52uugRyTHNweVOEKNlNBRNplxcD3FBL+8Y84Cn9+HvVs8Dg4CDAZo1tyJUB0Fdt1 eY9dSer4RI/kPleW0y4bdXX9yT9wLlIMfAW0ViPUgRzv5u7eIQTnphFRdQTlUAU64DG1 gG6u0JRla4QsxQjoV5vUmM+OglnrYH+4jdjSZzWAfBvShQEjTMo+hjnwscB1wR9BL+u8 T5mA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hucGFG8o; 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 a640c23a62f3a-aa6b6916574si415948166b.136.2024.12.13.09.39.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:39:18 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hucGFG8o; 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 1tM9Zq-0007kF-7n; Fri, 13 Dec 2024 12:35:46 -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 1tM9Xy-0008Gc-5M for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:53 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9Xs-0001iU-AU for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:49 -0500 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-3862f32a33eso985759f8f.3 for ; Fri, 13 Dec 2024 09:33:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111223; x=1734716023; 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=B0zNMUMDgnHepXnqq3jWRGeUDsJcd/C9LjIYSZ/w5Ro=; b=hucGFG8osqO6K24tCo/4k7NM8x2Rmz45TQG9gzWTdn8vktLfTCTXA8NX8hHcfchkyD T8eoXftAvoIRWGqJ3F5m/eNfE+eQpBzLkuiMMtGh5YnscWb7J/quMrviMzKZ16EGk2z6 twYuuXBsO36QBOOFRuIsjQuxDvUzB04OnwhdCPyK25acjN5oyG3ESaxVpbYNSqHZq14O +oj17mVV99FBx71w9kBDnMDrYNpUpJChvv9MCvKB7+wsvEbVbwJ51UpomWJZYOM00XAG xHbOmoapIsL7kEWtdWg0/ZkPr4Q33s1+cNjf7aUqg3lv1oc5dX2pvGtBfz6CoDbMHktP Hlbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111223; x=1734716023; 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=B0zNMUMDgnHepXnqq3jWRGeUDsJcd/C9LjIYSZ/w5Ro=; b=V9HcxkLKZKMZ2G/mOirU9XoItYQQvgTVlP8ZcdsCFt1zi+bD7ty3GtxbH64NAV8b17 xlt6wO4AIyYZVtYBFlQmSM9qQX01zI/5aJI3Ks2/ouj4Cl5VP2wE9GC6LCeKzgOpcByk WNYp39L7M24rrNsLqnUknIP4xSDpZiD0j96Gf4S3YmDeEHyHFa4ObVf5+CspPSCz2MuU MVjeBtcFyHzokGke39C43TVpdw5nVLrWy8CWmVGMZTgRLZwcXzVQRp08asHCl2JlHCn/ ONFDWgzO49GTto3UG+F424Jefql8AHauXzWcfpTOgi+Y26IK1wGR6sUjnszNKDX6E8DL h8eg== X-Gm-Message-State: AOJu0YzwGDXvaW14BzkiiJhxomm54GKMpIn1qeR/pJQ2DSEjXLWb+oMI qneaEhdq4AVO+cfOIY1dl8TqfXNGs9Vhkt0mswzC2k1Bi/aDVhqP9qExRb7ulNlxGAf83J2PYqb V X-Gm-Gg: ASbGncsnE+jw+UJXhRav9oqJR1RhrI+Yxo/9ivs1cm2Xnf8DxJjEQBCzVSFHVnBFe1u Nr2TdavGqJeS0fcEpR+pvufeKmPMCxCFtli21KuwLTd0xTuhjQ9Qqh50ISdYyUkUQBUZPpRD9Kr zIQMKQLsaWcapPPL5ddnZ2oru8ry9d6SkQRro/JMLaOHmFhRGWXQErgLC1aXjCJ3326rZaVGuuv U1O0iFWRbIGUTYw1j5h8sylaWDEy51PenbY/R+YINzCRm7ZsfUFB6stNxR8eg== X-Received: by 2002:a05:6000:4025:b0:385:f1f2:13f1 with SMTP id ffacd0b85a97d-3888dcd4796mr2654489f8f.22.1734111222829; Fri, 13 Dec 2024 09:33:42 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:42 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 67/85] target/arm: Introduce gen_gvec_urecpe, gen_gvec_ursqrte Date: Fri, 13 Dec 2024 17:32:11 +0000 Message-Id: <20241213173229.3308926-68-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-68-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/helper.h | 3 +++ target/arm/tcg/translate.h | 5 +++++ target/arm/tcg/gengvec.c | 16 ++++++++++++++++ target/arm/tcg/translate-neon.c | 4 ++-- target/arm/tcg/vec_helper.c | 22 ++++++++++++++++++++++ 5 files changed, 48 insertions(+), 2 deletions(-) diff --git a/target/arm/helper.h b/target/arm/helper.h index 1132a5cab61..9919b1367b7 100644 --- a/target/arm/helper.h +++ b/target/arm/helper.h @@ -1121,6 +1121,9 @@ DEF_HELPER_FLAGS_4(gvec_uminp_b, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(gvec_uminp_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(gvec_uminp_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_3(gvec_urecpe_s, TCG_CALL_NO_RWG, void, ptr, ptr, i32) +DEF_HELPER_FLAGS_3(gvec_ursqrte_s, TCG_CALL_NO_RWG, void, ptr, ptr, i32) + #ifdef TARGET_AARCH64 #include "tcg/helper-a64.h" #include "tcg/helper-sve.h" diff --git a/target/arm/tcg/translate.h b/target/arm/tcg/translate.h index b996de2c156..9b9abf19925 100644 --- a/target/arm/tcg/translate.h +++ b/target/arm/tcg/translate.h @@ -608,6 +608,11 @@ void gen_gvec_fabs(unsigned vece, uint32_t dofs, uint32_t aofs, void gen_gvec_fneg(unsigned vece, uint32_t dofs, uint32_t aofs, uint32_t oprsz, uint32_t maxsz); +void gen_gvec_urecpe(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs, + uint32_t opr_sz, uint32_t max_sz); +void gen_gvec_ursqrte(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs, + uint32_t opr_sz, uint32_t max_sz); + /* * Forward to the isar_feature_* tests given a DisasContext pointer. */ diff --git a/target/arm/tcg/gengvec.c b/target/arm/tcg/gengvec.c index 01c9d5436d4..01867f8ace3 100644 --- a/target/arm/tcg/gengvec.c +++ b/target/arm/tcg/gengvec.c @@ -2711,3 +2711,19 @@ void gen_gvec_fneg(unsigned vece, uint32_t dofs, uint32_t aofs, uint64_t s_bit = 1ull << ((8 << vece) - 1); tcg_gen_gvec_xori(vece, dofs, aofs, s_bit, oprsz, maxsz); } + +void gen_gvec_urecpe(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs, + uint32_t opr_sz, uint32_t max_sz) +{ + assert(vece == MO_32); + tcg_gen_gvec_2_ool(rd_ofs, rn_ofs, opr_sz, max_sz, 0, + gen_helper_gvec_urecpe_s); +} + +void gen_gvec_ursqrte(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs, + uint32_t opr_sz, uint32_t max_sz) +{ + assert(vece == MO_32); + tcg_gen_gvec_2_ool(rd_ofs, rn_ofs, opr_sz, max_sz, 0, + gen_helper_gvec_ursqrte_s); +} diff --git a/target/arm/tcg/translate-neon.c b/target/arm/tcg/translate-neon.c index f9ca889beca..c4fecb8fd6c 100644 --- a/target/arm/tcg/translate-neon.c +++ b/target/arm/tcg/translate-neon.c @@ -3070,7 +3070,7 @@ static bool trans_VRECPE(DisasContext *s, arg_2misc *a) if (a->size != 2) { return false; } - return do_2misc(s, a, gen_helper_recpe_u32); + return do_2misc_vec(s, a, gen_gvec_urecpe); } static bool trans_VRSQRTE(DisasContext *s, arg_2misc *a) @@ -3078,7 +3078,7 @@ static bool trans_VRSQRTE(DisasContext *s, arg_2misc *a) if (a->size != 2) { return false; } - return do_2misc(s, a, gen_helper_rsqrte_u32); + return do_2misc_vec(s, a, gen_gvec_ursqrte); } #define WRAP_1OP_ENV_FN(WRAPNAME, FUNC) \ diff --git a/target/arm/tcg/vec_helper.c b/target/arm/tcg/vec_helper.c index ee847745173..768f7458285 100644 --- a/target/arm/tcg/vec_helper.c +++ b/target/arm/tcg/vec_helper.c @@ -3099,3 +3099,25 @@ void HELPER(gvec_rbit_b)(void *vd, void *vn, uint32_t desc) } clear_tail(d, opr_sz, simd_maxsz(desc)); } + +void HELPER(gvec_urecpe_s)(void *vd, void *vn, uint32_t desc) +{ + intptr_t i, opr_sz = simd_oprsz(desc); + uint32_t *d = vd, *n = vn; + + for (i = 0; i < opr_sz / 4; ++i) { + d[i] = helper_recpe_u32(n[i]); + } + clear_tail(d, opr_sz, simd_maxsz(desc)); +} + +void HELPER(gvec_ursqrte_s)(void *vd, void *vn, uint32_t desc) +{ + intptr_t i, opr_sz = simd_oprsz(desc); + uint32_t *d = vd, *n = vn; + + for (i = 0; i < opr_sz / 4; ++i) { + d[i] = helper_rsqrte_u32(n[i]); + } + clear_tail(d, opr_sz, simd_maxsz(desc)); +} From patchwork Fri Dec 13 17:32:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850160 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1639918wry; Fri, 13 Dec 2024 09:37:53 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW9//H2NDfkQ2rIF7HX7wB8X6RY5vfBL3IZftLp0DLJozXtpvzFtZbvoWCNHwIQVagfrR6/HQ==@linaro.org X-Google-Smtp-Source: AGHT+IECBufy1PhoObiLJraDdS85PYnA+ha8URKHGmsw9foGBM5nVONeCRAFxFaKoaJjNc212TO4 X-Received: by 2002:a05:6402:51ce:b0:5d1:2631:b897 with SMTP id 4fb4d7f45d1cf-5d63c308eccmr3283053a12.14.1734111473097; Fri, 13 Dec 2024 09:37:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111473; cv=none; d=google.com; s=arc-20240605; b=D3QEIf/Utcey5QYctFVpsskDzEDxi7ENne8snQBMDi2uyZtu69VqhWY7YMToK0Nx7D frV8lLkFL1GHN0uqQM6K31A1kXK5eyV7BJihpBN0pz2svRLi96xy/mLRqiVdiKxOC8vL R/RLsMW70PAUU6aSbTYkLatTG2Bo/vYGo2AVgpnG0h5QnJUuwkbRpQ7rpZ/POcADr1fr VjWfCP7DcOk8X1XkxhgxSoAJJIcacL377uBvY1omdn7Mwcvo85ttmlBxZGW3NqzD2Jv+ 9FwaF1+d2s/r6vF6FySrnzFdIuTh3wTvSc7Lq+vPxrGCfqCMmtx1/Rt9OgvEfMNUZjZb Cglw== 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=PLy+/MFJVsBnaMYhANiuG7MuuzMJJdty2yJCk6wbBqc=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=LpHsVgSqFX4CztP2S10cD8SpXS/9DXfKVflI4mNOZC0A4b1XY1gOD7GOEWpEtLY0RM qfAXbRo+J4UvrFAqS9YPnbiU888u3pGIGq9RBqRK4UIYQaQErE3D9VNuRzeUuFN6mFE4 /7FsZfDMcwqfCltOgTN6O+bm0S5ykEnN8SiU4Pts61lXS83duMvDvnPr6e+urad6gEiQ 3xpNlpS/cV8EBw9Vt61nGnvQJrd+zeJh9+RSEvZHRM8lsG0RLLp6iGKe+gtC5K59/pv3 MPqBLI/xUnbc6YzLFF3s0N+rdilkjV6y+i6g2yAHWvO3OdT2SQGSMw/ij8JdIwPO4raD 7mCw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=W4tQdKHX; 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 4fb4d7f45d1cf-5d652add419si56293a12.56.2024.12.13.09.37.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:37: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=W4tQdKHX; 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 1tM9Zu-0007sM-OZ; Fri, 13 Dec 2024 12:35:50 -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 1tM9Y0-0008Gw-0Z for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:55 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9Xu-0001iq-At for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:51 -0500 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-385de9f789cso1544591f8f.2 for ; Fri, 13 Dec 2024 09:33:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111224; x=1734716024; 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=PLy+/MFJVsBnaMYhANiuG7MuuzMJJdty2yJCk6wbBqc=; b=W4tQdKHXppUKRFshudGj+jTmY5NbpqNa/xDHtliCSekmQJabL5ERsCN4+yQrq18ZtT sQHTygp4At4T0MzPP4LOenGaenJyymNJmQLxZzSI86Vt1Zw0hhqa3KJhKOJoIOkiciDc T8wLsns9p1rqKSv/ROcrfLqpJ3XrLE4JptXkkLGY4t4cxPf1CyMXNNbBel/9m2KyKuJi iOsSOdW0in+HLjCVe0n5sAANoXBGn3snndecVfYIdki68WxsvRBiN4ibZBfPSD2l4+BQ pDiGVdxYRd6hxTO4B4spffOUJKAMA4+JagLjEER+a2ZKtmgSxYrxOw73Us6Gq4oAKl3J qxUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111224; x=1734716024; 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=PLy+/MFJVsBnaMYhANiuG7MuuzMJJdty2yJCk6wbBqc=; b=ijk7/05fbJ6M2MQN6F/dI8xO1MuF2baxrRp1zJsg37QUxnKMCXJ1seKDliN9yq5Dp1 Y5fYBCbllKuxhWHvdqRNiMPW097CGrx5gVisEnEeq0H2+z0Z3iqLmiXuRTWJVxoCpJcr Pm7m7mak0IvKTTw8b+iaQyv7Swh2QkWSBa9qnwZ03wmGRfNMbtnmcACaAbacmWAllsNY wQJqAKkM95i1j0hJfA5eMhlfrwoRctSJnPp4EN4556+95aqQmaY/c/twsPjsBreztGWJ OBezENKvaeDR7JEy9PY08F1SHOr7eWnC3aJO+hh60Nu1HfBlymzqUUl0Nr9wm0ntwGTF IBLw== X-Gm-Message-State: AOJu0YwuTC3nWMRmoyapWUeKNXyiOXBrb1zah69x0zTaYxF+UK3KfsM5 7SvfIsFzJI4PCPaZjwcaU+UzLpChgtfTwrwCLzZDaANfvb61cET4Sr7CHSZA56SX2l1UHrl11eg 2 X-Gm-Gg: ASbGncv4q9k7/Xj9ZfzkQPyvK50xHKdxC3lzgVmT1Ifp3wzX9nFZJGjtbWN264JiOrw 4oZpbCs4ocbeOFGSbp+sfXvgMl1mgeveIWuxUy6JLnT7jk0mkIWxom5zXH8kXq1SjfjVAwvyyqV 1kRlyzfDMMhPvJi6i6eM/rWVzQvRxD16yFLxCb1rnUevAW7muRCgW+Q5jwkzRsKl9EMT0rnw9XL +CvBP7t1ivBP30MNfRwkg+aBtXaZqLBKtH/bjc6poMUNxYr9ipUFFID8jfgTw== X-Received: by 2002:a5d:59ad:0:b0:385:ed16:c97 with SMTP id ffacd0b85a97d-3889ad35736mr2234995f8f.49.1734111223759; Fri, 13 Dec 2024 09:33:43 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:43 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 68/85] target/arm: Convert URECPE and URSQRTE to decodetree Date: Fri, 13 Dec 2024 17:32:12 +0000 Message-Id: <20241213173229.3308926-69-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x432.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Remove handle_2misc_reciprocal as these were the last insns decoded by that function. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-69-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 3 + target/arm/tcg/translate-a64.c | 139 ++------------------------------- 2 files changed, 8 insertions(+), 134 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 9b3b09c3bb2..f35d123821c 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -1863,6 +1863,9 @@ FRECPE_v 0.00 1110 1.1 00001 11011 0 ..... ..... @qrr_sd FRSQRTE_v 0.10 1110 111 11001 11011 0 ..... ..... @qrr_h FRSQRTE_v 0.10 1110 1.1 00001 11011 0 ..... ..... @qrr_sd +URECPE_v 0.00 1110 101 00001 11001 0 ..... ..... @qrr_s +URSQRTE_v 0.10 1110 101 00001 11001 0 ..... ..... @qrr_s + &fcvt_q rd rn esz q shift @fcvtq_h . q:1 . ...... 001 .... ...... rn:5 rd:5 \ &fcvt_q esz=1 shift=%fcvt_f_sh_h diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 63cf25251b9..fa3170da860 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -9163,6 +9163,8 @@ TRANS(CMLE0_v, do_gvec_fn2, a, gen_gvec_cle0) TRANS(CMEQ0_v, do_gvec_fn2, a, gen_gvec_ceq0) TRANS(REV16_v, do_gvec_fn2, a, gen_gvec_rev16) TRANS(REV32_v, do_gvec_fn2, a, gen_gvec_rev32) +TRANS(URECPE_v, do_gvec_fn2, a, gen_gvec_urecpe) +TRANS(URSQRTE_v, do_gvec_fn2, a, gen_gvec_ursqrte) static bool do_gvec_fn2_bhs(DisasContext *s, arg_qrr_e *a, GVecGen2Fn *fn) { @@ -9506,51 +9508,6 @@ static gen_helper_gvec_2_ptr * const f_frsqrte[] = { }; TRANS(FRSQRTE_v, do_gvec_op2_fpst, a->esz, a->q, a->rd, a->rn, 0, f_frsqrte) -static void handle_2misc_reciprocal(DisasContext *s, int opcode, - bool is_scalar, bool is_u, bool is_q, - int size, int rn, int rd) -{ - bool is_double = (size == 3); - - if (is_double) { - g_assert_not_reached(); - } else { - TCGv_i32 tcg_op = tcg_temp_new_i32(); - TCGv_i32 tcg_res = tcg_temp_new_i32(); - int pass, maxpasses; - - if (is_scalar) { - maxpasses = 1; - } else { - maxpasses = is_q ? 4 : 2; - } - - for (pass = 0; pass < maxpasses; pass++) { - read_vec_element_i32(s, tcg_op, rn, pass, MO_32); - - switch (opcode) { - case 0x3c: /* URECPE */ - gen_helper_recpe_u32(tcg_res, tcg_op); - break; - case 0x3d: /* FRECPE */ - case 0x3f: /* FRECPX */ - case 0x7d: /* FRSQRTE */ - default: - g_assert_not_reached(); - } - - if (is_scalar) { - write_fp_sreg(s, rd, tcg_res); - } else { - write_vec_element_i32(s, tcg_res, rd, pass, MO_32); - } - } - if (!is_scalar) { - clear_vec_high(s, is_q, rd); - } - } -} - static void handle_2misc_widening(DisasContext *s, int opcode, bool is_q, int size, int rn, int rd) { @@ -9609,10 +9566,6 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) bool is_q = extract32(insn, 30, 1); int rn = extract32(insn, 5, 5); int rd = extract32(insn, 0, 5); - bool need_fpstatus = false; - int rmode = -1; - TCGv_i32 tcg_rmode; - TCGv_ptr tcg_fpstatus; switch (opcode) { case 0xc ... 0xf: @@ -9625,28 +9578,12 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) opcode |= (extract32(size, 1, 1) << 5) | (u << 6); size = is_double ? 3 : 2; switch (opcode) { - case 0x3c: /* URECPE */ - if (size == 3) { - unallocated_encoding(s); - return; - } - if (!fp_access_check(s)) { - return; - } - handle_2misc_reciprocal(s, opcode, false, u, is_q, size, rn, rd); - return; case 0x17: /* FCVTL, FCVTL2 */ if (!fp_access_check(s)) { return; } handle_2misc_widening(s, opcode, is_q, size, rn, rd); return; - case 0x7c: /* URSQRTE */ - if (size == 3) { - unallocated_encoding(s); - return; - } - break; default: case 0x16: /* FCVTN, FCVTN2 */ case 0x36: /* BFCVTN, BFCVTN2 */ @@ -9684,6 +9621,8 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) case 0x6d: /* FCMLE (zero) */ case 0x3d: /* FRECPE */ case 0x7d: /* FRSQRTE */ + case 0x3c: /* URECPE */ + case 0x7c: /* URSQRTE */ unallocated_encoding(s); return; } @@ -9708,75 +9647,7 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) unallocated_encoding(s); return; } - - if (!fp_access_check(s)) { - return; - } - - if (need_fpstatus || rmode >= 0) { - tcg_fpstatus = fpstatus_ptr(FPST_FPCR); - } else { - tcg_fpstatus = NULL; - } - if (rmode >= 0) { - tcg_rmode = gen_set_rmode(rmode, tcg_fpstatus); - } else { - tcg_rmode = NULL; - } - - { - int pass; - - assert(size == 2); - for (pass = 0; pass < (is_q ? 4 : 2); pass++) { - TCGv_i32 tcg_op = tcg_temp_new_i32(); - TCGv_i32 tcg_res = tcg_temp_new_i32(); - - read_vec_element_i32(s, tcg_op, rn, pass, MO_32); - - { - /* Special cases for 32 bit elements */ - switch (opcode) { - case 0x7c: /* URSQRTE */ - gen_helper_rsqrte_u32(tcg_res, tcg_op); - break; - default: - case 0x7: /* SQABS, SQNEG */ - case 0x2f: /* FABS */ - case 0x6f: /* FNEG */ - case 0x7f: /* FSQRT */ - case 0x18: /* FRINTN */ - case 0x19: /* FRINTM */ - case 0x38: /* FRINTP */ - case 0x39: /* FRINTZ */ - case 0x58: /* FRINTA */ - case 0x79: /* FRINTI */ - case 0x59: /* FRINTX */ - case 0x1e: /* FRINT32Z */ - case 0x5e: /* FRINT32X */ - case 0x1f: /* FRINT64Z */ - case 0x5f: /* FRINT64X */ - case 0x1a: /* FCVTNS */ - case 0x1b: /* FCVTMS */ - case 0x1c: /* FCVTAS */ - case 0x3a: /* FCVTPS */ - case 0x3b: /* FCVTZS */ - case 0x5a: /* FCVTNU */ - case 0x5b: /* FCVTMU */ - case 0x5c: /* FCVTAU */ - case 0x7a: /* FCVTPU */ - case 0x7b: /* FCVTZU */ - g_assert_not_reached(); - } - } - write_vec_element_i32(s, tcg_res, rd, pass, MO_32); - } - } - clear_vec_high(s, is_q, rd); - - if (tcg_rmode) { - gen_restore_rmode(tcg_rmode, tcg_fpstatus); - } + g_assert_not_reached(); } /* C3.6 Data processing - SIMD, inc Crypto From patchwork Fri Dec 13 17:32:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850213 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1643734wry; Fri, 13 Dec 2024 09:46:22 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXMe0+FkbZNIA8J1n2xs6BWjiSx4CQhZXcI1Q32oszqS8LuBXlY4CdKy+Tt60MO8uVWtJxxkQ==@linaro.org X-Google-Smtp-Source: AGHT+IH+46HZZ5UFxmQ6YDdE9TUIDWLPDdLyicthyzxXUj2QT8qIvnjIRXp6BC+nqawCwz+dCm1b X-Received: by 2002:a05:6000:717:b0:385:ebea:969d with SMTP id ffacd0b85a97d-38880ad91f1mr2338644f8f.22.1734111982371; Fri, 13 Dec 2024 09:46:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111982; cv=none; d=google.com; s=arc-20240605; b=NViDuK4OymeQif9/qxFsAF1Gk+v2nawwx2Zs6OMJ0fBXCgQ25Q93EhyhRaqfAMjA12 Q7bjywzDE8JqFSV/0RflOiIGSk2QoVsCtMJC5fruDAJ2sgIeH/LN5n7yrjsSrS5BCWuI XfWl2AIO0TFVM9XhjXGXTm/By1SMlUZli9oqAwkrCYX4sdVPMZaCnd5YMhpMi4dL9/k3 ucm8mMETpj9BK0272B2gFdNxjNJvmVDIkHOs2rH1zYJ8LaJsd8qWuzo76uoSky/dokpE 1q0UlhCuPCoO33svdbsFTwuqPIsBSkJW+qJMIVH5/giRg3Z01SehXOZW33hwqdRddXMV C0IQ== 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=Bg/iiVpN9EKFWgvja0txYOWPIgkXQ6VVFL3VOyL0qzI=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=jG9BURMMvs6RZ0Um3f9uicYjsCgY2ttlf+imwf4jr6YTv0j1i+iaCP0uR+fSPjihYg kirO+f9U3w7tnIfRS1TcbEEWDAhpkm6l2ZWyKOfR8X6aExII/XY9nrKPu2MmFzN/ZegP jqYKPvMe9cWVrEetNQpGutl558lc8YMkfngdXzkSLRKblPCx8b4RT8b9QZ1s69h4Py+H Rh9USqEhyHzVZGf1ZnJCPjQMMJY7OkRV7Anty04/DhfGRUFMMmJVqfqWYAvkoqRQVvyO lF6aLiNnzlr+qPBI3eT0fpF11y1UG1Y78NMeCgQxO0ql+HV3E84amrlbwTntdxPoiYUb y90Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=T71OSNdR; 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 ffacd0b85a97d-388c8074be8si32134f8f.896.2024.12.13.09.46.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:46: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=T71OSNdR; 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 1tM9YV-0002WZ-2i; Fri, 13 Dec 2024 12:34:23 -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 1tM9Y0-0008Gx-Be for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:55 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9Xu-0001jG-Hm for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:51 -0500 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-382610c7116so986770f8f.0 for ; Fri, 13 Dec 2024 09:33:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111225; x=1734716025; 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=Bg/iiVpN9EKFWgvja0txYOWPIgkXQ6VVFL3VOyL0qzI=; b=T71OSNdRTnY6aP62Pf2GZ4I+04sJslF7gN/Wtv5xSNTbFKW2PdsiaiS8QshnHUn1My lvnzEoUqsZQCMSFbh8FiRbtbQ8S5fj71XX5XldkwGbYTHjyGhy06We3mCJCQJJcstrT6 3rfZ9M43qnuJklzOEfeill36CGi3yKhtkY1n34/n/3gTmH5CyI9B2ARe5XIazuKkR8qm tPXhuM8I7oYfbpR+H4ZwsVYkgTkhsyefiUNOn7F4ElzCO7/meePWDRrfBygo2p08CZg9 cSaQvVuX6PQWT6WV901vXg+vqKljmIXVExFckz8liS1OqzZjYtfNDVQe+7twdo0ZiLJI r14g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111225; x=1734716025; 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=Bg/iiVpN9EKFWgvja0txYOWPIgkXQ6VVFL3VOyL0qzI=; b=xUsvatDTgxZAAKiRh+nY66JdWZJiWFvMSFASHyFx+DsDw8u05deplXRnRQGfoIkJc0 7l2JfldOJeqv2LfiMA/Zv8dsvi1gIyiHEyYQ8N+m2ZQnTWtpR+Dt/8ea//AaJJA4C2lx YVDoabrsf7cTPspHNjPodH5dKFn3q+m6qDgHb9o5pxHjJ+9ZfquqKLNcCHcWUSNeIBZ2 fX6xWu5OgdRTIGix2aIkaw4x3q3WecbwOdVnWezeJ7vYe1um4AO+9EWuS3IoX7fYHmsF rMLGkJFXPDoS+ZjvVH469teGI6PeakEyB1/Gen23daGs25TSuFsO9gR9TwPs5I4A2j2W JaHQ== X-Gm-Message-State: AOJu0YwxUMuILN5tOb5Cb0FTDWwOxWzw69/GYgmhOo27uTRzV8D71c64 BxmuhM1HpTw7J+YrlAV7FsWtuxQrGNbZV6vUW1TZwdH2jUS9/4C9qbg06mQhWzAxC0I53UUzhhc K X-Gm-Gg: ASbGnctafcy9UX63oNIIO3Idmo2Adel4DVSJxl326MtPIjKzSU5i3eDDw5dG4hPHinH BamvGPUT8iYzIGoxK76+0GGr4ZzNRnHKTG5U84MVhAAcVuiXNRf1aLLk9BOF3m2zoUwotnyEMmj 7dV0EYgSMLDhyOkEvfzdAi38h1bBaNn3Vj0TjN7ScZxAn9tO2AGa/SX1QRREmH7/9TUxQ80pZjx h0LqIOvfGOb3HPLWyYSEd2cVAa7pwMFD581SN+JKemOd1ZoAhRy/43Agd2A/g== X-Received: by 2002:a5d:6daa:0:b0:385:e38f:8dd with SMTP id ffacd0b85a97d-3888e0b8e56mr2845091f8f.46.1734111225119; Fri, 13 Dec 2024 09:33:45 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:44 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 69/85] target/arm: Convert FCVTL to decodetree Date: Fri, 13 Dec 2024 17:32:13 +0000 Message-Id: <20241213173229.3308926-70-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x432.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Remove lookup_disas_fn, handle_2misc_widening, disas_simd_two_reg_misc, disas_data_proc_simd, disas_data_proc_simd_fp, disas_a64_legacy, as this is the final insn to be converted. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-70-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 2 + target/arm/tcg/translate-a64.c | 202 +++------------------------------ 2 files changed, 18 insertions(+), 186 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index f35d123821c..7aa10f51471 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -1866,6 +1866,8 @@ FRSQRTE_v 0.10 1110 1.1 00001 11011 0 ..... ..... @qrr_sd URECPE_v 0.00 1110 101 00001 11001 0 ..... ..... @qrr_s URSQRTE_v 0.10 1110 101 00001 11001 0 ..... ..... @qrr_s +FCVTL_v 0.00 1110 0.1 00001 01111 0 ..... ..... @qrr_sd + &fcvt_q rd rn esz q shift @fcvtq_h . q:1 . ...... 001 .... ...... rn:5 rd:5 \ &fcvt_q esz=1 shift=%fcvt_f_sh_h diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index fa3170da860..3e57b98c27f 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -1465,31 +1465,6 @@ static inline void gen_check_sp_alignment(DisasContext *s) */ } -/* - * This provides a simple table based table lookup decoder. It is - * intended to be used when the relevant bits for decode are too - * awkwardly placed and switch/if based logic would be confusing and - * deeply nested. Since it's a linear search through the table, tables - * should be kept small. - * - * It returns the first handler where insn & mask == pattern, or - * NULL if there is no match. - * The table is terminated by an empty mask (i.e. 0) - */ -static inline AArch64DecodeFn *lookup_disas_fn(const AArch64DecodeTable *table, - uint32_t insn) -{ - const AArch64DecodeTable *tptr = table; - - while (tptr->mask) { - if ((insn & tptr->mask) == tptr->pattern) { - return tptr->disas_fn; - } - tptr++; - } - return NULL; -} - /* * The instruction disassembly implemented here matches * the instruction encoding classifications in chapter C4 @@ -9508,8 +9483,7 @@ static gen_helper_gvec_2_ptr * const f_frsqrte[] = { }; TRANS(FRSQRTE_v, do_gvec_op2_fpst, a->esz, a->q, a->rd, a->rn, 0, f_frsqrte) -static void handle_2misc_widening(DisasContext *s, int opcode, bool is_q, - int size, int rn, int rd) +static bool trans_FCVTL_v(DisasContext *s, arg_qrr_e *a) { /* Handle 2-reg-misc ops which are widening (so each size element * in the source becomes a 2*size element in the destination. @@ -9517,173 +9491,43 @@ static void handle_2misc_widening(DisasContext *s, int opcode, bool is_q, */ int pass; - if (size == 3) { + if (!fp_access_check(s)) { + return true; + } + + if (a->esz == MO_64) { /* 32 -> 64 bit fp conversion */ TCGv_i64 tcg_res[2]; - int srcelt = is_q ? 2 : 0; + TCGv_i32 tcg_op = tcg_temp_new_i32(); + int srcelt = a->q ? 2 : 0; for (pass = 0; pass < 2; pass++) { - TCGv_i32 tcg_op = tcg_temp_new_i32(); tcg_res[pass] = tcg_temp_new_i64(); - - read_vec_element_i32(s, tcg_op, rn, srcelt + pass, MO_32); + read_vec_element_i32(s, tcg_op, a->rn, srcelt + pass, MO_32); gen_helper_vfp_fcvtds(tcg_res[pass], tcg_op, tcg_env); } for (pass = 0; pass < 2; pass++) { - write_vec_element(s, tcg_res[pass], rd, pass, MO_64); + write_vec_element(s, tcg_res[pass], a->rd, pass, MO_64); } } else { /* 16 -> 32 bit fp conversion */ - int srcelt = is_q ? 4 : 0; + int srcelt = a->q ? 4 : 0; TCGv_i32 tcg_res[4]; TCGv_ptr fpst = fpstatus_ptr(FPST_FPCR); TCGv_i32 ahp = get_ahp_flag(); for (pass = 0; pass < 4; pass++) { tcg_res[pass] = tcg_temp_new_i32(); - - read_vec_element_i32(s, tcg_res[pass], rn, srcelt + pass, MO_16); + read_vec_element_i32(s, tcg_res[pass], a->rn, srcelt + pass, MO_16); gen_helper_vfp_fcvt_f16_to_f32(tcg_res[pass], tcg_res[pass], fpst, ahp); } for (pass = 0; pass < 4; pass++) { - write_vec_element_i32(s, tcg_res[pass], rd, pass, MO_32); + write_vec_element_i32(s, tcg_res[pass], a->rd, pass, MO_32); } } -} - -/* AdvSIMD two reg misc - * 31 30 29 28 24 23 22 21 17 16 12 11 10 9 5 4 0 - * +---+---+---+-----------+------+-----------+--------+-----+------+------+ - * | 0 | Q | U | 0 1 1 1 0 | size | 1 0 0 0 0 | opcode | 1 0 | Rn | Rd | - * +---+---+---+-----------+------+-----------+--------+-----+------+------+ - */ -static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) -{ - int size = extract32(insn, 22, 2); - int opcode = extract32(insn, 12, 5); - bool u = extract32(insn, 29, 1); - bool is_q = extract32(insn, 30, 1); - int rn = extract32(insn, 5, 5); - int rd = extract32(insn, 0, 5); - - switch (opcode) { - case 0xc ... 0xf: - case 0x16 ... 0x1f: - { - /* Floating point: U, size[1] and opcode indicate operation; - * size[0] indicates single or double precision. - */ - int is_double = extract32(size, 0, 1); - opcode |= (extract32(size, 1, 1) << 5) | (u << 6); - size = is_double ? 3 : 2; - switch (opcode) { - case 0x17: /* FCVTL, FCVTL2 */ - if (!fp_access_check(s)) { - return; - } - handle_2misc_widening(s, opcode, is_q, size, rn, rd); - return; - default: - case 0x16: /* FCVTN, FCVTN2 */ - case 0x36: /* BFCVTN, BFCVTN2 */ - case 0x56: /* FCVTXN, FCVTXN2 */ - case 0x2f: /* FABS */ - case 0x6f: /* FNEG */ - case 0x7f: /* FSQRT */ - case 0x18: /* FRINTN */ - case 0x19: /* FRINTM */ - case 0x38: /* FRINTP */ - case 0x39: /* FRINTZ */ - case 0x59: /* FRINTX */ - case 0x79: /* FRINTI */ - case 0x58: /* FRINTA */ - case 0x1e: /* FRINT32Z */ - case 0x1f: /* FRINT64Z */ - case 0x5e: /* FRINT32X */ - case 0x5f: /* FRINT64X */ - case 0x1d: /* SCVTF */ - case 0x5d: /* UCVTF */ - case 0x1a: /* FCVTNS */ - case 0x1b: /* FCVTMS */ - case 0x3a: /* FCVTPS */ - case 0x3b: /* FCVTZS */ - case 0x5a: /* FCVTNU */ - case 0x5b: /* FCVTMU */ - case 0x7a: /* FCVTPU */ - case 0x7b: /* FCVTZU */ - case 0x5c: /* FCVTAU */ - case 0x1c: /* FCVTAS */ - case 0x2c: /* FCMGT (zero) */ - case 0x2d: /* FCMEQ (zero) */ - case 0x2e: /* FCMLT (zero) */ - case 0x6c: /* FCMGE (zero) */ - case 0x6d: /* FCMLE (zero) */ - case 0x3d: /* FRECPE */ - case 0x7d: /* FRSQRTE */ - case 0x3c: /* URECPE */ - case 0x7c: /* URSQRTE */ - unallocated_encoding(s); - return; - } - break; - } - default: - case 0x0: /* REV64, REV32 */ - case 0x1: /* REV16 */ - case 0x2: /* SADDLP, UADDLP */ - case 0x3: /* SUQADD, USQADD */ - case 0x4: /* CLS, CLZ */ - case 0x5: /* CNT, NOT, RBIT */ - case 0x6: /* SADALP, UADALP */ - case 0x7: /* SQABS, SQNEG */ - case 0x8: /* CMGT, CMGE */ - case 0x9: /* CMEQ, CMLE */ - case 0xa: /* CMLT */ - case 0xb: /* ABS, NEG */ - case 0x12: /* XTN, XTN2, SQXTUN, SQXTUN2 */ - case 0x13: /* SHLL, SHLL2 */ - case 0x14: /* SQXTN, SQXTN2, UQXTN, UQXTN2 */ - unallocated_encoding(s); - return; - } - g_assert_not_reached(); -} - -/* C3.6 Data processing - SIMD, inc Crypto - * - * As the decode gets a little complex we are using a table based - * approach for this part of the decode. - */ -static const AArch64DecodeTable data_proc_simd[] = { - /* pattern , mask , fn */ - { 0x0e200800, 0x9f3e0c00, disas_simd_two_reg_misc }, - { 0x00000000, 0x00000000, NULL } -}; - -static void disas_data_proc_simd(DisasContext *s, uint32_t insn) -{ - /* Note that this is called with all non-FP cases from - * table C3-6 so it must UNDEF for entries not specifically - * allocated to instructions in that table. - */ - AArch64DecodeFn *fn = lookup_disas_fn(&data_proc_simd[0], insn); - if (fn) { - fn(s, insn); - } else { - unallocated_encoding(s); - } -} - -/* C3.6 Data processing - SIMD and floating point */ -static void disas_data_proc_simd_fp(DisasContext *s, uint32_t insn) -{ - if (extract32(insn, 28, 1) == 1 && extract32(insn, 30, 1) == 0) { - unallocated_encoding(s); /* in decodetree */ - } else { - /* SIMD, including crypto */ - disas_data_proc_simd(s, insn); - } + clear_vec_high(s, true, a->rd); + return true; } static bool trans_OK(DisasContext *s, arg_OK *a) @@ -9749,20 +9593,6 @@ static bool btype_destination_ok(uint32_t insn, bool bt, int btype) return false; } -/* C3.1 A64 instruction index by encoding */ -static void disas_a64_legacy(DisasContext *s, uint32_t insn) -{ - switch (extract32(insn, 25, 4)) { - case 0x7: - case 0xf: /* Data processing - SIMD and floating point */ - disas_data_proc_simd_fp(s, insn); - break; - default: - unallocated_encoding(s); - break; - } -} - static void aarch64_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cpu) { @@ -9965,7 +9795,7 @@ static void aarch64_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu) if (!disas_a64(s, insn) && !disas_sme(s, insn) && !disas_sve(s, insn)) { - disas_a64_legacy(s, insn); + unallocated_encoding(s); } /* From patchwork Fri Dec 13 17:32:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850153 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1639315wry; Fri, 13 Dec 2024 09:36:41 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXI0NjKo8om+6cf4dvgVl0JVOVvlT0SoLMu/Cvj2pnI++S4P++M+jKosCrjQJhgs02IZVataA==@linaro.org X-Google-Smtp-Source: AGHT+IFF819SdnbQ02RBJzoyb5TquSuUWGeR9MnCk5vTHo2sscL1X4BrGqJHI9rO0Md0wmwzK0EZ X-Received: by 2002:a05:6000:1fa2:b0:386:3357:2d9d with SMTP id ffacd0b85a97d-3888e0f2de1mr2650770f8f.36.1734111401310; Fri, 13 Dec 2024 09:36:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111401; cv=none; d=google.com; s=arc-20240605; b=WKNqEr+LV5i1rF1vX0m/jVj3rXJznoBqnSLyjURiMu7nVxEF5pM9nMZA5j2woiEFir qeoggVpRBHqoGVPmdnUKurYlCJWFm/SQupsZd/YDtFQMEee31njita7dXCT8VUEHOpPb RwryQ0yOBOekLc4i3jNx/nDzNj+i2cVpzLg9yM0A3ZHm7uPmI1bCxcDUGyq4b0xYEC8U PJHrvHReffBtVV4Xk5QYxsBe6elpjnvP7YYxgqVO6V+J/O1c6NQrGi4ftzvAT1mAnyT3 Jc46SJFyrlirqbJfSsgYfVw372DnrPm71ikk3nf8hME5GrcXkedtSuvahjElygYd3xkl W2ww== 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=4Tvdd/VSuAoXtZ7lXIE2S/8K11Z6fStvv2Pl+2QKZyA=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=lSFSImaOOXL10TaBt0TmprQs8ujiPehL1u7GIPdgV5c3J8R09BNhr18ujRMi8oJDPe CLNMN9oMK6v2s5a/QDtjcF4VtmcNw/12AfULdEwJrkd+DFw615QR2h53xNcWjZiSgNED arw3wrQmfz4mPI/LZkLaqEhLgObpLjOvJwP52rfYgtwUWUVFubDg8e8uau+marYjPSvp JukFe28iEtfSmwmyt798gI+BtG/WLckHLkxi4j5D0CyRlsc9rDTghcNVA/LilYgkk+Nk A2SmFQYNNWunuJwpuWwROrr0a6QJmnn/fCC5nvSELTDyuKt6D77/nCxyNAtd/dRJ6KQo +fTQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gwMvsFkV; 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 5b1f17b1804b1-4362580f9e8si22754445e9.191.2024.12.13.09.36.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:36:41 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gwMvsFkV; 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 1tM9aO-0000ZV-Ib; Fri, 13 Dec 2024 12:36:21 -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 1tM9Y5-0008MD-TJ for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:58 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9Xy-0001jO-Cj for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:57 -0500 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-3862f32a33eso985782f8f.3 for ; Fri, 13 Dec 2024 09:33:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111226; x=1734716026; 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=4Tvdd/VSuAoXtZ7lXIE2S/8K11Z6fStvv2Pl+2QKZyA=; b=gwMvsFkVvQvGJ29VHbPGqKdBQkGHMmw/eDvdfFJf7vSd/Rl/uPTgMlIEHwIIDgPQjn Pruc5odOJI1itIqQ0sQklSKs2ek6/lqIsN/TAtXjHsC+WNfIdvIodTm7H9RbpTcg88J8 nQVd/6nKA/6ychrbEKhigUmAiGXBEUEZGztm4ErEz0sQgbdzvdk73IrHJPjq3bUhlVSi A7X7jgS+JPHQUyvaDIDnT5buFVZz4dj31ov6WjCWDL0IquXvACTKMRJ0LSO95OnaLzwq Ju9BM5V3+v3LySIQ59lQ1eOMen9BhD7hNbZI6cIgYm1JtpbUtVUgvZ8VXDSG03M+HFw4 fj9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111226; x=1734716026; 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=4Tvdd/VSuAoXtZ7lXIE2S/8K11Z6fStvv2Pl+2QKZyA=; b=rrLeo2oSBhp5BlwgsWYDHvIfalYluUPGNRId3B96pOmf+5SnaDHyUmEQ/EkvikcCwn IUq8DfxB+gfSoh5ZGYMT7OQbx3/v2JGtg72N4VnYn1uuTB3l/8+vDBvKCLgZMlaFlBOo zbILYvp199p1GhKuQ0mT4pPjNHps96Mf+gbdL78+byzlMMFf4eUHKBR05twzAWgA0PW5 iV/8BVz71g/DDfieh2rbGh9nWyAW6gNEa4t/ZV4wNEKOAiFYlPdIGh4un+azZIX4xfEo yQWeRPz8UJJxG9Sxopmp3h22JpvLkPTCyVMa8gt4aPpuoDgZv8K67sGiZoMM7V1acwFU Ejiw== X-Gm-Message-State: AOJu0YzigqTunZOhHtGre5sSJBuHbh/eVxGYOxZgZJndmq2Sa2h/ZoK3 OpM2GyBRGqYfLTqevX7lZVOS2oNamSUi6Oh4WwawuKdNUg8xnlgpCyEsDkHVZpqam4BYJ23+XPl F X-Gm-Gg: ASbGncvCk5z0jRn8+JfRzufPF12sttJ9pMfK6cBoOH/ImuzxbvHdI4zDifrwdQ5nwd3 i94mSTZuFeKhUfmxyfKcNm3CnFtWY0F5ud/lbtXyQskkDHkPjG6mhohkSO4L5ZTa9T051lnOj6o ZTh3/SuP/XDmjBuj5MQFi2PkLgvY3uUYXcEJzEaddH7lsP+AehUfdvqkkY/BNqeun4edLELP2pF K6jrHmNbegiv6lOh/ftf6jDsmYVmUkt5Uc8cbng9k0qmHKEGRY0Hbxb30BLkg== X-Received: by 2002:a5d:6d8f:0:b0:385:e43a:4dd8 with SMTP id ffacd0b85a97d-38880af1458mr2823540f8f.4.1734111226023; Fri, 13 Dec 2024 09:33:46 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:45 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 70/85] target/arm: Use float_round_to_odd in helper_fcvtx_f64_to_f32 Date: Fri, 13 Dec 2024 17:32:14 +0000 Message-Id: <20241213173229.3308926-71-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42c.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, T_SPF_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Softfloat has native support for round-to-odd. Use it. Signed-off-by: Richard Henderson Message-id: 20241206031428.78634-1-richard.henderson@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target/arm/tcg/helper-a64.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/target/arm/tcg/helper-a64.c b/target/arm/tcg/helper-a64.c index 28de7468cd1..fb6fe0fcaa9 100644 --- a/target/arm/tcg/helper-a64.c +++ b/target/arm/tcg/helper-a64.c @@ -408,23 +408,13 @@ float64 HELPER(frecpx_f64)(float64 a, void *fpstp) float32 HELPER(fcvtx_f64_to_f32)(float64 a, CPUARMState *env) { - /* Von Neumann rounding is implemented by using round-to-zero - * and then setting the LSB of the result if Inexact was raised. - */ float32 r; float_status *fpst = &env->vfp.fp_status; - float_status tstat = *fpst; - int exflags; + int old = get_float_rounding_mode(fpst); - set_float_rounding_mode(float_round_to_zero, &tstat); - set_float_exception_flags(0, &tstat); - r = float64_to_float32(a, &tstat); - exflags = get_float_exception_flags(&tstat); - if (exflags & float_flag_inexact) { - r = make_float32(float32_val(r) | 1); - } - exflags |= get_float_exception_flags(fpst); - set_float_exception_flags(exflags, fpst); + set_float_rounding_mode(float_round_to_odd, fpst); + r = float64_to_float32(a, fpst); + set_float_rounding_mode(old, fpst); return r; } From patchwork Fri Dec 13 17:32:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850204 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1643392wry; Fri, 13 Dec 2024 09:45:44 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUhIIEQLv5ZWo4m6WLBcipyZ7vDyg2SMybxFF0etxvvcaRuC/QWx6gMzQ2zx45RXvooo8KF+A==@linaro.org X-Google-Smtp-Source: AGHT+IEYj39rtX5vNMdUXqCNxe5aceP9cdp0xBTPMaHxBnaC1jqh7NpLb0LD7mpj9kZqxO/FXXse X-Received: by 2002:a17:907:940e:b0:aa6:5385:90ef with SMTP id a640c23a62f3a-aab77ee9f36mr441771166b.61.1734111944293; Fri, 13 Dec 2024 09:45:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111944; cv=none; d=google.com; s=arc-20240605; b=Rr/xexBWZSTD1F5AzZzD/cVAWm/DyDxLGRqk5B0i8Y06hOOdytqINoJaco55H4YG+G gIWtpKZFK96fv7rnGx+4eKcxIniiUrUdOt860ZjyiVAzEoC+mineT+zLDbrXvlvLzqMe uVQRbtY2Cce5FRN/CCrLLwN6NXcm+OkRGEnUGTHheJRMEApvByFy+qASkfOBlCH69p0R 0tWhlE60vjYKfb/yRzFHkLIAJJAET1/HR4w0rak8qrGIFWDnAEyJucRRtUQpFvyNnW6p mMm1shODyf4j+Zg2BK8YoXvP/IUAwtApiKe7eyx5BClfY+G8wXI/H4zWULP9sf0rcN3z rCBw== 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=PBFuTHZDcPncuwYvvsk4kRJzR/9xPxvQn/qSMVquJ4E=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=JmjSLRsngRDcp2y3vD9tYxBjGs6idCgNw7hOUWJLxLu6ckj9io5IklxRAmUb7IgIeZ +VJThX0CRRo7JnK/H/b/N64uft88zoUEtXAcXDhaLMBiDNePsN+dAEqp4ur6Riq44RRx kxDcqr2SsysUiMcnxKonnH8JfYcRuHPmo5WuwkpkMz4OPnj26ZNRLm9gO3Xplgy8y86J 2ossoJ2RN//DqnaEaMkyKcXbJELmAbzIfGldH0sGZ91ZTII42TcHLCUooPyc6zUqLCOM e20KA+MtuZY32zsofCfCtvZofru3p89/ABQKULur7j/OVRCyC25t+tVL94D5rWZEXAxt xt4w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dAFIg2uJ; 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 a640c23a62f3a-aa6b730ef94si408147666b.797.2024.12.13.09.45.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:45:44 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dAFIg2uJ; 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 1tM9af-0001hQ-VJ; Fri, 13 Dec 2024 12:36:38 -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 1tM9Y2-0008HY-Sh for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:57 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9Xy-0001jZ-Jc for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:54 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-43625c4a50dso13995965e9.0 for ; Fri, 13 Dec 2024 09:33:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111227; x=1734716027; 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=PBFuTHZDcPncuwYvvsk4kRJzR/9xPxvQn/qSMVquJ4E=; b=dAFIg2uJbAKMMaGaHURNMm0O/wz5nhNk+d4DaabzZAwEj1ZA5M7492iiwxh/8rAx3F 2hNe989kOV0H8fp0wmwpe1mSqJgF6DuK7Aq48aw7FAEL3Vzyb3e9UiEGBNsUvY5NzMQl tf4OpOmMTar32VdLZBVtBIMROkFmpC47vBVFQtVjkkVvNghO3U5GPCplFdUbMjYl8W53 m9+3cKKPUzHVuCJ7Z8bQr2TbHAwAwhoCtRUlOfrXzcFKM+zQRI/Bp0d8srDOxdmNkcNF l2x76JeMk9RdmQ91jSujy+aa2beRVxLM1CjdAd7r3cqlQMTCOxVCC/2XAXNwdlySLvp9 Sasw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111227; x=1734716027; 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=PBFuTHZDcPncuwYvvsk4kRJzR/9xPxvQn/qSMVquJ4E=; b=eqAVmLJ3OoJZ95Dv0fjgCTYacFE26yOXpEugMZfzkvqYS0vPloz2DCR75dGs33L3AX KHE4e+anyrQ+rvoGJoRknT8WkziVjIMpZtVZ15tw754r/zmGkPpnO5mkMixeExKOi0Cp ZyvZjMNqHq/gk9PfXnruyP6Mw4iUcxnesKiEAsUgoybvyzWycg/f9O79QDRa9qm8HURT RL3X6VBBW0GCsbZCL9usXohNOwGAaxtGt845/SoMMfgEPaoWvn0+ti5RCQfeUyvqotdi SmqFJSjPDkfo45XZi14nGTAWxTKWw3EBwqNL53SPmyAX1OizAWkQgc3gpMIcOxMo73ek aT/Q== X-Gm-Message-State: AOJu0YyNZvNYUq+/1qePbeKg3/Ixyk7h4WsaVEV6Py+3weZDCey0uD9H DrM2tn4PmBGVCEIU0vj0jr7VPvJ/gjK15ceyxIfWQn0AIrmmn0vjKjKdMRbLdSHRMScJA9vp9/B D X-Gm-Gg: ASbGncszwDkFBProK5boJJ/g0evtB2vyQzKY+RYD/hBKSMOTY7QFG5UMalK55PQA+8b dVtyIDY2r7qendMxDSVU0OXSshCggQEqtXv2/RFGM25Spj8cLg1vPWA3gIyJpvhSOp4iNQYpiyr 9pcUmSkc/1SSAlC+BcV866oOncJHDxvCJfjxJGdvZ7nO4wuQiCFYSnduzgENWu8WZVufrVFBWM+ gVMNkIWAy6thmemIUqu/3vSgq2mqNl2kDxlqiu93DNkyeFVM8Ay74QBH1wIAQ== X-Received: by 2002:a05:600c:3ba1:b0:434:fddf:5bfd with SMTP id 5b1f17b1804b1-4362aa1473bmr25634335e9.5.1734111227103; Fri, 13 Dec 2024 09:33:47 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:46 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 71/85] docs/system/arm/orangepi: update links Date: Fri, 13 Dec 2024 17:32:15 +0000 Message-Id: <20241213173229.3308926-72-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x334.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: Pierrick Bouvier www.orangepi.org does not support https, it's expected to stick to http. Reviewed-by: Niek Linnenbank Signed-off-by: Pierrick Bouvier Message-id: 20241206192254.3889131-2-pierrick.bouvier@linaro.org Signed-off-by: Peter Maydell --- docs/system/arm/orangepi.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/system/arm/orangepi.rst b/docs/system/arm/orangepi.rst index 9afa54213b0..db87e81fec4 100644 --- a/docs/system/arm/orangepi.rst +++ b/docs/system/arm/orangepi.rst @@ -119,7 +119,7 @@ Orange Pi PC images Note that the mainline kernel does not have a root filesystem. You may provide it with an official Orange Pi PC image from the official website: - http://www.orangepi.org/downloadresources/ + http://www.orangepi.org/html/serviceAndSupport/index.html Another possibility is to run an Armbian image for Orange Pi PC which can be downloaded from: @@ -213,7 +213,7 @@ including the Orange Pi PC. NetBSD 9.0 is known to work best for the Orange Pi P board and provides a fully working system with serial console, networking and storage. For the Orange Pi PC machine, get the 'evbarm-earmv7hf' based image from: - https://cdn.netbsd.org/pub/NetBSD/NetBSD-9.0/evbarm-earmv7hf/binary/gzimg/armv7.img.gz + https://archive.netbsd.org/pub/NetBSD-archive/NetBSD-9.0/evbarm-earmv7hf/binary/gzimg/armv7.img.gz The image requires manually installing U-Boot in the image. Build U-Boot with the orangepi_pc_defconfig configuration as described in the previous section. From patchwork Fri Dec 13 17:32:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850191 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1642423wry; Fri, 13 Dec 2024 09:43:22 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXYJ2edvK/vNdA1J96QuDJKCxGT6FWkElfUNY2wl7BQfyoNe/BPLRjOVD+7+L8Z1R2R2yCwPQ==@linaro.org X-Google-Smtp-Source: AGHT+IE5AM6MASmSrm/5X2PHgQG2Fn8X7kOaxZZP123qdazKk38bTGInw8MpHcO/lgXSzChq3eFu X-Received: by 2002:a05:6402:2b94:b0:5d3:cdb3:a66 with SMTP id 4fb4d7f45d1cf-5d63c32efc0mr3235022a12.18.1734111802088; Fri, 13 Dec 2024 09:43:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111802; cv=none; d=google.com; s=arc-20240605; b=K+uDeewB6SvdJkN/TV+6AFE5f4S2FiV/6vzBB0fiRat+jxym4xaSOri1qMkwydTx/q f9blirZOj6xcJubWP3yLLWoiGw7p8RUlzWL39HVFY3Oa7haLBDh/ufpj58aBjuHuS68s NZ0b14W1we4L5VfUADpJkvtvTzb3BgR00UhvhRiEMrN/clPE0Mm5lp6if6BW9F4Sus5Z PQgPGJK/LeG4p1Fqp5OrPylOcd43OSZ3mhcASxqOXoHhKY0nPQ3t6kzGDPVjC2IPvrcD vgipXiVPjFSqBtr3HhV9/d4ROXPldI4M7k/S4IYWFzWGpYpfK4VVwSWcEr/gyziico7h UvWg== 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=0Sy7P0n6dA4Q78sOSEQL1CmMwGaZp6w4fKZORHOrLdc=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=WddjZ+sjma/uBTdFfMQpuKJQw7z03RufOdrS48wqCSYO7r0TdEgZQmFL5VuvGL/E2Y br3/tRTIDh05Db8G4bi3I/Wa9Sbcd/0SlOBMFeJwW27Xbl285mXbprC/mYQxj3kympdx SyP99ZmUyUOBVn5Q6LES1TPbhSpSpkOxcHYxDq36TTQohUNsN2JV1hpJp8/TWxjk+LRh c6AfmQdkuUxK212KaAu8SggYnvrq95ARH5u6QVN7s5WNVqTqMDFvdamZ+RymaG6QPUfE 0HRJ9nOg/RPxMX1wx75F7ASAtP37H5ZnxAZHxGwna2PoOeUVSRFDa+FuDe9z9wcVC2Rj +TGg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hFvQV3Oo; 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 4fb4d7f45d1cf-5d652f53374si44490a12.324.2024.12.13.09.43.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:43: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=hFvQV3Oo; 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 1tM9Yg-000451-9g; Fri, 13 Dec 2024 12:34:34 -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 1tM9Y1-0008HU-SZ for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:57 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9Xx-0001jx-TK for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:53 -0500 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-4361a50e337so14511005e9.0 for ; Fri, 13 Dec 2024 09:33:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111228; x=1734716028; 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=0Sy7P0n6dA4Q78sOSEQL1CmMwGaZp6w4fKZORHOrLdc=; b=hFvQV3OoOFvXdEm6204VY/NKuKREf7MzB8uSFhOwVtGBloeIARhCLnl4qpN77+aOTs u2xqDL+KqCt9mlnTDp7rZ/BY13vIhQpk93wk5P/ik3wFpxnAFv5KT1U+aTjqOZPl11hV y/KZNGe05DjQGjz/zJvNvs996lcqWj0xyJXoxogqhErZ9vNABZSJroRlm/q2anLUIQG2 ZlQt+qlvoX4j4BauAFR+KwE7yydb58RMp9WYVJCAOpEb3VU7Bcb2OUBnuWVysIHts3K2 W6gg3SO1TecCC9N6JfQLxK55ovJL1nwb60s5IF5cV425nUrsNw2bmLarXpkF4BMzYjba 402A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111228; x=1734716028; 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=0Sy7P0n6dA4Q78sOSEQL1CmMwGaZp6w4fKZORHOrLdc=; b=wW06+8nT91GjaufuF0LQRKhoA3iD9FOy2GbDOr1pfGDvNV+YMY6YEPqYH8h2vTJmTN Rqb4wvpmNGPBfalxH+vS5jdkQeMxcf2hdzuJnpyPor+4ytgdut6+pUQL7iWGDnyqNEeT RN+GYBY6sQHt996/VIY9zaZW5cMxKxJxf1prfbfZ3FLnGbU9d1xrG+Cp/M5eV0bn/jgC YP+NcV/g6wt9JKXUSvjjHcofyF7ilFByZ7fo6VDRfPdFeWCixUsYkHFIV+OpVrYn9P7a Q5CjtFzfwsZw3/mSnoywYW/efDn+7NWs4rTlI0S7BNkCyVt2SwooXrfS0XOnNprNpBjv CiEg== X-Gm-Message-State: AOJu0Yyl++PSqWq4EsWEeB8MNS1mvmW4GXOq9V4NN6nWPzLtSndhTfC9 mhc0DgB+lHRmHLL19NA0hKJ0w1LQ0cxOy3Rtf7erK74pCidUZqkrGOnecJtJQp8F8IIhgfOw7Wb f X-Gm-Gg: ASbGncv7w69oSlm//zgzR9cHAWYHzVQFoTNj0Tr/WY+pHpueXWH3TpYioVxXh43TVhF eDgez95or8OlweAfgvqQBtAYTVMDUS45pVdJ1U3sy6lxTpBhlUV/tPEA1rDNcRKUvsB++UeBBd3 V4KAw/YDt8l8u/lYIpCUd+4XxNutN78FDGa2JGCNhv1LnJongDf2njbBGaLTrFSA+12gjvSpa2K ppNxHn0B9swSLWg9lrL9VgfPfsQZbrgQI74rLo11zrVBvZpNW/k25PBisO33g== X-Received: by 2002:a05:600c:468b:b0:434:9f81:76d5 with SMTP id 5b1f17b1804b1-4362aaa9a4emr24566445e9.22.1734111228128; Fri, 13 Dec 2024 09:33:48 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:47 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 72/85] docs/system/arm/fby35: document execute-in-place property Date: Fri, 13 Dec 2024 17:32:16 +0000 Message-Id: <20241213173229.3308926-73-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x329.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: Pierrick Bouvier Reviewed-by: Cédric Le Goater Signed-off-by: Pierrick Bouvier Message-id: 20241206192254.3889131-3-pierrick.bouvier@linaro.org Signed-off-by: Peter Maydell --- docs/system/arm/fby35.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/system/arm/fby35.rst b/docs/system/arm/fby35.rst index bf6da6baa2a..e19274e75c8 100644 --- a/docs/system/arm/fby35.rst +++ b/docs/system/arm/fby35.rst @@ -45,3 +45,8 @@ process starts. $ screen /dev/tty0 # In a separate TMUX pane, terminal window, etc. $ screen /dev/tty1 $ (qemu) c # Start the boot process once screen is setup. + +This machine model supports emulation of the boot from the CE0 flash device by +setting option ``execute-in-place``. When using this option, the CPU fetches +instructions to execute by reading CE0 and not from a preloaded ROM +initialized at machine init time. As a result, execution will be slower. From patchwork Fri Dec 13 17:32:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850210 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1643514wry; Fri, 13 Dec 2024 09:45:57 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXQsoHVKtKsXm/K1f8UFP976w1Bxdzosi3eWK3aFJudY9AEbna7mNtcBuAo2MpYuawCRJNMRg==@linaro.org X-Google-Smtp-Source: AGHT+IHgJel+39SuAanm0+nKfkKUOLZzCQ5yj1fY46ZnuJdThYzFh95zMx9XMGAMXBYqHW8x43Ep X-Received: by 2002:a05:6402:3713:b0:5cf:c0d2:698 with SMTP id 4fb4d7f45d1cf-5d63c333981mr3066826a12.18.1734111957503; Fri, 13 Dec 2024 09:45:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111957; cv=none; d=google.com; s=arc-20240605; b=TjhwwxOxZEsoTKsaZ5X2dLy/MP/MNwHMEzUSZ3+oIVoLIa7v/ex7FaycnHEQKJ6R0W R4G1KPpuDb+G1p8V64MgB6Nw3KyZm3CTnybi6+Ihhs6VAcKjM923ytEm0V9tmIgPX3Zd iTJr5bHGVB3IhlEHuv8r35rG8DovGJG3lIZk/VkoYrCpcaqwaeMjWWQhwoFzMqHVngy0 oQd5vsQAKWTzDeoQBb9CKUWGb/aiw4wrEWBKfe8jVzd54a+TiaGMGZmzyaG1SuyE7Ws6 0Mz/J1lCWjomn6CcZhVqyyHksoKCgiO1/DnK39zUDsGq3w2B5lYeISSgjEhAnlyKIQyp tRsw== 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=Iu6/mYPMj4sIgrpfHxPuinFzD7tP6UGxaUnV9V3hRtM=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=FP8BWR6hRc4+Qe5cwxHQ/qcjM7vMOF8cD6k7xGhpApqakjvF+vvn0Zqijx4oGLEnpK Xs4mORHGBX0eMMqyVxEAF9+fJTB1/lYyN5RwzzgWiVmnfq7/ERWoUiJaZ7DEqtAAblqm Fj11Ex/PHJM7jLdTF55Uv16jQRgbbrqUzQEjRUrXtoJarF2B3oTtR1iybls9o6qMWP48 69RSKLBp9XdeP5QO1ni607HVbouTDLCO6HHrhsKWQXBg6FyAf22GSTtX/+Y8Nf+VdE48 RMFzOgt2qfmarUwfPue9blrM/gWNm/EjP8BhVa2vfF4/3MZFjBp2+UFYubRAcYLGcHSg PfWA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ffjdv46U; 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 4fb4d7f45d1cf-5d652f87377si41878a12.563.2024.12.13.09.45.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:45:57 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ffjdv46U; 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 1tM9aj-0001xF-HO; Fri, 13 Dec 2024 12:36: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 1tM9Y2-0008HX-PO for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:57 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9Xz-0001k6-I5 for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:54 -0500 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-4361fe642ddso20466455e9.2 for ; Fri, 13 Dec 2024 09:33:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111229; x=1734716029; 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=Iu6/mYPMj4sIgrpfHxPuinFzD7tP6UGxaUnV9V3hRtM=; b=Ffjdv46U3swuZymAhMXNwnDXA2GwW0nqkl0r3ZNpplaF4/dSDbuVnLLeDgck5AMP9s AntVD+hbeRMo7qeZdSYjVTFFE9HU24zuG1BND2wLV0+HKPE7MBsKLr0gFQlYzF6GNNul NFLDfSNHUyL7C5uvflW/eBuep6QROpov55+E1CWKnad40xClLr87Fjlh/9IgXB5NI6nn YcCCGwE5OYwT9VGXNcDCsvu1G2FnC+NiKl9SjM6yHsatm/T+SoEDIjwVwWPTnqRn4IrQ z6jw/LFC1BT1hQLTezCTPs4OT5iSCev+7GteiDOpxF6MWBkOLw+TWW6/cGvHRkvKD0XD XugA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111229; x=1734716029; 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=Iu6/mYPMj4sIgrpfHxPuinFzD7tP6UGxaUnV9V3hRtM=; b=lE9hnOurELswquSex+B0/ljLRjvS9oUR09Yls3B6+vLrJf93KYD/x18NaVhbYtnIAi sJl/00J8IcIyg9naCQ0BB6XE3rcOMYTclaJPfyxTwLfnf+9havrrXrIOcYTc1fV+Y87S Anke+YfyTueHKuxXEIPmrRm2gOZ24VUbTS2+tt1uDqQwyluRORJC4WWcPvq9uDSoQZZA z9XYQ0AYSnvS9rFTD2/JwS/2tiAM+Dj46XkcBVFiuYQpmM66wbbGkQht/5vII3hR9kEg uSYFkI3QaDNS225xR37RcNzat8yaomav7Xm3EBpFctcjKneUiXIO9+d1cX31hkU++a0S bJuQ== X-Gm-Message-State: AOJu0YwFS62bhQUhHSmew74YuLwwHzEVTrvhw3k1cRdNk0JZbJz6LYlh x9ZTGwi4MSCGWIY100HLoYR06QtJT9wTrlQP0HiraoJp9pywOtPEwVBT0qq6XnJUH3yzA5h1nQQ c X-Gm-Gg: ASbGnct5EzQ1pRrWhSt5siCM6BTcKyZYf0gfmLqCLnJubiK0Hgkd7CecuXrUGBvcT0w Lfqn4+b89pvilFa4nELhbXiAmkFUE0Qn1tW/Je49tJyFgP/bjHuR9zZpVA72X/nQYT2l5JS1IO2 50FG5XB1tytmVwg1GqNh7WtaP70IMqAqLyvTzoxGZ7xCp08rh2aOOQqjLWxPz/qt9m6VqktAOIa 5zc1ejbriDfAzMlxByhynxu02p+V2E08SitU2LJwCGRS8p0MvEFllIs/2JgMA== X-Received: by 2002:a05:600c:3548:b0:434:f753:600f with SMTP id 5b1f17b1804b1-4362aa408fcmr29869535e9.19.1734111229106; Fri, 13 Dec 2024 09:33:49 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:48 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 73/85] docs/system/arm/xlnx-versal-virt: document ospi-flash property Date: Fri, 13 Dec 2024 17:32:17 +0000 Message-Id: <20241213173229.3308926-74-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32d.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, WEIRD_QUOTING=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: Pierrick Bouvier Signed-off-by: Pierrick Bouvier Message-id: 20241206192254.3889131-4-pierrick.bouvier@linaro.org Signed-off-by: Peter Maydell Reviewed-by: Peter Maydell --- docs/system/arm/xlnx-versal-virt.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/system/arm/xlnx-versal-virt.rst b/docs/system/arm/xlnx-versal-virt.rst index 0bafc76469d..c5f35f28e4f 100644 --- a/docs/system/arm/xlnx-versal-virt.rst +++ b/docs/system/arm/xlnx-versal-virt.rst @@ -178,6 +178,9 @@ Run the following at the U-Boot prompt: fdt set /chosen/dom0 reg <0x00000000 0x40000000 0x0 0x03100000> booti 30000000 - 20000000 +It's possible to change the OSPI flash model emulated by using the machine model +option ``ospi-flash``. + BBRAM File Backend """""""""""""""""" BBRAM can have an optional file backend, which must be a seekable From patchwork Fri Dec 13 17:32:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850161 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1639919wry; Fri, 13 Dec 2024 09:37:53 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXcH7T2ZP+2YTpFm0vsffaprc858y+MB4dJdoTfFAzPnTn7n3pLryws+pbZh9rN4fTC71ZaPg==@linaro.org X-Google-Smtp-Source: AGHT+IHhebBmK4NuDtSnFXvQpxKBFkKnJMAQKIiLTYSNTsIPZX10DnvzHVUb9SrUK0GEpLZXR0hh X-Received: by 2002:a17:907:6e88:b0:aa6:96c4:ad62 with SMTP id a640c23a62f3a-aab77ec88f0mr398857466b.58.1734111473235; Fri, 13 Dec 2024 09:37:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111473; cv=none; d=google.com; s=arc-20240605; b=Ru/vTGDqixg69TA5GTSMl47aPotzNsCYTx07dWTSBTbv6AQ+j/NEM2ghV/kPOR742h eSoLUmq+rOW8u9rRuuEcQ0gPoHT96qtwJ6YfQ30Nko2za304vM2xejZcpAit2WvvF1sn X50ifX1VDfn5nZlCuhGs2jGpB/6HjsunBTXZOAwL6XI2XpkI5n9cVtczSBHxGqyIy/tt yA2cc+PNtkiSfbu4aWwn2cRkutOj97+41MMMmttjVlmDJQKb0eha4TcgLtjpAtBW8p+v lwpCAEKHrWd2/X2SBstoT2pezGmdmb4MjiBaT3cdpqXekqkqxvVJeVPlJrJo79KYJqPS 98IA== 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=LHYKnsZII936z/JzPGS2acHwiW7ATdMySxAu7M3/+ak=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=BF18ESgS/WH/7ElqD5avVP+6FRIwsy+/6MeQWhGLDIfyKuViwHthxOOGmm/N+8BTeB ZXbk25fn5YunMxNchdm5RCUk5dq7y74njxyztMnTCSfzIS2Ja8iqcI3qxMcRgLgYKSq8 CkNJbNzzhbuXSv1OOUa0MKBODnu5+tAUJ6Kp/ZZXNF0Gupspczkcmp03Uuln1GXBKQZS PqD7cbxTLfQLVW3F7RGJJqdTcIC8G6gBBJ0Gq5yTLhxomQfErVRe1y34JW/3EN3qatI1 +r40ocM57YBruMO/iy5aWsb9aalZEAxZfXX9aRAP0Yz1c4n8hLJwxHohs6rqNKs5b877 0+gg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lEXY1DNF; 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 a640c23a62f3a-aa694bcd953si729950366b.882.2024.12.13.09.37.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:37: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=lEXY1DNF; 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 1tM9a1-00089D-W3; Fri, 13 Dec 2024 12:35: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 1tM9Y3-0008Ha-55 for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:57 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9Xz-0001kJ-Om for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:54 -0500 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-436345cc17bso3210265e9.0 for ; Fri, 13 Dec 2024 09:33:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111230; x=1734716030; 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=LHYKnsZII936z/JzPGS2acHwiW7ATdMySxAu7M3/+ak=; b=lEXY1DNF83rdYg10DecIsEpjMbPDvk8BFAairfAK1zcxe4i6m4XvTISK9Gqs+5ShYJ e1k0ZdtsofSo5yWsLT1xwBw2wZl6m6U+SKFXGV/Ol1hZcgw+JQ9euzYCGxOWJODN6Krg KqNmL9YjQ9+2ymyEUXsEeTyaV1hyMMnOT27CS9+2tcC9NnDPE4FJcYsEzSfpkEkP9b2S 2SEImf2qY3c73T/efX0Hx241wpDKzqk3vi2jvWEDcHqlTF8o7wMBLPsNFLlU+JeQsmbb rytdS5cRJXfqfGkyOQLhzbafba7uj30N5BPXTUn9iVcs+5iJ31UeSGxiGhFxuFdLnVLw vrkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111230; x=1734716030; 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=LHYKnsZII936z/JzPGS2acHwiW7ATdMySxAu7M3/+ak=; b=gM2wvCD8jE1vBkNZluxpQKUs8DUwei7/vkTJPyJ3SjSbduo1gxi6+FVnt6eTCyLWtV N0Ho5ND9jXS0F/Q0sGs62CaTZNxyJtjq/W7HSzJFstPQ7Fi/SzpwBLRbJZaf8KMoxGpw XHHvZlADTI6OuMtAOMLFYP1GHgH5Lei1NGcM5ZQZlbmuOUgYAuMH1eHs66QV9LZxrGEd Dv+t7L6764q0bd2zBJ+HDimdfFZmj5+x7dlXw54jAF5/2jO6xskKeru0qVBS3Vade9T0 pAjfzZEVi/I065q55J0cHgevLA5pnHEvCCSRcrZtsG9EXwdnF9PSzkMqIZY5XaCiRXIa g4JQ== X-Gm-Message-State: AOJu0YyGF+WUMk3qKuNlhj9CRLraHoxrfntindbfXesLxcAvlR3alLrj NRjwQGqmqz56MOHVijqSD8GMzNveLh5GyHK/hfoKEgwesl207pqWBXu+GmcXUbxq+udIUotmTii M X-Gm-Gg: ASbGncupv9bcABPTZlUnE34iUiiH982wE+ylCXzZuxXne6z6/Ei4zL3FlLi0h5v5nHk H2QIwIU0BIouF4tJTLbjXKFmqN5CZupihe932JQxGVXM84mHBCOw2NauMqMvmdcC4zc36TfujZB oTBR4GrQte7Tm46SZxtHgObWlkJTYDl4A+bTGOFAG1tewPTVcQAmnQdZJ4KwGf9KVGjPfpLfa8M 7cI7uuH+wCm0twa5N2Mr/bKY+LALRI5aIzkt5oP1k1QXFoqGgR9QJeDsUEL5A== X-Received: by 2002:a05:600c:83c9:b0:431:5044:e388 with SMTP id 5b1f17b1804b1-4362aaa9a2dmr24723545e9.22.1734111230113; Fri, 13 Dec 2024 09:33:50 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:49 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 74/85] docs/system/arm/virt: document missing properties Date: Fri, 13 Dec 2024 17:32:18 +0000 Message-Id: <20241213173229.3308926-75-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32d.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, WEIRD_QUOTING=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: Pierrick Bouvier Signed-off-by: Pierrick Bouvier Message-id: 20241206192254.3889131-5-pierrick.bouvier@linaro.org Signed-off-by: Peter Maydell Reviewed-by: Peter Maydell --- docs/system/arm/virt.rst | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/system/arm/virt.rst b/docs/system/arm/virt.rst index e67e7f0f7c5..f87adeb444c 100644 --- a/docs/system/arm/virt.rst +++ b/docs/system/arm/virt.rst @@ -167,10 +167,18 @@ iommu ``smmuv3`` Create an SMMUv3 +default-bus-bypass-iommu + Set ``on``/``off`` to enable/disable `bypass_iommu + `_ + for default root bus. + ras Set ``on``/``off`` to enable/disable reporting host memory errors to a guest using ACPI and guest external abort exceptions. The default is off. +acpi + Set ``on``/``off``/``auto`` to enable/disable ACPI. + dtb-randomness Set ``on``/``off`` to pass random seeds via the guest DTB rng-seed and kaslr-seed nodes (in both "/chosen" and @@ -184,6 +192,14 @@ dtb-randomness dtb-kaslr-seed A deprecated synonym for dtb-randomness. +x-oem-id + Set string (up to 6 bytes) to override the default value of field OEMID in ACPI + table header. + +x-oem-table-id + Set string (up to 8 bytes) to override the default value of field OEM Table ID + in ACPI table header. + Linux guest kernel configuration """""""""""""""""""""""""""""""" From patchwork Fri Dec 13 17:32:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850154 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1639608wry; Fri, 13 Dec 2024 09:37:18 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCX1xfWhsk4cj+Ib6G70zKy+DEYIeP8kyr6+xQUymNCNH7HhmwXmRDfFoxO2W1Im6A7JEE5BZw==@linaro.org X-Google-Smtp-Source: AGHT+IHD0g+uCtqRu6ml/VNFCC4JZOkOWJVElmGFtwTgj9ESah8ifeWTtowXdc5PDAL8um126/ix X-Received: by 2002:a17:907:9449:b0:aa5:1d68:1f43 with SMTP id a640c23a62f3a-aab7b153d03mr300016966b.11.1734111438592; Fri, 13 Dec 2024 09:37:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111438; cv=none; d=google.com; s=arc-20240605; b=LWw39efQpjWtRCYn3JFUdCDwbPT3pAsW4iWH9QraynkRYo7Od0iSaC2NUYADyhYLeL +Q/RlLiwMs8spYK1abcqE/DErzSLzN96XQP9TUaGVnCsb17VQ2V3XnMqLv/+Cj3mpU1u r1oPMPrvbNVdH5249j0YIk7Ldek0kTz7AvRNpfkRKs7MSB++vh4OuwmhOOPCdDV8GNTo EjCWh9QLl4derrJnbc+ueryCmygTDp8TBqN1mIp3ccxNeNcoxzB2nT3NFSFiHsBb6PV2 gNyn3IcOVF9kSObJMcYL1vZ57CRy11rOMtMNZi/0+vDwt1kDbJVUBzxhRwgCVfuUAAHf uQzA== 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=1pl3yiGui8waosH6gArdPVMZTP/hR95Dt5JKzQYZcYE=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=k6NGoyqH5N1yW3woJaWPWXBQGDvJqElvvBlBshhdhHTcn6VOLfWP4eEOKk+yP1vz9p k2FZA9kgNO4JJ7ws45AkAJZmJ/Jrvh1Gk5wsSOyv0062pb+VFAI1qZkz9jaYUSx0kwms p3Yi17S2hTa/6n2+HIBZlkFTJdLvPELUMHRZrQ7254yF1jnNYsCMVMuMbRZ3CFEzvdLP Du763O3SJpNONmqU6M6afcIyPf54qKbp9r0+vbcxHDN8sch7T+Ylz/828SnzMceCgNWP 5MB9A59mqGNiGkqex0C8WS4t3ePy6w1hFebkagOWn4/hQIhiuNvLAcNEO0sYUIxq6iry Ul2A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tTkuFmcV; 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 a640c23a62f3a-aa6707a5165si895410766b.265.2024.12.13.09.37.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:37:18 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tTkuFmcV; 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 1tM9aJ-0000Ix-PL; Fri, 13 Dec 2024 12:36: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 1tM9Y4-0008Ht-C6 for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:57 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9Y2-0001kW-GX for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:56 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-4361b6f9faeso12763325e9.1 for ; Fri, 13 Dec 2024 09:33:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111231; x=1734716031; 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=1pl3yiGui8waosH6gArdPVMZTP/hR95Dt5JKzQYZcYE=; b=tTkuFmcVwJ2LLri3J6dV7HjH6FN/dSrXWxLrxCmUIy7Bazam5L4i/57ldKFfShNxuX /SzFCAmIxcoeJa3HTJaHoeEvnKFKQCt88HdbYmMuCmDNQC4cnYbOc7Pr2SqScLAOO8ze kvOooRtnxvp/MEzQ5pNUxjdibEnqDlHDseYP6PJjG4Chp1lpL6R6P4vq8emClKUCUh+5 rYpkMNc+BQBecIi5DXhztPpSF5qYHiQj7WqwyxhLTNFspxOV8YrE4Q+wWPDGdezTDSfh kQOLG5GyvUntaRDUyaV3/8Y4WiUdYrQIuZuw1A5mLBHT+qLNKWPDxg7/rBAKIGZwqUMp MXeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111231; x=1734716031; 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=1pl3yiGui8waosH6gArdPVMZTP/hR95Dt5JKzQYZcYE=; b=iTG7md1QK2jUCdwH1bBbNOUN5jLIzxTN2iasHtdh+3G0eplNEY5Z+Xw7CbMEgQV/r+ V34f+0HVkV1Wmcd1HLThDXQGZoxbdeaz0cusg1eakfc7VPLNEz4rp6RS3br+JRtuMKh+ fKIwTQ4g6SiOtKNLOCJOYydN896Cr1kfRTwxEoJ37r6XTFkRqnZ1qjkZ3qTTzoKYDYV2 DlFUr2PBbeBs52ubfKW5bJAEthP28xtRPfnMo8FEyenxatup5sVGy9N28TjCUXxr1xpe KzzVdZab3dbiLuTovB4YY7FegsxPrZPHccEW1djaDkSmnVFkI4Zg41eB6mwQz2pMOPqd 22Qg== X-Gm-Message-State: AOJu0YwL/c0xUr1fGNpLcxgSO0rP5zIo7kv5qTRDkyBK2x14IWkYHi44 mswWtvYVbqn6PsIBjb8x2/M1UHM+F/e9Tm2gcrqXIsD19D5nYBMeXk03goCpMV0eZCCmb6bPcJQ / X-Gm-Gg: ASbGnctZF/YM1qkR+zXsaZtNREN6OL7Q9iF+Uw31voyJQFq4E2hg8hc8SiHsEvnnKnD 8yKWR+zXnFo8KrhXhOWc3OG/R0lukMZm0+kj53L6XyL1QWtWzMN2Xqlw/fkPt7Oj/SV8a+ynzxr oxkWONw5u0LhR0VL8eBiODH7OcR10o39WlCHAKKdz6CqLFTcBCd5HytUAqD83aa4Uy/PlJc4YbA b7QNY5FHFRe3+CiioLBgiUPC7OCxizwKueNKy/nzuPSPlC+eU+xEegcq6zn5g== X-Received: by 2002:a05:600c:1da6:b0:434:fa73:a906 with SMTP id 5b1f17b1804b1-4362b10e8a7mr25002765e9.4.1734111231069; Fri, 13 Dec 2024 09:33:51 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:50 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 75/85] MAINTAINERS: correct my email address Date: Fri, 13 Dec 2024 17:32:19 +0000 Message-Id: <20241213173229.3308926-76-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x332.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: Brian Cain Mea culpa, I don't know how I got this wrong in 2dfe93699c. Still getting used to the new address, I suppose. Somehow I got it right in the mailmap, though. Signed-off-by: Brian Cain Message-id: 20241209181242.1434231-1-brian.cain@oss.qualcomm.com Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 7c1ab51b2d1..822f34344b0 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -226,7 +226,7 @@ F: target/avr/ F: tests/functional/test_avr_mega2560.py Hexagon TCG CPUs -M: Brian Cain +M: Brian Cain S: Supported F: target/hexagon/ X: target/hexagon/idef-parser/ From patchwork Fri Dec 13 17:32:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850182 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1641411wry; Fri, 13 Dec 2024 09:41:06 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWk5btM9kTAkSe3zyVk9Mu3sWTA67sHbyfNRnkDnEBQYydhbevMaWGeQYcmbsBWTaZ1YahpkA==@linaro.org X-Google-Smtp-Source: AGHT+IFHdKcXUTKh0CKjD2QbFDabH1js9xVwDUUdZKf2HVSkQzYTXpOFdaIkBgGtPNv21+YO9CjI X-Received: by 2002:a05:600c:871b:b0:434:ff08:202e with SMTP id 5b1f17b1804b1-4362b120df5mr28278085e9.8.1734111666521; Fri, 13 Dec 2024 09:41:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111666; cv=none; d=google.com; s=arc-20240605; b=EFiZBlY16og+YzZh2BKFZ8gI2UQzwT5TN4n2+Bs2QJZf+MEJWkd3HzQxe2eZi5BfBw h3i5lmU4JjWlqoHCC8tjGz4JcxF1Wcurh5FZA1oBeos6h5kmj9/Oe33wojmr69jOt+T/ VwHfthNjbR66RuoLE6fxEyEXIjVb25A0PYFWipnmq/MuugcWTn6H3mdzuB4xfOyWE1Ai AKhQf/LHeVX5Nmu/oPy6WBwBiuyb1v2mg3Q/VfmiQPf02ycAn8s3wweCAch0dcCco3yr SjrtwSe2GPUPifL7a1XkF7KPa4Shq0M4EQ4dW/VSWNVgRx2YcnJGRqP/5x8a4viePFI+ +pqg== 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=BR5lP39iWitI/xN0rR+6v+e6ip8ieZWp+uLcr4tQVQ8=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=ehnPg9rE/jtLlV49uyYL8D1vZnX3dIZ8uS3CYxAJ9UnOXrp/L3T2gHihVrrNWjSiNg DWmjW2Hbq1farQ0A8ePW0gkSvBkURyNZM6z6sI3XDKNGZuJAMxluI0sp2SGgbL7/MQUl AWaiD0RFz7xbtH7Zh4ksnvgBtBld/cu+mCOpDpDftiGPp7bzV9z7ZkqAeRoeZZQfNWCE +rEZg6usUsTPbrO4+dcWmITLQWWlBxpkvgdLrMCZ/XV9S5NM8AYYqJckCL5SWCBXbWFb eNK7qXrkJErzL1oPQ5IjBADPEXLmnNgcBc3wTmMho6AFy+0mPrc00ABZqI+tBT5UUEZf j2Ag==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HP0f7mjJ; 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 5b1f17b1804b1-4362570b66esi23471915e9.143.2024.12.13.09.41.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:41: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=HP0f7mjJ; 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 1tM9aP-0000bV-O1; Fri, 13 Dec 2024 12:36:21 -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 1tM9Y8-0000Fg-5d for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:34:00 -0500 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9Y2-0001kv-16 for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:58 -0500 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-3862d16b4f5so1352215f8f.0 for ; Fri, 13 Dec 2024 09:33:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111232; x=1734716032; 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=BR5lP39iWitI/xN0rR+6v+e6ip8ieZWp+uLcr4tQVQ8=; b=HP0f7mjJDhxZd6Gne24J04HXzqZI46ypIkbh6zd4ItqlLWsUktdylATDEToJgER6W6 1EqwcUx2i+KySxa0CbMJpKAtsn7779RBQSy+IQo4Frm1P/PvkHbap2yyNvOHKNJosUWP JXbgTUIGMqaKuRwxFCy0vRBNvemru+ifOTzHzzj2kvlwUcLtGIHLbSMzAR5XPU8ulLgh 8YEDwVBWcrz+Jw8lIDE4LWaEOgIYm+uIRE3xCQz4n5NPLu81dCGLCjsxiNOCGCrJQ9TG v/td+M+FGx1Io2oxGRskUwuIJprPE7UeivYVz+7iJTJgCkRwJ9L3rhFAMhuuni7sOZKV EBlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111232; x=1734716032; 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=BR5lP39iWitI/xN0rR+6v+e6ip8ieZWp+uLcr4tQVQ8=; b=uI4KuBfb9tJhXyYzxxC58+LOobYhKaXxRi0X3PiqKl7tpWpYRUrlVT2cfBjk0RCOjQ UZUCoF4hUKOaKkAWAZaAgvryNFtyhoBybgXAukrl3ciJC4eybbDMwf9NofNhMAALMix0 079eyvs2HXDdKOF4U//iv9aVDGnEDKUZ/Z6PObJ6jiFuDwvtA3zq20Vq5JN0q8bqgxCZ BQSXgX4kCpRxQAAvGxXTEg+zsNbVKS8l84Q4uV59XwKx/jHS0xq5p8U9EqbJyhVS2CbJ P8/GLpdcdJ4Sg1FKrBWVL+WuivXVhnHR1JthkRUszXaF3uxmzDzU2U+PNmsCYnKEpWKa jY1w== X-Gm-Message-State: AOJu0YwfWOKZu0cq5/ZeVOu5mhp5jxVaZ0mTNJFaIRi2UsvmNXOKyRfL iokCIP0zsh7kqbCYzhIMII88QUIXzBCTq/ZjKKreeiJQqj78cDef9lUJYXFST4uCEiEyh9hRCAm E X-Gm-Gg: ASbGncvW9YFsAfUSKhkB0Fvq7FQSIek+qrL8N+hLl3cQkdiO4ymzCM6i4tC4yz2mxEg XHI4r7COnKw9OJpuy3zGkik3WbbY8L+oRJc4UQGPFnZY12u1nzj0ZTaUBPkIh+U2i3AXEDJAbdY 1OGkIjNAhTD7qzJiA42DXCdHmBwgGFb01YayhNy8Gx3Y8MsI5dQSLv8FtL8vIpYEEMH5GIb1tPj xAw6bUsUhncOilOnkfewg8G+/gjPIEIaerbHnoZLM7YXizPL0U0gGXZe0Jwuw== X-Received: by 2002:a05:6000:4612:b0:385:faf5:ebb8 with SMTP id ffacd0b85a97d-388c3651797mr2812141f8f.7.1734111232427; Fri, 13 Dec 2024 09:33:52 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:51 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 76/85] target/arm: Move some TLBI insns to their own source file Date: Fri, 13 Dec 2024 17:32:20 +0000 Message-Id: <20241213173229.3308926-77-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x429.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=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 target/arm/helper.c is very large and unwieldy. One subset of code that we can pull out into its own file is the cpreg arrays and corresponding functions for the TLBI instructions. Because these are instructions they are only relevant for TCG and we can make the new file only be built for CONFIG_TCG. In this commit we move the AArch32 instructions from: not_v7_cp_reginfo[] v7_cp_reginfo[] v7mp_cp_reginfo[] v8_cp_reginfo[] into a new file target/arm/tcg/tlb-insns.c. A few small functions are used both by functions we haven't yet moved across and by functions we have already moved. We temporarily make these global with a prototype in cpregs.h; when the move of all TLBI insns is complete these will return to being file-local. For CONFIG_TCG, this is just moving code around. For a KVM only build, these cpregs will no longer be added to the cpregs hashtable for the CPU. However this should not be a behaviour change, because: * we never try to migration sync or otherwise include ARM_CP_NO_RAW cpregs * for migration we treat the kernel's list of system registers as the authoritative one, so these TLBI insns were never in it anyway The no-tcg stub of define_tlb_insn_regs() therefore does nothing. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20241210160452.2427965-2-peter.maydell@linaro.org --- target/arm/cpregs.h | 14 +++ target/arm/internals.h | 3 + target/arm/helper.c | 231 ++-------------------------------- target/arm/tcg-stubs.c | 5 + target/arm/tcg/tlb-insns.c | 246 +++++++++++++++++++++++++++++++++++++ target/arm/tcg/meson.build | 1 + 6 files changed, 280 insertions(+), 220 deletions(-) create mode 100644 target/arm/tcg/tlb-insns.c diff --git a/target/arm/cpregs.h b/target/arm/cpregs.h index cc7c54378f4..26c27dc5cb6 100644 --- a/target/arm/cpregs.h +++ b/target/arm/cpregs.h @@ -1134,4 +1134,18 @@ static inline bool arm_cpreg_traps_in_nv(const ARMCPRegInfo *ri) return ri->opc1 == 4 || ri->opc1 == 5; } +/* + * Temporary declarations of functions until the move to tlb_insn_helper.c + * is complete and we can make the functions static again + */ +CPAccessResult access_ttlb(CPUARMState *env, const ARMCPRegInfo *ri, + bool isread); +CPAccessResult access_ttlbis(CPUARMState *env, const ARMCPRegInfo *ri, + bool isread); +bool tlb_force_broadcast(CPUARMState *env); +void tlbimva_hyp_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value); +void tlbimva_hyp_is_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value); + #endif /* TARGET_ARM_CPREGS_H */ diff --git a/target/arm/internals.h b/target/arm/internals.h index e37f459af35..2adedb94777 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -1727,6 +1727,9 @@ static inline uint64_t pauth_ptr_mask(ARMVAParameters param) /* Add the cpreg definitions for debug related system registers */ void define_debug_regs(ARMCPU *cpu); +/* Add the cpreg definitions for TLBI instructions */ +void define_tlb_insn_regs(ARMCPU *cpu); + /* Effective value of MDCR_EL2 */ static inline uint64_t arm_mdcr_el2_eff(CPUARMState *env) { diff --git a/target/arm/helper.c b/target/arm/helper.c index f38eb054c06..6a9bf70f185 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -366,8 +366,8 @@ static CPAccessResult access_tacr(CPUARMState *env, const ARMCPRegInfo *ri, } /* Check for traps from EL1 due to HCR_EL2.TTLB. */ -static CPAccessResult access_ttlb(CPUARMState *env, const ARMCPRegInfo *ri, - bool isread) +CPAccessResult access_ttlb(CPUARMState *env, const ARMCPRegInfo *ri, + bool isread) { if (arm_current_el(env) == 1 && (arm_hcr_el2_eff(env) & HCR_TTLB)) { return CP_ACCESS_TRAP_EL2; @@ -376,8 +376,8 @@ static CPAccessResult access_ttlb(CPUARMState *env, const ARMCPRegInfo *ri, } /* Check for traps from EL1 due to HCR_EL2.TTLB or TTLBIS. */ -static CPAccessResult access_ttlbis(CPUARMState *env, const ARMCPRegInfo *ri, - bool isread) +CPAccessResult access_ttlbis(CPUARMState *env, const ARMCPRegInfo *ri, + bool isread) { if (arm_current_el(env) == 1 && (arm_hcr_el2_eff(env) & (HCR_TTLB | HCR_TTLBIS))) { @@ -455,104 +455,16 @@ static int alle1_tlbmask(CPUARMState *env) ARMMMUIdxBit_Stage2_S); } - -/* IS variants of TLB operations must affect all cores */ -static void tlbiall_is_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value) -{ - CPUState *cs = env_cpu(env); - - tlb_flush_all_cpus_synced(cs); -} - -static void tlbiasid_is_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value) -{ - CPUState *cs = env_cpu(env); - - tlb_flush_all_cpus_synced(cs); -} - -static void tlbimva_is_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value) -{ - CPUState *cs = env_cpu(env); - - tlb_flush_page_all_cpus_synced(cs, value & TARGET_PAGE_MASK); -} - -static void tlbimvaa_is_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value) -{ - CPUState *cs = env_cpu(env); - - tlb_flush_page_all_cpus_synced(cs, value & TARGET_PAGE_MASK); -} - /* * Non-IS variants of TLB operations are upgraded to * IS versions if we are at EL1 and HCR_EL2.FB is effectively set to * force broadcast of these operations. */ -static bool tlb_force_broadcast(CPUARMState *env) +bool tlb_force_broadcast(CPUARMState *env) { return arm_current_el(env) == 1 && (arm_hcr_el2_eff(env) & HCR_FB); } -static void tlbiall_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value) -{ - /* Invalidate all (TLBIALL) */ - CPUState *cs = env_cpu(env); - - if (tlb_force_broadcast(env)) { - tlb_flush_all_cpus_synced(cs); - } else { - tlb_flush(cs); - } -} - -static void tlbimva_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value) -{ - /* Invalidate single TLB entry by MVA and ASID (TLBIMVA) */ - CPUState *cs = env_cpu(env); - - value &= TARGET_PAGE_MASK; - if (tlb_force_broadcast(env)) { - tlb_flush_page_all_cpus_synced(cs, value); - } else { - tlb_flush_page(cs, value); - } -} - -static void tlbiasid_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value) -{ - /* Invalidate by ASID (TLBIASID) */ - CPUState *cs = env_cpu(env); - - if (tlb_force_broadcast(env)) { - tlb_flush_all_cpus_synced(cs); - } else { - tlb_flush(cs); - } -} - -static void tlbimvaa_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value) -{ - /* Invalidate single entry by MVA, all ASIDs (TLBIMVAA) */ - CPUState *cs = env_cpu(env); - - value &= TARGET_PAGE_MASK; - if (tlb_force_broadcast(env)) { - tlb_flush_page_all_cpus_synced(cs, value); - } else { - tlb_flush_page(cs, value); - } -} - static void tlbiall_nsnh_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) { @@ -586,8 +498,8 @@ static void tlbiall_hyp_is_write(CPUARMState *env, const ARMCPRegInfo *ri, tlb_flush_by_mmuidx_all_cpus_synced(cs, ARMMMUIdxBit_E2); } -static void tlbimva_hyp_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value) +void tlbimva_hyp_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) { CPUState *cs = env_cpu(env); uint64_t pageaddr = value & ~MAKE_64BIT_MASK(0, 12); @@ -595,8 +507,8 @@ static void tlbimva_hyp_write(CPUARMState *env, const ARMCPRegInfo *ri, tlb_flush_page_by_mmuidx(cs, pageaddr, ARMMMUIdxBit_E2); } -static void tlbimva_hyp_is_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value) +void tlbimva_hyp_is_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) { CPUState *cs = env_cpu(env); uint64_t pageaddr = value & ~MAKE_64BIT_MASK(0, 12); @@ -605,24 +517,6 @@ static void tlbimva_hyp_is_write(CPUARMState *env, const ARMCPRegInfo *ri, ARMMMUIdxBit_E2); } -static void tlbiipas2_hyp_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value) -{ - CPUState *cs = env_cpu(env); - uint64_t pageaddr = (value & MAKE_64BIT_MASK(0, 28)) << 12; - - tlb_flush_page_by_mmuidx(cs, pageaddr, ARMMMUIdxBit_Stage2); -} - -static void tlbiipas2is_hyp_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value) -{ - CPUState *cs = env_cpu(env); - uint64_t pageaddr = (value & MAKE_64BIT_MASK(0, 28)) << 12; - - tlb_flush_page_by_mmuidx_all_cpus_synced(cs, pageaddr, ARMMMUIdxBit_Stage2); -} - static const ARMCPRegInfo cp_reginfo[] = { /* * Define the secure and non-secure FCSE identifier CP registers @@ -732,22 +626,6 @@ static const ARMCPRegInfo not_v7_cp_reginfo[] = { */ { .name = "DBGDIDR", .cp = 14, .crn = 0, .crm = 0, .opc1 = 0, .opc2 = 0, .access = PL0_R, .type = ARM_CP_CONST, .resetvalue = 0 }, - /* - * MMU TLB control. Note that the wildcarding means we cover not just - * the unified TLB ops but also the dside/iside/inner-shareable variants. - */ - { .name = "TLBIALL", .cp = 15, .crn = 8, .crm = CP_ANY, - .opc1 = CP_ANY, .opc2 = 0, .access = PL1_W, .writefn = tlbiall_write, - .type = ARM_CP_NO_RAW }, - { .name = "TLBIMVA", .cp = 15, .crn = 8, .crm = CP_ANY, - .opc1 = CP_ANY, .opc2 = 1, .access = PL1_W, .writefn = tlbimva_write, - .type = ARM_CP_NO_RAW }, - { .name = "TLBIASID", .cp = 15, .crn = 8, .crm = CP_ANY, - .opc1 = CP_ANY, .opc2 = 2, .access = PL1_W, .writefn = tlbiasid_write, - .type = ARM_CP_NO_RAW }, - { .name = "TLBIMVAA", .cp = 15, .crn = 8, .crm = CP_ANY, - .opc1 = CP_ANY, .opc2 = 3, .access = PL1_W, .writefn = tlbimvaa_write, - .type = ARM_CP_NO_RAW }, { .name = "PRRR", .cp = 15, .crn = 10, .crm = 2, .opc1 = 0, .opc2 = 0, .access = PL1_RW, .type = ARM_CP_NOP }, { .name = "NMRR", .cp = 15, .crn = 10, .crm = 2, @@ -2331,55 +2209,6 @@ static const ARMCPRegInfo v7_cp_reginfo[] = { .opc0 = 3, .opc1 = 0, .crn = 12, .crm = 1, .opc2 = 0, .fgt = FGT_ISR_EL1, .type = ARM_CP_NO_RAW, .access = PL1_R, .readfn = isr_read }, - /* 32 bit ITLB invalidates */ - { .name = "ITLBIALL", .cp = 15, .opc1 = 0, .crn = 8, .crm = 5, .opc2 = 0, - .type = ARM_CP_NO_RAW, .access = PL1_W, .accessfn = access_ttlb, - .writefn = tlbiall_write }, - { .name = "ITLBIMVA", .cp = 15, .opc1 = 0, .crn = 8, .crm = 5, .opc2 = 1, - .type = ARM_CP_NO_RAW, .access = PL1_W, .accessfn = access_ttlb, - .writefn = tlbimva_write }, - { .name = "ITLBIASID", .cp = 15, .opc1 = 0, .crn = 8, .crm = 5, .opc2 = 2, - .type = ARM_CP_NO_RAW, .access = PL1_W, .accessfn = access_ttlb, - .writefn = tlbiasid_write }, - /* 32 bit DTLB invalidates */ - { .name = "DTLBIALL", .cp = 15, .opc1 = 0, .crn = 8, .crm = 6, .opc2 = 0, - .type = ARM_CP_NO_RAW, .access = PL1_W, .accessfn = access_ttlb, - .writefn = tlbiall_write }, - { .name = "DTLBIMVA", .cp = 15, .opc1 = 0, .crn = 8, .crm = 6, .opc2 = 1, - .type = ARM_CP_NO_RAW, .access = PL1_W, .accessfn = access_ttlb, - .writefn = tlbimva_write }, - { .name = "DTLBIASID", .cp = 15, .opc1 = 0, .crn = 8, .crm = 6, .opc2 = 2, - .type = ARM_CP_NO_RAW, .access = PL1_W, .accessfn = access_ttlb, - .writefn = tlbiasid_write }, - /* 32 bit TLB invalidates */ - { .name = "TLBIALL", .cp = 15, .opc1 = 0, .crn = 8, .crm = 7, .opc2 = 0, - .type = ARM_CP_NO_RAW, .access = PL1_W, .accessfn = access_ttlb, - .writefn = tlbiall_write }, - { .name = "TLBIMVA", .cp = 15, .opc1 = 0, .crn = 8, .crm = 7, .opc2 = 1, - .type = ARM_CP_NO_RAW, .access = PL1_W, .accessfn = access_ttlb, - .writefn = tlbimva_write }, - { .name = "TLBIASID", .cp = 15, .opc1 = 0, .crn = 8, .crm = 7, .opc2 = 2, - .type = ARM_CP_NO_RAW, .access = PL1_W, .accessfn = access_ttlb, - .writefn = tlbiasid_write }, - { .name = "TLBIMVAA", .cp = 15, .opc1 = 0, .crn = 8, .crm = 7, .opc2 = 3, - .type = ARM_CP_NO_RAW, .access = PL1_W, .accessfn = access_ttlb, - .writefn = tlbimvaa_write }, -}; - -static const ARMCPRegInfo v7mp_cp_reginfo[] = { - /* 32 bit TLB invalidates, Inner Shareable */ - { .name = "TLBIALLIS", .cp = 15, .opc1 = 0, .crn = 8, .crm = 3, .opc2 = 0, - .type = ARM_CP_NO_RAW, .access = PL1_W, .accessfn = access_ttlbis, - .writefn = tlbiall_is_write }, - { .name = "TLBIMVAIS", .cp = 15, .opc1 = 0, .crn = 8, .crm = 3, .opc2 = 1, - .type = ARM_CP_NO_RAW, .access = PL1_W, .accessfn = access_ttlbis, - .writefn = tlbimva_is_write }, - { .name = "TLBIASIDIS", .cp = 15, .opc1 = 0, .crn = 8, .crm = 3, .opc2 = 2, - .type = ARM_CP_NO_RAW, .access = PL1_W, .accessfn = access_ttlbis, - .writefn = tlbiasid_is_write }, - { .name = "TLBIMVAAIS", .cp = 15, .opc1 = 0, .crn = 8, .crm = 3, .opc2 = 3, - .type = ARM_CP_NO_RAW, .access = PL1_W, .accessfn = access_ttlbis, - .writefn = tlbimvaa_is_write }, }; static const ARMCPRegInfo pmovsset_cp_reginfo[] = { @@ -5833,42 +5662,6 @@ static const ARMCPRegInfo v8_cp_reginfo[] = { .fieldoffset = offsetof(CPUARMState, cp15.par_el[1]), .writefn = par_write }, #endif - /* TLB invalidate last level of translation table walk */ - { .name = "TLBIMVALIS", .cp = 15, .opc1 = 0, .crn = 8, .crm = 3, .opc2 = 5, - .type = ARM_CP_NO_RAW, .access = PL1_W, .accessfn = access_ttlbis, - .writefn = tlbimva_is_write }, - { .name = "TLBIMVAALIS", .cp = 15, .opc1 = 0, .crn = 8, .crm = 3, .opc2 = 7, - .type = ARM_CP_NO_RAW, .access = PL1_W, .accessfn = access_ttlbis, - .writefn = tlbimvaa_is_write }, - { .name = "TLBIMVAL", .cp = 15, .opc1 = 0, .crn = 8, .crm = 7, .opc2 = 5, - .type = ARM_CP_NO_RAW, .access = PL1_W, .accessfn = access_ttlb, - .writefn = tlbimva_write }, - { .name = "TLBIMVAAL", .cp = 15, .opc1 = 0, .crn = 8, .crm = 7, .opc2 = 7, - .type = ARM_CP_NO_RAW, .access = PL1_W, .accessfn = access_ttlb, - .writefn = tlbimvaa_write }, - { .name = "TLBIMVALH", .cp = 15, .opc1 = 4, .crn = 8, .crm = 7, .opc2 = 5, - .type = ARM_CP_NO_RAW, .access = PL2_W, - .writefn = tlbimva_hyp_write }, - { .name = "TLBIMVALHIS", - .cp = 15, .opc1 = 4, .crn = 8, .crm = 3, .opc2 = 5, - .type = ARM_CP_NO_RAW, .access = PL2_W, - .writefn = tlbimva_hyp_is_write }, - { .name = "TLBIIPAS2", - .cp = 15, .opc1 = 4, .crn = 8, .crm = 4, .opc2 = 1, - .type = ARM_CP_NO_RAW, .access = PL2_W, - .writefn = tlbiipas2_hyp_write }, - { .name = "TLBIIPAS2IS", - .cp = 15, .opc1 = 4, .crn = 8, .crm = 0, .opc2 = 1, - .type = ARM_CP_NO_RAW, .access = PL2_W, - .writefn = tlbiipas2is_hyp_write }, - { .name = "TLBIIPAS2L", - .cp = 15, .opc1 = 4, .crn = 8, .crm = 4, .opc2 = 5, - .type = ARM_CP_NO_RAW, .access = PL2_W, - .writefn = tlbiipas2_hyp_write }, - { .name = "TLBIIPAS2LIS", - .cp = 15, .opc1 = 4, .crn = 8, .crm = 0, .opc2 = 5, - .type = ARM_CP_NO_RAW, .access = PL2_W, - .writefn = tlbiipas2is_hyp_write }, /* 32 bit cache operations */ { .name = "ICIALLUIS", .cp = 15, .opc1 = 0, .crn = 7, .crm = 1, .opc2 = 0, .type = ARM_CP_NOP, .access = PL1_W, .accessfn = access_ticab }, @@ -8734,6 +8527,8 @@ void register_cp_regs_for_features(ARMCPU *cpu) define_arm_cp_regs(cpu, not_v8_cp_reginfo); } + define_tlb_insn_regs(cpu); + if (arm_feature(env, ARM_FEATURE_V6)) { /* The ID registers all have impdef reset values */ ARMCPRegInfo v6_idregs[] = { @@ -8839,10 +8634,6 @@ void register_cp_regs_for_features(ARMCPU *cpu) if (arm_feature(env, ARM_FEATURE_V6K)) { define_arm_cp_regs(cpu, v6k_cp_reginfo); } - if (arm_feature(env, ARM_FEATURE_V7MP) && - !arm_feature(env, ARM_FEATURE_PMSA)) { - define_arm_cp_regs(cpu, v7mp_cp_reginfo); - } if (arm_feature(env, ARM_FEATURE_V7VE)) { define_arm_cp_regs(cpu, pmovsset_cp_reginfo); } diff --git a/target/arm/tcg-stubs.c b/target/arm/tcg-stubs.c index 152b172e243..f3f45d54f28 100644 --- a/target/arm/tcg-stubs.c +++ b/target/arm/tcg-stubs.c @@ -25,3 +25,8 @@ void raise_exception_ra(CPUARMState *env, uint32_t excp, uint32_t syndrome, void assert_hflags_rebuild_correctly(CPUARMState *env) { } + +/* TLBI insns are only used by TCG, so we don't need to do anything for KVM */ +void define_tlb_insn_regs(ARMCPU *cpu) +{ +} diff --git a/target/arm/tcg/tlb-insns.c b/target/arm/tcg/tlb-insns.c new file mode 100644 index 00000000000..cdf23352d7a --- /dev/null +++ b/target/arm/tcg/tlb-insns.c @@ -0,0 +1,246 @@ +/* + * Helpers for TLBI insns + * + * This code is licensed under the GNU GPL v2 or later. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#include "qemu/osdep.h" +#include "exec/exec-all.h" +#include "cpu.h" +#include "internals.h" +#include "cpu-features.h" +#include "cpregs.h" + +/* IS variants of TLB operations must affect all cores */ +static void tlbiall_is_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) +{ + CPUState *cs = env_cpu(env); + + tlb_flush_all_cpus_synced(cs); +} + +static void tlbiasid_is_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) +{ + CPUState *cs = env_cpu(env); + + tlb_flush_all_cpus_synced(cs); +} + +static void tlbimva_is_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) +{ + CPUState *cs = env_cpu(env); + + tlb_flush_page_all_cpus_synced(cs, value & TARGET_PAGE_MASK); +} + +static void tlbimvaa_is_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) +{ + CPUState *cs = env_cpu(env); + + tlb_flush_page_all_cpus_synced(cs, value & TARGET_PAGE_MASK); +} + +static void tlbiall_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) +{ + /* Invalidate all (TLBIALL) */ + CPUState *cs = env_cpu(env); + + if (tlb_force_broadcast(env)) { + tlb_flush_all_cpus_synced(cs); + } else { + tlb_flush(cs); + } +} + +static void tlbimva_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) +{ + /* Invalidate single TLB entry by MVA and ASID (TLBIMVA) */ + CPUState *cs = env_cpu(env); + + value &= TARGET_PAGE_MASK; + if (tlb_force_broadcast(env)) { + tlb_flush_page_all_cpus_synced(cs, value); + } else { + tlb_flush_page(cs, value); + } +} + +static void tlbiasid_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) +{ + /* Invalidate by ASID (TLBIASID) */ + CPUState *cs = env_cpu(env); + + if (tlb_force_broadcast(env)) { + tlb_flush_all_cpus_synced(cs); + } else { + tlb_flush(cs); + } +} + +static void tlbimvaa_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) +{ + /* Invalidate single entry by MVA, all ASIDs (TLBIMVAA) */ + CPUState *cs = env_cpu(env); + + value &= TARGET_PAGE_MASK; + if (tlb_force_broadcast(env)) { + tlb_flush_page_all_cpus_synced(cs, value); + } else { + tlb_flush_page(cs, value); + } +} + +static void tlbiipas2_hyp_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) +{ + CPUState *cs = env_cpu(env); + uint64_t pageaddr = (value & MAKE_64BIT_MASK(0, 28)) << 12; + + tlb_flush_page_by_mmuidx(cs, pageaddr, ARMMMUIdxBit_Stage2); +} + +static void tlbiipas2is_hyp_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) +{ + CPUState *cs = env_cpu(env); + uint64_t pageaddr = (value & MAKE_64BIT_MASK(0, 28)) << 12; + + tlb_flush_page_by_mmuidx_all_cpus_synced(cs, pageaddr, ARMMMUIdxBit_Stage2); +} + +static const ARMCPRegInfo tlbi_not_v7_cp_reginfo[] = { + /* + * MMU TLB control. Note that the wildcarding means we cover not just + * the unified TLB ops but also the dside/iside/inner-shareable variants. + */ + { .name = "TLBIALL", .cp = 15, .crn = 8, .crm = CP_ANY, + .opc1 = CP_ANY, .opc2 = 0, .access = PL1_W, .writefn = tlbiall_write, + .type = ARM_CP_NO_RAW }, + { .name = "TLBIMVA", .cp = 15, .crn = 8, .crm = CP_ANY, + .opc1 = CP_ANY, .opc2 = 1, .access = PL1_W, .writefn = tlbimva_write, + .type = ARM_CP_NO_RAW }, + { .name = "TLBIASID", .cp = 15, .crn = 8, .crm = CP_ANY, + .opc1 = CP_ANY, .opc2 = 2, .access = PL1_W, .writefn = tlbiasid_write, + .type = ARM_CP_NO_RAW }, + { .name = "TLBIMVAA", .cp = 15, .crn = 8, .crm = CP_ANY, + .opc1 = CP_ANY, .opc2 = 3, .access = PL1_W, .writefn = tlbimvaa_write, + .type = ARM_CP_NO_RAW }, +}; + +static const ARMCPRegInfo tlbi_v7_cp_reginfo[] = { + /* 32 bit ITLB invalidates */ + { .name = "ITLBIALL", .cp = 15, .opc1 = 0, .crn = 8, .crm = 5, .opc2 = 0, + .type = ARM_CP_NO_RAW, .access = PL1_W, .accessfn = access_ttlb, + .writefn = tlbiall_write }, + { .name = "ITLBIMVA", .cp = 15, .opc1 = 0, .crn = 8, .crm = 5, .opc2 = 1, + .type = ARM_CP_NO_RAW, .access = PL1_W, .accessfn = access_ttlb, + .writefn = tlbimva_write }, + { .name = "ITLBIASID", .cp = 15, .opc1 = 0, .crn = 8, .crm = 5, .opc2 = 2, + .type = ARM_CP_NO_RAW, .access = PL1_W, .accessfn = access_ttlb, + .writefn = tlbiasid_write }, + /* 32 bit DTLB invalidates */ + { .name = "DTLBIALL", .cp = 15, .opc1 = 0, .crn = 8, .crm = 6, .opc2 = 0, + .type = ARM_CP_NO_RAW, .access = PL1_W, .accessfn = access_ttlb, + .writefn = tlbiall_write }, + { .name = "DTLBIMVA", .cp = 15, .opc1 = 0, .crn = 8, .crm = 6, .opc2 = 1, + .type = ARM_CP_NO_RAW, .access = PL1_W, .accessfn = access_ttlb, + .writefn = tlbimva_write }, + { .name = "DTLBIASID", .cp = 15, .opc1 = 0, .crn = 8, .crm = 6, .opc2 = 2, + .type = ARM_CP_NO_RAW, .access = PL1_W, .accessfn = access_ttlb, + .writefn = tlbiasid_write }, + /* 32 bit TLB invalidates */ + { .name = "TLBIALL", .cp = 15, .opc1 = 0, .crn = 8, .crm = 7, .opc2 = 0, + .type = ARM_CP_NO_RAW, .access = PL1_W, .accessfn = access_ttlb, + .writefn = tlbiall_write }, + { .name = "TLBIMVA", .cp = 15, .opc1 = 0, .crn = 8, .crm = 7, .opc2 = 1, + .type = ARM_CP_NO_RAW, .access = PL1_W, .accessfn = access_ttlb, + .writefn = tlbimva_write }, + { .name = "TLBIASID", .cp = 15, .opc1 = 0, .crn = 8, .crm = 7, .opc2 = 2, + .type = ARM_CP_NO_RAW, .access = PL1_W, .accessfn = access_ttlb, + .writefn = tlbiasid_write }, + { .name = "TLBIMVAA", .cp = 15, .opc1 = 0, .crn = 8, .crm = 7, .opc2 = 3, + .type = ARM_CP_NO_RAW, .access = PL1_W, .accessfn = access_ttlb, + .writefn = tlbimvaa_write }, +}; + +static const ARMCPRegInfo tlbi_v7mp_cp_reginfo[] = { + /* 32 bit TLB invalidates, Inner Shareable */ + { .name = "TLBIALLIS", .cp = 15, .opc1 = 0, .crn = 8, .crm = 3, .opc2 = 0, + .type = ARM_CP_NO_RAW, .access = PL1_W, .accessfn = access_ttlbis, + .writefn = tlbiall_is_write }, + { .name = "TLBIMVAIS", .cp = 15, .opc1 = 0, .crn = 8, .crm = 3, .opc2 = 1, + .type = ARM_CP_NO_RAW, .access = PL1_W, .accessfn = access_ttlbis, + .writefn = tlbimva_is_write }, + { .name = "TLBIASIDIS", .cp = 15, .opc1 = 0, .crn = 8, .crm = 3, .opc2 = 2, + .type = ARM_CP_NO_RAW, .access = PL1_W, .accessfn = access_ttlbis, + .writefn = tlbiasid_is_write }, + { .name = "TLBIMVAAIS", .cp = 15, .opc1 = 0, .crn = 8, .crm = 3, .opc2 = 3, + .type = ARM_CP_NO_RAW, .access = PL1_W, .accessfn = access_ttlbis, + .writefn = tlbimvaa_is_write }, +}; + +static const ARMCPRegInfo tlbi_v8_cp_reginfo[] = { + /* AArch32 TLB invalidate last level of translation table walk */ + { .name = "TLBIMVALIS", .cp = 15, .opc1 = 0, .crn = 8, .crm = 3, .opc2 = 5, + .type = ARM_CP_NO_RAW, .access = PL1_W, .accessfn = access_ttlbis, + .writefn = tlbimva_is_write }, + { .name = "TLBIMVAALIS", .cp = 15, .opc1 = 0, .crn = 8, .crm = 3, .opc2 = 7, + .type = ARM_CP_NO_RAW, .access = PL1_W, .accessfn = access_ttlbis, + .writefn = tlbimvaa_is_write }, + { .name = "TLBIMVAL", .cp = 15, .opc1 = 0, .crn = 8, .crm = 7, .opc2 = 5, + .type = ARM_CP_NO_RAW, .access = PL1_W, .accessfn = access_ttlb, + .writefn = tlbimva_write }, + { .name = "TLBIMVAAL", .cp = 15, .opc1 = 0, .crn = 8, .crm = 7, .opc2 = 7, + .type = ARM_CP_NO_RAW, .access = PL1_W, .accessfn = access_ttlb, + .writefn = tlbimvaa_write }, + { .name = "TLBIMVALH", .cp = 15, .opc1 = 4, .crn = 8, .crm = 7, .opc2 = 5, + .type = ARM_CP_NO_RAW, .access = PL2_W, + .writefn = tlbimva_hyp_write }, + { .name = "TLBIMVALHIS", + .cp = 15, .opc1 = 4, .crn = 8, .crm = 3, .opc2 = 5, + .type = ARM_CP_NO_RAW, .access = PL2_W, + .writefn = tlbimva_hyp_is_write }, + { .name = "TLBIIPAS2", + .cp = 15, .opc1 = 4, .crn = 8, .crm = 4, .opc2 = 1, + .type = ARM_CP_NO_RAW, .access = PL2_W, + .writefn = tlbiipas2_hyp_write }, + { .name = "TLBIIPAS2IS", + .cp = 15, .opc1 = 4, .crn = 8, .crm = 0, .opc2 = 1, + .type = ARM_CP_NO_RAW, .access = PL2_W, + .writefn = tlbiipas2is_hyp_write }, + { .name = "TLBIIPAS2L", + .cp = 15, .opc1 = 4, .crn = 8, .crm = 4, .opc2 = 5, + .type = ARM_CP_NO_RAW, .access = PL2_W, + .writefn = tlbiipas2_hyp_write }, + { .name = "TLBIIPAS2LIS", + .cp = 15, .opc1 = 4, .crn = 8, .crm = 0, .opc2 = 5, + .type = ARM_CP_NO_RAW, .access = PL2_W, + .writefn = tlbiipas2is_hyp_write }, +}; + +void define_tlb_insn_regs(ARMCPU *cpu) +{ + CPUARMState *env = &cpu->env; + + if (!arm_feature(env, ARM_FEATURE_V7)) { + define_arm_cp_regs(cpu, tlbi_not_v7_cp_reginfo); + } else { + define_arm_cp_regs(cpu, tlbi_v7_cp_reginfo); + } + if (arm_feature(env, ARM_FEATURE_V7MP) && + !arm_feature(env, ARM_FEATURE_PMSA)) { + define_arm_cp_regs(cpu, tlbi_v7mp_cp_reginfo); + } + if (arm_feature(env, ARM_FEATURE_V8)) { + define_arm_cp_regs(cpu, tlbi_v8_cp_reginfo); + } +} diff --git a/target/arm/tcg/meson.build b/target/arm/tcg/meson.build index 508932a249f..09238989c5a 100644 --- a/target/arm/tcg/meson.build +++ b/target/arm/tcg/meson.build @@ -39,6 +39,7 @@ arm_ss.add(files( 'op_helper.c', 'tlb_helper.c', 'vec_helper.c', + 'tlb-insns.c', )) arm_ss.add(when: 'TARGET_AARCH64', if_true: files( From patchwork Fri Dec 13 17:32:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850208 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1643436wry; Fri, 13 Dec 2024 09:45:50 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCX1WTCsLUbwP2fmTnqaMYLiLFe/vtKQi3HyCd6m2upHPMndDFyXhZbJUZH8UnSgkElQTgrJ2g==@linaro.org X-Google-Smtp-Source: AGHT+IElVXWDaYlIIASzvytp84uQ9gYlnfqBQNdIgf2CwtfJ02/THGqynV4h9qfaAk9PBEtgzSIg X-Received: by 2002:a5d:6d8f:0:b0:385:e3d3:be1b with SMTP id ffacd0b85a97d-38880ae1392mr3272407f8f.28.1734111950670; Fri, 13 Dec 2024 09:45:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111950; cv=none; d=google.com; s=arc-20240605; b=etLyOGU41o6XoGarJbKs5DxRwvXKGjcTTTEJ4qXGZcvqmUXN/ZtnqXg3+XSxJxP/eB Alf508QToCqq409ltcUTf7fZw75cca2KxZguMt9MCPkId3vXi5U9PScutKrxu0sqTc9z FU/wRl/qXlAIJsw2EdV+wAxSUS0OQgzaXSUg6oeXbpC+Y8tWbISCWiaV0XI+mYFw7x9v hno4vCfWuCLWA9reeZD691znQkl7t/ByQ8+nqrpG7SEdnURWef0V//Ipts3Bwm5Fnmhj 4N3txWcKLUSwms+h8EtHsezh5ZCXOdcwwVxOlF8bX71ROhugOKYIc+0cnkEuuaXTau4f 5b9w== 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=Qq5JezWAvvQQNLy9rclqYIOw0RJcJBgtsySv4HgTsTw=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=DqeA5HCY55LuVs92wmGydbtuLfaN3rRhsGEXv1NsUwqhdaB3DD7BH6cJ+99PbGZL6M XDptoQib5Nsi5fz6otYO8yMJpp4NidQVljylhbUL2a7fc73z5Q/oo7KEQO/WLGz9jHFI s0o2LwUlJVcm/+v0npj1CEPgnS3df0ujE7CV6kJZhtQa8CAGnWAjenpXm2FWXOdU563R bCg9ePaHvFHa0nPQkX2Jl0wEiDwtU23yJsgFAa0SRwXQlxcOjI2Ih+YlFbVKUQ0hlndz 3NMitTRtYb5Yn5q9Ys6obnGSqz86eLmOjDLOARvGo9ThMWuHnCgLN5+PkMzQwDEssZcr NMMQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=onjVAfx1; 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 5b1f17b1804b1-4362554836csi22867995e9.21.2024.12.13.09.45.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:45: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=onjVAfx1; 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 1tM9aH-00008f-BE; Fri, 13 Dec 2024 12:36:14 -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 1tM9YB-0000RV-LA for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:34:06 -0500 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9Y5-0001lM-Br for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:34:03 -0500 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-386329da1d9so1000918f8f.1 for ; Fri, 13 Dec 2024 09:33:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111234; x=1734716034; 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=Qq5JezWAvvQQNLy9rclqYIOw0RJcJBgtsySv4HgTsTw=; b=onjVAfx1P8QWMjeLGXx1+nU7RHPzpN8TE2p12h/p9bxkrK3FY5r/LoKjBdYhd4KBaj wrt1qFGw68+/PK8beYoAHIm1bG23czw8M2pX//r8TOy5U3OcwiKvPXyTgRvBk/oSOBc8 RXfNb9TF+MP0TIpPuvY4wjDoRJJOd5uPB4szI41Rtb8VpPwgK6EEjpGf3S/s+9MS9gKZ 2R6UMat94iNF+9nHjLzv9RdVxHdwh4exlkAy7VSVSXgZ2fzJEWI3xzQW7qSD2Xx24U7k j4De8YX/SdY2+YI6SXCF4Z2lTPyo971vzJHCUmwBzNNjk2AvqFzM2SpQwFnLVk7ei1/3 t6UQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111234; x=1734716034; 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=Qq5JezWAvvQQNLy9rclqYIOw0RJcJBgtsySv4HgTsTw=; b=dZ4HQIlXxf+7hSxAxP1f/g34/tVO3xMgD6F4hSFAj8fdpo9E0/3p9HlMXJVoI4NNv7 2qQP4NMezSid7Eo2tVT2iIVdZIAgurFVsu0TqUjJMEqzbn92EdzDUXnE887UP6dJ4A+8 RjBAWMnPMSBeFVIIKgKHnt0CJ8grEKlm2ujqf6r4iKL7BM6ugbusVS6vBRuV6Xq/z0XV wXWKxrnKnm9E+v5AKvesk3BM49wVbvEryTcAGluidVAzO06Vs4x9p/YUQqXhBBNZy+hC c2Lm4VnSEkdF7eJbFfRky/lKRjnGN8QR1do1cIDvW+PFNLs2fuDgHe8v0j2TYUA7pr89 V8ug== X-Gm-Message-State: AOJu0YxwFo9o32jDhtcHI1Z/wwRKEzrtFd/ZHevxSfB3+k0uld/UFsdc 5AfYVmWFdGZ3DwpF2LGw3aCxwbFVgWiG/Cx9qiLDi4Ragji1wRJcjM4noB7y9cODFvedKQmDUqH m X-Gm-Gg: ASbGncuwsFTc9SxJjRkEiqDHNG+U0UDu4nQDQXqyBDZ8KWgqNbyRCX+ur5gki2NbUlO gBTDjL0eMEguA4V8cg5ABPLbCdT0bBxAazgcLyILiZbmWw5NqjFJv0DCr8C/g96iyWD5UKGW95q 4bftZbbGA7wuyX+jvIN7sntLlmMNvVUAlLPL0D/dKCn2NVC1rvgLZ3h4o7sR9nSdYZzqiQ772TT RxhbsGXEebKyWg3lZs65xC7frQ9oFFNfZVjjrul7+iN4WCbVULtoyfhmumvlw== X-Received: by 2002:a05:6000:144f:b0:385:fae4:424e with SMTP id ffacd0b85a97d-3888e0c07b9mr2408616f8f.52.1734111233796; Fri, 13 Dec 2024 09:33:53 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:52 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 77/85] target/arm: Move TLBI insns for AArch32 EL2 to tlbi_insn_helper.c Date: Fri, 13 Dec 2024 17:32:21 +0000 Message-Id: <20241213173229.3308926-78-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x429.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=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 Move the AArch32 TLBI insns for AArch32 EL2 to tlbi_insn_helper.c. To keep this as an obviously pure code-movement, we retain the same condition for registering tlbi_el2_cp_reginfo that we use for el2_cp_reginfo. We'll be able to simplify this condition later, since the need to define the reginfo for EL3-without-EL2 doesn't apply for the TLBI ops specifically. This move brings all the uses of tlbimva_hyp_write() and tlbimva_hyp_is_write() back into a single file, so we can move those also, and make them file-local again. The helper alle1_tlbmask() is an exception to the pattern that we only need to make these functions global temporarily, because once this refactoring is complete it will be called by both code in helper.c (vttbr_write()) and by code in tlb-insns.c. We therefore put its prototype in a permanent home in internals.h. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20241210160452.2427965-3-peter.maydell@linaro.org --- target/arm/cpregs.h | 4 -- target/arm/internals.h | 6 +++ target/arm/helper.c | 74 +-------------------------------- target/arm/tcg/tlb-insns.c | 85 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 92 insertions(+), 77 deletions(-) diff --git a/target/arm/cpregs.h b/target/arm/cpregs.h index 26c27dc5cb6..851cd045b2c 100644 --- a/target/arm/cpregs.h +++ b/target/arm/cpregs.h @@ -1143,9 +1143,5 @@ CPAccessResult access_ttlb(CPUARMState *env, const ARMCPRegInfo *ri, CPAccessResult access_ttlbis(CPUARMState *env, const ARMCPRegInfo *ri, bool isread); bool tlb_force_broadcast(CPUARMState *env); -void tlbimva_hyp_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value); -void tlbimva_hyp_is_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value); #endif /* TARGET_ARM_CPREGS_H */ diff --git a/target/arm/internals.h b/target/arm/internals.h index 2adedb94777..c3a5b1385f1 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -1820,4 +1820,10 @@ uint64_t gt_get_countervalue(CPUARMState *env); * and CNTVCT_EL0 (this will be either 0 or the value of CNTVOFF_EL2). */ uint64_t gt_virt_cnt_offset(CPUARMState *env); + +/* + * Return mask of ARMMMUIdxBit values corresponding to an "invalidate + * all EL1" scope; this covers stage 1 and stage 2. + */ +int alle1_tlbmask(CPUARMState *env); #endif diff --git a/target/arm/helper.c b/target/arm/helper.c index 6a9bf70f185..3c69225e1d9 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -438,7 +438,7 @@ static void contextidr_write(CPUARMState *env, const ARMCPRegInfo *ri, raw_write(env, ri, value); } -static int alle1_tlbmask(CPUARMState *env) +int alle1_tlbmask(CPUARMState *env) { /* * Note that the 'ALL' scope must invalidate both stage 1 and @@ -465,58 +465,6 @@ bool tlb_force_broadcast(CPUARMState *env) return arm_current_el(env) == 1 && (arm_hcr_el2_eff(env) & HCR_FB); } -static void tlbiall_nsnh_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value) -{ - CPUState *cs = env_cpu(env); - - tlb_flush_by_mmuidx(cs, alle1_tlbmask(env)); -} - -static void tlbiall_nsnh_is_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value) -{ - CPUState *cs = env_cpu(env); - - tlb_flush_by_mmuidx_all_cpus_synced(cs, alle1_tlbmask(env)); -} - - -static void tlbiall_hyp_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value) -{ - CPUState *cs = env_cpu(env); - - tlb_flush_by_mmuidx(cs, ARMMMUIdxBit_E2); -} - -static void tlbiall_hyp_is_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value) -{ - CPUState *cs = env_cpu(env); - - tlb_flush_by_mmuidx_all_cpus_synced(cs, ARMMMUIdxBit_E2); -} - -void tlbimva_hyp_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value) -{ - CPUState *cs = env_cpu(env); - uint64_t pageaddr = value & ~MAKE_64BIT_MASK(0, 12); - - tlb_flush_page_by_mmuidx(cs, pageaddr, ARMMMUIdxBit_E2); -} - -void tlbimva_hyp_is_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value) -{ - CPUState *cs = env_cpu(env); - uint64_t pageaddr = value & ~MAKE_64BIT_MASK(0, 12); - - tlb_flush_page_by_mmuidx_all_cpus_synced(cs, pageaddr, - ARMMMUIdxBit_E2); -} - static const ARMCPRegInfo cp_reginfo[] = { /* * Define the secure and non-secure FCSE identifier CP registers @@ -6248,26 +6196,6 @@ static const ARMCPRegInfo el2_cp_reginfo[] = { { .name = "HTTBR", .cp = 15, .opc1 = 4, .crm = 2, .access = PL2_RW, .type = ARM_CP_64BIT | ARM_CP_ALIAS, .fieldoffset = offsetof(CPUARMState, cp15.ttbr0_el[2]) }, - { .name = "TLBIALLNSNH", - .cp = 15, .opc1 = 4, .crn = 8, .crm = 7, .opc2 = 4, - .type = ARM_CP_NO_RAW, .access = PL2_W, - .writefn = tlbiall_nsnh_write }, - { .name = "TLBIALLNSNHIS", - .cp = 15, .opc1 = 4, .crn = 8, .crm = 3, .opc2 = 4, - .type = ARM_CP_NO_RAW, .access = PL2_W, - .writefn = tlbiall_nsnh_is_write }, - { .name = "TLBIALLH", .cp = 15, .opc1 = 4, .crn = 8, .crm = 7, .opc2 = 0, - .type = ARM_CP_NO_RAW, .access = PL2_W, - .writefn = tlbiall_hyp_write }, - { .name = "TLBIALLHIS", .cp = 15, .opc1 = 4, .crn = 8, .crm = 3, .opc2 = 0, - .type = ARM_CP_NO_RAW, .access = PL2_W, - .writefn = tlbiall_hyp_is_write }, - { .name = "TLBIMVAH", .cp = 15, .opc1 = 4, .crn = 8, .crm = 7, .opc2 = 1, - .type = ARM_CP_NO_RAW, .access = PL2_W, - .writefn = tlbimva_hyp_write }, - { .name = "TLBIMVAHIS", .cp = 15, .opc1 = 4, .crn = 8, .crm = 3, .opc2 = 1, - .type = ARM_CP_NO_RAW, .access = PL2_W, - .writefn = tlbimva_hyp_is_write }, { .name = "TLBI_ALLE2", .state = ARM_CP_STATE_AA64, .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 7, .opc2 = 0, .access = PL2_W, .type = ARM_CP_NO_RAW | ARM_CP_EL3_NO_EL2_UNDEF, diff --git a/target/arm/tcg/tlb-insns.c b/target/arm/tcg/tlb-insns.c index cdf23352d7a..66096093dcc 100644 --- a/target/arm/tcg/tlb-insns.c +++ b/target/arm/tcg/tlb-insns.c @@ -99,6 +99,25 @@ static void tlbimvaa_write(CPUARMState *env, const ARMCPRegInfo *ri, } } +static void tlbimva_hyp_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) +{ + CPUState *cs = env_cpu(env); + uint64_t pageaddr = value & ~MAKE_64BIT_MASK(0, 12); + + tlb_flush_page_by_mmuidx(cs, pageaddr, ARMMMUIdxBit_E2); +} + +static void tlbimva_hyp_is_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) +{ + CPUState *cs = env_cpu(env); + uint64_t pageaddr = value & ~MAKE_64BIT_MASK(0, 12); + + tlb_flush_page_by_mmuidx_all_cpus_synced(cs, pageaddr, + ARMMMUIdxBit_E2); +} + static void tlbiipas2_hyp_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) { @@ -117,6 +136,39 @@ static void tlbiipas2is_hyp_write(CPUARMState *env, const ARMCPRegInfo *ri, tlb_flush_page_by_mmuidx_all_cpus_synced(cs, pageaddr, ARMMMUIdxBit_Stage2); } +static void tlbiall_nsnh_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) +{ + CPUState *cs = env_cpu(env); + + tlb_flush_by_mmuidx(cs, alle1_tlbmask(env)); +} + +static void tlbiall_nsnh_is_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) +{ + CPUState *cs = env_cpu(env); + + tlb_flush_by_mmuidx_all_cpus_synced(cs, alle1_tlbmask(env)); +} + + +static void tlbiall_hyp_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) +{ + CPUState *cs = env_cpu(env); + + tlb_flush_by_mmuidx(cs, ARMMMUIdxBit_E2); +} + +static void tlbiall_hyp_is_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) +{ + CPUState *cs = env_cpu(env); + + tlb_flush_by_mmuidx_all_cpus_synced(cs, ARMMMUIdxBit_E2); +} + static const ARMCPRegInfo tlbi_not_v7_cp_reginfo[] = { /* * MMU TLB control. Note that the wildcarding means we cover not just @@ -227,6 +279,29 @@ static const ARMCPRegInfo tlbi_v8_cp_reginfo[] = { .writefn = tlbiipas2is_hyp_write }, }; +static const ARMCPRegInfo tlbi_el2_cp_reginfo[] = { + { .name = "TLBIALLNSNH", + .cp = 15, .opc1 = 4, .crn = 8, .crm = 7, .opc2 = 4, + .type = ARM_CP_NO_RAW, .access = PL2_W, + .writefn = tlbiall_nsnh_write }, + { .name = "TLBIALLNSNHIS", + .cp = 15, .opc1 = 4, .crn = 8, .crm = 3, .opc2 = 4, + .type = ARM_CP_NO_RAW, .access = PL2_W, + .writefn = tlbiall_nsnh_is_write }, + { .name = "TLBIALLH", .cp = 15, .opc1 = 4, .crn = 8, .crm = 7, .opc2 = 0, + .type = ARM_CP_NO_RAW, .access = PL2_W, + .writefn = tlbiall_hyp_write }, + { .name = "TLBIALLHIS", .cp = 15, .opc1 = 4, .crn = 8, .crm = 3, .opc2 = 0, + .type = ARM_CP_NO_RAW, .access = PL2_W, + .writefn = tlbiall_hyp_is_write }, + { .name = "TLBIMVAH", .cp = 15, .opc1 = 4, .crn = 8, .crm = 7, .opc2 = 1, + .type = ARM_CP_NO_RAW, .access = PL2_W, + .writefn = tlbimva_hyp_write }, + { .name = "TLBIMVAHIS", .cp = 15, .opc1 = 4, .crn = 8, .crm = 3, .opc2 = 1, + .type = ARM_CP_NO_RAW, .access = PL2_W, + .writefn = tlbimva_hyp_is_write }, +}; + void define_tlb_insn_regs(ARMCPU *cpu) { CPUARMState *env = &cpu->env; @@ -243,4 +318,14 @@ void define_tlb_insn_regs(ARMCPU *cpu) if (arm_feature(env, ARM_FEATURE_V8)) { define_arm_cp_regs(cpu, tlbi_v8_cp_reginfo); } + /* + * We retain the existing logic for when to register these TLBI + * ops (i.e. matching the condition for el2_cp_reginfo[] in + * helper.c), but we will be able to simplify this later. + */ + if (arm_feature(env, ARM_FEATURE_EL2) + || (arm_feature(env, ARM_FEATURE_EL3) + && arm_feature(env, ARM_FEATURE_V8))) { + define_arm_cp_regs(cpu, tlbi_el2_cp_reginfo); + } } From patchwork Fri Dec 13 17:32:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850171 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1640496wry; Fri, 13 Dec 2024 09:39:06 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVPPweNVkM9bio8AoHqi/j5x9ufWGkAa+JTxy+5VFIuDfwTc9uTf1CJyLnVBnD34G3zEO25MA==@linaro.org X-Google-Smtp-Source: AGHT+IFPQar61zDTI94VwHll01hPMuxIAENjGxMn3Tt5JpDEtlLK1AgFvry+K7gHTr1CR+DGJfi2 X-Received: by 2002:a17:906:3118:b0:aa5:27d4:980a with SMTP id a640c23a62f3a-aab77eb3245mr347197766b.49.1734111546745; Fri, 13 Dec 2024 09:39:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111546; cv=none; d=google.com; s=arc-20240605; b=F/35TDXH+mw0kbv5EynMYBcfhfTg7/woJaMedAzlJvefuDXd0kRqg9k5MLMyHSSxZg MZuavj/eg8k1V88Dts/Huy1e8QMuxQiaWITq4rGPCzlG2QcP9/vS8lgC7KHp1YZAmTtZ 4Ee7semJI8JkcLM2fYkN2V+JBgNEcCOO4bMen9sjMgEf5vvq8ui/++a04gXh4V3ERIrF MCFfjrcaaL9cOXsEEWMKUBy2Js0QobXF/lk/aEfg7vTmhbDVtVXiL4loS4oWlLdfKXXw dTXsuw5TirCuOGTMPWdpY+D/VnAcAshTjcy00Bomnb8+hxAGT5vR8QbtLb6hTCecXax5 iZqg== 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=pravC1a+TcYMOWzbSQtbx3p2RApZHY6cS9IpPtAW//g=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=BqKkzaBv+5Ch1YQR2PoSCHuIhGY76jxXT+xKgqp26SEdTwfhbYW9M98L273Fxy6qwO 4eJBeR9Mv8TG3OjmDowoEMc8T5NEg0zOlSkeO5W8c0R6Vh49ppMieopz89qcLl2Tdren dzTBuapPK1NrgTKuEfNvS4j6KQSY4xXwba/BxSft+aWWNwaLRenDRKuaxp8Wn4EFYlxf JvQ6HwVNlebgR0Z4IrWBtHl6bd0YloOW55LGfi7cznoKWQnE6XKm1k2HkkRvw5X1d43P 9Q2wqzGoKKymlXHqvyw3qduz4Gyh5kbLiiCX+RS7QeE5YJ65nOIcM0eeLwysSM6FUR0W vOfw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Lgakri4Q; 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 a640c23a62f3a-aa6965914c2si723486666b.98.2024.12.13.09.39.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:39: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=Lgakri4Q; 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 1tM9Yo-0005HY-PZ; Fri, 13 Dec 2024 12:34:42 -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 1tM9YD-0000Rh-K4 for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:34:06 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9Y6-0001lo-5C for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:34:05 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-436281c8a38so11943825e9.3 for ; Fri, 13 Dec 2024 09:33:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111235; x=1734716035; 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=pravC1a+TcYMOWzbSQtbx3p2RApZHY6cS9IpPtAW//g=; b=Lgakri4QriUSQVKQesjJRzvP0NjOBfIzF8wnVC6iWnP1mo42OUqryXRFsUsFTufTtX Jc8qIDedlIC0snvmyCIiIPwI2FeByDw5iYvZoBNSh43dk5LtEXv8qmMMQNSBs8L+48pO EBivujoE6mcgU1oGb2EjugI7+j59d7kl+0DIQwGxUe69RPrjUoxdQU2qz/tSiCNYckau oFwuhYyd1Hm+YkfhkI32Bn5eo59kd9SwXFIcQK8D2wQR5BQaSBY+7lWt6UCKs3As+tJK AkUZBZEyeTZQS3AdJ8gD10eOqP9zDnJ/nldDS0x5Ga7ZxVBwVduuYrdZdHJ59HQ++K9d ITkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111235; x=1734716035; 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=pravC1a+TcYMOWzbSQtbx3p2RApZHY6cS9IpPtAW//g=; b=uewWJqFYUDMvco4VjSAaGYbq6rqnHwh0bxk78jzMbznGIKsuhN9gtDnCtSUEZBobVZ LEmvIvBcPkp4G6WRlqlrT1YMnpi6en3Y6pzWgy/NBQQqKV4uS/lTU+C0pLq5c1DTe+GH a/jxSEju5bTj2eTRU6/kc/n7kOHQJAEnuuU5C8toU4fsyG0/Nssn3YY2DBhM3gEWkOMk AlZ8LegsMw4r54Sdx425UNNTgndcDSBCPwdMRtwZPJLjS8RqOWqd3XaO9Xu/xADbgVoF 3U/szmbOJwrLSsH/KJ2Ev0tZUdiRfcQoGfgosRyjpB/hpAUIlOeWfJ7z9XYbqoE90OPc 3c6g== X-Gm-Message-State: AOJu0Yw0/yF7kUu0sAgKGHk4f3uCHuLM2lAsrVkjrS109dkeb+pIiRQU EmUdqDABO++GlQ/PHvq6ksNI24+Bw+PWzIqdReRgFe9+sgIHIrvcBJfH1nXKh/ryhcRek6x4H1F 2 X-Gm-Gg: ASbGncsEPMuvsFgW/Xj8Ir8V4g8+Bxibjm9ME/0UzSfFfjrAonFTUBRdFibKJy2eHcQ jGpmb6d70bxGbvVY0ag52QDBljKK14Rx4R0GW/7krnrUCgpSIz9yHmUwOttqCi5rlOxdTpMkrX7 kjGBaBaoxc5r9RAVz8HuyW1bZEvGNunCh++gnSg4/+HLy11on5VsinsYGyrH5BsGtxPHEwy1E1X tqX6rlTGA57oYcRb4QaVKeyQu9a91tPasqlIGEzk0JaZJG6DJRO9CnXkLqqEA== X-Received: by 2002:a05:600c:4f01:b0:434:f3a1:b210 with SMTP id 5b1f17b1804b1-4362aab0faamr29859315e9.32.1734111234778; Fri, 13 Dec 2024 09:33:54 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:54 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 78/85] target/arm: Move AArch64 TLBI insns from v8_cp_reginfo[] Date: Fri, 13 Dec 2024 17:32:22 +0000 Message-Id: <20241213173229.3308926-79-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x331.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, 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 Move the AArch64 TLBI insns that are declared in v8_cp_reginfo[] into tlb-insns.c. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20241210160452.2427965-4-peter.maydell@linaro.org --- target/arm/cpregs.h | 11 +++ target/arm/helper.c | 182 +++---------------------------------- target/arm/tcg/tlb-insns.c | 160 ++++++++++++++++++++++++++++++++ 3 files changed, 182 insertions(+), 171 deletions(-) diff --git a/target/arm/cpregs.h b/target/arm/cpregs.h index 851cd045b2c..a14f5bb6c98 100644 --- a/target/arm/cpregs.h +++ b/target/arm/cpregs.h @@ -1143,5 +1143,16 @@ CPAccessResult access_ttlb(CPUARMState *env, const ARMCPRegInfo *ri, CPAccessResult access_ttlbis(CPUARMState *env, const ARMCPRegInfo *ri, bool isread); bool tlb_force_broadcast(CPUARMState *env); +int tlbbits_for_regime(CPUARMState *env, ARMMMUIdx mmu_idx, + uint64_t addr); +int vae1_tlbbits(CPUARMState *env, uint64_t addr); +int vae1_tlbmask(CPUARMState *env); +int ipas2e1_tlbmask(CPUARMState *env, int64_t value); +void tlbi_aa64_vmalle1is_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value); +void tlbi_aa64_alle1is_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value); +void tlbi_aa64_vae1is_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value); #endif /* TARGET_ARM_CPREGS_H */ diff --git a/target/arm/helper.c b/target/arm/helper.c index 3c69225e1d9..cc7da7f1159 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -4685,7 +4685,7 @@ static CPAccessResult access_tocu(CPUARMState *env, const ARMCPRegInfo *ri, * Page D4-1736 (DDI0487A.b) */ -static int vae1_tlbmask(CPUARMState *env) +int vae1_tlbmask(CPUARMState *env) { uint64_t hcr = arm_hcr_el2_eff(env); uint16_t mask; @@ -4721,8 +4721,8 @@ static int vae2_tlbmask(CPUARMState *env) } /* Return 56 if TBI is enabled, 64 otherwise. */ -static int tlbbits_for_regime(CPUARMState *env, ARMMMUIdx mmu_idx, - uint64_t addr) +int tlbbits_for_regime(CPUARMState *env, ARMMMUIdx mmu_idx, + uint64_t addr) { uint64_t tcr = regime_tcr(env, mmu_idx); int tbi = aa64_va_parameter_tbi(tcr, mmu_idx); @@ -4731,7 +4731,7 @@ static int tlbbits_for_regime(CPUARMState *env, ARMMMUIdx mmu_idx, return (tbi >> select) & 1 ? 56 : 64; } -static int vae1_tlbbits(CPUARMState *env, uint64_t addr) +int vae1_tlbbits(CPUARMState *env, uint64_t addr) { uint64_t hcr = arm_hcr_el2_eff(env); ARMMMUIdx mmu_idx; @@ -4767,8 +4767,8 @@ static int vae2_tlbbits(CPUARMState *env, uint64_t addr) return tlbbits_for_regime(env, mmu_idx, addr); } -static void tlbi_aa64_vmalle1is_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value) +void tlbi_aa64_vmalle1is_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) { CPUState *cs = env_cpu(env); int mask = vae1_tlbmask(env); @@ -4776,19 +4776,6 @@ static void tlbi_aa64_vmalle1is_write(CPUARMState *env, const ARMCPRegInfo *ri, tlb_flush_by_mmuidx_all_cpus_synced(cs, mask); } -static void tlbi_aa64_vmalle1_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value) -{ - CPUState *cs = env_cpu(env); - int mask = vae1_tlbmask(env); - - if (tlb_force_broadcast(env)) { - tlb_flush_by_mmuidx_all_cpus_synced(cs, mask); - } else { - tlb_flush_by_mmuidx(cs, mask); - } -} - static int e2_tlbmask(CPUARMState *env) { return (ARMMMUIdxBit_E20_0 | @@ -4797,15 +4784,6 @@ static int e2_tlbmask(CPUARMState *env) ARMMMUIdxBit_E2); } -static void tlbi_aa64_alle1_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value) -{ - CPUState *cs = env_cpu(env); - int mask = alle1_tlbmask(env); - - tlb_flush_by_mmuidx(cs, mask); -} - static void tlbi_aa64_alle2_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) { @@ -4824,8 +4802,8 @@ static void tlbi_aa64_alle3_write(CPUARMState *env, const ARMCPRegInfo *ri, tlb_flush_by_mmuidx(cs, ARMMMUIdxBit_E3); } -static void tlbi_aa64_alle1is_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value) +void tlbi_aa64_alle1is_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) { CPUState *cs = env_cpu(env); int mask = alle1_tlbmask(env); @@ -4881,8 +4859,8 @@ static void tlbi_aa64_vae3_write(CPUARMState *env, const ARMCPRegInfo *ri, tlb_flush_page_by_mmuidx(cs, pageaddr, ARMMMUIdxBit_E3); } -static void tlbi_aa64_vae1is_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value) +void tlbi_aa64_vae1is_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) { CPUState *cs = env_cpu(env); int mask = vae1_tlbmask(env); @@ -4892,27 +4870,6 @@ static void tlbi_aa64_vae1is_write(CPUARMState *env, const ARMCPRegInfo *ri, tlb_flush_page_bits_by_mmuidx_all_cpus_synced(cs, pageaddr, mask, bits); } -static void tlbi_aa64_vae1_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value) -{ - /* - * Invalidate by VA, EL1&0 (AArch64 version). - * Currently handles all of VAE1, VAAE1, VAALE1 and VALE1, - * since we don't support flush-for-specific-ASID-only or - * flush-last-level-only. - */ - CPUState *cs = env_cpu(env); - int mask = vae1_tlbmask(env); - uint64_t pageaddr = sextract64(value << 12, 0, 56); - int bits = vae1_tlbbits(env, pageaddr); - - if (tlb_force_broadcast(env)) { - tlb_flush_page_bits_by_mmuidx_all_cpus_synced(cs, pageaddr, mask, bits); - } else { - tlb_flush_page_bits_by_mmuidx(cs, pageaddr, mask, bits); - } -} - static void tlbi_aa64_vae2is_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) { @@ -4935,7 +4892,7 @@ static void tlbi_aa64_vae3is_write(CPUARMState *env, const ARMCPRegInfo *ri, ARMMMUIdxBit_E3, bits); } -static int ipas2e1_tlbmask(CPUARMState *env, int64_t value) +int ipas2e1_tlbmask(CPUARMState *env, int64_t value) { /* * The MSB of value is the NS field, which only applies if SEL2 @@ -4948,30 +4905,6 @@ static int ipas2e1_tlbmask(CPUARMState *env, int64_t value) : ARMMMUIdxBit_Stage2); } -static void tlbi_aa64_ipas2e1_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value) -{ - CPUState *cs = env_cpu(env); - int mask = ipas2e1_tlbmask(env, value); - uint64_t pageaddr = sextract64(value << 12, 0, 56); - - if (tlb_force_broadcast(env)) { - tlb_flush_page_by_mmuidx_all_cpus_synced(cs, pageaddr, mask); - } else { - tlb_flush_page_by_mmuidx(cs, pageaddr, mask); - } -} - -static void tlbi_aa64_ipas2e1is_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value) -{ - CPUState *cs = env_cpu(env); - int mask = ipas2e1_tlbmask(env, value); - uint64_t pageaddr = sextract64(value << 12, 0, 56); - - tlb_flush_page_by_mmuidx_all_cpus_synced(cs, pageaddr, mask); -} - #ifdef TARGET_AARCH64 typedef struct { uint64_t base; @@ -5462,99 +5395,6 @@ static const ARMCPRegInfo v8_cp_reginfo[] = { .opc0 = 1, .opc1 = 0, .crn = 7, .crm = 14, .opc2 = 2, .fgt = FGT_DCCISW, .access = PL1_W, .accessfn = access_tsw, .type = ARM_CP_NOP }, - /* TLBI operations */ - { .name = "TLBI_VMALLE1IS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 3, .opc2 = 0, - .access = PL1_W, .accessfn = access_ttlbis, .type = ARM_CP_NO_RAW, - .fgt = FGT_TLBIVMALLE1IS, - .writefn = tlbi_aa64_vmalle1is_write }, - { .name = "TLBI_VAE1IS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 3, .opc2 = 1, - .access = PL1_W, .accessfn = access_ttlbis, .type = ARM_CP_NO_RAW, - .fgt = FGT_TLBIVAE1IS, - .writefn = tlbi_aa64_vae1is_write }, - { .name = "TLBI_ASIDE1IS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 3, .opc2 = 2, - .access = PL1_W, .accessfn = access_ttlbis, .type = ARM_CP_NO_RAW, - .fgt = FGT_TLBIASIDE1IS, - .writefn = tlbi_aa64_vmalle1is_write }, - { .name = "TLBI_VAAE1IS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 3, .opc2 = 3, - .access = PL1_W, .accessfn = access_ttlbis, .type = ARM_CP_NO_RAW, - .fgt = FGT_TLBIVAAE1IS, - .writefn = tlbi_aa64_vae1is_write }, - { .name = "TLBI_VALE1IS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 3, .opc2 = 5, - .access = PL1_W, .accessfn = access_ttlbis, .type = ARM_CP_NO_RAW, - .fgt = FGT_TLBIVALE1IS, - .writefn = tlbi_aa64_vae1is_write }, - { .name = "TLBI_VAALE1IS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 3, .opc2 = 7, - .access = PL1_W, .accessfn = access_ttlbis, .type = ARM_CP_NO_RAW, - .fgt = FGT_TLBIVAALE1IS, - .writefn = tlbi_aa64_vae1is_write }, - { .name = "TLBI_VMALLE1", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 7, .opc2 = 0, - .access = PL1_W, .accessfn = access_ttlb, .type = ARM_CP_NO_RAW, - .fgt = FGT_TLBIVMALLE1, - .writefn = tlbi_aa64_vmalle1_write }, - { .name = "TLBI_VAE1", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 7, .opc2 = 1, - .access = PL1_W, .accessfn = access_ttlb, .type = ARM_CP_NO_RAW, - .fgt = FGT_TLBIVAE1, - .writefn = tlbi_aa64_vae1_write }, - { .name = "TLBI_ASIDE1", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 7, .opc2 = 2, - .access = PL1_W, .accessfn = access_ttlb, .type = ARM_CP_NO_RAW, - .fgt = FGT_TLBIASIDE1, - .writefn = tlbi_aa64_vmalle1_write }, - { .name = "TLBI_VAAE1", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 7, .opc2 = 3, - .access = PL1_W, .accessfn = access_ttlb, .type = ARM_CP_NO_RAW, - .fgt = FGT_TLBIVAAE1, - .writefn = tlbi_aa64_vae1_write }, - { .name = "TLBI_VALE1", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 7, .opc2 = 5, - .access = PL1_W, .accessfn = access_ttlb, .type = ARM_CP_NO_RAW, - .fgt = FGT_TLBIVALE1, - .writefn = tlbi_aa64_vae1_write }, - { .name = "TLBI_VAALE1", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 7, .opc2 = 7, - .access = PL1_W, .accessfn = access_ttlb, .type = ARM_CP_NO_RAW, - .fgt = FGT_TLBIVAALE1, - .writefn = tlbi_aa64_vae1_write }, - { .name = "TLBI_IPAS2E1IS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 0, .opc2 = 1, - .access = PL2_W, .type = ARM_CP_NO_RAW, - .writefn = tlbi_aa64_ipas2e1is_write }, - { .name = "TLBI_IPAS2LE1IS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 0, .opc2 = 5, - .access = PL2_W, .type = ARM_CP_NO_RAW, - .writefn = tlbi_aa64_ipas2e1is_write }, - { .name = "TLBI_ALLE1IS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 3, .opc2 = 4, - .access = PL2_W, .type = ARM_CP_NO_RAW, - .writefn = tlbi_aa64_alle1is_write }, - { .name = "TLBI_VMALLS12E1IS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 3, .opc2 = 6, - .access = PL2_W, .type = ARM_CP_NO_RAW, - .writefn = tlbi_aa64_alle1is_write }, - { .name = "TLBI_IPAS2E1", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 4, .opc2 = 1, - .access = PL2_W, .type = ARM_CP_NO_RAW, - .writefn = tlbi_aa64_ipas2e1_write }, - { .name = "TLBI_IPAS2LE1", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 4, .opc2 = 5, - .access = PL2_W, .type = ARM_CP_NO_RAW, - .writefn = tlbi_aa64_ipas2e1_write }, - { .name = "TLBI_ALLE1", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 7, .opc2 = 4, - .access = PL2_W, .type = ARM_CP_NO_RAW, - .writefn = tlbi_aa64_alle1_write }, - { .name = "TLBI_VMALLS12E1", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 7, .opc2 = 6, - .access = PL2_W, .type = ARM_CP_NO_RAW, - .writefn = tlbi_aa64_alle1is_write }, #ifndef CONFIG_USER_ONLY /* 64 bit address translation operations */ { .name = "AT_S1E1R", .state = ARM_CP_STATE_AA64, diff --git a/target/arm/tcg/tlb-insns.c b/target/arm/tcg/tlb-insns.c index 66096093dcc..ff7698e31b6 100644 --- a/target/arm/tcg/tlb-insns.c +++ b/target/arm/tcg/tlb-insns.c @@ -169,6 +169,73 @@ static void tlbiall_hyp_is_write(CPUARMState *env, const ARMCPRegInfo *ri, tlb_flush_by_mmuidx_all_cpus_synced(cs, ARMMMUIdxBit_E2); } +static void tlbi_aa64_vmalle1_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) +{ + CPUState *cs = env_cpu(env); + int mask = vae1_tlbmask(env); + + if (tlb_force_broadcast(env)) { + tlb_flush_by_mmuidx_all_cpus_synced(cs, mask); + } else { + tlb_flush_by_mmuidx(cs, mask); + } +} + +static void tlbi_aa64_alle1_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) +{ + CPUState *cs = env_cpu(env); + int mask = alle1_tlbmask(env); + + tlb_flush_by_mmuidx(cs, mask); +} + +static void tlbi_aa64_vae1_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) +{ + /* + * Invalidate by VA, EL1&0 (AArch64 version). + * Currently handles all of VAE1, VAAE1, VAALE1 and VALE1, + * since we don't support flush-for-specific-ASID-only or + * flush-last-level-only. + */ + CPUState *cs = env_cpu(env); + int mask = vae1_tlbmask(env); + uint64_t pageaddr = sextract64(value << 12, 0, 56); + int bits = vae1_tlbbits(env, pageaddr); + + if (tlb_force_broadcast(env)) { + tlb_flush_page_bits_by_mmuidx_all_cpus_synced(cs, pageaddr, mask, bits); + } else { + tlb_flush_page_bits_by_mmuidx(cs, pageaddr, mask, bits); + } +} + +static void tlbi_aa64_ipas2e1_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) +{ + CPUState *cs = env_cpu(env); + int mask = ipas2e1_tlbmask(env, value); + uint64_t pageaddr = sextract64(value << 12, 0, 56); + + if (tlb_force_broadcast(env)) { + tlb_flush_page_by_mmuidx_all_cpus_synced(cs, pageaddr, mask); + } else { + tlb_flush_page_by_mmuidx(cs, pageaddr, mask); + } +} + +static void tlbi_aa64_ipas2e1is_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) +{ + CPUState *cs = env_cpu(env); + int mask = ipas2e1_tlbmask(env, value); + uint64_t pageaddr = sextract64(value << 12, 0, 56); + + tlb_flush_page_by_mmuidx_all_cpus_synced(cs, pageaddr, mask); +} + static const ARMCPRegInfo tlbi_not_v7_cp_reginfo[] = { /* * MMU TLB control. Note that the wildcarding means we cover not just @@ -277,6 +344,99 @@ static const ARMCPRegInfo tlbi_v8_cp_reginfo[] = { .cp = 15, .opc1 = 4, .crn = 8, .crm = 0, .opc2 = 5, .type = ARM_CP_NO_RAW, .access = PL2_W, .writefn = tlbiipas2is_hyp_write }, + /* AArch64 TLBI operations */ + { .name = "TLBI_VMALLE1IS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 3, .opc2 = 0, + .access = PL1_W, .accessfn = access_ttlbis, .type = ARM_CP_NO_RAW, + .fgt = FGT_TLBIVMALLE1IS, + .writefn = tlbi_aa64_vmalle1is_write }, + { .name = "TLBI_VAE1IS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 3, .opc2 = 1, + .access = PL1_W, .accessfn = access_ttlbis, .type = ARM_CP_NO_RAW, + .fgt = FGT_TLBIVAE1IS, + .writefn = tlbi_aa64_vae1is_write }, + { .name = "TLBI_ASIDE1IS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 3, .opc2 = 2, + .access = PL1_W, .accessfn = access_ttlbis, .type = ARM_CP_NO_RAW, + .fgt = FGT_TLBIASIDE1IS, + .writefn = tlbi_aa64_vmalle1is_write }, + { .name = "TLBI_VAAE1IS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 3, .opc2 = 3, + .access = PL1_W, .accessfn = access_ttlbis, .type = ARM_CP_NO_RAW, + .fgt = FGT_TLBIVAAE1IS, + .writefn = tlbi_aa64_vae1is_write }, + { .name = "TLBI_VALE1IS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 3, .opc2 = 5, + .access = PL1_W, .accessfn = access_ttlbis, .type = ARM_CP_NO_RAW, + .fgt = FGT_TLBIVALE1IS, + .writefn = tlbi_aa64_vae1is_write }, + { .name = "TLBI_VAALE1IS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 3, .opc2 = 7, + .access = PL1_W, .accessfn = access_ttlbis, .type = ARM_CP_NO_RAW, + .fgt = FGT_TLBIVAALE1IS, + .writefn = tlbi_aa64_vae1is_write }, + { .name = "TLBI_VMALLE1", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 7, .opc2 = 0, + .access = PL1_W, .accessfn = access_ttlb, .type = ARM_CP_NO_RAW, + .fgt = FGT_TLBIVMALLE1, + .writefn = tlbi_aa64_vmalle1_write }, + { .name = "TLBI_VAE1", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 7, .opc2 = 1, + .access = PL1_W, .accessfn = access_ttlb, .type = ARM_CP_NO_RAW, + .fgt = FGT_TLBIVAE1, + .writefn = tlbi_aa64_vae1_write }, + { .name = "TLBI_ASIDE1", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 7, .opc2 = 2, + .access = PL1_W, .accessfn = access_ttlb, .type = ARM_CP_NO_RAW, + .fgt = FGT_TLBIASIDE1, + .writefn = tlbi_aa64_vmalle1_write }, + { .name = "TLBI_VAAE1", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 7, .opc2 = 3, + .access = PL1_W, .accessfn = access_ttlb, .type = ARM_CP_NO_RAW, + .fgt = FGT_TLBIVAAE1, + .writefn = tlbi_aa64_vae1_write }, + { .name = "TLBI_VALE1", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 7, .opc2 = 5, + .access = PL1_W, .accessfn = access_ttlb, .type = ARM_CP_NO_RAW, + .fgt = FGT_TLBIVALE1, + .writefn = tlbi_aa64_vae1_write }, + { .name = "TLBI_VAALE1", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 7, .opc2 = 7, + .access = PL1_W, .accessfn = access_ttlb, .type = ARM_CP_NO_RAW, + .fgt = FGT_TLBIVAALE1, + .writefn = tlbi_aa64_vae1_write }, + { .name = "TLBI_IPAS2E1IS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 0, .opc2 = 1, + .access = PL2_W, .type = ARM_CP_NO_RAW, + .writefn = tlbi_aa64_ipas2e1is_write }, + { .name = "TLBI_IPAS2LE1IS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 0, .opc2 = 5, + .access = PL2_W, .type = ARM_CP_NO_RAW, + .writefn = tlbi_aa64_ipas2e1is_write }, + { .name = "TLBI_ALLE1IS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 3, .opc2 = 4, + .access = PL2_W, .type = ARM_CP_NO_RAW, + .writefn = tlbi_aa64_alle1is_write }, + { .name = "TLBI_VMALLS12E1IS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 3, .opc2 = 6, + .access = PL2_W, .type = ARM_CP_NO_RAW, + .writefn = tlbi_aa64_alle1is_write }, + { .name = "TLBI_IPAS2E1", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 4, .opc2 = 1, + .access = PL2_W, .type = ARM_CP_NO_RAW, + .writefn = tlbi_aa64_ipas2e1_write }, + { .name = "TLBI_IPAS2LE1", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 4, .opc2 = 5, + .access = PL2_W, .type = ARM_CP_NO_RAW, + .writefn = tlbi_aa64_ipas2e1_write }, + { .name = "TLBI_ALLE1", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 7, .opc2 = 4, + .access = PL2_W, .type = ARM_CP_NO_RAW, + .writefn = tlbi_aa64_alle1_write }, + { .name = "TLBI_VMALLS12E1", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 7, .opc2 = 6, + .access = PL2_W, .type = ARM_CP_NO_RAW, + .writefn = tlbi_aa64_alle1is_write }, }; static const ARMCPRegInfo tlbi_el2_cp_reginfo[] = { From patchwork Fri Dec 13 17:32:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850211 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1643705wry; Fri, 13 Dec 2024 09:46:18 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVxi6dto56dVWTDrD/H1gAWXPEDSfdoghotJQKu0vA9IoCtFEk24x41MKRVWGPiFAQ7DFq70A==@linaro.org X-Google-Smtp-Source: AGHT+IFJAmoVGwY+Rynwk94g4Hn5QvHVCLY+jDiqkhg4kbjs6zOYcgNtJbh2KLYQmLzeFfIDYsya X-Received: by 2002:a17:907:1c07:b0:aa6:7c36:3428 with SMTP id a640c23a62f3a-aab7ad158b3mr315800966b.0.1734111978774; Fri, 13 Dec 2024 09:46:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111978; cv=none; d=google.com; s=arc-20240605; b=f+Yzr0fx3B2wWjuBZFXyWCj4wm93461IiWLb/KUSlpQEO8nVxPaGuRlGXg3AeqrYOB P850gXOFDbt98C4Gf9I9VjfE+Ixrb5h/GeR5PpXT4qwqzVTPdOTGyVftmXxwjCd3DjQk /aC/BNAcw7eaPDlkManbgLwm+OysJ0MxwoEbQ5W3r04QwYV/lLpkbHCr63Izq0jBdK51 393sUwtjsTFK9SO2spy/lMeNZes+jkOpSjrc3oTSNyjTpTx/D7HjM2DNTBWj+jguOCDN v0j3tXcuJfZWGF14vOK9vfH+fB9aqfPHLzrUEtkV0k4onpT4GTpZl1UugT340+tLO34Y /vmw== 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=IXb1EyNQgSAc6Jv9qKhwJUtQcVIW/R0AFPQfAJk+WHA=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=fN0CqFcdtZ2ILc8CqTW71OY1DsTSC8mxzo1Jj/c5pXz4FSPYqStr+rQs7U9Dw5IZ36 7E13atZv2Az8ol3VurohuUDW2N1Q9LTRPL+83msDBZddJGBOxeFD1z1y14BkfSkL/9co hxDhEPaDZ+VKxuTqsXfDloChLP1zn77YqqacnWVKMFr54qfhNNu9YaOE6Nk4o/kdVVSk JfqmuMqptVPAcVMuLeM4EzzSIQupU7QApC5SeCWBb/YaSRVkV9KLkoQsirImQp9u4ev4 8LkCqBTYxmLrNqOigbDT5LO43PxEvZuL8Ggzz0T2OheCSByIdl5bKzAcJjtqEo6/Zk4r SK6w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mJgSUrxa; 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 a640c23a62f3a-aa6b4918a3esi437190866b.635.2024.12.13.09.46.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:46:18 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mJgSUrxa; 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 1tM9Yj-0004TM-5A; Fri, 13 Dec 2024 12:34: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 ) id 1tM9YC-0000RX-D1 for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:34:06 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9Y6-0001m4-2s for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:34:03 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-434f80457a4so19355775e9.0 for ; Fri, 13 Dec 2024 09:33:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111236; x=1734716036; 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=IXb1EyNQgSAc6Jv9qKhwJUtQcVIW/R0AFPQfAJk+WHA=; b=mJgSUrxah3PyldZzAeRCjzVEEX0UdEwRzGjj4lpWqx1YVxinOCVtLwVjlrdIkQb6GR pSYI0WIye6bZD+YYgzRGjuSyiW7jMDvlPvAUcP56FPBd0w0SpP1vCe3icKRvAwlo6cL1 h+J3lL7P0gQxxzoGaM/G96/0e8LnxZ7s0AJhwCGRH8NJdGb/3oWusfw7SwKgURpAWy2y YF/wXQq4qSPj17rV+sXwv4Oq/mtdWY3rXFWiNXtUT4aY1cTGHv2gi+B4vX4Lcq68c6W+ 1SWecXJ5E/tXzyAFMpoxRekdAsFoSagTxfZpeoMJUqzhZ4WbR0efoisi9PBsDO8bXAog JJAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111236; x=1734716036; 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=IXb1EyNQgSAc6Jv9qKhwJUtQcVIW/R0AFPQfAJk+WHA=; b=PRb+CCE3KBAyljrkosNBJ7gJA4hfls4NDEULrTWarOVeOOnG4TKtVRvcjB36rckwdD xZTS4pPQT9Z2k6mj+bo3Fe+Wz0PO5wZbH7a8rMNo9vkhNpyUa64kVX3VdhyQapoai8aT aMF9F9TOPyc8MYfqSn18BtiY+2e+6jIuqwWMWrVQWLxRCjSDXOuTvnyvCMEn5p5nGkFg DUUpjiEp0FvLKCgXXd1bMFrdWVGkEiednTDFjBvPZOfr7RxUr23i3w6WEi2qIPzDl/Gd pQJVWc5W4JLcQ82caLdLa4R89WOAsW6RLozErM9ysjVygPBJKFy+FfB3WOxMbXtaL3NA Y2MA== X-Gm-Message-State: AOJu0Yx22j/YFRUKlA/vlnxfG447sCT9yxEVmSOS8kWMrKxXaalZ8YHA IFhdphS5Zsz9tnEGJCg5FbSyoPBeyau/jKJ2nz90AAZIyo/iSR1A0YLGAE7R8y0xzteDZgc9vxZ 2 X-Gm-Gg: ASbGncta3grH+zbU9ID/IOCXBveLN/WyD/Vjb33Qlq+Z3ur+jTdMekpmzlY+XqtdQ8Z cuYML07dzSDUn6qj3R5G0esJA4SR+SNY1m18efW1Odh6qumRHpoHYE0CCIxvWlsqLeHMDXsnNWT 1/ijYGZrQ9k6kuvG047YWzJEOqEXF0SIW6Y63ygTpvtj2QgyQZBcX41CeXYHZXlo14eQ+MBN/Bu 8tVlEaB2yYCcC+/1Y02WV8TpJ9Isw2z9YgatUuFjw/M6PsTkI155UeCMHh/Bw== X-Received: by 2002:a05:600c:1c09:b0:435:edb0:5d27 with SMTP id 5b1f17b1804b1-436230bfd93mr63250495e9.9.1734111235781; Fri, 13 Dec 2024 09:33:55 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:55 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 79/85] target/arm: Move the AArch64 EL2 TLBI insns Date: Fri, 13 Dec 2024 17:32:23 +0000 Message-Id: <20241213173229.3308926-80-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32f.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, T_SPF_TEMPERROR=0.01 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 Move the AArch64 EL2 TLBI insn definitions that were in el2_cp_reginfo[] across to tlb-insns.c. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20241210160452.2427965-5-peter.maydell@linaro.org --- target/arm/cpregs.h | 7 +++++ target/arm/helper.c | 61 ++++---------------------------------- target/arm/tcg/tlb-insns.c | 49 ++++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+), 55 deletions(-) diff --git a/target/arm/cpregs.h b/target/arm/cpregs.h index a14f5bb6c98..57446ae1b52 100644 --- a/target/arm/cpregs.h +++ b/target/arm/cpregs.h @@ -1146,13 +1146,20 @@ bool tlb_force_broadcast(CPUARMState *env); int tlbbits_for_regime(CPUARMState *env, ARMMMUIdx mmu_idx, uint64_t addr); int vae1_tlbbits(CPUARMState *env, uint64_t addr); +int vae2_tlbbits(CPUARMState *env, uint64_t addr); int vae1_tlbmask(CPUARMState *env); +int vae2_tlbmask(CPUARMState *env); int ipas2e1_tlbmask(CPUARMState *env, int64_t value); +int e2_tlbmask(CPUARMState *env); void tlbi_aa64_vmalle1is_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value); void tlbi_aa64_alle1is_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value); void tlbi_aa64_vae1is_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value); +void tlbi_aa64_alle2is_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value); +void tlbi_aa64_vae2is_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value); #endif /* TARGET_ARM_CPREGS_H */ diff --git a/target/arm/helper.c b/target/arm/helper.c index cc7da7f1159..6942d2f2fb3 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -4705,7 +4705,7 @@ int vae1_tlbmask(CPUARMState *env) return mask; } -static int vae2_tlbmask(CPUARMState *env) +int vae2_tlbmask(CPUARMState *env) { uint64_t hcr = arm_hcr_el2_eff(env); uint16_t mask; @@ -4748,7 +4748,7 @@ int vae1_tlbbits(CPUARMState *env, uint64_t addr) return tlbbits_for_regime(env, mmu_idx, addr); } -static int vae2_tlbbits(CPUARMState *env, uint64_t addr) +int vae2_tlbbits(CPUARMState *env, uint64_t addr) { uint64_t hcr = arm_hcr_el2_eff(env); ARMMMUIdx mmu_idx; @@ -4776,7 +4776,7 @@ void tlbi_aa64_vmalle1is_write(CPUARMState *env, const ARMCPRegInfo *ri, tlb_flush_by_mmuidx_all_cpus_synced(cs, mask); } -static int e2_tlbmask(CPUARMState *env) +int e2_tlbmask(CPUARMState *env) { return (ARMMMUIdxBit_E20_0 | ARMMMUIdxBit_E20_2 | @@ -4784,15 +4784,6 @@ static int e2_tlbmask(CPUARMState *env) ARMMMUIdxBit_E2); } -static void tlbi_aa64_alle2_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value) -{ - CPUState *cs = env_cpu(env); - int mask = e2_tlbmask(env); - - tlb_flush_by_mmuidx(cs, mask); -} - static void tlbi_aa64_alle3_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) { @@ -4811,8 +4802,8 @@ void tlbi_aa64_alle1is_write(CPUARMState *env, const ARMCPRegInfo *ri, tlb_flush_by_mmuidx_all_cpus_synced(cs, mask); } -static void tlbi_aa64_alle2is_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value) +void tlbi_aa64_alle2is_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) { CPUState *cs = env_cpu(env); int mask = e2_tlbmask(env); @@ -4828,22 +4819,6 @@ static void tlbi_aa64_alle3is_write(CPUARMState *env, const ARMCPRegInfo *ri, tlb_flush_by_mmuidx_all_cpus_synced(cs, ARMMMUIdxBit_E3); } -static void tlbi_aa64_vae2_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value) -{ - /* - * Invalidate by VA, EL2 - * Currently handles both VAE2 and VALE2, since we don't support - * flush-last-level-only. - */ - CPUState *cs = env_cpu(env); - int mask = vae2_tlbmask(env); - uint64_t pageaddr = sextract64(value << 12, 0, 56); - int bits = vae2_tlbbits(env, pageaddr); - - tlb_flush_page_bits_by_mmuidx(cs, pageaddr, mask, bits); -} - static void tlbi_aa64_vae3_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) { @@ -4870,7 +4845,7 @@ void tlbi_aa64_vae1is_write(CPUARMState *env, const ARMCPRegInfo *ri, tlb_flush_page_bits_by_mmuidx_all_cpus_synced(cs, pageaddr, mask, bits); } -static void tlbi_aa64_vae2is_write(CPUARMState *env, const ARMCPRegInfo *ri, +void tlbi_aa64_vae2is_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) { CPUState *cs = env_cpu(env); @@ -6036,30 +6011,6 @@ static const ARMCPRegInfo el2_cp_reginfo[] = { { .name = "HTTBR", .cp = 15, .opc1 = 4, .crm = 2, .access = PL2_RW, .type = ARM_CP_64BIT | ARM_CP_ALIAS, .fieldoffset = offsetof(CPUARMState, cp15.ttbr0_el[2]) }, - { .name = "TLBI_ALLE2", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 7, .opc2 = 0, - .access = PL2_W, .type = ARM_CP_NO_RAW | ARM_CP_EL3_NO_EL2_UNDEF, - .writefn = tlbi_aa64_alle2_write }, - { .name = "TLBI_VAE2", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 7, .opc2 = 1, - .access = PL2_W, .type = ARM_CP_NO_RAW | ARM_CP_EL3_NO_EL2_UNDEF, - .writefn = tlbi_aa64_vae2_write }, - { .name = "TLBI_VALE2", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 7, .opc2 = 5, - .access = PL2_W, .type = ARM_CP_NO_RAW | ARM_CP_EL3_NO_EL2_UNDEF, - .writefn = tlbi_aa64_vae2_write }, - { .name = "TLBI_ALLE2IS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 3, .opc2 = 0, - .access = PL2_W, .type = ARM_CP_NO_RAW | ARM_CP_EL3_NO_EL2_UNDEF, - .writefn = tlbi_aa64_alle2is_write }, - { .name = "TLBI_VAE2IS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 3, .opc2 = 1, - .access = PL2_W, .type = ARM_CP_NO_RAW | ARM_CP_EL3_NO_EL2_UNDEF, - .writefn = tlbi_aa64_vae2is_write }, - { .name = "TLBI_VALE2IS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 3, .opc2 = 5, - .access = PL2_W, .type = ARM_CP_NO_RAW | ARM_CP_EL3_NO_EL2_UNDEF, - .writefn = tlbi_aa64_vae2is_write }, #ifndef CONFIG_USER_ONLY /* * Unlike the other EL2-related AT operations, these must diff --git a/target/arm/tcg/tlb-insns.c b/target/arm/tcg/tlb-insns.c index ff7698e31b6..1eebb6055ce 100644 --- a/target/arm/tcg/tlb-insns.c +++ b/target/arm/tcg/tlb-insns.c @@ -191,6 +191,31 @@ static void tlbi_aa64_alle1_write(CPUARMState *env, const ARMCPRegInfo *ri, tlb_flush_by_mmuidx(cs, mask); } +static void tlbi_aa64_alle2_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) +{ + CPUState *cs = env_cpu(env); + int mask = e2_tlbmask(env); + + tlb_flush_by_mmuidx(cs, mask); +} + +static void tlbi_aa64_vae2_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) +{ + /* + * Invalidate by VA, EL2 + * Currently handles both VAE2 and VALE2, since we don't support + * flush-last-level-only. + */ + CPUState *cs = env_cpu(env); + int mask = vae2_tlbmask(env); + uint64_t pageaddr = sextract64(value << 12, 0, 56); + int bits = vae2_tlbbits(env, pageaddr); + + tlb_flush_page_bits_by_mmuidx(cs, pageaddr, mask, bits); +} + static void tlbi_aa64_vae1_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) { @@ -460,6 +485,30 @@ static const ARMCPRegInfo tlbi_el2_cp_reginfo[] = { { .name = "TLBIMVAHIS", .cp = 15, .opc1 = 4, .crn = 8, .crm = 3, .opc2 = 1, .type = ARM_CP_NO_RAW, .access = PL2_W, .writefn = tlbimva_hyp_is_write }, + { .name = "TLBI_ALLE2", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 7, .opc2 = 0, + .access = PL2_W, .type = ARM_CP_NO_RAW | ARM_CP_EL3_NO_EL2_UNDEF, + .writefn = tlbi_aa64_alle2_write }, + { .name = "TLBI_VAE2", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 7, .opc2 = 1, + .access = PL2_W, .type = ARM_CP_NO_RAW | ARM_CP_EL3_NO_EL2_UNDEF, + .writefn = tlbi_aa64_vae2_write }, + { .name = "TLBI_VALE2", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 7, .opc2 = 5, + .access = PL2_W, .type = ARM_CP_NO_RAW | ARM_CP_EL3_NO_EL2_UNDEF, + .writefn = tlbi_aa64_vae2_write }, + { .name = "TLBI_ALLE2IS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 3, .opc2 = 0, + .access = PL2_W, .type = ARM_CP_NO_RAW | ARM_CP_EL3_NO_EL2_UNDEF, + .writefn = tlbi_aa64_alle2is_write }, + { .name = "TLBI_VAE2IS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 3, .opc2 = 1, + .access = PL2_W, .type = ARM_CP_NO_RAW | ARM_CP_EL3_NO_EL2_UNDEF, + .writefn = tlbi_aa64_vae2is_write }, + { .name = "TLBI_VALE2IS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 3, .opc2 = 5, + .access = PL2_W, .type = ARM_CP_NO_RAW | ARM_CP_EL3_NO_EL2_UNDEF, + .writefn = tlbi_aa64_vae2is_write }, }; void define_tlb_insn_regs(ARMCPU *cpu) From patchwork Fri Dec 13 17:32:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850200 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1643068wry; Fri, 13 Dec 2024 09:44:55 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWESGugxtt4KmBeS02j0UAG20egWdbRnjE+lZNqkJ0xUYS7Qghf5J2k9LbSmGx5BdPgaMYHCw==@linaro.org X-Google-Smtp-Source: AGHT+IFOAkBMTv/5aYfSAs8wnkLcIJjuOnyCifXFBJ+WuLOQj+Xb1pFxOMKrx+/e+Q63iLlzNkBg X-Received: by 2002:a05:600c:1e0d:b0:42c:b9c8:2bb0 with SMTP id 5b1f17b1804b1-4362aa27057mr29867915e9.4.1734111895363; Fri, 13 Dec 2024 09:44:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111895; cv=none; d=google.com; s=arc-20240605; b=JAbMDOB86oGBA3C5Dmsm8ltkypF01T5JZ7sV2biiueqwzIk2GhAMJp2sv3iNlmpqL7 o1pdqZE8Wnm6KMziHIH76wXR0d4Srb3D7ZFt1V4VJwrasCyOapUOwKqiecHFZ35YdGgX Y4s62IkcEbhHxegzOQE2VFCk+xEJWIcg5rD/6q8YjsxE8leUs/2G1G8dQbnWAkwnXX3X IGf6VTs0O4nVaoH6AqqnjpuoMwrEaSkHVygKWtYVmVNQ/14C4MQugVXJd6qqz14eYyE2 F4n6uYRQycUsFGD1qz+GwRsSBG3k3vc2B8z99r+xBdePiMCcMJnY41MYezklTFBm5TbW fnsw== 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=PnZrF/tSgFnWOLB78XUnLnp4yZ94TIfs2kxs+s5SEtA=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=NKeZVu1aCqEsOu2AGX4hiMvvBX7XjVvGMM3AbAq3Aed5IwrevgtZ0euuN8W0uC0ejW /wT5De+t25qHLVAqaCz8d0lpVWAHt7iJodVv7mT1YKPhUwMvD9rB0R12hSSiqrnkn7GD P3d3vlIgS6soooa9e41yi8tGylp3M7jYLQ6BTlFj4aN76GZ+4tdvRlnY2WHDNE2yLU0d oKyxBGyz+QDYxeI0NwSbw3OSTJQy3JLOf642PiumwiSFjIiPm++5ZHFkUSDLQePSbx0P raCT3Rgb48GG0NbQ7AlDVeDFKPulor6dejJ/KWJRyK9oXNxRmLlU3rSk8TPED/mXEqca 5p1g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ILMci85b; 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 ffacd0b85a97d-388c806f397si29121f8f.682.2024.12.13.09.44.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:44:55 -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=ILMci85b; 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 1tM9YY-000303-Bt; Fri, 13 Dec 2024 12:34:26 -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 1tM9YC-0000RY-DW for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:34:06 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9Y8-0001mI-Ec for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:34:03 -0500 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-4361f65ca01so19215045e9.1 for ; Fri, 13 Dec 2024 09:33:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111237; x=1734716037; 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=PnZrF/tSgFnWOLB78XUnLnp4yZ94TIfs2kxs+s5SEtA=; b=ILMci85be/Jzkz/iSjZNiBZeTgzzNWBiBIleucfVXCz9ZU17GvB4Gjbdvbnq57TpOY KElzHwYdYREcPU5YfIe+P3RU3zj0WqlbUGlWgl6C4pGkh2nUvfHAmdPnjt5EItcBnffz txdt92uozHIGwEI1npPj0zqSnVDxl3MErPguM21mypTmoQNHHc+QHFEDB/XeCyoGQaba Z82SJSk6Zb/edBNN2Bj6lZ6DN1f185sRUEvM6DsYm4Hzts2yhGLxOitkw6OGNCG/J1e3 QDPKglgkQdQh5FVlwzmH9EPfButl8HmqwZEyKJ8iRdvLTMnJH8fhhx443pfWPwZ/Uxsg Yy7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111237; x=1734716037; 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=PnZrF/tSgFnWOLB78XUnLnp4yZ94TIfs2kxs+s5SEtA=; b=Kr2giwj/8W+AyLKuBpDYOUrxIPXwz19PXAdixtP8ic2h+hE3Fo5ShVwV8biTrQKZUq ZYgMhAV4kP4ORWF/GG7q3GpowNZcvTOcv+8b2sP+Ul5/7T/+HB8Y3vj8tBaWAlmS7Rb7 y4XbZ0t5wXP6YLTgP8Ojr7spPsZNDQxLTcTRcgOix8REFy0W+t8eayTi+BvReNSU4KZT oofhANH/2O+VlQL0OF5AunYfopq4QjoOSKSWbDg3o0ETeB5fPYK5mqy3Jle5xzJZbf0x RDkroZRSUMYjhNlBbBS1px3Ug2vYYrFvfwBFbJQXbrt44lDgEEZ345ZvKzMl1lqa0GXJ r3WQ== X-Gm-Message-State: AOJu0Yyd2o6nb+X6AKaJcU71iAvWgXH96cNKmo0AIOaSpzzItQb6iWLY 0GSm3z6EP2SNKZ6cj9/Lfqrk0DJlKwaAvWDkqGF7Z3c6+1BezFEPw27gXPYK5hZeAx1WBFPftty D X-Gm-Gg: ASbGnctRJ2zVuKUKuGrmdRcvzLUnX+ikW8LU+Z6uylI6/7AWuO4yCODHRCuQKeXpH36 pKpyG/LgL4KE7Qfvao5mDR7w7SE+wSdkycK8TnIVfFjCGcgJsg/NcBWSCL2uObToqww92SNZvSV 3pSWQe1QycNLBGcKzievWuatwSmWNsLGT+qUfz0zE4SKi6LomHen0rBamMoVnKWhS1zyl5viWHD wcP8wNmN74zHPRZLXN3H9LoZVhSaXKTwp3QqWH6ko0n8Bjaz3yi64ctQTFRcQ== X-Received: by 2002:a05:6000:1a8b:b0:385:e5d8:2bea with SMTP id ffacd0b85a97d-3888dcd4a0emr2821232f8f.20.1734111236668; Fri, 13 Dec 2024 09:33:56 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:56 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 80/85] target/arm: Move AArch64 EL3 TLBI insns Date: Fri, 13 Dec 2024 17:32:24 +0000 Message-Id: <20241213173229.3308926-81-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32a.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 Move the AArch64 EL3 TLBI insns from el3_cp_reginfo[] across to tlb-insns.c. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20241210160452.2427965-6-peter.maydell@linaro.org --- target/arm/cpregs.h | 4 +++ target/arm/helper.c | 56 +++----------------------------------- target/arm/tcg/tlb-insns.c | 54 ++++++++++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+), 52 deletions(-) diff --git a/target/arm/cpregs.h b/target/arm/cpregs.h index 57446ae1b52..722ac5bb884 100644 --- a/target/arm/cpregs.h +++ b/target/arm/cpregs.h @@ -1161,5 +1161,9 @@ void tlbi_aa64_alle2is_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value); void tlbi_aa64_vae2is_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value); +void tlbi_aa64_vae3is_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value); +void tlbi_aa64_alle3is_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value); #endif /* TARGET_ARM_CPREGS_H */ diff --git a/target/arm/helper.c b/target/arm/helper.c index 6942d2f2fb3..baeabb5ec73 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -4784,15 +4784,6 @@ int e2_tlbmask(CPUARMState *env) ARMMMUIdxBit_E2); } -static void tlbi_aa64_alle3_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value) -{ - ARMCPU *cpu = env_archcpu(env); - CPUState *cs = CPU(cpu); - - tlb_flush_by_mmuidx(cs, ARMMMUIdxBit_E3); -} - void tlbi_aa64_alle1is_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) { @@ -4811,29 +4802,14 @@ void tlbi_aa64_alle2is_write(CPUARMState *env, const ARMCPRegInfo *ri, tlb_flush_by_mmuidx_all_cpus_synced(cs, mask); } -static void tlbi_aa64_alle3is_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value) +void tlbi_aa64_alle3is_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) { CPUState *cs = env_cpu(env); tlb_flush_by_mmuidx_all_cpus_synced(cs, ARMMMUIdxBit_E3); } -static void tlbi_aa64_vae3_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value) -{ - /* - * Invalidate by VA, EL3 - * Currently handles both VAE3 and VALE3, since we don't support - * flush-last-level-only. - */ - ARMCPU *cpu = env_archcpu(env); - CPUState *cs = CPU(cpu); - uint64_t pageaddr = sextract64(value << 12, 0, 56); - - tlb_flush_page_by_mmuidx(cs, pageaddr, ARMMMUIdxBit_E3); -} - void tlbi_aa64_vae1is_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) { @@ -4856,8 +4832,8 @@ void tlbi_aa64_vae2is_write(CPUARMState *env, const ARMCPRegInfo *ri, tlb_flush_page_bits_by_mmuidx_all_cpus_synced(cs, pageaddr, mask, bits); } -static void tlbi_aa64_vae3is_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value) +void tlbi_aa64_vae3is_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) { CPUState *cs = env_cpu(env); uint64_t pageaddr = sextract64(value << 12, 0, 56); @@ -6223,30 +6199,6 @@ static const ARMCPRegInfo el3_cp_reginfo[] = { .opc0 = 3, .opc1 = 6, .crn = 5, .crm = 1, .opc2 = 1, .access = PL3_RW, .type = ARM_CP_CONST, .resetvalue = 0 }, - { .name = "TLBI_ALLE3IS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 6, .crn = 8, .crm = 3, .opc2 = 0, - .access = PL3_W, .type = ARM_CP_NO_RAW, - .writefn = tlbi_aa64_alle3is_write }, - { .name = "TLBI_VAE3IS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 6, .crn = 8, .crm = 3, .opc2 = 1, - .access = PL3_W, .type = ARM_CP_NO_RAW, - .writefn = tlbi_aa64_vae3is_write }, - { .name = "TLBI_VALE3IS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 6, .crn = 8, .crm = 3, .opc2 = 5, - .access = PL3_W, .type = ARM_CP_NO_RAW, - .writefn = tlbi_aa64_vae3is_write }, - { .name = "TLBI_ALLE3", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 6, .crn = 8, .crm = 7, .opc2 = 0, - .access = PL3_W, .type = ARM_CP_NO_RAW, - .writefn = tlbi_aa64_alle3_write }, - { .name = "TLBI_VAE3", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 6, .crn = 8, .crm = 7, .opc2 = 1, - .access = PL3_W, .type = ARM_CP_NO_RAW, - .writefn = tlbi_aa64_vae3_write }, - { .name = "TLBI_VALE3", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 6, .crn = 8, .crm = 7, .opc2 = 5, - .access = PL3_W, .type = ARM_CP_NO_RAW, - .writefn = tlbi_aa64_vae3_write }, }; #ifndef CONFIG_USER_ONLY diff --git a/target/arm/tcg/tlb-insns.c b/target/arm/tcg/tlb-insns.c index 1eebb6055ce..528265404de 100644 --- a/target/arm/tcg/tlb-insns.c +++ b/target/arm/tcg/tlb-insns.c @@ -200,6 +200,15 @@ static void tlbi_aa64_alle2_write(CPUARMState *env, const ARMCPRegInfo *ri, tlb_flush_by_mmuidx(cs, mask); } +static void tlbi_aa64_alle3_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) +{ + ARMCPU *cpu = env_archcpu(env); + CPUState *cs = CPU(cpu); + + tlb_flush_by_mmuidx(cs, ARMMMUIdxBit_E3); +} + static void tlbi_aa64_vae2_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) { @@ -216,6 +225,21 @@ static void tlbi_aa64_vae2_write(CPUARMState *env, const ARMCPRegInfo *ri, tlb_flush_page_bits_by_mmuidx(cs, pageaddr, mask, bits); } +static void tlbi_aa64_vae3_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) +{ + /* + * Invalidate by VA, EL3 + * Currently handles both VAE3 and VALE3, since we don't support + * flush-last-level-only. + */ + ARMCPU *cpu = env_archcpu(env); + CPUState *cs = CPU(cpu); + uint64_t pageaddr = sextract64(value << 12, 0, 56); + + tlb_flush_page_by_mmuidx(cs, pageaddr, ARMMMUIdxBit_E3); +} + static void tlbi_aa64_vae1_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) { @@ -511,6 +535,33 @@ static const ARMCPRegInfo tlbi_el2_cp_reginfo[] = { .writefn = tlbi_aa64_vae2is_write }, }; +static const ARMCPRegInfo tlbi_el3_cp_reginfo[] = { + { .name = "TLBI_ALLE3IS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 6, .crn = 8, .crm = 3, .opc2 = 0, + .access = PL3_W, .type = ARM_CP_NO_RAW, + .writefn = tlbi_aa64_alle3is_write }, + { .name = "TLBI_VAE3IS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 6, .crn = 8, .crm = 3, .opc2 = 1, + .access = PL3_W, .type = ARM_CP_NO_RAW, + .writefn = tlbi_aa64_vae3is_write }, + { .name = "TLBI_VALE3IS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 6, .crn = 8, .crm = 3, .opc2 = 5, + .access = PL3_W, .type = ARM_CP_NO_RAW, + .writefn = tlbi_aa64_vae3is_write }, + { .name = "TLBI_ALLE3", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 6, .crn = 8, .crm = 7, .opc2 = 0, + .access = PL3_W, .type = ARM_CP_NO_RAW, + .writefn = tlbi_aa64_alle3_write }, + { .name = "TLBI_VAE3", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 6, .crn = 8, .crm = 7, .opc2 = 1, + .access = PL3_W, .type = ARM_CP_NO_RAW, + .writefn = tlbi_aa64_vae3_write }, + { .name = "TLBI_VALE3", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 6, .crn = 8, .crm = 7, .opc2 = 5, + .access = PL3_W, .type = ARM_CP_NO_RAW, + .writefn = tlbi_aa64_vae3_write }, +}; + void define_tlb_insn_regs(ARMCPU *cpu) { CPUARMState *env = &cpu->env; @@ -537,4 +588,7 @@ void define_tlb_insn_regs(ARMCPU *cpu) && arm_feature(env, ARM_FEATURE_V8))) { define_arm_cp_regs(cpu, tlbi_el2_cp_reginfo); } + if (arm_feature(env, ARM_FEATURE_EL3)) { + define_arm_cp_regs(cpu, tlbi_el3_cp_reginfo); + } } From patchwork Fri Dec 13 17:32:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850194 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1642448wry; Fri, 13 Dec 2024 09:43:24 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVtWQ33U+wvcUXYxuSE2Thu5BxxQ80TpQWdD+vrYom54p+tafW3IUGc/Rh5LzalezF1GZoqnA==@linaro.org X-Google-Smtp-Source: AGHT+IHhOKMoq7ORCBayjMCGcMuMitUwzVpjym4R5kmmZT3aiV9PDMABtwVpT4XYgWUre0iwl50n X-Received: by 2002:a05:6000:400c:b0:386:2aba:a7f6 with SMTP id ffacd0b85a97d-3888e0c064bmr2604239f8f.49.1734111804211; Fri, 13 Dec 2024 09:43:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111804; cv=none; d=google.com; s=arc-20240605; b=R+rn7rhIYtMgu2pLRQf2DOuDw2FZNFSbFH8BnZ/EAO28hZDxPN9Jjkc7Z7mWXm/GHc kBit45vgqoOUZJ/dXZp5KHVmCuaoVWdvnTmPZv4vE5noktr7tqJvN8h24G+CHtpZwcaR ItAn1SyLzJSMqp8YGhvOdaKQXdFt3h9TahswVz7C0DSIppclK4s7DVZ0kopZqo0dOkLR qXJSQOCsh3xmdx4wBNLDREGU9MgeopzNr+iv5njfCbzkG35E65vsYe9r+go9UQwmQsmT 3UqvIIj+tJR2h5LO677IhIAyKvvkR9gnImLj8rNfLz8NhsN0use7YRhdhVaI4ienT4Rf I5OA== 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=45L+aoVgEEd2WUjbOIWPfqtVdvY9lz3HkpoBO1xYvkQ=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=KROFjOVew9+9SmVaIlp/C7ViqcnqwHqMFcWE/coLQpg26E15ILfOCNSefzbAYLJMJN kRkJNLEhk70UEOrNKc7BQEuws30Y5LkRSvMPlET+xbGegCk6HbUc6lzpnQ+dYtbBfXx1 FIhsRa/EkvcFcAPWVMcn9LVV3kRPykKmEhZHsM1/6GjPCZoS3Rbcs1BFrnRmQ98kjk2A nIeDzvokyg7/r8N6yzAP5KoUkqzlOv95BUhRh+L4hKBBNwJ0zsf0of87VS+NUVkCPs3B +c17TxKTWsjMqmUUeq5mtoK78BT3nPRtisNIp9RMnN6a3tKLUWc+CkftLvlBVzziGOe2 GO9Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nBvpZXYM; 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 ffacd0b85a97d-388c8061bf0si38707f8f.497.2024.12.13.09.43.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:43:24 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nBvpZXYM; 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 1tM9aU-000100-3L; Fri, 13 Dec 2024 12:36:26 -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 1tM9YE-0000Tf-8L for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:34:06 -0500 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9Y8-0001mv-E3 for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:34:05 -0500 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-386329da1d9so1000946f8f.1 for ; Fri, 13 Dec 2024 09:33:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111238; x=1734716038; 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=45L+aoVgEEd2WUjbOIWPfqtVdvY9lz3HkpoBO1xYvkQ=; b=nBvpZXYMl4n4QpXWFzjgOdvGNwoPMA+XKnJimmqbTxHi7dUl3TGn/hRLJtpQvvdqRn f3XkkCUlnq9bwcKWVITQ6NGrEIJOcnXjrJYS2YIgyu+tI/QaaSHrR4kraE+lFig3ic1e kiywBr4cA1/HMW3LbCUKN607r5k8GuUTK0VHeJNL3sRWLlNfnoe2DXYUm2t19T1lxuxk w0xK6QJU3OIq2KAKlxL3k2EC9WWFqtAcyMKUmWgRO4lFAEwwllN1bh90DZAyZMXcT5Md 0M1IrGzZaMHC0H9HM45KxKkoBwQd/749vPxjMM7eHAOIuJbxHL2IrM4YDfEzj25ZKpC9 QP0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111238; x=1734716038; 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=45L+aoVgEEd2WUjbOIWPfqtVdvY9lz3HkpoBO1xYvkQ=; b=E3r+LwhM2GW2Mw9OC3+EUSFhfzswujCqURxPqTQhJTNpOAFzZf4gRAt17w76aUgd3p F75+K0Jb/eyYqNFAvEeWmWXiO/liwjVKAgNar5LVZIqv5s1AT3HhklcHHwyaVSMskYV/ zfE2t7v66qvCtK+tAlHdETDUJNnVNe61nkBUhMyY04Ob+tHTwWfh5epCZnKb1s99mMnu gnkNg1aqb3HzOSIFOzDqR6eP9ym4MPG3eXaymzGBbzbtbSsUTeaE9/DfHcpd3UosiJ1w YTnx2/QYsaxYr1fuNiQKmtTNKQtuuKhdI+DkosBHPOPN6BI98uvQ5oQ+iNjAIrm1er1I FHQw== X-Gm-Message-State: AOJu0YwZDKKgIIDGhS4/HXUO0U1KMHik1mzqFVR0cpzBcxMiViJX4GHb hizDriZmrPAyxTj9opsx5/g/cvnc5YlQrdTRD83c/8df4JH2YvcppzOucjRiwgA7kqOk+oFPjrw T X-Gm-Gg: ASbGnctkmBDykfIrdSojMsAX2AK0vsXSKRB6mvRF2gx4hhdtgkabCQRP8MN/bllrRU+ 2aA8f/8D+XT/xtoNqSI6NFiKNmvKNOjDYBxsNJqHUaSzTexeSQmyAy0aS8Dh/JhMiScEuovAIYa 1TS3HpaIt7meke0eMxdUSNg29cQl1Y2G5l0CywqAjWcojS/zXCtfln4mRz4be4mK2VkSQewASC5 mVEf0B/Cn3/yL8I5sp76nyc5qPkLGdN5dJcd4FNjpoflpgjpCrEJrMz7OVbtw== X-Received: by 2002:a05:6000:2ad:b0:385:f19f:5a8f with SMTP id ffacd0b85a97d-38880ac6108mr2888983f8f.4.1734111237758; Fri, 13 Dec 2024 09:33:57 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:57 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 81/85] target/arm: Move TLBI range insns Date: Fri, 13 Dec 2024 17:32:25 +0000 Message-Id: <20241213173229.3308926-82-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42a.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 Move the TLBI invalidate-range insns across to tlb-insns.c. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20241210160452.2427965-7-peter.maydell@linaro.org --- target/arm/cpregs.h | 2 + target/arm/helper.c | 330 +------------------------------------ target/arm/tcg/tlb-insns.c | 329 ++++++++++++++++++++++++++++++++++++ 3 files changed, 333 insertions(+), 328 deletions(-) diff --git a/target/arm/cpregs.h b/target/arm/cpregs.h index 722ac5bb884..fe838bcfd97 100644 --- a/target/arm/cpregs.h +++ b/target/arm/cpregs.h @@ -1142,6 +1142,8 @@ CPAccessResult access_ttlb(CPUARMState *env, const ARMCPRegInfo *ri, bool isread); CPAccessResult access_ttlbis(CPUARMState *env, const ARMCPRegInfo *ri, bool isread); +CPAccessResult access_ttlbos(CPUARMState *env, const ARMCPRegInfo *ri, + bool isread); bool tlb_force_broadcast(CPUARMState *env); int tlbbits_for_regime(CPUARMState *env, ARMMMUIdx mmu_idx, uint64_t addr); diff --git a/target/arm/helper.c b/target/arm/helper.c index baeabb5ec73..376aa9aecd5 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -388,8 +388,8 @@ CPAccessResult access_ttlbis(CPUARMState *env, const ARMCPRegInfo *ri, #ifdef TARGET_AARCH64 /* Check for traps from EL1 due to HCR_EL2.TTLB or TTLBOS. */ -static CPAccessResult access_ttlbos(CPUARMState *env, const ARMCPRegInfo *ri, - bool isread) +CPAccessResult access_ttlbos(CPUARMState *env, const ARMCPRegInfo *ri, + bool isread) { if (arm_current_el(env) == 1 && (arm_hcr_el2_eff(env) & (HCR_TTLB | HCR_TTLBOS))) { @@ -4856,202 +4856,6 @@ int ipas2e1_tlbmask(CPUARMState *env, int64_t value) : ARMMMUIdxBit_Stage2); } -#ifdef TARGET_AARCH64 -typedef struct { - uint64_t base; - uint64_t length; -} TLBIRange; - -static ARMGranuleSize tlbi_range_tg_to_gran_size(int tg) -{ - /* - * Note that the TLBI range TG field encoding differs from both - * TG0 and TG1 encodings. - */ - switch (tg) { - case 1: - return Gran4K; - case 2: - return Gran16K; - case 3: - return Gran64K; - default: - return GranInvalid; - } -} - -static TLBIRange tlbi_aa64_get_range(CPUARMState *env, ARMMMUIdx mmuidx, - uint64_t value) -{ - unsigned int page_size_granule, page_shift, num, scale, exponent; - /* Extract one bit to represent the va selector in use. */ - uint64_t select = sextract64(value, 36, 1); - ARMVAParameters param = aa64_va_parameters(env, select, mmuidx, true, false); - TLBIRange ret = { }; - ARMGranuleSize gran; - - page_size_granule = extract64(value, 46, 2); - gran = tlbi_range_tg_to_gran_size(page_size_granule); - - /* The granule encoded in value must match the granule in use. */ - if (gran != param.gran) { - qemu_log_mask(LOG_GUEST_ERROR, "Invalid tlbi page size granule %d\n", - page_size_granule); - return ret; - } - - page_shift = arm_granule_bits(gran); - num = extract64(value, 39, 5); - scale = extract64(value, 44, 2); - exponent = (5 * scale) + 1; - - ret.length = (num + 1) << (exponent + page_shift); - - if (param.select) { - ret.base = sextract64(value, 0, 37); - } else { - ret.base = extract64(value, 0, 37); - } - if (param.ds) { - /* - * With DS=1, BaseADDR is always shifted 16 so that it is able - * to address all 52 va bits. The input address is perforce - * aligned on a 64k boundary regardless of translation granule. - */ - page_shift = 16; - } - ret.base <<= page_shift; - - return ret; -} - -static void do_rvae_write(CPUARMState *env, uint64_t value, - int idxmap, bool synced) -{ - ARMMMUIdx one_idx = ARM_MMU_IDX_A | ctz32(idxmap); - TLBIRange range; - int bits; - - range = tlbi_aa64_get_range(env, one_idx, value); - bits = tlbbits_for_regime(env, one_idx, range.base); - - if (synced) { - tlb_flush_range_by_mmuidx_all_cpus_synced(env_cpu(env), - range.base, - range.length, - idxmap, - bits); - } else { - tlb_flush_range_by_mmuidx(env_cpu(env), range.base, - range.length, idxmap, bits); - } -} - -static void tlbi_aa64_rvae1_write(CPUARMState *env, - const ARMCPRegInfo *ri, - uint64_t value) -{ - /* - * Invalidate by VA range, EL1&0. - * Currently handles all of RVAE1, RVAAE1, RVAALE1 and RVALE1, - * since we don't support flush-for-specific-ASID-only or - * flush-last-level-only. - */ - - do_rvae_write(env, value, vae1_tlbmask(env), - tlb_force_broadcast(env)); -} - -static void tlbi_aa64_rvae1is_write(CPUARMState *env, - const ARMCPRegInfo *ri, - uint64_t value) -{ - /* - * Invalidate by VA range, Inner/Outer Shareable EL1&0. - * Currently handles all of RVAE1IS, RVAE1OS, RVAAE1IS, RVAAE1OS, - * RVAALE1IS, RVAALE1OS, RVALE1IS and RVALE1OS, since we don't support - * flush-for-specific-ASID-only, flush-last-level-only or inner/outer - * shareable specific flushes. - */ - - do_rvae_write(env, value, vae1_tlbmask(env), true); -} - -static void tlbi_aa64_rvae2_write(CPUARMState *env, - const ARMCPRegInfo *ri, - uint64_t value) -{ - /* - * Invalidate by VA range, EL2. - * Currently handles all of RVAE2 and RVALE2, - * since we don't support flush-for-specific-ASID-only or - * flush-last-level-only. - */ - - do_rvae_write(env, value, vae2_tlbmask(env), - tlb_force_broadcast(env)); - - -} - -static void tlbi_aa64_rvae2is_write(CPUARMState *env, - const ARMCPRegInfo *ri, - uint64_t value) -{ - /* - * Invalidate by VA range, Inner/Outer Shareable, EL2. - * Currently handles all of RVAE2IS, RVAE2OS, RVALE2IS and RVALE2OS, - * since we don't support flush-for-specific-ASID-only, - * flush-last-level-only or inner/outer shareable specific flushes. - */ - - do_rvae_write(env, value, vae2_tlbmask(env), true); - -} - -static void tlbi_aa64_rvae3_write(CPUARMState *env, - const ARMCPRegInfo *ri, - uint64_t value) -{ - /* - * Invalidate by VA range, EL3. - * Currently handles all of RVAE3 and RVALE3, - * since we don't support flush-for-specific-ASID-only or - * flush-last-level-only. - */ - - do_rvae_write(env, value, ARMMMUIdxBit_E3, tlb_force_broadcast(env)); -} - -static void tlbi_aa64_rvae3is_write(CPUARMState *env, - const ARMCPRegInfo *ri, - uint64_t value) -{ - /* - * Invalidate by VA range, EL3, Inner/Outer Shareable. - * Currently handles all of RVAE3IS, RVAE3OS, RVALE3IS and RVALE3OS, - * since we don't support flush-for-specific-ASID-only, - * flush-last-level-only or inner/outer specific flushes. - */ - - do_rvae_write(env, value, ARMMMUIdxBit_E3, true); -} - -static void tlbi_aa64_ripas2e1_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value) -{ - do_rvae_write(env, value, ipas2e1_tlbmask(env, value), - tlb_force_broadcast(env)); -} - -static void tlbi_aa64_ripas2e1is_write(CPUARMState *env, - const ARMCPRegInfo *ri, - uint64_t value) -{ - do_rvae_write(env, value, ipas2e1_tlbmask(env, value), true); -} -#endif - static CPAccessResult aa64_zva_access(CPUARMState *env, const ARMCPRegInfo *ri, bool isread) { @@ -7312,133 +7116,6 @@ static const ARMCPRegInfo pauth_reginfo[] = { .fieldoffset = offsetof(CPUARMState, keys.apib.hi) }, }; -static const ARMCPRegInfo tlbirange_reginfo[] = { - { .name = "TLBI_RVAE1IS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 2, .opc2 = 1, - .access = PL1_W, .accessfn = access_ttlbis, .type = ARM_CP_NO_RAW, - .fgt = FGT_TLBIRVAE1IS, - .writefn = tlbi_aa64_rvae1is_write }, - { .name = "TLBI_RVAAE1IS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 2, .opc2 = 3, - .access = PL1_W, .accessfn = access_ttlbis, .type = ARM_CP_NO_RAW, - .fgt = FGT_TLBIRVAAE1IS, - .writefn = tlbi_aa64_rvae1is_write }, - { .name = "TLBI_RVALE1IS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 2, .opc2 = 5, - .access = PL1_W, .accessfn = access_ttlbis, .type = ARM_CP_NO_RAW, - .fgt = FGT_TLBIRVALE1IS, - .writefn = tlbi_aa64_rvae1is_write }, - { .name = "TLBI_RVAALE1IS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 2, .opc2 = 7, - .access = PL1_W, .accessfn = access_ttlbis, .type = ARM_CP_NO_RAW, - .fgt = FGT_TLBIRVAALE1IS, - .writefn = tlbi_aa64_rvae1is_write }, - { .name = "TLBI_RVAE1OS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 5, .opc2 = 1, - .access = PL1_W, .accessfn = access_ttlbos, .type = ARM_CP_NO_RAW, - .fgt = FGT_TLBIRVAE1OS, - .writefn = tlbi_aa64_rvae1is_write }, - { .name = "TLBI_RVAAE1OS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 5, .opc2 = 3, - .access = PL1_W, .accessfn = access_ttlbos, .type = ARM_CP_NO_RAW, - .fgt = FGT_TLBIRVAAE1OS, - .writefn = tlbi_aa64_rvae1is_write }, - { .name = "TLBI_RVALE1OS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 5, .opc2 = 5, - .access = PL1_W, .accessfn = access_ttlbos, .type = ARM_CP_NO_RAW, - .fgt = FGT_TLBIRVALE1OS, - .writefn = tlbi_aa64_rvae1is_write }, - { .name = "TLBI_RVAALE1OS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 5, .opc2 = 7, - .access = PL1_W, .accessfn = access_ttlbos, .type = ARM_CP_NO_RAW, - .fgt = FGT_TLBIRVAALE1OS, - .writefn = tlbi_aa64_rvae1is_write }, - { .name = "TLBI_RVAE1", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 6, .opc2 = 1, - .access = PL1_W, .accessfn = access_ttlb, .type = ARM_CP_NO_RAW, - .fgt = FGT_TLBIRVAE1, - .writefn = tlbi_aa64_rvae1_write }, - { .name = "TLBI_RVAAE1", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 6, .opc2 = 3, - .access = PL1_W, .accessfn = access_ttlb, .type = ARM_CP_NO_RAW, - .fgt = FGT_TLBIRVAAE1, - .writefn = tlbi_aa64_rvae1_write }, - { .name = "TLBI_RVALE1", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 6, .opc2 = 5, - .access = PL1_W, .accessfn = access_ttlb, .type = ARM_CP_NO_RAW, - .fgt = FGT_TLBIRVALE1, - .writefn = tlbi_aa64_rvae1_write }, - { .name = "TLBI_RVAALE1", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 6, .opc2 = 7, - .access = PL1_W, .accessfn = access_ttlb, .type = ARM_CP_NO_RAW, - .fgt = FGT_TLBIRVAALE1, - .writefn = tlbi_aa64_rvae1_write }, - { .name = "TLBI_RIPAS2E1IS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 0, .opc2 = 2, - .access = PL2_W, .type = ARM_CP_NO_RAW, - .writefn = tlbi_aa64_ripas2e1is_write }, - { .name = "TLBI_RIPAS2LE1IS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 0, .opc2 = 6, - .access = PL2_W, .type = ARM_CP_NO_RAW, - .writefn = tlbi_aa64_ripas2e1is_write }, - { .name = "TLBI_RVAE2IS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 2, .opc2 = 1, - .access = PL2_W, .type = ARM_CP_NO_RAW | ARM_CP_EL3_NO_EL2_UNDEF, - .writefn = tlbi_aa64_rvae2is_write }, - { .name = "TLBI_RVALE2IS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 2, .opc2 = 5, - .access = PL2_W, .type = ARM_CP_NO_RAW | ARM_CP_EL3_NO_EL2_UNDEF, - .writefn = tlbi_aa64_rvae2is_write }, - { .name = "TLBI_RIPAS2E1", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 4, .opc2 = 2, - .access = PL2_W, .type = ARM_CP_NO_RAW, - .writefn = tlbi_aa64_ripas2e1_write }, - { .name = "TLBI_RIPAS2LE1", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 4, .opc2 = 6, - .access = PL2_W, .type = ARM_CP_NO_RAW, - .writefn = tlbi_aa64_ripas2e1_write }, - { .name = "TLBI_RVAE2OS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 5, .opc2 = 1, - .access = PL2_W, .type = ARM_CP_NO_RAW | ARM_CP_EL3_NO_EL2_UNDEF, - .writefn = tlbi_aa64_rvae2is_write }, - { .name = "TLBI_RVALE2OS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 5, .opc2 = 5, - .access = PL2_W, .type = ARM_CP_NO_RAW | ARM_CP_EL3_NO_EL2_UNDEF, - .writefn = tlbi_aa64_rvae2is_write }, - { .name = "TLBI_RVAE2", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 6, .opc2 = 1, - .access = PL2_W, .type = ARM_CP_NO_RAW | ARM_CP_EL3_NO_EL2_UNDEF, - .writefn = tlbi_aa64_rvae2_write }, - { .name = "TLBI_RVALE2", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 6, .opc2 = 5, - .access = PL2_W, .type = ARM_CP_NO_RAW | ARM_CP_EL3_NO_EL2_UNDEF, - .writefn = tlbi_aa64_rvae2_write }, - { .name = "TLBI_RVAE3IS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 6, .crn = 8, .crm = 2, .opc2 = 1, - .access = PL3_W, .type = ARM_CP_NO_RAW, - .writefn = tlbi_aa64_rvae3is_write }, - { .name = "TLBI_RVALE3IS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 6, .crn = 8, .crm = 2, .opc2 = 5, - .access = PL3_W, .type = ARM_CP_NO_RAW, - .writefn = tlbi_aa64_rvae3is_write }, - { .name = "TLBI_RVAE3OS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 6, .crn = 8, .crm = 5, .opc2 = 1, - .access = PL3_W, .type = ARM_CP_NO_RAW, - .writefn = tlbi_aa64_rvae3is_write }, - { .name = "TLBI_RVALE3OS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 6, .crn = 8, .crm = 5, .opc2 = 5, - .access = PL3_W, .type = ARM_CP_NO_RAW, - .writefn = tlbi_aa64_rvae3is_write }, - { .name = "TLBI_RVAE3", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 6, .crn = 8, .crm = 6, .opc2 = 1, - .access = PL3_W, .type = ARM_CP_NO_RAW, - .writefn = tlbi_aa64_rvae3_write }, - { .name = "TLBI_RVALE3", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 6, .crn = 8, .crm = 6, .opc2 = 5, - .access = PL3_W, .type = ARM_CP_NO_RAW, - .writefn = tlbi_aa64_rvae3_write }, -}; - static const ARMCPRegInfo tlbios_reginfo[] = { { .name = "TLBI_VMALLE1OS", .state = ARM_CP_STATE_AA64, .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 1, .opc2 = 0, @@ -9389,9 +9066,6 @@ void register_cp_regs_for_features(ARMCPU *cpu) if (cpu_isar_feature(aa64_rndr, cpu)) { define_arm_cp_regs(cpu, rndr_reginfo); } - if (cpu_isar_feature(aa64_tlbirange, cpu)) { - define_arm_cp_regs(cpu, tlbirange_reginfo); - } if (cpu_isar_feature(aa64_tlbios, cpu)) { define_arm_cp_regs(cpu, tlbios_reginfo); } diff --git a/target/arm/tcg/tlb-insns.c b/target/arm/tcg/tlb-insns.c index 528265404de..a273c6f4b58 100644 --- a/target/arm/tcg/tlb-insns.c +++ b/target/arm/tcg/tlb-insns.c @@ -6,6 +6,7 @@ * SPDX-License-Identifier: GPL-2.0-or-later */ #include "qemu/osdep.h" +#include "qemu/log.h" #include "exec/exec-all.h" #include "cpu.h" #include "internals.h" @@ -562,6 +563,329 @@ static const ARMCPRegInfo tlbi_el3_cp_reginfo[] = { .writefn = tlbi_aa64_vae3_write }, }; +#ifdef TARGET_AARCH64 +typedef struct { + uint64_t base; + uint64_t length; +} TLBIRange; + +static ARMGranuleSize tlbi_range_tg_to_gran_size(int tg) +{ + /* + * Note that the TLBI range TG field encoding differs from both + * TG0 and TG1 encodings. + */ + switch (tg) { + case 1: + return Gran4K; + case 2: + return Gran16K; + case 3: + return Gran64K; + default: + return GranInvalid; + } +} + +static TLBIRange tlbi_aa64_get_range(CPUARMState *env, ARMMMUIdx mmuidx, + uint64_t value) +{ + unsigned int page_size_granule, page_shift, num, scale, exponent; + /* Extract one bit to represent the va selector in use. */ + uint64_t select = sextract64(value, 36, 1); + ARMVAParameters param = aa64_va_parameters(env, select, mmuidx, true, false); + TLBIRange ret = { }; + ARMGranuleSize gran; + + page_size_granule = extract64(value, 46, 2); + gran = tlbi_range_tg_to_gran_size(page_size_granule); + + /* The granule encoded in value must match the granule in use. */ + if (gran != param.gran) { + qemu_log_mask(LOG_GUEST_ERROR, "Invalid tlbi page size granule %d\n", + page_size_granule); + return ret; + } + + page_shift = arm_granule_bits(gran); + num = extract64(value, 39, 5); + scale = extract64(value, 44, 2); + exponent = (5 * scale) + 1; + + ret.length = (num + 1) << (exponent + page_shift); + + if (param.select) { + ret.base = sextract64(value, 0, 37); + } else { + ret.base = extract64(value, 0, 37); + } + if (param.ds) { + /* + * With DS=1, BaseADDR is always shifted 16 so that it is able + * to address all 52 va bits. The input address is perforce + * aligned on a 64k boundary regardless of translation granule. + */ + page_shift = 16; + } + ret.base <<= page_shift; + + return ret; +} + +static void do_rvae_write(CPUARMState *env, uint64_t value, + int idxmap, bool synced) +{ + ARMMMUIdx one_idx = ARM_MMU_IDX_A | ctz32(idxmap); + TLBIRange range; + int bits; + + range = tlbi_aa64_get_range(env, one_idx, value); + bits = tlbbits_for_regime(env, one_idx, range.base); + + if (synced) { + tlb_flush_range_by_mmuidx_all_cpus_synced(env_cpu(env), + range.base, + range.length, + idxmap, + bits); + } else { + tlb_flush_range_by_mmuidx(env_cpu(env), range.base, + range.length, idxmap, bits); + } +} + +static void tlbi_aa64_rvae1_write(CPUARMState *env, + const ARMCPRegInfo *ri, + uint64_t value) +{ + /* + * Invalidate by VA range, EL1&0. + * Currently handles all of RVAE1, RVAAE1, RVAALE1 and RVALE1, + * since we don't support flush-for-specific-ASID-only or + * flush-last-level-only. + */ + + do_rvae_write(env, value, vae1_tlbmask(env), + tlb_force_broadcast(env)); +} + +static void tlbi_aa64_rvae1is_write(CPUARMState *env, + const ARMCPRegInfo *ri, + uint64_t value) +{ + /* + * Invalidate by VA range, Inner/Outer Shareable EL1&0. + * Currently handles all of RVAE1IS, RVAE1OS, RVAAE1IS, RVAAE1OS, + * RVAALE1IS, RVAALE1OS, RVALE1IS and RVALE1OS, since we don't support + * flush-for-specific-ASID-only, flush-last-level-only or inner/outer + * shareable specific flushes. + */ + + do_rvae_write(env, value, vae1_tlbmask(env), true); +} + +static void tlbi_aa64_rvae2_write(CPUARMState *env, + const ARMCPRegInfo *ri, + uint64_t value) +{ + /* + * Invalidate by VA range, EL2. + * Currently handles all of RVAE2 and RVALE2, + * since we don't support flush-for-specific-ASID-only or + * flush-last-level-only. + */ + + do_rvae_write(env, value, vae2_tlbmask(env), + tlb_force_broadcast(env)); + + +} + +static void tlbi_aa64_rvae2is_write(CPUARMState *env, + const ARMCPRegInfo *ri, + uint64_t value) +{ + /* + * Invalidate by VA range, Inner/Outer Shareable, EL2. + * Currently handles all of RVAE2IS, RVAE2OS, RVALE2IS and RVALE2OS, + * since we don't support flush-for-specific-ASID-only, + * flush-last-level-only or inner/outer shareable specific flushes. + */ + + do_rvae_write(env, value, vae2_tlbmask(env), true); + +} + +static void tlbi_aa64_rvae3_write(CPUARMState *env, + const ARMCPRegInfo *ri, + uint64_t value) +{ + /* + * Invalidate by VA range, EL3. + * Currently handles all of RVAE3 and RVALE3, + * since we don't support flush-for-specific-ASID-only or + * flush-last-level-only. + */ + + do_rvae_write(env, value, ARMMMUIdxBit_E3, tlb_force_broadcast(env)); +} + +static void tlbi_aa64_rvae3is_write(CPUARMState *env, + const ARMCPRegInfo *ri, + uint64_t value) +{ + /* + * Invalidate by VA range, EL3, Inner/Outer Shareable. + * Currently handles all of RVAE3IS, RVAE3OS, RVALE3IS and RVALE3OS, + * since we don't support flush-for-specific-ASID-only, + * flush-last-level-only or inner/outer specific flushes. + */ + + do_rvae_write(env, value, ARMMMUIdxBit_E3, true); +} + +static void tlbi_aa64_ripas2e1_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) +{ + do_rvae_write(env, value, ipas2e1_tlbmask(env, value), + tlb_force_broadcast(env)); +} + +static void tlbi_aa64_ripas2e1is_write(CPUARMState *env, + const ARMCPRegInfo *ri, + uint64_t value) +{ + do_rvae_write(env, value, ipas2e1_tlbmask(env, value), true); +} + +static const ARMCPRegInfo tlbirange_reginfo[] = { + { .name = "TLBI_RVAE1IS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 2, .opc2 = 1, + .access = PL1_W, .accessfn = access_ttlbis, .type = ARM_CP_NO_RAW, + .fgt = FGT_TLBIRVAE1IS, + .writefn = tlbi_aa64_rvae1is_write }, + { .name = "TLBI_RVAAE1IS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 2, .opc2 = 3, + .access = PL1_W, .accessfn = access_ttlbis, .type = ARM_CP_NO_RAW, + .fgt = FGT_TLBIRVAAE1IS, + .writefn = tlbi_aa64_rvae1is_write }, + { .name = "TLBI_RVALE1IS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 2, .opc2 = 5, + .access = PL1_W, .accessfn = access_ttlbis, .type = ARM_CP_NO_RAW, + .fgt = FGT_TLBIRVALE1IS, + .writefn = tlbi_aa64_rvae1is_write }, + { .name = "TLBI_RVAALE1IS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 2, .opc2 = 7, + .access = PL1_W, .accessfn = access_ttlbis, .type = ARM_CP_NO_RAW, + .fgt = FGT_TLBIRVAALE1IS, + .writefn = tlbi_aa64_rvae1is_write }, + { .name = "TLBI_RVAE1OS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 5, .opc2 = 1, + .access = PL1_W, .accessfn = access_ttlbos, .type = ARM_CP_NO_RAW, + .fgt = FGT_TLBIRVAE1OS, + .writefn = tlbi_aa64_rvae1is_write }, + { .name = "TLBI_RVAAE1OS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 5, .opc2 = 3, + .access = PL1_W, .accessfn = access_ttlbos, .type = ARM_CP_NO_RAW, + .fgt = FGT_TLBIRVAAE1OS, + .writefn = tlbi_aa64_rvae1is_write }, + { .name = "TLBI_RVALE1OS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 5, .opc2 = 5, + .access = PL1_W, .accessfn = access_ttlbos, .type = ARM_CP_NO_RAW, + .fgt = FGT_TLBIRVALE1OS, + .writefn = tlbi_aa64_rvae1is_write }, + { .name = "TLBI_RVAALE1OS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 5, .opc2 = 7, + .access = PL1_W, .accessfn = access_ttlbos, .type = ARM_CP_NO_RAW, + .fgt = FGT_TLBIRVAALE1OS, + .writefn = tlbi_aa64_rvae1is_write }, + { .name = "TLBI_RVAE1", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 6, .opc2 = 1, + .access = PL1_W, .accessfn = access_ttlb, .type = ARM_CP_NO_RAW, + .fgt = FGT_TLBIRVAE1, + .writefn = tlbi_aa64_rvae1_write }, + { .name = "TLBI_RVAAE1", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 6, .opc2 = 3, + .access = PL1_W, .accessfn = access_ttlb, .type = ARM_CP_NO_RAW, + .fgt = FGT_TLBIRVAAE1, + .writefn = tlbi_aa64_rvae1_write }, + { .name = "TLBI_RVALE1", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 6, .opc2 = 5, + .access = PL1_W, .accessfn = access_ttlb, .type = ARM_CP_NO_RAW, + .fgt = FGT_TLBIRVALE1, + .writefn = tlbi_aa64_rvae1_write }, + { .name = "TLBI_RVAALE1", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 6, .opc2 = 7, + .access = PL1_W, .accessfn = access_ttlb, .type = ARM_CP_NO_RAW, + .fgt = FGT_TLBIRVAALE1, + .writefn = tlbi_aa64_rvae1_write }, + { .name = "TLBI_RIPAS2E1IS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 0, .opc2 = 2, + .access = PL2_W, .type = ARM_CP_NO_RAW, + .writefn = tlbi_aa64_ripas2e1is_write }, + { .name = "TLBI_RIPAS2LE1IS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 0, .opc2 = 6, + .access = PL2_W, .type = ARM_CP_NO_RAW, + .writefn = tlbi_aa64_ripas2e1is_write }, + { .name = "TLBI_RVAE2IS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 2, .opc2 = 1, + .access = PL2_W, .type = ARM_CP_NO_RAW | ARM_CP_EL3_NO_EL2_UNDEF, + .writefn = tlbi_aa64_rvae2is_write }, + { .name = "TLBI_RVALE2IS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 2, .opc2 = 5, + .access = PL2_W, .type = ARM_CP_NO_RAW | ARM_CP_EL3_NO_EL2_UNDEF, + .writefn = tlbi_aa64_rvae2is_write }, + { .name = "TLBI_RIPAS2E1", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 4, .opc2 = 2, + .access = PL2_W, .type = ARM_CP_NO_RAW, + .writefn = tlbi_aa64_ripas2e1_write }, + { .name = "TLBI_RIPAS2LE1", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 4, .opc2 = 6, + .access = PL2_W, .type = ARM_CP_NO_RAW, + .writefn = tlbi_aa64_ripas2e1_write }, + { .name = "TLBI_RVAE2OS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 5, .opc2 = 1, + .access = PL2_W, .type = ARM_CP_NO_RAW | ARM_CP_EL3_NO_EL2_UNDEF, + .writefn = tlbi_aa64_rvae2is_write }, + { .name = "TLBI_RVALE2OS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 5, .opc2 = 5, + .access = PL2_W, .type = ARM_CP_NO_RAW | ARM_CP_EL3_NO_EL2_UNDEF, + .writefn = tlbi_aa64_rvae2is_write }, + { .name = "TLBI_RVAE2", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 6, .opc2 = 1, + .access = PL2_W, .type = ARM_CP_NO_RAW | ARM_CP_EL3_NO_EL2_UNDEF, + .writefn = tlbi_aa64_rvae2_write }, + { .name = "TLBI_RVALE2", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 6, .opc2 = 5, + .access = PL2_W, .type = ARM_CP_NO_RAW | ARM_CP_EL3_NO_EL2_UNDEF, + .writefn = tlbi_aa64_rvae2_write }, + { .name = "TLBI_RVAE3IS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 6, .crn = 8, .crm = 2, .opc2 = 1, + .access = PL3_W, .type = ARM_CP_NO_RAW, + .writefn = tlbi_aa64_rvae3is_write }, + { .name = "TLBI_RVALE3IS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 6, .crn = 8, .crm = 2, .opc2 = 5, + .access = PL3_W, .type = ARM_CP_NO_RAW, + .writefn = tlbi_aa64_rvae3is_write }, + { .name = "TLBI_RVAE3OS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 6, .crn = 8, .crm = 5, .opc2 = 1, + .access = PL3_W, .type = ARM_CP_NO_RAW, + .writefn = tlbi_aa64_rvae3is_write }, + { .name = "TLBI_RVALE3OS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 6, .crn = 8, .crm = 5, .opc2 = 5, + .access = PL3_W, .type = ARM_CP_NO_RAW, + .writefn = tlbi_aa64_rvae3is_write }, + { .name = "TLBI_RVAE3", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 6, .crn = 8, .crm = 6, .opc2 = 1, + .access = PL3_W, .type = ARM_CP_NO_RAW, + .writefn = tlbi_aa64_rvae3_write }, + { .name = "TLBI_RVALE3", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 6, .crn = 8, .crm = 6, .opc2 = 5, + .access = PL3_W, .type = ARM_CP_NO_RAW, + .writefn = tlbi_aa64_rvae3_write }, +}; +#endif + void define_tlb_insn_regs(ARMCPU *cpu) { CPUARMState *env = &cpu->env; @@ -591,4 +915,9 @@ void define_tlb_insn_regs(ARMCPU *cpu) if (arm_feature(env, ARM_FEATURE_EL3)) { define_arm_cp_regs(cpu, tlbi_el3_cp_reginfo); } +#ifdef TARGET_AARCH64 + if (cpu_isar_feature(aa64_tlbirange, cpu)) { + define_arm_cp_regs(cpu, tlbirange_reginfo); + } +#endif } From patchwork Fri Dec 13 17:32:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850176 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1640533wry; Fri, 13 Dec 2024 09:39:11 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWVoIqValgsXJcKlImAJLBnpzImJtSk5c94WB/DsKiAouy4Klhws75Dr+PiGfhJLVytn2OO9Q==@linaro.org X-Google-Smtp-Source: AGHT+IG0VdPDXXy741qgR4PR+TX7puUOs/QEollChofnFWmFgvBmu140pfS2AaLFTV53O+lGlsdm X-Received: by 2002:a05:6402:35c3:b0:5d2:7396:b0ed with SMTP id 4fb4d7f45d1cf-5d63c31e814mr8240858a12.14.1734111551706; Fri, 13 Dec 2024 09:39:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111551; cv=none; d=google.com; s=arc-20240605; b=Pa5M9aMknUd7ySO34tmOwh9QjdKxuifjHFw8PRk0EY3QsXNmroAovM2KJ+GcTYCU5r tq3AhnUW/nEK+kGjh0aQhjzTGPKQyKphdW9VhBbCQwDTaUniR64MvQ4wr+5Pap+IhMwJ vjxk47tkZ7/8VkQNCk3Ajy8ivuJrdoU4jiLWeRn6+B/QREwlRDvsK4rYAhB2xh+UX/CG x3DNBXb+KEHJrd4c2BFBDdV9Zxs3tLTTk5hJ9Y6d9E9W0/RJoVcuQM1liKRatkNosPW+ vuD9kb2fQe4byCbvc89OMVZn6mNjE9TSnHuWZsZiMYyAW4ZvXC2VvsdYu4VLQniR+yhT dBKA== 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=HbH6mKs94rPic6KcGRGG3fOmwu2HnUwrKyb75JHn04c=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=OmHxjkJOIfRWxKJLSEkS/dpBaUR8DFsCmzet6Wi+QqGTlf+Np2vjGMoOt0GxygcGl/ 1Iw9N0X9p2hWzXgoVEp5Wm3FDh/V9HyNFH2GUaTO58G24zoXBLwtAaKkhiBeFe7FPGPZ rt7WfY6QWMGuocGPYfr99eLuKoKWGlwAA+k+1EsKMwZJLWqfNJSD9blqO9fp4INiHmEv DNEbhldc0iMtGBqGpvrToYIq/focTAZDnoWIIkJXdsSpB47g1tVAsTJ2v+LttwuOFW7b DC15kocNt3UDgIETLkPzH/gmw/Cp6QdAAYFcrdzALxnnIxf34PfbR5LiPcbZjo/3+yfr NJcA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SQIjs+L6; 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 4fb4d7f45d1cf-5d652addde8si55683a12.80.2024.12.13.09.39.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:39:11 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SQIjs+L6; 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 1tM9aO-0000XL-4r; Fri, 13 Dec 2024 12:36: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 1tM9YB-0000RU-Hu for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:34:06 -0500 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9Y8-0001n5-9W for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:34:03 -0500 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-385e2880606so1928465f8f.3 for ; Fri, 13 Dec 2024 09:33:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111239; x=1734716039; 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=HbH6mKs94rPic6KcGRGG3fOmwu2HnUwrKyb75JHn04c=; b=SQIjs+L6YGrJHgAU1OQSx92ysQmyuSVUQ/Opwk6gylrFM5nQqrHTJtRTUGj/jsRWMR X3HgHrNloKaK76Tix/cgKxgCa6tdCJZL8RInjVVimSnJeIdQclzNdshoEW6xPvdrqjDD pKzd0iUNGYJhKe3tnhxW7aHN5d7VjcQsvJO4n+wFBEqDwWH0qqo/kAa0pqsyJZdWw0SD SnInlPxqx+IISuLHxFhtcHEL25qe6jgmvZOygsurtvGl55IfYHd3dxQurmA+z/98KYN0 b3qnfyvUTYeg2bT31/7uzCF+E8OFu4DB/5yc/c1M20dWMIR3jVcYJcoXKBsvmvfEdel1 3trA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111239; x=1734716039; 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=HbH6mKs94rPic6KcGRGG3fOmwu2HnUwrKyb75JHn04c=; b=AuJN6wM5d5Xoi0Mx/J3aybhdTmnJcHhPdNLiFJgk8Y+YV517tn09Q7rfF5FkMDjwV1 feEqdrTXHSQjgrxoKeednZSjmsITZpVJSuTEyVactj8aHuO4JrTckkmgTjZu9tX2ewrp tb6Y5g2ImG+QVyl0xYiX7sODLnsZVmsAfnJO1U2lSG6WB7fwbZv25VIiX8xLHmjXyLfV FyHGaa/vR/Ex87ChsiuRiKvLGxiaD5mi342V+/CjBT6ymwEVNohXkuEYFpN/k51eetH8 0/XNfEefCuoZRBHHQo2Ha4u0219hp2MUrq3BchVfIRnNjNLtZ9nlqj8PBuNL0qdvy6+x SGCw== X-Gm-Message-State: AOJu0YxiIE+GehLTd0XKbQLF9kTdIbhhoTepVd9sxJf/Xln3cp0tTv16 2gMGp0aA9LewvYmrbjksFzHckD0rGGLDrjRCRiQgXLv70QCLS2Aky4ybChuDVLQDYIwQjQYiefH J X-Gm-Gg: ASbGncvLVk48troUav6PP8B6wI2A6D9F3ut28RbF8d3MzB4BZNuocoXP0wwC7uALCxf TDZ7elwrW8oqpIQpZGswg88rqcnXBQNX3b5YqKeM0BBYQhYMJ+m0XMCGMVDB1Aukyt04E/nHbIo nyY81ydK09G/71tVQHxbBcezknNCS4A3HgWaNF2ALJtsfGXWfByvV3svuOOkeO6cyAgcbETgoLq KTnEfGepYd3dpLD7kLqCrFfrExckdcxV+wH36NZPubH7MnmUfk5lGHUa5v5Ug== X-Received: by 2002:a5d:588b:0:b0:385:f062:c2d4 with SMTP id ffacd0b85a97d-3888e0b87d6mr3065477f8f.37.1734111238730; Fri, 13 Dec 2024 09:33:58 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:58 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 82/85] target/arm: Move the TLBI OS insns to tlb-insns.c. Date: Fri, 13 Dec 2024 17:32:26 +0000 Message-Id: <20241213173229.3308926-83-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42a.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 Move the TLBI OS insns across to tlb-insns.c. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20241210160452.2427965-8-peter.maydell@linaro.org --- target/arm/helper.c | 80 -------------------------------------- target/arm/tcg/tlb-insns.c | 80 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+), 80 deletions(-) diff --git a/target/arm/helper.c b/target/arm/helper.c index 376aa9aecd5..3f7d56e809f 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -7116,83 +7116,6 @@ static const ARMCPRegInfo pauth_reginfo[] = { .fieldoffset = offsetof(CPUARMState, keys.apib.hi) }, }; -static const ARMCPRegInfo tlbios_reginfo[] = { - { .name = "TLBI_VMALLE1OS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 1, .opc2 = 0, - .access = PL1_W, .accessfn = access_ttlbos, .type = ARM_CP_NO_RAW, - .fgt = FGT_TLBIVMALLE1OS, - .writefn = tlbi_aa64_vmalle1is_write }, - { .name = "TLBI_VAE1OS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 1, .opc2 = 1, - .fgt = FGT_TLBIVAE1OS, - .access = PL1_W, .accessfn = access_ttlbos, .type = ARM_CP_NO_RAW, - .writefn = tlbi_aa64_vae1is_write }, - { .name = "TLBI_ASIDE1OS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 1, .opc2 = 2, - .access = PL1_W, .accessfn = access_ttlbos, .type = ARM_CP_NO_RAW, - .fgt = FGT_TLBIASIDE1OS, - .writefn = tlbi_aa64_vmalle1is_write }, - { .name = "TLBI_VAAE1OS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 1, .opc2 = 3, - .access = PL1_W, .accessfn = access_ttlbos, .type = ARM_CP_NO_RAW, - .fgt = FGT_TLBIVAAE1OS, - .writefn = tlbi_aa64_vae1is_write }, - { .name = "TLBI_VALE1OS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 1, .opc2 = 5, - .access = PL1_W, .accessfn = access_ttlbos, .type = ARM_CP_NO_RAW, - .fgt = FGT_TLBIVALE1OS, - .writefn = tlbi_aa64_vae1is_write }, - { .name = "TLBI_VAALE1OS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 1, .opc2 = 7, - .access = PL1_W, .accessfn = access_ttlbos, .type = ARM_CP_NO_RAW, - .fgt = FGT_TLBIVAALE1OS, - .writefn = tlbi_aa64_vae1is_write }, - { .name = "TLBI_ALLE2OS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 1, .opc2 = 0, - .access = PL2_W, .type = ARM_CP_NO_RAW | ARM_CP_EL3_NO_EL2_UNDEF, - .writefn = tlbi_aa64_alle2is_write }, - { .name = "TLBI_VAE2OS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 1, .opc2 = 1, - .access = PL2_W, .type = ARM_CP_NO_RAW | ARM_CP_EL3_NO_EL2_UNDEF, - .writefn = tlbi_aa64_vae2is_write }, - { .name = "TLBI_ALLE1OS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 1, .opc2 = 4, - .access = PL2_W, .type = ARM_CP_NO_RAW, - .writefn = tlbi_aa64_alle1is_write }, - { .name = "TLBI_VALE2OS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 1, .opc2 = 5, - .access = PL2_W, .type = ARM_CP_NO_RAW | ARM_CP_EL3_NO_EL2_UNDEF, - .writefn = tlbi_aa64_vae2is_write }, - { .name = "TLBI_VMALLS12E1OS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 1, .opc2 = 6, - .access = PL2_W, .type = ARM_CP_NO_RAW, - .writefn = tlbi_aa64_alle1is_write }, - { .name = "TLBI_IPAS2E1OS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 4, .opc2 = 0, - .access = PL2_W, .type = ARM_CP_NOP }, - { .name = "TLBI_RIPAS2E1OS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 4, .opc2 = 3, - .access = PL2_W, .type = ARM_CP_NOP }, - { .name = "TLBI_IPAS2LE1OS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 4, .opc2 = 4, - .access = PL2_W, .type = ARM_CP_NOP }, - { .name = "TLBI_RIPAS2LE1OS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 4, .opc2 = 7, - .access = PL2_W, .type = ARM_CP_NOP }, - { .name = "TLBI_ALLE3OS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 6, .crn = 8, .crm = 1, .opc2 = 0, - .access = PL3_W, .type = ARM_CP_NO_RAW, - .writefn = tlbi_aa64_alle3is_write }, - { .name = "TLBI_VAE3OS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 6, .crn = 8, .crm = 1, .opc2 = 1, - .access = PL3_W, .type = ARM_CP_NO_RAW, - .writefn = tlbi_aa64_vae3is_write }, - { .name = "TLBI_VALE3OS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 6, .crn = 8, .crm = 1, .opc2 = 5, - .access = PL3_W, .type = ARM_CP_NO_RAW, - .writefn = tlbi_aa64_vae3is_write }, -}; - static uint64_t rndr_readfn(CPUARMState *env, const ARMCPRegInfo *ri) { Error *err = NULL; @@ -9066,9 +8989,6 @@ void register_cp_regs_for_features(ARMCPU *cpu) if (cpu_isar_feature(aa64_rndr, cpu)) { define_arm_cp_regs(cpu, rndr_reginfo); } - if (cpu_isar_feature(aa64_tlbios, cpu)) { - define_arm_cp_regs(cpu, tlbios_reginfo); - } /* Data Cache clean instructions up to PoP */ if (cpu_isar_feature(aa64_dcpop, cpu)) { define_one_arm_cp_reg(cpu, dcpop_reg); diff --git a/target/arm/tcg/tlb-insns.c b/target/arm/tcg/tlb-insns.c index a273c6f4b58..45ebfc512f9 100644 --- a/target/arm/tcg/tlb-insns.c +++ b/target/arm/tcg/tlb-insns.c @@ -884,6 +884,83 @@ static const ARMCPRegInfo tlbirange_reginfo[] = { .access = PL3_W, .type = ARM_CP_NO_RAW, .writefn = tlbi_aa64_rvae3_write }, }; + +static const ARMCPRegInfo tlbios_reginfo[] = { + { .name = "TLBI_VMALLE1OS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 1, .opc2 = 0, + .access = PL1_W, .accessfn = access_ttlbos, .type = ARM_CP_NO_RAW, + .fgt = FGT_TLBIVMALLE1OS, + .writefn = tlbi_aa64_vmalle1is_write }, + { .name = "TLBI_VAE1OS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 1, .opc2 = 1, + .fgt = FGT_TLBIVAE1OS, + .access = PL1_W, .accessfn = access_ttlbos, .type = ARM_CP_NO_RAW, + .writefn = tlbi_aa64_vae1is_write }, + { .name = "TLBI_ASIDE1OS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 1, .opc2 = 2, + .access = PL1_W, .accessfn = access_ttlbos, .type = ARM_CP_NO_RAW, + .fgt = FGT_TLBIASIDE1OS, + .writefn = tlbi_aa64_vmalle1is_write }, + { .name = "TLBI_VAAE1OS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 1, .opc2 = 3, + .access = PL1_W, .accessfn = access_ttlbos, .type = ARM_CP_NO_RAW, + .fgt = FGT_TLBIVAAE1OS, + .writefn = tlbi_aa64_vae1is_write }, + { .name = "TLBI_VALE1OS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 1, .opc2 = 5, + .access = PL1_W, .accessfn = access_ttlbos, .type = ARM_CP_NO_RAW, + .fgt = FGT_TLBIVALE1OS, + .writefn = tlbi_aa64_vae1is_write }, + { .name = "TLBI_VAALE1OS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 0, .crn = 8, .crm = 1, .opc2 = 7, + .access = PL1_W, .accessfn = access_ttlbos, .type = ARM_CP_NO_RAW, + .fgt = FGT_TLBIVAALE1OS, + .writefn = tlbi_aa64_vae1is_write }, + { .name = "TLBI_ALLE2OS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 1, .opc2 = 0, + .access = PL2_W, .type = ARM_CP_NO_RAW | ARM_CP_EL3_NO_EL2_UNDEF, + .writefn = tlbi_aa64_alle2is_write }, + { .name = "TLBI_VAE2OS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 1, .opc2 = 1, + .access = PL2_W, .type = ARM_CP_NO_RAW | ARM_CP_EL3_NO_EL2_UNDEF, + .writefn = tlbi_aa64_vae2is_write }, + { .name = "TLBI_ALLE1OS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 1, .opc2 = 4, + .access = PL2_W, .type = ARM_CP_NO_RAW, + .writefn = tlbi_aa64_alle1is_write }, + { .name = "TLBI_VALE2OS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 1, .opc2 = 5, + .access = PL2_W, .type = ARM_CP_NO_RAW | ARM_CP_EL3_NO_EL2_UNDEF, + .writefn = tlbi_aa64_vae2is_write }, + { .name = "TLBI_VMALLS12E1OS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 1, .opc2 = 6, + .access = PL2_W, .type = ARM_CP_NO_RAW, + .writefn = tlbi_aa64_alle1is_write }, + { .name = "TLBI_IPAS2E1OS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 4, .opc2 = 0, + .access = PL2_W, .type = ARM_CP_NOP }, + { .name = "TLBI_RIPAS2E1OS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 4, .opc2 = 3, + .access = PL2_W, .type = ARM_CP_NOP }, + { .name = "TLBI_IPAS2LE1OS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 4, .opc2 = 4, + .access = PL2_W, .type = ARM_CP_NOP }, + { .name = "TLBI_RIPAS2LE1OS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 4, .crn = 8, .crm = 4, .opc2 = 7, + .access = PL2_W, .type = ARM_CP_NOP }, + { .name = "TLBI_ALLE3OS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 6, .crn = 8, .crm = 1, .opc2 = 0, + .access = PL3_W, .type = ARM_CP_NO_RAW, + .writefn = tlbi_aa64_alle3is_write }, + { .name = "TLBI_VAE3OS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 6, .crn = 8, .crm = 1, .opc2 = 1, + .access = PL3_W, .type = ARM_CP_NO_RAW, + .writefn = tlbi_aa64_vae3is_write }, + { .name = "TLBI_VALE3OS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 6, .crn = 8, .crm = 1, .opc2 = 5, + .access = PL3_W, .type = ARM_CP_NO_RAW, + .writefn = tlbi_aa64_vae3is_write }, +}; #endif void define_tlb_insn_regs(ARMCPU *cpu) @@ -919,5 +996,8 @@ void define_tlb_insn_regs(ARMCPU *cpu) if (cpu_isar_feature(aa64_tlbirange, cpu)) { define_arm_cp_regs(cpu, tlbirange_reginfo); } + if (cpu_isar_feature(aa64_tlbios, cpu)) { + define_arm_cp_regs(cpu, tlbios_reginfo); + } #endif } From patchwork Fri Dec 13 17:32:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850215 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1643805wry; Fri, 13 Dec 2024 09:46:31 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVg+3OzbiuKlIJNF6Twf3ca1LVNz+ud7kOMDyCPD/mum7nJUTVlny6XbnLX8PbQfZUPbnxkpg==@linaro.org X-Google-Smtp-Source: AGHT+IEIBzs/okJOVpmu0+k/TUuDopMhAN78xvmz3cDoX7HpzzmLwayVIdzAPLz0AXmSkpUo5+vH X-Received: by 2002:a17:907:3eaa:b0:aa6:abe7:ff49 with SMTP id a640c23a62f3a-aab7b7607camr301722366b.16.1734111991555; Fri, 13 Dec 2024 09:46:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111991; cv=none; d=google.com; s=arc-20240605; b=Mff2FWTlQDyUYKILoeipLKCP+ZGlN9z4IHsOvoAzqXzYkpPPHXDreshhOy307T6A8u nY3r4Ug7ZeUZBsm+68Q8cPpBXrUlnm+jLC0nBPuD+CcYcolA/DvW0xeflZufOjU5Nx8C aXUkNosWt5bAh4pDnt2g1vB5u8QdAeb4xzc/IdF53JyV0zg6/H6i2/ucOZfhTQ1z1AMf slxFrCvWI7xBjWLWh2ONw6D87kNHh2FGc9nBH9tAeadN9Nd6BEekmvO3Ad8Kn4B3cITo m+96mlK4nRPuGckf/pyLCrmKkR3I56yWXuNo5skHjM2LqWn+6BVG4AjaeRSJrAGyTCRz RLpQ== 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=Y+wOBXQ4nR4PSgQu/QW17WIQZdSFhMR8jDryGS5FwMg=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=hS2i5t7+ZElkxBrh5lDP+xKGJfQsy9hQqI961F+V6UHe48Li4vgR3OHeRzvTu0qiYl hFuFtVLnRmQcvqEvpuof7a0Ue2S1tyFbfDDHlDDyE2+OYLwtVKQm0tTCYnpGbATPxmhl I6mfzVmwlrgdFgjhKP4iJoHjW2wzb1/Uxlkb/U4Z3Z0FQqntZYWfYomNBg1Xe2Bw22/R feKH0QgJU7r5Ie8X4z36B4uZig7rVcJ3st5Fy3gLRMktPDikGsyBNDJIPU+ke2q87XKQ 1wGnoYzPFOhe61ktbAHbfdtqVQnU9E43GBCanTKTGE3ux6ZJ7X2mUKauXENQBWAjYylX b+Aw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rT53OYUp; 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 a640c23a62f3a-aa66cbeb1f7si966043866b.26.2024.12.13.09.46.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:46:31 -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=rT53OYUp; 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 1tM9aX-0001As-9v; Fri, 13 Dec 2024 12:36:29 -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 1tM9YG-0000vi-M9 for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:34:08 -0500 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9YA-0001nD-En for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:34:08 -0500 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-3862d16b4f5so1352288f8f.0 for ; Fri, 13 Dec 2024 09:34:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111240; x=1734716040; 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=Y+wOBXQ4nR4PSgQu/QW17WIQZdSFhMR8jDryGS5FwMg=; b=rT53OYUpZdYsqWrRuyJPm1qgaFncWevaxpAqi1494FH+oRTEaHhmeaJ8EUfPKqgxNQ /mQSgdsmRiUf0Y76/pw5dvR3WYWVJr+qU0EILTIQPoYuX5UJmgtOvABRCMAdGTVPjf4P ykYkvn0Q6EZPSPIiXuS04Ot4/BRh/xNCpRMMzJzQJUOmk3AUAzqUlrFeSUhPW1p78WJk TGaTqLpXfQaMwq5gCMNey/AjjSA1MFV22wXz6JALjN/0h/2ctO9lGGwzyx/GTsg3SZdo RM4LUDZjVC+XUb0sjvz/HvlyGfZ2fgriBvLF+NVjz0nKGyTJAWd5wquAvv5dqADo0JZx C+og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111240; x=1734716040; 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=Y+wOBXQ4nR4PSgQu/QW17WIQZdSFhMR8jDryGS5FwMg=; b=w0lPPFzibLjSW6Xo319nYmMxqC07m5u2THxD4Xbtl8N1QB/F1cF2rfwJWj4TJ8Ya+X tW8q0n+2wVgHPfCjVIoXODJkTzyuuDs7PraVI5UPywTxIRDWlnrLFXoJOBHU5MP/CuqH 3oG3AObe2CHj8MKLFldyJg9zI53Z270RL6DQqqHv+WVaf1YZPcV2BlHxUrHGcBJMZIRr OLMAFC2arbm+vu5WIZPlq8IBRi1F9wgqKQy9ApHQPN0WZDVtSQKDgno5L2xhhY3wCTbb nEnPR1sf+pdy3HozI+GwicT9zZ6mAkCGzwVP0zEqoDsximsZk9bOF/h3el4HLKIPhmh1 fqpg== X-Gm-Message-State: AOJu0YwgFFXvGD3V0d25jj+ouDM7sWhG4eTLrNuxb3VX2QFZtsDZRclF W1Or6+msaSMlO/RCGCrdl2+zRVk7IevltTFY1cch/v0TQTD6arxhpjBkx1ah1v8xEoa+GfaT89V f X-Gm-Gg: ASbGnctgCqzU1sUjUpo4DBPugJCNAqYp9dE5pT3i0guDAYeSJAXCZdpmZRvrOw6mxVP 3fvB9GjaMB4dZaI8Q3pd28RnkpwbLcyfFoBVZ2JibStizdrvsiwC94Wwem1TZHENa7uwDxvISpl WADkaG8yBOEjvPX8Hw2DLlmRyWLRuJMcDM1w03y4Brrf6mXbsCl3f8HrlA+fPQ1yFk7wYVBFR6H yAcQIw7L/o27kVaqH/1XHoWbAPr6X4iajar8dHErA239dq+wy+fObX2ELUTPQ== X-Received: by 2002:a05:6000:70e:b0:385:e8e7:d09a with SMTP id ffacd0b85a97d-388c3645ec2mr2888973f8f.2.1734111239685; Fri, 13 Dec 2024 09:33:59 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:59 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 83/85] target/arm: Move small helper functions to tlb-insns.c Date: Fri, 13 Dec 2024 17:32:27 +0000 Message-Id: <20241213173229.3308926-84-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.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 remaining functions that we temporarily made global are now used only from callsits in tlb-insns.c; move them across and make them file-local again. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20241210160452.2427965-9-peter.maydell@linaro.org --- target/arm/cpregs.h | 34 ------ target/arm/helper.c | 220 ------------------------------------- target/arm/tcg/tlb-insns.c | 220 +++++++++++++++++++++++++++++++++++++ 3 files changed, 220 insertions(+), 254 deletions(-) diff --git a/target/arm/cpregs.h b/target/arm/cpregs.h index fe838bcfd97..cc7c54378f4 100644 --- a/target/arm/cpregs.h +++ b/target/arm/cpregs.h @@ -1134,38 +1134,4 @@ static inline bool arm_cpreg_traps_in_nv(const ARMCPRegInfo *ri) return ri->opc1 == 4 || ri->opc1 == 5; } -/* - * Temporary declarations of functions until the move to tlb_insn_helper.c - * is complete and we can make the functions static again - */ -CPAccessResult access_ttlb(CPUARMState *env, const ARMCPRegInfo *ri, - bool isread); -CPAccessResult access_ttlbis(CPUARMState *env, const ARMCPRegInfo *ri, - bool isread); -CPAccessResult access_ttlbos(CPUARMState *env, const ARMCPRegInfo *ri, - bool isread); -bool tlb_force_broadcast(CPUARMState *env); -int tlbbits_for_regime(CPUARMState *env, ARMMMUIdx mmu_idx, - uint64_t addr); -int vae1_tlbbits(CPUARMState *env, uint64_t addr); -int vae2_tlbbits(CPUARMState *env, uint64_t addr); -int vae1_tlbmask(CPUARMState *env); -int vae2_tlbmask(CPUARMState *env); -int ipas2e1_tlbmask(CPUARMState *env, int64_t value); -int e2_tlbmask(CPUARMState *env); -void tlbi_aa64_vmalle1is_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value); -void tlbi_aa64_alle1is_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value); -void tlbi_aa64_vae1is_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value); -void tlbi_aa64_alle2is_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value); -void tlbi_aa64_vae2is_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value); -void tlbi_aa64_vae3is_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value); -void tlbi_aa64_alle3is_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value); - #endif /* TARGET_ARM_CPREGS_H */ diff --git a/target/arm/helper.c b/target/arm/helper.c index 3f7d56e809f..cd9f8650316 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -365,40 +365,6 @@ static CPAccessResult access_tacr(CPUARMState *env, const ARMCPRegInfo *ri, return CP_ACCESS_OK; } -/* Check for traps from EL1 due to HCR_EL2.TTLB. */ -CPAccessResult access_ttlb(CPUARMState *env, const ARMCPRegInfo *ri, - bool isread) -{ - if (arm_current_el(env) == 1 && (arm_hcr_el2_eff(env) & HCR_TTLB)) { - return CP_ACCESS_TRAP_EL2; - } - return CP_ACCESS_OK; -} - -/* Check for traps from EL1 due to HCR_EL2.TTLB or TTLBIS. */ -CPAccessResult access_ttlbis(CPUARMState *env, const ARMCPRegInfo *ri, - bool isread) -{ - if (arm_current_el(env) == 1 && - (arm_hcr_el2_eff(env) & (HCR_TTLB | HCR_TTLBIS))) { - return CP_ACCESS_TRAP_EL2; - } - return CP_ACCESS_OK; -} - -#ifdef TARGET_AARCH64 -/* Check for traps from EL1 due to HCR_EL2.TTLB or TTLBOS. */ -CPAccessResult access_ttlbos(CPUARMState *env, const ARMCPRegInfo *ri, - bool isread) -{ - if (arm_current_el(env) == 1 && - (arm_hcr_el2_eff(env) & (HCR_TTLB | HCR_TTLBOS))) { - return CP_ACCESS_TRAP_EL2; - } - return CP_ACCESS_OK; -} -#endif - static void dacr_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) { ARMCPU *cpu = env_archcpu(env); @@ -455,16 +421,6 @@ int alle1_tlbmask(CPUARMState *env) ARMMMUIdxBit_Stage2_S); } -/* - * Non-IS variants of TLB operations are upgraded to - * IS versions if we are at EL1 and HCR_EL2.FB is effectively set to - * force broadcast of these operations. - */ -bool tlb_force_broadcast(CPUARMState *env) -{ - return arm_current_el(env) == 1 && (arm_hcr_el2_eff(env) & HCR_FB); -} - static const ARMCPRegInfo cp_reginfo[] = { /* * Define the secure and non-secure FCSE identifier CP registers @@ -4680,182 +4636,6 @@ static CPAccessResult access_tocu(CPUARMState *env, const ARMCPRegInfo *ri, return do_cacheop_pou_access(env, HCR_TOCU | HCR_TPU); } -/* - * See: D4.7.2 TLB maintenance requirements and the TLB maintenance instructions - * Page D4-1736 (DDI0487A.b) - */ - -int vae1_tlbmask(CPUARMState *env) -{ - uint64_t hcr = arm_hcr_el2_eff(env); - uint16_t mask; - - assert(arm_feature(env, ARM_FEATURE_AARCH64)); - - if ((hcr & (HCR_E2H | HCR_TGE)) == (HCR_E2H | HCR_TGE)) { - mask = ARMMMUIdxBit_E20_2 | - ARMMMUIdxBit_E20_2_PAN | - ARMMMUIdxBit_E20_0; - } else { - /* This is AArch64 only, so we don't need to touch the EL30_x TLBs */ - mask = ARMMMUIdxBit_E10_1 | - ARMMMUIdxBit_E10_1_PAN | - ARMMMUIdxBit_E10_0; - } - return mask; -} - -int vae2_tlbmask(CPUARMState *env) -{ - uint64_t hcr = arm_hcr_el2_eff(env); - uint16_t mask; - - if (hcr & HCR_E2H) { - mask = ARMMMUIdxBit_E20_2 | - ARMMMUIdxBit_E20_2_PAN | - ARMMMUIdxBit_E20_0; - } else { - mask = ARMMMUIdxBit_E2; - } - return mask; -} - -/* Return 56 if TBI is enabled, 64 otherwise. */ -int tlbbits_for_regime(CPUARMState *env, ARMMMUIdx mmu_idx, - uint64_t addr) -{ - uint64_t tcr = regime_tcr(env, mmu_idx); - int tbi = aa64_va_parameter_tbi(tcr, mmu_idx); - int select = extract64(addr, 55, 1); - - return (tbi >> select) & 1 ? 56 : 64; -} - -int vae1_tlbbits(CPUARMState *env, uint64_t addr) -{ - uint64_t hcr = arm_hcr_el2_eff(env); - ARMMMUIdx mmu_idx; - - assert(arm_feature(env, ARM_FEATURE_AARCH64)); - - /* Only the regime of the mmu_idx below is significant. */ - if ((hcr & (HCR_E2H | HCR_TGE)) == (HCR_E2H | HCR_TGE)) { - mmu_idx = ARMMMUIdx_E20_0; - } else { - mmu_idx = ARMMMUIdx_E10_0; - } - - return tlbbits_for_regime(env, mmu_idx, addr); -} - -int vae2_tlbbits(CPUARMState *env, uint64_t addr) -{ - uint64_t hcr = arm_hcr_el2_eff(env); - ARMMMUIdx mmu_idx; - - /* - * Only the regime of the mmu_idx below is significant. - * Regime EL2&0 has two ranges with separate TBI configuration, while EL2 - * only has one. - */ - if (hcr & HCR_E2H) { - mmu_idx = ARMMMUIdx_E20_2; - } else { - mmu_idx = ARMMMUIdx_E2; - } - - return tlbbits_for_regime(env, mmu_idx, addr); -} - -void tlbi_aa64_vmalle1is_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value) -{ - CPUState *cs = env_cpu(env); - int mask = vae1_tlbmask(env); - - tlb_flush_by_mmuidx_all_cpus_synced(cs, mask); -} - -int e2_tlbmask(CPUARMState *env) -{ - return (ARMMMUIdxBit_E20_0 | - ARMMMUIdxBit_E20_2 | - ARMMMUIdxBit_E20_2_PAN | - ARMMMUIdxBit_E2); -} - -void tlbi_aa64_alle1is_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value) -{ - CPUState *cs = env_cpu(env); - int mask = alle1_tlbmask(env); - - tlb_flush_by_mmuidx_all_cpus_synced(cs, mask); -} - -void tlbi_aa64_alle2is_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value) -{ - CPUState *cs = env_cpu(env); - int mask = e2_tlbmask(env); - - tlb_flush_by_mmuidx_all_cpus_synced(cs, mask); -} - -void tlbi_aa64_alle3is_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value) -{ - CPUState *cs = env_cpu(env); - - tlb_flush_by_mmuidx_all_cpus_synced(cs, ARMMMUIdxBit_E3); -} - -void tlbi_aa64_vae1is_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value) -{ - CPUState *cs = env_cpu(env); - int mask = vae1_tlbmask(env); - uint64_t pageaddr = sextract64(value << 12, 0, 56); - int bits = vae1_tlbbits(env, pageaddr); - - tlb_flush_page_bits_by_mmuidx_all_cpus_synced(cs, pageaddr, mask, bits); -} - -void tlbi_aa64_vae2is_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value) -{ - CPUState *cs = env_cpu(env); - int mask = vae2_tlbmask(env); - uint64_t pageaddr = sextract64(value << 12, 0, 56); - int bits = vae2_tlbbits(env, pageaddr); - - tlb_flush_page_bits_by_mmuidx_all_cpus_synced(cs, pageaddr, mask, bits); -} - -void tlbi_aa64_vae3is_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value) -{ - CPUState *cs = env_cpu(env); - uint64_t pageaddr = sextract64(value << 12, 0, 56); - int bits = tlbbits_for_regime(env, ARMMMUIdx_E3, pageaddr); - - tlb_flush_page_bits_by_mmuidx_all_cpus_synced(cs, pageaddr, - ARMMMUIdxBit_E3, bits); -} - -int ipas2e1_tlbmask(CPUARMState *env, int64_t value) -{ - /* - * The MSB of value is the NS field, which only applies if SEL2 - * is implemented and SCR_EL3.NS is not set (i.e. in secure mode). - */ - return (value >= 0 - && cpu_isar_feature(aa64_sel2, env_archcpu(env)) - && arm_is_secure_below_el3(env) - ? ARMMMUIdxBit_Stage2_S - : ARMMMUIdxBit_Stage2); -} - static CPAccessResult aa64_zva_access(CPUARMState *env, const ARMCPRegInfo *ri, bool isread) { diff --git a/target/arm/tcg/tlb-insns.c b/target/arm/tcg/tlb-insns.c index 45ebfc512f9..51b4756e31e 100644 --- a/target/arm/tcg/tlb-insns.c +++ b/target/arm/tcg/tlb-insns.c @@ -13,6 +13,40 @@ #include "cpu-features.h" #include "cpregs.h" +/* Check for traps from EL1 due to HCR_EL2.TTLB. */ +static CPAccessResult access_ttlb(CPUARMState *env, const ARMCPRegInfo *ri, + bool isread) +{ + if (arm_current_el(env) == 1 && (arm_hcr_el2_eff(env) & HCR_TTLB)) { + return CP_ACCESS_TRAP_EL2; + } + return CP_ACCESS_OK; +} + +/* Check for traps from EL1 due to HCR_EL2.TTLB or TTLBIS. */ +static CPAccessResult access_ttlbis(CPUARMState *env, const ARMCPRegInfo *ri, + bool isread) +{ + if (arm_current_el(env) == 1 && + (arm_hcr_el2_eff(env) & (HCR_TTLB | HCR_TTLBIS))) { + return CP_ACCESS_TRAP_EL2; + } + return CP_ACCESS_OK; +} + +#ifdef TARGET_AARCH64 +/* Check for traps from EL1 due to HCR_EL2.TTLB or TTLBOS. */ +static CPAccessResult access_ttlbos(CPUARMState *env, const ARMCPRegInfo *ri, + bool isread) +{ + if (arm_current_el(env) == 1 && + (arm_hcr_el2_eff(env) & (HCR_TTLB | HCR_TTLBOS))) { + return CP_ACCESS_TRAP_EL2; + } + return CP_ACCESS_OK; +} +#endif + /* IS variants of TLB operations must affect all cores */ static void tlbiall_is_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) @@ -46,6 +80,16 @@ static void tlbimvaa_is_write(CPUARMState *env, const ARMCPRegInfo *ri, tlb_flush_page_all_cpus_synced(cs, value & TARGET_PAGE_MASK); } +/* + * Non-IS variants of TLB operations are upgraded to + * IS versions if we are at EL1 and HCR_EL2.FB is effectively set to + * force broadcast of these operations. + */ +static bool tlb_force_broadcast(CPUARMState *env) +{ + return arm_current_el(env) == 1 && (arm_hcr_el2_eff(env) & HCR_FB); +} + static void tlbiall_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) { @@ -170,6 +214,102 @@ static void tlbiall_hyp_is_write(CPUARMState *env, const ARMCPRegInfo *ri, tlb_flush_by_mmuidx_all_cpus_synced(cs, ARMMMUIdxBit_E2); } +/* + * See: D4.7.2 TLB maintenance requirements and the TLB maintenance instructions + * Page D4-1736 (DDI0487A.b) + */ + +static int vae1_tlbmask(CPUARMState *env) +{ + uint64_t hcr = arm_hcr_el2_eff(env); + uint16_t mask; + + assert(arm_feature(env, ARM_FEATURE_AARCH64)); + + if ((hcr & (HCR_E2H | HCR_TGE)) == (HCR_E2H | HCR_TGE)) { + mask = ARMMMUIdxBit_E20_2 | + ARMMMUIdxBit_E20_2_PAN | + ARMMMUIdxBit_E20_0; + } else { + /* This is AArch64 only, so we don't need to touch the EL30_x TLBs */ + mask = ARMMMUIdxBit_E10_1 | + ARMMMUIdxBit_E10_1_PAN | + ARMMMUIdxBit_E10_0; + } + return mask; +} + +static int vae2_tlbmask(CPUARMState *env) +{ + uint64_t hcr = arm_hcr_el2_eff(env); + uint16_t mask; + + if (hcr & HCR_E2H) { + mask = ARMMMUIdxBit_E20_2 | + ARMMMUIdxBit_E20_2_PAN | + ARMMMUIdxBit_E20_0; + } else { + mask = ARMMMUIdxBit_E2; + } + return mask; +} + +/* Return 56 if TBI is enabled, 64 otherwise. */ +static int tlbbits_for_regime(CPUARMState *env, ARMMMUIdx mmu_idx, + uint64_t addr) +{ + uint64_t tcr = regime_tcr(env, mmu_idx); + int tbi = aa64_va_parameter_tbi(tcr, mmu_idx); + int select = extract64(addr, 55, 1); + + return (tbi >> select) & 1 ? 56 : 64; +} + +static int vae1_tlbbits(CPUARMState *env, uint64_t addr) +{ + uint64_t hcr = arm_hcr_el2_eff(env); + ARMMMUIdx mmu_idx; + + assert(arm_feature(env, ARM_FEATURE_AARCH64)); + + /* Only the regime of the mmu_idx below is significant. */ + if ((hcr & (HCR_E2H | HCR_TGE)) == (HCR_E2H | HCR_TGE)) { + mmu_idx = ARMMMUIdx_E20_0; + } else { + mmu_idx = ARMMMUIdx_E10_0; + } + + return tlbbits_for_regime(env, mmu_idx, addr); +} + +static int vae2_tlbbits(CPUARMState *env, uint64_t addr) +{ + uint64_t hcr = arm_hcr_el2_eff(env); + ARMMMUIdx mmu_idx; + + /* + * Only the regime of the mmu_idx below is significant. + * Regime EL2&0 has two ranges with separate TBI configuration, while EL2 + * only has one. + */ + if (hcr & HCR_E2H) { + mmu_idx = ARMMMUIdx_E20_2; + } else { + mmu_idx = ARMMMUIdx_E2; + } + + return tlbbits_for_regime(env, mmu_idx, addr); +} + +static void tlbi_aa64_vmalle1is_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) +{ + CPUState *cs = env_cpu(env); + int mask = vae1_tlbmask(env); + + tlb_flush_by_mmuidx_all_cpus_synced(cs, mask); +} + static void tlbi_aa64_vmalle1_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) { @@ -183,6 +323,14 @@ static void tlbi_aa64_vmalle1_write(CPUARMState *env, const ARMCPRegInfo *ri, } } +static int e2_tlbmask(CPUARMState *env) +{ + return (ARMMMUIdxBit_E20_0 | + ARMMMUIdxBit_E20_2 | + ARMMMUIdxBit_E20_2_PAN | + ARMMMUIdxBit_E2); +} + static void tlbi_aa64_alle1_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) { @@ -210,6 +358,32 @@ static void tlbi_aa64_alle3_write(CPUARMState *env, const ARMCPRegInfo *ri, tlb_flush_by_mmuidx(cs, ARMMMUIdxBit_E3); } +static void tlbi_aa64_alle1is_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) +{ + CPUState *cs = env_cpu(env); + int mask = alle1_tlbmask(env); + + tlb_flush_by_mmuidx_all_cpus_synced(cs, mask); +} + +static void tlbi_aa64_alle2is_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) +{ + CPUState *cs = env_cpu(env); + int mask = e2_tlbmask(env); + + tlb_flush_by_mmuidx_all_cpus_synced(cs, mask); +} + +static void tlbi_aa64_alle3is_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) +{ + CPUState *cs = env_cpu(env); + + tlb_flush_by_mmuidx_all_cpus_synced(cs, ARMMMUIdxBit_E3); +} + static void tlbi_aa64_vae2_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) { @@ -241,6 +415,17 @@ static void tlbi_aa64_vae3_write(CPUARMState *env, const ARMCPRegInfo *ri, tlb_flush_page_by_mmuidx(cs, pageaddr, ARMMMUIdxBit_E3); } +static void tlbi_aa64_vae1is_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) +{ + CPUState *cs = env_cpu(env); + int mask = vae1_tlbmask(env); + uint64_t pageaddr = sextract64(value << 12, 0, 56); + int bits = vae1_tlbbits(env, pageaddr); + + tlb_flush_page_bits_by_mmuidx_all_cpus_synced(cs, pageaddr, mask, bits); +} + static void tlbi_aa64_vae1_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) { @@ -262,6 +447,41 @@ static void tlbi_aa64_vae1_write(CPUARMState *env, const ARMCPRegInfo *ri, } } +static void tlbi_aa64_vae2is_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) +{ + CPUState *cs = env_cpu(env); + int mask = vae2_tlbmask(env); + uint64_t pageaddr = sextract64(value << 12, 0, 56); + int bits = vae2_tlbbits(env, pageaddr); + + tlb_flush_page_bits_by_mmuidx_all_cpus_synced(cs, pageaddr, mask, bits); +} + +static void tlbi_aa64_vae3is_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) +{ + CPUState *cs = env_cpu(env); + uint64_t pageaddr = sextract64(value << 12, 0, 56); + int bits = tlbbits_for_regime(env, ARMMMUIdx_E3, pageaddr); + + tlb_flush_page_bits_by_mmuidx_all_cpus_synced(cs, pageaddr, + ARMMMUIdxBit_E3, bits); +} + +static int ipas2e1_tlbmask(CPUARMState *env, int64_t value) +{ + /* + * The MSB of value is the NS field, which only applies if SEL2 + * is implemented and SCR_EL3.NS is not set (i.e. in secure mode). + */ + return (value >= 0 + && cpu_isar_feature(aa64_sel2, env_archcpu(env)) + && arm_is_secure_below_el3(env) + ? ARMMMUIdxBit_Stage2_S + : ARMMMUIdxBit_Stage2); +} + static void tlbi_aa64_ipas2e1_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) { From patchwork Fri Dec 13 17:32:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850184 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1641502wry; Fri, 13 Dec 2024 09:41:17 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWX7+j+4xDj+A++/fjB7GM4iymFdf3FL0MVxVp7sVu/l9D7opKNCmAW7Jx8jOFbqylHMB2hTQ==@linaro.org X-Google-Smtp-Source: AGHT+IE8bbj+hUJvQp4WS7r2pgQU3OfgBwTVBfIhMBFc8i+JMU4RgYoyYBJ9AGP35VK97NJWgYw1 X-Received: by 2002:a05:600c:cc7:b0:434:a386:6ae with SMTP id 5b1f17b1804b1-4362aa14685mr30152895e9.7.1734111677255; Fri, 13 Dec 2024 09:41:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111677; cv=none; d=google.com; s=arc-20240605; b=f9P9qQ9rDjfZET5772QoVUSdMF8pwjvqNrbn2cpUV3pZfF6sLKwOEEb/YvzekMvZCL tHQJpZG+XzV/Zob6N6BWWuOflYg5m5VgiyjQ94vfIHJc3pITl9pZi0vDmixAEdry72fK FvKirpEKBjGA3o5YMcqTA5aMJZvx6CuzOurQ7g3UtQ2q4qUIltS6W5L17N/dj1u7sn9E guSp3mREH3q+muNxmVHKhIU6H2wOLd26bsG7f81Vg9Q0QFpPL1CuquZ1QvtQMS8no8Mw GSqnDnFQ7CLLkJPEQ57c9zGd6NTLWqOAS/LzGn4XkmUHvOUFL2/H8KctMWpaRgkcvnob tMTQ== 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=xaMbB8kjdY13l6QcFYXNfjRvMJl7ExJkmBH2Rljo9ow=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=NiSTJviAkUTsH2G4muMhnjgWDzvbg6rbqEa9CD6sE6CEa2MWAlpLiUpnPTzFb8pJSu j2u88ExYgx/TqQmJtEN9EYrQvhoZ9BIeFnSGCw6blrf3hFwmxU1lM8gSjxkLZcNZpWzk UgjkGPTBu5fnfqqh9/JmhrPWlXEYftQR4sP/uSiHP8/HovJ+IiIFZQ1IskCivQ5PSpck yiFZ24coblwKHBDPDg6AqE6QI7dLRJFEOeniSVdp6rWZfuDOeJrkoufTOPFW1NUDJ1p0 Ml4Bbp2ZxfE7ktL4MxKeaxY9EKcWyyPn6sRzlL2/9C73WintGMK2vIuxwrIxUUVxy36s BLlQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ko8djdGu; 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 5b1f17b1804b1-4361ec85f41si22677755e9.2.2024.12.13.09.41.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:41:17 -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=Ko8djdGu; 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 1tM9ax-0002Qb-4H; Fri, 13 Dec 2024 12:36:55 -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 1tM9YG-0000rY-8O for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:34:08 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9YB-0001nJ-PM for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:34:07 -0500 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-3862f32a33eso985899f8f.3 for ; Fri, 13 Dec 2024 09:34:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111241; x=1734716041; 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=xaMbB8kjdY13l6QcFYXNfjRvMJl7ExJkmBH2Rljo9ow=; b=Ko8djdGuUGoJcndE+rLSX5JkgffULpJ5AgjNW+X0qhcNpRDq/+ZDyiOGWUKVC9X1yu a0BGLveJQmay1zoQHRB/pX0ke5jJF92vbJPMdiKklpq9AOgbun9gQY9OpDB4KIbgFyYk 4atq2pgW/UZzHS1OIx2ngilQL2PsvH/WFtBch4FPkrg8cceYfHQDpOUpqrGsEWjWN7IR UKbycEHZYU8W03QZI9LJNg2je15HG20kz94lvi20eyDb4hfJaZMxJndZE1vONbkcWdWc QrS2rfh1UFcus0NB4ykZ5AOz4Rw/u/9/YsucJjAZoPRuL24b8fGyW/yxorJ9FneCsBrI K09Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111241; x=1734716041; 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=xaMbB8kjdY13l6QcFYXNfjRvMJl7ExJkmBH2Rljo9ow=; b=aHX5Mi48W//CsztejoBXuG74Ywao9Fb40LdzDCXpnn6+rx5QkVKCFl0jU4Nt1+mBd6 ZCoomYQ99njneaUAPP/CT0sASJFosCUKiQ+XlJW/HbZB5svUznC90W/Gt87+sVypUVxE tz5GHactk1jZGMLVgdVyNHK0Q3V3NyUUZtgCZVwots3yFq2kjT0CrV0VEQQLukHli/T+ DyKkHpXd5w5ol0F2EGHsHVerwD2uwbGX29P75G4XLU39vzkYGpU9KzS6kgoX5LcSUa4Q nwYQmX77iN3AfIImYNd8qbE8BLq/xKdXmvxp3iMpF13eWACtY978fVgW6XH7Nj4pcb6f hmyQ== X-Gm-Message-State: AOJu0Yya1E/yfRsV7pp/cVwhfF0BKb58o6MwJ4VJrUQEGLObn1YfLwuO 69UXK3cKd4K+I/fCDc6CeVzUjoXT3/5NWwyBN+m/y1uYc79gIbKc9kR3gFPBfc4pfbNpQ2bTTTZ p X-Gm-Gg: ASbGnct1v39V245MNwbjBIDMFupijTtxl+IWygPkRCIeJaXCcBd1mpBj21KzB/Sx/qx HEUJ6oZFvyvoCEeQemWRrHG/lB3HGdXxN+jEW/R+HiAkcUYC2a+dXAvXyyzQONeKGbdUIi4kZ9d W3Mu9WqXXL0ZdI0KqXg8n0U+ONsbAmX01JvCQ+fXxb+2yew0YQ3An8avnIuvmc0qCYbq90hoTht CSCe2S2yGl9XpkgRrbk+tk0P3gQZTa5wMkJFmUvgp3bF1Pf6L4JiQaHRk4n7A== X-Received: by 2002:a5d:6d8f:0:b0:385:e43a:4dd8 with SMTP id ffacd0b85a97d-38880af1458mr2824172f8f.4.1734111240716; Fri, 13 Dec 2024 09:34:00 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:59 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 84/85] target/arm: Move RME TLB insns to tlb-insns.c Date: Fri, 13 Dec 2024 17:32:28 +0000 Message-Id: <20241213173229.3308926-85-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x433.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.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 Move the FEAT_RME specific TLB insns across to tlb-insns.c. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20241210160452.2427965-10-peter.maydell@linaro.org --- target/arm/helper.c | 38 -------------------------------- target/arm/tcg/tlb-insns.c | 45 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 38 deletions(-) diff --git a/target/arm/helper.c b/target/arm/helper.c index cd9f8650316..910ae62c476 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -6525,14 +6525,6 @@ static const ARMCPRegInfo sme_reginfo[] = { .type = ARM_CP_CONST, .resetvalue = 0 }, }; -static void tlbi_aa64_paall_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value) -{ - CPUState *cs = env_cpu(env); - - tlb_flush(cs); -} - static void gpccr_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) { @@ -6550,14 +6542,6 @@ static void gpccr_reset(CPUARMState *env, const ARMCPRegInfo *ri) env_archcpu(env)->reset_l0gptsz); } -static void tlbi_aa64_paallos_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value) -{ - CPUState *cs = env_cpu(env); - - tlb_flush_all_cpus_synced(cs); -} - static const ARMCPRegInfo rme_reginfo[] = { { .name = "GPCCR_EL3", .state = ARM_CP_STATE_AA64, .opc0 = 3, .opc1 = 6, .crn = 2, .crm = 1, .opc2 = 6, @@ -6569,28 +6553,6 @@ static const ARMCPRegInfo rme_reginfo[] = { { .name = "MFAR_EL3", .state = ARM_CP_STATE_AA64, .opc0 = 3, .opc1 = 6, .crn = 6, .crm = 0, .opc2 = 5, .access = PL3_RW, .fieldoffset = offsetof(CPUARMState, cp15.mfar_el3) }, - { .name = "TLBI_PAALL", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 6, .crn = 8, .crm = 7, .opc2 = 4, - .access = PL3_W, .type = ARM_CP_NO_RAW, - .writefn = tlbi_aa64_paall_write }, - { .name = "TLBI_PAALLOS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 6, .crn = 8, .crm = 1, .opc2 = 4, - .access = PL3_W, .type = ARM_CP_NO_RAW, - .writefn = tlbi_aa64_paallos_write }, - /* - * QEMU does not have a way to invalidate by physical address, thus - * invalidating a range of physical addresses is accomplished by - * flushing all tlb entries in the outer shareable domain, - * just like PAALLOS. - */ - { .name = "TLBI_RPALOS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 6, .crn = 8, .crm = 4, .opc2 = 7, - .access = PL3_W, .type = ARM_CP_NO_RAW, - .writefn = tlbi_aa64_paallos_write }, - { .name = "TLBI_RPAOS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 6, .crn = 8, .crm = 4, .opc2 = 3, - .access = PL3_W, .type = ARM_CP_NO_RAW, - .writefn = tlbi_aa64_paallos_write }, { .name = "DC_CIPAPA", .state = ARM_CP_STATE_AA64, .opc0 = 1, .opc1 = 6, .crn = 7, .crm = 14, .opc2 = 1, .access = PL3_W, .type = ARM_CP_NOP }, diff --git a/target/arm/tcg/tlb-insns.c b/target/arm/tcg/tlb-insns.c index 51b4756e31e..d20d32624da 100644 --- a/target/arm/tcg/tlb-insns.c +++ b/target/arm/tcg/tlb-insns.c @@ -1181,6 +1181,48 @@ static const ARMCPRegInfo tlbios_reginfo[] = { .access = PL3_W, .type = ARM_CP_NO_RAW, .writefn = tlbi_aa64_vae3is_write }, }; + +static void tlbi_aa64_paall_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) +{ + CPUState *cs = env_cpu(env); + + tlb_flush(cs); +} + +static void tlbi_aa64_paallos_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) +{ + CPUState *cs = env_cpu(env); + + tlb_flush_all_cpus_synced(cs); +} + +static const ARMCPRegInfo tlbi_rme_reginfo[] = { + { .name = "TLBI_PAALL", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 6, .crn = 8, .crm = 7, .opc2 = 4, + .access = PL3_W, .type = ARM_CP_NO_RAW, + .writefn = tlbi_aa64_paall_write }, + { .name = "TLBI_PAALLOS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 6, .crn = 8, .crm = 1, .opc2 = 4, + .access = PL3_W, .type = ARM_CP_NO_RAW, + .writefn = tlbi_aa64_paallos_write }, + /* + * QEMU does not have a way to invalidate by physical address, thus + * invalidating a range of physical addresses is accomplished by + * flushing all tlb entries in the outer shareable domain, + * just like PAALLOS. + */ + { .name = "TLBI_RPALOS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 6, .crn = 8, .crm = 4, .opc2 = 7, + .access = PL3_W, .type = ARM_CP_NO_RAW, + .writefn = tlbi_aa64_paallos_write }, + { .name = "TLBI_RPAOS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 6, .crn = 8, .crm = 4, .opc2 = 3, + .access = PL3_W, .type = ARM_CP_NO_RAW, + .writefn = tlbi_aa64_paallos_write }, +}; + #endif void define_tlb_insn_regs(ARMCPU *cpu) @@ -1219,5 +1261,8 @@ void define_tlb_insn_regs(ARMCPU *cpu) if (cpu_isar_feature(aa64_tlbios, cpu)) { define_arm_cp_regs(cpu, tlbios_reginfo); } + if (cpu_isar_feature(aa64_rme, cpu)) { + define_arm_cp_regs(cpu, tlbi_rme_reginfo); + } #endif } From patchwork Fri Dec 13 17:32:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850179 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1640795wry; Fri, 13 Dec 2024 09:39:46 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUjpszCu7POYuLSLsFC3e0et+JLsI8SiM5f0QZjgzYB+Lv9jBPIBmRgMHEDlyTCuSA99xOUpw==@linaro.org X-Google-Smtp-Source: AGHT+IFqDsKcmZ3ABaujDn0hG+SSpWNm0D6nIEl9TiwUXA+9bAbFCOwndpzpOXQ6Ov52YlaG2alo X-Received: by 2002:a05:6000:78b:b0:385:f9ed:1632 with SMTP id ffacd0b85a97d-38880adb0f2mr2945619f8f.28.1734111586077; Fri, 13 Dec 2024 09:39:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111586; cv=none; d=google.com; s=arc-20240605; b=jblFjSLrZMVpGh2mo86AL69Ag4qKrf0KRGkxex3P4xJd1Z4tSFfTSV59H6THcODydE EaVrSXOKQLUgGSTpc9Z4s+FEK3xj6PfOt7hS+dx/ISDTUKINWf4k5Fg1UuhyvmctHoip NoElorhr1e7JyQZJ7tb4YCVBY3i9Ia65W7gsrUqQ7sXhqv9xyROmK8kei4ZmCnnJuXPD /RAtVrTi0tvEStvQBRnG1q17fGGt5T4XUTlfYIpe1PZK3ieYKXu7f5Mhr9fQel/dId3N yueDZzZ+9BKsivsz6Ut54feerQUd+xVwDuBL9SlhN92r+ot7O09+6VE41tX5NkCL4V7Y jsLQ== 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=N0xxKJ/gejC1AsfVGkch3u9PAoevYxIM+im6oAvRmIA=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=iXGfj+yJ1wzg7hq0ERWsVpLFzxENPAVzI4sSLqWsmQSottQgtAH+vji9kXrhlhgF+g AgvBzyi1f91ELTh8klSNNFWiKEN446TraCclkxViZzI8bzjhrVZb1tVmnY5ywMXgBy1y Z74Rj55fm91Um8SnS1dUNfDYRZOI1gbiCflI56SrVZV9x1AxJ9h6dx6jyGbJZphAK0uS I7g8jbrNBZfW3w7XQ6WGqaem0YCv8EYSPlK0EJCx9K+pwLUqnvNaCSMQxc93+eAnYFS6 Q8EQdcr5mF3+LJPDk6eJ7oBeiLaoAAK15zN671oLyfX6T2TAwYY9kSgxLBm+0kqRvTSi ITkg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=w6UWYQ8c; 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 5b1f17b1804b1-43625548344si22740855e9.5.2024.12.13.09.39.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:39:46 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=w6UWYQ8c; 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 1tM9aT-0000tZ-A0; Fri, 13 Dec 2024 12:36:25 -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 1tM9YD-0000Ri-Ky for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:34:06 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9YB-0001nR-4F for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:34:05 -0500 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-43628e97467so13716405e9.3 for ; Fri, 13 Dec 2024 09:34:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111241; x=1734716041; 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=N0xxKJ/gejC1AsfVGkch3u9PAoevYxIM+im6oAvRmIA=; b=w6UWYQ8cbjdt8AZjs36u0ytJCgLbS+k/czPlRh81A2IlXde8wiWw7oXpU7WanvljSL ePYD5Asu0Gq3NjRE0V2YwwQ7UBYxX5ch5P0yIx+VxHn1IEV1PH7Ft67g/LsN/PAUU5Lg XrdhjPhiKdaoZHOWca2F4qtcPQfagB2PzEREMTRIbizEw4hzvCjf+DkvuE3E+7QLoee6 V9k2WG/Femzb4XgX39i3ILZft/3IpxwLUz9qgCPn0m/Tb50KRh5dICZOTbBdsDj3oc3/ Mm7JuVcU7cpfcQtMJKMuv6Q5SHHVkpSlR/eLwr5mF2tFt1mqkMzAjwQHM3zRgZmF6IEA CdTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111241; x=1734716041; 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=N0xxKJ/gejC1AsfVGkch3u9PAoevYxIM+im6oAvRmIA=; b=OjHqxeeBIysbZrEB4OEzuZRmgjljy2RDm3QctugO4qArTJr071aInxABkhrN6X4V0H j6umXDJ86jY6rQa0f5EFon40No0E+kddEgQwKmK11YjevrPb2iekl6ZbkdhvVmxlAJhZ uqyuC/kIj61LUSFd+FaQfPeP9C35PmKImk+Wv4Yo7q2UrtCmqWz8bRYCsZGVCo7zBy7C LWDR54/4RZ2xmksOY6bqZKR5sHCr8jYS8H5gsDm1U2OyrAYcocWsXkkkuVAySFQGKkZq dMLdpEOgiemfNWmIu1zVhPGTjybq/+Sx3+c1cnnIkHuQli49Ax6Sq/b4OKv6+sAaj2Ui 24SQ== X-Gm-Message-State: AOJu0YxmTx8kKaJnp3PMDtapWozX9D9iArS8O4+Gm/AcgabUY5zwmARo OJc1Tq3GaqoJe2YR+3Aw89G376zKBatFZc84BuzFTQQzGM27l7uIVky2wr1//wQeweX9lxMhDZw n X-Gm-Gg: ASbGncud0QgqfltyeTpKnP3axJC/u85sJzAaKsLymbMbHo250HiYG1rwovmr5NMWm6T IOm5omieGws2a2U2+2opZQ2JyEoM0LGOkcQPW+Pb6crrJcycHrp0ko/cVWznljGXPd1vFFYEth5 dVEnpLr692b1bPVbMYCCeP/+RUceJ76GGmNbiyfP0L7nanKk70yNHY65kVbsTTph6WXu8mAX/fb dgeCDaWDLL/PxYUEGPlWTGlqKk06vxTDBtJU3EmqTuGGmhR1jfqX3Qgm2tF5g== X-Received: by 2002:a05:6000:4025:b0:385:e034:8d47 with SMTP id ffacd0b85a97d-3888e0b98f6mr2990104f8f.46.1734111241633; Fri, 13 Dec 2024 09:34:01 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.34.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:34:00 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 85/85] target/arm: Simplify condition for tlbi_el2_cp_reginfo[] Date: Fri, 13 Dec 2024 17:32:29 +0000 Message-Id: <20241213173229.3308926-86-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32d.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 We currently register the tlbi_el2_cp_reginfo[] TLBI insns if EL2 is implemented, or if EL3 and v8 is implemented. This is a copy of the logic used for el2_cp_reginfo[], but for the specific case of the TLBI insns we can simplify it. This is because we do not need the "if EL2 does not exist but EL3 does then EL2 registers should exist and be RAZ/WI" handling here: all our cpregs are for instructions, which UNDEF when EL3 exists and EL2 does not. Simplify the condition down to just "if EL2 exists". This is not a behaviour change because: * for AArch64 insns we marked them with ARM_CP_EL3_NO_EL2_UNDEF, which meant that define_arm_cp_regs() would ignore them if EL2 wasn't present * for AArch32 insns, the .access = PL2_W meant that if EL2 was not present the only way to get at them was from AArch32 EL3; but we have no CPUs which have ARM_FEATURE_V8 but start in AArch32 Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20241210160452.2427965-11-peter.maydell@linaro.org --- target/arm/tcg/tlb-insns.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/target/arm/tcg/tlb-insns.c b/target/arm/tcg/tlb-insns.c index d20d32624da..0f67294edc4 100644 --- a/target/arm/tcg/tlb-insns.c +++ b/target/arm/tcg/tlb-insns.c @@ -1246,9 +1246,7 @@ void define_tlb_insn_regs(ARMCPU *cpu) * ops (i.e. matching the condition for el2_cp_reginfo[] in * helper.c), but we will be able to simplify this later. */ - if (arm_feature(env, ARM_FEATURE_EL2) - || (arm_feature(env, ARM_FEATURE_EL3) - && arm_feature(env, ARM_FEATURE_V8))) { + if (arm_feature(env, ARM_FEATURE_EL2)) { define_arm_cp_regs(cpu, tlbi_el2_cp_reginfo); } if (arm_feature(env, ARM_FEATURE_EL3)) {