diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-02-06 13:08:37 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-02-11 05:10:04 -0500 |
commit | aba51b65863db5f2687f29d10ba24ffa49dabd3b (patch) | |
tree | dc82a63a7423f54d37917e72ffea8cbd03360bc7 /rts | |
parent | b75e7486de73868e6821a9f680e9e13794dff15c (diff) | |
download | haskell-aba51b65863db5f2687f29d10ba24ffa49dabd3b.tar.gz |
Add arithmetic exception primops (#14664)
Diffstat (limited to 'rts')
-rw-r--r-- | rts/Prelude.h | 3 | ||||
-rw-r--r-- | rts/PrimOps.cmm | 19 | ||||
-rw-r--r-- | rts/RtsSymbols.c | 3 | ||||
-rw-r--r-- | rts/package.conf.in | 6 | ||||
-rw-r--r-- | rts/win32/libHSbase.def | 3 |
5 files changed, 34 insertions, 0 deletions
diff --git a/rts/Prelude.h b/rts/Prelude.h index 6e5bf03bd6..7bcb6292fa 100644 --- a/rts/Prelude.h +++ b/rts/Prelude.h @@ -47,6 +47,9 @@ PRELUDE_CLOSURE(base_ControlziExceptionziBase_nonTermination_closure); PRELUDE_CLOSURE(base_ControlziExceptionziBase_nestedAtomically_closure); PRELUDE_CLOSURE(base_ControlziExceptionziBase_absentSumFieldError_closure); PRELUDE_CLOSURE(base_GHCziEventziThread_blockedOnBadFD_closure); +PRELUDE_CLOSURE(base_GHCziExceptionziType_divZZeroException_closure); +PRELUDE_CLOSURE(base_GHCziExceptionziType_underflowException_closure); +PRELUDE_CLOSURE(base_GHCziExceptionziType_overflowException_closure); PRELUDE_CLOSURE(base_GHCziConcziSync_runSparks_closure); PRELUDE_CLOSURE(base_GHCziConcziIO_ensureIOManagerIsRunning_closure); diff --git a/rts/PrimOps.cmm b/rts/PrimOps.cmm index 7f0b7d5d90..78a958d5ec 100644 --- a/rts/PrimOps.cmm +++ b/rts/PrimOps.cmm @@ -31,6 +31,9 @@ import pthread_mutex_unlock; #endif import CLOSURE base_ControlziExceptionziBase_nestedAtomically_closure; import CLOSURE base_GHCziIOziException_heapOverflow_closure; +import CLOSURE base_GHCziExceptionziType_divZZeroException_closure; +import CLOSURE base_GHCziExceptionziType_underflowException_closure; +import CLOSURE base_GHCziExceptionziType_overflowException_closure; import EnterCriticalSection; import LeaveCriticalSection; import CLOSURE ghczmprim_GHCziTypes_False_closure; @@ -2606,3 +2609,19 @@ stg_setThreadAllocationCounterzh ( I64 counter ) StgTSO_alloc_limit(CurrentTSO) = counter + TO_I64(offset); return (); } + + +stg_raiseDivZZerozh () +{ + jump stg_raisezh(base_GHCziExceptionziType_divZZeroException_closure); +} + +stg_raiseUnderflowzh () +{ + jump stg_raisezh(base_GHCziExceptionziType_underflowException_closure); +} + +stg_raiseOverflowzh () +{ + jump stg_raisezh(base_GHCziExceptionziType_overflowException_closure); +} diff --git a/rts/RtsSymbols.c b/rts/RtsSymbols.c index aef49606b3..c62810b4d3 100644 --- a/rts/RtsSymbols.c +++ b/rts/RtsSymbols.c @@ -728,6 +728,9 @@ SymI_HasProto(prog_argv) \ SymI_HasProto(stg_putMVarzh) \ SymI_HasProto(stg_raisezh) \ + SymI_HasProto(stg_raiseDivZZerozh) \ + SymI_HasProto(stg_raiseUnderflowzh) \ + SymI_HasProto(stg_raiseOverflowzh) \ SymI_HasProto(stg_raiseIOzh) \ SymI_HasProto(stg_readTVarzh) \ SymI_HasProto(stg_readTVarIOzh) \ diff --git a/rts/package.conf.in b/rts/package.conf.in index e4cb159cb8..c13e20119a 100644 --- a/rts/package.conf.in +++ b/rts/package.conf.in @@ -101,6 +101,9 @@ ld-options: , "-Wl,-u,_base_ControlziExceptionziBase_nonTermination_closure" , "-Wl,-u,_base_ControlziExceptionziBase_nestedAtomically_closure" , "-Wl,-u,_base_GHCziEventziThread_blockedOnBadFD_closure" + , "-Wl,-u,_base_GHCziExceptionziType_divZZeroException_closure" + , "-Wl,-u,_base_GHCziExceptionziType_underflowException_closure" + , "-Wl,-u,_base_GHCziExceptionziType_overflowException_closure" , "-Wl,-u,_base_GHCziConcziSync_runSparks_closure" , "-Wl,-u,_base_GHCziConcziIO_ensureIOManagerIsRunning_closure" , "-Wl,-u,_base_GHCziConcziIO_ioManagerCapabilitiesChanged_closure" @@ -204,6 +207,9 @@ ld-options: , "-Wl,-u,base_ControlziExceptionziBase_nonTermination_closure" , "-Wl,-u,base_ControlziExceptionziBase_nestedAtomically_closure" , "-Wl,-u,base_GHCziEventziThread_blockedOnBadFD_closure" + , "-Wl,-u,base_GHCziExceptionziType_divZZeroException_closure" + , "-Wl,-u,base_GHCziExceptionziType_underflowException_closure" + , "-Wl,-u,base_GHCziExceptionziType_overflowException_closure" , "-Wl,-u,base_GHCziConcziSync_runSparks_closure" , "-Wl,-u,base_GHCziConcziIO_ensureIOManagerIsRunning_closure" , "-Wl,-u,base_GHCziConcziIO_ioManagerCapabilitiesChanged_closure" diff --git a/rts/win32/libHSbase.def b/rts/win32/libHSbase.def index d4ec1fab0a..0b674452a1 100644 --- a/rts/win32/libHSbase.def +++ b/rts/win32/libHSbase.def @@ -46,3 +46,6 @@ EXPORTS base_ControlziExceptionziBase_nonTermination_closure base_ControlziExceptionziBase_nestedAtomically_closure base_GHCziEventziThread_blockedOnBadFD_closure + base_GHCziExceptionziType_divZZeroException_closure + base_GHCziExceptionziType_underflowException_closure + base_GHCziExceptionziType_overflowException_closure |