Stories
Slash Boxes
Comments

SoylentNews is people

posted by martyb on Saturday October 31 2015, @03:33AM   Printer-friendly
from the A|Journey|Through|the|CPU|Pipeline dept.

It is good for programmers to understand what goes on inside a processor. The CPU is at the heart of our career.

What goes on inside the CPU? How long does it take for one instruction to run? What does it mean when a new CPU has a 12-stage pipeline, or 18-stage pipeline, or even a "deep" 31-stage pipeline?

Programs generally treat the CPU as a black box. Instructions go into the box in order, instructions come out of the box in order, and some processing magic happens inside.

As a programmer, it is useful to learn what happens inside the box. This is especially true if you will be working on tasks like program optimization. If you don't know what is going on inside the CPU, how can you optimize for it?

A primer for those with a less formal background.


Original Submission

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 2) by Snotnose on Saturday October 31 2015, @02:35PM

    by Snotnose (1623) on Saturday October 31 2015, @02:35PM (#256892)

    was writing assembly for the 8086. I quickly learned the chip had 2 units: the execution unit and the bus interface unit. The BIU was responsible for all memory access, instruction and data. The EU took that data and executed it. I was soon rearranging my assembly steps to ensure the BUI always had data ready for the EU. Did it make the code harder to follow? Yep. Did I optimize a lot of idle loops? Most likely. But hey, I was new at this, 100% self taught, and I knew the instruction set better than any of my co-workers.

    Another CSB. At a different company we took a field trip to silicon valley to visit National Semiconductor and Intel. At NS we put on bunny suits and got a tour of the production line. Interesting, but not all that valuable for us software types. At Intel we met the leader of their next gen CPU. He was what was at the time the stereotypical Indian. Full beard, white dress, whole nine yards. Did I mention he was smart? Scary smart. He taught us about pipelines, VLIW, OOO, and lots of other then unheard of things. Very interesting trip.

    --
    Why shouldn't we judge a book by it's cover? It's got the author, title, and a summary of what the book's about.
    Starting Score:    1  point
    Karma-Bonus Modifier   +1  

    Total Score:   2