qemu-s390x
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [qemu-s390x] [PATCH v2 3/7] s390x/tcg: properly implement the TOD


From: Richard Henderson
Subject: Re: [qemu-s390x] [PATCH v2 3/7] s390x/tcg: properly implement the TOD
Date: Wed, 20 Jun 2018 09:33:40 -1000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0

On 06/20/2018 12:08 AM, David Hildenbrand wrote:
> +/* Converts ns to s390's clock format */
> +static inline uint64_t time2tod(uint64_t ns)
> +{
> +    return (ns << 9) / 125;
> +}
> +
> +/* Converts s390's clock format to ns */
> +static inline uint64_t tod2time(uint64_t t)
> +{
> +    return (t * 125) >> 9;
> +}

How many significant bits on input here?
Do you in fact want to be using muldiv64?


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]