What is a "register chanend"? Topic is solved

Technical questions regarding the xTIMEcomposer, xSOFTip Explorer and Programming with XMOS.
User avatar
dsteinwe
Experienced Member
Posts: 66
Joined: Wed Jun 29, 2016 8:59 am

What is a "register chanend"?

Postby dsteinwe » Mon Feb 25, 2019 5:45 pm

Hi,

I'm studding the code from the usb audio demo. In the source file "usb_buffer.xc", I have found the function:

Code: Select all

buffer(register chanend c_aud_out, register chanend c_aud_in, ...)
Can anybody explain me, what a "register chanend" is? So far, I have not found any documentation about it.

Thanks,
Dieter
View Solution
User avatar
CousinItt
XCore Addict
Posts: 178
Joined: Wed May 31, 2017 6:55 pm

Postby CousinItt » Mon Feb 25, 2019 7:21 pm

From the XC reference:
The auto and register specifiers give the declared objects automatic storage class, and may be used only within functions. Such declarations also serve as definitions and cause storage to be reserved.
Why it's necessary to do this for this particular function I'm not sure. There doesn't appear to be any other similar examples in the library code.
User avatar
dsteinwe
Experienced Member
Posts: 66
Joined: Wed Jun 29, 2016 8:59 am

Postby dsteinwe » Tue Feb 26, 2019 9:17 am

I have found the document (https://www.xmos.com/developer/download ... %5D%29.pdf), that you refer. Unfortunately, I don't understand it.
User avatar
dsteinwe
Experienced Member
Posts: 66
Joined: Wed Jun 29, 2016 8:59 am

Postby dsteinwe » Fri Aug 07, 2020 9:41 am

I have implemented a performance test using a streaming channel without and within "register". The performance does not differ. Therefore, I think it is a useless modifier in combination with a channel.

What does the "register" modifier do: Registers are faster than memory to access. This modifier hints the compiler to store the variable in the register and not in the memory.

Who is online

Users browsing this forum: No registered users and 9 guests