From owner-freebsd-questions Thu Jun 21 10:42:44 2001 Delivered-To: freebsd-questions@freebsd.org Received: from serenity.mcc.ac.uk (serenity.mcc.ac.uk [130.88.200.93]) by hub.freebsd.org (Postfix) with ESMTP id 9281937B403 for ; Thu, 21 Jun 2001 10:42:39 -0700 (PDT) (envelope-from jcm@freebsd-uk.eu.org) Received: from dogma.freebsd-uk.eu.org ([130.88.200.97] ident=root) by serenity.mcc.ac.uk with esmtp (Exim 2.05 #6) id 15D8TW-0000Zd-00; Thu, 21 Jun 2001 18:42:38 +0100 Received: (from jcm@localhost) by dogma.freebsd-uk.eu.org (8.11.3/8.11.1) id f5LHgc132143; Thu, 21 Jun 2001 18:42:38 +0100 (BST) (envelope-from jcm) Date: Thu, 21 Jun 2001 18:42:37 +0100 From: j mckitrick To: John Merryweather Cooper Cc: freebsd-questions@FreeBSD.ORG Subject: Re: what does this define do? Message-ID: <20010621184237.B31729@dogma.freebsd-uk.eu.org> References: <20010620173855.A2941@dogma.freebsd-uk.eu.org> <20010620094925.A14541@johncoop> <20010620182353.A3958@dogma.freebsd-uk.eu.org> <20010620104718.C14541@johncoop> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: <20010620104718.C14541@johncoop>; from jmcoopr@webmail.bmi.net on Wed, Jun 20, 2001 at 10:47:18AM -0700 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, Jun 20, 2001 at 10:47:18AM -0700, John Merryweather Cooper wrote: | On 2001.06.20 10:23 j mckitrick wrote: | > | This is, of course, highly compiler dependent. Looks like somebody is | > | concerned with the efficiency of a MOV AX, 0 as opposed to an XOR AX, | > AX. | > | > I wondered about that. But i agree, with no way of knowing what the | > compiler is doing anyway, it doesn't make much sense. | > | > The way it is being used seems to invalid the potential benefit: | > | > static char var = FLAG1 | FLAG2 | n(FLAG3) | > | > because the compiler might drop the n() values anyway, since ORing with 0 | > does nothing anyway. I can understand the n() values being in the code | > as | > placeholders, so you can see what lines are hi or low on the hardware | > register, but if the compiler drops them anyway, optimizing the macro | > rather | > than just using 0 doesn't seem to buy any benefits. | > | > | > Jonathon | > -- | > "It is through will alone I set my mind in motion...." | > | | Because I qualify as among the curious, I ran a little test program to look | at the assembly. A couple of observations: | | 1) the "not/and" macro breaks on doubles; | 2) the "xor" macro also breaks on doubles; | 3) the compiler doesn't know about fldz . . . :) | | See attached . . . It turns out this was a dead macro after all. :-) Oh, well, it was fun after it lasted.... now i'm off to delete the offending line from the repository... ;-) Jonathon -- Microsoft complaining about the source license used by Linux is like the event horizon calling the kettle black. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message