Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C++ is awesome!

Name: Anonymous 2006-11-06 18:09

(a<b?a:b<c?b:c) = val();

Name: Anonymous 2006-11-07 4:09

>>7

I considered doing that but it just seems sloppy.  It looks like it'd work, but somewhere you'll have to write a winding, thick forest of if or switch/case statements.  And excessive branching can really suck balls on some processors (lol Pentium 4 lol).

Although that's probably about as "neat" as you can get in C++, I guess... :/

Name: Anonymous 2006-11-10 3:04

>>9

I thought P4's crappy branching was one of the reasons the "branch prediction" technology in Intel's new processors kicks so much ass.

Name: Anonymous 2006-11-10 19:16

>>12
Netburst P4's have this "feature" due to the xbox-hueg long pipeline where one branch prediction miss costs you about twenty five cycles. That's on a Prescott, mind, it's like eighteen on Northwoods and Willamettes.

Unsurprisingly then the main speed boost from HyperThreading comes from being able to run the other thread while one suffers from a branch misprediction. Goodbye mainstream code performance.

NetBurst was pretty cool though if you first spent about a week coming up with an optimized routine to do something that you'd like. Kind of like an extremely well hidden DSP mode, only you need to do 128-bit wide integer SIMD stuff and no branching to get at it.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List