[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Floating-point constant folding in Emacs byte compiler
From: |
Eli Zaretskii |
Subject: |
Re: Floating-point constant folding in Emacs byte compiler |
Date: |
Mon, 26 Mar 2018 19:02:54 +0300 |
> From: Robert Pluim <address@hidden>
> Cc: address@hidden
> Date: Mon, 26 Mar 2018 17:57:01 +0200
>
> >> >> I imagine that on a 32-bit version of emacs, (byte-compile (lambda (x)
> >> >> (* #x10000 #x10000))) similarly produces a constant-zero function,
> >> >
> >> > The result depends on whether Emacs was build --with-wide-int. If it
> >> > was, the result is #[(x) "\300\207" [4294967296] 1], if it wasn't, I
> >> > get #[(x) "\300\207" [0] 1].
> >>
> >> Hmm, would it be worthwhile to have Emacs signal overflow in such a
> >> situation (perhaps controlled by a configuration variable) so we could
> >> fix such issues?
> >
> > In which of these two cases do you see overflow?
> >
>
> Does (* #x10000 #x10000) not overflow on 32-bit?
Only if Emacs was not built --with-wide-int.
> > I also don't think I understand the utility of signaling an overflow
> > error from the byte compiler that happened because it did constant
> > folding. What else except bug reports could this yield?
>
> I was proposing it as a debug option, not a generally enabled one. Of
> course if there's no overflow, it would be kind of useless :-)
If we want the byte code to be portable, the results of compiling
cannot depend on the machine on which the code was byte-compiled.
- Re: Floating-point constant folding in Emacs byte compiler, (continued)
- Re: Floating-point constant folding in Emacs byte compiler, Pip Cet, 2018/03/23
- Re: Floating-point constant folding in Emacs byte compiler, Eli Zaretskii, 2018/03/24
- Re: Floating-point constant folding in Emacs byte compiler, Robert Pluim, 2018/03/26
- Re: Floating-point constant folding in Emacs byte compiler, Eli Zaretskii, 2018/03/26
- Re: Floating-point constant folding in Emacs byte compiler, Robert Pluim, 2018/03/26
- Re: Floating-point constant folding in Emacs byte compiler,
Eli Zaretskii <=
- Re: Floating-point constant folding in Emacs byte compiler, Pip Cet, 2018/03/26
- Re: Floating-point constant folding in Emacs byte compiler, Eli Zaretskii, 2018/03/26
- Re: Floating-point constant folding in Emacs byte compiler, Paul Eggert, 2018/03/26
- Re: Floating-point constant folding in Emacs byte compiler, Paul Eggert, 2018/03/27
- Re: Floating-point constant folding in Emacs byte compiler, Pip Cet, 2018/03/30
- Re: Floating-point constant folding in Emacs byte compiler, Noam Postavsky, 2018/03/30
- Re: Floating-point constant folding in Emacs byte compiler, Paul Eggert, 2018/03/30
- Re: Floating-point constant folding in Emacs byte compiler, Stefan Monnier, 2018/03/26
- Re: Floating-point constant folding in Emacs byte compiler, Eli Zaretskii, 2018/03/26
- Re: Floating-point constant folding in Emacs byte compiler, Paul Eggert, 2018/03/26