-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #633 from tea/bswap
Implement __bswap[si]i2 intrinsics
- Loading branch information
Showing
5 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
intrinsics! { | ||
#[maybe_use_optimized_c_shim] | ||
#[avr_skip] | ||
/// Swaps bytes in 32-bit number | ||
pub extern "C" fn __bswapsi2(x: u32) -> u32 { | ||
x.swap_bytes() | ||
} | ||
|
||
#[maybe_use_optimized_c_shim] | ||
#[avr_skip] | ||
/// Swaps bytes in 64-bit number | ||
pub extern "C" fn __bswapdi2(x: u64) -> u64 { | ||
x.swap_bytes() | ||
} | ||
|
||
#[maybe_use_optimized_c_shim] | ||
#[avr_skip] | ||
/// Swaps bytes in 128-bit number | ||
pub extern "C" fn __bswapti2(x: u128) -> u128 { | ||
x.swap_bytes() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters