summaryrefslogtreecommitdiff
path: root/arch/nds32/math-emu/fsi2d.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-06-03 20:23:41 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2019-06-03 20:23:41 +0300
commit30d1d92a888d03681b927c76a35181b4eed7071f (patch)
tree8a1d452bd9c13d9edaa8f86ff9355f663ea9ec55 /arch/nds32/math-emu/fsi2d.c
parent01e7a841b4346836f19b40677e1fef4657cc0d0d (diff)
parent932296120543149e3397af252e7daee7af37eb05 (diff)
downloadlinux-30d1d92a888d03681b927c76a35181b4eed7071f.tar.xz
Merge tag 'nds32-for-linux-5.2-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/greentime/linux
Pull nds32 fixes from Greentime Hu: - fix warning for math-emu - fix nds32 fpu exception handling - fix nds32 fpu emulation implementation * tag 'nds32-for-linux-5.2-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/greentime/linux: nds32: add new emulations for floating point instruction nds32: Avoid IEX status being incorrectly modified math-emu: Use statement expressions to fix Wshift-count-overflow warning
Diffstat (limited to 'arch/nds32/math-emu/fsi2d.c')
-rw-r--r--arch/nds32/math-emu/fsi2d.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/nds32/math-emu/fsi2d.c b/arch/nds32/math-emu/fsi2d.c
new file mode 100644
index 000000000000..6b04cec0c5c5
--- /dev/null
+++ b/arch/nds32/math-emu/fsi2d.c
@@ -0,0 +1,22 @@
+// SPDX-License-Identifier: GPL-2.0
+// Copyright (C) 2005-2019 Andes Technology Corporation
+#include <linux/uaccess.h>
+
+#include <asm/sfp-machine.h>
+#include <math-emu/soft-fp.h>
+#include <math-emu/double.h>
+
+void fsi2d(void *ft, void *fa)
+{
+ int a = *(int *)fa;
+
+ FP_DECL_D(R);
+ FP_DECL_EX;
+
+ FP_FROM_INT_D(R, a, 32, int);
+
+ FP_PACK_DP(ft, R);
+
+ __FPU_FPCSR |= FP_CUR_EXCEPTIONS;
+
+}