Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112157 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 29805 invoked from network); 31 Oct 2020 15:58:08 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 31 Oct 2020 15:58:08 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id B2C44180533 for ; Sat, 31 Oct 2020 08:17:44 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sat, 31 Oct 2020 08:17:44 -0700 (PDT) Received: by mail-pf1-f178.google.com with SMTP id o129so7564306pfb.1 for ; Sat, 31 Oct 2020 08:17:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=nTkal0c7dZjj3VCAFUvqPEc1xBoWqUqS5JWskDEldEc=; b=L23G7wFYBOkxzeyScRjmS3t746Xzy+LKV8eJBV7fToOLvXuuhG6yKKIYr9y5b86BQn oaqARlLtg+bmaSh2mpswBs1CAQGkkaEnEzywU1UDnOSGSFzOvYGkW4bK/CrmecTgODar cjq+3tETj5gk+6jVlwILz//3fzFL+gbwhAFfsVonsBDasLxNtZvJfC9Zj7BdDT2b0o2I LNScISxy8eEjeOjjfcc3A2vVs2buh/1f9qWQo1fsjVEPX1IC4KlI4ZIBfKVzh4vAAqNo NeJRskdptIcjVS3DMqmMsK+LRWHjAtwX8ok0g9D/LX5YLcP3M53VObEGhxQUWH7RBArE GXCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nTkal0c7dZjj3VCAFUvqPEc1xBoWqUqS5JWskDEldEc=; b=g1tpmGTuDBIsPGjetUAO0VMGso0rMhI7doPGiemiYOMdENSLOoQGYetZl+JMvXq6HV 7osMnHb0ohsUWwsidAtXEmbU8Jv3AFcK0TTc2aQIFs13/5ZfmcI0sLhXF1s2n0aOFLJp JPiwUVW3/nvXX2aCqHEBH9MM8PQY9l0UL0CURtHrYdT7LPlcyioGvJaW5DzV/E+D7eJg 5ZF5ZGx2R8oKf30Fm2D3HPnTc3fYuKmvhtfE+EmSXqnpAO8cw2S69ETYjU0EVns8eWjB FtRq9m6ne+8ZGfuGgu/s0784tpW+3tCVkGPcK76w8a8UAGd4k2yK96cER1Cc5feFJ2jI jZvw== X-Gm-Message-State: AOAM532ri9C2vLSWyo3VbU2tcbJu9waCNOy5bP83ogVgrennGNKJ9aDD jM0Bu/b7pEgthwmytIYIHdBFMxqUrj4rwKWlaq8= X-Google-Smtp-Source: ABdhPJy9YX3Up2mODB/qqvBu6aIf4/uKPTScBsUuf2ehXKqr1Lojx6xOEcRt2QZvrh1Ez+mb7h7/jqZiQ4ghnpiJokA= X-Received: by 2002:a63:4d0f:: with SMTP id a15mr6491498pgb.250.1604157462905; Sat, 31 Oct 2020 08:17:42 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Sat, 31 Oct 2020 16:17:31 +0100 Message-ID: To: Levi Morrison Cc: PHP internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] Re: hash BLAKE3 From: divinity76@gmail.com (Hans Henrik Bergan) @Levi > However, I still see CPU related code in get_cpu_features. Are you > sure you pushed the right thing? I think it's correct, yes, the problem is ext/hash/blake3/blake3_dispatch.c, which is just a copypaste of the upstream https://github.com/BLAKE3-team/BLAKE3/blob/master/c/blake3_dispatch.c (specifically version 0.3.7, with 2 patches that will be part of 0.3.8.. specifically https://github.com/BLAKE3-team/BLAKE3/pull/128 and https://github.com/BLAKE3-team/BLAKE3/pull/131 , both of which were accepted upstream) Unfortunately the upstream blake3_dispatch.c always run cpu feature detection when compiled for x86, even when it's only compiling the portable implementation. we are free to rip out that part for PHP's copy, and it should be a pretty easy job to do too (i'm guessing ~30min including `make test` on decent hardware), note that if we do it, comparing php's version with the upstream version is slightly more work, and updating to newer upstream versions will be slightly more work (we'll need to rip out the cpu-detection stuff next time we want to sync with upstream and the upstream dispatch code changed. I'm guessing it will be years between each time someone actually has a good reason to do this, though.) if ripping out the cpu feature detection code in blake3_dispatch is desired, i can volunteer for that, if nobody else want to ^^