Preserving the content of a first register without affecting...

Electrical computers and digital processing systems: processing – Processing control – Context preserving (e.g. – context swapping – checkpointing,...

Reexamination Certificate

Rate now

  [ 0.00 ] – not rated yet Voters 0   Comments 0

Details

Reexamination Certificate

active

06807627

ABSTRACT:

FIELD OF THE INVENTION
The present invention relates generally to using registers in various situations such as program modification or code instrumentation. More specifically, the invention relates to preserving the content of a first register so that this register may be used without affecting the content of a second register.
BACKGROUND OF THE INVENTION
Program modification is often implemented in code instrumentation, which is a process for analyzing programming code, usually executables. During this process, new instructions (or probe code) are added to the program, and, consequently, the original code in the program is changed and/or relocated, resulting in modified or instrumented code. Some examples of added instructions include adding values to a register, moving the content of one register to another register, moving the address of some data to some registers, etc. Code instrumentation may be done both statically and dynamically (i.e., while the program is running). In one approach, probe code is binary or assembly code.
Registers refer to special, high-speed areas storing data to be processed by the program code. A free register is a register that can be used in code instrumentation without violating program correctness. Compiler annotations and data flow analysis may provide information to identify free registers. However, compiler annotations require specific support from the compiler while data flow analysis is expensive. Alternatively, modifying the output parameters of a program statement provides a method for allocating registers. However, in one embodiment, this approach cannot be used to obtain free registers if the original code already uses all registers that can be made available using this approach. In an alternative approach, before the registers are used in the probe code, the content of the registers is saved to memory, and, after the registers are used in the probe code, the content of the registers is restored from memory. Unfortunately, in various situations, saving the content of a register to memory may cause the system to change the content of other registers, which changes the program semantics. For example, in the IA64 system architecture of Hewlett-Packard Company of Palo Alto, Calif., saving/restoring the content of a general register on the memory stack, while also preserving the NaT bit associated with the general register, causes the system to save the NaT bit into the UNaT register. This changes the content of the UNaT register as seen by the original program code, which may result in changed program behavior.
Based on the foregoing, it is clearly desirable that mechanisms be provided to solve the above deficiencies and associated problems.
SUMMARY OF THE INVENTION
The present invention, in various embodiments, provides techniques for preserving first content in a first register while maintaining second content in a second register wherein saving the first content to a particular location changes the second content in the second register. In one embodiment, the first register is a general register, the second register is a UNaT register, and each general register is associated with a NaT bit. In one aspect, saving the content of a general register to memory causes the system to save the associated NaT bit to the UNaT register, which, in effect, changes the content of the UNaT register. To preserve the content of the UNaT register while saving the content of a general register so that the general register may be used in programming code modification, the content of the general register, in one embodiment, is saved to a floating-point register. After the general register has been used, the content of the general register saved in the floating-point register is restored to the general register.
In one embodiment, when the content of a general register is saved to the floating-point register, the NaT bit associated with the general register is also saved. Further, if the NaT bit is not “set,” then the content of the general register needs to be restored, and, if the NaT bit is set, then the content of the general register may be discarded. Consequently, if the NaT bit is set, then only the NaT bit is restored. Conversely, if the NaT bit is not set, then both the content of the general register and the NaT bit are restored. Where it is desirable that the content of the floating-point register be preserved, this content is saved to memory and restored to the floating-register after the floating-point register has been used.


REFERENCES:
patent: 5021993 (1991-06-01), Matoba et al.
patent: 5812823 (1998-09-01), Kahle et al.
patent: 6128728 (2000-10-01), Dowling
Intel IA-64 Architecture Software Developer's Maunal, Jul. 2000, vol. 2 p. 15-2, vol. 3 p. 2-147.

LandOfFree

Say what you really think

Search LandOfFree.com for the USA inventors and patents. Rate them and share your experience with other people.

Rating

Preserving the content of a first register without affecting... does not yet have a rating. At this time, there are no reviews or comments for this patent.

If you have personal experience with Preserving the content of a first register without affecting..., we encourage you to share that experience with our LandOfFree.com community. Your opinion is very important and Preserving the content of a first register without affecting... will most certainly appreciate the feedback.

Rate now

     

Profile ID: LFUS-PAI-O-3286701

  Search
All data on this website is collected from public sources. Our data reflects the most accurate information available at the time of publication.