blob: 45f1edbda3570c61bc33c220a9af71392800ce62 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001// SPDX-License-Identifier: GPL-2.0
Linus Torvalds1da177e2005-04-16 15:20:36 -07002#include <linux/types.h>
3#include <linux/errno.h>
Linus Torvalds7c0f6ba2016-12-24 11:46:01 -08004#include <linux/uaccess.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07005
Kumar Galad2b194e2008-06-04 02:59:29 -05006#include <asm/sfp-machine.h>
7#include <math-emu/soft-fp.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07008
9int
10mtfsfi(unsigned int crfD, unsigned int IMM)
11{
12 u32 mask = 0xf;
13
14 if (!crfD)
15 mask = 9;
16
17 __FPU_FPSCR &= ~(mask << ((7 - crfD) << 2));
18 __FPU_FPSCR |= (IMM & 0xf) << ((7 - crfD) << 2);
19
20#ifdef DEBUG
Harvey Harrisone48b1b42008-03-29 08:21:07 +110021 printk("%s: %d %x: %08lx\n", __func__, crfD, IMM, __FPU_FPSCR);
Linus Torvalds1da177e2005-04-16 15:20:36 -070022#endif
23
24 return 0;
25}