emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Add more supported primitives in libgccjit IR (was: Shrinking the C


From: Ihor Radchenko
Subject: Re: Add more supported primitives in libgccjit IR (was: Shrinking the C core)
Date: Mon, 21 Aug 2023 11:41:53 +0000

"Alfred M. Szmidt" <ams@gnu.org> writes:

>    > Look at data.c:arith_driver.  You'll see that it's essentially a 
> function 
>    > which dispatches the handling of its arguments depending on their type...
>    >
>    > These integer/float/bignum types are not known at compilation time ...
>
>    This is not correct. If you have something like
>    (progn (setq x 1) (> x 2)), compiler is actually able to determine the
>    type of X at compilation time.
>
> It is absolutley correct, the Emacs compiler is not capable of doing
> what you are suggesting.  There are no specific functions for fixnum
> comparison in Emacs Lisp, nor is the Emacs Lisp compiler capable of
> being instructed to do such specific things.  I've been repeating this
> constantly now.  That is needed to make programs faster in Lisp.

I can see

/*
   Define a substitute for Fadd1 Fsub1.
   Currently expose just fixnum arithmetic.
*/

static void
define_add1_sub1 (void)

in comp.c

So, there is some type-specific optimization going on.
It looks very limited though.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]