News for hackers. Stuff that matters.
Re:Intel x86 documentation has more pages than the 6502 has ... by petercooper on Wednesday December 07, 2016 @08:08PM (#13127644)
I'd be keen to see a comparison of transistors counts between modern and older processors with caches removed (I could be wrong, but I thought built-in caches made up the majority of transistor counts nowadays). That is, how much more complex is a single cache-less core now vs then? Not as much as the overall transistor count would indicate, I suspect.
Re:Intel x86 documentation has more pages than the 6502 has ... by qb45 on Thursday December 08, 2016 @05:03AM (#13129422)
Annotated die photo of a single-core VIA Nano chip from some 10 years ago:

https://en.wikipedia.org/wiki/File:VIA_Isaiah_Architecture_d...

As you can see, caches are merely half of the chip and half of the rest is about dynamic instruction reordering, branch prediction, register renaming and stuff.

These things have pipelined execution units so they can start a new instruction before the previous one is finished executing, enough duplication to start executing two or three instructions per cycle (sometimes even of the same kind, say two floating point SIMD additions) and logic to schedule instructions wrt data dependencies, not program order, so that instructions which need input data not yet available can wait for a few cycles while other, later instructions are executing.

And all of this has to be done with some degree of appearance of executing instructions serially, so if say some instruction causes a page fault and a jump to the OS fault handling code, the CPU has to cancel all later instructions which may have already finished executing :)

And, btw, this is not in any way specific to x86. POWER, high-end ARM, they all do it.

Re:Intel x86 documentation has more pages than the 6502 has ... by 72deluxe on Thursday December 08, 2016 @05:34AM (#13129522)
Fascinating. Where do you learn this stuff? Any recommended reading you can point me to as a complete novice with regard to CPU architecture?
Re:Intel x86 documentation has more pages than the 6502 has ... by qb45 on Thursday December 08, 2016 @08:01AM (#13130006)
That's somewhat hard to answer because I've been accumulating knowledge from many sources over many years, and it started with some dead-tree book from the '90s :)

Maybe Agner's site, in particular his microarchitecture manual, would be a reasonable place to start:

http://www.agner.org/optimize/

There are "software optimization manuals" from CPU vendors, but these may not be particularly novice-friendly. I think I've used Wikipedia at times for general CPU-agnostic concepts, though it has a tendency to use jargon with tittle explanation. Occasionally somebody submits something to HN.

On the lowest level, it may be helpful to know some simple digital circuits (decoders, multiplexers, adders, flip-flops, ...?) just to have an idea of what kind of things can be done in hardware.

Re:Intel x86 documentation has more pages than the 6502 has ... by projektfu on Thursday December 08, 2016 @07:54AM (#13129977)
Many CS departments teach from Patterson and Hennessey, Computer Organization and Design for intro, Computer Architecture: A Quantitative Approach for advanced.
Re:Intel x86 documentation has more pages than the 6502 has ... by ktRolster on Thursday December 08, 2016 @02:11AM (#13128898)
They're pretty complex. For example, the modern x86 (afaik) uses lookup tables to make multiplication faster. The 6502 didn't even have integer multiplication.
Re:Intel x86 documentation has more pages than the 6502 has ... by vidarh on Thursday December 08, 2016 @04:34AM (#13129328)
Yes, we rolled it ourselves with ASL's (Arithmentic Shift Left) and ADC's (ADd with Carry) and the like, typically hardcoding it if we knew one of the operands. Particularly fun with pretty much always having to be prepared to deal with overflow since the registers are only 8 bit. I love the 6502, but I can't say I miss that part.