emacs-devel
[Top][All Lists]
Advanced

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

Re: Q: What is default architecture for code produced by native compiler


From: Arthur Miller
Subject: Re: Q: What is default architecture for code produced by native compiler?
Date: Wed, 25 Aug 2021 03:13:49 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Andrea Corallo <akrl@sdf.org> writes:

> Arthur Miller <arthur.miller@live.com> writes:
>
>> Just wonder, is it generic x86 or something later or does it uses
>> native for architecture and cpu flags (-march=native and -mcpu=native)?
>
> I'd say is GCC's default.

Yes, I see. The default is generic.

$ echo | gcc -v -E - 2>&1 | grep cc1
 /usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/cc1 -E -quiet -v - -mtune=generic 
-march=x86-64 -dumpbase -

I am not sure what "generic" cpu boils down to on intel, but I would of course
prefer to generate code for my cpu (skylake) if possible.

>> If it is generic, do we have option to pass in arch and cpu flags?
>
> No we don't, even if we could expose it using
> 'gcc_jit_context_add_command_line_option' for non obsolete versions of
> GCC.

Allright, is there any interest to expose this? :-)

We could have a defcustom in comp.el, either some boolean like:
"native-comp-prefer-host-cpu"

or maybe a string like: "native-comp-compiler-options" but that is maybe too
wide? I don't know how resilient is native comp to various opt flags, is it very
picky which are used, or anything gcc can take works?

I have never looked at native branch code, so I am not sure how it works, but
grep tells me that this function were fun happens is comp--compile-ctxt-to-file,
would that be the only one I need to hack?

To be honest, I have no idea if there is much if anything to win in speed in 
elisp context,
between generic and skylake, but I have to try :).

> Regards
>
>   Andrea
Thanks for very fast answer!

best regards
/a



reply via email to

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