2009-09-12 09:23:48 +08:00
|
|
|
//===------- bswapdi2 - Implement bswapdi2 ---------------------------------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2009-10-28 01:49:50 +08:00
|
|
|
#include "../assembly.h"
|
2009-09-12 09:23:48 +08:00
|
|
|
|
|
|
|
//
|
|
|
|
// extern uint64_t __bswapdi2(uint64_t);
|
|
|
|
//
|
|
|
|
// Reverse all the bytes in a 64-bit integer.
|
|
|
|
//
|
|
|
|
.globl ___bswapdi2
|
|
|
|
___bswapdi2:
|
|
|
|
rev r2, r1 // reverse bytes in high 32-bits into temp2
|
|
|
|
rev r3, r0 // reverse bytes in low 32-bit into temp3
|
|
|
|
mov r0, r2 // set low 32-bits of result to temp2
|
|
|
|
mov r1, r3 // set high 32-bits of result to temp3
|
|
|
|
bx lr
|