www.ti.com
Instructions
ADDF32 RaH, RbH, #16FHi
32-bit Floating-Point Addition
Operands
RaH
floating-point destination register (R0H to R7H)
RbH
floating-point source register (R0H to R7H)
#16FHi
A 16-bit immediate value that represents the upper 16-bits of an IEEE 32-bit
floating-point value. The low 16-bits of the mantissa are assumed to be all 0.
Opcode
LSW: 1110 1000
10II IIII
MSW: IIII IIII
IIbb baaa
Description
Add RbH to the floating-point value represented by the immediate operand. Store the
result of the addition in RaH.
#16FHi is a 16-bit immediate value that represents the upper 16-bits of an IEEE 32-bit
floating-point value. The low 16-bits of the mantissa are assumed to be all 0. #16FHi is
most useful for representing constants where the lowest 16-bits of the mantissa are 0.
Some examples are 2.0 (0x40000000), 4.0 (0x40800000), 0.5 (0x3F000000), and -1.5
(0xBFC00000). The assembler will accept either a hex or float as the immediate value.
That is, the value -1.5 can be represented as #-1.5 or #0xBFC0.
RaH = RbH + #16FHi:0
This instruction can also be written as ADDF32 RaH, #16FHi, RbH.
Flags
This instruction modifies the following flags in the STF register:
Flag
TF
ZI
NI
ZF
NF
LUF
LVF
Modified
No
No
No
No
No
Yes
Yes
The STF register flags are modified as follows:
•
LUF = 1 if ADDF32 generates an underflow condition.
•
LVF = 1 if ADDF32 generates an overflow condition.
Pipeline
This is a 2 pipeline-cycle instruction (2p). That is:
ADDF32 RaH, #16FHi, RbH
; 2 pipeline cycles (2p)
NOP
; 1 cycle delay or non-conflicting instruction
; <-- ADDF32 completes, RaH updated
NOP
Any instruction in the delay slot must not use RaH as a destination register or use RaH
as a source operand.
Example
; Add to R1H the value 2.0 in 32-bit floating-point format
ADDF32 R0H, R1H, #2.0
; R0H = R1H + 2.0
NOP
; Delay for ADDF32 to complete
; <-- ADDF32 completes, R0H updated
NOP
;
; Add to R3H the value -2.5 in 32-bit floating-point format
ADDF32 R2H, R3H, #-2.5
; R2H = R3H + (-2.5)
NOP
; Delay for ADDF32 to complete
; <-- ADDF32 completes, R2H updated
NOP
;
; Add to R5H the value 0x3FC00000 (1.5)
ADDF32 R5H, R5H, #0x3FC0
; R5H = R5H + 1.5
NOP
; Delay for ADDF32 to complete
; <-- ADDF32 completes, R5H updated
NOP
;
SPRUEO2A – June 2007 – Revised August 2008
Instruction Set
37
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 ...