Re: [commit: ghc] master: UNREG: PprC: add support for of W16 literals (Ticket #15237) (01c9d95)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [commit: ghc] master: UNREG: PprC: add support for of W16 literals (Ticket #15237) (01c9d95)

Gabor Greif-2
Thanks for fixing this!

I am in the process of building an unregisterised MIPS64
cross-compiler and just noticed this warning running by:

  HC [stage 1] libraries/base/dist-install/build/GHC/Show.p_o
/tmp/ghc414_0/ghc_7.hc: In function '_c53i':

/tmp/ghc414_0/ghc_7.hc:1483:17: error:
     warning: integer constant is so large that it is unsigned
     _s4Lo = (_s4Ld+-9223372036854775808) + (_s4Lg + _s4L9);
                     ^
     |
1483 | _s4Lo = (_s4Ld+-9223372036854775808) + (_s4Lg + _s4L9);
     |                 ^

Not sure whether I should be worried (there seem to be others of this
kind) or a simple change in the datatype (int -> unsigned) could
silence this.

Cheers,

    Gabor


On 6/15/18, [hidden email] <[hidden email]> wrote:

> Repository : ssh://[hidden email]/ghc
>
> On branch  : master
> Link       :
> http://ghc.haskell.org/trac/ghc/changeset/01c9d95aca12caf5c954320a2a82335b32568554/ghc
>
>>---------------------------------------------------------------
>
> commit 01c9d95aca12caf5c954320a2a82335b32568554
> Author: Sergei Trofimovich <[hidden email]>
> Date:   Thu Jun 14 23:13:16 2018 +0100
>
>     UNREG: PprC: add support for of W16 literals (Ticket #15237)
>
>     Fix UNREG build failure for 32-bit targets.
>
>     This change is an equivalent of commit
>     0238a6c78102d43dae2f56192bd3486e4f9ecf1d
>     ("UNREG: PprC: add support for of W32 literals")
>
>     The change allows combining two subwords into one word
>     on 32-bit targets. Tested on nios2-unknown-linux-gnu.
>
>     GHC Trac Issues: #15237
>
>     Signed-off-by: Sergei Trofimovich <[hidden email]>
>
>
>>---------------------------------------------------------------
>
> 01c9d95aca12caf5c954320a2a82335b32568554
>  compiler/cmm/PprC.hs | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/compiler/cmm/PprC.hs b/compiler/cmm/PprC.hs
> index e46fff1..8b30bbf 100644
> --- a/compiler/cmm/PprC.hs
> +++ b/compiler/cmm/PprC.hs
> @@ -546,6 +546,14 @@ pprStatics dflags (CmmStaticLit (CmmInt a W32) :
>                              rest)
>      else pprStatics dflags (CmmStaticLit (CmmInt ((shiftL b 32) .|. a) W64)
> :
>                              rest)
> +pprStatics dflags (CmmStaticLit (CmmInt a W16) :
> +                   CmmStaticLit (CmmInt b W16) : rest)
> +  | wordWidth dflags == W32
> +  = if wORDS_BIGENDIAN dflags
> +    then pprStatics dflags (CmmStaticLit (CmmInt ((shiftL a 16) .|. b) W32)
> :
> +                            rest)
> +    else pprStatics dflags (CmmStaticLit (CmmInt ((shiftL b 16) .|. a) W32)
> :
> +                            rest)
>  pprStatics dflags (CmmStaticLit (CmmInt _ w) : _)
>    | w /= wordWidth dflags
>    = pprPanic "pprStatics: cannot emit a non-word-sized static literal" (ppr
> w)
>
> _______________________________________________
> ghc-commits mailing list
> [hidden email]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-commits
>
_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Reply | Threaded
Open this post in threaded view
|

Re: [commit: ghc] master: UNREG: PprC: add support for of W16 literals (Ticket #15237) (01c9d95)

Gabor Greif-2
Hi Sergei,

thanks for your swift response!

I did:
```
$ mips64-wrsmllib64-linux-gcc -E -dM - </dev/null | grep MIPS_SIM
#define _MIPS_SIM _ABI64
```

Looks like 64 bit ABI.

Cheers,

    Gabor


On 6/15/18, Sergei Trofimovich <[hidden email]> wrote:

> On Fri, 15 Jun 2018 10:49:41 +0200
> Gabor Greif <[hidden email]> wrote:
>
>> Thanks for fixing this!
>>
>> I am in the process of building an unregisterised MIPS64
>> cross-compiler and just noticed this warning running by:
>>
>>   HC [stage 1] libraries/base/dist-install/build/GHC/Show.p_o
>> /tmp/ghc414_0/ghc_7.hc: In function '_c53i':
>>
>> /tmp/ghc414_0/ghc_7.hc:1483:17: error:
>>      warning: integer constant is so large that it is unsigned
>>      _s4Lo = (_s4Ld+-9223372036854775808) + (_s4Lg + _s4L9);
>>                      ^
>>      |
>> 1483 | _s4Lo = (_s4Ld+-9223372036854775808) + (_s4Lg + _s4L9);
>>      |                 ^
>>
>> Not sure whether I should be worried (there seem to be others of this
>> kind) or a simple change in the datatype (int -> unsigned) could
>> silence this.
>
> The overflow looks fishy. -9223372036854775808 is 0x8000000000000000.
> What ABI your mips64 targets to? 64 or n32? I'd like to reproduce it
> locally.
>
> Simplest way to check for ABI (mine is N32):
>   $ mips64-unknown-linux-gnu-gcc -E -dM - </dev/null | grep MIPS_SIM
>   #define _MIPS_SIM _ABIN32
>
> --
>
>   Sergei
>
_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs