unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: Zack Weinberg <zackw@panix.com>
Cc: Florian Weimer <fweimer@redhat.com>,
	GNU C Library <libc-alpha@sourceware.org>,
	Joseph Myers <joseph@codesourcery.com>,
	Lukasz Majewski <lukma@denx.de>,
	Alistair Francis <alistair23@gmail.com>,
	Stepan Golosunov <stepan@golosunov.pp.ru>,
	Arnd Bergmann <arnd@arndb.de>,
	Samuel Thibault <samuel.thibault@ens-lyon.org>
Subject: Re: [PATCH v2 02/10] Finish move of clock_* functions to libc.
Date: Tue, 3 Sep 2019 15:50:51 -0300	[thread overview]
Message-ID: <861d132b-c190-470b-0865-698552cd1657@linaro.org> (raw)
In-Reply-To: <CAKCAbMgu=ShWr1KPmAgfXJM479iDXSFoLSRnD2ZpDLQz21j-Sg@mail.gmail.com>



On 03/09/2019 11:34, Zack Weinberg wrote:
> On Tue, Sep 3, 2019 at 9:44 AM Adhemerval Zanella
> <adhemerval.zanella@linaro.org> wrote:
>> On 03/09/2019 10:31, Florian Weimer wrote:
>>> * Adhemerval Zanella:
>>>> On 03/09/2019 04:29, Florian Weimer wrote:
>>>>> * Zack Weinberg:
>>>>>> diff --git a/rt/Versions b/rt/Versions
>>>>>> index 91e3fd2a20..84d1345420 100644
>>>>>> --- a/rt/Versions
>>>>>> +++ b/rt/Versions
>>>>>> @@ -1,15 +1,3 @@
>>>>>> -libc {
>>>>>> -  GLIBC_2.17 {
>>>>>> -    # c*
>>>>>> -    clock_getres; clock_gettime; clock_settime; clock_getcpuclockid;
>>>>>> -    clock_nanosleep;
>>>>>> -  }
>>>>>> -  GLIBC_PRIVATE {
>>>>>> -    __clock_getres; __clock_gettime; __clock_settime; __clock_getcpuclockid;
>>>>>> -    __clock_nanosleep;
>>>>>> -  }
>>>>>> -}
>>>>>
>>>>> Sorry, you cannot remove the GLIBC_2.17 symbol version in this way,
>>>>> otherwise old binaries will fail to load.  You need to leave behind a
>>>>> dummy function definition.  See __libpthread_version_placeholder for how
>>>>> I handled this in the libpthread/vfork case.
>>>>
>>>> Are you sure about it?
>>>
>>> Yes. 8-)  But I missed that this block was just moved to time/Versions.
>>> Either place will work and generate the same symbol versions.
>>
>> Right, because that was my understanding (the symbol versions will still
>> be generated correctly on libc).
> 
> Yes, I moved the GLIBC_2.17 versions from rt/Versions to time/Versions
> to keep them together with their .c files.
> 
> Adhemerval, Florian, I suspect I won't have very much time to work on
> glibc for the next two weeks.  If either or both of you would like to
> take over the branch for these patches (zack/y2038-preliminaries) and
> keep working on it, please feel free.

I will try to spare some time to create a personal branch based on yours
with my reviewed remarks fixed.

> 
> Incidentally, regarding the cost of converting from a struct timespec
> to a struct timeval on systems where 'long' is 64 bits, I'm getting
> what looks like decent code generation out of this definition of
> TIMESPEC_TO_TIMEVAL:
> 
> #define TIMESPEC_TO_TIMEVAL(tv, ts) do {        \
>     uint32_t __nsec = (ts)->tv_nsec;            \
>     (tv)->tv_sec = (ts)->tv_sec;                \
>     (tv)->tv_usec = __nsec / 1000;              \
> } while (0)
> 
> e.g.
> 
>     movq    8(%rsi), %rax
>     movq    (%rsi), %rdx
>     movl    %eax, %eax
>     movq    %rdx, (%rdi)
>     imulq    $274877907, %rax, %rax
>     shrq    $38, %rax
>     movl    %eax, %eax
>     movq    %rax, 8(%rdi)
>     ret
> 
> (Not sure why the 'movl %eax, %eax', though - clearing the upper 32
> bits maybe?  I might throw this at a superoptimizer and see what it
> comes up with.)
> 
> zw
> 

  reply	other threads:[~2019-09-03 18:51 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-28 15:32 [PATCH v2 00/10] Y2038 preparation: use clock_[gs]ettime to implement the other time-getting and -setting functions Zack Weinberg
2019-08-28 15:32 ` [PATCH v2 01/10] Change most internal uses of __gettimeofday to __clock_gettime Zack Weinberg
2019-08-29 20:30   ` Adhemerval Zanella
2019-08-29 20:42     ` Samuel Thibault
2019-08-28 15:32 ` [PATCH v2 02/10] Finish move of clock_* functions to libc Zack Weinberg
2019-08-30 17:40   ` Adhemerval Zanella
2019-09-03  7:29   ` Florian Weimer
2019-09-03 13:25     ` Adhemerval Zanella
2019-09-03 13:31       ` Florian Weimer
2019-09-03 13:44         ` Adhemerval Zanella
2019-09-03 14:34           ` Zack Weinberg
2019-09-03 18:50             ` Adhemerval Zanella [this message]
2019-08-28 15:32 ` [PATCH v2 03/10] Use clock_settime to implement stime; withdraw stime Zack Weinberg
2019-08-30 17:54   ` Adhemerval Zanella
2019-08-28 15:32 ` [PATCH v2 04/10] Use clock_settime to implement settimeofday Zack Weinberg
2019-09-02 13:22   ` Adhemerval Zanella
2019-09-03 14:44     ` Zack Weinberg
2019-08-28 15:32 ` [PATCH v2 05/10] Use clock_gettime to implement time Zack Weinberg
2019-08-28 18:16   ` Florian Weimer
2019-08-28 18:36     ` Zack Weinberg
2019-08-28 18:49       ` Florian Weimer
2019-08-28 20:01     ` Paul Eggert
2019-08-28 20:21       ` Florian Weimer
2019-08-28 21:12         ` Paul Eggert
2019-08-28 21:39           ` Florian Weimer
2019-08-29 17:49             ` Zack Weinberg
2019-09-02 13:32               ` Florian Weimer
2019-09-02 18:35                 ` Adhemerval Zanella
2019-08-28 15:32 ` [PATCH v2 06/10] Use clock_gettime to implement ftime; withdraw ftime Zack Weinberg
2019-09-02 18:42   ` Adhemerval Zanella
2019-08-28 15:32 ` [PATCH v2 07/10] Use clock_gettime to implement timespec_get Zack Weinberg
2019-09-02 19:25   ` Adhemerval Zanella
2019-08-28 15:32 ` [PATCH v2 08/10] Use clock_gettime to implement gettimeofday Zack Weinberg
2019-08-28 18:27   ` Florian Weimer
2019-09-02 19:31     ` Adhemerval Zanella
2019-08-28 15:32 ` [PATCH v2 09/10] Warn when gettimeofday is called with non-null tzp argument Zack Weinberg
2019-09-03 19:56   ` Adhemerval Zanella
2019-08-28 15:32 ` [PATCH v2 10/10] Revise the documentation of simple calendar time Zack Weinberg
2019-08-29  1:09   ` Paul Eggert
2019-08-29 17:41     ` Zack Weinberg
2019-08-30 19:17       ` Paul Eggert
2019-08-28 17:15 ` [PATCH v2 00/10] Y2038 preparation: use clock_[gs]ettime to implement the other time-getting and -setting functions Joseph Myers
2019-09-03 14:43   ` Zack Weinberg
2019-09-10 17:32     ` Adhemerval Zanella

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/libc/involved.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=861d132b-c190-470b-0865-698552cd1657@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=alistair23@gmail.com \
    --cc=arnd@arndb.de \
    --cc=fweimer@redhat.com \
    --cc=joseph@codesourcery.com \
    --cc=libc-alpha@sourceware.org \
    --cc=lukma@denx.de \
    --cc=samuel.thibault@ens-lyon.org \
    --cc=stepan@golosunov.pp.ru \
    --cc=zackw@panix.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).