diff options
Diffstat (limited to 'lib/Data')
-rw-r--r-- | lib/Data/Packed/Internal/Common.hs | 5 | ||||
-rw-r--r-- | lib/Data/Packed/Internal/auxi.c | 6 | ||||
-rw-r--r-- | lib/Data/Packed/Internal/auxi.h | 2 |
3 files changed, 13 insertions, 0 deletions
diff --git a/lib/Data/Packed/Internal/Common.hs b/lib/Data/Packed/Internal/Common.hs index 3609bc2..bce9922 100644 --- a/lib/Data/Packed/Internal/Common.hs +++ b/lib/Data/Packed/Internal/Common.hs | |||
@@ -80,9 +80,14 @@ errorCode 2006 = "the input matrix is not positive definite" | |||
80 | errorCode 2007 = "not yet supported in this OS" | 80 | errorCode 2007 = "not yet supported in this OS" |
81 | errorCode n = "code "++show n | 81 | errorCode n = "code "++show n |
82 | 82 | ||
83 | |||
84 | -- | clear the fpu | ||
85 | foreign import ccall "auxi.h asm_finit" finit :: IO () | ||
86 | |||
83 | -- | check the error code | 87 | -- | check the error code |
84 | check :: String -> IO CInt -> IO () | 88 | check :: String -> IO CInt -> IO () |
85 | check msg f = do | 89 | check msg f = do |
90 | finit | ||
86 | err <- f | 91 | err <- f |
87 | when (err/=0) $ if err > 1024 | 92 | when (err/=0) $ if err > 1024 |
88 | then (error (msg++": "++errorCode err)) -- our errors | 93 | then (error (msg++": "++errorCode err)) -- our errors |
diff --git a/lib/Data/Packed/Internal/auxi.c b/lib/Data/Packed/Internal/auxi.c index 04dc7ad..bbb8cd4 100644 --- a/lib/Data/Packed/Internal/auxi.c +++ b/lib/Data/Packed/Internal/auxi.c | |||
@@ -149,3 +149,9 @@ int conjugate(KCVEC(x),CVEC(t)) { | |||
149 | } | 149 | } |
150 | OK | 150 | OK |
151 | } | 151 | } |
152 | |||
153 | //--------------------------------------- | ||
154 | void asm_finit() { | ||
155 | asm("finit"); | ||
156 | } | ||
157 | //--------------------------------------- | ||
diff --git a/lib/Data/Packed/Internal/auxi.h b/lib/Data/Packed/Internal/auxi.h index 377a4a1..507a30d 100644 --- a/lib/Data/Packed/Internal/auxi.h +++ b/lib/Data/Packed/Internal/auxi.h | |||
@@ -26,3 +26,5 @@ const char * gsl_strerror (const int gsl_errno); | |||
26 | int matrix_fscanf(char*filename, RMAT(a)); | 26 | int matrix_fscanf(char*filename, RMAT(a)); |
27 | 27 | ||
28 | int conjugate(KCVEC(x),CVEC(t)); | 28 | int conjugate(KCVEC(x),CVEC(t)); |
29 | |||
30 | void asm_finit(); | ||