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: 83
Joined: Wed Jun 29, 2016 8:59 am

What is a "register chanend"?

Post by dsteinwe »

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
Respected Member
Posts: 265
Joined: Wed May 31, 2017 6:55 pm

Post by CousinItt »

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: 83
Joined: Wed Jun 29, 2016 8:59 am

Post by dsteinwe »

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: 83
Joined: Wed Jun 29, 2016 8:59 am

Post by dsteinwe »

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.