Quote:
Aslak3 wrote:
Quote:
Anyway if really wont the compiler to optimize for using registers.
You need to define your int as:
Register int cnt;
however there is a limited number of registers and so there is limited of what compiler will put in there.
A decent compiler will take care of this for you. "register" as a keyword is basically obsolete and has been for years. Likewise a good compiler will use registers for loop counters etc, automatically.
Lawrence
unless you require dictating which register is what variable to keep consistency between compilers when needing to deal with such details
at that time you are completely on your own
I am yet to get any help clarifying just such a problem where "relying on the compilers intelligence" breaks the design due to inconsistent state
as I need 24 registers to retain state and not lose it by restoring the contents on function exit or pushing it onto the stack at entry
and this is for one of my existing projects
any suggestions? as I need to perform the above *inside* a C wrapper that is not a single function
「at least 282 seperate entry points sharing this set of state 」 and no it's not a design flaw
I would like to make it work on Amiga OS 4 and MorphOS if possible