From patchwork Tue Dec 10 16:16:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848808 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp416145wrn; Tue, 10 Dec 2024 08:19:44 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU9GOzjWtVria1SWTvVz9N8KwxAB2sEqYzN2FMg8hYzT8X3ghdmmrb64Uw1BECJYtxhm1bY5Q==@linaro.org X-Google-Smtp-Source: AGHT+IFD9MFSwM+OZ2usWWZ04kNrOdJgJL+XGXHBErzLMvygOs2hKlXiUZCX39WnP1vNPdfQjInr X-Received: by 2002:a05:6102:3750:b0:4b1:130f:9fd3 with SMTP id ada2fe7eead31-4b1130fa18bmr6607708137.15.1733847583918; Tue, 10 Dec 2024 08:19:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733847583; cv=none; d=google.com; s=arc-20240605; b=R0F+z3uBVB/I0Cflv72SZlpjcfe0Ms0YKs3QLN8RdPYROJ2Wnk5GLCHpvDTf2+Ayq5 zwm66GRBTMv8ZURNbGFPs31UoXvDoOztL+bFAY4m/0OBkLDAItAqI0oTNQ8x5SRnb48I s27EcvGGCPtDQcOP+ZTK61FJ3FLXFWbLKC5vHVILnBMJw2/3swBfmgX9/Yy4nfHMq8wd VRfBvO0Gi8LyrDEy4ZVRoP7hlUZh63Ll/+LtyeFFUqx8GIGdKkfHUPtmZKvET9fFcOjd 87B+Ykq1d74ihU37x9mP4CzymhuRQGYMWz9/pTGPMncuyBVoBLy2iXf7xD2iORMVG3fz uSBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=s63N5H1NJdR8gVUhJ6lBSzQfPRwDYdjmVxlruA0DAg4=; fh=OZQBfL75rC14cCDy3q+1fYHCs9KjWAQ7ZJ3hTfS+5lQ=; b=MEPj1N0lTx1694BSYne1fQ+nCnEfizoUgu7eIyj/dUp9uiE/w09I6dcd01LUkKogEI y3VafZh6cmvePzaJa5nCJAvuWAilaum3lul76XO+s51MvQqB6sPKqzMduaEpGguvc2le VrN/wFtTkMLtv8MgxJhamiQxofalQ2wxfKT+yBm35u3GrhGKV4bAa6AUbYXHdrMxkHOW G6ugQHVHff/ZkLVEOYJ9VlLzaWpkUXDomK++BVDMvkAvYZG2E9G1Iy7lj/JmkFM/Nxi6 5DyA2Vfx9YjCMuIjx/GJ34xMQv5MX179F2otaRmDJyFaI0Z0kcin7daqGZktomBwEz5x 5BbQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ox+l6cQQ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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-4afdf1b9cb4si1749650137.478.2024.12.10.08.19.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 08:19: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=Ox+l6cQQ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 1tL2vw-0002QS-Vo; Tue, 10 Dec 2024 11:18: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 1tL2vv-0002Pj-2T for qemu-devel@nongnu.org; Tue, 10 Dec 2024 11:17:59 -0500 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL2vt-0006HC-Bl for qemu-devel@nongnu.org; Tue, 10 Dec 2024 11:17:58 -0500 Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-53e3a37ae07so3463462e87.3 for ; Tue, 10 Dec 2024 08:17:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733847475; x=1734452275; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=s63N5H1NJdR8gVUhJ6lBSzQfPRwDYdjmVxlruA0DAg4=; b=Ox+l6cQQYRcdlnVW4dTu3jv3OdfLjyWTDXRVEankWwhxnO89hnmcxySDkakYFlr7qA TGNF+d5x0OASGOBRnArPuOnXSOFHeWghYJJZ1jGqSmPx1wiKJrxlii7fsxfNG4xyz2oG 17IVJTZ/xcRRLdDUs/mVB5Bv7izEYTtPRjbmHXHZlsnSSIDiGgBbqlL12KTGoXKoCFVu M/2I61mnC33pIGebPhNeblah1EyBF15JwLmgvHTh9Hmr/ry/9OK97MQ8pqXMp33SVD2S 3v1kO/PFtNQcptGhqT46cuVuILHgXD38teQgKCriXdzYTpC73W1iYVqv09UeZC5V/ohT TLxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733847475; x=1734452275; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=s63N5H1NJdR8gVUhJ6lBSzQfPRwDYdjmVxlruA0DAg4=; b=lrxgreKHBdgJZufDt5Pma/mJQTB8AvpuZoHybPscFe2Hu+QYe3n+2ikqkTKYNxD8a2 tGRYp+0rdnkvNm7RpBUg5h8KYhXfmvnaedrDlsp6hGYpSjNDmOEICYU7qqLgdZX2LcfR NTgE66oiKnhMSRm8BfRbbqXBQDzSoEzgf2FRZDQdq5sPbGxLRPtjymNc67zqPsUMo2AK Ys+GcsdLRfaID1LyWOBER+Z7HsVFt6pqhusNoT++Dkhn4hXP/FhwpW8ld1o3T4nksjYO UR68AF0dIxEmGCyl6Ghh/bCLqFUDncAf+EmXh8VSbeNDEvv3QXxNzQOVXKtgJiDJ8ElM yCVg== X-Gm-Message-State: AOJu0Yw0O3sz1TgOwtcO27BeC36k+nBillepYTAfBuEr+Prqu0o3iLOC fADGSMnTm3nJcG5ktVIO56SU2gKNmty+dFCVY78+AnZcw5eTgyVSx5qQmAdKmaSSYw4/D18hPKY BZFVpOTIm X-Gm-Gg: ASbGncuN0Vk6T76RxPT7fAVRSLboDkuGf8BwulaMYQLArfvTF2SrRStcBprrAfaFA0q CF2lAuTv+o3AVuu1alPIRNU0dYaE38jZMPgDmERFUZ+qx0nvy0fpBuesw7Sm8uIk+Z9hsuTThao oLZ4GL+D51nNK0QE0OiXVCh95QR94alH3haytar9/7Hx/Kw4qrpKloLff2ZpM+WH3rr56sGAGeM ydXtHiITHNMo1meIif1lV9cCbj2YQAUfQXIyuNigPTPBKu1cKW7kudmF7A= X-Received: by 2002:a05:6512:3e19:b0:53e:3a53:f884 with SMTP id 2adb3069b0e04-53e3a53f931mr5111988e87.35.1733847474913; Tue, 10 Dec 2024 08:17:54 -0800 (PST) Received: from stoup.. ([91.209.212.80]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53f93377eefsm1026343e87.67.2024.12.10.08.17.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 08:17:53 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 03/69] target/arm: Convert LSLV, LSRV, ASRV, RORV to decodetree Date: Tue, 10 Dec 2024 10:16:27 -0600 Message-ID: <20241210161733.1830573-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241210161733.1830573-1-richard.henderson@linaro.org> References: <20241210161733.1830573-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::131; envelope-from=richard.henderson@linaro.org; helo=mail-lf1-x131.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/arm/tcg/translate-a64.c | 46 ++++++++++++++++------------------ target/arm/tcg/a64.decode | 4 +++ 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 9f687ba840..8b7ca2c68a 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; } diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index c218f6afbc..3db55b78a6 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)