From owner-freebsd-hackers@FreeBSD.ORG Fri Dec 5 09:59:56 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A10E7106564A for ; Fri, 5 Dec 2008 09:59:56 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 5C0488FC08 for ; Fri, 5 Dec 2008 09:59:56 +0000 (UTC) (envelope-from des@des.no) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 31B9F6D43F; Fri, 5 Dec 2008 09:59:55 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 0A892844B1; Fri, 5 Dec 2008 10:59:55 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: "Garrett Cooper" References: <7d6fde3d0812040324y3bf0901cy1f4a6d961362c314@mail.gmail.com> <20081205072229.GE18652@hoeg.nl> <7d6fde3d0812050034y43a70ce8i49fbba92f9c8943b@mail.gmail.com> <7d6fde3d0812050035u6e3ea930o9e093830a8608444@mail.gmail.com> <20081205084441.GA29312@owl.midgard.homeip.net> <7d6fde3d0812050050l57684eebkf14f252d78b68ec0@mail.gmail.com> <4938F036.4010600@gmx.de> <7d6fde3d0812050131p2e9ac761n1c76575d3a3f5792@mail.gmail.com> Date: Fri, 05 Dec 2008 10:59:54 +0100 In-Reply-To: <7d6fde3d0812050131p2e9ac761n1c76575d3a3f5792@mail.gmail.com> (Garrett Cooper's message of "Fri, 5 Dec 2008 01:31:12 -0800") Message-ID: <861vwnhrhh.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: FreeBSD Hackers , Christoph Mallon , Maksim Yevmenkin Subject: Re: RFC: small syscons and kbd patch X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2008 09:59:56 -0000 "Garrett Cooper" writes: > If you really want to split hairs, ! only negates the logic value, > whereas ~ actually negates the bits. So technically, you're not > flipping 0 to make 1 and vice versa, but instead flipping 0 to make > non-zero, etc. There is a clear distinction in hardware. He didn't say anything about flipping bits... and you're wrong, !0 is guaranteed to evaluate to 1. > The point was that !! isn't obvious at first glancing the C code. It is to an experienced C programmer. > Getting down to it I'd like to see what the compiler optimizes each > as, because I can see dumb compilers saying `!!' translates to `not, > bne =3D> set, else set, continue', whereas `? :' could be translated to > `bne, set, else set, continue'; I'm sure gcc has moved passed these > really minute details. Never try to second-guess the compiler. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no