Endian conversion tool
AssigneeIntel Corporation
InventorsMichael P. Rice, Hugh Wilkinson, Maximillian J. Domeika, Evgueni V. Brevnov, Peter Lachner
Life of this patent
Estimating the term…
Abstract
In one embodiment of the invention code (e.g., compiler, tool) may generate information so a first code portion, which includes a pointer value in a first endian format (e.g., big endian), can be properly initialized and executed on a platform having a second endian format (e.g., little endian). Also, various embodiments of the invention may identify problematic regions of code (e.g., source code) where a particular byte order is cast away through void pointers.
Claims20
A method comprising:
- receiving first and second source code portions that respectively define first and second instances of a global variable, wherein each instance has a first endian format and neither instance can be fully initialized at compile time;
- generating first and second references to byteswap instructions configured to respectively convert the first and second instances to a second endian format;
- generating, using a processor, a shadow variable configured to suppress a byteswap of the second instance after compile time and based on the first instance having been byteswapped;
- and
- storing the shadow variable in a memory coupled to the processor.
An article comprising a non-transitory storage medium storing instructions that enable a processor-based system to:
- receive first and second code portions that respectively define first and second instances of a global variable, wherein each instance of the global variable has a first endian format and neither instance can be correctly initialized at compile time;
- and
- generate a first variable configured to suppress endian conversion of the second instance after compile time and based on the first instance having been endian converted.
An apparatus comprising:
- a processor, coupled to a memory, to:
- (1) receive, using the memory, first and second source code portions that respectively define first and second instances of a global variable, wherein each instance of the global variable has a first endian format and neither instance can be fully initialized at compile time;
- and
- (2) generate a first variable configured to suppress a byteswap of the second instance after compile time and based on the first instance having been byteswapped.
Dependencies are inferred from the claim text.