3 // NEC specific instructions
6 // Integer Instructions
7 // --------------------
9 // MulAcc is the Multiply Accumulator.
10 // This register is mapped on the the HI and LO registers.
11 // Upper 32 bits of MulAcc is mapped on to lower 32 bits of HI register.
12 // Lower 32 bits of MulAcc is mapped on to lower 32 bits of LO register.
15 :function:::unsigned64:MulAcc:
18 unsigned64 result = U8_4 (HI, LO);
22 :function:::void:SET_MulAcc:unsigned64 value
26 *AL4_8 (&HI) = VH4_8 (value);
27 *AL4_8 (&LO) = VL4_8 (value);
30 :function:::signed64:SignedMultiply:signed32 l, signed32 r
33 signed64 result = (signed64) l * (signed64) r;
37 :function:::unsigned64:UnsignedMultiply:unsigned32 l, unsigned32 r
40 unsigned64 result = (unsigned64) l * (unsigned64) r;
44 :function:::unsigned64:Low32Bits:unsigned64 value
47 unsigned64 result = (signed64) (signed32) VL4_8 (value);
51 :function:::unsigned64:High32Bits:unsigned64 value
54 unsigned64 result = (signed64) (signed32) VH4_8 (value);
60 // Multiply, Accumulate
61 000000,5.RS,5.RT,00000,00000,101000::64::MAC
65 SET_MulAcc (SD_, MulAcc (SD_) + SignedMultiply (SD_, GPR[RS], GPR[RT]));
69 // D-Multiply, Accumulate
70 000000,5.RS,5.RT,00000,00000,101001::64::DMAC
74 LO = LO + SignedMultiply (SD_, GPR[RS], GPR[RT]);