Subsections

Machine Interface

Processor Architecture

Data Representation

Within this specification, the term byte refers to a 8-bit object, the term twobyte refers to a 16-bit object, the term fourbyte refers to a 32-bit object, the term eightbyte refers to a 64-bit object, and the term sixteenbyte refers to a 128-bit object.3.1

Fundamental Types

Figure [*] shows the correspondence between ISO C's scalar types and the processor's. The __int128, __float128, __m64 and __m128 types are optional.

Figure: Scalar Types
\begin{figure}{ %% Use small here - the table is still too large
\small \begin{...
...l$^{\dagger\dagger}$\ These types are optional.}\\
\end{tabular}}
\end{figure}

The __float128 type uses a 15-bit exponent, a 113-bit mantissa (the high order significant bit is implicit) and an exponent bias of 16383.3.2

The long double type uses a 15 bit exponent, a 64-bit mantissa with an explicit high order significant bit and an exponent bias of 16383.3.3 Although a long double requires 16 bytes of storage, only the first 10 bytes are significant. The remaining six bytes are tail padding, and the contents of these bytes are undefined.

The __int128 type is stored in little-endian order in memory, i.e., the 64 low-order bits are stored at a a lower address than the 64 high-order bits.

A null pointer (for all types) has the value zero.

The type size_t is defined as unsigned long.

Booleans, when stored in a memory object, are stored as single byte objects the value of which is always 0 (false) or 1 (true). When stored in integer registers or passed as arguments on the stack, all 8 bytes of the register are significant; any nonzero value is considered true.

Like the Intel386 architecture, the AMD64 architecture in general does not require all data access to be properly aligned. Accessing misaligned data will be slower than accessing properly aligned data, but otherwise there is no difference. The only exception here is that __m128 always has to be aligned properly.

Aggregates and Unions

An array uses the same alignment as its elements, except that a local or global array variable that requires at least 16 bytes, or a C99 local or global variable-length array variable, always has alignment of at least 16 bytes.3.4

No other changes required.

Bit-Fields

Amend the description of bit-field ranges as follows:

Figure: Bit-Field Ranges
\begin{figure}\noindent\rule{\linewidth}{0.3mm}
\begin{center}
\leavevmode
\b...
...$\ \\
\end{tabular} \end{center}\noindent\rule{\linewidth}{0.3mm}
\end{figure}

The ABI does not permit bitfields having the type __m64 or __m128. Programs using bitfields of these types are not portable.

No other changes required.



Footnotes

...3.1
The Intel386 ABI uses the term halfword for a 16-bit object, the term word for a 32-bit object, the term doubleword for a 64-bit object. But most IA-32 processor specific documentation define a word as a 16-bit object, a doubleword as a 32-bit object, a quardword as a 64-bit object and a double quadword as a 128-bit object.
... 16383.3.2
Initial implementations of the AMD64 architecture are expected to support operations on the __float128 type only via software emulation.
... 16383.3.3
This type is the x87 double extended precision data type.
... bytes.3.4
The alignment requirement allows the use of SSE instructions when operating on the array. The compiler cannot in general calculate the size of a variable-length array (VLA), but it is expected that most VLAs will require at least 16 bytes, so it is logical to mandate that VLAs have at least a 16-byte alignment.
Jan Hubicka 2003-05-04