1. 09 Jul, 2020 3 commits
    • Sylvain Henry's avatar
      LLVM: fix MO_S_Mul2 support (#18434) · 3656dff8
      Sylvain Henry authored
      The value indicating if the carry is useful wasn't taken into account.
      3656dff8
    • Stefan Schulze Frielinghaus's avatar
      Fix GHCi :print on big-endian platforms · b7de4b96
      Stefan Schulze Frielinghaus authored
      On big-endian platforms executing
      
        import GHC.Exts
        data Foo = Foo Float# deriving Show
        foo = Foo 42.0#
        foo
        :print foo
      
      results in an arithmetic overflow exception which is caused by function
      index where moveBytes equals
        word_size - (r + item_size_b) * 8
      Here we have a mixture of units. Both, word_size and item_size_b have
      unit bytes whereas r has unit bits.  On 64-bit platforms moveBytes
      equals then
        8 - (0 + 4) * 8
      which results in a negative and therefore invalid second parameter for a
      shiftL operation.
      
      In order to make things more clear the expression
        (word .&. (mask `shiftL` moveBytes)) `shiftR` moveBytes
      is equivalent to
        (word `shiftR` moveBytes) .&. mask
      On big-endian platforms the shift must be a left shift instead of a
      right shift. For symmetry reasons not a mask is used but two shifts in
      order to zero out bits. Thus the fixed version equals
        case endian of
          BigEndian    -> (word `shiftL` moveBits) `shiftR` zeroOutBits `shiftL` zeroOutBits
          LittleEndian -> (word `shiftR` moveBits) `shiftL` zeroOutBits `shiftR` zeroOutBits
      
      Fixes #16548 and #14455
      b7de4b96
    • Adam Sandberg Eriksson's avatar
  2. 07 Jul, 2020 22 commits
  3. 03 Jul, 2020 9 commits
  4. 02 Jul, 2020 4 commits
  5. 01 Jul, 2020 2 commits
    • Ryan Scott's avatar
      Desugar quoted uses of DerivingVia and expression type signatures properly · 76d8cc74
      Ryan Scott authored
      The way that `GHC.HsToCore.Quote` desugared quoted `via` types (e.g.,
      `deriving via forall a. [a] instance Eq a => Eq (List a)`) and
      explicit type annotations in signatures (e.g.,
      `f = id @a :: forall a. a -> a`) was completely wrong, as it did not
      implement the scoping guidelines laid out in
      `Note [Scoped type variables in bindings]`. This is easily fixed.
      
      While I was in town, I did some minor cleanup of related Notes:
      
      * `Note [Scoped type variables in bindings]` and
        `Note [Scoped type variables in class and instance declarations]`
        say very nearly the same thing. I decided to just consolidate the
        two Notes into `Note [Scoped type variables in quotes]`.
      * `Note [Don't quantify implicit type variables in quotes]` is
        somewhat outdated, as it predates GHC 8.10, where the
        `forall`-or-nothing rule requires kind variables to be explicitly
        quantified in the presence of an explicit `forall`. As a result,
        the running example in that Note doesn't even compile. I have
        changed the example to something simpler that illustrates the
        same point that the original Note was making.
      
      Fixes #18388.
      76d8cc74
    • Hécate's avatar
      5c9fabb8