> 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. > Yeah, just #define B_BITMAP_CACHE_ALIGNED 0x00000100 ... François.