Hacker News new | ask | show | jobs
by gpderetta 2996 days ago
on an high end x86, decoder takes only a tiny proportion of the area and a power budget.

On smaller low power cpus it is more significant of course.

The stack engine is necessary anyway even if you have no specific stack instructions, as it removes the dependence of the top of stack manipulation from local variable accesses which is critical. Explicit stack manipulation instructions might actually make the stack engine simpler.

Coherent instruction cache and pipeline are super relevant in this age of pervasive self modifying code (a.k.a JIT).

Modern CPUs are complex for a reason.

1 comments

It's relatively straightforward for self modifying code to manually flush instruction caches when necessary and JIT compilers that target other architectures already satisfy this requirement. Only backwards compatibility with existing x86 software requires a coherent instruction cache.
> It's relatively straightforward for self modifying code to manually flush instruction caches when necessary

Barriers are expensive. JITs might need to issue lots of them. Then the next generation of CPUs start tracking modified lines to make barriers cheaper. Then you end up with all the hardware complexity of implicit barriers without simplifying the software side.

> JIT compilers that target other architectures already satisfy this requirement.

they might have different tuning parameters to take into account the cost of the barrier when deciding profitability of JITing a region of code.

> Only backwards compatibility with existing x86 software requires a coherent instruction cache.

Far from it, IIRC the coherency guarantee has actually been strengthened recently. It used to require a far jump as a barrier.

Explicit vs implicit barriers are just an architectural tradeoff.

I'm having a hard time with "straightforward" and "self modifying code" in the same sentence. In fact, I think it's a syntax error.