summaryrefslogtreecommitdiff
path: root/ghc/lib/std/cbits/longlong.c
diff options
context:
space:
mode:
authorsimonmar <unknown>2002-02-12 15:17:36 +0000
committersimonmar <unknown>2002-02-12 15:17:36 +0000
commit2cc5b907318f97e19b28b2ad8ed9ff8c1f401dcc (patch)
tree2fefe09bc63464ac3a28ea37b61eefc5e506685a /ghc/lib/std/cbits/longlong.c
parent239e9471e104fd88ec93bf42623c3a68a496657a (diff)
downloadhaskell-2cc5b907318f97e19b28b2ad8ed9ff8c1f401dcc.tar.gz
[project @ 2002-02-12 15:17:13 by simonmar]
Switch over to the new hierarchical libraries --------------------------------------------- This commit reorganises our libraries to use the new hierarchical module namespace extension. The basic story is this: - fptools/libraries contains the new hierarchical libraries. Everything in here is "clean", i.e. most deprecated stuff has been removed. - fptools/libraries/base is the new base package (replacing "std") and contains roughly what was previously in std, lang, and concurrent, minus deprecated stuff. Things that are *not allowed* in libraries/base include: Addr, ForeignObj, ByteArray, MutableByteArray, _casm_, _ccall_, ``'', PrimIO For ByteArrays and MutableByteArrays we use UArray and STUArray/IOUArray respectively now. Modules previously called PrelFoo are now under fptools/libraries/GHC. eg. PrelBase is now GHC.Base. - fptools/libraries/haskell98 provides the Haskell 98 std. libraries (Char, IO, Numeric etc.) as a package. This package is enabled by default. - fptools/libraries/network is a rearranged version of the existing net package (the old package net is still available; see below). - Other packages will migrate to fptools/libraries in due course. NB. you need to checkout fptools/libraries as well as fptools/hslibs now. The nightly build scripts will need to be tweaked. - fptools/hslibs still contains (almost) the same stuff as before. Where libraries have moved into the new hierarchy, the hslibs version contains a "stub" that just re-exports the new version. The idea is that code will gradually migrate from fptools/hslibs into fptools/libraries as it gets cleaned up, and in a version or two we can remove the old packages altogether. - I've taken the opportunity to make some changes to the build system, ripping out the old hslibs Makefile stuff from mk/target.mk; the new package building Makefile code is in mk/package.mk (auto-included from mk/target.mk). The main improvement is that packages now register themselves at make boot time using ghc-pkg, and the monolithic package.conf in ghc/driver is gone. I've updated the standard packages but haven't tested win32, graphics, xlib, object-io, or OpenGL yet. The Makefiles in these packages may need some further tweaks, and they'll need pkg.conf.in files added. - Unfortunately all this rearrangement meant I had to bump the interface-file version and create a bunch of .hi-boot-6 files :-(
Diffstat (limited to 'ghc/lib/std/cbits/longlong.c')
-rw-r--r--ghc/lib/std/cbits/longlong.c126
1 files changed, 0 insertions, 126 deletions
diff --git a/ghc/lib/std/cbits/longlong.c b/ghc/lib/std/cbits/longlong.c
deleted file mode 100644
index a373786a1d..0000000000
--- a/ghc/lib/std/cbits/longlong.c
+++ /dev/null
@@ -1,126 +0,0 @@
-/* -----------------------------------------------------------------------------
- * $Id: longlong.c,v 1.5 2001/12/07 11:34:48 sewardj Exp $
- *
- * (c) The GHC Team, 1998-1999
- *
- * Primitive operations over (64-bit) long longs
- * (only used on 32-bit platforms.)
- *
- * ---------------------------------------------------------------------------*/
-
-
-/*
-Miscellaneous primitive operations on StgInt64 and StgWord64s.
-N.B. These are not primops!
-
-Instead of going the normal (boring) route of making the list
-of primitive operations even longer to cope with operations
-over 64-bit entities, we implement them instead 'out-of-line'.
-
-The primitive ops get their own routine (in C) that implements
-the operation, requiring the caller to _ccall_ out. This has
-performance implications of course, but we currently don't
-expect intensive use of either Int64 or Word64 types.
-
-The exceptions to the rule are primops that cast to and from
-64-bit entities (these are defined in PrimOps.h)
-*/
-
-#include "Rts.h"
-
-#ifdef SUPPORT_LONG_LONGS
-
-/* Relational operators */
-
-StgBool stg_gtWord64 (StgWord64 a, StgWord64 b) {return a > b;}
-StgBool stg_geWord64 (StgWord64 a, StgWord64 b) {return a >= b;}
-StgBool stg_eqWord64 (StgWord64 a, StgWord64 b) {return a == b;}
-StgBool stg_neWord64 (StgWord64 a, StgWord64 b) {return a != b;}
-StgBool stg_ltWord64 (StgWord64 a, StgWord64 b) {return a < b;}
-StgBool stg_leWord64 (StgWord64 a, StgWord64 b) {return a <= b;}
-
-StgBool stg_gtInt64 (StgInt64 a, StgInt64 b) {return a > b;}
-StgBool stg_geInt64 (StgInt64 a, StgInt64 b) {return a >= b;}
-StgBool stg_eqInt64 (StgInt64 a, StgInt64 b) {return a == b;}
-StgBool stg_neInt64 (StgInt64 a, StgInt64 b) {return a != b;}
-StgBool stg_ltInt64 (StgInt64 a, StgInt64 b) {return a < b;}
-StgBool stg_leInt64 (StgInt64 a, StgInt64 b) {return a <= b;}
-
-/* Arithmetic operators */
-
-StgWord64 stg_remWord64 (StgWord64 a, StgWord64 b) {return a % b;}
-StgWord64 stg_quotWord64 (StgWord64 a, StgWord64 b) {return a / b;}
-StgInt64 stg_remInt64 (StgInt64 a, StgInt64 b) {return a % b;}
-StgInt64 stg_quotInt64 (StgInt64 a, StgInt64 b) {return a / b;}
-StgInt64 stg_negateInt64 (StgInt64 a) {return -a;}
-StgInt64 stg_plusInt64 (StgInt64 a, StgInt64 b) {return a + b;}
-StgInt64 stg_minusInt64 (StgInt64 a, StgInt64 b) {return a - b;}
-StgInt64 stg_timesInt64 (StgInt64 a, StgInt64 b) {return a * b;}
-
-/* Logical operators: */
-
-StgWord64 stg_and64 (StgWord64 a, StgWord64 b) {return a & b;}
-StgWord64 stg_or64 (StgWord64 a, StgWord64 b) {return a | b;}
-StgWord64 stg_xor64 (StgWord64 a, StgWord64 b) {return a ^ b;}
-StgWord64 stg_not64 (StgWord64 a) {return ~a;}
-
-StgWord64 stg_uncheckedShiftL64 (StgWord64 a, StgInt b) {return a << b;}
-StgWord64 stg_uncheckedShiftRL64 (StgWord64 a, StgInt b) {return a >> b;}
-/* Right shifting of signed quantities is not portable in C, so
- the behaviour you'll get from using these primops depends
- on the whatever your C compiler is doing. ToDo: fix. -- sof 8/98
-*/
-StgInt64 stg_uncheckedIShiftL64 (StgInt64 a, StgInt b) {return a << b;}
-StgInt64 stg_uncheckedIShiftRA64 (StgInt64 a, StgInt b) {return a >> b;}
-StgInt64 stg_uncheckedIShiftRL64 (StgInt64 a, StgInt b)
- {return (StgInt64) ((StgWord64) a >> b);}
-
-/* Casting between longs and longer longs.
- (the primops that cast from long longs to Integers
- expressed as macros, since these may cause some heap allocation).
-*/
-
-StgInt64 stg_intToInt64 (StgInt i) {return (StgInt64) i;}
-StgInt stg_int64ToInt (StgInt64 i) {return (StgInt) i;}
-StgWord64 stg_int64ToWord64 (StgInt64 i) {return (StgWord64) i;}
-StgWord64 stg_wordToWord64 (StgWord w) {return (StgWord64) w;}
-StgWord stg_word64ToWord (StgWord64 w) {return (StgWord) w;}
-StgInt64 stg_word64ToInt64 (StgWord64 w) {return (StgInt64) w;}
-
-StgWord64 stg_integerToWord64 (I_ sa, StgByteArray /* Really: mp_limb_t* */ da)
-{
- mp_limb_t* d;
- I_ s;
- StgWord64 res;
- d = (mp_limb_t *)da;
- s = sa;
- switch (s) {
- case 0: res = 0; break;
- case 1: res = d[0]; break;
- case -1: res = -d[0]; break;
- default:
- res = d[0] + ((StgWord64) d[1] << (BITS_IN (mp_limb_t)));
- if (s < 0) res = -res;
- }
- return res;
-}
-
-StgInt64 stg_integerToInt64 (StgInt sa, StgByteArray /* Really: mp_limb_t* */ da)
-{
- mp_limb_t* d;
- I_ s;
- StgInt64 res;
- d = (mp_limb_t *)da;
- s = (sa);
- switch (s) {
- case 0: res = 0; break;
- case 1: res = d[0]; break;
- case -1: res = -d[0]; break;
- default:
- res = d[0] + ((StgWord64) d[1] << (BITS_IN (mp_limb_t)));
- if (s < 0) res = -res;
- }
- return res;
-}
-
-#endif /* SUPPORT_LONG_LONGS */