Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
float_regs_sparc.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020 Cobham Gaisler AB
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef _FLOAT_REGS_SPARC_H
8#define _FLOAT_REGS_SPARC_H
9
10#include <toolchain.h>
11#include "float_context.h"
12
13static inline void _load_all_float_registers(struct fp_register_set *regs)
14{
15 __asm__ volatile (
16 "ldd [%0 + 0x00], %%f0\n"
17 "ldd [%0 + 0x08], %%f2\n"
18 "ldd [%0 + 0x10], %%f4\n"
19 "ldd [%0 + 0x18], %%f6\n"
20 "ldd [%0 + 0x20], %%f8\n"
21 "ldd [%0 + 0x28], %%f10\n"
22 "ldd [%0 + 0x30], %%f12\n"
23 "ldd [%0 + 0x38], %%f14\n"
24 "ldd [%0 + 0x40], %%f16\n"
25 "ldd [%0 + 0x48], %%f18\n"
26 "ldd [%0 + 0x50], %%f20\n"
27 "ldd [%0 + 0x58], %%f22\n"
28 "ldd [%0 + 0x60], %%f24\n"
29 "ldd [%0 + 0x68], %%f26\n"
30 "ldd [%0 + 0x70], %%f28\n"
31 "ldd [%0 + 0x78], %%f30\n"
32 :
33 : "r" (&regs->fp_volatile)
34 );
35}
36
37static inline void _store_all_float_registers(struct fp_register_set *regs)
38{
39 __asm__ volatile (
40 "std %%f0, [%0 + 0x00]\n"
41 "std %%f2, [%0 + 0x08]\n"
42 "std %%f4, [%0 + 0x10]\n"
43 "std %%f6, [%0 + 0x18]\n"
44 "std %%f8, [%0 + 0x20]\n"
45 "std %%f10, [%0 + 0x28]\n"
46 "std %%f12, [%0 + 0x30]\n"
47 "std %%f14, [%0 + 0x38]\n"
48 "std %%f16, [%0 + 0x40]\n"
49 "std %%f18, [%0 + 0x48]\n"
50 "std %%f20, [%0 + 0x50]\n"
51 "std %%f22, [%0 + 0x58]\n"
52 "std %%f24, [%0 + 0x60]\n"
53 "std %%f26, [%0 + 0x68]\n"
54 "std %%f28, [%0 + 0x70]\n"
55 "std %%f30, [%0 + 0x78]\n"
56 :
57 : "r" (&regs->fp_volatile)
58 : "memory"
59 );
60}
61
62static inline void _load_then_store_all_float_registers(struct fp_register_set
63 *regs)
64{
65 _load_all_float_registers(regs);
66 _store_all_float_registers(regs);
67}
68#endif /* _FLOAT_REGS_SPARC_H */
common definitions for the FPU sharing test application
Definition: float_context.h:164
struct fp_volatile_register_set fp_volatile
Definition: float_context.h:165
Macros to abstract toolchain specific capabilities.