GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> IPBS / V0-0-2 > pbs / i845e


Interface   Data Structures   File List   Data Fields   Globals  

BSWP.ih File Reference

Byteswapping, inline versions. More...

#include <PBI/Inline.h>
#include <PBI/Unions.h>
#include <PBI/Attribute.h>
#include <PBI/Endianness.h>
#include <IPBS/impl/BSWP.ih.xx-xxx-xxx>

Defines

#define _AT   __attribute__((unused))
 Abbreviation for the attributes of the BSWP inlines.

Functions

BSWP__EXP_PROTO unsigned int BSWP__swap16 (unsigned short int val) _AT
 Byte swaps a 16 bit word.
BSWP__EXP_PROTO unsigned int BSWP__swap16l (unsigned short int val) _AT
 Ensures that the little endian input 16 bit word val is transformed to the host representation.
BSWP__EXP_PROTO unsigned int BSWP__swap16b (unsigned short int val) _AT
 Ensures that the big endian input 16 bit word val is transformed to the host representation.
BSWP__EXP_PROTO unsigned int BSWP__load16 (const unsigned short int *src) _AT
 Loads a byte swapped version of the 16 bit integer from memory.
BSWP__EXP_PROTO unsigned int BSWP__load16l (const unsigned short int *src) _AT
 Loads the host representation of the known little endian 16 bit integer byte from memory.
BSWP__EXP_PROTO unsigned int BSWP__load16b (const unsigned short int *src) _AT
 Loads the host representation of the known big endian 16 bit integer byte from memory.
BSWP__EXP_PROTO unsigned int BSWP__load16x (const unsigned short int *src, unsigned int offset) _AT
 Loads a byte swapped version of the 16 bit integer from memory.
BSWP__EXP_PROTO unsigned int BSWP__load16lx (const unsigned short int *src, unsigned int offset) _AT
 Loads the host representation of the known little endian 16 bit integer byte from memory.
BSWP__EXP_PROTO unsigned int BSWP__load16bx (const unsigned short int *src, unsigned int offset) _AT
 Loads the host representation of the known bige endian 16 bit integer byte from memory.
BSWP__EXP_PROTO void BSWP__store16 (unsigned short int *dst, unsigned short int val) _AT
 Stores a byte swapped version of the 16 bit integer to memory.
BSWP__EXP_PROTO void BSWP__store16l (unsigned short int *dst, unsigned short int val) _AT
 Stores the host representation of val into memory as a 16 bit little endian integer.
BSWP__EXP_PROTO void BSWP__store16b (unsigned short int *dst, unsigned short int val) _AT
 Stores the host representation of val into memory as a 16 bit big endian integer.
BSWP__EXP_PROTO void BSWP__store16x (unsigned short int *dst, unsigned int offset, unsigned short int val) _AT
 Stores a byte swapped version of the 16 bit integer to memory.
BSWP__EXP_PROTO void BSWP__store16lx (unsigned short int *dst, unsigned int offset, unsigned short int val) _AT
 Stores the host representation of val into memory as a 16 bit little endian integer.
BSWP__EXP_PROTO void BSWP__store16bx (unsigned short int *dst, unsigned int offset, unsigned short int val) _AT
 Stores the host representation of val into memory as a 16 bit big endian integer.
BSWP__EXP_PROTO unsigned int BSWP__swap16_lclXbig (unsigned short int val) _AT
 Byte swaps a 16 bit word; local representation <=> big.
BSWP__EXP_PROTO unsigned int BSWP__swap16_lclXlittle (unsigned short int val) _AT
 Byte swaps a 32 bit word; local representation <=> little.
BSWP__EXP_PROTO unsigned int BSWP__swap32 (unsigned int val) _AT
 Byte swaps a 32 bit word.
BSWP__EXP_PROTO unsigned int BSWP__swap32l (unsigned int val) _AT
 Ensures that the little endian input 32 bit word val is transformed to the host representation.
BSWP__EXP_PROTO unsigned int BSWP__swap32b (unsigned int val) _AT
 Ensures that the big endian input 16 bit word val is transformed to the host representation.
BSWP__EXP_PROTO unsigned int BSWP__load32 (const unsigned int *src) _AT
 Loads a byte swapped version of the 32 bit integer from memory.
BSWP__EXP_PROTO unsigned int BSWP__load32l (const unsigned int *src) _AT
 Loads the host representation of the known little endian 32 bit integer byte from memory.
BSWP__EXP_PROTO unsigned int BSWP__load32b (const unsigned int *src) _AT
 Loads the host representation of the known big endian 32 bit integer byte from memory.
BSWP__EXP_PROTO unsigned int BSWP__load32x (const unsigned int *src, unsigned int offset) _AT
 Loads a byte swapped version of the 32 bit integer from memory after applying the specified offset.
BSWP__EXP_PROTO unsigned int BSWP__load32lx (const unsigned int *src, unsigned int offset) _AT
 Loads the host representation of the known little endian 32 bit integer byte from memory.
BSWP__EXP_PROTO unsigned int BSWP__load32bx (const unsigned int *src, unsigned int offset) _AT
 Loads the host representation of the known bige endian 32 bit integer byte from memory.
BSWP__EXP_PROTO void BSWP__store32 (unsigned int *dst, unsigned int val) _AT
 Stores a byte swapped version of the 32 bit integer to memory.
BSWP__EXP_PROTO void BSWP__store32l (unsigned int *dst, unsigned int val) _AT
 Stores the host representation of val into memory as a 32 bit little endian integer.
BSWP__EXP_PROTO void BSWP__store32b (unsigned int *dst, unsigned int val) _AT
 Stores the host representation of val into memory as a 32 bit big endian integer.
BSWP__EXP_PROTO void BSWP__store32x (unsigned int *dst, unsigned int offset, unsigned int val) _AT
 Stores a byte swapped version of the 32 bit integer to memory after a byte offset has been applied.
BSWP__EXP_PROTO void BSWP__store32lx (unsigned int *dst, unsigned int offset, unsigned int val) _AT
 Stores the host representation of val into memory as a 32 bit little endian integer.
BSWP__EXP_PROTO void BSWP__store32bx (unsigned int *dst, unsigned int offset, unsigned int val) _AT
 Stores the host representation of val into memory as a 32 bit big endian integer.
BSWP__EXP_PROTO unsigned int BSWP__swap32_lclXbig (unsigned int val) _AT
 Byte swaps a 32 bit word; local representation <=> big.
BSWP__EXP_PROTO unsigned int BSWP__swap32_lclXlittle (unsigned int val) _AT
 Byte swaps a 32 bit word; local representation <=> little.
BSWP__EXP_PROTO unsigned long
long int 
BSWP__swap64 (unsigned long long int val) _AT
 Byte swaps a 64 bit word.
BSWP__EXP_PROTO unsigned long
long int 
BSWP__swap64l (unsigned long long int val) _AT
 Ensures that the little endian input 64 bit word val is transformed to the host representation.
BSWP__EXP_PROTO unsigned long
long int 
BSWP__swap64b (unsigned long long int val) _AT
 Ensures that the big endian input 64 bit word val is transformed to the host representation.
BSWP__EXP_PROTO unsigned long
long int 
BSWP__load64 (const unsigned long long int *src) _AT
 Loads a byte swapped version of the 64 bit integer from memory.
BSWP__EXP_PROTO unsigned long
long int 
BSWP__load64l (const unsigned long long int *src) _AT
 Loads the host representation of the known little endian 64 bit integer byte from memory.
BSWP__EXP_PROTO unsigned long
long int 
BSWP__load64b (const unsigned long long int *src) _AT
 Loads the host representation of the known big endian 64 bit integer byte from memory.
BSWP__EXP_PROTO unsigned long
long int 
BSWP__load64x (const unsigned long long int *src, unsigned int offset) _AT
 Loads a byte swapped version of the 64 bit integer from memory.
BSWP__EXP_PROTO unsigned long
long int 
BSWP__load64lx (const unsigned long long int *src, unsigned int offset) _AT
 Loads the host representation of the known little endian 64 bit integer byte from memory.
BSWP__EXP_PROTO unsigned long
long int 
BSWP__load64bx (const unsigned long long int *src, unsigned int offset) _AT
 Loads the host representation of the known bige endian 64 bit integer byte from memory.
BSWP__EXP_PROTO void BSWP__store64 (unsigned long long int *dst, unsigned long long int val) _AT
 Stores a byte swapped version of the 64 bit integer to memory.
BSWP__EXP_PROTO void BSWP__store64l (unsigned long long int *dst, unsigned long long int val) _AT
 Stores the host representation of val into memory as a 64 bit little endian integer.
BSWP__EXP_PROTO void BSWP__store64b (unsigned long long int *dst, unsigned long long int val) _AT
 Stores the host representation of val into memory as a 64 bit big endian integer.
BSWP__EXP_PROTO void BSWP__store64x (unsigned long long int *dst, unsigned int offset, unsigned long long int val) _AT
 Stores a byte swapped version of the 64 bit integer to memory.
BSWP__EXP_PROTO void BSWP__store64lx (unsigned long long int *dst, unsigned int offset, unsigned long long int val) _AT
 Stores the host representation of val into memory as a 64 bit little endian integer.
BSWP__EXP_PROTO void BSWP__store64bx (unsigned long long int *dst, unsigned int offset, unsigned long long int val) _AT
 Stores the host representation of val into memory as a 64 bit big endian integer.
BSWP__EXP_PROTO unsigned long
long int 
BSWP__swap64_lclXbig (unsigned long long int val) _AT
 Byte swaps a 64 bit word; local representation <=> big.
BSWP__EXP_PROTO unsigned long
long int 
BSWP__swap64_lclXlittle (unsigned long long int val) _AT
 Byte swaps a 32 bit word; local representation <=> little.


Detailed Description

Byteswapping, inline versions.

Author:
JJRussell - russell@slac.stanford.edu

    CVS $Id: BSWP.ih,v 1.2 2011/03/25 21:15:00 saxton Exp $

SYNOPSIS
This provides a generic interface to the inline byte swapping. These routines are inspired by the PPC instructions that perform byte swapping operations.

The PPC provides three sets of instuctions, one that operates on 16 bit values one that operates on 32 bit values and one that operates on 64 bit values. All three sets have five instructions. The first two byte swaps the data as in loads it from memory, while the second one byte swaps the data as it stores it in memory. These instructions come in two flavors, a straight addressing mode and an indexed addressing mode. The final two do the byteswapping as immediate value. This final one is provided only in this sense of completing the complement of operations. Unfortunately there is no instruction to byte swap a value already in a register. All 6 of these instructions are made available as inline functions.

In addition to splitting the routines into 16, 32 and 64 bit versions, the routines can be split along another axis, single and array versions. The array versions are really just convenience routines in that all they do is wrap the single word routines in a loop. Since this is a common thing to do, they are also provided, although only in a callable form (see BSWP.h).

The single word swapping routines have only an inline implementation. This is because these routines are so simple and efficiency is a major design driver, there is no reason to use a callable version.


Function Documentation

BSWP__EXP_PROTO unsigned int BSWP__load16 ( const unsigned short int *  src  ) 

Loads a byte swapped version of the 16 bit integer from memory.

Parameters:
src The address of the 16 bit integer to load
Returns:
The byte-swapped value of the 16 bit integer
This routine should be used when loading 16 bit byte-swapped value from memory.

References BSWP__swap16().

Referenced by BSWP__load16b().

BSWP__EXP_PROTO unsigned int BSWP__load16b ( const unsigned short int *  src  ) 

Loads the host representation of the known big endian 16 bit integer byte from memory.

Parameters:
src The address of the known bit endian 16 bit integer to load
Returns:
The host representation of the big endian 16 bit integer
This routine should be used when loading a known big endian 16 bit values from memory and the caller wishes that value to be in the host's representation.

References BSWP__load16().

BSWP__EXP_PROTO unsigned int BSWP__load16bx ( const unsigned short int *  src,
unsigned int  offset 
)

Loads the host representation of the known bige endian 16 bit integer byte from memory.

Parameters:
src The address of the known big endian 16 bit integer to load.
offset The byte offset from the source
Returns:
The host representation of the big endian 16 bit integer
This routine should be used when loading a known big endian 16 bit value from memory. and the caller wishes that value to be in the host's representation. If the offset is known to be a constant, it is marginally more efficient to use BSWP__load16l().

Warning:
Note that offset is a byte offset and not an index. This is in keeping with the spirit that this instruction maps directly to the underlying instruction of the PPC.

References BSWP__load16x().

BSWP__EXP_PROTO unsigned int BSWP__load16l ( const unsigned short int *  src  ) 

Loads the host representation of the known little endian 16 bit integer byte from memory.

Parameters:
src The address of the known little endian 16 bit integer to load
Returns:
The host representation of the little endian 16 bit integer
This routine should be used when loading a known little endian 16 bit values from memory and the caller wishes that value to be in the host's representation.

BSWP__EXP_PROTO unsigned int BSWP__load16lx ( const unsigned short int *  src,
unsigned int  offset 
)

Loads the host representation of the known little endian 16 bit integer byte from memory.

Parameters:
src The address of the known little endian 16 bit integer to load.
offset The byte offset from the source
Returns:
The host representation of the little endian 16 bit integer
This routine should be used when loading a known little endian 16 bit value from memory. and the caller wishes that value to be in the host's representation. If the offset is known to be a constant, it is marginally more efficient to use BSWP__load16l().

Warning:
Note that offset is a byte offset and not an index. This is in keeping with the spirit that this instruction maps directly to the underlying instruction of the PPC.

BSWP__EXP_PROTO unsigned int BSWP__load16x ( const unsigned short int *  src,
unsigned int  offset 
)

Loads a byte swapped version of the 16 bit integer from memory.

Parameters:
src The address of the 16 bit integer to load
offset The byte offset from the source
Returns:
The byte-swapped value of the 16 bit integer
This routine should be used when loading 16 bit byte-swapped value from memory. If the offset is known to be a constant, it is marginally more efficient to use BSWP__load16().

Warning:
Note that offset is a byte offset and not an index. This is in keeping with the spirit that this instruction maps directly to the underlying instruction of the PPC.

References BSWP__swap16().

Referenced by BSWP__load16bx(), and BSWP_swap16N().

BSWP__EXP_PROTO unsigned int BSWP__load32 ( const unsigned int *  src  ) 

Loads a byte swapped version of the 32 bit integer from memory.

Parameters:
src The address of the 32 bit integer to load
Returns:
The byte-swapped value of the 32 bit integer
This routine should be used when loading 32 bit byte-swapped value from memory. If the value is already in a register, then use BSWP__swap32().

References BSWP__swap32().

Referenced by BSWP__load32b().

BSWP__EXP_PROTO unsigned int BSWP__load32b ( const unsigned int *  src  ) 

Loads the host representation of the known big endian 32 bit integer byte from memory.

Parameters:
src The address of the known bit endian 32 bit integer to load
Returns:
The host representation of the big endian 32 bit integer
This routine should be used when loading a known big endian 32 bit values from memory and the caller wishes that value to be in the host's representation.

References BSWP__load32().

BSWP__EXP_PROTO unsigned int BSWP__load32bx ( const unsigned int *  src,
unsigned int  offset 
)

Loads the host representation of the known bige endian 32 bit integer byte from memory.

Parameters:
src The address of the known big endian 32 bit integer to load.
offset The byte offset from the source
Returns:
The host representation of the big endian 32 bit integer
This routine should be used when loading a known big endian 32 bit value from memory. and the caller wishes that value to be in the host's representation. If the offset is known to be a constant, it is marginally more efficient to use BSWP__load32l().

Warning:
Note that offset is a byte offset and not an index. This is in keeping with the spirit that this instruction maps directly to the underlying instruction of the PPC.

References BSWP__load32x().

BSWP__EXP_PROTO unsigned int BSWP__load32l ( const unsigned int *  src  ) 

Loads the host representation of the known little endian 32 bit integer byte from memory.

Parameters:
src The address of the known little endian 32 bit integer to load
Returns:
The host representation of the little endian 32 bit integer
This routine should be used when loading a known little endian 32 bit values from memory and the caller wishes that value to be in the host's representation.

BSWP__EXP_PROTO unsigned int BSWP__load32lx ( const unsigned int *  src,
unsigned int  offset 
)

Loads the host representation of the known little endian 32 bit integer byte from memory.

Parameters:
src The address of the known little endian 32 bit integer to load.
offset The byte offset from the source
Returns:
The host representation of the little endian 32 bit integer
This routine should be used when loading a known little endian 32 bit value from memory. and the caller wishes that value to be in the host's representation. If the offset is known to be a constant, it is marginally more efficient to use BSWP__load32l().

Warning:
Note that offset is a byte offset and not an index. This is in keeping with the spirit that this instruction maps directly to the underlying instruction of the PPC.

BSWP__EXP_PROTO unsigned int BSWP__load32x ( const unsigned int *  src,
unsigned int  offset 
)

Loads a byte swapped version of the 32 bit integer from memory after applying the specified offset.

Parameters:
src The address of the 32 bit integer to load
offset The byte offset to be applied.
Returns:
The byte-swapped value of the 32 bit integer
This routine should be used when loading 32 bit byte-swapped value from memory. If the value is already in a register, then use BSWP__swap32().

Warning:
Note that offset is a byte offset and not an index. This is in keeping with the spirit that this instruction maps directly to the underlying instruction of the PPC.

References BSWP__swap32().

Referenced by BSWP__load32bx(), and BSWP_swap32N().

BSWP__EXP_PROTO unsigned long long int BSWP__load64 ( const unsigned long long int *  src  ) 

Loads a byte swapped version of the 64 bit integer from memory.

Parameters:
src The address of the 64 bit integer to load
Returns:
The byte-swapped value of the 64 bit integer
This routine should be used when loading 64 bit byte-swapped value from memory.

Referenced by BSWP__load64b(), and BSWP__load64x().

BSWP__EXP_PROTO unsigned long long int BSWP__load64b ( const unsigned long long int *  src  ) 

Loads the host representation of the known big endian 64 bit integer byte from memory.

Parameters:
src The address of the known bit endian 64 bit integer to load
Returns:
The host representation of the big endian 64 bit integer
This routine should be used when loading a known big endian 64 bit values from memory and the caller wishes that value to be in the host's representation.

References BSWP__load64().

BSWP__EXP_PROTO unsigned long long int BSWP__load64bx ( const unsigned long long int *  src,
unsigned int  offset 
)

Loads the host representation of the known bige endian 64 bit integer byte from memory.

Parameters:
src The address of the known big endian 64 bit integer to load.
offset The byte offset from the source
Returns:
The host representation of the big endian 64 bit integer
This routine should be used when loading a known big endian 64 bit value from memory. and the caller wishes that value to be in the host's representation. If the offset is known to be a constant, it is marginally more efficient to use BSWP__load64l().

Warning:
Note that offset is a byte offset and not an index. This is in keeping with the spirit that this instruction maps directly to the underlying instruction of the PPC.

References BSWP__load64x().

BSWP__EXP_PROTO unsigned long long int BSWP__load64l ( const unsigned long long int *  src  ) 

Loads the host representation of the known little endian 64 bit integer byte from memory.

Parameters:
src The address of the known little endian 64 bit integer to load
Returns:
The host representation of the little endian 64 bit integer
This routine should be used when loading a known little endian 64 bit values from memory and the caller wishes that value to be in the host's representation.

BSWP__EXP_PROTO unsigned long long int BSWP__load64lx ( const unsigned long long int *  src,
unsigned int  offset 
)

Loads the host representation of the known little endian 64 bit integer byte from memory.

Parameters:
src The address of the known little endian 64 bit integer to load.
offset The byte offset from the source
Returns:
The host representation of the little endian 64 bit integer
This routine should be used when loading a known little endian 64 bit value from memory. and the caller wishes that value to be in the host's representation. If the offset is known to be a constant, it is marginally more efficient to use BSWP__load64l().

Warning:
Note that offset is a byte offset and not an index. This is in keeping with the spirit that this instruction maps directly to the underlying instruction of the PPC.

BSWP__EXP_PROTO unsigned long long int BSWP__load64x ( const unsigned long long int *  src,
unsigned int  offset 
)

Loads a byte swapped version of the 64 bit integer from memory.

Parameters:
src The address of the 64 bit integer to load
offset The byte offset from the source
Returns:
The byte-swapped value of the 64 bit integer
This routine should be used when loading 64 bit byte-swapped value from memory. If the offset is known to be a constant, it is marginally more efficient to use BSWP__load64().

Warning:
Note that offset is a byte offset and not an index. This is in keeping with the spirit that this instruction maps directly to the underlying instruction of the PPC.

References BSWP__load64().

Referenced by BSWP__load64bx(), and BSWP_swap64N().

BSWP__EXP_PROTO void BSWP__store16 ( unsigned short int *  dst,
unsigned short int  val 
)

Stores a byte swapped version of the 16 bit integer to memory.

Parameters:
dst The address of the destination word
val The word to byte swap and store
This routine should be used when storing a 16 bit byte-swapped value into memory.

References BSWP__swap16().

Referenced by BSWP__store16b().

BSWP__EXP_PROTO void BSWP__store16b ( unsigned short int *  dst,
unsigned short int  val 
)

Stores the host representation of val into memory as a 16 bit big endian integer.

Parameters:
dst The address of the destination word
val The 16 bit integer to store as a big endian 16 bit integer.
This routine should be used when storing the host's representation of a 16 bit into memory as a little endian 16 bit integer.

References BSWP__store16().

BSWP__EXP_PROTO void BSWP__store16bx ( unsigned short int *  dst,
unsigned int  offset,
unsigned short int  val 
)

Stores the host representation of val into memory as a 16 bit big endian integer.

Parameters:
dst The address of the destination word
offset A byte offset to apply to dst.
val The big endian 16 bit integer to store
This routine should be used when storing the host's representation of a 16 bit integer into memory. If the value is already in a register, then use BSWP__swap16b(). If the offset is known to be a constant, it is marginally more efficient to use BSWP__store16b().

Warning:
Note that offset is a byte offset and not an index. This is in keeping with the spirit that this instruction maps directly to the underlying instruction of the PPC.

References BSWP__store16x().

BSWP__EXP_PROTO void BSWP__store16l ( unsigned short int *  dst,
unsigned short int  val 
)

Stores the host representation of val into memory as a 16 bit little endian integer.

Parameters:
dst The address of the destination word
val The 16 bit integer to store as a little endian 16 bit integer.
This routine should be used when storing the host's representation of a 16 bit integer into memory as a little endian 16 bit integer.

BSWP__EXP_PROTO void BSWP__store16lx ( unsigned short int *  dst,
unsigned int  offset,
unsigned short int  val 
)

Stores the host representation of val into memory as a 16 bit little endian integer.

Parameters:
dst The address of the destination word
offset A byte offset to apply to dst.
val The little endian 16 bitword to store
This routine should be used when storing the host's representation of a 16 bit integer into memory. If the value is already in a register, then use BSWP__swapl(). If the offset is known to be a constant, it is marginally more efficient to use BSWP__store16l().

Warning:
Note that offset is a byte offset and not an index. This is in keeping with the spirit that this instruction maps directly to the underlying instruction of the PPC.

BSWP__EXP_PROTO void BSWP__store16x ( unsigned short int *  dst,
unsigned int  offset,
unsigned short int  val 
)

Stores a byte swapped version of the 16 bit integer to memory.

Parameters:
dst The address of the destination word
offset A byte offset to apply to dst.
val The word to byte swap and store
This routine should be used when storing a 16 bit byte-swapped value into memory. If the value is already in a register, then use BSWP__swap16(). If the offset is known to be a constant, it is marginally more efficient to use BSWP__store16().

Warning:
Note that offset is a byte offset and not an index. This is in keeping with the spirit that this instruction maps directly to the underlying instruction of the PPC.

References BSWP__swap16().

Referenced by BSWP__store16bx().

BSWP__EXP_PROTO void BSWP__store32 ( unsigned int *  dst,
unsigned int  val 
)

Stores a byte swapped version of the 32 bit integer to memory.

Parameters:
dst The address of the destination word
val The word to byte swap and store
This routine should be used when storing a 32 bit byte-swapped value into memory. If the value is already in a register, then use BSWP__swap32().

References BSWP__swap32().

Referenced by BSWP__store32b().

BSWP__EXP_PROTO void BSWP__store32b ( unsigned int *  dst,
unsigned int  val 
)

Stores the host representation of val into memory as a 32 bit big endian integer.

Parameters:
dst The address of the destination word
val The 32 bit integer to store as a big endian 32 bit integer.
This routine should be used when storing the host's representation of a 32 bit into memory as a little endian 16 bit integer.

References BSWP__store32().

BSWP__EXP_PROTO void BSWP__store32bx ( unsigned int *  dst,
unsigned int  offset,
unsigned int  val 
)

Stores the host representation of val into memory as a 32 bit big endian integer.

Parameters:
dst The address of the destination word
offset A byte offset to apply to dst.
val The big endian 32 bit integer to store
This routine should be used when storing the host's representation of a 32 bit integer into memory. If the value is already in a register, then use BSWP__swap32b(). If the offset is known to be a constant, it is marginally more efficient to use BSWP__store32b().

Warning:
Note that offset is a byte offset and not an index. This is in keeping with the spirit that this instruction maps directly to the underlying instruction of the PPC.

References BSWP__store32x().

BSWP__EXP_PROTO void BSWP__store32l ( unsigned int *  dst,
unsigned int  val 
)

Stores the host representation of val into memory as a 32 bit little endian integer.

Parameters:
dst The address of the destination word
val The 32 bit integer to store as a little endian 32 bit integer.
This routine should be used when storing the host's representation of a 3s bit integer into memory as a little endian 16 bit integer.

BSWP__EXP_PROTO void BSWP__store32lx ( unsigned int *  dst,
unsigned int  offset,
unsigned int  val 
)

Stores the host representation of val into memory as a 32 bit little endian integer.

Parameters:
dst The address of the destination word
offset A byte offset to apply to dst.
val The little endian 32 bitword to store
This routine should be used when storing the host's representation of a 32 bit integer into memory. If the value is already in a register, then use BSWP__swapl(). If the offset is known to be a constant, it is marginally more efficient to use BSWP__store32l().

Warning:
Note that offset is a byte offset and not an index. This is in keeping with the spirit that this instruction maps directly to the underlying instruction of the PPC.

BSWP__EXP_PROTO void BSWP__store32x ( unsigned int *  dst,
unsigned int  offset,
unsigned int  val 
)

Stores a byte swapped version of the 32 bit integer to memory after a byte offset has been applied.

Parameters:
dst The address of the destination word
offset The byte offset to be applied
val The word to byte swap and store
This routine should be used when storing a 32 bit byte-swapped value into memory. If the value is already in a register, then use BSWP__swap32(). If the offset is known to be a constant, it is marginally more efficient to use BSWP_store32().

Warning:
Note that offset is a byte offset and not an index. This is in keeping with the spirit that this instruction maps directly to the underlying instruction of the PPC.

References BSWP__swap32().

Referenced by BSWP__store32bx().

BSWP__EXP_PROTO void BSWP__store64 ( unsigned long long int *  dst,
unsigned long long int  val 
)

Stores a byte swapped version of the 64 bit integer to memory.

Parameters:
dst The address of the destination word
val The word to byte swap and store
This routine should be used when storing a 64 bit byte-swapped value into memory.

Referenced by BSWP__store64b().

BSWP__EXP_PROTO void BSWP__store64b ( unsigned long long int *  dst,
unsigned long long int  val 
)

Stores the host representation of val into memory as a 64 bit big endian integer.

Parameters:
dst The address of the destination word
val The 64 bit integer to store as a big endian 64 bit integer.
This routine should be used when storing the host's representation of a 64 bit into memory as a little endian 64 bit integer.

References BSWP__store64().

BSWP__EXP_PROTO void BSWP__store64bx ( unsigned long long int *  dst,
unsigned int  offset,
unsigned long long int  val 
)

Stores the host representation of val into memory as a 64 bit big endian integer.

Parameters:
dst The address of the destination word
offset A byte offset to apply to dst.
val The big endian 64 bit integer to store
This routine should be used when storing the host's representation of a 64 bit integer into memory. If the value is already in a register, then use BSWP__swap64b(). If the offset is known to be a constant, it is marginally more efficient to use BSWP__store64b().

Warning:
Note that offset is a byte offset and not an index. This is in keeping with the spirit that this instruction maps directly to the underlying instruction of the PPC.

References BSWP__store64x().

BSWP__EXP_PROTO void BSWP__store64l ( unsigned long long int *  dst,
unsigned long long int  val 
)

Stores the host representation of val into memory as a 64 bit little endian integer.

Parameters:
dst The address of the destination word
val The 64 bit integer to store as a little endian 64 bit integer.
This routine should be used when storing the host's representation of a 64 bit integer into memory as a little endian 64 bit integer.

BSWP__EXP_PROTO void BSWP__store64lx ( unsigned long long int *  dst,
unsigned int  offset,
unsigned long long int  val 
)

Stores the host representation of val into memory as a 64 bit little endian integer.

Parameters:
dst The address of the destination word
offset A byte offset to apply to dst.
val The little endian 64 bitword to store
This routine should be used when storing the host's representation of a 64 bit integer into memory. If the value is already in a register, then use BSWP__swapl(). If the offset is known to be a constant, it is marginally more efficient to use BSWP__store64l().

Warning:
Note that offset is a byte offset and not an index. This is in keeping with the spirit that this instruction maps directly to the underlying instruction of the PPC.

BSWP__EXP_PROTO void BSWP__store64x ( unsigned long long int *  dst,
unsigned int  offset,
unsigned long long int  val 
)

Stores a byte swapped version of the 64 bit integer to memory.

Parameters:
dst The address of the destination word
offset A byte offset to apply to dst.
val The word to byte swap and store
This routine should be used when storing a 64 bit byte-swapped value into memory. If the value is already in a register, then use BSWP__swap64(). If the offset is known to be a constant, it is marginally more efficient to use BSWP_store64().

Warning:
Note that offset is a byte offset and not an index. This is in keeping with the spirit that this instruction maps directly to an underlying pair of PPC instructions.

References BSWP__swap64().

Referenced by BSWP__store64bx().

BSWP__EXP_PROTO unsigned int BSWP__swap16 ( unsigned short int  val  ) 

Byte swaps a 16 bit word.

Parameters:
val The 16 bit word to swap
Returns:
The byte-swapped value of the 16 bit integer
This routine should be used when byte-swapping 16 bit quantities that are already in registers. The routines BSWP__load16() and BSWP__store16 should by used when loading or storing 16 bit quantities from/into memory.

Referenced by BSWP__load16(), BSWP__load16x(), BSWP__store16(), BSWP__store16x(), BSWP__swap16_lclXbig(), and BSWP__swap16b().

BSWP__EXP_PROTO unsigned int BSWP__swap16_lclXbig ( unsigned short int  val  ) 

Byte swaps a 16 bit word; local representation <=> big.

Parameters:
val The 16 bit word transform from/to the local representation to/from big endian representation
Returns:
The appropriately byte-swapped value of the 16 bit integer
This routine is used to swap a source word in the local target machine representation's into a big endian representation. Due to the symmetrical nature of the translation, it also works the other way, i.e. swapping a source word in a big endian representation into the local target machine's representation.

If the local target machine representation is big endian, then this routine is a NOOP.

Warning:
This routine is being deprecated. The new name is BSWP__swap16b().

References BSWP__swap16().

BSWP__EXP_PROTO unsigned int BSWP__swap16_lclXlittle ( unsigned short int  val  ) 

Byte swaps a 32 bit word; local representation <=> little.

Parameters:
val The 16 bit word transform from/to the local representation to/from little endian representation
Returns:
The appropriately byte-swapped value of the 16 bit integer
This routine is used to swap a source word in the local target machine representation's into a little endian representation. Due to the symmetrical nature of the translation, it also works the other way, i.e. swapping a source word in a little endian representation into the local target machine's representation.

If the local target machine representation is little endian, then this routine is a NOOP.

Warning:
This routine is being deprecated. The new name is BSWP__swap16l().

BSWP__EXP_PROTO unsigned int BSWP__swap16b ( unsigned short int  val  ) 

Ensures that the big endian input 16 bit word val is transformed to the host representation.

Parameters:
val The big endian 16 bit value
Returns:
The host representation of the big endian val
This routine returns the host representation of known big endian 16 bit value, already in a register. The routines BSWP__load16b(), BSWP__store16b() or BSWP__store16xb() should by used when loading or storing known big endian 16 bit quantities from/into memory.

References BSWP__swap16().

BSWP__EXP_PROTO unsigned int BSWP__swap16l ( unsigned short int  val  ) 

Ensures that the little endian input 16 bit word val is transformed to the host representation.

Parameters:
val The little endian 16 bit value
Returns:
The host representation of the little endian val
This routine returns the host representation of known little endian 16 bit value, already in a register. The routines BSWP__load16l(), BSWP__store16l() or BSWP__store16xl() should by used when loading or storing known little endian 16 bit quantities from/into memory.

BSWP__EXP_PROTO unsigned int BSWP__swap32 ( unsigned int  val  ) 

Byte swaps a 32 bit word.

Parameters:
val The 32 bit word to swap
Returns:
The byte-swapped value of the 32 bit integer
This routine should be used when byte-swapping 32 bit quantities that are already in registers. The routines BSWP__load32() and BSWP__store32 should by used when loading or storing 32 bit quantities from/into memory.

Referenced by BSWP__load32(), BSWP__load32x(), BSWP__store32(), BSWP__store32x(), BSWP__swap32_lclXlittle(), and BSWP__swap32b().

BSWP__EXP_PROTO unsigned int BSWP__swap32_lclXbig ( unsigned int  val  ) 

Byte swaps a 32 bit word; local representation <=> big.

Parameters:
val The 32 bit word transform from/to the local representation to/from big endian representation
Returns:
The appropriately byte-swapped value of the 32 bit integer
This routine is used to swap a source word in the local target machine representation's into a big endian representation. Due to the symmetrical nature of the translation, it also works the other way, i.e. swapping a source word in a big endian representation into the local target machine's representation.

If the local target machine representation is big endian, then this routine is a NOOP.

Warning:
This routine is being deprecated. The new name is BSWP__swap32b().

BSWP__EXP_PROTO unsigned int BSWP__swap32_lclXlittle ( unsigned int  val  ) 

Byte swaps a 32 bit word; local representation <=> little.

Parameters:
val The 32 bit word transform from/to the local representation to/from little endian representation
Returns:
The appropriately byte-swapped value of the 32 bit integer
This routine is used to swap a source word in the local target machine representation's into a little endian representation. Due to the symmetrical nature of the translation, it also works the other way, i.e. swapping a source word in a little endian representation into the local target machine's representation.

If the local target machine representation is little endian, then this routine is a NOOP.

Warning:
This routine is being deprecated. The new name is BSWP__swap32l().

References BSWP__swap32().

BSWP__EXP_PROTO unsigned int BSWP__swap32b ( unsigned int  val  ) 

Ensures that the big endian input 16 bit word val is transformed to the host representation.

Parameters:
val The big endian 32 bit value
Returns:
The host representation of the big endian val
This routine returns the host representation of known big endian 32 bit value, already in a register. The routines BSWP__load32b(), BSWP__store32b() or BSWP__store32xb() should by used when loading or storing known big endian 32 bit quantities from/into memory.

References BSWP__swap32().

BSWP__EXP_PROTO unsigned int BSWP__swap32l ( unsigned int  val  ) 

Ensures that the little endian input 32 bit word val is transformed to the host representation.

Parameters:
val The little endian 32 bit value
Returns:
The host representation of the little endian val
This routine returns the host representation of known little endian 32 bit value, already in a register. The routines BSWP__load32l(), BSWP__store32l() or BSWP__store32xl() should by used when loading or storing known little endian 32 bit quantities from/into memory.

BSWP__EXP_PROTO unsigned long long int BSWP__swap64 ( unsigned long long int  val  ) 

Byte swaps a 64 bit word.

Parameters:
val The 64 bit word to swap
Returns:
The byte-swapped value of the 64 bit integer
This routine should be used when byte-swapping 64 bit quantities that are already in registers. The routines BSWP__load64() and BSWP__store64 should by used when loading or storing 64 bit quantities from/into memory.

Referenced by BSWP__store64x(), BSWP__swap64_lclXlittle(), and BSWP__swap64b().

BSWP__EXP_PROTO unsigned long long int BSWP__swap64_lclXbig ( unsigned long long int  val  ) 

Byte swaps a 64 bit word; local representation <=> big.

Parameters:
val The 64 bit word transform from/to the local representation to/from big endian representation
Returns:
The appropriately byte-swapped value of the 64 bit integer
This routine is used to swap a source word in the local target machine representation's into a big endian representation. Due to the symmetrical nature of the translation, it also works the other way, i.e. swapping a source word in a big endian representation into the local target machine's representation.

If the local target machine representation is big endian, then this routine is a NOOP.

BSWP__EXP_PROTO unsigned long long int BSWP__swap64_lclXlittle ( unsigned long long int  val  ) 

Byte swaps a 32 bit word; local representation <=> little.

Parameters:
val The 64 bit word transform from/to the local representation to/from little endian representation
Returns:
The appropriately byte-swapped value of the 64 bit integer
This routine is used to swap a source word in the local target machine representation's into a little endian representation. Due to the symmetrical nature of the translation, it also works the other way, i.e. swapping a source word in a little endian representation into the local target machine's representation.

If the local target machine representation is little endian, then this routine is a NOOP.

References BSWP__swap64().

BSWP__EXP_PROTO unsigned long long int BSWP__swap64b ( unsigned long long int  val  ) 

Ensures that the big endian input 64 bit word val is transformed to the host representation.

Parameters:
val The big endian 64 bit value
Returns:
The host representation of the big endian val
This routine returns the host representation of known big endian 64 bit value, already in a register. The routines BSWP__load64b(), BSWP__store64b() or BSWP__store64xb() should by used when loading or storing known big endian 64 bit quantities from/into memory.

References BSWP__swap64().

BSWP__EXP_PROTO unsigned long long int BSWP__swap64l ( unsigned long long int  val  ) 

Ensures that the little endian input 64 bit word val is transformed to the host representation.

Parameters:
val The little endian 64 bit value
Returns:
The host representation of the little endian val
This routine returns the host representation of known little endian 64 bit value, already in a register. The routines BSWP__load64l(), BSWP__store64l() or BSWP__store64xl() should by used when loading or storing known little endian 64 bit quantities from/into memory.


Generated on Wed Nov 21 21:23:51 2012 by  doxygen 1.5.8