[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 01/47] rules.mak: New logical functions
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH 01/47] rules.mak: New logical functions |
Date: |
Fri, 13 Sep 2013 16:02:30 +0100 |
On 13 September 2013 15:55, Paolo Bonzini <address@hidden> wrote:
> Il 13/09/2013 15:43, Peter Maydell ha scritto:
>> On 25 August 2013 23:58, Ákos Kovács <address@hidden> wrote:
>>> +eq = $(if $(subst $2,,$1)$(subst $1,,$2),n,y)
>>> +ne = $(if $(subst $2,,$1)$(subst $1,,$2),y,n)
>>
>> These give the wrong answer for comparisons
>> of 'n' with ''. Working versions:
>>
>> eq = $(if $(filter $(call lnot,$1),$(call lnot,$2)),y,n)
>> ne = $(if $(filter $(call lnot,$1),$(call lnot,$2)),n,y)
>
> isempty/notempty are clearly string functions, where only the output is
> of the y/n form. Seeing Akos's implementation of isempty/notempty, I
> think the desired semantics for eq/ne/isempty/notempty are also those of
> string functions.
>
> I would call your functions leqv/lxor, not eq/ne.
Sounds reasonable -- I was led a little astray by
them all being in a patch whose only documentation
was the phrase "logical functions"...
> Your patch is fine if you either rename eq/ne like this,
> or revert them to Akos's version.
It sounds like we probably want two patches:
1. logical functions: land/lor/leqv/lxor/lnot
2. string functions: eq/ne/isempty/notempty
I assume we do end up using eq/ne somewhere?
-- PMM