Idle Loop Optimized 68
seebs writes "Every so often someone makes a joke about optimizing the idle loop, but this article actually does it. " It's about time too- that process has been eating up clock cycles for to long.
Time is the most valuable thing a man can spend. -- Theophrastus
My idle loop is already optimized (Score:4, Funny)
Re:My idle loop is already optimized (Score:1)
Re:My idle loop is already optimized (Score:2)
Eating them up (Score:1, Funny)
Re:Slashdot only posts Stuff That Matters! (Score:2)
ciao guys, see you on May 1st.
Re:Slashdot only posts Stuff That Matters! (Score:2)
Re:Slashdot only posts Stuff That Matters! (Score:1)
Re:Slashdot only posts Stuff That Matters! (Score:2)
It also shows some neat things about vectorizing non-trivial examples.
hah (Score:2, Funny)
Welcome to First Post Day! (Score:5, Funny)
Re:Welcome to First Post Day! (Score:2)
i am not lame.
i am not lame. */
Re:Welcome to First Post Day! (Score:2)
Re:Welcome to First Post Day! (Score:2)
Re:Welcome to First Post Day! (Score:2)
But that "idle loop" actually does something, it increments a counter - and thus calculates a lot of numbers. The optimized, vectorized loop does the same (yes, it does calculate the exact same numbers), just faster. Another victory for AliVec.
Grammar! (Score:5, Funny)
The article does what? Makes the joke, or optimizes the idle loop?
Re:Grammar! (Score:1)
Re:Grammar! (Score:2)
Ain't it obvious? (Score:1)
BASIC (Score:1)
10 PRINT "I am awesome"
20 GOTO 10
Re:BASIC (Score:2)
10 PRINT "I am Awesome ";
You are obviously a sickly C programmer! BASIC rox donchaknow?
Re:BASIC (Score:2)
We are trying to optimise remember?! Get with the program.
Sheesh.
World's Smallest Slashdot Effect Found (Score:5, Funny)
The webmaster in question said "yeah, I noticed a couple of extra visitors, but my TRS80-based web server coped just fine.".
Going for the record? (Score:2, Interesting)
-Charles
Re:Going for the record? (Score:1)
Too late, I've already done it.
http://mnewberg.com/content/view/78/2/ [mnewberg.com]
Re:Going for the record? (Score:2)
Especially as it isn't april fools day any more.
GIVE IT A REST PEOPLE!!!
Also (Score:1)
they must have a SlashStory Generator (Score:2)
I can do even better.... (Score:5, Funny)
Today at work I was in a spectacularly smooth (and remarkably energy efficient) idle-loop.
Fortunately the loop was terminated automatically at 5pm.
Yeah, but.... (Score:2, Funny)
Re:Yeah, but.... (Score:2)
And now for something completely different. . . . (Score:1, Funny)
Isn't it frightfully good to have a "dong"?
It's swell to have a "stiffy",
It's divine to own a "dick".
From the tinyest little "tadger",
To the world's biggest "prick".
So three cheers for your "Willy" or "John Thomas",
Hooray for your "one-eyed trouser snake".
Your "piece of pork",
Your "Wife's best friend",
Your "Percy" or your "cock".
You can wrap it up in ribbons,
You can slip it in your sock.
But don't take it out in public,
Or they will put you in the dock,
And you won't come
Where is my TPS report? (Score:2, Funny)
Re:Where is my TPS report? (Score:2)
code snipplet (Score:1)
Uses (Score:1)
I hate it when I give a cpu an idle loop, and come back later to find it's not even running, lazy bastard. Seriously, after prototyping a new processor the first test it gets is something like
0000 jmp 0000, or after getting a VHDL z80 to run in ModelSIM the first thing I did was slowly stepping thru a similar loop to verify it was actually 'fetching and stepping' (manually putting the instruction in the bus since I d
Anyone else read the whole thing? (Score:2)
Jesus - optimizing the idle loop - the way he ends up doing it just cracks me up.
It's not all a joke (Score:2, Insightful)
Re:It's not all a joke- 4bsd history (Score:1, Interesting)
Brilliant! (Score:3, Informative)
I remember in the 1980's there was a great article on how to add a GOSUB keyword to the FORTH language. The article evolved the code through four different versions, and each one showed something cool and useful about FORTH. Well, maybe not the last one:
: GOSUB ; IMMEDIATE
For those of you who don't grok FORTH, this defines a keyword called GOSUB that does nothing, and does it at compile time so it doesn't get compiled in either. (The article noted that GOSUB FOO is the same thing as just plain old FOO, since FORTH functions are always called as subroutines anyway.)
Around the same time, I saw an article on how to build your own 64KB memory: take a breadboard, and 65536 8-bit flip-flop chips, plus a 1:65536 multiplexer and a 65536:1 demultiplexer for address selection! The article helpfully calculated how many Watts of power it would take to drive all these chips (a LOT) but it didn't say where one might find a multiplexer or demultiplexer with over 65000 pins on it.
steveha
Re:Brilliant! (Score:1)
Re:Brilliant! (Score:2)
Well, in real life you would have to.
Even a modern ball grid array [wikipedia.org] chip doesn't have tens of thousands of pins; a few hundred at most. Back in the 80's, with the dual inline packages [wikipedia.org] for chips, a few dozen pins at most was the limit.
So if you were insane enough to use a few thousand 8-bit flip-flop chips to build a memory, you would need to cascade a series of multiplexers and demultiplexers. I'm not really a hardware guy, but here's how I think
Another problem (Score:2, Funny)
About the optimisations (Score:1)
Loop unrolling is the _basics_.
You should worry about better design and readability.
Auto-vectorization is a step for GCC 4.0, thought.
Hah! (Score:2)