{"id":2235099,"url":"http://patchwork.ozlabs.org/api/1.2/patches/2235099/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20260508-mips-octeon-missing-insns-v2-v3-24-bcbec96357d9@gmail.com/","project":{"id":14,"url":"http://patchwork.ozlabs.org/api/1.2/projects/14/?format=json","name":"QEMU Development","link_name":"qemu-devel","list_id":"qemu-devel.nongnu.org","list_email":"qemu-devel@nongnu.org","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20260508-mips-octeon-missing-insns-v2-v3-24-bcbec96357d9@gmail.com>","list_archive_url":null,"date":"2026-05-08T15:12:24","name":"[v3,24/32] tests/tcg/mips: add Octeon instruction smoke test","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"5dcf79a62e82da8eaefac1b87008bdaf2494c1af","submitter":{"id":66301,"url":"http://patchwork.ozlabs.org/api/1.2/people/66301/?format=json","name":"James Hilliard","email":"james.hilliard1@gmail.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20260508-mips-octeon-missing-insns-v2-v3-24-bcbec96357d9@gmail.com/mbox/","series":[{"id":503407,"url":"http://patchwork.ozlabs.org/api/1.2/series/503407/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/list/?series=503407","date":"2026-05-08T15:12:00","name":"target/mips: add missing Octeon user-mode support","version":3,"mbox":"http://patchwork.ozlabs.org/series/503407/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2235099/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2235099/checks/","tags":{},"related":[],"headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=e0vuK+iZ;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists1p.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"],"Received":["from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4gBt3M6Kvrz1yJq\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 09 May 2026 01:15:27 +1000 (AEST)","from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists1p.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1wLMu9-0003kT-Ry; Fri, 08 May 2026 11:14:17 -0400","from eggs.gnu.org ([2001:470:142:3::10])\n by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <james.hilliard1@gmail.com>)\n id 1wLMtJ-0002hj-FT\n for qemu-devel@nongnu.org; Fri, 08 May 2026 11:13:26 -0400","from mail-oa1-x2b.google.com ([2001:4860:4864:20::2b])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1) (envelope-from <james.hilliard1@gmail.com>)\n id 1wLMtH-0001lY-3q\n for qemu-devel@nongnu.org; Fri, 08 May 2026 11:13:25 -0400","by mail-oa1-x2b.google.com with SMTP id\n 586e51a60fabf-42fbf95cca8so1592342fac.0\n for <qemu-devel@nongnu.org>; Fri, 08 May 2026 08:13:22 -0700 (PDT)","from\n 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa\n (71-218-113-237.hlrn.qwest.net. [71.218.113.237])\n by smtp.gmail.com with ESMTPSA id\n 586e51a60fabf-43557109b7dsm1897904fac.5.2026.05.08.08.13.20\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Fri, 08 May 2026 08:13:21 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1778253202; x=1778858002; darn=nongnu.org;\n h=cc:to:in-reply-to:references:message-id:content-transfer-encoding\n :mime-version:subject:date:from:from:to:cc:subject:date:message-id\n :reply-to; bh=hFVHCN58pY4Te0rUYFWkIZamhOgAdl/wBYf7gt8R5Bs=;\n b=e0vuK+iZM0A/FXlYmXLxoKOawWPaEbXzJC8GLPNqiA8BsgSvpIRqd3wRWsQhka4pro\n 3iBD1lRhxMirSpG04R8a6Vsv7yMhdaG6dJQ2/vbG59QP90PzrF2N4gLiYq37j/Cz9pLs\n XdOC4jjlWAQb8GtBarUKB1qkQQblOgdK/CZjPY4byrMQHDmF/wtDS1KWw4Yxca6pAlYh\n Xgb4nOpoMIubY6EP4G1qohZzQDHBnAcR/bBaew+7hwDcDDaVNF7pTLYGzI99nMkRSGAM\n XiXzWxAzivRV2bY3QreokrbGzChQoqbPgAP8Mzl+olY8NOaVRxOuVUDY3FtCu+vL4xXs\n tkMA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1778253202; x=1778858002;\n h=cc:to:in-reply-to:references:message-id:content-transfer-encoding\n :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to\n :cc:subject:date:message-id:reply-to;\n bh=hFVHCN58pY4Te0rUYFWkIZamhOgAdl/wBYf7gt8R5Bs=;\n b=A0s7OVdd0r0eSrPOBinp45gsLRKgxiE7SwIMA2tsIeFLkYdmz+cCWLQCJtoHvJLRtV\n JJB/6RnO6R17l597BhEVkJcvwUmeCDfo+nPVU0SUiamkTXQXCyXHO1o8fy0mRqeD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":"by 2002:a05:6870:f617:b0:41c:a61:b612 with SMTP id\n 586e51a60fabf-43556b27b4fmr1823353fac.1.1778253201609;\n Fri, 08 May 2026 08:13:21 -0700 (PDT)","From":"James Hilliard <james.hilliard1@gmail.com>","Date":"Fri, 08 May 2026 09:12:24 -0600","Subject":"[PATCH v3 24/32] tests/tcg/mips: add Octeon instruction smoke test","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"7bit","Message-Id":"\n <20260508-mips-octeon-missing-insns-v2-v3-24-bcbec96357d9@gmail.com>","References":"\n <20260508-mips-octeon-missing-insns-v2-v3-0-bcbec96357d9@gmail.com>","In-Reply-To":"\n <20260508-mips-octeon-missing-insns-v2-v3-0-bcbec96357d9@gmail.com>","To":"qemu-devel@nongnu.org","Cc":"Laurent Vivier <laurent@vivier.eu>, =?utf-8?q?Philippe_Mathieu-Daud?=\n\t=?utf-8?q?=C3=A9?= <philmd@linaro.org>,\n  Aurelien Jarno <aurelien@aurel32.net>,\n  Jiaxun Yang <jiaxun.yang@flygoat.com>,\n  Aleksandar Rikalo <arikalo@gmail.com>, Huacai Chen <chenhuacai@kernel.org>,\n  James Hilliard <james.hilliard1@gmail.com>, Helge Deller <deller@gmx.de>,\n  Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>,\n  Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>","X-Mailer":"b4 0.15.2","Received-SPF":"pass client-ip=2001:4860:4864:20::2b;\n envelope-from=james.hilliard1@gmail.com; helo=mail-oa1-x2b.google.com","X-Spam_score_int":"-17","X-Spam_score":"-1.8","X-Spam_bar":"-","X-Spam_report":"(-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,\n DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001,\n RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,\n 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":"qemu development <qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<https://lists.nongnu.org/archive/html/qemu-devel>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"},"content":"Add a mips64/mips64el linux-user TCG smoke test for representative\nOcteon integer, comparison, population count, and multiplier instruction\npaths.\n\nRun the test with -cpu Octeon68XX and share the source between the\nmips64 and mips64el target directories.\n\nSigned-off-by: James Hilliard <james.hilliard1@gmail.com>\n---\nChanges v2 -> v3:\n  - Split the smoke test out of the combined Octeon arithmetic and memory\n    instruction patch.  (requested by Richard Henderson)\n---\n MAINTAINERS                                   |   2 +\n tests/tcg/mips/Makefile.target                |  11 ++\n tests/tcg/mips/user/isa/octeon/octeon-insns.c | 145 ++++++++++++++++++++++++++\n tests/tcg/mips64/Makefile.target              |  20 ++++\n tests/tcg/mips64el/Makefile.target            |   8 ++\n 5 files changed, 186 insertions(+)","diff":"diff --git a/MAINTAINERS b/MAINTAINERS\nindex 9d3d645953..9501aaf36c 100644\n--- a/MAINTAINERS\n+++ b/MAINTAINERS\n@@ -311,6 +311,8 @@ F: target/mips/\n F: disas/*mips.c\n F: docs/system/cpu-models-mips.rst.inc\n F: tests/tcg/mips/\n+F: tests/tcg/mips64/\n+F: tests/tcg/mips64el/\n \n OpenRISC TCG CPUs\n M: Stafford Horne <shorne@gmail.com>\ndiff --git a/tests/tcg/mips/Makefile.target b/tests/tcg/mips/Makefile.target\nindex 5d17c1706e..d9dc16f8ec 100644\n--- a/tests/tcg/mips/Makefile.target\n+++ b/tests/tcg/mips/Makefile.target\n@@ -8,6 +8,17 @@ MIPS_SRC=$(SRC_PATH)/tests/tcg/mips\n # Set search path for all sources\n VPATH \t\t+= $(MIPS_SRC)\n \n+ifneq ($(findstring 64,$(TARGET_NAME)),)\n+VPATH += $(MIPS_SRC)/user/isa/octeon\n+\n+MIPS64_TESTS=octeon-insns\n+\n+TESTS += $(MIPS64_TESTS)\n+\n+octeon-insns: CFLAGS+=-mabi=64\n+run-octeon-insns: QEMU_OPTS+=-cpu Octeon68XX\n+endif\n+\n # hello-mips is 32 bit only\n ifeq ($(findstring 64,$(TARGET_NAME)),)\n MIPS_TESTS=hello-mips\ndiff --git a/tests/tcg/mips/user/isa/octeon/octeon-insns.c b/tests/tcg/mips/user/isa/octeon/octeon-insns.c\nnew file mode 100644\nindex 0000000000..e9db93d1b6\n--- /dev/null\n+++ b/tests/tcg/mips/user/isa/octeon/octeon-insns.c\n@@ -0,0 +1,145 @@\n+/*\n+ * Test Octeon-specific user-mode instructions.\n+ *\n+ * SPDX-License-Identifier: GPL-2.0-or-later\n+ */\n+\n+#include <assert.h>\n+#include <stdint.h>\n+\n+static uint64_t octeon_baddu(uint64_t rs, uint64_t rt)\n+{\n+    uint64_t rd;\n+\n+    asm volatile(\n+        \"move $8, %[rs]\\n\\t\"\n+        \"move $9, %[rt]\\n\\t\"\n+        \".word 0x71095028\\n\\t\" /* baddu $10, $8, $9 */\n+        \"move %[rd], $10\\n\\t\"\n+        : [rd] \"=r\" (rd)\n+        : [rs] \"r\" (rs), [rt] \"r\" (rt)\n+        : \"$8\", \"$9\", \"$10\");\n+\n+    return rd;\n+}\n+\n+static uint64_t octeon_dmul(uint64_t rs, uint64_t rt)\n+{\n+    uint64_t rd;\n+\n+    asm volatile(\n+        \"move $8, %[rs]\\n\\t\"\n+        \"move $9, %[rt]\\n\\t\"\n+        \".word 0x71095003\\n\\t\" /* dmul $10, $8, $9 */\n+        \"move %[rd], $10\\n\\t\"\n+        : [rd] \"=r\" (rd)\n+        : [rs] \"r\" (rs), [rt] \"r\" (rt)\n+        : \"$8\", \"$9\", \"$10\");\n+\n+    return rd;\n+}\n+\n+static uint64_t octeon_dpop(uint64_t rs)\n+{\n+    uint64_t rd;\n+\n+    asm volatile(\n+        \"move $8, %[rs]\\n\\t\"\n+        \".word 0x7100502d\\n\\t\" /* dpop $10, $8 */\n+        \"move %[rd], $10\\n\\t\"\n+        : [rd] \"=r\" (rd)\n+        : [rs] \"r\" (rs)\n+        : \"$8\", \"$10\");\n+\n+    return rd;\n+}\n+\n+static uint64_t octeon_seq(uint64_t rs, uint64_t rt)\n+{\n+    uint64_t rd;\n+\n+    asm volatile(\n+        \"move $8, %[rs]\\n\\t\"\n+        \"move $9, %[rt]\\n\\t\"\n+        \".word 0x7109502a\\n\\t\" /* seq $10, $8, $9 */\n+        \"move %[rd], $10\\n\\t\"\n+        : [rd] \"=r\" (rd)\n+        : [rs] \"r\" (rs), [rt] \"r\" (rt)\n+        : \"$8\", \"$9\", \"$10\");\n+\n+    return rd;\n+}\n+\n+static uint64_t octeon_sne(uint64_t rs, uint64_t rt)\n+{\n+    uint64_t rd;\n+\n+    asm volatile(\n+        \"move $8, %[rs]\\n\\t\"\n+        \"move $9, %[rt]\\n\\t\"\n+        \".word 0x7109502b\\n\\t\" /* sne $10, $8, $9 */\n+        \"move %[rd], $10\\n\\t\"\n+        : [rd] \"=r\" (rd)\n+        : [rs] \"r\" (rs), [rt] \"r\" (rt)\n+        : \"$8\", \"$9\", \"$10\");\n+\n+    return rd;\n+}\n+\n+static uint64_t octeon_vmulu(uint64_t mpl0, uint64_t rs, uint64_t rt)\n+{\n+    uint64_t rd;\n+\n+    asm volatile(\n+        \"move $8, %[mpl0]\\n\\t\"\n+        \"move $9, $0\\n\\t\"\n+        \".word 0x71090008\\n\\t\" /* mtm0 $8, $9 */\n+        \"move $8, %[rs]\\n\\t\"\n+        \"move $9, %[rt]\\n\\t\"\n+        \".word 0x7109500f\\n\\t\" /* vmulu $10, $8, $9 */\n+        \"move %[rd], $10\\n\\t\"\n+        : [rd] \"=r\" (rd)\n+        : [mpl0] \"r\" (mpl0), [rs] \"r\" (rs), [rt] \"r\" (rt)\n+        : \"$8\", \"$9\", \"$10\");\n+\n+    return rd;\n+}\n+\n+static uint64_t octeon_vmm0(uint64_t mpl0, uint64_t p0,\n+                            uint64_t rs, uint64_t rt)\n+{\n+    uint64_t rd;\n+\n+    asm volatile(\n+        \"move $8, %[mpl0]\\n\\t\"\n+        \"move $9, $0\\n\\t\"\n+        \".word 0x71090008\\n\\t\" /* mtm0 $8, $9 */\n+        \"move $8, %[p0]\\n\\t\"\n+        \"move $9, $0\\n\\t\"\n+        \".word 0x71090009\\n\\t\" /* mtp0 $8, $9 */\n+        \"move $8, %[rs]\\n\\t\"\n+        \"move $9, %[rt]\\n\\t\"\n+        \".word 0x71095010\\n\\t\" /* vmm0 $10, $8, $9 */\n+        \"move %[rd], $10\\n\\t\"\n+        : [rd] \"=r\" (rd)\n+        : [mpl0] \"r\" (mpl0), [p0] \"r\" (p0),\n+          [rs] \"r\" (rs), [rt] \"r\" (rt)\n+        : \"$8\", \"$9\", \"$10\");\n+\n+    return rd;\n+}\n+\n+int main(void)\n+{\n+    assert(octeon_baddu(0x123, 0x0f0) == 0x13);\n+    assert(octeon_dmul(0x12345678, 0x10) == 0x123456780);\n+    assert(octeon_dpop(0xf0f0f0f0f0f0f0f0ULL) == 32);\n+    assert(octeon_seq(0xabc, 0xabc) == 1);\n+    assert(octeon_seq(0xabc, 0xdef) == 0);\n+    assert(octeon_sne(0xabc, 0xabc) == 0);\n+    assert(octeon_sne(0xabc, 0xdef) == 1);\n+    assert(octeon_vmulu(5, 7, 11) == 46);\n+    assert(octeon_vmm0(5, 13, 7, 11) == 59);\n+\n+    return 0;\n+}\ndiff --git a/tests/tcg/mips64/Makefile.target b/tests/tcg/mips64/Makefile.target\nnew file mode 100644\nindex 0000000000..042855844a\n--- /dev/null\n+++ b/tests/tcg/mips64/Makefile.target\n@@ -0,0 +1,20 @@\n+# -*- Mode: makefile -*-\n+#\n+# SPDX-License-Identifier: GPL-2.0-or-later\n+#\n+# MIPS64 - included from tests/tcg/Makefile.target\n+#\n+\n+MIPS64_SRC=$(SRC_PATH)/tests/tcg/mips64\n+MIPS_OCTEON_SRC=$(SRC_PATH)/tests/tcg/mips/user/isa/octeon\n+\n+# Set search path for all sources\n+VPATH \t\t+= $(MIPS64_SRC) $(MIPS_OCTEON_SRC)\n+\n+MIPS64_TESTS=octeon-insns\n+\n+TESTS += $(MIPS64_TESTS)\n+\n+$(MIPS64_TESTS): CFLAGS+=-mabi=64\n+\n+run-octeon-insns: QEMU_OPTS+=-cpu Octeon68XX\ndiff --git a/tests/tcg/mips64el/Makefile.target b/tests/tcg/mips64el/Makefile.target\nnew file mode 100644\nindex 0000000000..dbc5f8dc5f\n--- /dev/null\n+++ b/tests/tcg/mips64el/Makefile.target\n@@ -0,0 +1,8 @@\n+# -*- Mode: makefile -*-\n+#\n+# SPDX-License-Identifier: GPL-2.0-or-later\n+#\n+# MIPS64 little-endian - included from tests/tcg/Makefile.target\n+#\n+\n+include $(SRC_PATH)/tests/tcg/mips64/Makefile.target\n","prefixes":["v3","24/32"]}