A method and apparatus provides the capability for a single function to safely
use multiple register windows within the same function, with minimal additional
support from the operating system, by specifying a new window pointer, the "Effective
Current Window Pointer" (ECWP), to be used in conjunction with the prior art window
pointer. According to the present invention, the new window pointer ECWP can be
used to override the prior art window pointer in dictating from which register
window the operands stipulated by the instructions to be executed are sourced/sinked.
Consequently, using the method and apparatus of the invention, the number of spills
to memory is reduced, the number of instructions required is decreased, resources
are used more efficiently, and costly dependency problems and RAW (read-after-write)
stalls are prevented.