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!
What is the "macs" function???
-
- New User
- Posts: 2
- Joined: Thu Sep 08, 2022 4:14 pm
-
- Respected Member
- Posts: 366
- Joined: Wed May 31, 2017 6:55 pm
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.
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.
-
- New User
- Posts: 2
- Joined: Thu Sep 08, 2022 4:14 pm
Thank you!