From nobody Mon Nov 25 12:15:53 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1714996036545510.03079087581546; Mon, 6 May 2024 04:47:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s3wmr-0002EW-N7; Mon, 06 May 2024 07:45:44 -0400 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 1s3wmU-0001q0-NJ for qemu-devel@nongnu.org; Mon, 06 May 2024 07:45:29 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s3wmL-0001t5-Rt for qemu-devel@nongnu.org; Mon, 06 May 2024 07:45:18 -0400 Received: from [2a00:23c4:8bb4:4000:b60d:a162:d698:c802] (helo=localhost.localdomain) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1s3wlC-0005pA-8v; Mon, 06 May 2024 12:44:02 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Iv0qu/DvouHMUWkJhrQofFhP1SlFQ9rAt+Y/ankr54U=; b=wzAmXBls+P8XEEE3Kc3Wdh5H5Q voHUvFR578+ssAmiTE6/yGKmwzGUoZ1iUfE9iiRAyF48aZWUHJFkLGhxKp3C3l+8FxlVMvORxkoxa y9cESB8oKjKerigqUdmGYcxD1ApZnagV8r1ZBl/MNH2oJzXf3rH6OGR7yNOsK8XfFf0tTc008/6Bh 8yiw6RvQgl74rvB/nIny8/MKnCVMITpbdQKhVOiSqFbNK6vTKj9LAofNtVSgKwmkowoV8a5P0Agcc RnmHlZnVLev3eWoIkPaetwDalTihvq/3QZJq8kPIMwp7+j3b79lI4GF4nqdYoA6nkHXxNlgaDNzbU az7mqV0JY29USIYCJHLWFyyXhHRCiCYzBuxMLNMm0Nt7fVMGaQhEsiHoNy4/G5BVTbBztweidr7tE qRsfmlyQsk2zpFnfFo5eyS6d1HLqqj+whJoRM4ULi+flNnm0S+mumVSFNqyW/wNh+JkkcZ1/K1wCz kSYZO7RsLO3LSsOCa2vYYYXFQ1fXH15zZ9B6+/yoCuQkO/PmhT/ageKxodZnMSntYS3vYWwfHrQqw 4wQvmWPSmJIESQrgJZD46HCiE1v/mNwM1uCSEYD0vqVZc/IT1mwkz+8BGYiu/4ojqXTLppazy4wSx P0TiVyWnfDi95Y+J9AI4VQaDWlu4hGoLOCUuE+K38=; From: Mark Cave-Ayland To: qemu-devel@nongnu.org, richard.henderson@linaro.org Date: Mon, 6 May 2024 12:44:40 +0100 Message-Id: <20240506114451.331311-2-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240506114451.331311-1-mark.cave-ayland@ilande.co.uk> References: <20240506114451.331311-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8bb4:4000:b60d:a162:d698:c802 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 01/12] target/sparc/cpu: Rename the CPU models with a "+" in their names X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1714996038391100003 Content-Type: text/plain; charset="utf-8" From: Thomas Huth Commit b447378e12 ("qom/object: Limit type names to alphanumerical ...") cut down the amount of allowed characters for QOM types to a saner set. The "+" character was meant to be included in this set, so we had to add a hack there to still allow the legacy names of POWER and Sparc64 CPUs. However, instead of putting such a hack in the common QOM code, there is a much better place to do this: The sparc_cpu_class_by_name() function which is used to look up the names of all Sparc CPUs. Thus let's finally get rid of the "+" in the Sparc CPU names, and provide backward compatibility for the old names via some simple checks in the sparc_cpu_class_by_name() function. Reviewed-by: Mark Cave-Ayland Signed-off-by: Thomas Huth Reviewed-by: Richard Henderson Message-Id: <20240419084812.504779-2-thuth@redhat.com> Signed-off-by: Mark Cave-Ayland --- qom/object.c | 8 -------- target/sparc/cpu.c | 14 ++++++++++++-- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/qom/object.c b/qom/object.c index 44ec8f6460..157a45c5f8 100644 --- a/qom/object.c +++ b/qom/object.c @@ -157,14 +157,6 @@ static bool type_name_is_valid(const char *name) "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "0123456789-_."); =20 - /* Allow some legacy names with '+' in it for compatibility reasons */ - if (name[plen] =3D=3D '+') { - if (plen >=3D 17 && g_str_has_prefix(name, "Sun-UltraSparc-I")) { - /* Allow "Sun-UltraSparc-IV+" and "Sun-UltraSparc-IIIi+" */ - return true; - } - } - return plen =3D=3D slen; } =20 diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index 485d416925..7487ae034d 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -314,7 +314,7 @@ static const sparc_def_t sparc_defs[] =3D { .features =3D CPU_DEFAULT_FEATURES, }, { - .name =3D "Sun UltraSparc IV+", + .name =3D "Sun UltraSparc IV plus", .iu_version =3D ((0x3eULL << 48) | (0x19ULL << 32) | (0x22ULL << 2= 4)), .fpu_version =3D 0x00000000, .mmu_version =3D mmu_us_12, @@ -323,7 +323,7 @@ static const sparc_def_t sparc_defs[] =3D { .features =3D CPU_DEFAULT_FEATURES | CPU_FEATURE_CMT, }, { - .name =3D "Sun UltraSparc IIIi+", + .name =3D "Sun UltraSparc IIIi plus", .iu_version =3D ((0x3eULL << 48) | (0x22ULL << 32) | (0ULL << 24)), .fpu_version =3D 0x00000000, .mmu_version =3D mmu_us_3, @@ -762,6 +762,16 @@ static ObjectClass *sparc_cpu_class_by_name(const char= *cpu_model) char *typename; =20 typename =3D sparc_cpu_type_name(cpu_model); + + /* Fix up legacy names with '+' in it */ + if (g_str_equal(typename, SPARC_CPU_TYPE_NAME("Sun-UltraSparc-IV+"))) { + g_free(typename); + typename =3D g_strdup(SPARC_CPU_TYPE_NAME("Sun-UltraSparc-IV-plus"= )); + } else if (g_str_equal(typename, SPARC_CPU_TYPE_NAME("Sun-UltraSparc-I= IIi+"))) { + g_free(typename); + typename =3D g_strdup(SPARC_CPU_TYPE_NAME("Sun-UltraSparc-IIIi-plu= s")); + } + oc =3D object_class_by_name(typename); g_free(typename); return oc; --=20 2.39.2 From nobody Mon Nov 25 12:15:53 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1714995942312310.7852738134252; Mon, 6 May 2024 04:45:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s3wmi-0001qu-BB; Mon, 06 May 2024 07:45:32 -0400 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 1s3wmT-0001pN-1R for qemu-devel@nongnu.org; Mon, 06 May 2024 07:45:17 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s3wmP-0001uF-9W for qemu-devel@nongnu.org; Mon, 06 May 2024 07:45:16 -0400 Received: from [2a00:23c4:8bb4:4000:b60d:a162:d698:c802] (helo=localhost.localdomain) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1s3wlG-0005pA-CI; Mon, 06 May 2024 12:44:06 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=DGPjem5TZdj3yuftXLL952yPWb/T1vMCWKCniZPKVMw=; b=N04jyO8lBiEj5rBY75154LdtLv o1BvRNoIueien5XKHlbv7c7vc+mKwpqzkcFYiAhNT3HxtreDbFelXSOHvimjXxKC7Bu6Jc+nx32NZ 2mfT5frf8t0ePPg9BaVJ42KZ9+aG1fcTzI45SX58Su9h8kNvGwfQSUVMqHWosiWqbt7O2VhtIPaiL 97xU7+xr5+8t7SNt0q9GWEDrpJ9gcufWv9WbnSgDpTdX8zO1B2pjL5S+lF+b8OYvzSsJj8N6dioCw cuBfKNDel6vztRDdxCpv0xhYflCbVVGK3iaxkRgyEn1rHBxX3BN3vimiUw3KK628gN41FiBznmq67 AmTXlw1Iw8F87JPOyMkspInIgCkgwm8OD4ZMjv4mFM1UPMx7RLdOZ+PsdfZForVF3SMdH008cQXV2 EhhsBHYVlH9zYryEzaDjOsilCN4F99xVgoK8pq9QTP+GHeELIbKuhGuDNZQSG7i0MzjsnoLsBwcJh +bogOPg9ZOlSA9CXcbeybqR41H46R2fbLfgtqDYg0LRhHFqpJH8SJGC/LXk5hdFGVOyvXYFGOa0li oETw0bhkfwu8YNMmEBWP8MdwUoxqnZ4aJps9iUjNkYoZ/REYInih1ajwTz/xktjNeLdMElIaS5DsZ 4Dhz8NzWVnQk2oJB1453GDB1N8TldP8NgkzMsjue8=; From: Mark Cave-Ayland To: qemu-devel@nongnu.org, richard.henderson@linaro.org Date: Mon, 6 May 2024 12:44:41 +0100 Message-Id: <20240506114451.331311-3-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240506114451.331311-1-mark.cave-ayland@ilande.co.uk> References: <20240506114451.331311-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8bb4:4000:b60d:a162:d698:c802 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 02/12] target/sparc/cpu: Avoid spaces by default in the CPU names X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1714995943948100003 Content-Type: text/plain; charset="utf-8" From: Thomas Huth The output of "-cpu help" is currently rather confusing to the users: It might not be fully clear which part of the output defines the CPU names since the CPU names contain white spaces (which we later have to convert into dashes internally). At best it's at least a nuisance since the users might need to specify the CPU names with quoting on the command line if they are not aware of the fact that the CPU names could be written with dashes instead. So let's finally clean up this mess by using dashes instead of white spaces for the CPU names, like we're doing it internally later (and like we're doing it in most other targets of QEMU). Note that it is still possible to pass the CPU names with spaces to the "-cpu" option, since sparc_cpu_type_name() still translates those to "-". Fixes: https://gitlab.com/qemu-project/qemu/-/issues/2141 Reviewed-by: Richard Henderson Reviewed-by: Mark Cave-Ayland Signed-off-by: Thomas Huth Message-Id: <20240419084812.504779-3-thuth@redhat.com> Signed-off-by: Mark Cave-Ayland --- target/sparc/cpu.c | 56 +++++++++++++++++++++++----------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index 7487ae034d..c2be4a00b6 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -206,7 +206,7 @@ void cpu_sparc_set_id(CPUSPARCState *env, unsigned int = cpu) static const sparc_def_t sparc_defs[] =3D { #ifdef TARGET_SPARC64 { - .name =3D "Fujitsu Sparc64", + .name =3D "Fujitsu-Sparc64", .iu_version =3D ((0x04ULL << 48) | (0x02ULL << 32) | (0ULL << 24)), .fpu_version =3D 0x00000000, .mmu_version =3D mmu_us_12, @@ -215,7 +215,7 @@ static const sparc_def_t sparc_defs[] =3D { .features =3D CPU_DEFAULT_FEATURES, }, { - .name =3D "Fujitsu Sparc64 III", + .name =3D "Fujitsu-Sparc64-III", .iu_version =3D ((0x04ULL << 48) | (0x03ULL << 32) | (0ULL << 24)), .fpu_version =3D 0x00000000, .mmu_version =3D mmu_us_12, @@ -224,7 +224,7 @@ static const sparc_def_t sparc_defs[] =3D { .features =3D CPU_DEFAULT_FEATURES, }, { - .name =3D "Fujitsu Sparc64 IV", + .name =3D "Fujitsu-Sparc64-IV", .iu_version =3D ((0x04ULL << 48) | (0x04ULL << 32) | (0ULL << 24)), .fpu_version =3D 0x00000000, .mmu_version =3D mmu_us_12, @@ -233,7 +233,7 @@ static const sparc_def_t sparc_defs[] =3D { .features =3D CPU_DEFAULT_FEATURES, }, { - .name =3D "Fujitsu Sparc64 V", + .name =3D "Fujitsu-Sparc64-V", .iu_version =3D ((0x04ULL << 48) | (0x05ULL << 32) | (0x51ULL << 2= 4)), .fpu_version =3D 0x00000000, .mmu_version =3D mmu_us_12, @@ -242,7 +242,7 @@ static const sparc_def_t sparc_defs[] =3D { .features =3D CPU_DEFAULT_FEATURES, }, { - .name =3D "TI UltraSparc I", + .name =3D "TI-UltraSparc-I", .iu_version =3D ((0x17ULL << 48) | (0x10ULL << 32) | (0x40ULL << 2= 4)), .fpu_version =3D 0x00000000, .mmu_version =3D mmu_us_12, @@ -251,7 +251,7 @@ static const sparc_def_t sparc_defs[] =3D { .features =3D CPU_DEFAULT_FEATURES, }, { - .name =3D "TI UltraSparc II", + .name =3D "TI-UltraSparc-II", .iu_version =3D ((0x17ULL << 48) | (0x11ULL << 32) | (0x20ULL << 2= 4)), .fpu_version =3D 0x00000000, .mmu_version =3D mmu_us_12, @@ -260,7 +260,7 @@ static const sparc_def_t sparc_defs[] =3D { .features =3D CPU_DEFAULT_FEATURES, }, { - .name =3D "TI UltraSparc IIi", + .name =3D "TI-UltraSparc-IIi", .iu_version =3D ((0x17ULL << 48) | (0x12ULL << 32) | (0x91ULL << 2= 4)), .fpu_version =3D 0x00000000, .mmu_version =3D mmu_us_12, @@ -269,7 +269,7 @@ static const sparc_def_t sparc_defs[] =3D { .features =3D CPU_DEFAULT_FEATURES, }, { - .name =3D "TI UltraSparc IIe", + .name =3D "TI-UltraSparc-IIe", .iu_version =3D ((0x17ULL << 48) | (0x13ULL << 32) | (0x14ULL << 2= 4)), .fpu_version =3D 0x00000000, .mmu_version =3D mmu_us_12, @@ -278,7 +278,7 @@ static const sparc_def_t sparc_defs[] =3D { .features =3D CPU_DEFAULT_FEATURES, }, { - .name =3D "Sun UltraSparc III", + .name =3D "Sun-UltraSparc-III", .iu_version =3D ((0x3eULL << 48) | (0x14ULL << 32) | (0x34ULL << 2= 4)), .fpu_version =3D 0x00000000, .mmu_version =3D mmu_us_12, @@ -287,7 +287,7 @@ static const sparc_def_t sparc_defs[] =3D { .features =3D CPU_DEFAULT_FEATURES, }, { - .name =3D "Sun UltraSparc III Cu", + .name =3D "Sun-UltraSparc-III-Cu", .iu_version =3D ((0x3eULL << 48) | (0x15ULL << 32) | (0x41ULL << 2= 4)), .fpu_version =3D 0x00000000, .mmu_version =3D mmu_us_3, @@ -296,7 +296,7 @@ static const sparc_def_t sparc_defs[] =3D { .features =3D CPU_DEFAULT_FEATURES, }, { - .name =3D "Sun UltraSparc IIIi", + .name =3D "Sun-UltraSparc-IIIi", .iu_version =3D ((0x3eULL << 48) | (0x16ULL << 32) | (0x34ULL << 2= 4)), .fpu_version =3D 0x00000000, .mmu_version =3D mmu_us_12, @@ -305,7 +305,7 @@ static const sparc_def_t sparc_defs[] =3D { .features =3D CPU_DEFAULT_FEATURES, }, { - .name =3D "Sun UltraSparc IV", + .name =3D "Sun-UltraSparc-IV", .iu_version =3D ((0x3eULL << 48) | (0x18ULL << 32) | (0x31ULL << 2= 4)), .fpu_version =3D 0x00000000, .mmu_version =3D mmu_us_4, @@ -314,7 +314,7 @@ static const sparc_def_t sparc_defs[] =3D { .features =3D CPU_DEFAULT_FEATURES, }, { - .name =3D "Sun UltraSparc IV plus", + .name =3D "Sun-UltraSparc-IV-plus", .iu_version =3D ((0x3eULL << 48) | (0x19ULL << 32) | (0x22ULL << 2= 4)), .fpu_version =3D 0x00000000, .mmu_version =3D mmu_us_12, @@ -323,7 +323,7 @@ static const sparc_def_t sparc_defs[] =3D { .features =3D CPU_DEFAULT_FEATURES | CPU_FEATURE_CMT, }, { - .name =3D "Sun UltraSparc IIIi plus", + .name =3D "Sun-UltraSparc-IIIi-plus", .iu_version =3D ((0x3eULL << 48) | (0x22ULL << 32) | (0ULL << 24)), .fpu_version =3D 0x00000000, .mmu_version =3D mmu_us_3, @@ -332,7 +332,7 @@ static const sparc_def_t sparc_defs[] =3D { .features =3D CPU_DEFAULT_FEATURES, }, { - .name =3D "Sun UltraSparc T1", + .name =3D "Sun-UltraSparc-T1", /* defined in sparc_ifu_fdp.v and ctu.h */ .iu_version =3D ((0x3eULL << 48) | (0x23ULL << 32) | (0x02ULL << 2= 4)), .fpu_version =3D 0x00000000, @@ -343,7 +343,7 @@ static const sparc_def_t sparc_defs[] =3D { | CPU_FEATURE_GL, }, { - .name =3D "Sun UltraSparc T2", + .name =3D "Sun-UltraSparc-T2", /* defined in tlu_asi_ctl.v and n2_revid_cust.v */ .iu_version =3D ((0x3eULL << 48) | (0x24ULL << 32) | (0x02ULL << 2= 4)), .fpu_version =3D 0x00000000, @@ -354,7 +354,7 @@ static const sparc_def_t sparc_defs[] =3D { | CPU_FEATURE_GL, }, { - .name =3D "NEC UltraSparc I", + .name =3D "NEC-UltraSparc-I", .iu_version =3D ((0x22ULL << 48) | (0x10ULL << 32) | (0x40ULL << 2= 4)), .fpu_version =3D 0x00000000, .mmu_version =3D mmu_us_12, @@ -364,7 +364,7 @@ static const sparc_def_t sparc_defs[] =3D { }, #else { - .name =3D "Fujitsu MB86904", + .name =3D "Fujitsu-MB86904", .iu_version =3D 0x04 << 24, /* Impl 0, ver 4 */ .fpu_version =3D 4 << FSR_VER_SHIFT, /* FPU version 4 (Meiko) */ .mmu_version =3D 0x04 << 24, /* Impl 0, ver 4 */ @@ -377,7 +377,7 @@ static const sparc_def_t sparc_defs[] =3D { .features =3D CPU_DEFAULT_FEATURES, }, { - .name =3D "Fujitsu MB86907", + .name =3D "Fujitsu-MB86907", .iu_version =3D 0x05 << 24, /* Impl 0, ver 5 */ .fpu_version =3D 4 << FSR_VER_SHIFT, /* FPU version 4 (Meiko) */ .mmu_version =3D 0x05 << 24, /* Impl 0, ver 5 */ @@ -390,7 +390,7 @@ static const sparc_def_t sparc_defs[] =3D { .features =3D CPU_DEFAULT_FEATURES, }, { - .name =3D "TI MicroSparc I", + .name =3D "TI-MicroSparc-I", .iu_version =3D 0x41000000, .fpu_version =3D 4 << FSR_VER_SHIFT, .mmu_version =3D 0x41000000, @@ -403,7 +403,7 @@ static const sparc_def_t sparc_defs[] =3D { .features =3D CPU_FEATURE_MUL | CPU_FEATURE_DIV, }, { - .name =3D "TI MicroSparc II", + .name =3D "TI-MicroSparc-II", .iu_version =3D 0x42000000, .fpu_version =3D 4 << FSR_VER_SHIFT, .mmu_version =3D 0x02000000, @@ -416,7 +416,7 @@ static const sparc_def_t sparc_defs[] =3D { .features =3D CPU_DEFAULT_FEATURES, }, { - .name =3D "TI MicroSparc IIep", + .name =3D "TI-MicroSparc-IIep", .iu_version =3D 0x42000000, .fpu_version =3D 4 << FSR_VER_SHIFT, .mmu_version =3D 0x04000000, @@ -429,7 +429,7 @@ static const sparc_def_t sparc_defs[] =3D { .features =3D CPU_DEFAULT_FEATURES, }, { - .name =3D "TI SuperSparc 40", /* STP1020NPGA */ + .name =3D "TI-SuperSparc-40", /* STP1020NPGA */ .iu_version =3D 0x41000000, /* SuperSPARC 2.x */ .fpu_version =3D 0 << FSR_VER_SHIFT, .mmu_version =3D 0x00000800, /* SuperSPARC 2.x, no MXCC */ @@ -442,7 +442,7 @@ static const sparc_def_t sparc_defs[] =3D { .features =3D CPU_DEFAULT_FEATURES, }, { - .name =3D "TI SuperSparc 50", /* STP1020PGA */ + .name =3D "TI-SuperSparc-50", /* STP1020PGA */ .iu_version =3D 0x40000000, /* SuperSPARC 3.x */ .fpu_version =3D 0 << FSR_VER_SHIFT, .mmu_version =3D 0x01000800, /* SuperSPARC 3.x, no MXCC */ @@ -455,7 +455,7 @@ static const sparc_def_t sparc_defs[] =3D { .features =3D CPU_DEFAULT_FEATURES, }, { - .name =3D "TI SuperSparc 51", + .name =3D "TI-SuperSparc-51", .iu_version =3D 0x40000000, /* SuperSPARC 3.x */ .fpu_version =3D 0 << FSR_VER_SHIFT, .mmu_version =3D 0x01000000, /* SuperSPARC 3.x, MXCC */ @@ -469,7 +469,7 @@ static const sparc_def_t sparc_defs[] =3D { .features =3D CPU_DEFAULT_FEATURES, }, { - .name =3D "TI SuperSparc 60", /* STP1020APGA */ + .name =3D "TI-SuperSparc-60", /* STP1020APGA */ .iu_version =3D 0x40000000, /* SuperSPARC 3.x */ .fpu_version =3D 0 << FSR_VER_SHIFT, .mmu_version =3D 0x01000800, /* SuperSPARC 3.x, no MXCC */ @@ -482,7 +482,7 @@ static const sparc_def_t sparc_defs[] =3D { .features =3D CPU_DEFAULT_FEATURES, }, { - .name =3D "TI SuperSparc 61", + .name =3D "TI-SuperSparc-61", .iu_version =3D 0x44000000, /* SuperSPARC 3.x */ .fpu_version =3D 0 << FSR_VER_SHIFT, .mmu_version =3D 0x01000000, /* SuperSPARC 3.x, MXCC */ @@ -496,7 +496,7 @@ static const sparc_def_t sparc_defs[] =3D { .features =3D CPU_DEFAULT_FEATURES, }, { - .name =3D "TI SuperSparc II", + .name =3D "TI-SuperSparc-II", .iu_version =3D 0x40000000, /* SuperSPARC II 1.x */ .fpu_version =3D 0 << FSR_VER_SHIFT, .mmu_version =3D 0x08000000, /* SuperSPARC II 1.x, MXCC */ --=20 2.39.2 From nobody Mon Nov 25 12:15:53 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1714995992627616.2163929567309; Mon, 6 May 2024 04:46:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s3wmq-0002BI-0z; Mon, 06 May 2024 07:45:41 -0400 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 1s3wmU-0001q2-Rb for qemu-devel@nongnu.org; Mon, 06 May 2024 07:45:29 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s3wmT-0001vE-0a for qemu-devel@nongnu.org; Mon, 06 May 2024 07:45:18 -0400 Received: from [2a00:23c4:8bb4:4000:b60d:a162:d698:c802] (helo=localhost.localdomain) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1s3wlK-0005pA-IZ; Mon, 06 May 2024 12:44:10 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=f5kowjNmM1V5Tw1z4x5IIe927kwIc/2zGVQMsZgVWG0=; b=vnISCjbuclUVCrzuPgfCO+xolc T0vgyR1B7O1aeZy3mCaXE+evDfMBgIYGiLV6bhgrx0sX9PcMKT1Dh8IBy9yefSfqzJPByGkMuqC44 lw3vK2SF4SaPm1FvlIg3As0tPuTi6BvQyUyVqnJxeMv04ppqIVWlxgS1sRCqJcjU0eEoAawwc9ny6 OLgNL0NG99/2YaTKU6td22VDJwqeLxOKN5R+hK8F+kCLKpkEvJ3Uvbz8iJvOO0AfQ6ItsOcA7Eoye WopxzVliKHU5eXqezSYhsstpJ972BGyZLnl1/O+h1Zr5S/FXjuOSLmeIDRiyvL6nirGKuTYLSH9w7 TOhWa0c8n+bIvuPunvG1h0o6EsUUzP2/A+0+rJ/nVIH8ZhfbCty/5Qhg+7sF2+jkvycGkFb+6+295 kKMasWs/mFTUj3fuEXmyXpeb3bplt4eUKaDgv9X9KOxItiLXk7BUkfzX//2NFhx9KxLJo6/pmNu5h 3z2H6jOVgZM7vNMAyil94v36l6duLQ1bULGzdVoVez5CU5uMX1IhfLIuDe04/ZxbvrNcqisPa5voA 6Yec2z0DBQVvhryiXQNpnOCX9S1boNSOToaNI+4bHZdX1+HBrYEbMBhSLOAsb8xdMxBL8vxQu2HRm ILqKBlKCZSWqI0pdUXG7mAlmQkj3dl2hv06ReWTbs=; From: Mark Cave-Ayland To: qemu-devel@nongnu.org, richard.henderson@linaro.org Date: Mon, 6 May 2024 12:44:42 +0100 Message-Id: <20240506114451.331311-4-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240506114451.331311-1-mark.cave-ayland@ilande.co.uk> References: <20240506114451.331311-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8bb4:4000:b60d:a162:d698:c802 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 03/12] docs/system/target-sparc: Improve the Sparc documentation X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1714995994195100003 Content-Type: text/plain; charset="utf-8" From: Thomas Huth Add some words about how to enable or disable boolean features, and remove the note about a Linux kernel being available on the QEMU website (they have been removed long ago already), and the note about NetBSD and OpenBSD still having issues (they should work fine nowadays). Fixes: https://gitlab.com/qemu-project/qemu/-/issues/2141 Signed-off-by: Thomas Huth Reviewed-by: Mark Cave-Ayland Reviewed-by: Richard Henderson Message-Id: <20240419084812.504779-4-thuth@redhat.com> Signed-off-by: Mark Cave-Ayland --- docs/system/target-sparc.rst | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/system/target-sparc.rst b/docs/system/target-sparc.rst index 9ec8c90c14..4116cac493 100644 --- a/docs/system/target-sparc.rst +++ b/docs/system/target-sparc.rst @@ -27,6 +27,11 @@ architecture machines: The emulation is somewhat complete. SMP up to 16 CPUs is supported, but Linux limits the number of usable CPUs to 4. =20 +The list of available CPUs can be viewed by starting QEMU with ``-cpu help= ``. +Optional boolean features can be added with a "+" in front of the feature = name, +or disabled with a "-" in front of the name, for example +``-cpu TI-SuperSparc-II,+float128``. + QEMU emulates the following sun4m peripherals: =20 - IOMMU @@ -55,8 +60,5 @@ OpenBIOS is a free (GPL v2) portable firmware implementat= ion. The goal is to implement a 100% IEEE 1275-1994 (referred to as Open Firmware) compliant firmware. =20 -A sample Linux 2.6 series kernel and ram disk image are available on the -QEMU web site. There are still issues with NetBSD and OpenBSD, but most -kernel versions work. Please note that currently older Solaris kernels -don't work probably due to interface issues between OpenBIOS and -Solaris. +Please note that currently older Solaris kernels don't work; this is proba= bly +due to interface issues between OpenBIOS and Solaris. --=20 2.39.2 From nobody Mon Nov 25 12:15:53 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 171499597270449.77564499200753; Mon, 6 May 2024 04:46:12 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s3wmq-0002BG-0Y; Mon, 06 May 2024 07:45:41 -0400 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 1s3wmZ-0001rI-18 for qemu-devel@nongnu.org; Mon, 06 May 2024 07:45:29 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s3wmW-0001vv-MY for qemu-devel@nongnu.org; Mon, 06 May 2024 07:45:22 -0400 Received: from [2a00:23c4:8bb4:4000:b60d:a162:d698:c802] (helo=localhost.localdomain) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1s3wlO-0005pA-Ow; Mon, 06 May 2024 12:44:14 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=WY+P13fomWYQhB4vSdw0hSoUKVFP4d5TPh/QOK/Wn/k=; b=K9ZPkyZsqvYWsK2zaLTiGRAzig 2kHrJhq6lbY0E0+hiJz58crO/lMtfjCOpfg/p6f/vnYGh6LkHwDKZTAqK/xLAZytkA9inA8NCxTvc TRtxJ1698Mp5Y4vM3ojy1fEXLn0epgwdQwG0JONECIe6pCLiZ1vab/Feqc47tBmUpyERYSi/FUo/N PdyHzfHu7xqUITND5F8N4UerS9ulXb+MtOCG6seMiXF/0HBujrf/ETbAXxIEKJuj+jB6cPl+TSSKw zFP0h6gx+c0ar9evMF9mJ31oebfKFoKBiHz7jbBGtPkdf4sY0/AfmSrgdapXE5pnhfKabBFShGvzE JmMT9KpG6kSZMPzPn22vTpL7MHaj04lN/SrB0VZbu7Fzl5Ltl7cndqACJ5MDX7FIYkrAPI4euY1K9 firCKmaE/CUiizsyXYkkq5Pz+tf3IdZyWNiibkqYKROSgtaazrVEsmP1UBgQms1KD5b0LA49FjfXf KoS1awX5F53FAJvxF4S5vYDm7yJd9XUvLJq7ZmPsSnRWICL0w2u8qMI1umE42KLHrZAsbhvAPaOwO 3n1viGiofnVRfDOXH52/rizDMJBN5wNWhvy2LMzHrv5NqdE2rK9jMZg0SyZWmgkUuXxKXdKqCpQVR pTmvJa3qwkMvpXZxkEtfU3a6MF0Z9BGMmNXq+UHvQ=; From: Mark Cave-Ayland To: qemu-devel@nongnu.org, richard.henderson@linaro.org Date: Mon, 6 May 2024 12:44:43 +0100 Message-Id: <20240506114451.331311-5-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240506114451.331311-1-mark.cave-ayland@ilande.co.uk> References: <20240506114451.331311-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8bb4:4000:b60d:a162:d698:c802 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 04/12] docs/about: Deprecate the old "UltraSparc" CPU names that contain a "+" X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1714995974068100003 From: Thomas Huth For consistency we should drop the names with a "+" in it in the long run. Reviewed-by: Mark Cave-Ayland Signed-off-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20240419084812.504779-5-thuth@redhat.com> Signed-off-by: Mark Cave-Ayland --- docs/about/deprecated.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 7b8aafa15b..03f8b1b655 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -194,6 +194,15 @@ in the QEMU object model anymore. ``power5+``, ``power= 5+_v2.1``, an alias, but for consistency these will get removed in a future release, too. Use ``power5p_v2.1`` and ``power7p_v2.1`` instead. =20 +``Sun-UltraSparc-IIIi+`` and ``Sun-UltraSparc-IV+`` CPU names (since 9.1) +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + +The character "+" in device (and thus also CPU) names is not allowed +in the QEMU object model anymore. ``Sun-UltraSparc-IIIi+`` and +``Sun-UltraSparc-IV+`` are currently still supported via a workaround, +but for consistency these will get removed in a future release, too. +Use ``Sun-UltraSparc-IIIi-plus`` and ``Sun-UltraSparc-IV-plus`` instead. + CRIS CPU architecture (since 9.0) ''''''''''''''''''''''''''''''''' =20 --=20 2.39.2 From nobody Mon Nov 25 12:15:53 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1714996053805607.2233538365925; Mon, 6 May 2024 04:47:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s3woY-0003tb-7C; Mon, 06 May 2024 07:47:27 -0400 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 1s3wmd-0001zc-FV for qemu-devel@nongnu.org; Mon, 06 May 2024 07:45:30 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s3wmb-00020C-RZ for qemu-devel@nongnu.org; Mon, 06 May 2024 07:45:27 -0400 Received: from [2a00:23c4:8bb4:4000:b60d:a162:d698:c802] (helo=localhost.localdomain) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1s3wlS-0005pA-Eq; Mon, 06 May 2024 12:44:18 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=RdZxbvcd9Ww/IUgTe96WN9PtS1C0KS34Ir6CDMqHT3w=; b=eSLEXoiEeyU6/sSFs/Rl2fZDRM HPDH85q9hKY9+gzyehL8F0rfjMiHVYVHMQqwOO69fmc/oTZ4eKywwtjWE1FBYkjtBTOnJvHhvRZZZ 08g/IqedpWspxer5c7I6U8qNf11KtAD2UMqNAza/dY0s1Dwp2DP9RK193JDXRujDaj0Y4afmLiRhn ZauWIrkiJ8KH34cmB2IkGrqBTGoRMXFJuxGwXofAX1q81KCex6PxlV2b4e+RZsf+hDNSPSY5kPZJp d1hAowwQE+cTMylGzoy+TXhsAwH+K8WtYRMdRDrYjyDPlWPxQVvuKuMc8qeMr4g9ZM6CaD8t2ph87 iFvLGqxq+ywGbMzFh8QUN5tqh8ANl+wcnDVVlvvMtwcH4PybN341ZQn5Mv8lamuZm0OsMkIj3DdQr /7+F9dKRLF382YlB2pCpzfaxoWlSU7YouwKDfP/npTeR6b0Y/9vrSUikK9ZMh7YM6i9eamlqttnKF DKkeugapNv00Kb7k+5gQn1KuiLIiWaE1ywMnnv9ZZNmnQDcoFBf1Li2/FKJtt/M6NsqgX9NArBjEJ jAJLa5wt9lo5efnvI6bUFfFLthC42a5VC00nK+hdoX5gg3l2AhXLUh1Ye0roTBhTxiWxQdHUn+sfi 0jQakl7E2eiobiJOpHHoOiSnd0sZMyLtH7BQ0YvTo=; From: Mark Cave-Ayland To: qemu-devel@nongnu.org, richard.henderson@linaro.org Date: Mon, 6 May 2024 12:44:44 +0100 Message-Id: <20240506114451.331311-6-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240506114451.331311-1-mark.cave-ayland@ilande.co.uk> References: <20240506114451.331311-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8bb4:4000:b60d:a162:d698:c802 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 05/12] hw/sparc64: set iommu_platform=on for virtio devices attached to the sun4u machine X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1714996054499100001 Content-Type: text/plain; charset="utf-8" The sun4u machine has an IOMMU and therefore it is possible to program it s= uch that the virtio-device IOVA does not map directly to the CPU physical addre= ss. This is not a problem with Linux which always maps the IOVA directly to the= CPU physical address, however it is required for the NetBSD virtio driver where= this is not the case. Set the sun4u machine defaults for all virtio devices so that disable-legac= y=3Don and iommu_platform=3Don to ensure a default configuration will allow virtio devices to function correctly on both Linux and NetBSD. Signed-off-by: Mark Cave-Ayland Message-Id: <20240418205730.31396-1-mark.cave-ayland@ilande.co.uk> Signed-off-by: Mark Cave-Ayland --- hw/sparc64/sun4u.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index cff6d5abaf..4ece1ac1ff 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -793,6 +793,12 @@ static void sun4v_init(MachineState *machine) sun4uv_init(get_system_memory(), machine, &hwdefs[1]); } =20 +static GlobalProperty hw_compat_sparc64[] =3D { + { "virtio-pci", "disable-legacy", "on", .optional =3D true }, + { "virtio-device", "iommu_platform", "on" }, +}; +static const size_t hw_compat_sparc64_len =3D G_N_ELEMENTS(hw_compat_sparc= 64); + static void sun4u_class_init(ObjectClass *oc, void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); @@ -810,6 +816,7 @@ static void sun4u_class_init(ObjectClass *oc, void *dat= a) mc->default_nic =3D "sunhme"; mc->no_parallel =3D !module_object_class_by_name(TYPE_ISA_PARALLEL); fwc->get_dev_path =3D sun4u_fw_dev_path; + compat_props_add(mc->compat_props, hw_compat_sparc64, hw_compat_sparc6= 4_len); } =20 static const TypeInfo sun4u_type =3D { --=20 2.39.2 From nobody Mon Nov 25 12:15:53 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1714996002644189.64587685947845; Mon, 6 May 2024 04:46:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s3wnY-0002wy-2z; Mon, 06 May 2024 07:46:29 -0400 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 1s3wmg-00020j-GH for qemu-devel@nongnu.org; Mon, 06 May 2024 07:45:31 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s3wme-00020u-WD for qemu-devel@nongnu.org; Mon, 06 May 2024 07:45:30 -0400 Received: from [2a00:23c4:8bb4:4000:b60d:a162:d698:c802] (helo=localhost.localdomain) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1s3wlW-0005pA-LF; Mon, 06 May 2024 12:44:22 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=EefT7v8rE+Ga47+Z+jrlLQY0Rn8dnOkk3WD8JQbXUh8=; b=Bym6Utbz9yzPXMJYkK/+VPcqYp CefB2UmBuSYuuTdrAsCN40cRj1QcD9ZtJ8EQ1qUmC8YiLz3kQunxcISWFYbMoFQqku9n6F6dT5HIS GmKFiLFlsC93n3Pw4F+fzkKct16jW7aYQg5Y1UcMBPo3NK/s1jpQbN3gJgdk0wtKdM3zlUT2bAh2W OW8J0GF+ZUf3qFG+UUkz1VgBt75POMUNZX1fjeeR/MXqe3SDBhRkmzg9bdSs8iu+nTB9/zcsO+tqT Lrv3Y4lQjdqACS4veEuoEQOJ/2FDojPrsHEOnTrkO83SOx4vC7zCxYjLaEryNK12y96Yb+8hMHGuD KGFdB45Oiq46B/yvxYpm4yA/qYmZV2myqmvCXkNtphxuA6oHuJj7o2lL5SJrmVA21LnqlDBVcY2U6 iPfD5U7GwyPcz0OizTfEqXgJ7OLK+PShx8Xak6pUUHuCJtUT4rd4qS04rKhdj1Br7ciQaKwswVg1v ghc/svQg8EWBMxzs4Loy6hvcvtKpofbh12FenhonsqERaTzaUIyIA4qmqh3ixztYHx/eZk5arM4SF ifngjUIDcVJF7c4MBrXy/N6tcSQYcihPdh/w0U9yxpkBN5t0Uud0OAwbOoxUxu9YvR5VgB4n+0cxF I/Qer9+HDRDVjVRRF36oFAVtACOi8Yqmul1MPIAXU=; From: Mark Cave-Ayland To: qemu-devel@nongnu.org, richard.henderson@linaro.org Date: Mon, 6 May 2024 12:44:45 +0100 Message-Id: <20240506114451.331311-7-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240506114451.331311-1-mark.cave-ayland@ilande.co.uk> References: <20240506114451.331311-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8bb4:4000:b60d:a162:d698:c802 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 06/12] linux-user/sparc: Add more hwcap bits for sparc64 X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1714996004230100003 Content-Type: text/plain; charset="utf-8" From: Richard Henderson Supply HWCAP_SPARC_V8PLUS, HWCAP_SPARC_MUL32, HWCAP_SPARC_DIV32, HWCAP_SPARC_POPC, HWCAP_SPARC_FSMULD, HWCAP_SPARC_VIS, HWCAP_SPARC_VIS2. Signed-off-by: Richard Henderson Message-Id: <20240502165528.244004-2-richard.henderson@linaro.org> Signed-off-by: Mark Cave-Ayland --- linux-user/elfload.c | 48 +++++++++++++++++++++++++++++++------------- 1 file changed, 34 insertions(+), 14 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index f9461d2844..14f08b64a1 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -968,24 +968,44 @@ const char *elf_hwcap2_str(uint32_t bit) #endif /* TARGET_ARM */ =20 #ifdef TARGET_SPARC -#ifdef TARGET_SPARC64 =20 -#define ELF_HWCAP (HWCAP_SPARC_FLUSH | HWCAP_SPARC_STBAR | HWCAP_SPARC_SW= AP \ - | HWCAP_SPARC_MULDIV | HWCAP_SPARC_V9) -#ifndef TARGET_ABI32 -#define elf_check_arch(x) ( (x) =3D=3D EM_SPARCV9 || (x) =3D=3D EM_SPARC32= PLUS ) +#ifndef TARGET_SPARC64 +# define ELF_CLASS ELFCLASS32 +# define ELF_ARCH EM_SPARC +#elif defined(TARGET_ABI32) +# define ELF_CLASS ELFCLASS32 +# define elf_check_arch(x) ((x) =3D=3D EM_SPARC32PLUS || (x) =3D=3D EM_SPA= RC) #else -#define elf_check_arch(x) ( (x) =3D=3D EM_SPARC32PLUS || (x) =3D=3D EM_SPA= RC ) +# define ELF_CLASS ELFCLASS64 +# define ELF_ARCH EM_SPARCV9 #endif =20 -#define ELF_CLASS ELFCLASS64 -#define ELF_ARCH EM_SPARCV9 -#else -#define ELF_HWCAP (HWCAP_SPARC_FLUSH | HWCAP_SPARC_STBAR | HWCAP_SPARC_SW= AP \ - | HWCAP_SPARC_MULDIV) -#define ELF_CLASS ELFCLASS32 -#define ELF_ARCH EM_SPARC -#endif /* TARGET_SPARC64 */ +#include "elf.h" + +#define ELF_HWCAP get_elf_hwcap() + +static uint32_t get_elf_hwcap(void) +{ + /* There are not many sparc32 hwcap bits -- we have all of them. */ + uint32_t r =3D HWCAP_SPARC_FLUSH | HWCAP_SPARC_STBAR | + HWCAP_SPARC_SWAP | HWCAP_SPARC_MULDIV; + +#ifdef TARGET_SPARC64 + CPUSPARCState *env =3D cpu_env(thread_cpu); + uint32_t features =3D env->def.features; + + r |=3D HWCAP_SPARC_V9 | HWCAP_SPARC_V8PLUS; + /* 32x32 multiply and divide are efficient. */ + r |=3D HWCAP_SPARC_MUL32 | HWCAP_SPARC_DIV32; + /* We don't have an internal feature bit for this. */ + r |=3D HWCAP_SPARC_POPC; + r |=3D features & CPU_FEATURE_FSMULD ? HWCAP_SPARC_FSMULD : 0; + r |=3D features & CPU_FEATURE_VIS1 ? HWCAP_SPARC_VIS : 0; + r |=3D features & CPU_FEATURE_VIS2 ? HWCAP_SPARC_VIS2 : 0; +#endif + + return r; +} =20 static inline void init_thread(struct target_pt_regs *regs, struct image_info *infop) --=20 2.39.2 From nobody Mon Nov 25 12:15:53 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1714996053946112.43923370387733; Mon, 6 May 2024 04:47:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s3wnd-0002yg-Bt; Mon, 06 May 2024 07:46:37 -0400 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 1s3wml-00028t-3x for qemu-devel@nongnu.org; Mon, 06 May 2024 07:45:38 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s3wmj-00023M-9k for qemu-devel@nongnu.org; Mon, 06 May 2024 07:45:34 -0400 Received: from [2a00:23c4:8bb4:4000:b60d:a162:d698:c802] (helo=localhost.localdomain) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1s3wla-0005pA-OL; Mon, 06 May 2024 12:44:26 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=sMhmJO5kyFUJkf58pFSFv2atNJSSrYfDJkwhEX27jSY=; b=nW9k4wvkivfJUu5+V32rAczZ2P +/7EPKtAjkjUEqwTb8jGnYySbJixBhVcgfC0/CNZ2g5IOnqlvi+9JzKi0R+W1lepkZ+GfAJFX0iHR nJU8Pbohj1egCRD/dipFSCZAr2a7a3t45HL7zEPCr1Mj+gPFh6XLRPoVNGLBIDPbUJsGmbMdMrM4w 4xzC1oolOERiknKqs/QiLwszDl0IOpJ4MQaLXMZaaNtwFYXNWi4Lnd8zFT2mbpY7BYsjS8zHLdQFd XkS5eSROOIpgcSoxP6yFCXdxDL4Ycx2UHWBDg89Rt73c8orLUMbOa5Jh3NQFdQB1UYvNqbKWKAtqC rWzaymlHYQpnfLjPKBWrT2SoV23PtU0eo2C2hPOYRtI4MSgQhVR2pdFPTAsbcP6XVNibQHuo/0/ug XyzySncr2LC/9A1HTrCLJLn9J5Nu9sjPpzl0N70EEathfs9iW4tuKWWQJkhLNwTe6i/mjruLrgEZR pUmMWviqZSfQODqwMdosgbtm7Pv883MRFQoUqNAI0NeUVpWNYj/aMGU67TM6agjlBCSM+p+r5gUXJ qnrkEM6G3LHVzwkNpGN1zlgMCO+VSVmU45sSiVnMpHJ5Z6sLZ4Yp520G7BY4LpwyqKk1UcBOcMi8+ 90Iqz5sUcibgUBk89jDB2lB1QZHqMzGvsF7XuitRw=; From: Mark Cave-Ayland To: qemu-devel@nongnu.org, richard.henderson@linaro.org Date: Mon, 6 May 2024 12:44:46 +0100 Message-Id: <20240506114451.331311-8-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240506114451.331311-1-mark.cave-ayland@ilande.co.uk> References: <20240506114451.331311-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8bb4:4000:b60d:a162:d698:c802 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 07/12] target/sparc: Fix FEXPAND X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1714996054515100002 From: Richard Henderson This is a 2-operand instruction, not 3-operand. Worse, we took the source from the wrong operand. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20240502165528.244004-3-richard.henderson@linaro.org> Signed-off-by: Mark Cave-Ayland --- target/sparc/helper.h | 2 +- target/sparc/insns.decode | 2 +- target/sparc/translate.c | 20 +++++++++++++++++++- target/sparc/vis_helper.c | 6 +++--- 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/target/sparc/helper.h b/target/sparc/helper.h index b8087d0d2b..57ab755ffd 100644 --- a/target/sparc/helper.h +++ b/target/sparc/helper.h @@ -102,7 +102,7 @@ DEF_HELPER_FLAGS_2(fmul8sux16, TCG_CALL_NO_RWG_SE, i64,= i64, i64) DEF_HELPER_FLAGS_2(fmul8ulx16, TCG_CALL_NO_RWG_SE, i64, i64, i64) DEF_HELPER_FLAGS_2(fmuld8sux16, TCG_CALL_NO_RWG_SE, i64, i64, i64) DEF_HELPER_FLAGS_2(fmuld8ulx16, TCG_CALL_NO_RWG_SE, i64, i64, i64) -DEF_HELPER_FLAGS_2(fexpand, TCG_CALL_NO_RWG_SE, i64, i64, i64) +DEF_HELPER_FLAGS_1(fexpand, TCG_CALL_NO_RWG_SE, i64, i32) DEF_HELPER_FLAGS_3(pdist, TCG_CALL_NO_RWG_SE, i64, i64, i64, i64) DEF_HELPER_FLAGS_2(fpack16, TCG_CALL_NO_RWG_SE, i32, i64, i64) DEF_HELPER_FLAGS_3(fpack32, TCG_CALL_NO_RWG_SE, i64, i64, i64, i64) diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index 2d26404cb2..e2d8a07dc4 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -352,7 +352,7 @@ FCMPEq 10 000 cc:2 110101 rs1:5 0 0101 0111 rs2:5 FALIGNDATAg 10 ..... 110110 ..... 0 0100 1000 ..... @r_r_r FPMERGE 10 ..... 110110 ..... 0 0100 1011 ..... @r_r_r BSHUFFLE 10 ..... 110110 ..... 0 0100 1100 ..... @r_r_r - FEXPAND 10 ..... 110110 ..... 0 0100 1101 ..... @r_r_r + FEXPAND 10 ..... 110110 00000 0 0100 1101 ..... @r_r2 =20 FSRCd 10 ..... 110110 ..... 0 0111 0100 00000 @r_r1 # FSRC1d FSRCs 10 ..... 110110 ..... 0 0111 0101 00000 @r_r1 # FSRC1s diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 571b3e3f03..dfcfe855a1 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -4358,6 +4358,25 @@ TRANS(FSQRTd, ALL, do_env_dd, a, gen_helper_fsqrtd) TRANS(FxTOd, 64, do_env_dd, a, gen_helper_fxtod) TRANS(FdTOx, 64, do_env_dd, a, gen_helper_fdtox) =20 +static bool do_df(DisasContext *dc, arg_r_r *a, + void (*func)(TCGv_i64, TCGv_i32)) +{ + TCGv_i64 dst; + TCGv_i32 src; + + if (gen_trap_ifnofpu(dc)) { + return true; + } + + dst =3D tcg_temp_new_i64(); + src =3D gen_load_fpr_F(dc, a->rs); + func(dst, src); + gen_store_fpr_D(dc, a->rd, dst); + return advance_pc(dc); +} + +TRANS(FEXPAND, VIS1, do_df, a, gen_helper_fexpand) + static bool do_env_df(DisasContext *dc, arg_r_r *a, void (*func)(TCGv_i64, TCGv_env, TCGv_i32)) { @@ -4589,7 +4608,6 @@ TRANS(FMUL8ULx16, VIS1, do_ddd, a, gen_helper_fmul8ul= x16) TRANS(FMULD8SUx16, VIS1, do_ddd, a, gen_helper_fmuld8sux16) TRANS(FMULD8ULx16, VIS1, do_ddd, a, gen_helper_fmuld8ulx16) TRANS(FPMERGE, VIS1, do_ddd, a, gen_helper_fpmerge) -TRANS(FEXPAND, VIS1, do_ddd, a, gen_helper_fexpand) =20 TRANS(FPADD16, VIS1, do_ddd, a, tcg_gen_vec_add16_i64) TRANS(FPADD32, VIS1, do_ddd, a, tcg_gen_vec_add32_i64) diff --git a/target/sparc/vis_helper.c b/target/sparc/vis_helper.c index 7763b16c24..db2e6dd6c1 100644 --- a/target/sparc/vis_helper.c +++ b/target/sparc/vis_helper.c @@ -260,13 +260,13 @@ uint64_t helper_fmuld8ulx16(uint64_t src1, uint64_t s= rc2) return d.ll; } =20 -uint64_t helper_fexpand(uint64_t src1, uint64_t src2) +uint64_t helper_fexpand(uint32_t src2) { VIS32 s; VIS64 d; =20 - s.l =3D (uint32_t)src1; - d.ll =3D src2; + s.l =3D src2; + d.ll =3D 0; d.VIS_W64(0) =3D s.VIS_B32(0) << 4; d.VIS_W64(1) =3D s.VIS_B32(1) << 4; d.VIS_W64(2) =3D s.VIS_B32(2) << 4; --=20 2.39.2 From nobody Mon Nov 25 12:15:53 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1714996056604242.16713018987616; Mon, 6 May 2024 04:47:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s3woT-0003eq-SV; Mon, 06 May 2024 07:47:25 -0400 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 1s3wms-0002Hv-6M for qemu-devel@nongnu.org; Mon, 06 May 2024 07:45:44 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s3wmn-00024u-8v for qemu-devel@nongnu.org; Mon, 06 May 2024 07:45:41 -0400 Received: from [2a00:23c4:8bb4:4000:b60d:a162:d698:c802] (helo=localhost.localdomain) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1s3wle-0005pA-RQ; Mon, 06 May 2024 12:44:30 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Y5M4mmYouEfYYTQYVwtEst5GlagcgUaUVsX9+atwWag=; b=1iwXMLliFz1iZ7jZX7STosT1/h H8rWdYsYmUaBxDyuR+i5VTzQMzG9A+HalnfRiUZrFd1ftcb9doeb1Vg0l5ddAA/5LSFbBpep6SFgD UOZB7Hm2Qwn2Ht8oeCTnV5SR22wApFRqXfOsK4blCsFFYQYWDh2TBNt7KTt9YzUur1lCdAEFzT8YL P0Sdzq0WtltPorQFRMjjdgkabpm2O8mGQDezoDzZosM6OZxF9+L3iBvUHrtPdOr2j8uAunaRFSN3J ornR2Z0qcp5/RtwPgxb4MNfb7yoOco1jWyc5U22tL58XIAMnVQvnQd6LcXNgTK0W8zHV9/fnaaDPw WufwGBGBY221Dq+siYxVuh+LNJJ+HJSQXknBSIVEqeSkTURfpkoPWldGP07pcm2TOHBPH9LeUA9Vj vJYMYUfvBONt+zzkpaSS0uZlv7IotuphSG6n3TruhjZUoV2qiHUfqGfPJ4AWo6N4YsWtdJaM66xAJ 0SR6XiwWde3mmJTjfR96M8OIWasufILf9uEnXotANwJDK41lsG1LBWzai+B7kjb8JsEDsSVeYSkY1 WxBVSrZcUf71f8FgJOuChkBN4fuMW8PUniJs1qLJ9O4bLzRIjL3J4LZvgrexL8d1oacT+lg2jMIRl mjVjauCcdWuK+nkg4beOp7XHhmKGE1y7OJMOOFWqw=; From: Mark Cave-Ayland To: qemu-devel@nongnu.org, richard.henderson@linaro.org Date: Mon, 6 May 2024 12:44:47 +0100 Message-Id: <20240506114451.331311-9-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240506114451.331311-1-mark.cave-ayland@ilande.co.uk> References: <20240506114451.331311-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8bb4:4000:b60d:a162:d698:c802 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 08/12] target/sparc: Fix FMUL8x16 X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk 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_PASS=-0.001, T_SPF_HELO_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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1714996058438100011 From: Richard Henderson This instruction has f32 as source1, which alters the decoding of the register number, which means we've been passing the wrong data for odd register numbers. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20240502165528.244004-4-richard.henderson@linaro.org> Signed-off-by: Mark Cave-Ayland --- target/sparc/helper.h | 2 +- target/sparc/translate.c | 21 ++++++++++++++++++++- target/sparc/vis_helper.c | 9 +++++---- 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/target/sparc/helper.h b/target/sparc/helper.h index 57ab755ffd..27dc604cac 100644 --- a/target/sparc/helper.h +++ b/target/sparc/helper.h @@ -95,7 +95,7 @@ DEF_HELPER_FLAGS_2(fdtox, TCG_CALL_NO_WG, s64, env, f64) DEF_HELPER_FLAGS_2(fqtox, TCG_CALL_NO_WG, s64, env, i128) =20 DEF_HELPER_FLAGS_2(fpmerge, TCG_CALL_NO_RWG_SE, i64, i64, i64) -DEF_HELPER_FLAGS_2(fmul8x16, TCG_CALL_NO_RWG_SE, i64, i64, i64) +DEF_HELPER_FLAGS_2(fmul8x16, TCG_CALL_NO_RWG_SE, i64, i32, i64) DEF_HELPER_FLAGS_2(fmul8x16al, TCG_CALL_NO_RWG_SE, i64, i64, i64) DEF_HELPER_FLAGS_2(fmul8x16au, TCG_CALL_NO_RWG_SE, i64, i64, i64) DEF_HELPER_FLAGS_2(fmul8sux16, TCG_CALL_NO_RWG_SE, i64, i64, i64) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index dfcfe855a1..c4adc148d2 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -4583,6 +4583,26 @@ TRANS(FSUBs, ALL, do_env_fff, a, gen_helper_fsubs) TRANS(FMULs, ALL, do_env_fff, a, gen_helper_fmuls) TRANS(FDIVs, ALL, do_env_fff, a, gen_helper_fdivs) =20 +static bool do_dfd(DisasContext *dc, arg_r_r_r *a, + void (*func)(TCGv_i64, TCGv_i32, TCGv_i64)) +{ + TCGv_i64 dst, src2; + TCGv_i32 src1; + + if (gen_trap_ifnofpu(dc)) { + return true; + } + + dst =3D gen_dest_fpr_D(dc, a->rd); + src1 =3D gen_load_fpr_F(dc, a->rs1); + src2 =3D gen_load_fpr_D(dc, a->rs2); + func(dst, src1, src2); + gen_store_fpr_D(dc, a->rd, dst); + return advance_pc(dc); +} + +TRANS(FMUL8x16, VIS1, do_dfd, a, gen_helper_fmul8x16) + static bool do_ddd(DisasContext *dc, arg_r_r_r *a, void (*func)(TCGv_i64, TCGv_i64, TCGv_i64)) { @@ -4600,7 +4620,6 @@ static bool do_ddd(DisasContext *dc, arg_r_r_r *a, return advance_pc(dc); } =20 -TRANS(FMUL8x16, VIS1, do_ddd, a, gen_helper_fmul8x16) TRANS(FMUL8x16AU, VIS1, do_ddd, a, gen_helper_fmul8x16au) TRANS(FMUL8x16AL, VIS1, do_ddd, a, gen_helper_fmul8x16al) TRANS(FMUL8SUx16, VIS1, do_ddd, a, gen_helper_fmul8sux16) diff --git a/target/sparc/vis_helper.c b/target/sparc/vis_helper.c index db2e6dd6c1..7728ffe9c6 100644 --- a/target/sparc/vis_helper.c +++ b/target/sparc/vis_helper.c @@ -94,16 +94,17 @@ uint64_t helper_fpmerge(uint64_t src1, uint64_t src2) return d.ll; } =20 -uint64_t helper_fmul8x16(uint64_t src1, uint64_t src2) +uint64_t helper_fmul8x16(uint32_t src1, uint64_t src2) { - VIS64 s, d; + VIS64 d; + VIS32 s; uint32_t tmp; =20 - s.ll =3D src1; + s.l =3D src1; d.ll =3D src2; =20 #define PMUL(r) \ - tmp =3D (int32_t)d.VIS_SW64(r) * (int32_t)s.VIS_B64(r); \ + tmp =3D (int32_t)d.VIS_SW64(r) * (int32_t)s.VIS_B32(r); \ if ((tmp & 0xff) > 0x7f) { \ tmp +=3D 0x100; \ } \ --=20 2.39.2 From nobody Mon Nov 25 12:15:53 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1714996062384838.8142013111957; Mon, 6 May 2024 04:47:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s3woe-0004Rr-Jc; Mon, 06 May 2024 07:47:34 -0400 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 1s3wnD-0002bH-JW for qemu-devel@nongnu.org; Mon, 06 May 2024 07:46:05 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s3wmr-00025S-FA for qemu-devel@nongnu.org; Mon, 06 May 2024 07:45:43 -0400 Received: from [2a00:23c4:8bb4:4000:b60d:a162:d698:c802] (helo=localhost.localdomain) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1s3wli-0005pA-UL; Mon, 06 May 2024 12:44:35 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=WavmyVT0W+fmmIs670leuexf31sAnaVVyxTdQUL0QZU=; b=xxNFWUKaGq5YMCRqybi5uHCo+B SpOhZTRK7FCaN0CXjKCn8rfdVGkJR4ukMSC0hZka5DTzwVVNGCRWLvFflXjclfeBTsiGfvD2+Gqei E372VDStxz2gCF5daUhZ3Rx+QjdK/n4pm5nynbaZI1vTfbQSs2BQ2dwwkTwfW0mFZ9XtoaN3GKp1F JW4/Pcy2+4EJDYMeaAZxtB9d0Szpaa+OZ7Lf4LKw4rxKzAfS0DOf22tK1GQFmyZb1DGkSVBe48BMN wXIJDoiX4Y+OJ9l9x2kLbsD9/BlNOx7dZf+UJ/998PdZSKTPSErlKXVkacTGzYy9EAwDgbvjUyanH FNtzh1pMbV31OsmoKPS8iLn/pE2dpSY7k41Re1Q5z8yDiqp4r4M+ZIhvxrlNCoY/EtwTIOij0VUJc Ro3ID/+QqHFknquOeSOpK2ZSCrlDwF0KMcaGweVd/hQV75diwlnw4qHzsUalY0TCdR9RMbM1KCVf4 PxMyAdkbNHbsJhrQlWr4+3UPsuWwfYjbriEIb/E5KD66bPuAUBAeRvg/TfX1PNAB1ax7vEary1ZYU X9HgekWKQlvf6ctzoMTBQBbi5HFZmz/rhUAQMM52H6HVbJ5TF2iHb8Uzxrq175/XgaqvSkfkljkVm v78Ba0e5WYZg24ObYTTCswgpuLBb+tGlfUBcsNdyE=; From: Mark Cave-Ayland To: qemu-devel@nongnu.org, richard.henderson@linaro.org Date: Mon, 6 May 2024 12:44:48 +0100 Message-Id: <20240506114451.331311-10-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240506114451.331311-1-mark.cave-ayland@ilande.co.uk> References: <20240506114451.331311-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8bb4:4000:b60d:a162:d698:c802 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 09/12] target/sparc: Fix FMUL8x16A{U,L} X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1714996064484100003 From: Richard Henderson These instructions have f32 inputs, which changes the decode of the register numbers. While we're fixing things, use a common helper for both insns, extracting the 16-bit scalar in tcg beforehand. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20240502165528.244004-5-richard.henderson@linaro.org> Signed-off-by: Mark Cave-Ayland --- target/sparc/helper.h | 3 +-- target/sparc/translate.c | 38 +++++++++++++++++++++++++++---- target/sparc/vis_helper.c | 47 +++++++++++---------------------------- 3 files changed, 48 insertions(+), 40 deletions(-) diff --git a/target/sparc/helper.h b/target/sparc/helper.h index 27dc604cac..9cde2b69a5 100644 --- a/target/sparc/helper.h +++ b/target/sparc/helper.h @@ -96,8 +96,7 @@ DEF_HELPER_FLAGS_2(fqtox, TCG_CALL_NO_WG, s64, env, i128) =20 DEF_HELPER_FLAGS_2(fpmerge, TCG_CALL_NO_RWG_SE, i64, i64, i64) DEF_HELPER_FLAGS_2(fmul8x16, TCG_CALL_NO_RWG_SE, i64, i32, i64) -DEF_HELPER_FLAGS_2(fmul8x16al, TCG_CALL_NO_RWG_SE, i64, i64, i64) -DEF_HELPER_FLAGS_2(fmul8x16au, TCG_CALL_NO_RWG_SE, i64, i64, i64) +DEF_HELPER_FLAGS_2(fmul8x16a, TCG_CALL_NO_RWG_SE, i64, i32, s32) DEF_HELPER_FLAGS_2(fmul8sux16, TCG_CALL_NO_RWG_SE, i64, i64, i64) DEF_HELPER_FLAGS_2(fmul8ulx16, TCG_CALL_NO_RWG_SE, i64, i64, i64) DEF_HELPER_FLAGS_2(fmuld8sux16, TCG_CALL_NO_RWG_SE, i64, i64, i64) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index c4adc148d2..a8ada6934a 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -45,6 +45,7 @@ # define gen_helper_clear_softint(E, S) qemu_build_not_reached() # define gen_helper_done(E) qemu_build_not_reached() # define gen_helper_flushw(E) qemu_build_not_reached() +# define gen_helper_fmul8x16a(D, S1, S2) qemu_build_not_reached() # define gen_helper_rdccr(D, E) qemu_build_not_reached() # define gen_helper_rdcwp(D, E) qemu_build_not_reached() # define gen_helper_restored(E) qemu_build_not_reached() @@ -72,8 +73,6 @@ # define gen_helper_fexpand ({ qemu_build_not_reached(); NULL= ; }) # define gen_helper_fmul8sux16 ({ qemu_build_not_reached(); NULL= ; }) # define gen_helper_fmul8ulx16 ({ qemu_build_not_reached(); NULL= ; }) -# define gen_helper_fmul8x16al ({ qemu_build_not_reached(); NULL= ; }) -# define gen_helper_fmul8x16au ({ qemu_build_not_reached(); NULL= ; }) # define gen_helper_fmul8x16 ({ qemu_build_not_reached(); NULL= ; }) # define gen_helper_fmuld8sux16 ({ qemu_build_not_reached(); NULL= ; }) # define gen_helper_fmuld8ulx16 ({ qemu_build_not_reached(); NULL= ; }) @@ -719,6 +718,18 @@ static void gen_op_bshuffle(TCGv_i64 dst, TCGv_i64 src= 1, TCGv_i64 src2) #endif } =20 +static void gen_op_fmul8x16al(TCGv_i64 dst, TCGv_i32 src1, TCGv_i32 src2) +{ + tcg_gen_ext16s_i32(src2, src2); + gen_helper_fmul8x16a(dst, src1, src2); +} + +static void gen_op_fmul8x16au(TCGv_i64 dst, TCGv_i32 src1, TCGv_i32 src2) +{ + tcg_gen_sari_i32(src2, src2, 16); + gen_helper_fmul8x16a(dst, src1, src2); +} + static void finishing_insn(DisasContext *dc) { /* @@ -4583,6 +4594,27 @@ TRANS(FSUBs, ALL, do_env_fff, a, gen_helper_fsubs) TRANS(FMULs, ALL, do_env_fff, a, gen_helper_fmuls) TRANS(FDIVs, ALL, do_env_fff, a, gen_helper_fdivs) =20 +static bool do_dff(DisasContext *dc, arg_r_r_r *a, + void (*func)(TCGv_i64, TCGv_i32, TCGv_i32)) +{ + TCGv_i64 dst; + TCGv_i32 src1, src2; + + if (gen_trap_ifnofpu(dc)) { + return true; + } + + dst =3D gen_dest_fpr_D(dc, a->rd); + src1 =3D gen_load_fpr_F(dc, a->rs1); + src2 =3D gen_load_fpr_F(dc, a->rs2); + func(dst, src1, src2); + gen_store_fpr_D(dc, a->rd, dst); + return advance_pc(dc); +} + +TRANS(FMUL8x16AU, VIS1, do_dff, a, gen_op_fmul8x16au) +TRANS(FMUL8x16AL, VIS1, do_dff, a, gen_op_fmul8x16al) + static bool do_dfd(DisasContext *dc, arg_r_r_r *a, void (*func)(TCGv_i64, TCGv_i32, TCGv_i64)) { @@ -4620,8 +4652,6 @@ static bool do_ddd(DisasContext *dc, arg_r_r_r *a, return advance_pc(dc); } =20 -TRANS(FMUL8x16AU, VIS1, do_ddd, a, gen_helper_fmul8x16au) -TRANS(FMUL8x16AL, VIS1, do_ddd, a, gen_helper_fmul8x16al) TRANS(FMUL8SUx16, VIS1, do_ddd, a, gen_helper_fmul8sux16) TRANS(FMUL8ULx16, VIS1, do_ddd, a, gen_helper_fmul8ulx16) TRANS(FMULD8SUx16, VIS1, do_ddd, a, gen_helper_fmuld8sux16) diff --git a/target/sparc/vis_helper.c b/target/sparc/vis_helper.c index 7728ffe9c6..ff2f43c23f 100644 --- a/target/sparc/vis_helper.c +++ b/target/sparc/vis_helper.c @@ -119,44 +119,23 @@ uint64_t helper_fmul8x16(uint32_t src1, uint64_t src2) return d.ll; } =20 -uint64_t helper_fmul8x16al(uint64_t src1, uint64_t src2) +uint64_t helper_fmul8x16a(uint32_t src1, int32_t src2) { - VIS64 s, d; - uint32_t tmp; - - s.ll =3D src1; - d.ll =3D src2; - -#define PMUL(r) \ - tmp =3D (int32_t)d.VIS_SW64(1) * (int32_t)s.VIS_B64(r); \ - if ((tmp & 0xff) > 0x7f) { \ - tmp +=3D 0x100; \ - } \ - d.VIS_W64(r) =3D tmp >> 8; - - PMUL(0); - PMUL(1); - PMUL(2); - PMUL(3); -#undef PMUL - - return d.ll; -} - -uint64_t helper_fmul8x16au(uint64_t src1, uint64_t src2) -{ - VIS64 s, d; + VIS32 s; + VIS64 d; uint32_t tmp; =20 - s.ll =3D src1; - d.ll =3D src2; + s.l =3D src1; + d.ll =3D 0; =20 -#define PMUL(r) \ - tmp =3D (int32_t)d.VIS_SW64(0) * (int32_t)s.VIS_B64(r); \ - if ((tmp & 0xff) > 0x7f) { \ - tmp +=3D 0x100; \ - } \ - d.VIS_W64(r) =3D tmp >> 8; +#define PMUL(r) \ + do { \ + tmp =3D src2 * (int32_t)s.VIS_B32(r); \ + if ((tmp & 0xff) > 0x7f) { \ + tmp +=3D 0x100; \ + } \ + d.VIS_W64(r) =3D tmp >> 8; \ + } while (0) =20 PMUL(0); PMUL(1); --=20 2.39.2 From nobody Mon Nov 25 12:15:53 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1714996145754228.836485499873; Mon, 6 May 2024 04:49:05 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s3wok-0004fG-F7; Mon, 06 May 2024 07:47:38 -0400 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 1s3wnD-0002bI-IU for qemu-devel@nongnu.org; Mon, 06 May 2024 07:46:05 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s3wmr-00025W-SR for qemu-devel@nongnu.org; Mon, 06 May 2024 07:45:43 -0400 Received: from [2a00:23c4:8bb4:4000:b60d:a162:d698:c802] (helo=localhost.localdomain) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1s3wln-0005pA-4f; Mon, 06 May 2024 12:44:35 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=NVY+DInK6e9c7Rfod3udmjYDPm6WHRlbkoobfpkday0=; b=AJJfiv620T+8S/6UmLQL8dX5L3 LWIi3XFQaE4CVpHBRpTH4KWo8uE0cTa9Qt8S8za5yfdxdEYC9eWFpAzxHd2Hi79p6t72oug3fjr9w b4vLuNe5VX+vwd9fghk48jYaBWIcCPGkOnF+/pLD2u5ld55k6Q/Ow5U8GkEKpMLLcpPviST+4vGrR pu0I2grH/QJlpEUgiwqyqTliIKMjunORuDWGOZjaQIxhLjU1/3zfyxpaeZ/wGWs0PmvOrg8hp51x6 I+IHBVz8sutSHdGGjxBWqn0aZ9HA77DgiZsdQHnuoLZFA5ah7uZzM9YhiuU8v2KG/tiPgbEDJrNw7 Lpint4/dCE6miLddt/1IRzgW6Lo4ev/vGAK6Tc01/JjJ340n6cVCQj692mT0DnxSI2hDVXXvl0CSh V6j9xacGJBH09a5vOBEKuryIfB1KPMyn0pWQlDh5ziah5rPgCPF3SxV8Y8AxXMgHYL5HD/v+SlO7f U/3lyqSjZhbMREwikicg9Y418H5+TbKMzlQpYM8EwKIIxDuHlChEas3wmUEvR/M3W1MR8ygwHL4wr puS7K6P2iMt4DKEb9XTq8RsLirnkZ2wThaz1bMh2MTnAJ4M4Xs8C4Ism78SnWHwdvFYQ7KjJNVA/6 eb4enEojEkL6f7GgZ7yQ0eabYP1olFuF6jFWohEn8=; From: Mark Cave-Ayland To: qemu-devel@nongnu.org, richard.henderson@linaro.org Date: Mon, 6 May 2024 12:44:49 +0100 Message-Id: <20240506114451.331311-11-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240506114451.331311-1-mark.cave-ayland@ilande.co.uk> References: <20240506114451.331311-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8bb4:4000:b60d:a162:d698:c802 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 10/12] target/sparc: Fix FMULD8*X16 X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1714996147052100003 Content-Type: text/plain; charset="utf-8" From: Richard Henderson Not only do these instructions have f32 inputs, they also do not perform rounding. Since these are relatively simple, implement them properly inline. Signed-off-by: Richard Henderson Message-Id: <20240502165528.244004-6-richard.henderson@linaro.org> Signed-off-by: Mark Cave-Ayland --- target/sparc/helper.h | 2 -- target/sparc/translate.c | 48 +++++++++++++++++++++++++++++++++++---- target/sparc/vis_helper.c | 46 ------------------------------------- 3 files changed, 44 insertions(+), 52 deletions(-) diff --git a/target/sparc/helper.h b/target/sparc/helper.h index 9cde2b69a5..fcb9c617b7 100644 --- a/target/sparc/helper.h +++ b/target/sparc/helper.h @@ -99,8 +99,6 @@ DEF_HELPER_FLAGS_2(fmul8x16, TCG_CALL_NO_RWG_SE, i64, i32= , i64) DEF_HELPER_FLAGS_2(fmul8x16a, TCG_CALL_NO_RWG_SE, i64, i32, s32) DEF_HELPER_FLAGS_2(fmul8sux16, TCG_CALL_NO_RWG_SE, i64, i64, i64) DEF_HELPER_FLAGS_2(fmul8ulx16, TCG_CALL_NO_RWG_SE, i64, i64, i64) -DEF_HELPER_FLAGS_2(fmuld8sux16, TCG_CALL_NO_RWG_SE, i64, i64, i64) -DEF_HELPER_FLAGS_2(fmuld8ulx16, TCG_CALL_NO_RWG_SE, i64, i64, i64) DEF_HELPER_FLAGS_1(fexpand, TCG_CALL_NO_RWG_SE, i64, i32) DEF_HELPER_FLAGS_3(pdist, TCG_CALL_NO_RWG_SE, i64, i64, i64, i64) DEF_HELPER_FLAGS_2(fpack16, TCG_CALL_NO_RWG_SE, i32, i64, i64) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index a8ada6934a..8a2894bb9f 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -74,8 +74,6 @@ # define gen_helper_fmul8sux16 ({ qemu_build_not_reached(); NULL= ; }) # define gen_helper_fmul8ulx16 ({ qemu_build_not_reached(); NULL= ; }) # define gen_helper_fmul8x16 ({ qemu_build_not_reached(); NULL= ; }) -# define gen_helper_fmuld8sux16 ({ qemu_build_not_reached(); NULL= ; }) -# define gen_helper_fmuld8ulx16 ({ qemu_build_not_reached(); NULL= ; }) # define gen_helper_fpmerge ({ qemu_build_not_reached(); NULL= ; }) # define gen_helper_fqtox ({ qemu_build_not_reached(); NULL= ; }) # define gen_helper_fstox ({ qemu_build_not_reached(); NULL= ; }) @@ -730,6 +728,48 @@ static void gen_op_fmul8x16au(TCGv_i64 dst, TCGv_i32 s= rc1, TCGv_i32 src2) gen_helper_fmul8x16a(dst, src1, src2); } =20 +static void gen_op_fmuld8ulx16(TCGv_i64 dst, TCGv_i32 src1, TCGv_i32 src2) +{ + TCGv_i32 t0 =3D tcg_temp_new_i32(); + TCGv_i32 t1 =3D tcg_temp_new_i32(); + TCGv_i32 t2 =3D tcg_temp_new_i32(); + + tcg_gen_ext8u_i32(t0, src1); + tcg_gen_ext16s_i32(t1, src2); + tcg_gen_mul_i32(t0, t0, t1); + + tcg_gen_extract_i32(t1, src1, 16, 8); + tcg_gen_sextract_i32(t2, src2, 16, 16); + tcg_gen_mul_i32(t1, t1, t2); + + tcg_gen_concat_i32_i64(dst, t0, t1); +} + +static void gen_op_fmuld8sux16(TCGv_i64 dst, TCGv_i32 src1, TCGv_i32 src2) +{ + TCGv_i32 t0 =3D tcg_temp_new_i32(); + TCGv_i32 t1 =3D tcg_temp_new_i32(); + TCGv_i32 t2 =3D tcg_temp_new_i32(); + + /* + * The insn description talks about extracting the upper 8 bits + * of the signed 16-bit input rs1, performing the multiply, then + * shifting left by 8 bits. Instead, zap the lower 8 bits of + * the rs1 input, which avoids the need for two shifts. + */ + tcg_gen_ext16s_i32(t0, src1); + tcg_gen_andi_i32(t0, t0, ~0xff); + tcg_gen_ext16s_i32(t1, src2); + tcg_gen_mul_i32(t0, t0, t1); + + tcg_gen_sextract_i32(t1, src1, 16, 16); + tcg_gen_andi_i32(t1, t1, ~0xff); + tcg_gen_sextract_i32(t2, src2, 16, 16); + tcg_gen_mul_i32(t1, t1, t2); + + tcg_gen_concat_i32_i64(dst, t0, t1); +} + static void finishing_insn(DisasContext *dc) { /* @@ -4614,6 +4654,8 @@ static bool do_dff(DisasContext *dc, arg_r_r_r *a, =20 TRANS(FMUL8x16AU, VIS1, do_dff, a, gen_op_fmul8x16au) TRANS(FMUL8x16AL, VIS1, do_dff, a, gen_op_fmul8x16al) +TRANS(FMULD8SUx16, VIS1, do_dff, a, gen_op_fmuld8sux16) +TRANS(FMULD8ULx16, VIS1, do_dff, a, gen_op_fmuld8ulx16) =20 static bool do_dfd(DisasContext *dc, arg_r_r_r *a, void (*func)(TCGv_i64, TCGv_i32, TCGv_i64)) @@ -4654,8 +4696,6 @@ static bool do_ddd(DisasContext *dc, arg_r_r_r *a, =20 TRANS(FMUL8SUx16, VIS1, do_ddd, a, gen_helper_fmul8sux16) TRANS(FMUL8ULx16, VIS1, do_ddd, a, gen_helper_fmul8ulx16) -TRANS(FMULD8SUx16, VIS1, do_ddd, a, gen_helper_fmuld8sux16) -TRANS(FMULD8ULx16, VIS1, do_ddd, a, gen_helper_fmuld8ulx16) TRANS(FPMERGE, VIS1, do_ddd, a, gen_helper_fpmerge) =20 TRANS(FPADD16, VIS1, do_ddd, a, tcg_gen_vec_add16_i64) diff --git a/target/sparc/vis_helper.c b/target/sparc/vis_helper.c index ff2f43c23f..61c61c7fea 100644 --- a/target/sparc/vis_helper.c +++ b/target/sparc/vis_helper.c @@ -194,52 +194,6 @@ uint64_t helper_fmul8ulx16(uint64_t src1, uint64_t src= 2) return d.ll; } =20 -uint64_t helper_fmuld8sux16(uint64_t src1, uint64_t src2) -{ - VIS64 s, d; - uint32_t tmp; - - s.ll =3D src1; - d.ll =3D src2; - -#define PMUL(r) \ - tmp =3D (int32_t)d.VIS_SW64(r) * ((int32_t)s.VIS_SW64(r) >> 8); \ - if ((tmp & 0xff) > 0x7f) { \ - tmp +=3D 0x100; \ - } \ - d.VIS_L64(r) =3D tmp; - - /* Reverse calculation order to handle overlap */ - PMUL(1); - PMUL(0); -#undef PMUL - - return d.ll; -} - -uint64_t helper_fmuld8ulx16(uint64_t src1, uint64_t src2) -{ - VIS64 s, d; - uint32_t tmp; - - s.ll =3D src1; - d.ll =3D src2; - -#define PMUL(r) \ - tmp =3D (int32_t)d.VIS_SW64(r) * ((uint32_t)s.VIS_B64(r * 2)); \ - if ((tmp & 0xff) > 0x7f) { \ - tmp +=3D 0x100; \ - } \ - d.VIS_L64(r) =3D tmp; - - /* Reverse calculation order to handle overlap */ - PMUL(1); - PMUL(0); -#undef PMUL - - return d.ll; -} - uint64_t helper_fexpand(uint32_t src2) { VIS32 s; --=20 2.39.2 From nobody Mon Nov 25 12:15:53 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1714996163289365.82373842712104; Mon, 6 May 2024 04:49:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s3wov-00057w-AW; Mon, 06 May 2024 07:47:49 -0400 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 1s3wnD-0002bJ-J8 for qemu-devel@nongnu.org; Mon, 06 May 2024 07:46:04 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s3wmw-00026A-57 for qemu-devel@nongnu.org; Mon, 06 May 2024 07:45:47 -0400 Received: from [2a00:23c4:8bb4:4000:b60d:a162:d698:c802] (helo=localhost.localdomain) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1s3wln-0005pA-LB; Mon, 06 May 2024 12:44:39 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=+nWXIBRD4JwFRlPQUPhOrXxE5sdDw1a50waOf4VxWsU=; b=g/WoWmHSHwrT15PtlpLQHgXNfk N7oWyHjeAvTGjV+vLX2JMPs22ZbiI9Cvra0d4nHYGsbFd6uGIA0WS0WfA4oDlYKMADgaoG8FAev2f 9L0peKwqDHh259QItx543UWjdSUBOwjdMHMFs0S7a+ipst8SHuV44oKkwPN0cZdEhMJH700MmdrUj fm6I1hr/YeMg9juejLRlHa3wQm3W9TLlLla8mmTjEtOkfI5uPmTSBLlL6irhSm2Yk2OHlI9HJRorH OPbCkZRAoPsneCKpTC+arQmhXoMwX9PwqD5/QWP8z8oYZyXc6JH6RtN5Z2HhJss+qeubx3b6uCo3+ h46esu6Q5OjSIrtBAvlJPsdyWlcOrpisVIX6yD0H6VN9L3ZF9I/zO0uByFGytq/808l1QlJWZaOgw Xm9J08eh9PQlO/Bjgl8yz7StsSTRwFnyYKUjzrL6k/BVZpE0xmCSBVZE3BPItNk6ahHRjiPxJPN3Y 2moUbqVDk7AzLMbykNX+H+32mwPZBBTalnYK1DnBjdzzQOiFOKTrLHzR7Vo/sdBKiAkeKpu+Dov7a MAEl3WEq0NDCw5ms6oxsI6epLEU4nvHCzBNWEerIRPBsgDnFfYb/vJwpOBSOmVlu5O3S7ilxqhcZM lwxOkXfFd2Px981cojTYJOe04+51hMUScgA7b+CpM=; From: Mark Cave-Ayland To: qemu-devel@nongnu.org, richard.henderson@linaro.org Date: Mon, 6 May 2024 12:44:50 +0100 Message-Id: <20240506114451.331311-12-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240506114451.331311-1-mark.cave-ayland@ilande.co.uk> References: <20240506114451.331311-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8bb4:4000:b60d:a162:d698:c802 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 11/12] target/sparc: Fix FPMERGE X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1714996164937100003 From: Richard Henderson This instruction has f32 inputs, which changes the decode of the register numbers. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20240502165528.244004-7-richard.henderson@linaro.org> Signed-off-by: Mark Cave-Ayland --- target/sparc/helper.h | 2 +- target/sparc/translate.c | 2 +- target/sparc/vis_helper.c | 27 ++++++++++++++------------- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/target/sparc/helper.h b/target/sparc/helper.h index fcb9c617b7..97fbf6f66c 100644 --- a/target/sparc/helper.h +++ b/target/sparc/helper.h @@ -94,7 +94,7 @@ DEF_HELPER_FLAGS_2(fstox, TCG_CALL_NO_WG, s64, env, f32) DEF_HELPER_FLAGS_2(fdtox, TCG_CALL_NO_WG, s64, env, f64) DEF_HELPER_FLAGS_2(fqtox, TCG_CALL_NO_WG, s64, env, i128) =20 -DEF_HELPER_FLAGS_2(fpmerge, TCG_CALL_NO_RWG_SE, i64, i64, i64) +DEF_HELPER_FLAGS_2(fpmerge, TCG_CALL_NO_RWG_SE, i64, i32, i32) DEF_HELPER_FLAGS_2(fmul8x16, TCG_CALL_NO_RWG_SE, i64, i32, i64) DEF_HELPER_FLAGS_2(fmul8x16a, TCG_CALL_NO_RWG_SE, i64, i32, s32) DEF_HELPER_FLAGS_2(fmul8sux16, TCG_CALL_NO_RWG_SE, i64, i64, i64) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 8a2894bb9f..99c6f3cc72 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -4656,6 +4656,7 @@ TRANS(FMUL8x16AU, VIS1, do_dff, a, gen_op_fmul8x16au) TRANS(FMUL8x16AL, VIS1, do_dff, a, gen_op_fmul8x16al) TRANS(FMULD8SUx16, VIS1, do_dff, a, gen_op_fmuld8sux16) TRANS(FMULD8ULx16, VIS1, do_dff, a, gen_op_fmuld8ulx16) +TRANS(FPMERGE, VIS1, do_dff, a, gen_helper_fpmerge) =20 static bool do_dfd(DisasContext *dc, arg_r_r_r *a, void (*func)(TCGv_i64, TCGv_i32, TCGv_i64)) @@ -4696,7 +4697,6 @@ static bool do_ddd(DisasContext *dc, arg_r_r_r *a, =20 TRANS(FMUL8SUx16, VIS1, do_ddd, a, gen_helper_fmul8sux16) TRANS(FMUL8ULx16, VIS1, do_ddd, a, gen_helper_fmul8ulx16) -TRANS(FPMERGE, VIS1, do_ddd, a, gen_helper_fpmerge) =20 TRANS(FPADD16, VIS1, do_ddd, a, tcg_gen_vec_add16_i64) TRANS(FPADD32, VIS1, do_ddd, a, tcg_gen_vec_add32_i64) diff --git a/target/sparc/vis_helper.c b/target/sparc/vis_helper.c index 61c61c7fea..14c665cad6 100644 --- a/target/sparc/vis_helper.c +++ b/target/sparc/vis_helper.c @@ -74,22 +74,23 @@ typedef union { float32 f; } VIS32; =20 -uint64_t helper_fpmerge(uint64_t src1, uint64_t src2) +uint64_t helper_fpmerge(uint32_t src1, uint32_t src2) { - VIS64 s, d; + VIS32 s1, s2; + VIS64 d; =20 - s.ll =3D src1; - d.ll =3D src2; + s1.l =3D src1; + s2.l =3D src2; + d.ll =3D 0; =20 - /* Reverse calculation order to handle overlap */ - d.VIS_B64(7) =3D s.VIS_B64(3); - d.VIS_B64(6) =3D d.VIS_B64(3); - d.VIS_B64(5) =3D s.VIS_B64(2); - d.VIS_B64(4) =3D d.VIS_B64(2); - d.VIS_B64(3) =3D s.VIS_B64(1); - d.VIS_B64(2) =3D d.VIS_B64(1); - d.VIS_B64(1) =3D s.VIS_B64(0); - /* d.VIS_B64(0) =3D d.VIS_B64(0); */ + d.VIS_B64(7) =3D s1.VIS_B32(3); + d.VIS_B64(6) =3D s2.VIS_B32(3); + d.VIS_B64(5) =3D s1.VIS_B32(2); + d.VIS_B64(4) =3D s2.VIS_B32(2); + d.VIS_B64(3) =3D s1.VIS_B32(1); + d.VIS_B64(2) =3D s2.VIS_B32(1); + d.VIS_B64(1) =3D s1.VIS_B32(0); + d.VIS_B64(0) =3D s2.VIS_B32(0); =20 return d.ll; } --=20 2.39.2 From nobody Mon Nov 25 12:15:53 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1714996186032939.0421646574925; Mon, 6 May 2024 04:49:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s3wox-0005R3-TK; Mon, 06 May 2024 07:47:52 -0400 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 1s3wnD-0002bM-JY for qemu-devel@nongnu.org; Mon, 06 May 2024 07:46:04 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s3wn0-00026a-0c for qemu-devel@nongnu.org; Mon, 06 May 2024 07:45:55 -0400 Received: from [2a00:23c4:8bb4:4000:b60d:a162:d698:c802] (helo=localhost.localdomain) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1s3wlr-0005pA-Nr; Mon, 06 May 2024 12:44:43 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=DIhcn+chzbw/OhcdHLU14KIEmrpThVyUGELVh9DW21U=; b=xgVmHfctoPamA2KpnDbvPlGJbq iL0Bt4C0B2utOXCb6qXvZUq98Ka+POgvMVMNCqvAMBmSP4ajij56wMPG7+4Lhf0PvDimi27vvptJ1 IjSbwXK+kBAW+N4wTBwPOfcM+iFSM9sqVE+dyJpqCkuQpPEOTp5afMk9nq48WUZe/evI01bvggO58 4UgkfIT5uPahFqkYxtr2l47vRiE2cR1rD+e9/qFRUAnC8HXgooEDe1xUbYZlntwv5UPAQUKNjYWI9 bV7jsQHJ+ZaOcG+whUst+ff2c6FBo+Bw724HiCz7K++bZY/QgWwHILNG08O8K5weY7hPIAADaXlGI GXm/cvNytSFZgfb9vI8r6GYYT+gyI87SZSFMrthmECWyYZouijWOFOcYhvlQaor0SkLbw9LUUio/R uNIAov6wzBVvzvYanATweFfltpjVfH0IfEZI9eJjjoBhcmFgaLgtQ75zJOWLjTKBG7CE6xWnYxYvm CIGnBC/4c5nQniCHZRpz8uOqcqLBaU4PJj0dtqqfxo8ktBmSFu9T+6qWsUZMinTwK2ihIMLwhnz2q EE/OjPim0qQgtptFmRkRbmyHtlat2/m6qDbibkCLjKjUdOUVR5vZYUlB976JWmqVl+qGBC76HolkS eF4eqISfdpHlSEZ5r4msGu7EpGrxmK4qz/8hfwzhM=; From: Mark Cave-Ayland To: qemu-devel@nongnu.org, richard.henderson@linaro.org Date: Mon, 6 May 2024 12:44:51 +0100 Message-Id: <20240506114451.331311-13-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240506114451.331311-1-mark.cave-ayland@ilande.co.uk> References: <20240506114451.331311-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8bb4:4000:b60d:a162:d698:c802 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 12/12] target/sparc: Split out do_ms16b X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1714996187025100001 From: Richard Henderson The unit operation for fmul8x16 and friends is described in the manual as "MS16b". Split that out for clarity. Improve rounding with an unconditional addition of 0.5 as a fixed-point integer. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20240502165528.244004-8-richard.henderson@linaro.org> Signed-off-by: Mark Cave-Ayland --- target/sparc/vis_helper.c | 78 ++++++++++++--------------------------- 1 file changed, 24 insertions(+), 54 deletions(-) diff --git a/target/sparc/vis_helper.c b/target/sparc/vis_helper.c index 14c665cad6..e15c6bb34e 100644 --- a/target/sparc/vis_helper.c +++ b/target/sparc/vis_helper.c @@ -44,6 +44,7 @@ target_ulong helper_array8(target_ulong pixel_addr, targe= t_ulong cubesize) =20 #if HOST_BIG_ENDIAN #define VIS_B64(n) b[7 - (n)] +#define VIS_SB64(n) sb[7 - (n)] #define VIS_W64(n) w[3 - (n)] #define VIS_SW64(n) sw[3 - (n)] #define VIS_L64(n) l[1 - (n)] @@ -51,6 +52,7 @@ target_ulong helper_array8(target_ulong pixel_addr, targe= t_ulong cubesize) #define VIS_W32(n) w[1 - (n)] #else #define VIS_B64(n) b[n] +#define VIS_SB64(n) sb[n] #define VIS_W64(n) w[n] #define VIS_SW64(n) sw[n] #define VIS_L64(n) l[n] @@ -60,6 +62,7 @@ target_ulong helper_array8(target_ulong pixel_addr, targe= t_ulong cubesize) =20 typedef union { uint8_t b[8]; + int8_t sb[8]; uint16_t w[4]; int16_t sw[4]; uint32_t l[2]; @@ -95,27 +98,23 @@ uint64_t helper_fpmerge(uint32_t src1, uint32_t src2) return d.ll; } =20 +static inline int do_ms16b(int x, int y) +{ + return ((x * y) + 0x80) >> 8; +} + uint64_t helper_fmul8x16(uint32_t src1, uint64_t src2) { VIS64 d; VIS32 s; - uint32_t tmp; =20 s.l =3D src1; d.ll =3D src2; =20 -#define PMUL(r) \ - tmp =3D (int32_t)d.VIS_SW64(r) * (int32_t)s.VIS_B32(r); \ - if ((tmp & 0xff) > 0x7f) { \ - tmp +=3D 0x100; \ - } \ - d.VIS_W64(r) =3D tmp >> 8; - - PMUL(0); - PMUL(1); - PMUL(2); - PMUL(3); -#undef PMUL + d.VIS_W64(0) =3D do_ms16b(s.VIS_B32(0), d.VIS_SW64(0)); + d.VIS_W64(1) =3D do_ms16b(s.VIS_B32(1), d.VIS_SW64(1)); + d.VIS_W64(2) =3D do_ms16b(s.VIS_B32(2), d.VIS_SW64(2)); + d.VIS_W64(3) =3D do_ms16b(s.VIS_B32(3), d.VIS_SW64(3)); =20 return d.ll; } @@ -124,25 +123,14 @@ uint64_t helper_fmul8x16a(uint32_t src1, int32_t src2) { VIS32 s; VIS64 d; - uint32_t tmp; =20 s.l =3D src1; d.ll =3D 0; =20 -#define PMUL(r) \ - do { \ - tmp =3D src2 * (int32_t)s.VIS_B32(r); \ - if ((tmp & 0xff) > 0x7f) { \ - tmp +=3D 0x100; \ - } \ - d.VIS_W64(r) =3D tmp >> 8; \ - } while (0) - - PMUL(0); - PMUL(1); - PMUL(2); - PMUL(3); -#undef PMUL + d.VIS_W64(0) =3D do_ms16b(s.VIS_B32(0), src2); + d.VIS_W64(1) =3D do_ms16b(s.VIS_B32(1), src2); + d.VIS_W64(2) =3D do_ms16b(s.VIS_B32(2), src2); + d.VIS_W64(3) =3D do_ms16b(s.VIS_B32(3), src2); =20 return d.ll; } @@ -150,23 +138,14 @@ uint64_t helper_fmul8x16a(uint32_t src1, int32_t src2) uint64_t helper_fmul8sux16(uint64_t src1, uint64_t src2) { VIS64 s, d; - uint32_t tmp; =20 s.ll =3D src1; d.ll =3D src2; =20 -#define PMUL(r) \ - tmp =3D (int32_t)d.VIS_SW64(r) * ((int32_t)s.VIS_SW64(r) >> 8); \ - if ((tmp & 0xff) > 0x7f) { \ - tmp +=3D 0x100; \ - } \ - d.VIS_W64(r) =3D tmp >> 8; - - PMUL(0); - PMUL(1); - PMUL(2); - PMUL(3); -#undef PMUL + d.VIS_W64(0) =3D do_ms16b(s.VIS_SB64(1), d.VIS_SW64(0)); + d.VIS_W64(1) =3D do_ms16b(s.VIS_SB64(3), d.VIS_SW64(1)); + d.VIS_W64(2) =3D do_ms16b(s.VIS_SB64(5), d.VIS_SW64(2)); + d.VIS_W64(3) =3D do_ms16b(s.VIS_SB64(7), d.VIS_SW64(3)); =20 return d.ll; } @@ -174,23 +153,14 @@ uint64_t helper_fmul8sux16(uint64_t src1, uint64_t sr= c2) uint64_t helper_fmul8ulx16(uint64_t src1, uint64_t src2) { VIS64 s, d; - uint32_t tmp; =20 s.ll =3D src1; d.ll =3D src2; =20 -#define PMUL(r) \ - tmp =3D (int32_t)d.VIS_SW64(r) * ((uint32_t)s.VIS_B64(r * 2)); \ - if ((tmp & 0xff) > 0x7f) { \ - tmp +=3D 0x100; \ - } \ - d.VIS_W64(r) =3D tmp >> 8; - - PMUL(0); - PMUL(1); - PMUL(2); - PMUL(3); -#undef PMUL + d.VIS_W64(0) =3D do_ms16b(s.VIS_B64(0), d.VIS_SW64(0)); + d.VIS_W64(1) =3D do_ms16b(s.VIS_B64(2), d.VIS_SW64(1)); + d.VIS_W64(2) =3D do_ms16b(s.VIS_B64(4), d.VIS_SW64(2)); + d.VIS_W64(3) =3D do_ms16b(s.VIS_B64(6), d.VIS_SW64(3)); =20 return d.ll; } --=20 2.39.2