Subject: Re: Tiled memory
From: [email-masked] (Shankar Unni)

17 Mar 1997 14:34:03 -0800
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
References: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 3.0Gold (X11; I; SunOS 5.5.1 sun4u)
Original-To: Chin Chee-Kai <[email-masked]>
Original-CC: root <[email-masked]>, [email-masked]
Original-Sender: [email-masked]

root <[email-masked]> wrote:

> > i.e. if you declare
> >       _tiled int vector1[1024],vector2[1024],vector3[1024];

and Chin Chee-Kai <[email-masked]> replied:

> This sort of special treatment should be included into some
> sort of optimizing flags, or parallelization flags to tell
> compiler to automatically process, or group instructions to
> process, them in parallel.

I sort of agree with you here. But it's always possible to treat this on
two levels. 

One is to say that we consider this "multimedia data" (for lack of a
better term: "vectors"?) as a special data kind, made up of streams of
packed 8, 16 or 32-bit quantities, and have a special kind for them,
with restrictions (i.e. cannot declare single _tiled int's, and so on). 

This makes it easier on the compiler writer to get off the ground, and
it is not terribly hard on the programmer, because it is usually clear
which variables are your media (or otherwise packed streams or vectors),
and where you are passing them around. 

While you (as a programmer) won't get the most general and powerful
optimizations for all of your character data, you'll get a substantial
benefit for a small expenditure of effort.

> On the other hand, the "_saturated" declarative is perhaps
> necessary as a type modifier (like "unsigned", "long long" etc).

Here, on the other hand, I strongly disagree.  

Saturatedness is not a feature of the data per se, but a feature of the
operation you perform on them. I.e. there will be occasions on which you
want to perform saturating adds on vectors, and other times when you
want to perform non-saturating operations.

What you need for this case is some sort of operator or builtin function
to perform your saturating operations for you.  The most obvious way of
doing this is to add builtin functions for this:

  vector3 = __saturated_add(vector1, vector2)

or, if you want to play games, you can invent either inline operators
(+|, -|, etc.?) or some sort of functional notation like

  vector3 = __saturated(vector1 + vector2)

where __saturated(expression) is treated by the compiler as putting a
"__saturated" attribute on all the arithmetic operators contained
within, if applicable (and maybe error out if not applicable).

-- 
Shankar Unni                                  [email-masked]
Chromatic Research                            (408) 752-9488
-
For help on using this list, send a message to
"[email-masked]" with one line of text: "help".