Nick Kledzik | e80e978 | 2009-09-12 01:23:48 +0000 | [diff] [blame] | 1 | //===------- bswapdi2 - Implement bswapdi2 ---------------------------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
Daniel Dunbar | 19336a2 | 2009-10-27 17:49:50 +0000 | [diff] [blame^] | 10 | #include "../assembly.h" |
Nick Kledzik | e80e978 | 2009-09-12 01:23:48 +0000 | [diff] [blame] | 11 | |
| 12 | // |
| 13 | // extern uint64_t __bswapdi2(uint64_t); |
| 14 | // |
| 15 | // Reverse all the bytes in a 64-bit integer. |
| 16 | // |
| 17 | .globl ___bswapdi2 |
| 18 | ___bswapdi2: |
| 19 | rev r2, r1 // reverse bytes in high 32-bits into temp2 |
| 20 | rev r3, r0 // reverse bytes in low 32-bit into temp3 |
| 21 | mov r0, r2 // set low 32-bits of result to temp2 |
| 22 | mov r1, r3 // set high 32-bits of result to temp3 |
| 23 | bx lr |