Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Jun 2001 18:42:37 +0100
From:      j mckitrick <jcm@FreeBSD-uk.eu.org>
To:        John Merryweather Cooper <jmcoopr@webmail.bmi.net>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: what does this define do?
Message-ID:  <20010621184237.B31729@dogma.freebsd-uk.eu.org>
In-Reply-To: <20010620104718.C14541@johncoop>; from jmcoopr@webmail.bmi.net on Wed, Jun 20, 2001 at 10:47:18AM -0700
References:  <20010620173855.A2941@dogma.freebsd-uk.eu.org> <20010620094925.A14541@johncoop> <20010620182353.A3958@dogma.freebsd-uk.eu.org> <20010620104718.C14541@johncoop>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010621184237.B31729>