Register saving for function calling
AssigneeAdvanced Micro Devices, Inc.
InventorMichael John Bedy
Life of this patent
Estimating the term…
Abstract
Described herein are techniques for saving registers in the event of a function call. The techniques include modifying a program including a block of code designated as a calling code that calls a function. The modifying includes modifying the calling code to set a register usage mask indicating which registers are in use at the time of the function call. The modifying also includes modifying the function to combine the information of the register usage mask with information indicating registers used by the function to generate registers to be saved and save the registers to be saved.
Claims20
A method for saving registers in the event of a function call, the method comprising:
- modifying a program including a block of code designated as a calling code that calls a function, the modifying including:
- modifying the calling code to:
- set a register usage mask indicating which registers are in use at the time of the function call;
- and
- modifying the function to:
- combine the information of the register usage mask with information indicating registers used by the function to generate an indication of which registers are to be saved;
- and
- save the registers to be saved.
A computing device for saving registers in the event of a function call, the computing device comprising:
- a processor;
- and
- a memory storing instructions that, when executed by the processor, cause the processor to:
- modify a program including a block of code designated as a calling code that calls a function, the modifying including:
- modifying the calling code to:
- set a register usage mask indicating which registers are in use at the time of the function call;
- and
- modify the function to:
- combine the information of the register usage mask with information indicating registers used by the function to generate an indication of which registers are to be saved;
- and
- save the registers to be saved.
A non-transitory computer-readable medium storing instructions that, when executed by a processor, cause the processor to:
- modify a program including a block of code designated as a calling code that calls a function, the modifying including:
- modifying the calling code to:
- set a register usage mask indicating which registers are in use at the time of the function call;
- and
- modify the function to:
- combine the information of the register usage mask with information indicating registers used by the function to generate an indication of which registers are to be saved;
- and
- save the registers to be saved.
Dependencies are inferred from the claim text.