ieu2ieg

Date:

10-20-2011

NAME

IEU2IEG, IEG2IEU - Converts Fortran data types between IEEE DEC-style little-endian and generic IEEE data types

SYNOPSIS

INTEGER IEU2IEG, IEG2IEU

ierr = IEU2IEG(type, num, foreign, bitoff, native, stride, natlen, forlen [,nativech])

ierr = IEG2IEU(type, num, foreign, bitoff, native, stride, natlen, forlen [,nativech])

IMPLEMENTATION

Cray Linux Environment (CLE)

DESCRIPTION

IEU2IEG converts IEEE little-endian Fortran data types for a system using 32-bit, 64-bit, and 128-bit little-endian IEEE floating-point representation (abbreviated as “IEU” in the following text) to data for systems that use generic 32-bit, 64-bit, and 128-bit IEEE floating-point representation (abbreviated as “IEG” in the following text).

IEG2IEU converts generic 32-bit, 64-bit, and 128-bit IEEE Fortran data types to 32-bit, 64-bit, and 128-bit IEEE Fortran data types.

When using the Cray Fortran compiler, all arguments must be of default kind unless documented otherwise. The default kind is KIND=4 for integer, real, complex, and logical arguments.

The following is a list of valid arguments for this routine.

type

An integer giving the data type code, as follows.

Code

Description

1

Typeless (no translation; natlen and forlen must be equal and must be 8-, 16-, 32-, 64-, 128-, or 256-bits.)

2

Integer IEG: 8-, 16-, 32-, or 64-bit twos complement IEU: 8-, 16-, 32-, or 64-bit twos complement

3

Real IEG: 32-, 64-, or 128-bit IEEE floating-point IEU: 32-, 64-, or 128-bit IEEE floating-point

4

Complex IEG: 2 x 32-, 64-, or 128-bit floating-point IEU: 2 x 32-, 64-, or 128-bit floating-point

5

Logical IEG: 8-, 16-, 32-, or 64-bit nonzero/zero logical IEU: 8-, 16-, 32-, or 64-bit nonzero/zero logical

6

Character ASCII to ASCII; no translation

  • The natlen and forlen parameters select the size of the data.

num

Number of data items to convert. Type integer variable, expression, or constant.

foreign

Variable or array of any noncharacter type or length containing the data which is not native to the current system. This variable or array either receives the converted data or contains data to be converted.

bitoff

Integer giving the bit offset within the foreign data variable or array to begin the conversion. bitoff must be at least 0 and no more than 63.

native

Variable or array of any noncharacter type or length containing the data which is native to the current system. This variable or array either receives the converted data or contains data to be converted. This may be a strided array.

  • This variable should be of a type that corresponds to the type argument. If type=6 (CHARACTER), native should be a dummy INTEGER variable and the optional nativech argument should be a CHARACTER variable or array that contains or will contain the native data.

stride

Integer variable or constant giving the memory increment for loading or storing data to the native array. For two and four-word items (complex and double-precision), this is a stride of items, not of words. For typeless, stride is always in words.

  • This parameter is ignored for CHARACTER (type = 6). Data in the foreign array is loaded or stored in a continuous bit stream regardless of this parameter.

natlen

Native storage length of an item, in bits. For COMPLEX data, natlen counts the total size of the real and imaginary component.

forlen

Fortran storage length of an item, in bits. For COMPLEX data, forlen counts the total size of the real and imaginary components.

nativech

Optional character parameter specifying native target variable if it is of type CHARACTER (type = 6). This parameter is ignored if type is not CHARACTER.

CAUTIONS

The foreign and native variables should not be associated (aliased to each other).

RETURN VALUES

The returned function values are as follows:

-1

Parameter error; too many arguments or nativech not specified with type = 6.

-2

Parameter error; invalid type.

-3

Parameter error; invalid num.

-4

Parameter error; invalid bitoff.

-5

Parameter error; invalid natlen.

-6

Parameter error; invalid forlen.

-7

Unable to malloc() memory for translation.

-8

Combination of natlen and forlen is invalid.

0

Translation complete; no errors.

>0

Translation complete; return value is the number of integer or real values that completely overflowed during conversion.