Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX 64-bit Porting and Transition Guide: HP 9000 Computers > Chapter 3 HP-UX 64-bit Porting Concepts

ILP32 and LP64 Data Models

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

The ANSI/ISO C standard specifies that C must support four signed and four unsigned integer data types: char, short, int, and long. There are few requirements imposed by the ANSI standard on the sizes of these data types. According to the standard, int and short should be at least 16 bits; and long should be at least as long as int, but not smaller than 32 bits.

Traditionally, Kernighan and Ritchie (K&R) C assumes int is the most efficient or fastest integer data type on a machine. ANSI C, with its integral promotion rule, continues this assumption.

The HP-UX 32-bit data model is called ILP32 because ints, longs, and pointers are 32 bits.

The HP-UX 64-bit data model is called LP64 because longs and pointers are 64 bits. In this model, ints remain 32 bits.

NOTE: The LP64 data model is the emerging standard on 64-bit UNIX systems provided by leading system vendors. Applications that transition to the LP64 data model on HP-UX systems are highly portable to other LP64 vendor platforms.

Data Type Sizes

The size of the base HP C data types under the HP-UX implementation of ILP32 and LP64 are shown in Table 3-1 “HP C/HP-UX 32-bit and 64-bit Base Data Types ”:

Table 3-1 HP C/HP-UX 32-bit and 64-bit Base Data Types

Data Type

ILP32 Size (bits)

LP64 Size (bits)

char

8

8

short

16

16

int

32

32

long

32

64

long long [1]

64

64

pointer

32

64

float

32

32

double

64

64

long double

128

128

enum [2]

32

32

[1] The long long data type is an HP value-added extension.

[2] Sized enums are available in 32-bit and 64-bit mode.

 

Huge Data

In general, huge data is any data that is larger than can be represented on a 32-bit system. Hence, huge data is only supported on 64-bit systems.

More specifically, huge data is any data greater than a certain size placed into a huge data segment (hbss segment). Smaller objects are placed into a bss segment.

In general, data objects on 32-bit systems can be as large as 228 bytes or 256 megabytes whereas on 64-bit systems data objects can be as large as 258 bytes or larger in some cases.

HP C/HP-UX supports uninitialized arrays, structs, and unions to a maximum of 258 bytes. HP aC++ supports uninitialized arrays and C-style structs and unions to a maximum of 261 bytes.

For More Information

For details see the HP C/HP-UX Release Notes, the HP aC++ Release Notes, or the HP Fortran 90 Release Notes.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1998 Hewlett-Packard Development Company, L.P.