18 Multiplier/Divider (COPRO2)
S1C17M12/M13 TECHNICAL MANUAL
Seiko Epson Corporation
18-7
(Rev. 1.2)
Conditions to set the overflow (V) flag
An overflow occurs in a signed MAC operation and the overflow (V) flag is set to 1 when the signs of the mul-
tiplication result, operation result register value, and multiplication & accumulation result match the following
conditions:
Table 18.5.3 Conditions to Set the Overflow (V) Flag
Mode setting value
Sign of multiplication result
Sign of operation result
register value
Sign of multiplication &
accumulation result
0x07
0 (positive)
0 (positive)
1 (negative)
0x07
1 (negative)
1 (negative)
0 (positive)
An overflow occurs when a MAC operation performs addition of positive values and a negative value results,
or it performs addition of negative values and a positive value results. The coprocessor holds the operation re-
sult until the overflow (V) flag is cleared.
Conditions to clear the overflow (V) flag
The overflow (V) flag that has been set will be cleared when an overflow has not been occurred during execu-
tion of the “
ld.ca
” instruction for MAC operation or when the “
ld.ca
” or “
ld.cf
” instruction is executed
in an operation mode other than operation result read mode.
18.6 Reading Operation Results
The “
ld.ca
” instruction cannot load a 32-bit operation result to a CPU register, so a multiplication, division or
MAC operation returns the one-half (16 bits according to the output mode) result (A[15:0] or A[31:16]) and the
flag status to the CPU registers. Another one-half should be read by setting COPRO2 into operation result read
mode. The operation result register keeps the loaded operation result until it is rewritten by other operation.
16 bits
S1C17 Core
Operation result
register 0
Operation result
register 1
Selector
Argument 2
Argument 1
Coprocessor
output (16 bits)
Flag output
COPRO2
Figure 18.6.1 Data Path in Operation Result Read Mode
Table 18.6.1 Operation in Operation Result Read Mode
Mode set-
ting value
Instruction
Operations
Flags
Remarks
0x03
ld.ca %rd,%rs
%rd
←
res[15:0]
psr (CVZN)
←
0b0000 This operation mode does not
affect the operation result reg-
isters 0 and 1.
ld.ca %rd,imm7
%rd
←
res[15:0]
0x13
ld.ca %rd,%rs
%rd
←
res[31:16]
ld.ca %rd,imm7
%rd
←
res[31:16]
0x23
ld.ca %rd,%rs
%rd
←
res1[15:0]
ld.ca %rd,imm7
%rd
←
res1[15:0]
0x33
ld.ca %rd,%rs
%rd
←
res1[31:16]
ld.ca %rd,imm7
%rd
←
res1[31:16]
res0: operation result register 0, res1: operation result register 1