From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by sourceware.org (Postfix) with ESMTPS id 7DA8D385501D for ; Thu, 19 Aug 2021 10:43:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7DA8D385501D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-x431.google.com with SMTP id v4so8314694wro.12 for ; Thu, 19 Aug 2021 03:43:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:cc:date:references:mime-version; bh=/bR3fRn1/0a4M4i74VuqvPy6M2jy9CuXoKy8JYCFGrg=; b=lwFxCXHooD4m+GvFD+XNlI9uwVZnB0YRNf/X0/HaYl6vIbXOhDw/jxKwkqs14YJG6t M5mlgYZBz3xIdDO3aLP9X8ovqg6GyCwdcIt6t+OU0BoEXYGycBwEAx/1YUaIVSEJkg/F eU8kuw4IKC9O6jGlIhR0T3JCzn3zfNodF5Sy/GHVZ2o+SnfOd6TFcwWx2M7p5en1SE7M ZwsvLu+RkNbhvVkEVmtcynpdW8P6lZlKOslfIOYA3yG8tiIjFAh08vkubD5dTlcTVgj5 EcUn8lH3Eq5VssoWeLwDTsoIfYY4LBuT+dzEOk8w2w7fx+d/k7fz7LTnvWQDbGyd4r5p +k6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:references :mime-version; bh=/bR3fRn1/0a4M4i74VuqvPy6M2jy9CuXoKy8JYCFGrg=; b=NXHONdevbOeKN6iGgWLjsCbPO4DBzSRH4NjXZIlTD30ZALxOSrZKw6Agiw26PqJrft RN7bkT+T9OOGVYOhFyUeWwrOw1wOhLBH/fVv2mJsR7RAtqPLCbJIwsidM5zN8fQ/bAxR shvx5iqOOxAsnwX+lAPpCteXEemn/T8WDVsLSxCV89Hfz/IiC4d9xue/g5IxpAZpjyNV RBwa0iNmjL6LqmrBzg6NSJSx5nYjMil1+g8dAEoitzAU3lJUmclzZqza0Bm0mZStxPMr IgT2sTJFG0skDl5NVj59DEwQ4PqlbsnVtDynleaZ9sOMFj9ZhRZmgQ8a7eI4LftHQLfn QrBw== X-Gm-Message-State: AOAM532M6nAEf4MoJ2GeT3v8wcpxtPB8moZYqQgX0M4ns69ucWWUmPLU OfvspNHVUhBcb+Ux7IBItF7wPqvSz/lw7g== X-Google-Smtp-Source: ABdhPJyxXcAhV6AxjZ8c1D+ZUgH8mJw2EpxvzGHcPQyEsJxI3PkGbeQWHWk6Sn2euyKoey3drpFdvQ== X-Received: by 2002:adf:cd10:: with SMTP id w16mr3056333wrm.404.1629369789544; Thu, 19 Aug 2021 03:43:09 -0700 (PDT) Received: from telaar.localdomain (84.125.126.156.dyn.user.ono.com. [84.125.126.156]) by smtp.gmail.com with ESMTPSA id t14sm7396925wmj.2.2021.08.19.03.43.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Aug 2021 03:43:09 -0700 (PDT) Message-ID: <096b8fc0a04bace9128bdb8c84e44ce3fa7a7116.camel@gmail.com> Subject: [Fwd: Re: [PATCH] Emulate clock and other stubs on nvptx] From: Yago Rubio To: Iago Rubio Sanfiz Cc: newlib@sourceware.org Date: Thu, 19 Aug 2021 12:45:33 +0200 References: Content-Type: multipart/mixed; boundary="=-iOZYjcLsekWzuNoKelk7" X-Mailer: Evolution 3.28.5 (3.28.5-16.el8) Mime-Version: 1.0 X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, MIME_BASE64_TEXT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, 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-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 10:43:21 -0000 --=-iOZYjcLsekWzuNoKelk7 Content-Type: text/plain Content-Transfer-Encoding: base64 Cg0K --=-iOZYjcLsekWzuNoKelk7 Content-Disposition: inline Content-Description: Forwarded message =?UTF-8?Q?=E2=80=94?= Re: [PATCH] Emulate clock and other stubs on nvptx Content-Type: message/rfc822 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on iagorubio.com X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, FORGED_SPF_HELO,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, PDS_RDNS_DYNAMIC_FP,RCVD_IN_DNSWL_BLOCKED,RDNS_DYNAMIC,SPF_HELO_PASS autolearn=no autolearn_force=no version=3.4.2 X-Original-To: fedora@iagorubio.com Delivered-To: iago@iagorubio.com Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=8.43.85.97; helo=sourceware.org; envelope-from=newlib-bounces+fedora=iagorubio.com@sourceware.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 iagorubio.com 82F3F40A5E Authentication-Results: iagorubio.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="EccnqArV" Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) by iagorubio.com (Postfix) with ESMTPS id 82F3F40A5E for ; Thu, 19 Aug 2021 10:34:42 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 84D313839804 for ; Thu, 19 Aug 2021 10:34:41 +0000 (GMT) X-Original-To: newlib@sourceware.org Delivered-To: newlib@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 7DADE3858400 for ; Thu, 19 Aug 2021 10:34:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7DADE3858400 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629369250; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=k1Fy98I+g9dcqSER1NayPYs0MY0yMAC+t/lMXD4i33A=; b=EccnqArVHs+2+kwLxnTa2FBr/J0TQXsjbsnMGB3KTyZwJVemkBpjWnuROg19EFu1/Q7HZ5 TWIbUWuJP4DnLC7Tb/pn9Z6x6WkTTom8dYvQ4vfIxf9twgVusStNeVrNVOrjgh+DMzGyMR 3FsGQYCned8tmxtCKEw87fm2nyaiHZs= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-482-vx9cTwnpMiiEau7L4IziEQ-1; Thu, 19 Aug 2021 06:34:08 -0400 X-MC-Unique: vx9cTwnpMiiEau7L4IziEQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E3F291020C20; Thu, 19 Aug 2021 10:34:07 +0000 (UTC) Received: from calimero.vinschen.de (ovpn-112-10.ams2.redhat.com [10.36.112.10]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B71F560657; Thu, 19 Aug 2021 10:34:07 +0000 (UTC) Received: by calimero.vinschen.de (Postfix, from userid 500) id 50ED2A80DDB; Thu, 19 Aug 2021 12:34:06 +0200 (CEST) Date: Thu, 19 Aug 2021 12:34:06 +0200 From: Corinna Vinschen To: Roger Sayle Subject: Re: [PATCH] Emulate clock and other stubs on nvptx Message-ID: Mail-Followup-To: Roger Sayle , newlib@sourceware.org References: <010301d79450$27eb3720$77c1a560$@nextmovesoftware.com> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=vinschen@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: newlib@sourceware.org Cc: newlib@sourceware.org Errors-To: newlib-bounces+fedora=iagorubio.com@sourceware.org Sender: "Newlib" Content-Transfer-Encoding: quoted-printable On Aug 19 12:22, Corinna Vinschen wrote: > Hi Roger, >=20 > On Aug 18 17:43, Roger Sayle wrote: > >=20 > > Please be gentle, this is my first patch to newlib. > >=20 > > This patch to the libc/machine/nvptx port of newlib implements an > > approximation of "clock" and provides some additional stub routines. > > These changes not only reduce the number of (link) failures in the GCC > > testsuite when targeting nvptx-none, but also allow the NIST scimark4 > > benchmark to compile and run without modification. > >=20 > > newlib already contains support for backends to provide their own > > clock implementations via -DCLOCK_PROVIDED. That functionality is > > used here to return an approximate elapsed time based on the NVidia > > GPU's clock64 cycle counter. Although not great, this is better than > > the current behaviour of link error from the unresolved symbol > > _times_r. > >=20 > > The other part of the patch is to add a small number of stub functions > > to nvptx's misc.c. Adding isatty, for example, resolves linking > > problems in libc from the dependency in __smakebuf_r, and the sync > > stub, for example, fixes the failure with GCC's > > testsuite/gfortran.dg/ISO_Fortran_binding_14.f90 [which simply tests > > that gfortran can call a/any C function]. > >=20 > > Hopefully, these changes are acceptable. If so, if someone could > > please commit >=20 > They are, but your patch submission is a bit weird and more work to > apply than necessary. >=20 > Please commit your patches to your local git repo, including a nice > commit message, create a git patch file via `git format-patch' and send > it via `git send-email --to=3D"newlib@..." to this mailing list. Note > that providing Makefile.in is nice, but you don't *have* to provide > Makefile.in. We'll regenerate that as required. >=20 > Another point: Given the HW support for a monotonic clock tick, > wouldn't it make more sense to implement clock_gettime() with support > for CLOCK_REALTIME and CLOCK_MONOTONIC, and implement clock() by calling > clock_gettime()? Oh, btw., since your comment enumerates the CPU variants, isn't there a runtime method to check the CPU and use more accurate values per CPU? Just an idea... Corinna --=-iOZYjcLsekWzuNoKelk7--