Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does x86-64 use IA-64 C++ ABI?

From the x86-64 psABI:

9.1 C++

For the C++ ABI we will use the IA-64 C++ ABI and instantiate it appropriately. The current draft of that ABI is available at:

http://mentorembedded.github.io/cxx-abi/

Why not design its own ABI?

like image 617
Chen Li Avatar asked Jan 27 '23 02:01

Chen Li


1 Answers

Because the “Itanium” C++ ABI is designed to be generic, or at least generalisable. Quoting the introduction:

In general, this document is written as a generic specification, to be usable by C++ implementations on a variety of architectures. However, it does contain processor-specific material for the Itanium 64-bit ABI, identified as such. Where structured data layout is described, we generally assume Itanium psABI member sizes. An implementation for a 32-bit ABI would typically just change the sizes of members as appropriate (i.e. pointers and long ints would become 32 bits), but sometimes an order change would be required for compactness, and we note more substantive changes.

The phrase “instantiate it appropriately” refers to the adaptations required to adjust the Itanium psABI assumptions for use with the x86-64 psABI.

like image 181
Stephen Kitt Avatar answered Feb 04 '23 04:02

Stephen Kitt