[{"id":3680214,"web_url":"http://patchwork.ozlabs.org/comment/3680214/","msgid":"<60c9860f-3b0b-4f39-b6b5-fb042994767d@linaro.org>","list_archive_url":null,"date":"2026-04-22T03:43:41","subject":"Re: [PATCH v2 05/13] target/mips: add Octeon arithmetic and memory\n instructions","submitter":{"id":72104,"url":"http://patchwork.ozlabs.org/api/people/72104/","name":"Richard Henderson","email":"richard.henderson@linaro.org"},"content":"On 4/22/26 03:27, James Hilliard wrote:\n> Octeon CPUs define additional integer, memory, and multiply operations\n> beyond the base MIPS64 ISA. Add the missing decode and helper support\n> for the remaining regular Octeon instructions used by existing user-mode\n> workloads.\n> \n> This covers the indexed load forms, cache block zero operations, the\n> Octeon multiply family, population count handling, and related\n> arithmetic and atomic memory operations in the translator and helper\n> layer.\n> \n> Add a TCG smoke test that exercises the arithmetic, compare, population\n> count, and multiplier instructions introduced here.\n> \n> Signed-off-by: James Hilliard <james.hilliard1@gmail.com>\n> \n> ---\n> \n> Changes v1 -> v2:\n> \n>    - Fold the initial Octeon arithmetic and multiplier smoke test into\n>      this patch.\n> \n>    - Keep SAA/SAAD atomics naturally aligned for Octeon L2 transactions.\n> \n>    - Split pre-existing BADDU/DMUL and SEQ/SNE translator changes into\n>      preliminary patches.  (suggested by Philippe Mathieu-Daudé)\n> \n>    - Store Octeon multiplier state in uint64_t arrays instead of\n>      target_ulong scalar fields.  (suggested by Philippe Mathieu-Daudé)\n> \n>    - Keep Octeon68XX CPU feature exposure out of this patch.  (suggested\n>      by Philippe Mathieu-Daudé)\n\nThis really needs to be split per instruction, and one just for adding the new register state.\n\n> +static void octeon_add_limb(uint64_t *sum, int limb_count,\n> +                            uint64_t value, int limb)\n> +{\n> +    while (limb < limb_count) {\n> +        uint64_t old = sum[limb];\n> +\n> +        sum[limb] += value;\n> +        if (sum[limb] >= old) {\n> +            break;\n> +        }\n> +        value = 1;\n> +        limb++;\n> +    }\n> +}\n\nYou may get better out of the compiler with uadd64_overflow().\n\n\nr~","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=linaro.org header.i=@linaro.org header.a=rsa-sha256\n header.s=google header.b=jiUhmtYH;\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 4g0lWL6r0cz1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 13:46:05 +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 1wFOWk-0001nJ-Qr; Tue, 21 Apr 2026 23:45:26 -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 <richard.henderson@linaro.org>)\n id 1wFOWX-0001n8-9X\n for qemu-devel@nongnu.org; Tue, 21 Apr 2026 23:45:16 -0400","from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1) (envelope-from <richard.henderson@linaro.org>)\n id 1wFOWV-0005NX-J8\n for qemu-devel@nongnu.org; Tue, 21 Apr 2026 23:45:12 -0400","by mail-pg1-x536.google.com with SMTP id\n 41be03b00d2f7-c795eacbeb0so2028085a12.2\n for <qemu-devel@nongnu.org>; Tue, 21 Apr 2026 20:45:07 -0700 (PDT)","from [10.72.56.227] ([144.130.154.193])\n by smtp.gmail.com with ESMTPSA id\n 41be03b00d2f7-c7976f9db0esm11180464a12.10.2026.04.21.20.45.03\n for <qemu-devel@nongnu.org>\n (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n Tue, 21 Apr 2026 20:45:05 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=linaro.org; s=google; t=1776829506; x=1777434306; darn=nongnu.org;\n h=content-transfer-encoding:in-reply-to:content-language:from\n :references:to:subject:user-agent:mime-version:date:message-id:from\n :to:cc:subject:date:message-id:reply-to;\n bh=TtODQkpVZBngwaRM7V4NBhxwq7HswxHY/LfMv31gYFw=;\n b=jiUhmtYH8cbPblxxNbelZEKay8xmdMQp2grFZqVGfCbQ8w39RQBgdLCshkUp273cZd\n oi5vRm2sc0xof/zMJ29Ero31iywUOWOytRcWYuMeiXw6ZAzOOoaRTOZYAB0jSyTszVOj\n yO1YE2cnVq9bd9gdL6UuK5qPIvkPCIj1pf/7DwbzPKXc5Me+jLFYANFSqn+1LibbUaqW\n mCsxwSm6XppYS4kAbpnMrG3ox5+/msGQ6/GBU5yXD5zfyA3dZoGYOUPyOxr6ziwVI80q\n oTQRQkMXvh+IJTLh4UTMcgHiVc2dQ0y7sPg8y8QkKxSAlaCkXuFbCm0JGI6nIPaNgKCA\n RxAQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776829506; x=1777434306;\n h=content-transfer-encoding:in-reply-to:content-language:from\n :references:to:subject:user-agent:mime-version:date:message-id\n :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id\n :reply-to;\n bh=TtODQkpVZBngwaRM7V4NBhxwq7HswxHY/LfMv31gYFw=;\n b=ZiDtbgOcoS83aXXkIaDxsjenpz+ckjS1tolRke9pKd/PiL/FNFfMW+BFx613DjWBaO\n 1CPaVMWtNgvQ4O+XAwgIJzfl4NY8O/Q8eXKwstONZOkTefYuGD/yPlU5Znr1DQjSw/uy\n zoq279J9t8y+O7eaO3QwBDwJjmgcvL3hhchG+ZmYzqnuzlipCT/9hQNnj1ufya1GZFJq\n 9MpKEebCJRc4xPzpxkwwOjicjZLsmfpKzdBY7M6L2DxKI4GGA8HB99TjW+cWIQKsFD/M\n 81/54nUIFvn5aDUD3Nme0r1PNxaTADFGhNsuGhBi8dZdBpbpWe+jAQM7ccd//Qj6Likw\n VTqw==","X-Gm-Message-State":"AOJu0YxIfmblh8o6U2LkJZcVjrLXzQtt27EDUR1RLM64RvKupuzKkQMW\n FSY88Wi4FTVuB/mFrmWPJhQOir4P1HlfhQNuh6i5iaJycJP40dXl93ROUVQTeK57DH14J0kbWVA\n /xVq15sY=","X-Gm-Gg":"AeBDietPWXshJC6YhDiTawGh1Y86la1XFKVg9HmeW01X2+Pp5R6BgO9B1D2UESeuJYa\n sf3a1RE6yUmYLfb4yKPW+a5G2kxhUmI1BofT0BdLa9P6NDgUzG3ohFSUgwK/O5a11yz8J2Sj1Rw\n edxtrCcKHKbzw+03uPQKRIqQIQ8t8ZzOqVlFV7CNdPapVcYHraPbBxWlTng9hWxhY7CHYVMhInm\n P2bQYdb0Onl4lg/pvr7+PFF+wPoMWyeyLGC7ee2fChQQP7XnHtzTLEFv4TH+O83scxpvym8PqUY\n 24Lr/oAYfkIZ+EZQTOtNYEPK20eX4YjC79i0LBI416KBaUJNZPzt1Marn0JVx2DDr2KctzqdYs3\n zlJOOxhTP5t87NE/oddNcoxbOTROdWmtQ9a+wlzg+28JG2GTIcQeU16L6nXltdOXjngCDRZbCVv\n V+IN/U+qG9mD1VcDRMyWkvEisdCGy5An5rZ+509ZONrCYrLwoRPa8=","X-Received":"by 2002:a05:6a21:9995:b0:39c:235:c5d7 with SMTP id\n adf61e73a8af0-3a08d8e6010mr23937544637.39.1776829506027;\n Tue, 21 Apr 2026 20:45:06 -0700 (PDT)","Message-ID":"<60c9860f-3b0b-4f39-b6b5-fb042994767d@linaro.org>","Date":"Wed, 22 Apr 2026 13:43:41 +1000","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v2 05/13] target/mips: add Octeon arithmetic and memory\n instructions","To":"qemu-devel@nongnu.org","References":"\n <20260421-mips-octeon-missing-insns-v2-v2-0-a0791df188c9@gmail.com>\n <20260421-mips-octeon-missing-insns-v2-v2-5-a0791df188c9@gmail.com>","From":"Richard Henderson <richard.henderson@linaro.org>","Content-Language":"en-US","In-Reply-To":"\n <20260421-mips-octeon-missing-insns-v2-v2-5-a0791df188c9@gmail.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","Received-SPF":"pass client-ip=2607:f8b0:4864:20::536;\n envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x536.google.com","X-Spam_score_int":"-20","X-Spam_score":"-2.1","X-Spam_bar":"--","X-Spam_report":"(-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,\n DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\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"}}]