MMM
Results 1 to 25 of 525

Thread: Intel Q9450 vs Phenom 9850 - ATI HD3870 X2

Threaded View

  1. #11
    Xtreme Enthusiast
    Join Date
    May 2008
    Posts
    612
    Quote Originally Posted by JumpingJack View Post
    Now think game code ... a player shoots a weapon....

    a) In the evaluation loop (which a loop is a branch condtion on when to exit), it needs to check does the player pull the trigger (a branch).
    b) If the trigger is pulled, what weapon is he firing (another branch).
    c) Calculate the physics, does he hit the bad guy (yes or no) another branch
    d) Where does he hit the bad guy (head, arm, kneck)

    Game code is the absolute branchiest of all code classes. I am still looking for those papers that show it 30-80% higher than an other major kind of code.

    Jack
    Eeehhh.. Are you joking with me?
    Firstly, I can tell you that firing a weapon will need much more branches than that . There is a lot going on the processor. Code isn't exactly like "If shoot then boom" if you know what I mean.

    One type of branchy code is parsers. The complexity of the stream that is parsed and how many different paths that could be taken will add to the how branchy it is. But this can be optimized using different techniques.

    branch prediction is in fact mostly for stupid developers that doesn't understand how to write fast code for the processor.

    The paper you showed about branch prediction was for K8, K10 has some improvements there but what I know they are not showing how that works.

    EDIT: The most branches in normal code are in fact used to handle errors.
    Last edited by gosh; 09-07-2008 at 07:40 AM.

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •