STDA045 November 2026 MSPM0G1505 , MSPM0G1506 , MSPM0G1507 , MSPM0G1518 , MSPM0G1519 , MSPM0G3505 , MSPM0G3506 , MSPM0G3507 , MSPM0G3518 , MSPM0G3519
The same operation can be performed using MATHACL to get the h[0] result:
MATHACL->RES2 = 0;
MATHACL->RES1 = 0;
MATHACL->OP2 = g0;
MATHACL->OP1 = f0;
MATHACL->OP2 = g9_19;
MATHACL->OP1 = f1_2;
MATHACL->OP2 = g8_19;
MATHACL->OP1 = f2;
MATHACL->OP2 = g7_19;
MATHACL->OP1 = f3_2;
MATHACL->OP2 = g6_19;
MATHACL->OP1 = f4;
MATHACL->OP2 = g5_19;
MATHACL->OP1 = f5_2;
MATHACL->OP2 = g4_19;
MATHACL->OP1 = f6;
MATHACL->OP2 = g3_19;
MATHACL->OP1 = f7_2;
MATHACL->OP2 = g2_19;
MATHACL->OP1 = f8;
MATHACL->OP2 = g1_19;
MATHACL->OP1 = f9_2;
__asm__ __volatile__ ("nop");
hvect[0] = ((uint64)(MATHACL->RES2)<<32) + MATHACL->RES1;
After accumulation, carries are propagated through alternating 26-bit and 25-bit limbs. The final carry from the highest limb is wrapped into limb 0 and multiplied by 19, maintaining a valid field element.
Based on a MAC operation in the MATHACL module in MSPM0G devices, the program must continuously input the 32-bit operation data into OP1 and OP2 to directly get the MAC results from the RES register, which is an obvious improvement to 32-bit multiplication efficiency.