1. 18 Sep, 2009 3 commits
    • dias@cs.tufts.edu's avatar
      Minor refactoring and formatting · df5b491c
      dias@cs.tufts.edu authored
      Wrote a generic function to extend dataflow results for safe foreign calls.
      Should be able to throw it away when we change the representation of safe foreign calls.
    • dias@cs.tufts.edu's avatar
      Keep Touch'd variables live through the back end · 787b08bd
      dias@cs.tufts.edu authored
      When we used derived pointers into the middle of an object,
      we need to keep the pointer to the start of the object live.
      We use a "fat machine instruction" with the primitive MO_Touch
      to propagate this information through the back end.
    • dias@cs.tufts.edu's avatar
      Fixed calling convention for unboxed tuples · e4caa74b
      dias@cs.tufts.edu authored
      Apparently, the arguments should be sorted by pointerhood.
      While we're at it, I rewrote the code that assigns registers
      and stack space to function call and return parameters.
  2. 06 Nov, 2009 2 commits
    • Ben.Lippmeier@anu.edu.au's avatar
      validate fixes · 374a85ae
      Ben.Lippmeier@anu.edu.au authored
    • Ben.Lippmeier@anu.edu.au's avatar
      * Refactor CLabel.RtsLabel to CLabel.CmmLabel · a02e7f40
      Ben.Lippmeier@anu.edu.au authored
      The type of the CmmLabel ctor is now
        CmmLabel :: PackageId -> FastString -> CmmLabelInfo -> CLabel
       - When you construct a CmmLabel you have to explicitly say what
         package it is in. Many of these will just use rtsPackageId, but
         I've left it this way to remind people not to pretend labels are
         in the RTS package when they're not. 
       - When parsing a Cmm file, labels that are not defined in the 
         current file are assumed to be in the RTS package. 
         Labels imported like
            import label
         are assumed to be in a generic "foreign" package, which is different
         from the current one.
         Labels imported like
            import "package-name" label
         are marked as coming from the named package.
         This last one is needed for the integer-gmp library as we want to
         refer to labels that are not in the same compilation unit, but
         are in the same non-rts package.
         This should help remove the nasty #ifdef __PIC__ stuff from
  3. 22 Oct, 2009 1 commit
  4. 18 Oct, 2009 3 commits
  5. 05 Nov, 2009 1 commit
  6. 29 Oct, 2009 2 commits
  7. 28 Sep, 2009 1 commit
    • Simon Marlow's avatar
      emitRetUT: cope with arguments overlapping with results (#3546) · fd274ffd
      Simon Marlow authored
      In decodeFloat_Int# we have the C-- code:
          mp_tmp1  = Sp - WDS(1);
          mp_tmp_w = Sp - WDS(2);
          /* arguments: F1 = Float# */
          arg = F1;
          /* Perform the operation */
          foreign "C" __decodeFloat_Int(mp_tmp1 "ptr", mp_tmp_w "ptr", arg) [];
          /* returns: (Int# (mantissa), Int# (exponent)) */
          RET_NN(W_[mp_tmp1], W_[mp_tmp_w]);
      Which all looks quite reasonable.  The problem is that RET_NN() might
      assign the results to the stack (with an unregisterised back end), and
      in this case the arguments to RET_NN() refer to the same stack slots
      that will be assigned to.
      The code generator should do the right thing here, but it wasn't - it
      was assuming that it could assign the results sequentially.  A 1-line
      fix to use emitSimultaneously rather than emitStmts (plus comments).
  8. 11 Sep, 2009 2 commits
  9. 10 Sep, 2009 2 commits
  10. 22 Jul, 2009 1 commit
  11. 03 Aug, 2009 1 commit
  12. 02 Aug, 2009 1 commit
    • Simon Marlow's avatar
      RTS tidyup sweep, first phase · a2a67cd5
      Simon Marlow authored
      The first phase of this tidyup is focussed on the header files, and in
      particular making sure we are exposinng publicly exactly what we need
      to, and no more.
       - Rts.h now includes everything that the RTS exposes publicly,
         rather than a random subset of it.
       - Most of the public header files have moved into subdirectories, and
         many of them have been renamed.  But clients should not need to
         include any of the other headers directly, just #include the main
         public headers: Rts.h, HsFFI.h, RtsAPI.h.
       - All the headers needed for via-C compilation have moved into the
         stg subdirectory, which is self-contained.  Most of the headers for
         the rest of the RTS APIs have moved into the rts subdirectory.
       - I left MachDeps.h where it is, because it is so widely used in
         Haskell code.
       - I left a deprecated stub for RtsFlags.h in place.  The flag
         structures are now exposed by Rts.h.
       - Various internal APIs are no longer exposed by public header files.
       - Various bits of dead code and declarations have been removed
       - More gcc warnings are turned on, and the RTS code is more
       - More source files #include "PosixSource.h", and hence only use
         standard POSIX (1003.1c-1995) interfaces.
      There is a lot more tidying up still to do, this is just the first
      pass.  I also intend to standardise the names for external RTS APIs
      (e.g use the rts_ prefix consistently), and declare the internal APIs
      as hidden for shared libraries.
  13. 20 Jun, 2009 1 commit
  14. 24 Jul, 2009 1 commit
  15. 07 Jul, 2009 1 commit
  16. 06 Jul, 2009 1 commit
  17. 01 Jul, 2009 1 commit
  18. 09 Jun, 2009 1 commit
    • Duncan Coutts's avatar
      Add PrimCall to the STG layer and update Core -> STG translation · cbbee4e8
      Duncan Coutts authored
      It adds a third case to StgOp which already hold StgPrimOp and StgFCallOp.
      The code generation for the new StgPrimCallOp case is almost exactly the
      same as for out-of-line primops. They now share the tailCallPrim function.
      In the Core -> STG translation we map foreign calls using the "prim"
      calling convention to the StgPrimCallOp case. This is because in Core we
      represent prim calls using the ForeignCall stuff. At the STG level however
      the prim calls are really much more like primops than foreign calls.
  19. 08 Jun, 2009 1 commit
  20. 23 May, 2009 1 commit
  21. 14 May, 2009 1 commit
  22. 24 Apr, 2009 1 commit
  23. 03 Apr, 2009 1 commit
  24. 31 Mar, 2009 1 commit
  25. 25 Mar, 2009 1 commit
  26. 23 Mar, 2009 5 commits
  27. 30 Mar, 2009 1 commit
  28. 23 Mar, 2009 1 commit
    • Bertram Felgenhauer's avatar
      update list of C math functions · f7ecb11b
      Bertram Felgenhauer authored
      Fix via C compilation of modules that import, say, log1p from math.h (#3117)
      The list is based on preprocessing Stg.h with glibc 2.6.1 headers, and
      cross-checked with the ISO C 99 standard (draft).