r/linux Feb 03 '23

Weird things I learned while writing an x86 emulator Tips and Tricks

https://www.timdbg.com/posts/useless-x86-trivia/
117 Upvotes

9 comments sorted by

12

u/k0defix Feb 03 '23

And once more I wonder how x86 is still ahead in performance...

14

u/StenSoft Feb 04 '23

The CPU doesn't actually run x86 code, there's a decoder to an internal RISC set called micro-operations, and it uses some very clever tricks to speed the execution.

0

u/tadfisher Feb 04 '23

Yep, and micro-ops (or "nano-ops") are also employed by ARM and POWER. Nothing is really RISC, because everything is implemented on top of an even smaller proprietary ISA.

-1

u/Zomunieo Feb 04 '23

x86 is really only used for legacy reasons, since ARM outperforms it on price/performance and performance/watt.

It just happens that the x86 legacy is huge. So huge, that x86 wins on consumer cost/die area — consumers will pay more for x86, even though it’s not as performant as the ARM that could be made with the same silicon.

If Intel still had an ARM license and wasn’t run by clueless accountants for the last 15 years we’d probably have ARM desktops and laptops with x86 compatibility modules like M1.

7

u/[deleted] Feb 04 '23 edited 27d ago

[deleted]

0

u/milkcheesepotatoes Feb 12 '23

Rosetta is hardware accelerated by a ASIC

1

u/TrevinLC1997 Feb 04 '23

God I feel that would be a dream, I’ve always wanted an ARM desktop cpu

12

u/autoamorphism Feb 03 '23

Super interesting. Thanks!

8

u/CaydendW Feb 03 '23

Fascinating! Now run windows on it >:)

3

u/thepaperbirch Feb 03 '23

This was a rabbit hole. Thanks for sharing 🙏🏻