Zephyr Project API 3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
float_regs_arc_gcc.h
Go to the documentation of this file.
1
6/*
7 * Copyright (c) 2019, Synopsys.
8 *
9 * SPDX-License-Identifier: Apache-2.0
10 */
11
12#ifndef _FLOAT_REGS_ARC_GCC_H
13#define _FLOAT_REGS_ARC_GCC_H
14
15#if !defined(__GNUC__) || !defined(CONFIG_ISA_ARCV2)
16#error __FILE__ goes only with ARC GCC
17#endif
18
19#include <zephyr/toolchain.h>
20#include "float_context.h"
21
38static inline void _load_all_float_registers(struct fp_register_set *regs)
39{
40#ifdef CONFIG_FP_FPU_DA
41 uint32_t temp = 0;
42
43 __asm__ volatile (
44 "ld.ab %1, [%0, 4];\n\t"
45 "sr %1, [%2];\n\t"
46 "ld.ab %1, [%0, 4];\n\t"
47 "sr %1, [%3];\n\t"
48 "ld.ab %1, [%0, 4];\n\t"
49 "sr %1, [%4];\n\t"
50 "ld.ab %1, [%0, 4];\n\t"
51 "sr %1, [%5];\n\t"
52 : : "r" (regs), "r" (temp),
53 "i"(_ARC_V2_FPU_DPFP1L), "i"(_ARC_V2_FPU_DPFP1H),
54 "i"(_ARC_V2_FPU_DPFP2L), "i"(_ARC_V2_FPU_DPFP2H)
55 : "memory"
56 );
57#endif
58}
59
71static inline void _store_all_float_registers(struct fp_register_set *regs)
72{
73#ifdef CONFIG_FP_FPU_DA
74 uint32_t temp = 0;
75
76 __asm__ volatile (
77 "lr %1, [%2];\n\t"
78 "st.ab %1, [%0, 4];\n\t"
79 "lr %1, [%3];\n\t"
80 "st.ab %1, [%0, 4];\n\t"
81 "lr %1, [%4];\n\t"
82 "st.ab %1, [%0, 4];\n\t"
83 "lr %1, [%5];\n\t"
84 "st.ab %1, [%0, 4];\n\t"
85 : : "r" (regs), "r" (temp),
86 "i"(_ARC_V2_FPU_DPFP1L), "i"(_ARC_V2_FPU_DPFP1H),
87 "i"(_ARC_V2_FPU_DPFP2L), "i"(_ARC_V2_FPU_DPFP2H)
88 );
89#endif
90}
91
105static inline void _load_then_store_all_float_registers(struct fp_register_set
106 *regs)
107{
108 _load_all_float_registers(regs);
109 _store_all_float_registers(regs);
110}
111#endif /* _FLOAT_REGS_ARC_GCC_H */
common definitions for the FPU sharing test application
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
Definition float_context.h:192
Macros to abstract toolchain specific capabilities.