Instructions
www.ti.com
SETFLG FLAG, VALUE
Set or clear selected floating-point status flags
Operands
FLAG
11 bit mask indicating which floating-point status flags to change.
VALUE
11 bit mask indicating the flag value; 0 or 1.
Opcode
LSW: 1110 0110
00FF FFFF
MSW: FFFF FVVV
VVVV VVVV
Description
The SETFLG instruction is used to set or clear selected floating-point status flags in the
STF register. The FLAG field is an 11-bit value that indicates which flags will be
changed. That is, if a FLAG bit is set to 1 it indicates that flag will be changed; all other
flags will not be modified. The bit mapping of the FLAG field is shown below:
10
9
8
7
6
5
4
3
2
1
0
reserved
RNDF32
reserved
reserved
TF
ZI
NI
ZF
NF
LUF
LVF
The VALUE field indicates the value the flag should be set to; 0 or 1.
Restrictions
Do not use the SETFLG instruction in the delay slots for pipelined operations. Doing so
can yield invalid results. To avoid this, the proper number of NOPs or non-pipelined
instructions must be inserted before the SETFLG operation.
; The following is INVALID
MPYF32
R2H, R1H, R0H
; 2 pipeline-cycle instruction (2p)
SETFLG
RNDF32=1
; INVALID, do not use SETFLG in a delay slot
; The following is VALID
MPYF32
R2H, R1H, R0H
; 2 pipeline-cycle instruction (2p)
NOP
; 1 delay cycle, R2H updated after this instruction
SETFLG
RNDF32=1
; VALID
Flags
This instruction modifies the following flags in the STF register:
Flag
TF
ZI
NI
ZF
NF
LUF
LVF
Modified
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Any flag can be modified by this instruction.
Pipeline
This is a single-cycle instruction.
Example
To make it easier and legible, the assembler will accept a FLAG=VALUE syntax for the
STFLG operation as shown below:
SETFLG
RNDF32=0, TF=1, ZF=0
; FLAG = 01001001000, VALUE = X0XX1XX0XXX
MOVST0
TF, ZF, LUF
; Copy the indicated flags to ST0
; X means this flag is not modified.
; The assembler will set X values to 0
See also
Instruction Set
122
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 ...