forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'nds32-for-linux-5.2-rc3' of git://git.kernel.org/pub/scm/l…
…inux/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
- Loading branch information
Showing
26 changed files
with
464 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 */ | ||
/* Copyright (C) 2005-2019 Andes Technology Corporation */ | ||
#ifndef _FP_UDF_IEX_CRTL_H | ||
#define _FP_UDF_IEX_CRTL_H | ||
|
||
/* | ||
* The cmd list of sys_fp_udfiex_crtl() | ||
*/ | ||
/* Disable UDF or IEX trap based on the content of parameter act */ | ||
#define DISABLE_UDF_IEX_TRAP 0 | ||
/* Enable UDF or IEX trap based on the content of parameter act */ | ||
#define ENABLE_UDF_IEX_TRAP 1 | ||
/* Get current status of UDF and IEX trap */ | ||
#define GET_UDF_IEX_TRAP 2 | ||
|
||
#endif /* _FP_UDF_IEX_CRTL_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// 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 fd2si(void *ft, void *fa) | ||
{ | ||
int r; | ||
|
||
FP_DECL_D(A); | ||
FP_DECL_EX; | ||
|
||
FP_UNPACK_DP(A, fa); | ||
|
||
if (A_c == FP_CLS_INF) { | ||
*(int *)ft = (A_s == 0) ? 0x7fffffff : 0x80000000; | ||
__FPU_FPCSR |= FP_EX_INVALID; | ||
} else if (A_c == FP_CLS_NAN) { | ||
*(int *)ft = 0xffffffff; | ||
__FPU_FPCSR |= FP_EX_INVALID; | ||
} else { | ||
FP_TO_INT_ROUND_D(r, A, 32, 1); | ||
__FPU_FPCSR |= FP_CUR_EXCEPTIONS; | ||
*(int *)ft = r; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// 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 fd2si_z(void *ft, void *fa) | ||
{ | ||
int r; | ||
|
||
FP_DECL_D(A); | ||
FP_DECL_EX; | ||
|
||
FP_UNPACK_DP(A, fa); | ||
|
||
if (A_c == FP_CLS_INF) { | ||
*(int *)ft = (A_s == 0) ? 0x7fffffff : 0x80000000; | ||
__FPU_FPCSR |= FP_EX_INVALID; | ||
} else if (A_c == FP_CLS_NAN) { | ||
*(int *)ft = 0xffffffff; | ||
__FPU_FPCSR |= FP_EX_INVALID; | ||
} else { | ||
FP_TO_INT_D(r, A, 32, 1); | ||
__FPU_FPCSR |= FP_CUR_EXCEPTIONS; | ||
*(int *)ft = r; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// 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 fd2ui(void *ft, void *fa) | ||
{ | ||
unsigned int r; | ||
|
||
FP_DECL_D(A); | ||
FP_DECL_EX; | ||
|
||
FP_UNPACK_DP(A, fa); | ||
|
||
if (A_c == FP_CLS_INF) { | ||
*(unsigned int *)ft = (A_s == 0) ? 0xffffffff : 0x00000000; | ||
__FPU_FPCSR |= FP_EX_INVALID; | ||
} else if (A_c == FP_CLS_NAN) { | ||
*(unsigned int *)ft = 0xffffffff; | ||
__FPU_FPCSR |= FP_EX_INVALID; | ||
} else { | ||
FP_TO_INT_ROUND_D(r, A, 32, 0); | ||
__FPU_FPCSR |= FP_CUR_EXCEPTIONS; | ||
*(unsigned int *)ft = r; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// 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 fd2ui_z(void *ft, void *fa) | ||
{ | ||
unsigned int r; | ||
|
||
FP_DECL_D(A); | ||
FP_DECL_EX; | ||
|
||
FP_UNPACK_DP(A, fa); | ||
|
||
if (A_c == FP_CLS_INF) { | ||
*(unsigned int *)ft = (A_s == 0) ? 0xffffffff : 0x00000000; | ||
__FPU_FPCSR |= FP_EX_INVALID; | ||
} else if (A_c == FP_CLS_NAN) { | ||
*(unsigned int *)ft = 0xffffffff; | ||
__FPU_FPCSR |= FP_EX_INVALID; | ||
} else { | ||
FP_TO_INT_D(r, A, 32, 0); | ||
__FPU_FPCSR |= FP_CUR_EXCEPTIONS; | ||
*(unsigned int *)ft = r; | ||
} | ||
|
||
} |
Oops, something went wrong.