Tms320c3x-to-ieee floating-point format conversion – Texas Instruments TMS320C3x User Manual

Page 127

Advertising
background image

Floating-Point Conversion (IEEE Std. 754)

5-22

5.4.2.1

TMS320C3x-to-IEEE Floating-Point Format Conversion

The vast majority of the numbers represented by the ’C3x floating-point format
are covered by the general IEEE format and the representation of 0s. The only
special case is e = –127 in the ’C3x format; this corresponds to a denormalized
number in IEEE format. It is ignored in the fast version, while it is treated properly
in the complete version. Example 5–6 shows the fast version, and Example 5–7
shows the complete version of the ’C3x-to-IEEE conversion.

Example 5–6. TMS320C3x-to-IEEE Conversion (Fast Version)

*
*

TITLE TMS320C3x TO IEEE CONVERSION (FAST VERSION)

*
*
*

SUBROUTINE TOIEEE

*
*

FUNCTION: CONVERSION BETWEEN THE TMS320C3x FORMAT AND THE IEEE

*

FLOATING-POINT FORMAT. THE NUMBER TO BE CONVERTED

*

IS IN THE UPPER 32 BITS OF R0. THE RESULT WILL BE IN

*

THE LOWER 32 BITS OF R0.

*

*

UPON ENTERING THE ROUTINE, AR1 POINTS TO THE FOLLOWING TABLE:

*
*

(0) 0xFF800000 <

– –

AR1

*

(1) 0xFF000000

*

(2) 0x7F000000

*

(3) 0x80000000

*

(4) 0x81000000

*

*

ARGUMENT

ASSIGNMENTS:

*

ARGUMENT

|

FUNCTION

*

––––––––––+–––––––––––––––––––––––––––––––––––––

*

R0

|

NUMBER TO BE CONVERTED

*

AR1

|

POINTER TO TABLE WITH CONSTANTS

*

*

REGISTERS USED AS INPUT: R0, AR1

*

REGISTERS MODIFIED: R0

*

REGISTER CONTAINING RESULT: R0

*

*

NOTE:

SINCE THE STACK POINTER ‘SP’ IS USED, MAKE SURE TO

*

INITIALIZE IT IN THE CALLING PROGRAM.

*
*

Advertising