blob: 70c13e6b9ceb17a570eb41f31e9ba9cf2b989915 [file] [log] [blame]
Nick Kledzike80e9782009-09-12 01:23:48 +00001//===------- 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 Dunbar19336a22009-10-27 17:49:50 +000010#include "../assembly.h"
Nick Kledzike80e9782009-09-12 01:23:48 +000011
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