1/*
2 * Copyright 2019, Adrien Destugues, pulkomandy@pulkomandy.tk
3 * Distributed under the terms of the MIT License.
4 */
5
6#include <asm_defs.h>
7
8.text
9
10// These function use the unused parameters slots on the stack (reserved for
11// arguments that are in fact passed in registers) for temporary storage.
12// %o0 is corrupt, but it is a scratch register so this should be fine.
13
14/* float __swap_float(float value)
15 */
16FUNCTION(__swap_float):
17	add %sp, 2175, %o0
18	st %d0, [%o0]
19	lda [%o0] 0x88, %d0
20	return
21FUNCTION_END(__swap_float)
22
23
24/* double __swap_double(double value)
25 */
26FUNCTION(__swap_double):
27	add %sp, 2175, %o0
28	std %d0, [%o0]
29	ldda [%o0] 0x88, %d0
30	return
31FUNCTION_END(__swap_double)
32
33