Amiga.org
Operating System Specific Discussions => Amiga OS => Amiga OS -- Development => Topic started by: ejstans on July 10, 2011, 06:17:27 PM
-
Hola!
I was reading through some old Amiga magazine where it talked about aligning bitplanes on 64KiB boundaries for maximum speed. Huh? What's this about?
-
I was reading through some old Amiga magazine where it talked about aligning bitplanes on 64KiB boundaries for maximum speed. Huh? What's this about?
64bit. Either the article is incorrect or you read it wrong.
-
There's a good chance the article is incorrect (they've printed nonsense before), but I did find another reference to the 64KiB alignment. In the "How to code (http://www.mways.co.uk/amiga/howtocode/text/generalguidelines.php)" series, in the section on relocatable code, we find the following sentence: "If you require bitplanes to be on a 64Kb boundary then try the following [...]" followed by code clearly trying to allocate on 64 kilobyte boundary.
It doesn't say anything about the reason for such a want though.
So, what are they talking about, if not nonsense? Worth pointing out that this is pre-AGA also. Is the 64-bit alignment applicable on OCS/ECS?
-
OCS/ECS don't care too much about alignment, needs to be 16-bit obviously. AGA introduced 32-bit access, so bitplanes need to be aligned likewise.
I suppose 64-bit is for emulation optimization. 64 KiB sounds very strange...
-
All my bitplanes are 64-bit aligned. If anyone can find any evidence that 128-bit or larger alignment provides an advantage then please tell me. Thanks.
-
Would it help speed up WinUAE if I increased my alignment to 128-bit or larger?
-
Modern x86 CPUs use 64-byte cache lines, so 512-bit alignment may be of advantage for emulation - provided emulation memory gets aligned, too...
-
Modern x86 CPUs use 64-byte cache lines, so 512-bit alignment may be of advantage for emulation - provided emulation memory gets aligned, too...
I'd hope that the emulated amiga's memory blocks were page aligned on the host.
-
All my bitplanes are 64-bit aligned. If anyone can find any evidence that 128-bit or larger alignment provides an advantage then please tell me. Thanks.
There are certain 040/060 instructions that allow performing very fast memcpy when data is 128bit aligned but I don't think it makes much difference with chipram in practice.
-
The reason people did 64K alignment of bitplanes, and more often areas touched by the Blitter, was in order to squeeze out a little extra performance by not having to repeatedly set the high word of the pointers since it wouldn't change.
In a tight loop doing many smaller blits you could always up the number of bobs or whatever on the screen like this, especially on the unexpanded classic machines.
Aligning the data in your emulated Amiga on 64 byte boundaries to suit the outside machine isn't going to make a difference, there's just too much stuff happening for that to be noticable, but f.ex aligning your 32-bit accesses on 68020 and up will of course still matter inside your emulated Amiga.
-
All my bitplanes are 64-bit aligned. If anyone can find any evidence that 128-bit or larger alignment provides an advantage then please tell me. Thanks.
Aligning on 64k boundaries allows you to do some funky things just by updating the high part of the blitter/bitplane address registers.
-
All my bitplanes are 64-bit aligned. If anyone can find any evidence that 128-bit or larger alignment provides an advantage then please tell me. Thanks.
IIRC the G5 cache lines were 128 bytes long so it makes sense to align them on that scale if you plan on running on a G5 or X1000.
OTOH 64KB doesn't make much sense.
-
The reason people did 64K alignment of bitplanes, and more often areas touched by the Blitter, was in order to squeeze out a little extra performance by not having to repeatedly set the high word of the pointers since it wouldn't change.
In a tight loop doing many smaller blits you could always up the number of bobs or whatever on the screen like this, especially on the unexpanded classic machines.
Aligning the data in your emulated Amiga on 64 byte boundaries to suit the outside machine isn't going to make a difference, there's just too much stuff happening for that to be noticable, but f.ex aligning your 32-bit accesses on 68020 and up will of course still matter inside your emulated Amiga.
Aligning on 64k boundaries allows you to do some funky things just by updating the high part of the blitter/bitplane address registers.
Ah, thank you both! This would explain it then! :)