From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35802) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VKV2S-0005X9-Na for qemu-devel@nongnu.org; Fri, 13 Sep 2013 11:12:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VKV2N-0004ze-Hl for qemu-devel@nongnu.org; Fri, 13 Sep 2013 11:12:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33337) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VKV2N-0004zX-9X for qemu-devel@nongnu.org; Fri, 13 Sep 2013 11:11:59 -0400 Message-ID: <52332B46.4030704@redhat.com> Date: Fri, 13 Sep 2013 17:12:06 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1377471536-12423-1-git-send-email-akoskovacs@gmx.com> <1377471536-12423-2-git-send-email-akoskovacs@gmx.com> <52332761.8090903@redhat.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 01/47] rules.mak: New logical functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: =?UTF-8?B?w4Frb3MgS292w6Fjcw==?= , QEMU Developers Il 13/09/2013 17:02, Peter Maydell ha scritto: > On 13 September 2013 15:55, Paolo Bonzini wrote: >> Il 13/09/2013 15:43, Peter Maydell ha scritto: >>> On 25 August 2013 23:58, =C3=81kos Kov=C3=A1cs w= rote: >>>> +eq =3D $(if $(subst $2,,$1)$(subst $1,,$2),n,y) >>>> +ne =3D $(if $(subst $2,,$1)$(subst $1,,$2),y,n) >>> >>> These give the wrong answer for comparisons >>> of 'n' with ''. Working versions: >>> >>> eq =3D $(if $(filter $(call lnot,$1),$(call lnot,$2)),y,n) >>> ne =3D $(if $(filter $(call lnot,$1),$(call lnot,$2)),n,y) >> >> isempty/notempty are clearly string functions, where only the output i= s >> 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. >=20 > Sounds reasonable -- I was led a little astray by > them all being in a patch whose only documentation > was the phrase "logical functions"... >=20 >> Your patch is fine if you either rename eq/ne like this, >> or revert them to Akos's version. >=20 > It sounds like we probably want two patches: > 1. logical functions: land/lor/leqv/lxor/lnot > 2. string functions: eq/ne/isempty/notempty >=20 > I assume we do end up using eq/ne somewhere? I cannot think off-hand of a place where I'd use eq/ne directly rather than isempty/notempty. Or for that matter leqv/lxor. :) But since we're discussing the issue and the implementation of eq/ne is not entirely trivial, I think it's simplest to have them even if they are unused for now. Paolo