From patchwork Tue Dec 10 16:16:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848819 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp416618wrn; Tue, 10 Dec 2024 08:20:35 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWnC8r3eUNepSWvye65yuXIJbz1JFfSQ+GRoMNs+EeGGprBmofKcre4U0bQ7rNZ9ZZk7CAtMw==@linaro.org X-Google-Smtp-Source: AGHT+IHVhSyTXuRXf0/elWeYYeZiP+hRY2iGg8WxaEgNUg6zF4RqyRQD8Sj3+JXCF5wL+Vz0+XHE X-Received: by 2002:a05:622a:34b:b0:466:a0e2:ae8e with SMTP id d75a77b69052e-46734cc233bmr272705641cf.9.1733847635036; Tue, 10 Dec 2024 08:20:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733847635; cv=none; d=google.com; s=arc-20240605; b=cyqRKFM4/FMuPId8t3PR6pUlLq152BMQs/QqWFTuTdNZqb4bKDFzORGGWei5To1CN/ zrsqiaBpt6V9LKwdIgsPmErch0a5A3a5yHjwEsul2c3o5T+pfYfJIgv6qjmcP5fYJTdJ 8buwhlsxqMUtRzwj7T6GCCKemLRneugC8IVldkXDkFJgLKFkBJ1cTChYkPo8YoQuidNu JZZ03r2aV29VvjJmljarmzgT4bKLVzjMIUCG4GSRqO1of24Ez0ECPMf1XWNabmDTUaFD ruZUaam7+U9FS5vu8uZcGGsH9KuRuKyYkJlkr7B15Tot39oD4sivpj2ryXaOc2xgLbPv 3/CA== 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=2oj/RkpXIcAPwY3YCVzEeJhtiY5v3oKNvSYJvuwDEeY=; fh=OZQBfL75rC14cCDy3q+1fYHCs9KjWAQ7ZJ3hTfS+5lQ=; b=amFqnnP2BiH+SYtFbjjz30u9I5lZgANG4QwFG6UloG5mGC43zLDyfQfEFvbnH3zmPf tR0X0hh4hfZklCuo8KAExTd/x5HX/AyCmPAVpXHTW+iXl8SZm4/N1r+1mvo1h4B/XIRX HD+l3HFqy4EJTfNDmVVOvzF1mmEpcJIT5p+w+dLPD+/qvjoZEu6nCdr9m1idj3oSF8Ff GTMn/tVQ9BM2QLepwwuDuE2Ipje/V1dJP7V6GrsSOQAofMkQkC0fN1WACC9y9feiGq/V DubYiXdUjxUEm6zD1CwrYO8N4z7akYAl7ROGAJWmzs1naUCIBgVPS+UBvmrIIUx+F2Op LGYQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WRDiHQRO; 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-46782e8aae7si13291141cf.59.2024.12.10.08.20.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 08:20:35 -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=WRDiHQRO; 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 1tL2xU-0004Cf-3c; Tue, 10 Dec 2024 11:19: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 1tL2wk-0002nA-UI for qemu-devel@nongnu.org; Tue, 10 Dec 2024 11:18:52 -0500 Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL2wi-0006QE-Nj for qemu-devel@nongnu.org; Tue, 10 Dec 2024 11:18:50 -0500 Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-53df19bf6a9so6636850e87.1 for ; Tue, 10 Dec 2024 08:18:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733847527; x=1734452327; 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=2oj/RkpXIcAPwY3YCVzEeJhtiY5v3oKNvSYJvuwDEeY=; b=WRDiHQROX7lsGE37nSzhyfqPvTtkcpJw3/ZZmuX1YcmVgHYtX937lxNw/kpigcpCVB 49LvlYqevIJ93eDEU75tnRGMx3/oG6fu3affHN/qu0kvyEAAMgEONzGYUgEnIzSgSsBf p3Ukswb+7B7MxnobhsAfkjUxpcgtHMBA9XI8V/98B/gEQY5F/fWQIiV4Kjl94BeA4eqr ZdjlvqBQ/gn7boF7oFv83XtL3Kalzr9dOhMr0v17/vqxfQhxRyKPpS2Z7fy4z6JU7d4H 7bkcus7btl4GVFU6ZI+owVFkQ6rW9OUwDjnk64oDBU9dlZ89VSo57iMqaDwUUhv9KtWB 3Fiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733847527; x=1734452327; 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=2oj/RkpXIcAPwY3YCVzEeJhtiY5v3oKNvSYJvuwDEeY=; b=t6h6tL9h/yf0I6Z2UhPd6/6moG4+ykJiQzaA7yL1h99yH4KycAp/Z5hIWX0vxeWwa5 SvzEp9Ux02Lo0QzRWoNnO2qthH9Vo6q3mh+QEjG1fZinGkovExieQqhaefd+o+YgxUCI 1+OF+0a0nDZcMZiFV+8qNNhD259u7UiFwmvkU0LTt5El7WynUFq611g1i+RYJwn4FIXt MPY0vuA5KjRzyeFOtTNQED5lwarLwRmGKn30lOmJyiGk1pFPd4GlCAh/0or+OqOFNop8 sDpKvjnGeEKs2qrfGm7Of4Xo7ggBgyjCqOCOUtRsXY3YJEXB67lFts/g+KSp8GezAucf pahQ== X-Gm-Message-State: AOJu0YzSWX7sYwm0iOHDV/W4JRFo5j2B44sgDzqEmWy51ObKpCtJo1m1 JV2aHezlIOsmV6Xv1HD1i3RhO7LqAk/27iQPwLhTDLOeHTNqnNA3AVlEpQ0wgyFv+NImQbGFB2y nhsQWNGCh X-Gm-Gg: ASbGnctN+y+rpZ6/B1F/ZWGTWo8b4yqYmOumoUH/je6gIeI0NS9bJKgKJujikMaY3zd fPnVivGNP3BDJNTI+4+EtcIi3rIpTd/S+0tWAzJWxy6dDQ7oAgSD9XFMIds7MZQhjRhRGGn1E2J URejx09ZSnurKbLwXTvEJJPOnIYyMxRidCx38xVk53fcwLYWKUqWoCtXhaaGXr5ORrN/z9sotTK EwmTzQ7dD+ofSzd17TERbppmT7a1yCxdJ2ibOjMG8j2zXA66jkIQ+H8yVE= X-Received: by 2002:ac2:4e06:0:b0:540:2549:b56e with SMTP id 2adb3069b0e04-5402549b696mr1653248e87.12.1733847527037; Tue, 10 Dec 2024 08:18:47 -0800 (PST) Received: from stoup.. ([91.209.212.80]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53f93377eefsm1026343e87.67.2024.12.10.08.18.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 08:18:45 -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 16/69] target/arm: Convert RMIF to decodetree Date: Tue, 10 Dec 2024 10:16:40 -0600 Message-ID: <20241210161733.1830573-17-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::12f; envelope-from=richard.henderson@linaro.org; helo=mail-lf1-x12f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/arm/tcg/translate-a64.c | 32 +++++++++----------------------- target/arm/tcg/a64.decode | 3 +++ 2 files changed, 12 insertions(+), 23 deletions(-) diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index d7747fcf57..1af41e22eb 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; diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 7a40ca455e..454494742e 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)