Welcome, Guest. Please login or register.
Amiga Kit Amiga Store Iridium Banner AMIStore App Store A1200/A600 4xIDE Interface

AuthorTopic: 64KiB alignment?  (Read 1743 times)

0 Members and 1 Guest are viewing this topic.

Offline ejstans

64KiB alignment?
« 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?
"It is preferable not to travel with a dead machine."

A500 1.3 / 512KiB slowmem / GVP HD8 w/ 8MiB fastmem & 52MB HDD
A600 2.05 / 1GB SSD
A1200 3.0 / Blizzard 1200/4 w/ 68882 @ 33MHz / 1GB SSD
A1200T 3.0 / Apollo 1260 w/ 68EC060 @ 50MHz & 16 MiB fastmem / 4GB SSD
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
  • Total likes: 0
    • http://www.iki.fi/sintonen/
Re: 64KiB alignment?
« Reply #1 on: July 10, 2011, 06:53:02 PM »
Quote from: ejstans;648945
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.
 

Offline ejstans

Re: 64KiB alignment?
« Reply #2 on: July 10, 2011, 07:06:17 PM »
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" 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?
"It is preferable not to travel with a dead machine."

A500 1.3 / 512KiB slowmem / GVP HD8 w/ 8MiB fastmem & 52MB HDD
A600 2.05 / 1GB SSD
A1200 3.0 / Blizzard 1200/4 w/ 68882 @ 33MHz / 1GB SSD
A1200T 3.0 / Apollo 1260 w/ 68EC060 @ 50MHz & 16 MiB fastmem / 4GB SSD
 

Offline Zac67

Re: 64KiB alignment?
« Reply #3 on: July 10, 2011, 07:25:33 PM »
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...
 

Offline ChaosLord

Re: 64KiB alignment?
« Reply #4 on: July 10, 2011, 07:48:14 PM »
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.
Wanna try a wonderfull strategy game with lots of handdrawn anims,
Magic Spells and Monsters, Incredible playability and lastability,
English speech, etc. Total Chaos AGA
 

Offline ChaosLord

Re: 64KiB alignment?
« Reply #5 on: July 10, 2011, 07:50:24 PM »
Would it help speed up WinUAE if I increased my alignment to 128-bit or larger?
Wanna try a wonderfull strategy game with lots of handdrawn anims,
Magic Spells and Monsters, Incredible playability and lastability,
English speech, etc. Total Chaos AGA
 

Offline Zac67

Re: 64KiB alignment?
« Reply #6 on: July 10, 2011, 09:22:36 PM »
Modern x86 CPUs use 64-byte cache lines, so 512-bit alignment may be of advantage for emulation - provided emulation memory gets aligned, too...
 

Offline Karlos

Re: 64KiB alignment?
« Reply #7 on: July 10, 2011, 09:25:03 PM »
Quote from: Zac67;648968
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.
int p; // A
 

Offline Crumb

Re: 64KiB alignment?
« Reply #8 on: July 10, 2011, 09:29:58 PM »
Quote from: ChaosLord;648951
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 only spanish amiga news web page/club: Club de Usuarios de Amiga de Zaragoza (CUAZ)
 

Offline Leffmann

Re: 64KiB alignment?
« Reply #9 on: July 10, 2011, 10:07:32 PM »
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.
 

Offline psxphill

Re: 64KiB alignment?
« Reply #10 on: July 10, 2011, 10:09:35 PM »
Quote from: ChaosLord;648951
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.
 

Offline minator

Re: 64KiB alignment?
« Reply #11 on: July 11, 2011, 01:15:51 AM »
Quote from: ChaosLord;648951
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.
 

Offline ejstans

Re: 64KiB alignment?
« Reply #12 on: July 11, 2011, 08:49:37 AM »
Quote from: Leffmann;648981
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.

Quote from: psxphill;648982
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! :)
"It is preferable not to travel with a dead machine."

A500 1.3 / 512KiB slowmem / GVP HD8 w/ 8MiB fastmem & 52MB HDD
A600 2.05 / 1GB SSD
A1200 3.0 / Blizzard 1200/4 w/ 68882 @ 33MHz / 1GB SSD
A1200T 3.0 / Apollo 1260 w/ 68EC060 @ 50MHz & 16 MiB fastmem / 4GB SSD