"steveu" <steveu@coppice.org> wrote in message news:HMSdnSYdBIpaZ-bXnZ2dnUVZ_vGdnZ2d@giganews.com...> If you program your x86 from the bare metal up the behaviour of your cache > will probably be very similar to using a DSP chip. However, if you are > programming like that, you might as well use a DSP chip. > Most x86 DSP users are running their code on top of something like Windows > or Linux. These systems do various things beside running your application. > Some of those things trash the cache. The result is some cycles of your > DSP > applications take far longer than others. If you work hard you can > minimise > or possibly eliminate this kind of effect, by managing your machine's > activities tightly. It does take real work, though.At one time (early versions of the PDP-11, for example) you knew the hardware of your computer inside out, and if working for an impoverished employer, attempted first-line maintenance, at least when the processors were standard TTL. If you wanted an operating system, you crafted one for yourself. Even when along came RSX, DEC would give you a System Programmer's training course to take you through the innards of their software. With today's OS's (Windows and, to a large extent, Linux) we are fighting blind. Certainly with the cut-throat competition from PC vendors, it can be difficult, if not impossible, to get hold of the low-level programming onfo for their chip sets. However, we all have upon our desks computing resources that we could only have dreamed of until very recently. What a pity to waste their technical achievements by using off-the-shelf operating systems/ We could use this group to mutually craft an operating system to release the power of the PC to all intending DSP artisans. As a first step, this could be as little as a hard real-time clock driver to run under Windows.
Online · Live + on demand
February 9-11, 2027
Price goes up Jan 1: register now to lock in today's rate
Register Now →
the performance of x86 processor and DSP
Started by ●August 6, 2009
Reply by ●August 12, 20092009-08-12
Reply by ●August 13, 20092009-08-13
On Aug 12, 4:13 pm, "Computer Man" <inva...@invalid.invalid> wrote:> "steveu" <ste...@coppice.org> wrote in message > > news:HMSdnSYdBIpaZ-bXnZ2dnUVZ_vGdnZ2d@giganews.com... > > > If you program your x86 from the bare metal up the behaviour of your cache > > will probably be very similar to using a DSP chip. However, if you are > > programming like that, you might as well use a DSP chip. > > Most x86 DSP users are running their code on top of something like Windows > > or Linux. These systems do various things beside running your application. > > Some of those things trash the cache. The result is some cycles of your > > DSP > > applications take far longer than others. If you work hard you can > > minimise > > or possibly eliminate this kind of effect, by managing your machine's > > activities tightly. It does take real work, though. > > At one time (early versions of the PDP-11, for example) you knew the > hardware > of your computer inside out, and if working for an impoverished employer, > attempted > first-line maintenance, at least when the processors were standard TTL. > > If you wanted an operating system, you crafted one for yourself. Even when > along > came RSX, DEC would give you a System Programmer's training course to take > you through the innards of their software. > > With today's OS's (Windows and, to a large extent, Linux) we are fighting > blind. Certainly > with the cut-throat competition from PC vendors, it can be difficult, if not > impossible, to > get hold of the low-level programming onfo for their chip sets. > > However, we all have upon our desks computing resources that we could only > have dreamed > of until very recently. What a pity to waste their technical achievements by > using off-the-shelf > operating systems/ > > We could use this group to mutually craft an operating system to release the > power of the PC > to all intending DSP artisans. > > As a first step, this could be as little as a hard real-time clock driver to > run under Windows.I think x86 processor is the combination of CPU and DSP-like SIMD instructions.If you hope to use the computing resources, maybe first of all you should learn how to use MMX and SSE to program. But Intel provides IPP ( Integrated Performance Primitives) libraries. If you hope to use x86 for real time control, I think it is more challenging,but it can provide soft real time, such as video playback. Best Regards Jogging
Reply by ●August 13, 20092009-08-13
>On Aug 12, 4:13=C2=A0pm, "Computer Man" <inva...@invalid.invalid> wrote: >> "steveu" <ste...@coppice.org> wrote in message >> >> news:HMSdnSYdBIpaZ-bXnZ2dnUVZ_vGdnZ2d@giganews.com... >> >> > If you program your x86 from the bare metal up the behaviour of yourca=>che >> > will probably be very similar to using a DSP chip. However, if youare>> > programming like that, you might as well use a DSP chip. >> > Most x86 DSP users are running their code on top of something likeWind=>ows >> > or Linux. These systems do various things beside running yourapplicati=>on. >> > Some of those things trash the cache. The result is some cycles ofyour>> > DSP >> > applications take far longer than others. If you work hard you can >> > minimise >> > or possibly eliminate this kind of effect, by managing yourmachine's>> > activities tightly. It does take real work, though. >> >> At one time (early versions of the PDP-11, for example) you knew the >> hardware >> of your computer inside out, and if working for an impoverishedemployer,>> attempted >> first-line maintenance, at least when the processors were standardTTL.>> >> If you wanted an operating system, you crafted one for yourself. Evenwhe=>n >> along >> came RSX, DEC would give you a System Programmer's training course totak=>e >> you through the innards of their software. >> >> With today's OS's (Windows and, to a large extent, Linux) we arefighting>> blind. Certainly >> with the cut-throat competition from PC vendors, it can be difficult,if =>not >> impossible, to >> get hold of the low-level programming onfo for their chip sets. >> >> However, we all have upon our desks computing resources that we couldonl=>y >> have dreamed >> of until very recently. What a pity to waste their technicalachievements=> by >> using off-the-shelf >> operating systems/ >> >> We could use this group to mutually craft an operating system torelease =>the >> power of the PC >> to all intending DSP artisans. >> >> As a first step, this could be as little as a hard real-time clockdriver=> to >> run under Windows. > >I think x86 processor is the combination of CPU and >DSP-like SIMD instructions.If you hope to use the >computing resources, maybe first of all you should >learn how to use MMX and SSE to program. But Intel >provides IPP =EF=BC=88 Integrated Performance Primitives=EF=BC=89 >libraries.SIMD is not a requirement. Its just fine tuning. Most DSP on x86 is done without using the SIMD instructions. It quite hard to even double the speed of an algorithm using them, even though they do 4 single precision FP operations at once. The Intel IPP stuff is hopeless. Performance of simple C code, not trying to take advantage of SIMD at all, usually beats IPP. IPP spends a huge amount of time getting things started, and winding up at the end. Unless you are processing huge vectors (which you seldom are in DSP work) that swamps any mid-vector benefits.>If you hope to use x86 for real time control, I >think it is more challenging,but it can provide >soft real time, such as video playback.Steve
Reply by ●August 13, 20092009-08-13
On Aug 13, 10:16�pm, "steveu" <ste...@coppice.org> wrote:> >On Aug 12, 4:13=C2=A0pm, "Computer Man" <inva...@invalid.invalid> wrote: > >> "steveu" <ste...@coppice.org> wrote in message > > >>news:HMSdnSYdBIpaZ-bXnZ2dnUVZ_vGdnZ2d@giganews.com... > > >> > If you program your x86 from the bare metal up the behaviour of your > ca= > >che > >> > will probably be very similar to using a DSP chip. However, if you > are > >> > programming like that, you might as well use a DSP chip. > >> > Most x86 DSP users are running their code on top of something like > Wind= > >ows > >> > or Linux. These systems do various things beside running your > applicati= > >on. > >> > Some of those things trash the cache. The result is some cycles of > your > >> > DSP > >> > applications take far longer than others. If you work hard you can > >> > minimise > >> > or possibly eliminate this kind of effect, by managing your > machine's > >> > activities tightly. It does take real work, though. > > >> At one time (early versions of the PDP-11, for example) you knew the > >> hardware > >> of your computer inside out, and if working for an impoverished > employer, > >> attempted > >> first-line maintenance, at least when the processors were standard > TTL. > > >> If you wanted an operating system, you crafted one for yourself. Even > whe= > >n > >> along > >> came RSX, DEC would give you a System Programmer's training course to > tak= > >e > >> you through the innards of their software. > > >> With today's OS's (Windows and, to a large extent, Linux) we are > fighting > >> blind. Certainly > >> with the cut-throat competition from PC vendors, it can be difficult, > if = > >not > >> impossible, to > >> get hold of the low-level programming onfo for their chip sets. > > >> However, we all have upon our desks computing resources that we could > onl= > >y > >> have dreamed > >> of until very recently. What a pity to waste their technical > achievements= > > by > >> using off-the-shelf > >> operating systems/ > > >> We could use this group to mutually craft an operating system to > release = > >the > >> power of the PC > >> to all intending DSP artisans. > > >> As a first step, this could be as little as a hard real-time clock > driver= > > to > >> run under Windows. > > >I think x86 processor is the combination of CPU and > >DSP-like SIMD instructions.If you hope to use the > >computing resources, maybe first of all you should > >learn how to use MMX and SSE to program. But Intel > >provides IPP =EF=BC=88 Integrated Performance Primitives=EF=BC=89 > >libraries. > > SIMD is not a requirement. Its just fine tuning. Most DSP on x86 is done > without using the SIMD instructions. It quite hard to even double the speed > of an algorithm using them, even though they do 4 single precision FP > operations at once.Really? I doubt about it. Maybe it depends on applications. I don't know what do "Most DSP" refer to . At least, for multimedia such as video codec, SIMD influences the performance greatly. If SIMD doesn't work well, what do you usually do to improve the performance on x86 for Most DSP? Parallel computation is a way to speedup the execution. SIMD is a kind of parallelism. Multiple execution units can also improve the performance. As for C64x+, I always doubt whether eight functional units can execute simultaneously in most of the programs. Best Regards Jogging> > The Intel IPP stuff is hopeless. Performance of simple C code, not trying > to take advantage of SIMD at all, usually beats IPP. IPP spends a huge > amount of time getting things started, and winding up at the end. Unless > you are processing huge vectors (which you seldom are in DSP work) that > swamps any mid-vector benefits. > > >If you hope to use x86 for real time control, I > >think it is more challenging,but it can provide > >soft real time, such as video playback. > > Steve
Reply by ●August 13, 20092009-08-13
>On Aug 13, 10:16=A0pm, "steveu" <ste...@coppice.org> wrote: >> >On Aug 12, 4:13=3DC2=3DA0pm, "Computer Man" <inva...@invalid.invalid>wr=>ote: >> >> "steveu" <ste...@coppice.org> wrote in message >> >> >>news:HMSdnSYdBIpaZ-bXnZ2dnUVZ_vGdnZ2d@giganews.com... >> >> >> > If you program your x86 from the bare metal up the behaviour ofyour>> ca=3D >> >che >> >> > will probably be very similar to using a DSP chip. However, ifyou>> are >> >> > programming like that, you might as well use a DSP chip. >> >> > Most x86 DSP users are running their code on top of somethinglike>> Wind=3D >> >ows >> >> > or Linux. These systems do various things beside running your >> applicati=3D >> >on. >> >> > Some of those things trash the cache. The result is some cyclesof>> your >> >> > DSP >> >> > applications take far longer than others. If you work hard youcan>> >> > minimise >> >> > or possibly eliminate this kind of effect, by managing your >> machine's >> >> > activities tightly. It does take real work, though. >> >> >> At one time (early versions of the PDP-11, for example) you knewthe>> >> hardware >> >> of your computer inside out, and if working for an impoverished >> employer, >> >> attempted >> >> first-line maintenance, at least when the processors were standard >> TTL. >> >> >> If you wanted an operating system, you crafted one for yourself.Even>> whe=3D >> >n >> >> along >> >> came RSX, DEC would give you a System Programmer's training courseto>> tak=3D >> >e >> >> you through the innards of their software. >> >> >> With today's OS's (Windows and, to a large extent, Linux) we are >> fighting >> >> blind. Certainly >> >> with the cut-throat competition from PC vendors, it can bedifficult,>> if =3D >> >not >> >> impossible, to >> >> get hold of the low-level programming onfo for their chip sets. >> >> >> However, we all have upon our desks computing resources that wecould>> onl=3D >> >y >> >> have dreamed >> >> of until very recently. What a pity to waste their technical >> achievements=3D >> > by >> >> using off-the-shelf >> >> operating systems/ >> >> >> We could use this group to mutually craft an operating system to >> release =3D >> >the >> >> power of the PC >> >> to all intending DSP artisans. >> >> >> As a first step, this could be as little as a hard real-time clock >> driver=3D >> > to >> >> run under Windows. >> >> >I think x86 processor is the combination of CPU and >> >DSP-like SIMD instructions.If you hope to use the >> >computing resources, maybe first of all you should >> >learn how to use MMX and SSE to program. But Intel >> >provides IPP =3DEF=3DBC=3D88 Integrated PerformancePrimitives=3DEF=3DBC=>=3D89 >> >libraries. >> >> SIMD is not a requirement. Its just fine tuning. Most DSP on x86 isdone>> without using the SIMD instructions. It quite hard to even double thespe=>ed >> of an algorithm using them, even though they do 4 single precision FP >> operations at once.>Really? I doubt about it.You doubt what?>Maybe it depends on applications. >I don't know what do "Most DSP" refer to . At least, for multimedia >such as video codecCodecs are a very focussed high volume application, which justifies enormous effort for performance tuning. Put that effort into most DSP and you'll go bankrupt.> , SIMD influences the performance greatly.Does it? Look at Intel's "isn't SSE wonderful" stuff. When they get finely tuned SSE to give a 50% boost over straight C code they announce this as wonderful. That's not a spectacular gain for a lot of effort. More cores would probably more cost effective if your volume is low enough to tolerate using PCs in the first place.>If SIMD doesn't work well, what do you usually do to improve the >performance on x86 for Most DSP?Recent x86 chips executing floating point are pretty fast.>Parallel computation is a way to speedup the execution. SIMD is a >kind of parallelism. Multiple execution units can also improve the >performance.The SIMDiness of SSE is actually rather poor.>As for C64x+, I always doubt whether eight functional units can >execute >simultaneously in most of the programs.Depends on the application. It is, however, possible to really make that thing hum with the right application and code. SSE never really impresses. Steve
Reply by ●August 13, 20092009-08-13
On 13 Aug, 16:16, "steveu" <ste...@coppice.org> wrote:> >On Aug 12, 4:13=C2=A0pm, "Computer Man" <inva...@invalid.invalid> wrote:> >I think x86 processor is the combination of CPU and > >DSP-like SIMD instructions.If you hope to use the > >computing resources, maybe first of all you should > >learn how to use MMX and SSE to program. But Intel > >provides IPP =EF=BC=88 Integrated Performance Primitives=EF=BC=89 > >libraries. > > SIMD is not a requirement. Its just fine tuning. Most DSP on x86 is done > without using the SIMD instructions. It quite hard to even double the speed > of an algorithm using them, even though they do 4 single precision FP > operations at once.I've seen somewhere that Intel made blunder with the MMX, that they designed the architecture such that one *either* uses the FPU *or* MMX. Don't remember the details, but could some data registers have been used for both? So that one has to do a lot of work and spend a lot of time switching between FPU and MMX modes? Rune
Reply by ●August 13, 20092009-08-13
> >I've seen somewhere that Intel made blunder with the MMX, >that they designed the architecture such that one *either* >uses the FPU *or* MMX. Don't remember the details, but >could some data registers have been used for both? So that >one has to do a lot of work and spend a lot of time switching >between FPU and MMX modes? > >Rune >From an old copy of the Intel Arch SW Dev Manual, vol 1 I have lying around: "Although the MMX registers are defined in the IA-32 architecture as separate registers, they are aliased to the registers in the FPU data register stack (R0 through R7). See Section 9.5., "Compatibility with x87 FPU Architecture"." Obviously, the section #s probably changed, but you get the idea. If you go to the trouble to use one, I imagine you finish your operation and then do the other, rather than trying to mix them, so it's not AS big a deal as it sounds. As far as consumer OS-es, that's saved/restored in the context switch.
Reply by ●August 13, 20092009-08-13
Michael Plante <michael.plante@gmail.com> wrote:>I've seen somewhere that Intel made blunder with the MMX, >that they designed the architecture such that one *either* >uses the FPU *or* MMX. Don't remember the details, but >could some data registers have been used for both? So that >one has to do a lot of work and spend a lot of time switching >between FPU and MMX modes?I don't think it was a blunder. At the time, no OS would have the code to save MMX registers at task switch. This way, systems that would save the FPU registers would also save the MMX registers. Programs could depend on the values in whichever set was being used. Also, because of the way the x87 stack works, it is pretty much impossible to keep data in registers across statements. -- glen
Reply by ●August 13, 20092009-08-13
>Michael Plante <michael.plante@gmail.com> wrote: > >>I've seen somewhere that Intel made blunder with the MMX, >>that they designed the architecture such that one *either* >>uses the FPU *or* MMX. Don't remember the details, but >>could some data registers have been used for both? So that >>one has to do a lot of work and spend a lot of time switching >>between FPU and MMX modes? > >I don't think it was a blunder. At the time, no OS would have >the code to save MMX registers at task switch. This way, systems >that would save the FPU registers would also save the MMX registers. > >Programs could depend on the values in whichever set was being used. > >Also, because of the way the x87 stack works, it is pretty much >impossible to keep data in registers across statements.The stack/register bank dichotomy means the choice they made there wasn't a blunder. It was more or less inevitable. It meant a slow mode change, but if you're doing the kinds of things where MMX makes a real difference you're probably doing enough work for the mode switch time to be lost in the noise. The blunders lie elsewhere.... MMX was supposed to be a platform for host signal processing. It seems they only talked to video people, because for anything else its terrible. Remember that Intel were trying to do V.34 modems, voice echo cancelling, and a number of other common DSP things on their CPUs at that time. MMX can only do saturated arithmetic on 8 or 16 bit values, not on 32. Misaligned data performance was awful. For a fixed filter you can store multiple sets of coefficients, with different alignment offsets, and cycle around the sets. Try that with the echo canceller or equalizer in a V.34 modem. The arcane workarounds you need for the misalignment issues make it difficult to get to the speed of non-MMX code, let alone see a speedup. SSE was a *lot* better, and today most floating point processing uses the non-SIMD SSE instructions, rather than the old x87 instruction set. Nonetheless, its also a mess. It looks like nobody tried common arithmetic kernels to see how they work out, because in SSE/SSE2 the most important ones, like dot products, work out badly. SSE3, SSSE3, and SSE4.1 have gradually filled in some of the missing pieces, but sooooooo incrementally. It took SSE, SSE2, SSE3 and SSSE3 before you could finally do a dot product reasonably efficiently, and it took SSE4.1 before you could do it efficiently in a more general way. It really looks like Intel cooked up their instruction set additions by talking to nobody but video developers. The next generation AVT instruction set looks like they might have finally woken up. We'll see how that plays out next year, when we can really work with it. Steve







