FTOI

Floating point to integer conversion

FTOI

Float TO Integer


[Syntax]

FTOI src, dest

 

[Operation]

dest = ( signed long ) src;

 

[Function]

-

This instruction converts the single-precision floating-point number stored in src into a signed longword (32-bit) integer and places the result in dest.

-

The result is always rounded towards 0, regardless of the setting of the RM[1:0] bits in the FPSW.

 

[Instruction Format]

Syntax

Processng Size

Operand

Code Size

(Byte)

src

dest

FTOI src, dest

L

Rs

Rd

3

L

[Rs].L

Rd

3

L

dsp:8[Rs].L

Rd

4

L

dsp:16[Rs].L

Rd

5

[Flag Change]

Flag

C

Z

S

O

CV

CO

CZ

CU

CX

CE

FV

FO

FZ

FU

FX

Change

 

 

 

 

 

 

 

 

 

 

Conditions

Z : The flag is set if the result of the operation is 0; otherwise it is cleared.

S : The flag is set if the sign bit (bit 31) of the result of the operation is 1; otherwise it is cleared.

CV : The flag is set if an invalid operation exception is generated; otherwise it is cleared.

CO : The value of the flag is always 0.

CZ : The value of the flag is always 0.

CU : The value of the flag is always 0.

CX : The flag is set if an inexact exception is generated; otherwise it is cleared.

CE : The flag is set if an unimplemented processing exception is generated; otherwise it is cleared.

FV : The flag is set if an invalid operation exception is generated; otherwise it does not change.

FX : The flag is set if an inexact exception is generated; otherwise it does not change.

Note

The FX and FV flags do not change if any of the exception enable bits EX and EV is 1. The S and Z flags do not change when an exception is generated.

 

[Description Example]

FTOI R1, R2

FTOI [R1], R2