Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | #include <linux/types.h> |
| 3 | #include <linux/errno.h> |
Linus Torvalds | 7c0f6ba | 2016-12-24 11:46:01 -0800 | [diff] [blame] | 4 | #include <linux/uaccess.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 5 | |
Kumar Gala | d2b194e | 2008-06-04 02:59:29 -0500 | [diff] [blame] | 6 | #include <asm/sfp-machine.h> |
| 7 | #include <math-emu/soft-fp.h> |
| 8 | #include <math-emu/double.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9 | |
| 10 | int |
| 11 | fctiw(u32 *frD, void *frB) |
| 12 | { |
| 13 | FP_DECL_D(B); |
Kumar Gala | d2b194e | 2008-06-04 02:59:29 -0500 | [diff] [blame] | 14 | FP_DECL_EX; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 | unsigned int r; |
| 16 | |
Kumar Gala | d2b194e | 2008-06-04 02:59:29 -0500 | [diff] [blame] | 17 | FP_UNPACK_DP(B, frB); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 18 | FP_TO_INT_D(r, B, 32, 1); |
| 19 | frD[1] = r; |
| 20 | |
| 21 | #ifdef DEBUG |
Harvey Harrison | e48b1b4 | 2008-03-29 08:21:07 +1100 | [diff] [blame] | 22 | printk("%s: D %p, B %p: ", __func__, frD, frB); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 23 | dump_double(frD); |
| 24 | printk("\n"); |
| 25 | #endif |
| 26 | |
| 27 | return 0; |
| 28 | } |