From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTPS id 1B344385841B for ; Wed, 3 Nov 2021 15:03:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1B344385841B Received: from mail-vk1-f198.google.com (mail-vk1-f198.google.com [209.85.221.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-573-Idfxfh6qM7aNh1UzDVV9vA-1; Wed, 03 Nov 2021 11:02:51 -0400 X-MC-Unique: Idfxfh6qM7aNh1UzDVV9vA-1 Received: by mail-vk1-f198.google.com with SMTP id q62-20020a1fd941000000b002e559c3f41aso1055806vkg.3 for ; Wed, 03 Nov 2021 08:02:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JzriJ992df4hs35IoFmGb+Z0hL0wSSeNDBzpjy88K9I=; b=6vBbcqa+KSJHIdiH9CCPzlUV18k++Jr9ETxM+/3swatnQbkZbL9Mn8jBVgJkNKNImG a9pXseolBeNMymUG45m5WbUbJygCVfgpdAtot+FV9JTIiqJwjERZvASRv+RAjXtjKddB l4hx8P73/VbrR2Utk2nM19+COSs0DBnwXjeJNhqLAS0eJyUcZdTzAVhE5uuzxLfMDebY NMUBAxgbd+quGyt3561gyJ7Y9XHgbz5uiwEqMDxy7Mf383+gZJqPMPkPuZ9Z1I8+8XKK Aw9+I2d42j0zjUp0Uy/Uvna8veEvpUxMdlhyMGqalQ9/LCFhERbGveF0Uq0VgwGwvuxL xYIg== X-Gm-Message-State: AOAM530Hnsl73voTzcgjz6p3NM+tQfyKQeIuDMn8hwOyDeOjqQK152h0 XFlRnBhMweCMQzdqPDve4ym11iJyQeRO0gjwAXuGIwsTH/0UuN/fSfM0++KIrJbPKYdPwoToBrb Z9gcT1ZFoQGgOVuj5UBCe+U7kmA8gVNc= X-Received: by 2002:a05:6102:e94:: with SMTP id l20mr51069174vst.4.1635951770426; Wed, 03 Nov 2021 08:02:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxUwmtWO/RgJXgXXnfzv4OvwVe1QS5yk3eZPAIImfmYQZ+4EfVX1Ny8qiKnf2zfo9dPIjl8y1HZj6yKPz3cw38= X-Received: by 2002:a05:6102:e94:: with SMTP id l20mr51069120vst.4.1635951770032; Wed, 03 Nov 2021 08:02:50 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jonathan Wakely Date: Wed, 3 Nov 2021 15:02:38 +0000 Message-ID: Subject: Re: [PATCH v2] libstdc++: Add support for POWER9 DARN instruction to std::random_device To: Jonathan Wakely Cc: "libstdc++" , gcc Patches , Bill Schmidt , Segher Boessenkool X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/mixed; boundary="000000000000205a0a05cfe3b47f" X-Spam-Status: No, score=-13.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, HTML_MESSAGE, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Nov 2021 15:03:08 -0000 --000000000000205a0a05cfe3b47f Content-Type: text/plain; charset="UTF-8" On Wed, 3 Nov 2021 at 15:01, Jonathan Wakely wrote: > Any feedback from POWER maintainers about this? I'd like to push it soon > if there's nothing wrong with it. > With the updated patch attached again this time ... > On Wed, 20 Oct 2021 at 14:00, Jonathan Wakely via Libstdc++ < > libstdc++@gcc.gnu.org> wrote: > >> On 20/10/21 10:12 +0100, Jonathan Wakely wrote: >> >On 19/10/21 17:47 +0100, Jonathan Wakely wrote: >> >>The ISA-3.0 instruction set includes DARN ("deliver a random number") >> >>which can be used similar to the existing support for RDRAND and RDSEED. >> >> >> >>libstdc++-v3/ChangeLog: >> >> >> >> * src/c++11/random.cc (USE_DARN): Define. >> >> (__ppc_darn): New function to use POWER9 DARN instruction. >> >> (Which): Add 'darn' enumerator. >> >> (which_source): Check for __ppc_darn. >> >> (random_device::_M_init): Support "darn" and "hw" tokens. >> >> (random_device::_M_getentropy): Add darn to switch. >> >> * testsuite/26_numerics/random/random_device/cons/token.cc: >> >> Check "darn" token. >> >> * testsuite/26_numerics/random/random_device/entropy.cc: >> >> Likewise. >> >> >> >>Tested powerpc64le-linux (power8 and power9) and x86_64-linux. >> >> >> >>The new "darn" (power-specific) and "hw" (x86 and power) >> >>strings should be documented, but I'll do that if this gets committed. >> >> >> >>Most of this patch is just "more of the same", similar to the existing >> >>code for RDRAND and RDSEED on x86, but the parts of the patch I'd like >> >>more eyes on are: >> >> >> >> >> >>+#elif defined __powerpc__ && defined __BUILTIN_CPU_SUPPORTS__ >> >>+# define USE_DARN 1 >> >>#endif >> > >> >This means DARN can only be used when __builtin_cpu_supports is >> >available, which means glibc 2.23 ... is that acceptable? It means >> >RHEL 7 wouldn't be able to use DARN, but RHEL 8 would. >> > >> >There certainly are POWER9 machines running RHEL 7 and similar >> >vintages (the GCC compile farm has one) so if there's another way to >> >check for ISA 3.0 then I could use that. >> > >> >If __POWER9_VECTOR__ is defined when building libstdc++, presumably >> >that means the whole library can only be run on POWER9 hardware. So >> >would that mean we don't need to check __builtin_cpu_supports("darn") >> >when __POWER9_VECTOR__ is defined? Or is it possible to build with >> >-mcpu=power8 -mpower9-vector and run it on h/w without the DARN >> >instruction? >> > >> >Also, I forgot to add a configure check that the assembler supports >> >darn, which is another prerequisite for using it here. >> > >> >>@@ -135,6 +137,15 @@ namespace std _GLIBCXX_VISIBILITY(default) >> >>#endif >> >>#endif >> >> >> >>+#ifdef USE_DARN >> >>+ unsigned int >> >>+ __attribute__((target("power9"))) >> > >> >Oops, that should be "cpu=power9". >> > >> >With that change it works on a POWER9 machine (9009-42A) with glibc >> >2.34 and binutils 2.35. >> > >> >> Here's the updated patch with a configure check for assembler support, >> and the target attribute fixed. >> >> This still requires Glibc 2.23 for __builtin_cpu_supports, which I'm >> assuming is acceptable. >> >> >> --000000000000205a0a05cfe3b47f Content-Type: text/plain; charset="US-ASCII"; name="patch.txt" Content-Disposition: attachment; filename="patch.txt" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_kvjnfmwa0 Y29tbWl0IGE2ZjkyNTQwN2RkMDVjNTkzYjIzMGRhMTYyNzQzNWFkYzUzNTg0ZjgNCkF1dGhvcjog Sm9uYXRoYW4gV2FrZWx5IDxqd2FrZWx5QHJlZGhhdC5jb20+DQpEYXRlOiAgIFdlZCBPY3QgMjAg MDk6MjU6MjQgMjAyMQ0KDQogICAgbGlic3RkYysrOiBBZGQgc3VwcG9ydCBmb3IgUE9XRVI5IERB Uk4gaW5zdHJ1Y3Rpb24gdG8gc3RkOjpyYW5kb21fZGV2aWNlDQogICAgDQogICAgVGhlIElTQS0z LjAgaW5zdHJ1Y3Rpb24gc2V0IGluY2x1ZGVzIERBUk4gKCJkZWxpdmVyIGEgcmFuZG9tIG51bWJl ciIpDQogICAgd2hpY2ggY2FuIGJlIHVzZWQgc2ltaWxhciB0byB0aGUgZXhpc3Rpbmcgc3VwcG9y dCBmb3IgUkRSQU5EIGFuZCBSRFNFRUQuDQogICAgDQogICAgbGlic3RkYysrLXYzL0NoYW5nZUxv ZzoNCiAgICANCiAgICAgICAgICAgICogYWNpbmNsdWRlLm00IChHTElCQ1hYX0NIRUNLX1BQQ19E QVJOKTogQ2hlY2sgYXNzZW1ibGVyLg0KICAgICAgICAgICAgKiBjb25maWcuaC5pbjogUmVnZW5l cmF0ZS4NCiAgICAgICAgICAgICogY29uZmlndXJlOiBSZWdlbmVyYXRlLg0KICAgICAgICAgICAg KiBjb25maWd1cmUuYWM6IFVzZSBHTElCQ1hYX0NIRUNLX1BQQ19EQVJOLg0KICAgICAgICAgICAg KiBzcmMvYysrMTEvcmFuZG9tLmNjIFtfR0xJQkNYWF9QUENfREFSTl0gKFVTRV9EQVJOKTogRGVm aW5lLg0KICAgICAgICAgICAgKF9fcHBjX2Rhcm4pOiBOZXcgZnVuY3Rpb24gdG8gdXNlIFBPV0VS OSBEQVJOIGluc3RydWN0aW9uLg0KICAgICAgICAgICAgKFdoaWNoKTogQWRkICdkYXJuJyBlbnVt ZXJhdG9yLg0KICAgICAgICAgICAgKHdoaWNoX3NvdXJjZSk6IENoZWNrIGZvciBfX3BwY19kYXJu Lg0KICAgICAgICAgICAgKHJhbmRvbV9kZXZpY2U6Ol9NX2luaXQpOiBTdXBwb3J0ICJkYXJuIiBh bmQgImh3IiB0b2tlbnMuDQogICAgICAgICAgICAocmFuZG9tX2RldmljZTo6X01fZ2V0ZW50cm9w eSk6IEFkZCBkYXJuIHRvIHN3aXRjaC4NCiAgICAgICAgICAgICogdGVzdHN1aXRlLzI2X251bWVy aWNzL3JhbmRvbS9yYW5kb21fZGV2aWNlL2NvbnMvdG9rZW4uY2M6DQogICAgICAgICAgICBDaGVj ayAiZGFybiIgdG9rZW4uDQogICAgICAgICAgICAqIHRlc3RzdWl0ZS8yNl9udW1lcmljcy9yYW5k b20vcmFuZG9tX2RldmljZS9lbnRyb3B5LmNjOg0KICAgICAgICAgICAgTGlrZXdpc2UuDQoNCmRp ZmYgLS1naXQgYS9saWJzdGRjKystdjMvYWNpbmNsdWRlLm00IGIvbGlic3RkYysrLXYzL2FjaW5j bHVkZS5tNA0KaW5kZXggOTBlY2M0YTg3YTIuLjlmZjljZWIyMGFjIDEwMDY0NA0KLS0tIGEvbGli c3RkYysr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