Sun Studio 12: C User's Guide

F.2.1 Integer Representations

Integer types used in ISO C are short, int, long, and long long:

Table F–2 Representation of short

Bits  

Content  

8- 15 

Byte 0 (SPARC)  

Byte 1 (x86)

0- 7 

Byte 1 (SPARC)  

Byte 0 (x86) 

Table F–3 Representation of int

Bits  

Content  

24- 31 

Byte 0 (SPARC)  

Byte 3 (x86) 

16- 23 

Byte 1 (SPARC)  

Byte 2 (x86) 

8- 15 

Byte 2 (SPARC)  

Byte 1 (x86) 

0- 7 

Byte 3 (SPARC)  

Byte 0 (x86) 

Table F–4 Representation of long on x86 and SPARC v8 versus SPARC v9

Bits  

Content  

24- 31 

Byte 0 (SPARC) v8 

Byte 4 (SPARC) v9 

Byte 3 (x86) 

16- 23 

Byte 1 (SPARC) v8 

Byte 5 (SPARC) v9 

Byte 2 (x86)

8- 15 

Byte 2 (SPARC) v8 

Byte 6 (SPARC) v9 

Byte 1 (x86)

0- 7 

Byte 3 (SPARC) v8 

Byte 7 (SPARC) v9 

Byte 0 (x86)


Note –

long long is not available in -Xc mode.


Table F–5 Representation of long long

Bits  

Content  

56- 63 

Byte 0 (SPARC)  

Byte 7 (x86) 

48- 55 

Byte 1 (SPARC)  

Byte 6 (x86) 

40- 47 

Byte 2 (SPARC)  

Byte 5 (x86) 

32- 39 

Byte 3 (SPARC)  

Byte 4 (x86) 

24- 31 

Byte 4 (SPARC)  

Byte 3 (x86) 

16- 23 

Byte 5 (SPARC)  

Byte 2 (x86) 

8- 15 

Byte 6 (SPARC)  

Byte 1 (x86) 

0- 7 

Byte 7 (SPARC)  

Byte 0 (x86)