Overhauled paragraph about register variables

git-svn-id: svn://svn.cc65.org/cc65/trunk@1634 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2002-11-25 15:03:54 +00:00
parent 5f812a3269
commit 192a6536f7

View file

@ -308,12 +308,11 @@ easy to see, that - apart from the additional code that is needed to save and
restore the values - you need to make heavy use of a variable to justify the restore the values - you need to make heavy use of a variable to justify the
overhead. overhead.
An exception are pointers, especially char pointers. The optimizer has code to As a general rule: Use register variables only for pointers that are
detect and transform the most common pointer operations if the pointer dereferenced several times in your function, or for heavily used induction
variable is a register variable. Declaring heavily used character pointers as variables in a loop (with several 100 accesses).
register may give significant gains in speed and size.
And remember: Register variables must be enabled with <tt/-Or/. And remember: Register variables must be enabled with <tt/-r/ or <tt/-Or/.