1/*
2 * Copyright 2021, Haiku, Inc. All rights reserved.
3 * Released under the terms of the MIT License
4 */
5
6
7#include <asm_defs.h>
8
9.text
10
11/* float __swap_float(float value) */
12FUNCTION(__swap_float):
13		fmov s0, w0	// Bitcopy float to general register
14		rev w0, w0	// GCC8.3 does this for __builtin_bswap32
15		fmov w0, s0	// and back
16		ret
17FUNCTION_END(__swap_float)
18
19
20/* double __swap_double(double value) */
21FUNCTION(__swap_double):
22		fmov d0, x0	// Bitcopy double to general register
23		rev x0, x0	// GCC8.3 does this for __builtin_bswap64
24		fmov x0, d0	// and back
25		ret
26FUNCTION_END(__swap_double)
27