Have you seen a version of IAR that supports 64 bit integers? The only
MSP430 tools I know of which support 64 bit integers are the mspgcc tools.
That said, this is a casting issue
int32_t a;
int32_t b;
int64_t c;
c = a*b;
means multiply a by b in their native way, and only then cast to the
type of c. That can be annoying, but its the way the C spec. says things
should work. If you want to multiply to give a 64 bit result, you can do
something like:
c = (int64_t) a*b
Typically compilers then do a 64 x 64 -> 64 multiply in a wasteful way,
but with optimisation they should be reducing it to 32 x 32 -> 64. I
think GCC always does.
Regards,
Steve
Andre Sodermans wrote:
so do I need to hand code it like Garst is suggesting?
The IAR compiler generates it exactly the way Garst
has mentioned but mspgcc doesn't. Perhaps it is a
casting issue?
--- Dmitry <[email protected]> wrote:
it can
~d
----- Original Message -----
From: "Andre Sodermans" <[email protected]>
To: <[email protected]>
Sent: Wednesday, February 16, 2005 10:47 PM
Subject: [Mspgcc-users] u32 x u32 -> u64 using h/w
multiplier
does anybody know if mspgcc can generate the
instruction stream for a multiply of two 32bit
operands into a 64bit result (using h/w mul) as
in:
unsigned long a,b;
unsigned long long res;
res = (unsigned long long) a*b;
If I try the above code on my device (149) a
u32xu32->u32 using h/w mul gets generated.
__________________________________
Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty
viruses.
http://promotions.yahoo.com/new_mail
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT
Products from real users.
Discover which products truly live up to the hype.
Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Mspgcc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT
Products from real users.
Discover which products truly live up to the hype.
Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Mspgcc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
__________________________________
Do you Yahoo!?
Yahoo! Mail - 250MB free storage. Do more. Manage less.
http://info.mail.yahoo.com/mail_250
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Mspgcc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users