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: Andrea Corallo
Subject: Re: Q: What is default architecture for code produced by native compiler?
Date: Wed, 25 Aug 2021 07:36:59 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Arthur Miller <arthur.miller@live.com> writes:

> 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.
>>
>>> 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.
>>
>> Regards
>>
>>   Andrea
> I am sorry to bother, but I have just seen:
>
> (defcustom native-comp-driver-options nil
>   "Options passed verbatim to the native compiler's back-end driver.
> Note that not all options are meaningful; typically only the options
> affecting the assembler and linker are likely to be useful.
>
> Passing these options is only available in libgccjit version 9
> and above."
>   :type '(repeat string)                ; FIXME is this right?
>   :version "28.1")
>
> I have tested with:
>
> (setq native-comp-driver-options '("-march=native" "-mcpu=native"))
>
> but I see no difference in emitted code when I dissaemble produced binaries.

Driver options are not for the compiler but rather linker and assembler,
infact `native-comp-driver-options' relies on
'gcc_jit_context_add_driver_option' [1].

That said for most of the code we generate ATM I doubt would make much
difference to specify a different -march and/or -mcpu.

Regards

  Andrea

[1] <https://gcc.gnu.org/onlinedocs/jit/topics/contexts.html>



reply via email to

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