Rev. 1.50, 10/04, page 235 of 448
10.1.18 DMULS.L
(Double-length
Multiply as Signed): Arithmetic Instruction
Format
Operation
Instruction Code
Cycle
T Bit
DMULS.L Rm,Rn
Signed,
Rn
×
Rm
→
MAC
0011nnnnmmmm1101
2 —
Description:
This instruction performs 32-bit multiplication of the contents of general register Rn
by the contents of Rm, and stores the 64-bit result in the MACH and MACL registers. The
multiplication is performed as a signed arithmetic operation.
Notes:
None
Operation:
DMULS(long m, long n) /* DMULS.L Rm,Rn */
{
unsigned long RnL,RnH,RmL,RmH,Res0,Res1,Res2;
unsigned long temp0,temp1,temp2,temp3;
long tempm,tempn,fnLmL;
tempn = (long)R[n];
tempm = (long)R[m];
if (tempn<0) tempn = 0 - tempn;
if (tempm<0) tempm = 0 - tempm;
if ((long)(R[n]^R[m])<0) fnLmL = -1;
else fnLmL = 0;
temp1 = (unsigned long)tempn;
temp2 = (unsigned long)tempm;
RnL = temp1&0x0000FFFF;
RnH = (temp1>>16)&0x0000FFFF;
RmL = temp2&0x0000FFFF;
RmH = (temp2>>16)&0x0000FFFF;
Summary of Contents for SuperH SH-4A
Page 2: ...Rev 1 50 10 04 page ii of xx ...
Page 8: ...Rev 1 50 10 04 page viii of xx ...
Page 116: ...Rev 1 50 10 04 page 96 of 448 ...
Page 178: ...Rev 1 50 10 04 page 158 of 448 ...
Page 206: ...Rev 1 50 10 04 page 186 of 448 ...
Page 231: ...Rev 1 50 10 04 page 211 of 448 Possible Exceptions Slot illegal instruction exception ...
Page 235: ...Rev 1 50 10 04 page 215 of 448 Possible Exceptions Slot illegal instruction exception ...
Page 238: ...Rev 1 50 10 04 page 218 of 448 Possible Exceptions Slot illegal instruction exception ...
Page 408: ...Rev 1 50 10 04 page 388 of 448 Possible Exceptions Inexact Not generated when FPSCR PR 1 ...
Page 446: ...Rev 1 50 10 04 page 426 of 448 ...
Page 468: ...Rev 1 50 10 04 page 448 of 448 ...
Page 471: ......
Page 472: ...SH 4A Software Manual ...