 |
Changeset 3209
- Timestamp:
- 02/16/08 21:21:49
(10 months ago)
- Author:
- kris
- Message:
closes #847
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r3175 |
r3209 |
|
| 22 | 22 | byte-swap approach avoids alignment issues, so is probably |
|---|
| 23 | 23 | faster overall than a traditional 'shift' implementation. |
|---|
| 24 | | |
|---|
| | 24 | --- |
|---|
| 25 | 25 | ubyte[] x = [0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08]; |
|---|
| 26 | 26 | |
|---|
| 27 | | swap16 (x.ptr, 8) -> 02 01 04 03 06 05 08 07 |
|---|
| 28 | | swap32 (x.ptr, 8) -> 04 03 02 01 08 07 06 05 |
|---|
| 29 | | swap64 (x.ptr, 8) -> 08 07 06 05 04 03 02 01 |
|---|
| | 27 | swap16 (x) => 02 01 04 03 06 05 08 07 |
|---|
| | 28 | swap32 (x) => 04 03 02 01 08 07 06 05 |
|---|
| | 29 | swap64 (x) => 08 07 06 05 04 03 02 01 |
|---|
| | 30 | --- |
|---|
| 30 | 31 | |
|---|
| 31 | 32 | *******************************************************************************/ |
|---|
| … | … | |
| 35 | 36 | /*********************************************************************** |
|---|
| 36 | 37 | |
|---|
| 37 | | Reverses two-byte sequences. Parameter bytes specifies the |
|---|
| | 38 | Reverses two-byte sequences. Parameter dst imples the |
|---|
| 38 | 39 | number of bytes, which should be a multiple of 2 |
|---|
| 39 | 40 | |
|---|
| … | … | |
| 47 | 48 | /*********************************************************************** |
|---|
| 48 | 49 | |
|---|
| 49 | | Reverses four-byte sequences. Parameter bytes specifies the |
|---|
| | 50 | Reverses four-byte sequences. Parameter dst implies the |
|---|
| 50 | 51 | number of bytes, which should be a multiple of 4 |
|---|
| 51 | 52 | |
|---|
| … | … | |
| 59 | 60 | /*********************************************************************** |
|---|
| 60 | 61 | |
|---|
| 61 | | Reverse eight-byte sequences. Parameter bytes specifies the |
|---|
| | 62 | Reverse eight-byte sequences. Parameter dst implies the |
|---|
| 62 | 63 | number of bytes, which should be a multiple of 8 |
|---|
| 63 | 64 | |
|---|
| … | … | |
| 71 | 72 | /*********************************************************************** |
|---|
| 72 | 73 | |
|---|
| 73 | | Reverse ten-byte sequences. Parameter bytes specifies the |
|---|
| | 74 | Reverse ten-byte sequences. Parameter dst implies the |
|---|
| 74 | 75 | number of bytes, which should be a multiple of 10 |
|---|
| 75 | 76 | |
|---|
Download in other formats:
|
 |
 |
|
 |
Copyright © 2006-2008 Tango. All Rights Reserved. | Page Width:
Static or
Dynamic