Godbolt Compiler Explorer

Godbolt Compiler Explorer

Ever want to see what assembly code your compiler is really generating?

There are a few reasons to want to know this. Firstly is correctness. Sometimes obscure bugs can crop up when you switch from one compiler to another, from one set of optimization settings to another, from debug to release, or even from one compiler version to another.

The second is optimization. What addressing mode(s) are being used, are there data hazards that are slowing things, are simd instructions being used? Game and high performance compute companies still spend time pulling every cycle they can out of a routine.

It used to be you had to compile and then pull the executable into a debugger and examine the code. Now, there’s an online tool that can quickly do the same. Enter the Godbolt compiler explorer.

It allows you to type in C/C++ code, select from a whole host of compilers, enter custom compiler flags, then show you the generated output.

In the case above, I wanted to verify C/C++ short-circuit comparison behavior of a variable against NULL and then dereference in the same conditional. If the compare against NULL doesn’t execute and exit before the dereference, a NULL pointer exception/segfault will result. According to C/C++ rules, there should be an early out after the comparison against NULL – and sure enough – on line 8 and 9 we see the test and exit.

Anyway – it’s a neat online tool you might give a try to learn more about the assembly your C/C++ code turns into.

AI Enhanced Moon Landing

AI Enhanced Moon Landing

Historic footage from the Apollo Moon landings is not so great. The footage is often grainy, blurry, and in some cases (to conserve film) only 24, 12, 6, or even 1 frame per second.

A photo and film restoration specialist, who goes by the name of DutchSteamMachine, has worked some AI magic to enhance original Apollo film, creating strikingly clear and vivid video clips and images. Read more about the technique here.

Apollo 15’s landing site at Hadley Rille in 60 fps (originally 12 fps)

Apollo 11 First Steps on the moon in 24fps, originally filmed in 12fps.

Mandalorian filming

Mandalorian filming

How the Unreal game engine and a nearly 360 degree video wall has transformed how special effects are done. It’s a complete game changer because it solves almost all the problems relating to green screens and digital effects.