Path: blob/main/contrib/llvm-project/compiler-rt/lib/builtins/arm/bswapsi2.S
35291 views
//===------- bswapsi2 - Implement bswapsi2 --------------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#include "../assembly.h"910.syntax unified11.text12DEFINE_CODE_STATE1314//15// extern uint32_t __bswapsi2(uint32_t);16//17// Reverse all the bytes in a 32-bit integer.18//19.p2align 220DEFINE_COMPILERRT_FUNCTION(__bswapsi2)21#if __ARM_ARCH < 622// before armv6 does not have "rev" instruction23eor r1, r0, r0, ror #1624bic r1, r1, #0xff000025mov r1, r1, lsr #826eor r0, r1, r0, ror #827#else28rev r0, r029#endif30JMP(lr)31END_COMPILERRT_FUNCTION(__bswapsi2)3233NO_EXEC_STACK_DIRECTIVE34353637