From 7acb77a6e7bddd4c4c5aa975bbf976927c013798 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Tue, 17 Jun 1997 13:20:30 +0000 Subject: Merge with 2.1.43. --- include/asm-alpha/fpu.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'include/asm-alpha/fpu.h') 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 */ -- cgit v1.2.3