A system comprises a main stack, a local data stack and plurality of
flags. The main stack comprises a plurality of entries and is located
outside a processor's core. The local data stack is coupled to the main
stack and is located internal to the processor's core. The local data
stack has a plurality of entries that correspond to entries in the main
stack. Each flag is associated with a corresponding entry in the local
data stack and indicates whether the data in the corresponding local data
stack entry is valid. The system performs two instructions. One
instruction synchronizes the main stack to the local data stack and
invalidates the local data stack, while the other instruction
synchronizes the main stack without invalidating the local data stack.