[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] x86: do away with HAVE_AS_NEGATIVE_TRUE
- To: Jan Beulich <jbeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
- Date: Wed, 17 May 2023 18:05:03 +0100
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Fg5W1XDHXS/R4/B4+Apfe6z1HaDLwENesQB3BTFUihY=; b=hGw8n8JpBaQthuX569uZ/6swp/NJYZI/5NGI0IaqhlYdLVCS4AmTzsifI6jBP9FonG3iLOCv+QjaITROQ3gpBqdrFKf4h1oJs4zCrHw523Yq93hX6dXI/Xj2+WSuVov3vp0BJrrsSFOCk5nbALfVYoDC4HdJE8wNA/DQiI0FldLPE1ko9EIYrCv3DgDalwyVDCE+50IS+SZREK6nppCvvVvTj5sbUmGlIK4Va6URvAuyx5em4EJVG0V474Z5bowbq81y4ueJx54AaihKU2AntVlXCyKhq4YGj7EuehVuiCMUGbgx4fMptmUB1wvugOMmkVpQXXf1dsQ0dX4pigPz4A==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jq6nYJHmkfdqPQQL4hwJp7joIYdnVfRpSo3HalXXB5WsJbiV1h2rEK5FcmN7YOO7eKnioD1LTKcr1Xyj4Wd9Pon/aa8XTPVjKSsviXjoV6CQUxxGJ1wG6IiNjKffYjK269YeXNJw3fAwqAvIt1Yj8RNnXJGL0XDrGZaSHov8SUPPHgSpZYPCXHES31X7XG47QjHjRwqaGqixjGOlvE6VCzXIXJyjM9+XaGSdznk2+lsAkWVT4dU1JbTpD/XwqOoFUAbVYIJoGoDRIN8Wdahjb/R4QRINReIbMVSNPCf5dvXiBx8AC57YUU8915V9ZaptMZeXX+IapuPPmGrYKTb02A==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
- Cc: Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Delivery-date: Wed, 17 May 2023 17:05:16 +0000
- Ironport-data: A9a23:70YE46Kss/X1wu3kFE+R/JQlxSXFcZb7ZxGr2PjKsXjdYENS1zwCx 2QeXm3QP/jfNmCgKd8gadzn9kkF7Z/Vy9I2TlBlqX01Q3x08seUXt7xwmUcnc+xBpaaEB84t ZV2hv3odp1coqr0/0/1WlTZhSAgk/rOHvykU7Ss1hlZHWdMUD0mhQ9oh9k3i4tphcnRKw6Ws Jb5rta31GWNglaYCUpJrfPSwP9TlK6q4mhA4wVhPaojUGL2zBH5MrpOfcldEFOgKmVkNrbSb /rOyri/4lTY838FYj9yuu+mGqGiaue60Tmm0hK6aYD76vRxjnVaPpIAHOgdcS9qZwChxLid/ jnvWauYEm/FNoWU8AgUvoIx/ytWZcWq85efSZSzXFD6I+QrvBIAzt03ZHzaM7H09c4nW21Ur P8BCgwKVUjcxOLv8KiFd9tF05FLwMnDZOvzu1lG5BSAVbMKZM6GRK/Ho9hFwD03m8ZCW+7EY NYUYiZuaxKGZABTPlAQC9Q1m+LAanvXKmUE7g7K4/dnpTGLkGSd05C0WDbRUvWMSd9YgQCzo WXe8n6iKhobKMae2XyO9XfEaurnxHurAdxLT+PgnhJsqAfO+3Y/NxtRbAOy/8uUiXWbSvgHF lNBr0LCqoB3riRHVOLVXRe1vXqFtR40QMdLHqsx7wTl4rrZ5UOVC3YJShZFacc6r4kmSDoyz FiLktj1Qzt1v9W9Vna15rqS6zSoNkAowXQqYCYFSU4J5oflqYRq1hbXFI87TOiyk8H/Hiz2z 3aSti8iir4PjMkNkaKm4VTAhDHqrZ/MJuIo2jjqsquexlsRTOaYi0aAtTA3Md4owF6lc2S8
- Ironport-hdrordr: A9a23:sk/xtKNqe+JMecBcT9z255DYdb4zR+YMi2TDiHoddfUFSKalfp 6V98jztSWatN/eYgBYpTnyAtjmfZq6z+8J3WBxB8bZYOCCggeVxe5ZnOjfKlHbakjDH6tmpN xdmstFeaPN5DpB7foSiTPQe7hA/DDEytHRuQ639QYTcegAUdAF0+4WMHf8LqQ7fnglOXJvf6 Dsmvav6gDQMUj+Ka+Adws4dtmGg+eOuIPtYBYACRJiwA6SjQmw4Lq/PwmE0gwYWzZvx65n1W TeiQT26oiqrvn+k3bnpiPuxqUTvOGk5spIBcSKhMRQAjLwijywbIAkd6yesCszqOSP7k9vtN XXuR8vM+l69nuUVGCophnG3RXmzV8VmjLf4G7dpUGmjd3yRTo8BcYErYVFciHB405lmN1nyq pE00+QqpISVHr77W7AzumNcysvulu/oHIkn+JWp3tDUbEGYLsUiYAE5ktaHLoJASq/woE6F+ tFCt3a+Z9tABinRkGcmlMq7M2nX3w1EBvDak8euvaN2zwTp3x9x1tw/r1pol4wsLYGD7VU7e XNNapl0JtUSNUNUK57DOAdBeOqF23kW3v3QSKvCGWiMJtCF2PGqpbx7rlwzvqtYoY0wJw7n4 mEeE9EtFQ1Z1nlBaS1rdx2Gyj2MSeAtAnWu4RjD8ATgMy5eFOrC1zMdLkWqbrinx1FaferHM paO/ptcovexCXVaMB0NjbFKupvwEklIbwoU+kAKiKzS+LwW/vXX7/gAb/uDYuoNwoYcUXCJV ZGdATPBax7nzWWsznD8VfsZ08=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 17/05/2023 3:22 pm, Jan Beulich wrote:
> There's no real need for the associated probing - we can easily convert
> to a uniform value without knowing the specific behavior (note also that
> the respective comments weren't fully correct and have gone stale). All
> we (need to) depend upon is unary ! producing 0 or 1 (and never -1).
>
> For all present purposes yielding a value with all bits set is more
> useful.
>
> No difference in generated code.
>
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> ---
> Unlike in C, there's also binary ! in assembly expressions, and even
> binary !!. But those don't get in the way here.
I had been wanting to do this for a while, but IMO a clearer expression
is to take ((x) & 1) to discard the sign.
It doesn't change any of the logic to use +1 (I don't think), and it's
definitely the more common way for the programmer to think.
~Andrew
|