[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Shrinking the C core
From: |
Emanuel Berg |
Subject: |
Re: Shrinking the C core |
Date: |
Mon, 28 Aug 2023 06:41:28 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Ihor Radchenko wrote:
>> The only problem (AFAIU) is that GCC JIT cannot reach
>> inside subr level, so all these information does not
>> benefit Emacs functions implemented in C.
>
> If I am right here, it might actually be worth it to rewrite
> some of the subroutines into Elisp. For example
> rounding_driver (called by `floor') code is full of runtime
> type checks:
>
> CHECK_NUMBER (n);
> if (NILP (d))
> ...
> CHECK_NUMBER (d);
> ...
> if (FIXNUMP (d))
> if (XFIXNUM (d) == 0)
> ...
> if (FIXNUMP (n))
> ...
> else if (FLOATP (d))
> if (XFLOAT_DATA (d) == 0)
> int nscale = FLOATP (n) ? double_integer_scale (XFLOAT_DATA (n)) : 0;
> ..
>
> During native compilation, if type information and n and
> d is available, GCC might have a chance to cut a number of
> branches away from the above code.
Does this indicate a tendency where one can foresee a future
where Elisp is as fast as C to the point C could be
dropped completely?
Even today we can run singular Elisp programs. But not without
Emacs and its Lisp interpreter, which is written in C.
Still, I wonder if those typechecks in C really slow things
down to the point it matters. Maybe for really huge
number-crunching computations?
--
underground experts united
https://dataswamp.org/~incal
- Re: Add more supported primitives in libgccjit IR (was: Shrinking the C core), (continued)
- Re: Shrinking the C core, Emanuel Berg, 2023/08/27
- Re: Shrinking the C core, Gregory Heytings, 2023/08/21
- Re: Shrinking the C core, Emanuel Berg, 2023/08/27
- Re: Shrinking the C core, Emanuel Berg, 2023/08/27
- Re: Shrinking the C core, Eli Zaretskii, 2023/08/21
- Re: Shrinking the C core, Ihor Radchenko, 2023/08/21
- Re: Shrinking the C core, Eli Zaretskii, 2023/08/21
- Re: Shrinking the C core,
Emanuel Berg <=
- Re: Shrinking the C core, Ihor Radchenko, 2023/08/28
- Re: Shrinking the C core, Alfred M. Szmidt, 2023/08/20
- Re: Shrinking the C core, Ihor Radchenko, 2023/08/20
- Re: Shrinking the C core, Alfred M. Szmidt, 2023/08/21
- Re: Shrinking the C core, Ihor Radchenko, 2023/08/21
- Re: Shrinking the C core, Alfred M. Szmidt, 2023/08/21
- Re: Shrinking the C core, Ihor Radchenko, 2023/08/21
- Re: Shrinking the C core, Alfred M. Szmidt, 2023/08/21
- Re: Shrinking the C core, Ihor Radchenko, 2023/08/21
- Re: Shrinking the C core, Alfred M. Szmidt, 2023/08/21