Andes Workshop

It is currently Sun Oct 13, 2024 4:32 am

All times are UTC + 8 hours [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: how to use mulr64 instruction
PostPosted: Thu Jun 30, 2016 6:04 pm 
Offline

Joined: Wed Aug 27, 2014 1:00 pm
Posts: 12
Andes mulr64 instruction: [ mulr64 rt, ra, rb ] that multiply the unsigned integer contents of two 32-bit registers and write the 64-bit result to an even/odd pair of 32-bit registers.

if you want to use this instruction, you can programming code as below:

#include <stdio.h>
#include <stdlib.h>
long long my_mulr64([long long a, long long b)
{
return a*b;
}

long long my_mul(int a, int b)
{
return a*b;
}

int main(void)
{
long long x, y;
long long z=0x5566;
x=0x24680;
y=0x12345;
z+=x*y;
z+=my_mulr64(x, y);
z+=my_mul(24680+10, 123456789+10);
}

that declare the related variable as long long type.
attached is the project.


Attachments:
hello-mulr64.zip [40.42 KiB]
Downloaded 1394 times
Top
 Profile Send private message E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group