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 [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id A9D763858030 for ; Fri, 5 Nov 2021 12:44:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A9D763858030 Received: from mail-vk1-f200.google.com (mail-vk1-f200.google.com [209.85.221.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-34-jWrt_TfiNOO76SwYYrIpIw-1; Fri, 05 Nov 2021 08:44:28 -0400 X-MC-Unique: jWrt_TfiNOO76SwYYrIpIw-1 Received: by mail-vk1-f200.google.com with SMTP id m11-20020ac5cfcb000000b002f2125cf22eso2919319vkf.8 for ; Fri, 05 Nov 2021 05:44:28 -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=K8dhZ8fE8gWSFcp4wqJ2ouFaTN1omRJuvsF9kwzK2LE=; b=zAsS2VA20/Xq7T92uq9O5gWvDDvEESfBUE8a4kdrbBlMVguqmXEdxbo7usbCHbg5Ye TZ/e+7C8Vthj3bM0qPkzCkH38VTiLn7QMzY1Xf61IpS2e2GIZUgfIg5GMN7HJb5tYy3S KXzdIiF8tmcSB/PjL950+S1zO8zGuKdi87AHpssv34LLM1fT0/4bWLuviLqcHqQsXpOk 6SI/Sdd3gx/f7j1XgwshtuLe8GB6PjBunOAx6mlTXklTdqeg93VgMczLOT4rROc+NVjT V8IzObGDS2J3M2B2R83cdX+SMzhW82DAPLV639lHrFWx3VwKYccl3UwuFSwWdvk/k+uT y/FA== X-Gm-Message-State: AOAM531wBgFv5AjeZblq3VcmEGEwtPORJLmLCM5bT5PxFdB+Z1EQSPWL NTdIJ7n5GmHjeyqwHGhsf8uo7WlmeU0aEcjfYWJXoPdihQmj+qKj9w1ZWx8oNfdeIGqT0WIUVln U69hZjs8GuLmnDHjgF1MPl3FvKr8Cz0o= X-Received: by 2002:a67:d815:: with SMTP id e21mr38188377vsj.16.1636116268483; Fri, 05 Nov 2021 05:44:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzACbwTKdK5NDU+XgcBLgizawNwxItZZGIjhDJnQP95WOTGEjij7JgRvA/eykZy3HAOgXOk6+RMKTveR1YzY0k= X-Received: by 2002:a67:d815:: with SMTP id e21mr38188338vsj.16.1636116268296; Fri, 05 Nov 2021 05:44:28 -0700 (PDT) MIME-Version: 1.0 References: <00a3f87e-77d4-39d4-8385-4207ab271bb1@linux.ibm.com> In-Reply-To: <00a3f87e-77d4-39d4-8385-4207ab271bb1@linux.ibm.com> From: Jonathan Wakely Date: Fri, 5 Nov 2021 12:44:16 +0000 Message-ID: Subject: Re: [PATCH v2] libstdc++: Add support for POWER9 DARN instruction to std::random_device To: Bill Schmidt Cc: "libstdc++" , gcc Patches , Segher Boessenkool X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/mixed; boundary="000000000000fbddbc05d00a00ed" X-Spam-Status: No, score=-13.7 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: Fri, 05 Nov 2021 12:44:34 -0000 --000000000000fbddbc05d00a00ed Content-Type: text/plain; charset="UTF-8" On Thu, 4 Nov 2021 at 20:44, Bill Schmidt wrote: > For posterity: This was discussed briefly on IRC, and Segher approved > with some > simplifications and a request to implement a fail/retry check. > > Here's what I have now. No more assembler check in configure, and it uses the 64-bit __builtin_darn() and truncates it to 32-bit, or retries (up to 100 times) if it fails. I'm doing some more testing now. --000000000000fbddbc05d00a00ed 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_kvmdd0xh0 Y29tbWl0IDc3ODE2MjY0NzEyOTIzNDgxZGIzN2EyOWQxNjM4ZmFhMWQ5OWFhZGMKQXV0aG9yOiBK b25hdGhhbiBXYWtlbHkgPGp3YWtlbHlAcmVkaGF0LmNvbT4KRGF0ZTogICBXZWQgT2N0IDIwIDA5 OjI1OjI0IDIwMjEKCiAgICBsaWJzdGRjKys6IEFkZCBzdXBwb3J0IGZvciBQT1dFUjkgREFSTiBp bnN0cnVjdGlvbiB0byBzdGQ6OnJhbmRvbV9kZXZpY2UKICAgIAogICAgVGhlIElTQS0zLjAgaW5z dHJ1Y3Rpb24gc2V0IGluY2x1ZGVzIERBUk4gKCJkZWxpdmVyIGEgcmFuZG9tIG51bWJlciIpCiAg ICB3aGljaCBjYW4gYmUgdXNlZCBzaW1pbGFyIHRvIHRoZSBleGlzdGluZyBzdXBwb3J0IGZvciBS RFJBTkQgYW5kIFJEU0VFRC4KICAgIAogICAgbGlic3RkYysrLXYzL0NoYW5nZUxvZzoKICAgIAog ICAgICAgICAgICAqIHNyYy9jKysxMS9yYW5kb20uY2MgW19fcG93ZXJwY19fXSAoVVNFX0RBUk4p OiBEZWZpbmUuCiAgICAgICAgICAgIChfX3BwY19kYXJuKTogTmV3IGZ1bmN0aW9uIHRvIHVzZSBQ T1dFUjkgREFSTiBpbnN0cnVjdGlvbi4KICAgICAgICAgICAgKFdoaWNoKTogQWRkICdkYXJuJyBl bnVtZXJhdG9yLgogICAgICAgICAgICAod2hpY2hfc291cmNlKTogQ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