brintos

brintos / llvm-project-archived public Read only

0
0
Text · 856 B · 07cc3d8 Raw
36 lines · plain
1//===------- bswapsi2 - Implement bswapsi2 --------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9#include "../assembly.h"10 11	.syntax unified12	.text13	DEFINE_CODE_STATE14 15//16// extern uint32_t __bswapsi2(uint32_t);17//18// Reverse all the bytes in a 32-bit integer.19//20	.p2align 221DEFINE_COMPILERRT_FUNCTION(__bswapsi2)22#if __ARM_ARCH < 623    // before armv6 does not have "rev" instruction24 	eor	r1, r0, r0, ror #1625 	bic	r1, r1, #0xff000026 	mov	r1, r1, lsr #827 	eor	r0, r1, r0, ror #828#else29    rev r0, r030#endif31    JMP(lr)32END_COMPILERRT_FUNCTION(__bswapsi2)33 34NO_EXEC_STACK_DIRECTIVE35 36