[openbeos] Re: app_server: MMX/SSE help wanted

I've got a question about aligning bitmaps.  Why do we
need a new constructor or flag at all?  Why not simply
align all bitmaps?  Also because bitmaps have this
sort of property that they can possibly be arbitrarily
large, it seems reasonable to be thinking about 
allocating the memory in a way that would help the VM
to deal with them. (page boundary anyone?)

I suppose there might be an issue with performing the
alignment on a graphics card (depending on the driver
API) but we can always simply make a best effort, 
can't we?

Andrew

-----Original Message-----
From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
To: openbeos@xxxxxxxxxxxxx
Date: Tue, 10 Aug 2004 20:40:45 +0200 CEST
Subject: [openbeos] Re: app_server: MMX/SSE help wanted

Adi Oanca <e2joseph@xxxxxxxxxx> wrote:
> > So from the SIMD coders perspective, it would be very good if Haiku 
> > would 
> > offer some control over data alignment for bitmap allocations.
> > This includes not only the base address of the bitmap, but should 
> > ideally 
> > extend to each bitmap row, in cases where each row has to be 
> > processed 
> > separately (e.g. by blur routines:). 
> > 
> > Of course there'd be some 'waste', but I don't think this would 
> > matter too 
> > much on modern systems. Binary compatibility shouldn't be a problem 
> > either, 
> > as the BeBook already says that BytesPerRow() are decisive on 
> > determing a 
> > bitmaps actual size.
> > 
> > This might be implemented by an additional constructor without too 
> > much 
> > fuss, I'd guess. It would be great if you could implement this, as 
> > this 
> > would make SIMD coding much easier and less bug-prone.
>       OK, you'll have that. Now, I have to see how. :-) Axel, can you 
> help?

What he means is: we would need a change of the public API, that is add 
another BBitmap constructor that allows an alignment. What we could 
also do is to add another bitmap flag to force an ideal alignment for 
the current CPU.

Bye,
   Axel.






Other related posts: