summaryrefslogtreecommitdiffstats
path: root/include/asm-alpha/fpu.h
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1997-06-17 13:20:30 +0000
committerRalf Baechle <ralf@linux-mips.org>1997-06-17 13:20:30 +0000
commit7acb77a6e7bddd4c4c5aa975bbf976927c013798 (patch)
tree4139829ec6edb85f73774bb95cdec376758bfc73 /include/asm-alpha/fpu.h
parent64d58d4c8cd6a89ee218301ec0dc0ebfec91a4db (diff)
Merge with 2.1.43.
Diffstat (limited to 'include/asm-alpha/fpu.h')
-rw-r--r--include/asm-alpha/fpu.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/asm-alpha/fpu.h b/include/asm-alpha/fpu.h
index f32b95f27..25148b14b 100644
--- a/include/asm-alpha/fpu.h
+++ b/include/asm-alpha/fpu.h
@@ -57,8 +57,28 @@
IEEE_STATUS_OVF | IEEE_STATUS_UNF | \
IEEE_STATUS_INE)
+#define IEEE_SW_MASK (IEEE_TRAP_ENABLE_MASK | IEEE_STATUS_MASK)
+
#define IEEE_STATUS_TO_EXCSUM_SHIFT 16
#define IEEE_INHERIT (1UL<<63) /* inherit on thread create? */
+/*
+ * Convert the spftware IEEE trap enable and status bits into the
+ * hardware fpcr format.
+ */
+
+static inline unsigned long
+ieee_swcr_to_fpcr(unsigned long sw)
+{
+ unsigned long fp;
+ fp = (sw & IEEE_STATUS_MASK) << 35;
+ fp |= sw & IEEE_STATUS_MASK ? FPCR_SUM : 0;
+ fp |= (~sw & (IEEE_TRAP_ENABLE_INV
+ | IEEE_TRAP_ENABLE_DZE
+ | IEEE_TRAP_ENABLE_OVF)) << 48;
+ fp |= (~sw & (IEEE_TRAP_ENABLE_UNF | IEEE_TRAP_ENABLE_INE)) << 57;
+ return fp;
+}
+
#endif /* __ASM_ALPHA_FPU_H */