From d00dc39a113702f9a12c9485113279d5d4bc6715 Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Wed, 8 Dec 2010 00:21:33 +0000 Subject: [PATCH] Simplify the byte reordering logic slightly. llvm-svn: 121216 --- lib/Target/ARM/ARMAsmBackend.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/Target/ARM/ARMAsmBackend.cpp b/lib/Target/ARM/ARMAsmBackend.cpp index 7c4823d8ba4..0bf6dd6e13d 100644 --- a/lib/Target/ARM/ARMAsmBackend.cpp +++ b/lib/Target/ARM/ARMAsmBackend.cpp @@ -131,10 +131,8 @@ static unsigned adjustFixupValue(unsigned Kind, uint64_t Value) { // Same addressing mode as fixup_arm_pcrel_10, but with the bytes reordered. if (Kind == ARM::fixup_t2_pcrel_10) { - uint64_t swapped = (Value & 0x00FF0000) >> 16; - swapped |= (Value & 0xFF000000) >> 16; - swapped |= (Value & 0x000000FF) << 16; - swapped |= (Value & 0x0000FF00) << 16; + uint64_t swapped = (Value & 0xFFFF0000) >> 16; + swapped |= (Value & 0x0000FFFF) << 16; return swapped; }