Andes madds64 instruction: [ madds64 Dt, ra, rb ] that multiply the signed integer contents of two 32-bit registers and add the multiplication result to the content of a 64-bit data register(
Dx register). Write the final result back to the 64-bit data register.
you can check the
NOD field of
Misc. Configuration Register : cr4 (MSC_CFG) if the Dx registers exist or not.
if Dx registers exist,
as the compiler can't generate the Dx related instruction automatically, you can use
inline assembly to use the madds64 instruction
Code:
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
int a = 0x12345;
int b = 0x24680;
long long c = 0;
__asm__ volatile ("move \t $r6, %1 \n\t"
"move \t $r7, %2 \n\t"
"madds64 D0, $r6, $r7"
: "=r"(c)
: "r"(a),"r"(b)
: "$r6","$r7");
return 0;
}
you can use
madd64 instruction in the same way.
attached is the project.