Hacker News new | ask | show | jobs
by rmcclellan 5194 days ago
64 bit x86 is very similar to 32 bit. The differences are covered in on slides 191-193 in this deck.

The biggest difference for me is the difference in the calling convention. In 32 bit, all arguments generally are placed on the stack for "standard" calls. In 64 bit, different OSes have different conventions:

http://en.wikipedia.org/wiki/X86_calling_conventions#x86-64_... (note that OS X and linux use the "System V" calling conventions)

2 comments

It's easier, too; you get a bunch more registers and the register calling convention is a little like having normal positional arguments (or in any case is more convenient than arranging pushls).
I was about to call BS on that last sentence but it looks like I was the one full of it. I thought that the amd64 calling convention was standardized, bummer.

On Windows, amd64 is much better than x86 in this regard because of the bevy of x86 calling conventions that are still around. Only one amd64 calling convention.

To be fair, the System V document is AMD's convention and it was Microsoft that decided to design an incompatible (and worse) ABI.
Sucks. I wonder if AMD wrote that later, after Microsoft had made up their own and were dependent on it. Dave Cutler was involved in amd64 really early in the process of Clawhammer (mainly because he hates Intel with a passion!)