1. 29 Jan, 2002 3 commits
  2. 21 Dec, 2001 1 commit
  3. 20 Dec, 2001 1 commit
    • sewardj's avatar
      [project @ 2001-12-20 15:20:37 by sewardj] · 0cc54eac
      sewardj authored
      Generate floating-point comparisons on x86 which deal with NaNs in what
      I assume is an IEEE854 compliant fashion.  For
         == >= > <= <
      if either arg is a NaN, produce False, and for
         /=
      if either arg is a NaN, produce True.
      
      This is the behaviour that gcc has, by default.
      
      Requires some ultramagical x86 code frags to be emitted.  A big comment
      in PprMach explains how it works.
      0cc54eac
  4. 18 Dec, 2001 1 commit
  5. 17 Dec, 2001 1 commit
    • sewardj's avatar
      [project @ 2001-12-17 18:03:08 by sewardj] · 9b3d7ebd
      sewardj authored
      Redo translation of array indexing primops in order to insert 8 <-> 32
      bit casts when dealing with Char arrays.  Also facilitate future removal
      of CMem and MO_{Read,Write}OSBI.
      
      In the process, notice and fix a large bogon in x86/sparc implementation
      of signed and unsigned integer widening.
      9b3d7ebd
  6. 14 Dec, 2001 2 commits
    • sewardj's avatar
      [project @ 2001-12-14 16:57:36 by sewardj] · 5a387d82
      sewardj authored
      Sparc NCG changes to track recent mulIntC# changes.  The Prelude
      can now finally be compiled with the sparc NCG.
      
      Also (incidentally) emit sparc integer multiply insns directly
      rather than calling a helper routine.  Most sparcs should implement
      them by now :)
      5a387d82
    • sewardj's avatar
      [project @ 2001-12-14 15:26:14 by sewardj] · 7dee9e10
      sewardj authored
      Get rid of multiple-result MachOps (MO_NatS_AddC, MO_NatS_SubC,
      MO_NatS_MulC) which implement {add,sub,mul}IntC#.  Supporting gunk
      in the NCG disappears as a result.
      
      Instead:
      
      * {add,sub}IntC# are translated out during abstract C simplification,
        turning into the xor-xor-invert-and-shift sequence previously defined
        in PrimOps.h.
      
      * mulIntC# is more difficult to get rid of portably.  Instead we have
        a new single-result PrimOp, mulIntMayOflo, with corresponding MachOp
        MO_NatS_MulMayOflo.  This tells you whether a W x W -> W signed
        multiply might overflow, where W is the word size.  When W=32, is
        implemented by computing a 2W-long result.  When W=64, we use the
        previous approximation.
      
      PrelNum.lhs' implementation of timesInteger changes slightly, to use
      the new PrimOp.
      7dee9e10
  7. 12 Dec, 2001 1 commit
    • sewardj's avatar
      [project @ 2001-12-12 18:12:45 by sewardj] · 0b447a84
      sewardj authored
      Make the sparc native code generator work again after recent
      primop hackery.
      
      * Track the change from PrimOp to MachOp at the Stix level.
      
      * Teach the sparc insn selector how to generate 64-bit code.
      
      * Fix various bogons in sparc {Int,Double,Float} <-> {Int,Double,Float}
        conversions which only happened to generate correct code by
        accident, so far.
      
      * Synthesise BaseReg from &MainCapability.r on archs which do not
        have BaseReg in a regiser (eg sparc :)
      
      At the moment {add,sub,mul}Int# are not implemented.  To be fixed.
      0b447a84
  8. 10 Dec, 2001 1 commit
    • sewardj's avatar
      [project @ 2001-12-10 18:04:51 by sewardj] · 0d1a15fd
      sewardj authored
      Add just enough infrastructure to the NCG that it can deal with simple 64-bit
      code on 32-bit platforms.  Main changes are:
      
      * Addition of a simple 64-bit instruction selection fn iselExpr64 to MachCode.
        This generates code for a 64-bit value and places the results into two
        virtual registers, related thusly:
      
      * Add a new type VRegUnique, which is used to label Stix virtual registers.
        This type used to be a plain Unique, but that forces the assumption that
        each Abstract-C level C temporary corresponds to exactly one Stix virtual
        register, which is untrue when the C temporary is 64-bit sized on a
        32-bit machine.  In the new scheme, the Unique for the C temporary can
        turn into two related VRegUniques, related by having the same embedded
        unique.
      
      * Made a start on 'target metrics' by adding ncg_target_is_32bits to the
        end of Stix.lhs.
      
      * Cleaned up numerous other gruesomenesses in the NCG which never came
        to light before now.   Got rid of MachMisc.sizeOf, which doesn't make
        sense in a 64-bit setting, and replaced it by calls to
        PrimRep.getPrimRepArrayElemSize, which, as far as I'm concerned, is the
        definitive answer to the questio `How Big Is This PrimRep Really?'
      
      Result: on x86-linux, at least, you can now compile the Entire Prelude
      with -fasm!  At this stage I cannot claim that the resulting code is
      correct, but it's a start.
      0d1a15fd
  9. 06 Dec, 2001 1 commit
  10. 05 Dec, 2001 1 commit
    • sewardj's avatar
      [project @ 2001-12-05 17:35:12 by sewardj] · d11e681f
      sewardj authored
      --------------------------------------------
              Translate out PrimOps at the AbstractC level
              --------------------------------------------
      
      This is the first in what might be a series of changes intended
      to make GHC less dependent on its C back end.  The main change is
      to translate PrimOps into vanilla abstract C inside the compiler,
      rather than having to duplicate that work in each code generation
      route.  The main changes are:
      
      * A new type, MachOp, in compiler/absCSyn/MachOp.hs.  A MachOp
        is a primitive operation which we can reasonably expect the
        native code generators to implement.  The set is quite small
        and unlikely to change much, if at all.
      
      * Translations from PrimOps to MachOps, at the end of
        absCSyn/AbsCUtils.  This should perhaps be moved to a different
        module, but it is hard to see how to do this without creating
        a circular dep between it and AbsCUtils.
      
      * The x86 insn selector has been updated to track these changes.  The
        sparc insn selector remains to be done.
      
      As a result of this, it is possible to compile much more code via the
      NCG than before.  Almost all the Prelude can be compiled with it.
      Currently it does not know how to do 64-bit code generation.  Once
      this is fixed, the entire Prelude should be compilable that way.
      
      I also took the opportunity to clean up the NCG infrastructure.
      The old Stix data type has been split into StixStmt (statements)
      and StixExpr (now denoting values only).  This removes a class
      of impossible constructions and clarifies the NCG.
      
      Still to do, in no particular order:
      
      * String and literal lifting, currently done in the NCG at the top
        of nativeGen/MachCode, should be done in the AbstractC flattener,
        for the benefit of all targets.
      
      * Further cleaning up of Stix assignments.
      
      * Remove word-size dependency from Abstract C.  (should be easy).
      
      * Translate out MagicIds in the AbsC -> Stix translation, not
        in the Stix constant folder. (!)
      
      Testsuite failures caused by this:
      
      * memo001 - fails (segfaults) for some unknown reason now.
      * arith003 - wrong answer in gcdInt boundary cases.
      * arith011 - wrong answer for shifts >= word size.
      * cg044 - wrong answer for some FP boundary cases.
      
      These should be fixed, but I don't think they are mission-critical for
      anyone.
      d11e681f
  11. 08 Nov, 2001 1 commit
    • simonmar's avatar
      [project @ 2001-11-08 12:56:00 by simonmar] · 6ae381cd
      simonmar authored
      Updates to the native code generator following the changes to fix the
      large block allocation bug, and changes to use the new
      function-address cache in the register table to reduce code size.
      
      Also: I changed the pretty-printing machinery for assembly code to use
      Pretty rather than Outputable, since we don't make use of the styles
      and it should improve performance.  Perhaps the same should be done
      for abstract C.
      6ae381cd
  12. 26 Oct, 2001 1 commit
    • sewardj's avatar
      [project @ 2001-10-26 11:53:34 by sewardj] · 9551c28b
      sewardj authored
      merge from stable, revs:
      
        1.74.4.1  +12 -11    fptools/ghc/compiler/nativeGen/MachCode.lhs
        1.30.4.1  +23 -0     fptools/ghc/compiler/nativeGen/Stix.lhs
        1.70.4.1  +2 -5      fptools/ghc/compiler/nativeGen/StixPrim.lhs
      
        Route all NCG panics to do with missing primop implementations and any
        other panic which could be caused by compiling legitimate sources
        through the function Stix.ncgPrimopMoan.  This emits a helpful message
        explaining what has happened, advises the use of -fvia-C as a
        workaround, and says please mail us.
      9551c28b
  13. 23 Oct, 2001 1 commit
    • sof's avatar
      [project @ 2001-10-23 22:25:46 by sof] · 1181f398
      sof authored
      Deleted HsVersions.h #defines that were now past their use-by-dates; in
      particular, make the assumption that a post-Haskell 1.4 compiler is now
      used to compile ghc/compiler/
      
      Hanging on to those FastString #defines is probably not worth it any longer,
      either, but I punted on making that (much bigger) change.
      1181f398
  14. 22 Oct, 2001 1 commit
    • simonmar's avatar
      [project @ 2001-10-22 09:05:26 by simonmar] · b01bb1ca
      simonmar authored
      import CLabe (isAsmTemp) for sparc/alpha (I guess someone removed the
      import after a warning from -fwarn-unused-imports, so I've put the
      import inside the relevant #ifdef this time).
      b01bb1ca
  15. 26 Sep, 2001 1 commit
    • simonpj's avatar
      [project @ 2001-09-26 15:11:50 by simonpj] · 5cd3527d
      simonpj authored
      -------------------------------
      	Code generation and SRT hygiene
      	-------------------------------
      
      This is a big tidy up commit.  I don't think it breaks anything,
      but it certainly makes the code clearer (to me).
      
      I'm not certain that you can use it without sucking in my other
      big commit... they come from the same tree.
      
      
      Core-to-STG, live variables and Static Reference Tables (SRTs)
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      I did a big tidy-up of the live-variable computation in CoreToStg.
      The key idea is that the live variables consist of two parts:
      	dynamic live vars
      	static live vars (CAFs)
      
      These two always travel round together, but they were always
      treated separately by the code until now. Now it's a new data type:
      
      type LiveInfo = (StgLiveVars, 	-- Dynamic live variables;
      				-- i.e. ones with a nested (non-top-level) binding
      		 CafSet)	-- Static live variables;
      				-- i.e. top-level variables that are CAFs or refer to them
      
      There's lots of documentation in CoreToStg.
      
      Code generation
      ~~~~~~~~~~~~~~~
      Arising from this, I found that SRT labels were stored in
      a LambdaFormInfo during code generation, whereas they *ought*
      to be in the ClosureInfo (which in turn contains a LambdaFormInfo).
      
      This led to lots of changes in ClosureInfo, and I took the opportunity
      to make it into a labelled record.
      
      Similarly, I made the data type in AbstractC a bit more explicit:
      
        -- C_SRT is what StgSyn.SRT gets translated to...
        -- we add a label for the table, and expect only the 'offset/length' form
      
      data C_SRT = NoC_SRT
      	   | C_SRT CLabel !Int{-offset-} !Int{-length-}
      
      (Previously there were bottoms lying around.)
      5cd3527d
  16. 17 Aug, 2001 1 commit
    • apt's avatar
      [project @ 2001-08-17 17:18:51 by apt] · 1dfaee31
      apt authored
      How I spent my summer vacation.
      
      Primops
      -------
      
      The format of the primops.txt.pp file has been enhanced to allow
      (latex-style) primop descriptions to be included.  There is a new flag
      to genprimopcode that generates documentation including these
      descriptions. A first cut at descriptions of the more interesting
      primops has been made, and the file has been reordered a bit.
      
      31-bit words
      ------------
      
      The front end now can cope with the possibility of 31-bit (or even 30-bit)
      Int# and Word# types.  The only current use of this is to generate
      external .core files that can be translated into OCAML source files
      (OCAML uses a one-bit tag to distinguish integers from pointers).
      The only way to get this right now is by hand-defining the preprocessor
      symbol WORD_SIZE_IN_BITS, which is normally set automatically from
      the familiar WORD_SIZE_IN_BYTES.
      
      Just in case 31-bit words are used, we now have Int32# and Word32# primitive types
      and an associated family of operators, paralleling the existing 64-bit
      stuff.  Of course, none of the operators actually need to be implemented
      in the absence of a 31-bit backend.
      There has also been some minor re-jigging of the 32 vs. 64 bit stuff.
      See the description at the top of primops.txt.pp file for more details.
      Note that, for the first time, the *type* of a primop can now depend
      on the target word size.
      
      Also, the family of primops intToInt8#, intToInt16#, etc.
      have been renamed narrow8Int#, narrow16Int#, etc., to emphasize
      that they work on Int#'s and don't actually convert between types.
      
      Addresses
      ---------
      
      As another part of coping with the possibility of 31-bit ints,
      the addr2Int# and int2Addr# primops are now thoroughly deprecated
      (and not even defined in the 31-bit case) and all uses
      of them have been removed except from the (deprecated) module
      hslibs/lang/Addr
      
      Addr# should now be treated as a proper abstract type, and has these suitable operators:
      
      nullAddr# : Int# -> Addr# (ignores its argument; nullary primops cause problems at various places)
      plusAddr# :  Addr# -> Int# -> Addr#
      minusAddr : Addr# -> Addr# -> Int#
      remAddr# : Addr# -> Int# -> Int#
      
      Obviously, these don't allow completely arbitrary offsets if 31-bit ints are
      in use, but they should do for all practical purposes.
      
      It is also still possible to generate an address constant, and there is a built-in rule
      that makes use of this to remove the nullAddr# calls.
      
      Misc
      ----
      There is a new compile flag -fno-code that causes GHC to quit after generating .hi files
      and .core files (if requested) but before generating STG.
      
      Z-encoded names for tuples have been rationalized; e.g.,
      Z3H now means an unboxed 3-tuple, rather than an unboxed
      tuple with 3 commas (i.e., a 4-tuple)!
      
      Removed misc. litlits in hslibs/lang
      
      Misc. small changes to external core format.  The external core description
      has also been substantially updated, and incorporates the automatically-generated
      primop documentation; its in the repository at /papers/ext-core/core.tex.
      
      A little make-system addition to allow passing CPP options to compiler and
      library builds.
      1dfaee31
  17. 26 Jun, 2001 1 commit
  18. 22 May, 2001 2 commits
    • qrczak's avatar
      [project @ 2001-05-22 16:45:41 by qrczak] · e6ba1800
      qrczak authored
      Fix small callconv-related import mismatches etc.
      e6ba1800
    • simonpj's avatar
      [project @ 2001-05-22 13:43:14 by simonpj] · f16228e4
      simonpj authored
      -------------------------------------------
      	Towards generalising 'foreign' declarations
      	-------------------------------------------
      
      This is a first step towards generalising 'foreign' declarations to
      handle langauges other than C.  Quite a lot of files are touched,
      but nothing has really changed.  Everything should work exactly as
      before.
      
      	But please be on your guard for ccall-related bugs.
      
      Main things
      
      Basic data types: ForeignCall.lhs
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      * Remove absCSyn/CallConv.lhs
      
      * Add prelude/ForeignCall.lhs.  This defines the ForeignCall
        type and its variants
      
      * Define ForeignCall.Safety to say whether a call is unsafe
        or not (was just a boolean).  Lots of consequential chuffing.
      
      * Remove all CCall stuff from PrimOp, and put it in ForeignCall
      
      
      Take CCallOp out of the PrimOp type (where it was always a glitch)
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      * Add IdInfo.FCallId variant to the type IdInfo.GlobalIdDetails,
      	along with predicates Id.isFCallId, Id.isFCallId_maybe
      
      * Add StgSyn.StgOp, to sum PrimOp with FCallOp, because it
        *is* useful to sum them together in Stg and AbsC land.  If
        nothing else, it minimises changes.
      
      
      Also generally rename "CCall" stuff to "FCall" where it's generic
      to all foreign calls.
      f16228e4
  19. 27 Apr, 2001 1 commit
    • sewardj's avatar
      [project @ 2001-04-27 15:39:18 by sewardj] · 276ff6e8
      sewardj authored
      merge rev 1.69.2.1, which was:
      Remove x86-specific implementation of {intToInt,wordToWord}{8,16,32}#
      primops, and replace them with platform-independent versions expressed
      purely in Stix terms.
      276ff6e8
  20. 28 Feb, 2001 1 commit
    • qrczak's avatar
      [project @ 2001-02-28 00:01:01 by qrczak] · 871db587
      qrczak authored
      * Add {intToInt,wordToWord}{8,16,32}# primops. WARNING: Not implemented
        in ncg for Alpha and Sparc. But -O -fasm is not going to go far anyway
        because of other omissions.
      
      * Have full repertoire of 8,16,32-bit signed and unsigned MachMisc.Size
        values. Again only x86 is fully supported. They are used for
        {index,read,write}{Int,Word}{8,16,32}{OffAddr,Array}# and
        {intToInt,wordToWord}{8,16,32}# primops.
      
      * Have full repertoire of
        {index,read,write}\
        {Char,WideChar,Int,Word,Addr,Float,Double,StablePtr,\
         {Int,Word}{8,16,32,64}}\
        {OffAddr,Array} primops and appropriate instances.
        There were various omissions in various places.
      
      * Add {plus,minus,times}Word# primops to avoid so many Word# <-> Int#
        coercions.
      
      * Rewrite modules PrelWord and PrelInt almost from scratch.
      
      * Simplify fromInteger and realToFrac rules. For each of
        {Int,Word}{8,16,32} there is just a pair of fromInteger rules
        replacing the source or target type with Int or Word. For
        {Int,Word,Int64,Word64} there are rules from any to any.
        Don't include rules which are derivable from inlining anyway,
        e.g. those mentioning Integer. Old explicit coercions are simply
        defined as appropriately typed fromInteger.
      
      * Various old coercion functions marked as deprecated.
      
      * Add instance Bits Int, and
        instance {Show,Num,Real,Enum,Integral,Bounded,Ix,Read,Bits} Word.
      
      * Coercions to sized integer types consistently behave as cutting the
        right amount of bits from the infinite two-complement representation.
        For example (fromIntegral (-1 :: Int8) :: Word64) == maxBound.
      
      * ghc/tests/numeric/should_run/arith011 tests {Int,Word}64 and instance
        Bits Int, and does not try to use overflowing toEnum. arith011.stdout
        is not updated yet because of a problem I will tell about soon.
      
      * Move fromInteger and realToFrac from Prelude to PrelReal.
        Move fromInt from PrelNum to PrelReal and define as fromInteger.
        Define toInt as fromInteger. fromInteger is the place to write
        integer conversion rules for.
      
      * Remove ArrayBase.newInitialisedArray, use default definition of
        newArray instead.
      
      * Bugs fixed:
        - {quot,rem}Word# primop attributes.
        - integerToInt64# for small negative values.
        - {min,max}Bound::Int on 64-bit platforms.
        - iShiftRL64#.
        - Various Bits instances.
      
      * Polishing:
        - Use 'ppr' instead of 'pprPrimOp' and 'text . showPrimRep'.
        - PrimRep.{primRepString,showPrimRepToUser} removed.
        - MachMisc.sizeOf returns Int instead of Integer.
        - Some eta reduction, parens, spacing, and reordering cleanups -
          sorry, couldn't resist.
      
      * Questions:
        - Should iShiftRL and iShiftRL64 be removed? IMHO they should,
          s/iShiftRA/iShiftR/, s/shiftRL/shiftR/. The behaviour on shifting
          is a property of the signedness of the type, not the operation!
          I haven't done this change.
      871db587
  21. 19 Feb, 2001 2 commits
    • sewardj's avatar
      [project @ 2001-02-19 11:38:55 by sewardj] · 8384f6dd
      sewardj authored
      Expand on comments re StString lifting activity
      8384f6dd
    • sewardj's avatar
      [project @ 2001-02-19 10:15:54 by sewardj] · 0879ee32
      sewardj authored
      Fix two bugs exposed when trying to boot HEAD on sparc with NCG and -O:
      
      1.  StScratchWords on sparc were in the wrong place; they were
          immediately above %fp and should have been immediately below.
          Fixed.  Also removed a suspicious-looking "+1" in the x86
          version of same.
      
      2.  (Potentially affects all platforms): Lift strings out from
          top-level literal data, and place them at the end of the block.
          The motivating example (bug) was:
      
           Stix:
              (DataSegment)
              Bogon.ping_closure :
              (Data P_ Addr.A#_static_info)
              (Data StgAddr (Str `alalal'))
              (Data P_ (0))
           results in:
              .data
                      .align 8
              .global Bogon_ping_closure
              Bogon_ping_closure:
                      .long   Addr_Azh_static_info
                      .long   .Ln1a8
              .Ln1a8:
                      .byte   0x61
                      .byte   0x6C
                      .byte   0x61
                      .byte   0x6C
                      .byte   0x61
                      .byte   0x6C
                      .byte   0x00
                      .long   0
         ie, the Str is planted in-line, when what we really meant was to place
         a _reference_ to the string there.  This is Way Wrong (tm).  Fixed.
      0879ee32
  22. 01 Feb, 2001 1 commit
    • sewardj's avatar
      [project @ 2001-02-01 13:35:10 by sewardj] · 9e358c7e
      sewardj authored
      Fix a long-standing roaring bogon in mangleIndexTree, to do with
      not-necessarily-valid assumptions about PrimRep sizes.  In future all
      enquiries about PrimRep sizes should go via MachMisc.primRepToSize
      and/or MachMisc.sizeOf.  The Lord preserve us from random, unportable
      hacks in the NCG.
      9e358c7e
  23. 31 Jan, 2001 1 commit
    • sewardj's avatar
      [project @ 2001-01-31 12:27:24 by sewardj] · 6142c28f
      sewardj authored
      Create PrimReps: {Int|Word}{8|16|32}Rep, for use in the native code
      generator.  And change the rep for character ops from Int8Rep to
      Word8Rep.  This fixes a bug in the sparc NCG in which chars loaded from
      memory were incorrectly sign-extended to 32 bits.  This problem
      appeared when CharRep was turned into a 32-bit quantity, and
      previous uses of it were replaced with Int8Rep, incorrectly, since
      Int8Rep is signed.  Also undo the kludge in the x86 section which
      had (unknown to all) kept it working despite the change to Int8Rep.
      
      sparc NCG now appears to work; hope the x86 side isn't now broken.
      6142c28f
  24. 17 Jan, 2001 1 commit
  25. 20 Dec, 2000 1 commit
  26. 04 Dec, 2000 1 commit
  27. 24 Nov, 2000 1 commit
  28. 13 Nov, 2000 1 commit
    • simonmar's avatar
      [project @ 2000-11-13 11:04:06 by simonmar] · ae034542
      simonmar authored
      Merge register allocation fix for idiv from before-ghci-branch:
      
        1.59.2.1  +2 -37     fptools/ghc/compiler/nativeGen/MachCode.lhs
        1.40.2.1  +15 -4     fptools/ghc/compiler/nativeGen/MachMisc.lhs
        1.43.2.1  +20 -1     fptools/ghc/compiler/nativeGen/PprMach.lhs
        1.26.2.1  +8 -15     fptools/ghc/compiler/nativeGen/RegAllocInfo.lhs
      ae034542
  29. 22 Aug, 2000 1 commit
  30. 21 Aug, 2000 1 commit
    • sewardj's avatar
      [project @ 2000-08-21 15:40:14 by sewardj] · b71148fc
      sewardj authored
      Make the register allocator deal properly with switch tables.
      Previously, it didn't calculate the correct flow edges away from the
      indirect jump (in fact it didn't reckon there were any flow edges
      leaving it :) which makes a nonsense of the live variable analysis in
      the branches.
      
      A jump insn can now optionally be annotated with a list of destination
      labels, and if so, the register allocator creates flow edges to all of
      them.
      
      Jump tables are now re-enabled.  They remain disabled for 4.08.1,
      since we aren't fixing the problem properly on that branch.
      
      I assume this problem wasn't exposed by the old register allocator
      because of the live-range-approximation hacks used in it.  Since it
      was undocumented, we'll never know.
      
      Sparc builds will now break until I fix them.
      b71148fc
  31. 07 Aug, 2000 1 commit
    • qrczak's avatar
      [project @ 2000-08-07 23:37:19 by qrczak] · 4b172698
      qrczak authored
      Now Char, Char#, StgChar have 31 bits (physically 32).
      "foo"# is still an array of bytes.
      
      CharRep represents 32 bits (on a 64-bit arch too). There is also
      Int8Rep, used in those places where bytes were originally meant.
      readCharArray, indexCharOffAddr etc. still use bytes. Storable and
      {I,M}Array use wide Chars.
      
      In future perhaps all sized integers should be primitive types. Then
      some usages of indexing primops scattered through the code could
      be changed to then-available Int8 ones, and then Char variants of
      primops could be made wide (other usages that handle text should use
      conversion that will be provided later).
      
      I/O and _ccall_ arguments assume ISO-8859-1. UTF-8 is internally used
      for string literals (only).
      
      Z-encoding is ready for Unicode identifiers.
      
      Ranges of intlike and charlike closures are more easily configurable.
      
      I've probably broken nativeGen/MachCode.lhs:chrCode for Alpha but I
      don't know the Alpha assembler to fix it (what is zapnot?). Generally
      I'm not sure if I've done the NCG changes right.
      
      This commit breaks the binary compatibility (of course).
      
      TODO:
      * is* and to{Lower,Upper} in Char (in progress).
      * Libraries for text conversion (in design / experiments),
        to be plugged to I/O and a higher level foreign library.
      * PackedString.
      * StringBuffer and accepting source in encodings other than ISO-8859-1.
      4b172698
  32. 27 Jul, 2000 1 commit
    • sewardj's avatar
      [project @ 2000-07-27 09:02:05 by sewardj] · 023fea0f
      sewardj authored
      Redo the sparc Ccall machinery, so as to correctly handle the case
      where one or more of the args to a Ccall is itself a Ccall.  Prior to
      the advent of the Stix inliner, this could never happen, but now it
      does.
      023fea0f
  33. 14 Jul, 2000 1 commit
    • simonpj's avatar
      [project @ 2000-07-14 08:17:36 by simonpj] · 77a8c0db
      simonpj authored
      This commit completely re-does the kind-inference mechanism.
      Previously it was inter-wound with type inference, but that was
      always hard to understand, and it finally broke when we started
      checking for ambiguity when type-checking a type signature (details
      irrelevant).
      
      So now kind inference is more clearly separated, so that it never
      takes place at the same time as type inference.  The biggest change
      is in TcTyClsDecls, which does the kind inference for a group of
      type and class declarations.  It now contains comments to explain
      how it all works.
      
      There are also comments in TypeRep which describes the slightly
      tricky way in which we deal with the fact that kind 'type' (written
      '*') actually has 'boxed type' and 'unboxed type' as sub-kinds.
      The whole thing is a bit of a hack, because we don't really have 
      sub-kinding, but it's less of a hack than before.
      
      A lot of general tidying up happened at the same time.
      In particular, I removed some dead code here and there
      77a8c0db
  34. 13 Jul, 2000 1 commit
  35. 12 Jul, 2000 1 commit
    • sewardj's avatar
      [project @ 2000-07-12 13:04:31 by sewardj] · df0e0b7f
      sewardj authored
      Make the x86 NCG work again following recent sparc hackage.
      
      Also, fix the x86 bits pertaining to the floats-promoted-to-doubles-
      in-ccalls problem.  So this problem should no longer exist on x86
      or sparc via NCG.
      df0e0b7f