Go to the documentation of this file. 1 #ifndef __ASM_ALPHA_FPU_H
2 #define __ASM_ALPHA_FPU_H
5 #include <asm/special_insns.h>
11 #define FPCR_DNOD (1UL<<47)
12 #define FPCR_DNZ (1UL<<48)
13 #define FPCR_INVD (1UL<<49)
14 #define FPCR_DZED (1UL<<50)
15 #define FPCR_OVFD (1UL<<51)
16 #define FPCR_INV (1UL<<52)
17 #define FPCR_DZE (1UL<<53)
18 #define FPCR_OVF (1UL<<54)
19 #define FPCR_UNF (1UL<<55)
20 #define FPCR_INE (1UL<<56)
21 #define FPCR_IOV (1UL<<57)
22 #define FPCR_UNDZ (1UL<<60)
23 #define FPCR_UNFD (1UL<<61)
24 #define FPCR_INED (1UL<<62)
25 #define FPCR_SUM (1UL<<63)
27 #define FPCR_DYN_SHIFT 58
28 #define FPCR_DYN_CHOPPED (0x0UL << FPCR_DYN_SHIFT)
29 #define FPCR_DYN_MINUS (0x1UL << FPCR_DYN_SHIFT)
30 #define FPCR_DYN_NORMAL (0x2UL << FPCR_DYN_SHIFT)
31 #define FPCR_DYN_PLUS (0x3UL << FPCR_DYN_SHIFT)
32 #define FPCR_DYN_MASK (0x3UL << FPCR_DYN_SHIFT)
34 #define FPCR_MASK 0xffff800000000000L
46 #define IEEE_TRAP_ENABLE_INV (1UL<<1)
47 #define IEEE_TRAP_ENABLE_DZE (1UL<<2)
48 #define IEEE_TRAP_ENABLE_OVF (1UL<<3)
49 #define IEEE_TRAP_ENABLE_UNF (1UL<<4)
50 #define IEEE_TRAP_ENABLE_INE (1UL<<5)
51 #define IEEE_TRAP_ENABLE_DNO (1UL<<6)
52 #define IEEE_TRAP_ENABLE_MASK (IEEE_TRAP_ENABLE_INV | IEEE_TRAP_ENABLE_DZE |\
53 IEEE_TRAP_ENABLE_OVF | IEEE_TRAP_ENABLE_UNF |\
54 IEEE_TRAP_ENABLE_INE | IEEE_TRAP_ENABLE_DNO)
57 #define IEEE_MAP_DMZ (1UL<<12)
58 #define IEEE_MAP_UMZ (1UL<<13)
60 #define IEEE_MAP_MASK (IEEE_MAP_DMZ | IEEE_MAP_UMZ)
63 #define IEEE_STATUS_INV (1UL<<17)
64 #define IEEE_STATUS_DZE (1UL<<18)
65 #define IEEE_STATUS_OVF (1UL<<19)
66 #define IEEE_STATUS_UNF (1UL<<20)
67 #define IEEE_STATUS_INE (1UL<<21)
68 #define IEEE_STATUS_DNO (1UL<<22)
70 #define IEEE_STATUS_MASK (IEEE_STATUS_INV | IEEE_STATUS_DZE | \
71 IEEE_STATUS_OVF | IEEE_STATUS_UNF | \
72 IEEE_STATUS_INE | IEEE_STATUS_DNO)
74 #define IEEE_SW_MASK (IEEE_TRAP_ENABLE_MASK | \
75 IEEE_STATUS_MASK | IEEE_MAP_MASK)
77 #define IEEE_CURRENT_RM_SHIFT 32
78 #define IEEE_CURRENT_RM_MASK (3UL<<IEEE_CURRENT_RM_SHIFT)
80 #define IEEE_STATUS_TO_EXCSUM_SHIFT 16
82 #define IEEE_INHERIT (1UL<<63)
94 static inline unsigned long
95 ieee_swcr_to_fpcr(
unsigned long sw)
110 static inline unsigned long
111 ieee_fpcr_to_swcr(
unsigned long fp)
132 static inline unsigned long
137 #if defined(CONFIG_ALPHA_EV6) || defined(CONFIG_ALPHA_EV67)
143 :
"=r"(tmp),
"=r"(ret));
150 :
"=m"(tmp),
"=m"(ret));
157 wrfpcr(
unsigned long val)
161 #if defined(CONFIG_ALPHA_EV6) || defined(CONFIG_ALPHA_EV67)
167 :
"=&r"(tmp) :
"r"(val));
174 :
"=m"(tmp) :
"m"(val));
178 static inline unsigned long
179 swcr_update_status(
unsigned long swcr,
unsigned long fpcr)