Home   News   Concept   AMIGA-Compatible   Hardware   Forum   Questions+Answers   Pictures   Contact & Team

Welcome to the Natami / Amiga Forum

This forum is for AMIGA fans interested in the new NATAMI platform.
Please read the forum usage manual.



All TopicsNewsQAFeaturesTalkTEAMLogin to post    Create account
Do you have ideas and feature wishes? Post them here and discuss your ideas.

Optimized Blits?
Børge Nøst
Norway

Posts 53
25 Nov 2011 17:44


So a stray thought entered my mind while driving home today:
Would it be possible/feasible to have optimized blits in the new blitter (also for classic mode)? I need to give some examples:

You do some blits that turn out to be a no-op - what you write back to memory is the same you read from it: Drop the write cycle. (Needs a cache of some kind. Small one though.)

You do a cookie-cutter, but the mask(or the mask registers) and OR data is 0(a null op anyway): Same effect as above really, but if you can re-order the reads so you skip reading destination you can drop a read and write cycle.
I could imagine this might happen when a bob is word aligned if the code does not do a check for that.

Not sure how much of a win it could be, but I thought it interesting to theorize about.

Samuel D Crow
USA
(Natami Team)
Posts 1295
25 Nov 2011 19:04


That sounds like a job for software.  I'll consider it when the AROS NatAmi drivers get written.

Børge Nøst
Norway

Posts 53
25 Nov 2011 22:37


Nono, this is not sw, this is peephole style micro-optimizations in the blitter. Something like only happening a few times per blit or only happening when a bob X position is divisible by 16 (and the coder has not put in an optimization check for just that).

The cache I mentioned should already be halfway there inside the chip, you only need the A, B, and C data words(depending on active DMA channels) with the matching address they used (16 bits data and no more than 32 bits of address, fitting well into a 64bit int or custom defined size) and do a parallel compare to D/destination; skip cycle if equal.

(My other suggestion needs more logic.)

Should be possible to modify UAE to test this?

Samuel D Crow
USA
(Natami Team)
Posts 1295
25 Nov 2011 23:04


It sounds to me like the hardware solution would form bubbles in the pipeline and possibly even stall the pipeline making it slower than it would have been otherwise.

Thomas Richter
Germany
(MX-Board Owner)
Posts 1425
26 Nov 2011 09:58


Samuel D Crow wrote:

It sounds to me like the hardware solution would form bubbles in the pipeline and possibly even stall the pipeline making it slower than it would have been otherwise.

It's probably up to Thomas to answer this, but: The current (simple) blitter implementation has a bandwidth limitation anyhow due to a known issue of the blitter queue.
For the final implementation, the blitter memory interface will be completely different from the "fixed DMA slots" implementation of the Amiga anyhow, so I wouldn't worry too much about this.

There are probably more issues with the line mode at the moment since it is still a bit unclear how it works on a lower level. For example, we suspect (but do not know) that the original blitter line mode made one pair of memory accesses *per pixel* when drawing a line. This, of course, could be improved a lot by a single cache line of memory which is not written out per DMA unless the blitter leaves it. This seems to be a trivial optimization here, and it would then likely speed up line drawing by a factor of probably more than 100 (128 bits per line?) over that of a naive implementation.


Marcel Verdaasdonk
Netherlands

Posts 3974
26 Nov 2011 19:46


biggest speed bump would be the transfer from 16b to 32b in a manner that is compatible with the old address layout.
How i would do it but this is how i would do it is make a 32b register outside the old mapping and point the original register only the the lower 16 bits.

But then again this is how i would expand the old hardware without breaking compatibility.

Thomas Richter
Germany
(MX-Board Owner)
Posts 1425
27 Nov 2011 11:18


That's part of the deal. In the end, it does not matter how big the blitter control registers are. What matters is that the blitter hardware uses the optimized memory interface to "burst read" entire lines of memory, and "burst write" entire lines back. The register layout will be "16 bits" as ever, but that doesn't mean the blitter internally accesses memory in chunks of 16 bits. This would be highly inefficient indeed.


Marcel Verdaasdonk
Netherlands

Posts 3974
27 Nov 2011 13:25


Not talking about the blitter persé, nor it's control registers.
Data registers and Source registers.

Thomas Richter
Germany
(MX-Board Owner)
Posts 1425
27 Nov 2011 17:44


Marcel Verdaasdonk wrote:

Not talking about the blitter persé, nor it's control registers.
  Data registers and Source registers.

I wonder then why you would need them 32 bit in size. Speed wise it wouldn't make a difference.


Marcel Verdaasdonk
Netherlands

Posts 3974
27 Nov 2011 18:02


thomas so it wouldn't matter if the datapath of the blitter is twice as wide as a original?

Thomas Richter
Germany
(MX-Board Owner)
Posts 1425
28 Nov 2011 09:40


Marcel Verdaasdonk wrote:

  thomas so it wouldn't matter if the datapath of the blitter is twice as wide as a original?
 

  It *is* twice as wide as original. Actually, more than twice as wide, even. Please don't confuse the register size with the bus width, the blitter should be able to bundle accesses anyhow and access a whole line at once - DDR ram doesn't work like the simple RAM we had in the Amiga where you could pull out bytes individually.

 

Marcel Verdaasdonk
Netherlands

Posts 3974
28 Nov 2011 10:37


thomas that i do happen to know

Thomas Richter
Germany
(MX-Board Owner)
Posts 1425
28 Nov 2011 12:18


Marcel Verdaasdonk wrote:

thomas that i do happen to know

Sorry, I really miss your point then. As long as the final blit is fast, why should I worry about the register size then?

Marcel Verdaasdonk
Netherlands

Posts 3974
28 Nov 2011 12:56


ThoR I talk about one thing and you talk about another, are you on linkedin?

posts 14