I think this paper is a very good start: https://pdfs.semanticscholar.org/1361/460a51ce9ecacec84fb8439caba4f88460c9.pdf
And I believe the RCS_Reg macro is the one mentioned in this thread: https://bbs.pinggu.org/thread-6434408-1-1.html
Hope it helps!