Instructions
www.ti.com
UI16TOF32 RaH, mem16
Convert unsigned 16-bit integer to 32-bit floating-point value
Operands
RaH
floating-point destination register (R0H to R7H)
mem16
pointer to 16-bit source memory location
Opcode
LSW: 1110 0010
1100 0100
MSW: 0000 0aaa
mem16
Description
When converting F32 to I16/UI16 data format, the F32TOI16/UI16 operation truncates to
zero while the F32TOI16R/UI16R operation will round to nearest (even) value.
RaH = UI16ToF32[mem16]
Flags
This instruction does not affect any flags:
Flag
TF
ZI
NI
ZF
NF
LUF
LVF
Modified
No
No
No
No
No
No
No
Pipeline
This is a 2 pipeline cycle (2p) instruction. That is:
UI16TOF32
RaH, mem16
; 2 pipeline cycles (2p)
NOP
; 1 cycle delay or non-conflicting instruction
; <-- UI16TOF32 completes, RaH updated
NOP
Any instruction in the delay slot must not use RaH as a destination register or as a
source operand.
Example
; float32 y,m,b;
; AdcRegs.RESULT0 is an unsigned int
; Calculate: y = (float)AdcRegs.ADCRESULT0 * m + b;
;
MOVW
DP
@0x01C4
UI16TOF32
R0H, @8
; R0H = (float)AdcRegs.RESULT0
MOV32
R1H, *-SP[6]
; R1H = M
; <-- Conversion complete, R0H valid
MPYF32
R0H, R1H, R0H
; R0H = (float)X * M
MOV32
R1H, *-SP[8]
; R1H = B
; <-- MPYF32 complete, R0H valid
ADDF32
R0H, R0H, R1H
; R0H = Y = (float)X * M + B
NOP
; <-- ADDF32 complete, R0H valid
MOV32
*-[SP], R0H
; Store Y
See also
Instruction Set
130
SPRUEO2A – June 2007 – Revised August 2008
Summary of Contents for TMS320C28 series
Page 2: ...2 SPRUEO2A June 2007 Revised August 2008 Submit Documentation Feedback ...
Page 12: ...Introduction 12 SPRUEO2A June 2007 Revised August 2008 Submit Documentation Feedback ...
Page 20: ...CPU Register Set 20 SPRUEO2A June 2007 Revised August 2008 Submit Documentation Feedback ...
Page 136: ...Instruction Set 136 SPRUEO2A June 2007 Revised August 2008 Submit Documentation Feedback ...