Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
5d5e1e1e
Commit
5d5e1e1e
authored
Mar 02, 1999
by
sof
Browse files
[project @ 1999-03-02 19:50:47 by sof]
StgNat64 --> StgWord64
parent
73319599
Changes
1
Hide whitespace changes
Inline
Side-by-side
ghc/rts/StgLongLong.c
View file @
5d5e1e1e
/* -----------------------------------------------------------------------------
* $Id: StgLongLong.c,v 1.
3
1999/0
2
/0
5
1
6:02:58 simonm
Exp $
* $Id: StgLongLong.c,v 1.
4
1999/0
3
/0
2
1
9:50:47 sof
Exp $
*
* (c) The GHC Team, 1998-1999
*
...
...
@@ -10,7 +10,7 @@
/*
Miscellaneous primitive operations on StgInt64 and Stg
Nat
64s.
Miscellaneous primitive operations on StgInt64 and Stg
Word
64s.
Instead of going the normal (boring) route of making the list
of primitive operations even longer to cope with operations
...
...
@@ -32,27 +32,27 @@ reason why.
#ifdef SUPPORT_LONG_LONGS
StgInt
stg_gtWord64
(
Stg
Nat
64
l1
,
Stg
Nat
64
l2
)
stg_gtWord64
(
Stg
Word
64
l1
,
Stg
Word
64
l2
)
{
return
(
l1
>
l2
);
}
StgInt
stg_geWord64
(
Stg
Nat
64
l1
,
Stg
Nat
64
l2
)
stg_geWord64
(
Stg
Word
64
l1
,
Stg
Word
64
l2
)
{
return
(
l1
>=
l2
);
}
StgInt
stg_eqWord64
(
Stg
Nat
64
l1
,
Stg
Nat
64
l2
)
stg_eqWord64
(
Stg
Word
64
l1
,
Stg
Word
64
l2
)
{
return
(
l1
==
l2
);
}
StgInt
stg_neWord64
(
Stg
Nat
64
l1
,
Stg
Nat
64
l2
)
stg_neWord64
(
Stg
Word
64
l1
,
Stg
Word
64
l2
)
{
return
(
l1
!=
l2
);
}
StgInt
stg_ltWord64
(
Stg
Nat
64
l1
,
Stg
Nat
64
l2
)
stg_ltWord64
(
Stg
Word
64
l1
,
Stg
Word
64
l2
)
{
return
(
l1
<
l2
);
}
StgInt
stg_leWord64
(
Stg
Nat
64
l1
,
Stg
Nat
64
l2
)
stg_leWord64
(
Stg
Word
64
l1
,
Stg
Word
64
l2
)
{
return
(
l1
<=
l2
);
}
/* ------------------ */
...
...
@@ -83,12 +83,12 @@ stg_leInt64(StgInt64 l1, StgInt64 l2)
/* Arithmetic operators */
Stg
Nat
64
stg_remWord64
(
Stg
Nat
64
a
,
Stg
Nat
64
b
)
Stg
Word
64
stg_remWord64
(
Stg
Word
64
a
,
Stg
Word
64
b
)
{
return
(
a
%
b
);
}
Stg
Nat
64
stg_quotWord64
(
Stg
Nat
64
a
,
Stg
Nat
64
b
)
Stg
Word
64
stg_quotWord64
(
Stg
Word
64
a
,
Stg
Word
64
b
)
{
return
(
a
/
b
);
}
StgInt64
...
...
@@ -117,28 +117,28 @@ stg_timesInt64(StgInt64 a, StgInt64 b)
/* Logical operators: */
Stg
Nat
64
stg_and64
(
Stg
Nat
64
a
,
Stg
Nat
64
b
)
Stg
Word
64
stg_and64
(
Stg
Word
64
a
,
Stg
Word
64
b
)
{
return
(
a
&
b
);
}
Stg
Nat
64
stg_or64
(
Stg
Nat
64
a
,
Stg
Nat
64
b
)
Stg
Word
64
stg_or64
(
Stg
Word
64
a
,
Stg
Word
64
b
)
{
return
(
a
|
b
);
}
Stg
Nat
64
stg_xor64
(
Stg
Nat
64
a
,
Stg
Nat
64
b
)
Stg
Word
64
stg_xor64
(
Stg
Word
64
a
,
Stg
Word
64
b
)
{
return
(
a
^
b
);
}
Stg
Nat
64
stg_not64
(
Stg
Nat
64
a
)
Stg
Word
64
stg_not64
(
Stg
Word
64
a
)
{
return
(
~
a
);
}
Stg
Nat
64
stg_shiftL64
(
Stg
Nat
64
a
,
StgInt
b
)
Stg
Word
64
stg_shiftL64
(
Stg
Word
64
a
,
StgInt
b
)
{
return
(
a
<<
b
);
}
Stg
Nat
64
stg_shiftRL64
(
Stg
Nat
64
a
,
StgInt
b
)
Stg
Word
64
stg_shiftRL64
(
Stg
Word
64
a
,
StgInt
b
)
{
return
(
a
>>
b
);
}
StgInt64
...
...
@@ -172,20 +172,20 @@ StgInt
stg_int64ToInt
(
StgInt64
i
)
{
return
(
(
StgInt
)
i
);
}
Stg
Nat
64
Stg
Word
64
stg_int64ToWord64
(
StgInt64
i
)
{
return
(
(
Stg
Nat
64
)
i
);
}
{
return
(
(
Stg
Word
64
)
i
);
}
Stg
Nat
64
Stg
Word
64
stg_wordToWord64
(
StgWord
w
)
{
return
(
(
Stg
Nat
64
)
w
);
}
{
return
(
(
Stg
Word
64
)
w
);
}
StgWord
stg_word64ToWord
(
Stg
Nat
64
w
)
stg_word64ToWord
(
Stg
Word
64
w
)
{
return
(
(
StgWord
)
w
);
}
StgInt64
stg_word64ToInt64
(
Stg
Nat
64
w
)
stg_word64ToInt64
(
Stg
Word
64
w
)
{
return
(
(
StgInt64
)
w
);
}
#endif
/* SUPPORT_LONG_LONGS */
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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