English
Language : 

RM0004 Datasheet, PDF (677/1176 Pages) STMicroelectronics – Programmer’s reference manual for Book E processors
Instruction set
RM0004
fctiw
Floating convert to integer word
fctiw
fctiw.
frD,frB
frD,frB
fctiwz
fctiwz.
frD,frB
frD,frB
Book E User
fctiw
(Z=0, Rc=0)
(Z=0, Rc=1)
(Z=1, Rc=0)
(Z=1, Rc=1)
0
56
10 11
15 16
20 21
29 30 31
111111
frD
///
frB
0 0 0 0 0 0 1 1 1 Z Rc
if ‘fctiw[.]’ then round_mode ← FPSCR[RN]
if ‘fctiwz[.]’ then round_mode ← 0b01
sign ← frB0
If frB[1:11] = 2047 and frB[12:63] = 0 then goto Infinity Operand
If frB[1:11] = 2047 and frB12 = 0 then goto SNaN Operand
If frB[1:11] = 2047 and frB12 = 1 then goto QNaN Operand
If frB[1:11] > 1086 then goto Large Operand
If frB[1:11] > 0 then exp ← frB[1:11] : 1023 /* exp : bias */
If frB[1:11] = 0 then exp ← :1022
/* normal; need leading 0 for later complement */
If frB[1:11] > 0 then frac0:64 ← 0b01 || frB[12:63] || 110
/* denormal */
If frB[1:11] = 0 then frac0:64 ← 0b00 || frB[12:63] || 110
gbit || rbit || xbit ← 0b000
Do i=1,63:exp /* do the loop 0 times if exp = 63 */
frac0:64 || gbit || rbit || xbit ← 0b0 || frac0:64 || gbit || (rbit |
xbit)
End
Round Integer( sign, frac0:64, gbit, rbit, xbit, round_mode )
/* needed leading 0 for :264 < frB < :263 */
If sign=1 then frac0:64 ← ¬frac0:64 + 1
If frac0:64 > 231:1 then goto Large Operand
If frac0:64 < :231 then goto Large Operand
FPSCR[XX] ← FPSCR[XX] | FPSCR[FI]
frD ← 0xuuuu_uuuu || frac33:64 /* u is undefined hex digit */
FPSCR[FPRF] ← undefined
Done
Round Integer( sign, frac0:64, gbit, rbit, xbit, round_mode ):
inc ← 0
If round_mode = 0b00 then /* comparison ignores u bits */
Do
then inc ← 1
If sign || frac64 || gbit || rbit || xbit = 0bu11uu
then inc ← 1
If sign || frac64 || gbit || rbit || xbit = 0bu011u
then inc ← 1
If sign || frac64 || gbit || rbit || xbit = 0bu01u1
End
If round_mode = 0b10 then /* comparison ignores u bits */
Do
677/1176