Skip to main content
GameDev.net gamedev.net
🔒 Locked

Registers

Started by The Keymaster Mar 24, 2003 at 5:22 AM 1 replies 250+ views
Original Post
The Keymaster
The Keymaster
I''ve been looking into registers a bit, to see if it is possible to speed up some game code. Apparently, one can use the Register keyword to request that a certain variable be stored in a register. This sounds like it would come in handy with some often-accessed variables. Yet, MSDN has the following to say about this:
quote:
MSDN C++ language reference: the Register keyword The compiler does not accept user requests for register variables; instead, it makes its own register choices when global register-allocation optimization (/Oe option) is on. However, all other semantics associated with the register keyword are honored.
So... does this mean the Register keyword is useless in Visual Studio? What "other semantics" are there, associated with the register keyword? And what does global register-allocation optimization do?
JuNC
JuNC
It means exactly what it says, register is an outdated keyword and most (if not all) modern compilers totally ignore it. Global-register-allocation just means that the compiler knows better than the programmer which values are going to be in which registers at any particular time
fearyourself
fearyourself
register is nowadays seen like "please compiler, if u could put this in a register it would be cool", but it is definetely not seen (by the compilers) as an order... it''s more like a request when not ignored...

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.