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 10 #include "../assembly.h" 11 12 // 13 // extern uint64_t __bswapdi2(uint64_t); 14 // 15 // Reverse all the bytes in a 64-bit integer. 16 // 17 DEFINE_COMPILERRT_FUNCTION(__bswapdi2) 18 rev r2, r1 // reverse bytes in high 32-bits into temp2 19 rev r3, r0 // reverse bytes in low 32-bit into temp3 20 mov r0, r2 // set low 32-bits of result to temp2 21 mov r1, r3 // set high 32-bits of result to temp3 22 bx lr 23