> >> Oh, I wasn't referring to any specific users. What I meant is that,
> >> if we make abs64() generically available from host-utils, callers
> >> could expect it to behave the same way as abs() in stdlib, for
> >> example.
> >
> > That would be surprising, but do you think there are cases where
On 8/25/21 11:18 PM, Eduardo Habkost wrote:
> On Wed, Aug 25, 2021 at 08:37:17PM +, Luis Fernando Fujita Pires wrote:
>> From: Eduardo Habkost
>>
Right, that's true of any standard implementation of abs().
I thought about making it return uint64_t, but that could make it
weird f
On Wed, Aug 25, 2021 at 08:37:17PM +, Luis Fernando Fujita Pires wrote:
> From: Eduardo Habkost
>
> > > Right, that's true of any standard implementation of abs().
> > > I thought about making it return uint64_t, but that could make it
> > > weird for other uses of abs64(), where callers woul
From: Eduardo Habkost
> > Right, that's true of any standard implementation of abs().
> > I thought about making it return uint64_t, but that could make it
> > weird for other uses of abs64(), where callers wouldn't expect a type
> > change from int64_t to uint64_t. Maybe create a separate uabs64
On Wed, Aug 25, 2021 at 12:48:35PM +, Luis Fernando Fujita Pires wrote:
> From: David Gibson
> > Hrm.. I'm a bit concerned about mkaing this a more widespread function,
> > because it has a nasty edge case... which is basically unavoidable in an
> > abs64()
> > implementation. Specifically:
From: David Gibson
> Hrm.. I'm a bit concerned about mkaing this a more widespread function,
> because it has a nasty edge case... which is basically unavoidable in an
> abs64()
> implementation. Specifically:
>
> abs64(0x800___0) == 0x800___ < 0
>
> At least in the mo
On Tue, Aug 24, 2021 at 11:27:13AM -0300, Luis Pires wrote:
> Move abs64 to host-utils so it can be reused elsewhere.
> Also made it inline.
>
> Signed-off-by: Luis Pires
> ---
> hw/i386/kvm/i8254.c | 5 -
> include/qemu/host-utils.h | 8
> 2 files changed, 8 insertions(+), 5
Move abs64 to host-utils so it can be reused elsewhere.
Also made it inline.
Signed-off-by: Luis Pires
---
hw/i386/kvm/i8254.c | 5 -
include/qemu/host-utils.h | 8
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/hw/i386/kvm/i8254.c b/hw/i386/kvm/i8254.c
index f