diff options
author | Vincent Chen <vincentc@andestech.com> | 2019-05-20 09:21:12 +0800 |
---|---|---|
committer | Greentime Hu <greentime@andestech.com> | 2019-05-31 15:23:26 +0800 |
commit | ed32949e0acb73e7bc054bb02e0453d4d561ceda (patch) | |
tree | f582241cdd3450e01fe6d1cf508a3e3a8211c675 /arch/nds32/include/uapi/asm/fp_udfiex_crtl.h | |
parent | 8183db10db6377ac58ad048a4c827425a614695c (diff) | |
download | linux-stable-ed32949e0acb73e7bc054bb02e0453d4d561ceda.tar.gz linux-stable-ed32949e0acb73e7bc054bb02e0453d4d561ceda.tar.bz2 linux-stable-ed32949e0acb73e7bc054bb02e0453d4d561ceda.zip |
nds32: Avoid IEX status being incorrectly modified
In order for kernel to capture each denormalized output, the UDF
trapping enable bit is always raised in $fpcsr. Because underflow case will
issue not an underflow exception but also an inexact exception, it causes
that the IEX, IEX cumulative exception, flag in $fpcsr to be raised in each
denormalized output handling. To make the emulation transparent to the
user, the emulator needs to clear the IEX flag in $fpcsr if the result is a
denormalized number. However, if the IEX flag has been raised before this
floating point emulation, this cleanup may be incorrect. To avoid the IEX
flags in $fpcsr be raised in each denormalized output handling, the IEX
trap shall be always enabled.
Signed-off-by: Vincent Chen <vincentc@andestech.com>
Acked-by: Greentime Hu <greentime@andestech.com>
Signed-off-by: Greentime Hu <greentime@andestech.com>
Diffstat (limited to 'arch/nds32/include/uapi/asm/fp_udfiex_crtl.h')
-rw-r--r-- | arch/nds32/include/uapi/asm/fp_udfiex_crtl.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/nds32/include/uapi/asm/fp_udfiex_crtl.h b/arch/nds32/include/uapi/asm/fp_udfiex_crtl.h new file mode 100644 index 000000000000..d54a5d6c6538 --- /dev/null +++ b/arch/nds32/include/uapi/asm/fp_udfiex_crtl.h @@ -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 */ |