#Godbolt

Michael Engelme_@sueden.social
2025-12-09

Another fascinating article by Matt #Godbolt in his Advent of Compiler Optimization series. This one is about induction variables and loops:

xania.org/202512/09-induction-

Here, Matt uses the llvm-mca tool to visualize the x86 Haswell CPU pipeline to show loop-carried dependencies.

If you want to see this for RISC-V (SiFive U74) for one of the given examples, try this link (llvm-mca -march=riscv64 -mcpu=sifive-u74 -timeline):

aoco.compiler-explorer.com/z/9

#compilers #optimization #risc_v #aoco2025

Luke T. Shumakerlukeshu@social.coop
2025-10-15

I can't use godbolt.org to confirm if the bug is still present in newer versions of GCC because I can't figure out how to see the `.ci` output file on godbolt.org. (Also, there's no "none-eabi" on godbolt.org, just "unknown-eabi" and "linux-gnueabihf"; the code won't compile with the GNU eabi, but I suspect that unknown-eabi will show the same behavior as none-eabi.)

#GCC #Godbolt

2025-07-03

Literally README says "Do not use me, i am a piece of shit that will not work everywhere", but they keeps using it, especialy #gitea and #godbolt
No, when i am on desktop, i will use qtcreator to edit code, not browser, so it is COMPLETELY STUPID

Q: Is the editor supported in mobile browsers or mobile web app frameworks?
A: No
2025-06-07

You don't realize just how good C++23 is until you take some old C++ code, paste it into #Godbolt, set the compiler flags to C++23, add a few concept-checking asserts, read the beautifully clear error messages from concepts, and fix your problem.

#ModernCPP #CPP #Concepts #Legacy #Evolution #Happyiness #Programming

N-gated Hacker Newsngate
2025-05-28

Matt bravely tackles the monumental challenge of creating that last forever—because we all desperately need browser tabs from 2012 🌐🔗. Turns out, cramming an entire compiler state into a URL just might not be the pinnacle of efficiency 🧐. But fear not, Google has come to the rescue, because who doesn't love outsourcing their problems to the tech overlords? 👾
xania.org/202505/compiler-expl

2025-05-23

[Перевод] Ускоряем работу видеодекодера на 1%

Какое-то время назад memorysafety.org объявил о конкурсе по повышению производительности rav1d — порта AV1-декодера dav1d на Rust. Моя фамилия Равид, совсем как название декодера, поэтому я решил, что будет забавно попробовать (хоть я и, вероятно , не смогу участвовать в конкурсе). Эта статья посвящена двум найденным мной небольшим улучшениям производительности ( первый PR , второй PR ) и рассказу о том, как я их нашёл.

habr.com/ru/articles/912136/

#оптимизация_кода #обработка_видео #декодер #dav1d #rav1d #godbolt

2025-04-26

Very interesting (and informing) video about x86_64 versus ARM architectures:

youtube.com/watch?v=Zr09I5OlOj

#CPU #ARM #Intel #x86_64 #GodBolt

2025-01-16

Need a clue pls. What's the trick to get #godbolt to target RISC-V for Rust? Just adding the `--target riscv32i-unknown-none-elf` compiler flag didn't work:
godbolt.org/z/1df9GqEPW

Clearly there's a way as rust.godbolt.org/noscript/z/Y8 (with the appropriated corrections) works.
#UICouldBeBetter

Joxean Koret (@matalaz)joxean
2025-01-13

Does anybody know how to prevent from issuing calls to libc functions like `memset` in this case when compiling C programs? I have tried I don't know how many command line arguments to try to disable it but none worked at all.

Here you have an example program in : godbolt.org/z/jheYoPWzj

These are the command line arguments I've tried to disable it:

-ffreestanding -disable-simplify-libcalls -fno-builtin -nostdinc -nostdlib -fno-builtin-memset -nostdlib++ -nostdinc++

Any idea?

2024-12-10

Couple years ago it was good and very useful tool.
Now it is glitchy sh#t...
Scripts only became working after es2022 smoothie re syntax was added to browser, after weakref (which MDN says avoid to use) was polyfilled...
And... it still cannot render correctly. What was improved in frontend in last 2 years??? It seems, nothing...
#frontend #front #godbolt #ce #compilerexplorer #js #libraries

2024-04-29

It's pretty bizarre that it's easier to just open godbolt and run code in a cloud somewhere wherever to test a snippet of code than to try running it locally. And that's while I actually have my go-to code editor open.

#cpp #CompilerExplorer #godbolt

2024-04-12

@simontoth Compiler exporer is a really nice tool! dont forget
dogbolt.org as well!

#dogbolt #godbolt

Mission Accomplished: local #godbolt #cpp #compiler #explorer #selfhosting complete. Some key takeaways:

- make kept timing out for me, even when I allocated 20 GB space and 8 cores to the VM.
- make dev just worked, even when I bumped memory back to 2 GB and 2 cores.

Considering this is not something I always need up and running - I'll probably spin up the server on demand, then bring it back down. Being able to play around with C++ in realtime is so much fun! I'm rusty, this helps a lot.

undefined

Plan to #selfhost #godbolt #cpp #compiler on a #container my #Proxmox machine.

I love interactive, iterative development for learning. Learning never stops. That's why I love #python, particularly #ipython - I can iterate quickly, test, fail, then succeed quickly when trying to learn stuff.

Known about godbolt.org for years, never thought of self hosting it before

Links:
- godbolt.org/ - the official site
- github.com/compiler-explorer/c - #github #sourcecode #repository

#OpenSource

Michael Engelme_@sueden.social
2024-02-13

Preparing the first lecture for our revamped Intro to Comp Arch and OS course...

Nifty, clang (rv64gc, -O1) manages to optimize all branches away in a "tolower" implementation:

tolower:
addiw a1, a0, -65
andi a1, a1, 255
sltiu a1, a1, 26
slli a1, a1, 5
addw a0, a0, a1
andi a0, a0, 255
ret

Thanks to Matt #Godbolt for his compiler explorer!

#riscv #assembly #optimization

Roger Ferrer Ibáñezrofirrim@mastodon.world
2024-02-10

You can now run flang executables on Compiler Explorer!

godbolt.org/z/4h1eWfaKd

#fortran #godbolt #compilers

2024-02-03

@jfmezei Usually, yes. But like most things in IT, details can vary.

VAX has a wad of CVT conversion instructions, among other wads of instructions including the vector extensions, for instance. VAX offers instructions for pretty much everything to everything (everything circa 1978) and either has an instruction, or maybe has a macro.

For VAX floating point details, see section 9.9 here:

docs.vmssoftware.com/docs/VAX_

Details here will vary by architecture, and often by implementation within architecture. (q.v. Alpha extensions including the byte-word extension, and Arm SBSA, etc.)

Here’s an Alpha intro, as Alpha was effectively VAX with most of the latent VAX limits removed (not the least of which were the condition codes):

cs.cmu.edu/afs/cs/academic/cla

Alpha too has a wad of CVT conversion instructions.

The wrinkle with C code can be the implicit conversions that can (necessarily) arise when mixing data types. I’m not entirely certain a compound if {} else {} and a ?: ternary will produce the same outcome for all possible variations, and I’ve been using C for... for a while.

<voice=buzzlightyear>And UB, UB everywhere.

C looks kinda like a weird PDP-11 in various ways.

If you want to view the instructions of recent architectures, visit godbolt.

godbolt.org

#retrocomputing #vax #DigitalEquipmentCorporation #digitalequipment #digitalequipmentcorp #history #computerarchitecture #pdp11 #c #godbolt

vitaut 🤍❤️🤍 🇺🇦vitaut
2024-01-13

For faster compile times use {fmt} trunk and include fmt/base.h on godbolt.org/z/KGfnsP9a5

2023-10-31

@AliveDevil This bit might be helpful:
en.cppreference.com/w/cpp/util

But interesting differences between GCC and clang, and the differences persist for any C++ version >= C++11. I haven't looked at why (traveling), but I hope the sample code helps. (Intentionally -O0)

Sorry, I don't have access to MSVC right now.

sigcpp.godbolt.org/z/ofh3E6zoo

#cpp #cPlusPlus #godbolt

Black text of white:

A std::initializer_list object is automatically constructed when:

a braced-init-list is used to list-initialize an object, where the corresponding constructor accepts an std::initializer_list parameter,

Client Info

Server: https://mastodon.social
Version: 2025.07
Repository: https://github.com/cyevgeniy/lmst