28.2.128 __builtin_swap_32

Architecture

dsPIC33A

Description

Swap bytes in a word. The outside bytes are swapped with each other and the inside bytes are swapped with each other.  That is:

  • bits 0-7 are swapped with bits 24-31
  • bits 8-15 are swapped with bits 16-23

Example:

uint32_t result,value;
 
value = 0x12345678;
result = __builtin_swap_32(value);

After swapping, result will contain 0x78563412.

Prototype

uint32_t __builtin_swap_32(uint32_t value);

Arguments

value - value to swap

Return Value

Returns the swapped value.

Machine Instruction

swap.l

Error Messages

None.