Poster | Thread |
EntilZha
| |
Re: Does AOS4 support ALTIVEC? Posted on 14-May-2004 11:01:20
| | [ #43 ] |
|
|
|
OS4 Core Developer |
Joined: 27-Aug-2003 Posts: 1679
From: The Jedi Academy, Yavin 4 | | |
|
| @ssolie
Quote:
Personally, I like XP's advice in this kind of situation. The AltiVec feature is important but the effort to tune it now may not be worth it as it affects a very small set of programs at the moment (1 by my count). Besides, you can always improve it in a later iteration (e.g. BoingBag, 4.1) if need be. |
That's what I meant: I don't know if all the hassle is worth the effort...
Quote:
Besides, there are much more important features to worry about *cough* SNAP *cough* in my opinion. |
SNAP porting is in full swing, but naturally, not by me That's the good thing about having a big team. I currently exclusively focus on exec resp. kernel related issues._________________ 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 |
|
|
vortexau
| |
Re: Does AOS4 support ALTIVEC? Posted on 14-May-2004 11:01:46
| | [ #44 ] |
|
|
|
Elite Member |
Joined: 10-Mar-2003 Posts: 2651
From: . . outside the Pod-bay; Australia | | |
|
| Are all of these ideas different from
how Apple uses AltiVec? Quote:
Notes About Optimization
Most applications will see dramatic performance gains by optimizing only a small number of key functions. It is usually not productive, and sometimes counter-productive to optimize everything. This is because often only a small handful of functions are responsible for the vast majority of the CPU time used by your application. Optimizing code that is never or rarely executed wastes your time and frequently results in larger functions that needlessly take up more system resources. The good news is that this means that just a little bit of work applied to the right functions will likely result in large improvements in overall speed. |
Of course, there must be some differences between pre-OSX, and post OSX, as Multitasking wasn't correctly implimented prior to X!_________________ -vortexau, who's A1 XE-G4 remains at half-RAM ! A2000HD (from 1991) 060 64Mb PicassoII with OS3.5 . . . still working. |
|
Status: Offline |
|
|
EntilZha
| |
Re: Does AOS4 support ALTIVEC? Posted on 14-May-2004 11:05:52
| | [ #45 ] |
|
|
|
OS4 Core Developer |
Joined: 27-Aug-2003 Posts: 1679
From: The Jedi Academy, Yavin 4 | | |
|
| @CodeSmith
Quote:
My algorithm is different - it is adaptive. Instead of looking at "uses altivec" for the lifetime of the task (this is "no" until the first time Altivec is used, and then it is "yes" from them on) |
Remember that there's a dedicated register (vrsave) that stores the registers invovled. When the task finishes using altive registers, vrsave will be 0, and no further Altivec context will be switched..._________________ 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 |
|
|
Bobsonsirjonny
| |
Re: Does AOS4 support ALTIVEC? Posted on 14-May-2004 13:01:03
| | [ #46 ] |
|
|
|
Elite Member |
Joined: 28-Jul-2003 Posts: 2880
From: Unknown | | |
|
| @EntilZha
My head now hurts - I got lost somewhere after the second page of the this topic..If its a vector engine is that like a built in graphics pre-processor?
Karlos was showing me how to code in C a while back but he's currently really busy. I know what a function is, and what a class is, and how you gotta call em all at the start, and they are all parented etc.. and I did the standard "hello world" but have since got forgotten. So I'm gonna get a good book on C. Can anyone recommend one?
|
|
Status: Offline |
|
|
BrianK
| |
Re: Does AOS4 support ALTIVEC? Posted on 14-May-2004 13:46:43
| | [ #47 ] |
|
|
|
Elite Member |
Joined: 30-Sep-2003 Posts: 8111
From: Minneapolis, MN, USA | | |
|
| @vortexau
Quote:
Of course, there must be some differences between pre-OSX, and post OSX, as Multitasking wasn't correctly implimented prior to X! |
Some differences? Major underlying differences. Switching The Mac OS to the Mach kernel with a BSD amalgam was the major factor in X. This added true multitasking, better multitreading, and better multiple CPU support.
Here's some history of Mach and Apple. http://www.stepwise.com/Articles/Technical/MeetMach.html
Something to scare you all? Rick Rashid was the main person behind Mach he's been working at Microsoft for at least 10 years. The microkernel in WinNT and XP is based upon his work using a microkernel very similar to Mach. http://www.microsoft.com/presspass/exec/rick/default.asp
|
|
Status: Offline |
|
|
Bobsonsirjonny
| |
Re: Does AOS4 support ALTIVEC? Posted on 14-May-2004 15:29:33
| | [ #48 ] |
|
|
|
Elite Member |
Joined: 28-Jul-2003 Posts: 2880
From: Unknown | | |
|
| @BrianK
Huh? How??? I mean...
M$ have something that works really well and then they turn it into XP...
Apple take it and you get OS X - which IMHO kicks arse. I hate MAC OS classic with a passion - but OS X is great. |
|
Status: Offline |
|
|
Karlos
| |
Re: Does AOS4 support ALTIVEC? Posted on 14-May-2004 19:54:43
| | [ #49 ] |
|
|
|
Elite Member |
Joined: 24-Aug-2003 Posts: 4411
From: As-sassin-aaate! As-sassin-aaate! Ooh! We forgot the ammunition! | | |
|
| @Bobsonsirjonny
Quote:
My head now hurts - I got lost somewhere after the second page of the this topic..If its a vector engine is that like a built in graphics pre-processor?
|
'lo bob,
Altivec (also known as Velocity Engine etc.) is a form of SIMD (single instruction multiple data) added to the powerpc to speed up certian types of tasks. You can think of it as being a similar technology to MMX or 3DNow. It's handy for computationally repetetive tasks such as AV streaming, 3D calculations etc. since it can apply the same operation simultaneously to several sets of data, thus acheiving a degree of parallel processing.
The altivec unit is an add on to the CPU, much like a FPU is. Your software has to be written in order to take advantage of it, just like software needs to be written to take advantage of your FPU etc.
Quote:
Karlos was showing me how to code in C a while back but he's currently really busy. I know what a function is, and what a class is
|
Sorry about that. If you know functions, half of C is done. Classes are for C++, but if you know structures and functions from C, classes are pretty easy to comprehend.
Quote:
So I'm gonna get a good book on C. Can anyone recommend one?
|
Actually GadgetMaster found some cool videos and stuff for introducing C. I'll have to ask him about it _________________ Doing stupid things for fun... |
|
Status: Offline |
|
|
Stilgar
| |
Re: Does AOS4 support ALTIVEC? Posted on 14-May-2004 22:22:40
| | [ #50 ] |
|
|
|
Regular Member |
Joined: 7-Nov-2003 Posts: 152
From: Unknown | | |
|
| RE: C books
Try
A Book on C, Kelley,Pohl, Published by Addison Welsley
I have an unfortunate problem with programming language books that I never get past the fourth chapter, but up until there it was pretty good.
The standard text is of course The C Programming language, by Kernighan and Richie, but its not as friendly, you probably need some coding background.
I also had a book C by Example, but I seem to have lost that one, maybe at work, but maybe it means that it's a crap book. |
|
Status: Offline |
|
|
CodeSmith
| |
Re: Does AOS4 support ALTIVEC? Posted on 15-May-2004 2:01:58
| | [ #51 ] |
|
|
|
Elite Member |
Joined: 8-Mar-2003 Posts: 3045
From: USA | | |
|
| @EntilZha
Ah, this is something I didn't know - on the x86, FPU/MMX registrers are loaded and saved to main memory. This is obviously a lot slower than shifting registers around inside the CPU. How many sets of Altivec registers can be saved that way?
|
|
Status: Offline |
|
|
moebius
| |
Re: Does AOS4 support ALTIVEC? Posted on 15-May-2004 2:21:38
| | [ #52 ] |
|
|
|
Member |
Joined: 26-Jul-2003 Posts: 29
From: Courtenay, BC | | |
|
| @EntilZha
Quote:
EntilZha wrote:
Another item on my Todo list: Thermal management. The PPC can watch the temperature, and if it's too high, it can generate an interrupt. The handler can then use the instruction fetch throttling to slow down (and cool) the CPU... |
But isn't there one fundamental problem with this idea? Motorola says that the thermal sensor is unreliable and therefore is unsupported. That says to me that you cannot rely on what it says (and my own observations of the absurd indications that were given by the original cpu in my A1 (7451?) and by the replacement 7455 when using Ross V's 2.4.19 kernel (which had that option enabled). One day that I recall, it told me that my cpu was running at 65 Degrees Celsius, yet the cpu was cool to the touch. The heat dissipation capabilities of PowerPC processors are most definitely *not* that good.
My current arrangement with external sensors hooked to a fan controller isn't the most accurate, but it is leap years ahead of depending on that unreliable internal sensor data.
That still being true, how can you be planning anything to do with thermal management?
|
|
Status: Offline |
|
|
EntilZha
| |
Re: Does AOS4 support ALTIVEC? Posted on 16-May-2004 10:10:03
| | [ #53 ] |
|
|
|
OS4 Core Developer |
Joined: 27-Aug-2003 Posts: 1679
From: The Jedi Academy, Yavin 4 | | |
|
| @CodeSmith
Quote:
Ah, this is something I didn't know - on the x86, FPU/MMX registrers are loaded and saved to main memory. This is obviously a lot slower than shifting registers around inside the CPU. How many sets of Altivec registers can be saved that way? |
No no, the registers are still saved to memory, but the vrsave register contains one bit for each vector register in use, so you only store registers that are in use. If none are in use anymore, none are saved/restored..._________________ 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 |
|
|
EntilZha
| |
Re: Does AOS4 support ALTIVEC? Posted on 16-May-2004 10:13:20
| | [ #54 ] |
|
|
|
OS4 Core Developer |
Joined: 27-Aug-2003 Posts: 1679
From: The Jedi Academy, Yavin 4 | | |
|
| @moebius
Quote:
That still being true, how can you be planning anything to do with thermal management? |
AFAIK, the thermal sensors on newr CPUs (750FX, 7455) is pretty reliable. At least it can give an indication on the temperature...
Honestly, if there wasn't any sense in the thermal sensores, WTF are they implemented on each of the newer CPUs ? Chip are is valuable, why waste it with something unsupported ?_________________ 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 |
|
|
CodeSmith
| |
Re: Does AOS4 support ALTIVEC? Posted on 16-May-2004 10:24:40
| | [ #55 ] |
|
|
|
Elite Member |
Joined: 8-Mar-2003 Posts: 3045
From: USA | | |
|
| @EntilZha
Ah, that's quite cool. Dirty bits for registers, huh. Neat
On the x86 there is a pair of instructions you use for this (fsave/frestore or the fnsave/fnrestore variants), but they process the entire FPU state. I'm pretty sure there's no way of knowing which registers got touched so one can optimize this.
The PPC sounds like a very interesting chip indeed, I'm looking forward to getting to know it better
|
|
Status: Offline |
|
|
Hammer
| |
Re: Does AOS4 support ALTIVEC? Posted on 16-May-2004 10:52:54
| | [ #56 ] |
|
|
|
Elite Member |
Joined: 9-Mar-2003 Posts: 5323
From: Australia | | |
|
| @CodeSmith
Quote:
CodeSmith wrote: @EntilZha
Ah, this is something I didn't know - on the x86, FPU/MMX registrers are loaded and saved to main memory. This is obviously a lot slower than shifting registers around inside the CPU. How many sets of Altivec registers can be saved that way?
|
Note that there?s the register renaming scheme (transparent to the programmer) to address the said performance issue. _________________ Ryzen 9 7900X, DDR5-6000 64 GB RAM, GeForce RTX 4080 16 GB Amiga 1200 (Rev 1D1, KS 3.2, PiStorm32lite/RPi 4B 4GB/Emu68) Amiga 500 (Rev 6A, KS 3.2, PiStorm/RPi 3a/Emu68) |
|
Status: Offline |
|
|
CodeSmith
| |
Re: Does AOS4 support ALTIVEC? Posted on 16-May-2004 11:29:04
| | [ #57 ] |
|
|
|
Elite Member |
Joined: 8-Mar-2003 Posts: 3045
From: USA | | |
|
| @Hammer
That's true for something like mov eax, edx or fadd. Fsave and frestore need to hit main memory, with the usual performance hits. Even if the stuff's in cache it is a performance hit - those 128 bytes tend to become a hole in your L1 cache because since they are the same across all tasks (assuming the kernel is mapped to the same linear addresses for all tasks), cache policies that rely on locality of reference (ie most of them) will see these bytes as being "important" and so they will not often get flushed.
|
|
Status: Offline |
|
|
EntilZha
| |
Re: Does AOS4 support ALTIVEC? Posted on 16-May-2004 11:50:10
| | [ #58 ] |
|
|
|
OS4 Core Developer |
Joined: 27-Aug-2003 Posts: 1679
From: The Jedi Academy, Yavin 4 | | |
|
| @Hammer
Quote:
Note that there?s the register renaming scheme (transparent to the programmer) to address the said performance issue. |
Register renaming is very common on modern CPUs. All PowerPC implement this as well._________________ 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 |
|
|
Hammer
| |
Re: Does AOS4 support ALTIVEC? Posted on 16-May-2004 12:47:00
| | [ #59 ] |
|
|
|
Elite Member |
Joined: 9-Mar-2003 Posts: 5323
From: Australia | | |
|
| @CodeSmith
What about prefetch predictions schemes? _________________ Ryzen 9 7900X, DDR5-6000 64 GB RAM, GeForce RTX 4080 16 GB Amiga 1200 (Rev 1D1, KS 3.2, PiStorm32lite/RPi 4B 4GB/Emu68) Amiga 500 (Rev 6A, KS 3.2, PiStorm/RPi 3a/Emu68) |
|
Status: Offline |
|
|
Karlos
| |
Re: Does AOS4 support ALTIVEC? Posted on 16-May-2004 13:06:07
| | [ #60 ] |
|
|
|
Elite Member |
Joined: 24-Aug-2003 Posts: 4411
From: As-sassin-aaate! As-sassin-aaate! Ooh! We forgot the ammunition! | | |
|
| @EntilZha
Quote:
No no, the registers are still saved to memory, but the vrsave register contains one bit for each vector register in use, so you only store registers that are in use. If none are in use anymore, none are saved/restored... |
Is there a similar mechanism for the IU / FPU register set? It seems a very obvious optimisation in hindsight
Doesn't the 68882/68040/68060 FPU have a similar mehcanism for the FPU registers? IIRC it wasn't an automatic "dirty bit", but you could tell it which registers your code has actually modified so that backing up registers could be optimised. Or did I just imagine it?_________________ Doing stupid things for fun... |
|
Status: Offline |
|
|
Hammer
| |
Re: Does AOS4 support ALTIVEC? Posted on 16-May-2004 13:19:25
| | [ #61 ] |
|
|
|
Elite Member |
Joined: 9-Mar-2003 Posts: 5323
From: Australia | | |
|
| @EntilZha
Quote:
Register renaming is very common on modern CPUs. All PowerPC implement this as well. |
Note that I wasn?t specific in relation specific CPU arch... _________________ Ryzen 9 7900X, DDR5-6000 64 GB RAM, GeForce RTX 4080 16 GB Amiga 1200 (Rev 1D1, KS 3.2, PiStorm32lite/RPi 4B 4GB/Emu68) Amiga 500 (Rev 6A, KS 3.2, PiStorm/RPi 3a/Emu68) |
|
Status: Offline |
|
|
Karlos
| |
Re: Does AOS4 support ALTIVEC? Posted on 16-May-2004 13:24:52
| | [ #62 ] |
|
|
|
Elite Member |
Joined: 24-Aug-2003 Posts: 4411
From: As-sassin-aaate! As-sassin-aaate! Ooh! We forgot the ammunition! | | |
|
| @Hammer
No offense intended, but the thing is, you do appear to be AW.net's resident "Mr. x86" - whether you intend to or not I think people just automatically assume you mean x86 these days unless you explicitly state otherwise _________________ Doing stupid things for fun... |
|
Status: Offline |
|
|