Zephyr Project API 3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
float_regs_arm_gcc.h
Go to the documentation of this file.
1
6/*
7 * Copyright (c) 2016, Wind River Systems, Inc.
8 *
9 * SPDX-License-Identifier: Apache-2.0
10 */
11
12#ifndef _FLOAT_REGS_ARM_GCC_H
13#define _FLOAT_REGS_ARM_GCC_H
14
15#include <zephyr/toolchain.h>
16#include "float_context.h"
17
18#if defined(CONFIG_VFP_FEATURE_REGS_S64_D32)
19
20static inline void _load_all_float_registers(struct fp_register_set *regs)
21{
22 __asm__ volatile (
23 "vldmia %0, {d0-d15};\n\t"
24 "vldmia %1, {d16-d31};\n\t"
25 : : "r" (&regs->fp_volatile), "r" (&regs->fp_non_volatile)
26 );
27}
28
29static inline void _store_all_float_registers(struct fp_register_set *regs)
30{
31 __asm__ volatile (
32 "vstmia %0, {d0-d15};\n\t"
33 "vstmia %1, {d16-d31};\n\t"
34 : : "r" (&regs->fp_volatile), "r" (&regs->fp_non_volatile)
35 : "memory"
36 );
37}
38
39static inline void _load_then_store_all_float_registers(struct fp_register_set *regs)
40{
41 _load_all_float_registers(regs);
42 _store_all_float_registers(regs);
43}
44
45#else
46
64static inline void _load_all_float_registers(struct fp_register_set *regs)
65{
66 __asm__ volatile (
67 "vldmia %0, {s0-s15};\n\t"
68 "vldmia %1, {s16-s31};\n\t"
69 : : "r" (&regs->fp_volatile), "r" (&regs->fp_non_volatile)
70 );
71}
72
84static inline void _store_all_float_registers(struct fp_register_set *regs)
85{
86 __asm__ volatile (
87 "vstmia %0, {s0-s15};\n\t"
88 "vstmia %1, {s16-s31};\n\t"
89 : : "r" (&regs->fp_volatile), "r" (&regs->fp_non_volatile)
90 : "memory"
91 );
92}
93
107static inline void _load_then_store_all_float_registers(struct fp_register_set
108 *regs)
109{
110 _load_all_float_registers(regs);
111 _store_all_float_registers(regs);
112}
113
114#endif
115
116#endif /* _FLOAT_REGS_ARM_GCC_H */
common definitions for the FPU sharing test application
Definition float_context.h:192
struct fp_non_volatile_register_set fp_non_volatile
Definition float_context.h:194
struct fp_volatile_register_set fp_volatile
Definition float_context.h:193
Macros to abstract toolchain specific capabilities.