Poster | Thread |
EntilZha
|  |
Re: Does AOS4 support ALTIVEC? Posted on 30-May-2004 20:34:04
| | [ #103 ] |
|
|
 |
OS4 Core Developer  |
Joined: 27-Aug-2003 Posts: 1679
From: The Jedi Academy, Yavin 4 | | |
|
| Just to let you know: OS4 supports Altivec since today (I had nothing else to do today )
I went for the "simple" approach: When a task starts, it's launched with Altivec disabled, thus no vector registers are stored during context switch. The first altive instruction then generates an exception, and the enable bit is set. From then on, the task saves/restores Altivec context whenever it is scheduled. vrsave is used to keep track of the registers. _________________ Thomas, the kernel guy
"I don't have a frigging clue. I'm norwegian" -- Ole-Egil
All opinions expressed are my own and do not necessarily represent those of Hyperion Entertainment |
|
Status: Offline |
|
|
The_Editor
|  |
Re: Does AOS4 support ALTIVEC? Posted on 30-May-2004 20:42:54
| | [ #104 ] |
|
|
 |
Elite Member  |
Joined: 7-Mar-2003 Posts: 7629
From: 192.168.0.02 ..Pederburgh .. Iceni | | |
|
| @EntilZha This is a news item Mr Frieden !!
btw ..
WELL DONE _________________ ****************************************** I dont suffer from Insanity - I enjoy it
****************************************** |
|
Status: Offline |
|
|
ajs
|  |
Re: Does AOS4 support ALTIVEC? Posted on 30-May-2004 20:43:50
| | [ #105 ] |
|
|
 |
Super Member  |
Joined: 8-Mar-2003 Posts: 1459
From: Surrey | | |
|
| @EntilZha
_________________
Everything is proceeding as I have foreseen 
Some people are like slinkies. Not really good for anything but they bring a smile to your face when pushed down the stairs. |
|
Status: Offline |
|
|
dimmck
|  |
Re: Does AOS4 support ALTIVEC? Posted on 30-May-2004 23:17:46
| | [ #106 ] |
|
|
 |
Regular Member  |
Joined: 3-Sep-2003 Posts: 415
From: Cheney, WA | | |
|
| @EntilZha
Quote:
EntilZha wrote: Just to let you know: OS4 supports Altivec since today (I had nothing else to do today )
I went for the "simple" approach: When a task starts, it's launched with Altivec disabled, thus no vector registers are stored during context switch. The first altive instruction then generates an exception, and the enable bit is set. From then on, the task saves/restores Altivec context whenever it is scheduled. vrsave is used to keep track of the registers. |
That's great news. It's really great when you have nothing else to do. I doubt that happens very often.
Anyway, by the time that becomes available in the the first update to OS4, maybe I'll have figured out how to put it to use. As it is, I know almost nothing about Altivec.
Dave M.
|
|
Status: Offline |
|
|
tomazkid
 |  |
Re: Does AOS4 support ALTIVEC? Posted on 30-May-2004 23:41:27
| | [ #107 ] |
|
|
 |
Team Member  |
Joined: 31-Jul-2003 Posts: 11694
From: Kristianstad, Sweden | | |
|
| |
Status: Offline |
|
|
Bobsonsirjonny
|  |
Re: Does AOS4 support ALTIVEC? Posted on 31-May-2004 0:14:13
| | [ #108 ] |
|
|
 |
Elite Member  |
Joined: 28-Jul-2003 Posts: 2880
From: Unknown | | |
|
| |
Status: Offline |
|
|
Bodie
|  |
Re: Does AOS4 support ALTIVEC? Posted on 31-May-2004 1:21:05
| | [ #109 ] |
|
|
 |
Super Member  |
Joined: 9-Jan-2003 Posts: 1439
From: Azjol-Nerub | | |
|
| @EntilZha
bloody great news indeed .
|
|
Status: Offline |
|
|
Treke
|  |
Re: Does AOS4 support ALTIVEC? Posted on 31-May-2004 7:41:17
| | [ #110 ] |
|
|
 |
Regular Member  |
Joined: 17-Mar-2003 Posts: 137
From: EU | | |
|
| @EntilZha
Quote:
Just to let you know: OS4 supports Altivec since today (I had nothing else to do today ) I went for the "simple" approach: When a task starts, it's launched with Altivec disabled, thus no vector registers are stored during context switch. The first altive instruction then generates an exception, and the enable bit is set. From then on, the task saves/restores Altivec context whenever it is scheduled. vrsave is used to keep track of the registers. |
Congrats. If bits in vrsave are zero, then no save is done, even if the task is already using Altivec ? Did I get it right ? |
|
Status: Offline |
|
|
jd997uk
|  |
Re: Does AOS4 support ALTIVEC? Posted on 31-May-2004 7:53:08
| | [ #111 ] |
|
|
 |
Regular Member  |
Joined: 11-Mar-2003 Posts: 135
From: Portsmouth | | |
|
| @Bobsonsirjonny
Re C Programming
Leicester University has decent online tutorials here. Should be enough to get you started.
-john |
|
Status: Offline |
|
|
Rogue
|  |
Re: Does AOS4 support ALTIVEC? Posted on 31-May-2004 8:23:25
| | [ #112 ] |
|
|
 |
OS4 Core Developer  |
Joined: 14-Jul-2003 Posts: 3999
From: Unknown | | |
|
| @Treke
Quote:
If bits in vrsave are zero, then no save is done, even if the task is already using Altivec ? Did I get it right ? |
Yes. Usually, gcc clears vrsave when leaving a function that uses altivec, so task scheduler overhead is minimal. _________________ Seriously, if you want to contact me do not bother sending me a PM here. Write me a mail |
|
Status: Offline |
|
|
Anonymous
|  |
Re: Does AOS4 support ALTIVEC? Posted on 31-May-2004 8:33:49
| | [ # ] |
|
| @Rogue
Will there be a trap library for processors without altivec? Or will using binaries with altivec code simply crash on processors without it?
/Björn |
|
|
|
|
Rogue
|  |
Re: Does AOS4 support ALTIVEC? Posted on 31-May-2004 10:29:51
| | [ #114 ] |
|
|
 |
OS4 Core Developer  |
Joined: 14-Jul-2003 Posts: 3999
From: Unknown | | |
|
| @Orgin
Quote:
Will there be a trap library for processors without altivec? Or will using binaries with altivec code simply crash on processors without it? |
Writing an "emulation" for altivec is a big task, and I don't think we'll be going through this. There are functions in the Exec API to test for the presence of Altivec, and applications are required to check this and not execute altivec instructions if not present.
_________________ Seriously, if you want to contact me do not bother sending me a PM here. Write me a mail |
|
Status: Offline |
|
|
MagicSN
|  |
Re: Does AOS4 support ALTIVEC? Posted on 31-May-2004 10:30:09
| | [ #115 ] |
|
|
 |
Hyperion  |
Joined: 10-Mar-2003 Posts: 640
From: Unknown | | |
|
| @Orgin
I'd say it might make sense to check what sort of CPU (check == with the provided API by the AltiVec-using program) is in an Amiga before using Altivec features. If not replacement non-Altivec-functions should be used by the program, without needed user-interaction, IMHO.
Steffen
|
|
Status: Offline |
|
|
Anonymous
|  |
Re: Does AOS4 support ALTIVEC? Posted on 31-May-2004 10:41:00
| | [ # ] |
|
| @Rogue
Okey cool. Thanks.
I assume that it would technically be possible for a third party to supply such emulation though? (If looking at it technically and not whether there would be a need for it.)
/Björn |
|
|
|
|
Rogue
|  |
Re: Does AOS4 support ALTIVEC? Posted on 31-May-2004 11:36:42
| | [ #117 ] |
|
|
 |
OS4 Core Developer  |
Joined: 14-Jul-2003 Posts: 3999
From: Unknown | | |
|
| @Orgin
Quote:
I assume that it would technically be possible for a third party to supply such emulation though? (If looking at it technically and not whether there would be a need for it.) |
Yes. It would cause a "program exception", and an emulation would need to check for the instruction that caused this, and emulate its meaning._________________ Seriously, if you want to contact me do not bother sending me a PM here. Write me a mail |
|
Status: Offline |
|
|
Treke
|  |
Re: Does AOS4 support ALTIVEC? Posted on 31-May-2004 12:26:34
| | [ #118 ] |
|
|
 |
Regular Member  |
Joined: 17-Mar-2003 Posts: 137
From: EU | | |
|
| @Rogue
AFAIR, the Altivec.resource isn't done yet, it is scheduled only for final version ?
Btw the solution suggested by codesmith in 2nd reply from top looks more effective (if the exception handling is fast), but it is harder to implement. A bit speculative in speedup gain, but maybe worth a measure.
Don't take it as a nitpicking pls, (and on the end of the thread ! ) the Altivec support is realy a great thing.
re
Treke |
|
Status: Offline |
|
|
Rogue
|  |
Re: Does AOS4 support ALTIVEC? Posted on 31-May-2004 14:16:21
| | [ #119 ] |
|
|
 |
OS4 Core Developer  |
Joined: 14-Jul-2003 Posts: 3999
From: Unknown | | |
|
| @Treke
Quote:
AFAIR, the Altivec.resource isn't done yet, it is scheduled only for final version ? |
Altivec resource was meant as an arbitration/detection method for Altivec. It has been more or less superceeded by Exec's API function GetCPUInfo.
Quote:
Btw the solution suggested by codesmith in 2nd reply from top looks more effective (if the exception handling is fast), but it is harder to implement. A bit speculative in speedup gain, but maybe worth a measure. |
The problem here would be to anticipate when a task is going to use the altivec unit or not. That is, if Task A is preempted then you don't know if task B is going to use altivec or not.
The proposed method of storing the altivec registers in the interrupt is a bit problematic - the vector for the Altivec Unavailable interrupt is rather small, and the PowerPC does not save anything onto the stack upon an exception, so you would need to store the current CPU context before you can do any sensible work._________________ Seriously, if you want to contact me do not bother sending me a PM here. Write me a mail |
|
Status: Offline |
|
|
EntilZha
|  |
Re: Does AOS4 support ALTIVEC? Posted on 31-May-2004 14:37:33
| | [ #120 ] |
|
|
 |
OS4 Core Developer  |
Joined: 27-Aug-2003 Posts: 1679
From: The Jedi Academy, Yavin 4 | | |
|
| @Treke
Quote:
AFAIR, the Altivec.resource isn't done yet, it is scheduled only for final version ? |
It won't be necessary. Initially, it was meant to "allocate" vetor registers, but since gcc generates the necessary vrsave code itself, and without the use of the system, it wasn't needed anymore. Same goes for streams.
To detect if there is an Altivec unit, you can use a new exec function ("GetCPUInfo") that will tell you if there is one or not.
Quote:
Btw the solution suggested by codesmith in 2nd reply from top looks more effective (if the exception handling is fast), but it is harder to implement. A bit speculative in speedup gain, but maybe worth a measure |
This is probably more efficient (I haven't looked at this in detail yet), but since the scheduler will be replaced for 4.1, the more sophistcated algorithm can come in later. For now, the vrsave and msr marking will make sure that the overhead is kept at a minimum. The important point is that it works And it's transparent to the application code, anyway, so later changes will not affect the applications..._________________ Thomas, the kernel guy
"I don't have a frigging clue. I'm norwegian" -- Ole-Egil
All opinions expressed are my own and do not necessarily represent those of Hyperion Entertainment |
|
Status: Offline |
|
|
Jorge
|  |
Re: Does AOS4 support ALTIVEC? Posted on 1-Jun-2004 11:35:49
| | [ #121 ] |
|
|
 |
Cult Member  |
Joined: 20-Oct-2003 Posts: 657
From: Scottsdale, AZ | | |
|
| @MagicSN
Quote:
I'd say it might make sense to check what sort of CPU (check == with the provided API by the AltiVec-using |
Well, now isn't that a cool thing in combination with the interface structures:
struct RenderIF * aRenderIF;
if (ExecIF->GetCPU()) & ALTIVEC) // or however this goes { render_lib = OpenLibrary("myPlainG3Render.library",0); aRenderIF = ObtainInterface(render_lib); } else { render_lib = OpenLibrary("mySIMDRender.library",0); aRenderIF = ObtainInterface(render_lib); }
aRenderIF->RenderMe();
I guess this would work ;)
Real OOP at OS level _________________ AmigaOne XE G3/933/VIA/FM801/R200 (fixed), G3SE/600/Voodoo3/Sil680/RTL8139/SBLive! (noiseless!) µA1-MK2/G3/933/R200/CMI8738 XE/G4 (broken 7450/800) |
|
Status: Offline |
|
|
olegil
|  |
Re: Does AOS4 support ALTIVEC? Posted on 1-Jun-2004 12:25:22
| | [ #122 ] |
|
|
 |
Elite Member  |
Joined: 22-Aug-2003 Posts: 5895
From: Work | | |
|
| @Jorge
If that one gets verified it needs to become the start of a HOW-TO immediately  _________________ This weeks pet peeve: Using "voltage" instead of "potential", which leads to inventing new words like "amperage" instead of "current" (I, measured in A) or possible "charge" (amperehours, Ah or Coulomb, C). Sometimes I don't even know what people mean. |
|
Status: Offline |
|
|