6

rustc_codegen_gcc: Progress Report #15

 1 year ago
source link: https://blog.antoyo.xyz/rustc_codegen_gcc-progress-report-15
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

rustc_codegen_gcc: Progress Report #15

03 Sep 2022

What is rustc_codegen_gcc?

rustc_codegen_gcc is a GCC ahead-of-time codegen for rustc, meaning that it can be loaded by the existing rustc frontend, but benefits from GCC by having more architectures supported and having access to GCC’s optimizations. It is not to be confused with gccrs, which is a GCC frontend for Rust.

LPC 2022

I’ll be presenting at the Linux Plumbers Conference in Dublin later this month. Make sure to attend if you want to discuss using this codegen for any specific purposes.

GCC patches status

This month, I did the following:

This commit is not yet posted as a patch for review since it is not ready: there are many more attributes that are not yet supported.

State of rustc_codegen_gcc

Here’s what has been done this month:

Here is the progress of the stdarch tests:

test result: FAILED. 4564 passed; 12 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.03s
Category Last Month This Month Delta

Passed

Failed

Here’s a rough summary of what has been implemented:

Feature Last month completion Completion Delta

target-specific builtins support in libgccjit

support for vector shuffle (equivalent of __builtin_shufflevector) in libgccjit

simd_extract

simd_select, simd_select_bitmask

simd_reduce_min, simd_reduce_max

simd_reduce_and, simd_reduce_or

simd_saturating_add and simd_saturating_sub

implemented for x86

simd_insert

simd_cast

simd_bitmask

LLVM SIMD intrinsics

~99% implemented for x86

~99% implemented for x86

0 (needs to fix some bugs)

SIMD float intrinsics

simd_reduce_add_unordered, simd_reduce_mul_unordered

simd_reduce_add_ordered, simd_reduce_mul_ordered

simd_reduce_min_nanless, simd_reduce_max_nanless

simd_reduce_xor, simd_reduce_all, simd_reduce_any

simd_gather and simd_scatter

simd_as

How to contribute

rustc_codegen_gcc

If you want to help on the project itself, please do the following:

  1. Run the tests locally.

  2. Choose a test that fails.

  3. Investigate why it fails.

  4. Fix the problem.

Even if you can’t fix the problem, your investigation could help, so if you enjoy staring at assembly code, have fun!

Crates and rustc

If you would like to contribute on adding support for Rust on currently unsupported platforms, you can help by adding the support for those platforms in some crates like libc and object and also in the rust compiler itself.

Test this project

Otherwise, you can test this project on new platforms and also compare the assembly with LLVM to see if some optimization is missing.

Good first issue

Finally, another good way to help is to look at good first issues. Those are issues that should be easier to start with.

Thanks for your support!

I wanted to personally thank all the people that sponsor this project: your support is very much appreciated.

A special thanks to the following sponsors:

  • saethlin

  • embark-studios

  • Traverse-Research

  • Shnatsel

A big thank you to bjorn3 for his help, contributions and reviews. And a big thank you to lqd and GuillaumeGomez for answering my questions about rustc’s internals. Another big thank you to Commeownist for his contributions.

Also, a big thank you to the rest of my sponsors:

  • 0x7CFE

  • nevi-me

  • oleid

  • acshi

  • joshtriplett

  • TimNN

  • sdroege

  • alanfalloon

  • steven-joruk

  • davidlattimore

  • Nehliin

  • colelawrence

  • zmanian

  • alexkirsz

  • regiontog

  • berkus

  • belzael

  • vincentdephily

  • jam1garner

  • Shoeboxam

  • evanrichter

  • yerke

  • seanpianka

  • srijs

  • kkysen

  • messense

  • riking

  • rafaelcaricio

  • Lemmih

  • memoryruins

  • pthariensflame

  • senden9

  • robjtede

  • Jonas Platte

  • spike grobstein

  • Oliver Marshall

  • Sam Harrington

  • Jonas

  • Jeff Muizelaar

  • Eugene Bulkin

  • Absolucy

  • Chris Butler

  • sierrafiveseven

  • Joseph Garvin

  • MarcoFalke

  • athre0z

  • icewind

  • Tommy Thorn

  • Sebastian Zivota

  • Oskar Nehlin

  • Nicolas Barbier

  • Daniel

  • Thomas Colliers

  • Justin Ossevoort

  • sbstp

  • Chris

  • Bálint Horváth

  • fanquake

  • sstadick

  • luizirber

  • kiyoshigawa

  • robinmoussu

  • Daniel Sheehan

  • Marvin Löbel

  • nacaclanga

  • Matthew Conolly

  • dandxy89

  • 0x0177b11f

  • L.apz

  • JockeTF

  • davidcornu

  • tedbyron

  • stuhood

  • 0xdeafbeef

and a few others who preferred to stay anonymous.

Former sponsors/patreons:

  • finfet

  • Alovchin91

  • mexus

  • raymanfx

  • ghost

  • gilescope

  • Hofer-Julian

  • olanod

  • Denis Zaletaev

  • Chai T. Rex

  • Paul Ellenbogen

  • Dakota Brink

  • Botlabs

  • Oliver Marshall


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK