From: fjh@mundook.cs.mu.OZ.AU (Fergus Henderson)
Subject: Re: Q: unboxed values and polymorphism
Date: 1996/07/02
Date: 1996-07-02T00:00:00+00:00 [thread overview]
Message-ID: <4rbgqf$t89@mulga.cs.mu.OZ.AU> (raw)
In-Reply-To: dewar.835939891@schonberg
dewar@cs.nyu.edu (Robert Dewar) writes:
>Hannes said
>
>"Let's assume your fixnums have the low bits `00' as tags. To add
>two fixnums, you would extract them from the word, perform the
>usual addition and put the result in a variant record? I'd just
>add the words."
>
>So what, you would get the same code!
That's presuming the compiler is smart enough, which is a very big IF.
Have you tried this with GNAT?
I tried a simple example in C, and found that GNU C on an Alpha
generated worse code using bitfields than using the approach
suggested by Hannes above; in particular, it does not avoid the
unnecessary shifts on the operands and result of the addition.
I doubt if GNAT would do any better.
(The test case I used is available on request, should anyone wish
to duplicate the results of my experimentation.)
--
Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger fjh@128.250.37.3 | -- the last words of T. S. Garp.
next prev parent reply other threads:[~1996-07-02 0:00 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-06-15 0:00 Q: unboxed values and polymorphism Hannes Haug
1996-06-15 0:00 ` Robert Dewar
1996-06-15 0:00 ` Jon S Anthony
1996-06-16 0:00 ` Hannes Haug
1996-06-17 0:00 ` Tucker Taft
1996-06-17 0:00 ` Hannes Haug
1996-06-18 0:00 ` Fergus Henderson
1996-06-18 0:00 ` Robert Dewar
1996-06-22 0:00 ` Robert A Duff
1996-06-22 0:00 ` Robert Dewar
1996-06-17 0:00 ` Tucker Taft
1996-06-17 0:00 ` Tucker Taft
1996-06-22 0:00 ` Hannes Haug
1996-06-22 0:00 ` Robert Dewar
[not found] ` <uvvhgryr22d.fsf@chaq.informatik.uni-tuebingen.de>
1996-06-28 0:00 ` Robert Dewar
1996-07-02 0:00 ` Fergus Henderson [this message]
1996-06-18 0:00 ` Jon S Anthony
1996-06-19 0:00 ` Hannes Haug
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox