Welcome, Guest. Please login or register.

Author Topic: 64KiB alignment?  (Read 3029 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline ejstansTopic starter

  • Newbie
  • *
  • Join Date: Jun 2009
  • Posts: 48
    • Show only replies by 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
    • Show only replies by Piru
    • 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 ejstansTopic starter

  • Newbie
  • *
  • Join Date: Jun 2009
  • Posts: 48
    • Show only replies by 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

  • Hero Member
  • *****
  • Join Date: Nov 2004
  • Posts: 2890
    • Show only replies by 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

  • Hero Member
  • *****
  • Join Date: Nov 2003
  • Posts: 2608
    • Show only replies by ChaosLord
    • http://totalchaoseng.dbv.pl/news.php
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

  • Hero Member
  • *****
  • Join Date: Nov 2003
  • Posts: 2608
    • Show only replies by ChaosLord
    • http://totalchaoseng.dbv.pl/news.php
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

  • Hero Member
  • *****
  • Join Date: Nov 2004
  • Posts: 2890
    • Show only replies by 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

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show only replies by 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

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 1786
  • Country: 00
    • Show only replies by Crumb
    • http://cuaz.sourceforge.net
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

  • Full Member
  • ***
  • Join Date: Feb 2011
  • Posts: 119
    • Show only replies by 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

  • Hero Member
  • *****
  • Join Date: Jan 2003
  • Posts: 592
    • Show only replies by minator
    • http://www.blachford.info
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 ejstansTopic starter

  • Newbie
  • *
  • Join Date: Jun 2009
  • Posts: 48
    • Show only replies by 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