What is the "macs" function???

New to XMOS and XCore? Get started here.
Post Reply
ekirill
New User
Posts: 2
Joined: Thu Sep 08, 2022 4:14 pm

What is the "macs" function???

Post by ekirill »

Hi, I really hope this is a very simple question for most here, but what does this do exactly:

{h, l} = macs(mult, sample, 0, 0);


I get its some sort of multiplication, returns high,low byte?? but is there a reference to somewhere I can find what this does exactly?
Is there a place somewhere I can look up things like this, that are not standard (as far as I know anyway)? It isn't in the programming guide.

Thank you!


User avatar
CousinItt
Respected Member
Posts: 360
Joined: Wed May 31, 2017 6:55 pm

Post by CousinItt »

From the xs1 library description (link):

Function macs

Description Multiplies two signed words and adds the double word result to a double word.

The high word and the low word of the result are returned. The calculation performed is:

(int64_t) a * (int64_t) b + (int64_t) c << 32 + (int64_t) d

Type {signed, unsigned} macs(signed a, signed b, signed c, unsigned d)

Returns The high and low halves of the calculation respectively.
ekirill
New User
Posts: 2
Joined: Thu Sep 08, 2022 4:14 pm

Post by ekirill »

Thank you!
Post Reply