From patchwork Wed Dec 11 16:29:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 849226 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp420744wry; Wed, 11 Dec 2024 08:33:44 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU7cuN9MlQ+qq8KqjrTNphKpZaUKPk/iVlXiMv4UEeZIzZK4Z348igJqht0bSDcEoLgrFpe3w==@linaro.org X-Google-Smtp-Source: AGHT+IGvo/x88BEmyj7026Dz0zFAwjZ+qSatpbyElkeLJs0bSMSImAA2tK9h954PV+09LeslnbmJ X-Received: by 2002:a05:622a:1e0e:b0:466:9f00:e766 with SMTP id d75a77b69052e-4678960e73emr57627171cf.24.1733934824345; Wed, 11 Dec 2024 08:33:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733934824; cv=none; d=google.com; s=arc-20240605; b=SneKNmnU+TKa3csAdquKRoglaKOSNJlKHFxGv2Olv0RSrtZWFfEHShk0B6sEU+p21V BAmVqQk0FmUAvq+VGFejaiH8iAnapluLbbA31TBjWkECxFqoPzfcwsW/JRYnaPWiYTbn +AsdJvcmKWTfppWIRCI1KbEPU7bn8cPGu9NCOz+6URTCBlzDTkqy2Gn+dwt/gbPLwlyX g1Aj3hOpG7nPjFk7Vu9Rc6U55PqUC/XNzcYFQCRHFCOCNsrwrNWeeLBtoQpHX5g23kKZ z8BtAKMoMXvhoFgGDjMmK/x0+UdQZUeiStjXNQyTII2LvktVvton4MqAEERfU4urVEwW 7x7w== 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=c0x9Gc+HY7Acd7tjUCgRB4Hjgq6m3aNyCYMpAkLJdVgqQiC4Zso8r0VMvWb0gSwCs0 ShsePOq9X9HNrObctxW/B+7OqVJWk3SBxbYGRpsGCDSCzsC/LMmdqbap3e5X6pk/g9IQ Rc00W5a1cwlH3B6go+aKgNrA4MIJgd0xxsqsJgv3N25stTgGoNJvL69cb0MHjCqlycHi i9ESkBar6n6dKWdA8V70eD2m0P3Xu6Nxxq5NFjAlLgaE6wGHV0xEhiUP2VxFU4G4fniV ZJ870V/evkGlz8Sb3QDpPoPFQYkVxgCBHl5Bh9pEkOlVSOdV0/wwmxHZuqWVZDXJshjq DRww==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=g4IArppN; 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-467896d5082si22614961cf.429.2024.12.11.08.33.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Dec 2024 08:33: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=g4IArppN; 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 1tLPdi-0007E6-Ef; Wed, 11 Dec 2024 11:32:43 -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 1tLPcj-0004T5-5d for qemu-devel@nongnu.org; Wed, 11 Dec 2024 11:31:46 -0500 Received: from mail-qt1-x833.google.com ([2607:f8b0:4864:20::833]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tLPch-0001Hd-8p for qemu-devel@nongnu.org; Wed, 11 Dec 2024 11:31:40 -0500 Received: by mail-qt1-x833.google.com with SMTP id d75a77b69052e-4675118f591so8195611cf.1 for ; Wed, 11 Dec 2024 08:31:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733934698; x=1734539498; 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=g4IArppNRNWFntlRyw3n+L73c8qmPsV2lnn/XKo3BQIJwj4pTgzYLd3ddBrLoNF2ts glrwtY5AakGgSu0Ht/DHy022UWMOGkDekJkbkCq7G/XkZznBcJmmsnr6Zje3GUimTkLG INBqT8LmFH/YDIWnIpOR9I7m4BF0Ep0d80l/4o9Cc1pDPAyAWkixH1ZP2OgNK4EjGaPf Q12aV804uyoU6jCKoOkjILWvs/rLv9mrT1zqSqzazT4lYsSE7Nt9bt5hLXNPGDsgexv1 fqJCwYLP2QPU/ymC3VaDJLbz7tTpwmS6Ja8af7UUUxhUNc3ei5+et6XOZB/3wAMKx/Sh H7/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733934698; x=1734539498; 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=IDNp8c9owZcT0mKrHeC+m/meWQO73O4hxkjUOBUII6zcZOpfgf10zOsnaGGQAXb/R3 XEKVIx2S0CumPsxGDHwnWT/dY+nXZjwEcEIamu2TzxSMfnbiKBjOYDrIZ3MfQ/ydhEu8 wj5/jMnqn8rnSnbfKZzbxCOSpz9JpF0XwRjygwU7pR6Oy0V+ZnpRN50ewhZhTFYHKgPd Un2WvXhGOBRPn43u1FQM5CLH8DtwfvXzODw3zMNR4IxOYhd669ydD/ArOVaxq1Xrhw6c U6vUjUmkgurVpFwzoeEOPe4kpSIf1oZ3uc2+j52NT+Ads3cCoMq+PrnxwJozop7HL6c+ ROQg== X-Gm-Message-State: AOJu0YxRDpUzmSkmR7ppOMSIjg9BnN1Zfybt0WD1GxlLlErIIMHk6HJY NPuNLNC4DCVoAuDg2rXyYAWq2WT0i7/iQE7TRaOI30BHMc0Xz1CT69EZBpSmneg19Z4RI7LH+Vm Ikuyl/ZhI X-Gm-Gg: ASbGnctgwYxJJBxZgOFya8omOlTI+GR2ntPkiuK2/3krWuYTTUMtKAgIrkS/8U1cJMX fA6NQi6s1TrMYrvflAjXjnopnHFK/SQnYup+0rxrOv7D9twxJi9JsPRdvuCwsrtmUsOjczdjzUB DRTqjf81sJe3PH0yHqgvBJN/XnXhByeXQzrUCY4J5EtPRIis1V8D4eSTUEH2Hc4/UvtlRDGAHNS 5jPazi+mcoRxI8Oe82nq4O3PUyYVyBcOE7uExy4CvYjPwXauYiTur6kYrUOWA== X-Received: by 2002:a05:622a:8c16:b0:467:7315:c63d with SMTP id d75a77b69052e-4678960e78amr53047251cf.23.1733934698344; Wed, 11 Dec 2024 08:31:38 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-46755db613csm43849381cf.70.2024.12.11.08.31.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Dec 2024 08:31:38 -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 v3 16/69] target/arm: Convert RMIF to decodetree Date: Wed, 11 Dec 2024 10:29:43 -0600 Message-ID: <20241211163036.2297116-17-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241211163036.2297116-1-richard.henderson@linaro.org> References: <20241211163036.2297116-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::833; envelope-from=richard.henderson@linaro.org; helo=mail-qt1-x833.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)