Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
9f093c85
Commit
9f093c85
authored
May 07, 1999
by
sof
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[project @ 1999-05-07 15:42:49 by sof]
integer2Int# again: don't flip sign unless outside [minInt,maxInt]
parent
23dbc7c8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
ghc/includes/PrimOps.h
ghc/includes/PrimOps.h
+10
-3
No files found.
ghc/includes/PrimOps.h
View file @
9f093c85
/* -----------------------------------------------------------------------------
* $Id: PrimOps.h,v 1.2
7
1999/05/0
4 08:58:18
sof Exp $
* $Id: PrimOps.h,v 1.2
8
1999/05/0
7 15:42:49
sof Exp $
*
* (c) The GHC Team, 1998-1999
*
...
...
@@ -303,16 +303,23 @@ typedef union {
/* We can do integer2Int and cmpInteger inline, since they don't need
* to allocate any memory.
*
* integer2Int# is now modular.
*/
#define integer2Intzh(r, sa,da) \
{ MP_INT arg; \
\
\
arg._mp_size = (sa); \
arg._mp_alloc = ((StgArrWords *)da)->words; \
arg._mp_d = (unsigned long int *) (BYTE_ARR_CTS(da)); \
\
(r) = RET_PRIM_STGCALL1(I_,mpz_get_ui,&arg); \
(r) = \
( arg._mp_size == 0 ) ? \
0 : \
( arg._mp_size < 0 && arg._mp_d[0] > 0x80000000 ) ? \
-(I_)arg._mp_d[0] : \
(I_)arg._mp_d[0]; \
}
#define integer2Wordzh(r, sa,da) \
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment