Xavier · @xavier
48 followers · 169 posts · Server sunny.garden

Yesterday I played around with the [1] compiler backend, and managed to implement the (amd64) stack semantics from Xhebraj et al.'s "What If We Don’t Pop the Stack? The Return of 2nd-Class Values"[2]. It took a couple hours and ~20 lines of diff.

This morning I peeked at LLVM's source code, and I can't imagine where I would even start.

Of course LLVM is so much more powerful and high-level, and it'll produce better machine code, but this experience really highlighted the value of a smol, hackable compiler backend like QBE.

[1]: c9x.me/compile/
[2]: bracevac.org/assets/pdf/ecoop2

#qbe

Last updated 1 year ago

nmeum · @nmeum
66 followers · 68 posts · Server hachyderm.io

I made some good progress on my tool for the intermediate language. The tool is now capable of exploring C software compiled to QBE using a QBE frontend like cproc (a small C11 compiler).

As an example, it is possible to enumerate prime numbers in a horribly inefficient manner through symbolic exploration of a C function: git.8pit.net/qsym/golden/prime

#symbolicexecution #qbe

Last updated 1 year ago

Noam Preil :plan9: · @pixelherodev
261 followers · 2651 posts · Server fosstodon.org

pixelhero.dev/tmp/8572f630d44f
I have compound literals working in kencc on ;D

Need to further test it, clean up the patch, and make sure it actually works for , but this is the first step towards getting working on 9front! :D

#9front #qbe #hare

Last updated 2 years ago

Garrit 🚣 · @garritfra
615 followers · 3385 posts · Server fosstodon.org

#qbe

Last updated 2 years ago

Dr. Brian Callahan · @bcallah
859 followers · 3925 posts · Server bsd.network

A wild post appears!

Let's study the and optimizers around the question of increments and decrements and see how they differ. Then we can make a decision as to whether or not we want to teach those optimizations to our optimizer we've been working on.

briancallahan.net/blog/2022041

#blog #llvm #gcc #qbe #compile #compilers #optimizer #optimizers #optimize #unix #c #programming #program #bsd #openbsd #freebsd #netbsd #dragonflybsd #linux #cproc

Last updated 2 years ago

Dr. Brian Callahan · @bcallah
859 followers · 3925 posts · Server bsd.network

A wild post appears!

I wrote a peephole optimizer for QBE. QBE missed a couple of easy optimization wins, so let's use it as an opportunity to learn how peephole optimizers work and write one of our own.

briancallahan.net/blog/2022033

#blog #compiler #compilers #compilation #compile #optimize #optimizer #optimizers #unix #openbsd #netbsd #freebsd #dragonflybsd #linux #c #cproc #qbe

Last updated 2 years ago

Garrit 🚣 · @garritfra
615 followers · 3385 posts · Server fosstodon.org

I just published v1.0.0 of the IR Rust crate. This is my first ever project that actually hits v1.0!πŸŽ‰

github.com/garritfra/qbe-rs/re

#qbe

Last updated 3 years ago

Dr. Brian Callahan · @bcallah
859 followers · 3925 posts · Server bsd.network

A wild post appears!

Today, we learn about QBE, a quick backend for compilers. It acts as a smaller version of LLVM: it reads in an intermediate language in SSA form and outputs optimized assembly.

Let's get our hands dirty figuring out how QBE works! We'll write a Brainfuck compiler directly in QBE IR.

briancallahan.net/blog/2021082

#blog #program #programming #code #coding #compile #compiler #compilers #qbe

Last updated 3 years ago