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;