JuliaLang/julia

Choose target ISA in `@code_llvm` and `@code_native`

Open

#52,949 opened on Jan 17, 2024

View on GitHub
 (12 comments) (1 reaction) (0 assignees)Julia (5,773 forks)batch import
featuregood first issue

Repository metrics

Stars
 (48,709 stars)
PR merge metrics
 (Avg merge 20d 6h) (157 merged PRs in 30d)

Description

@vchuravy mentioned on slack that it should be possible to teach @code_llvm and @code_native to generate code for a different ISA (but within same architecture) than the target chosen at startup with -C (native by default), with the only caveat that it'd work only for ISAs that are equal to or smaller than the current one.

A nice use case for this would be to able to choose the target in Compiler Explorer, whose julia backend at the moment only generates code for whatever is the native CPU currently being used.

It'd be nice to have pointers of where one would need to look at, in case they were interested in tackling the issue :slightly_smiling_face:

Contributor guide