The first part of std::simd just landed in #GCC 16: https://forge.sourceware.org/gcc/gcc-mirror/commit/8be0893fd98c9a89bbcd81e0ff8ebae60841d062
Expect it on Compiler Explorer in — I guess — 12 hours.
Matthias Kretz | Vir
mastodon 4.7.3🧔🏻♂️👩🏽 👦🏻👧🏻👧🏻, C++ committee numerics chair, std::simd / SIMD specialist, CS PhD, Dipl.-Phys, nuclear physics, former KDE core developer, FLOSS user & supporter, anti fascist, 🏋️♂️, 🏊♂️🚴♂️🏃♂️
Profile picture: me on my Aeroad racing in a triathlon
Header picture: @mkretz@floss.social
#SIMD #stdsimd #WG21 #Cpp #GCC #KDE #roadcycling #running #triathlon #Darmstadt #DSW12triathlon
Clang is trolling me: "error: call to consteval function […] is not a constant expression"
New blog post "Introduction to std::simd in C++26 (Part 1)": https://mattkretz.github.io/2026/05/21/intro-to-std-simd-part-1.html
It's been more than 10 years that I've been at CERN. A lot has changed. But I also recognize a lot, still.
RE: @danielskatz@fediscience.org
🎉 Seems like my #stdsimd work will finally be easier to recognize as research output.
I've been looking into matrix multiplication using std::simd and std::mdspan/submdspan (all single-threaded).
I got to 86% of peak FLOP. x86_64 AVX2 has 32/16 FLOP/cycle peak (2 FMAs per cycle).
I suspect better performance needs a more cache-friendly layout mapping. This is using layout_right.
The #GCC16 branch has been created. A #GCC 16.1 release is imminent. I already adjusted my https://github.com/mattkretz/cplusplus-ci GCC CI images accordingly. If it builds, you can then get gcc-17 images, too.
I'm a bit sad today. Yesterday I pushed https://forge.sourceware.org/gcc/gcc-mirror/commit/804bde962de4819138951aed24b2c8ba768d7344, which makes a simple `x + 1` ill-formed: https://compiler-explorer.com/z/4rYx87fcW. Now, in generic code, you write `+ std::cw<1>` instead. If you know the value-type (`float` in this case), just use the appropriate literal (if it exists): `x + 1.f`.
On my way back from #WG21 in Croydon/London. #cpp26 is done. Notable change that I got through: You don't have to wonder anymore what difference there is between `constant_arg` and `constant_wrapper`. Only the latter remains. And `constant_wrapper` now works as a function-wrapper, too (passing a callable as constant expression via function argument).
And—somewhat sad—but `simd::vec(...) * 2` won't compile anymore. I'll have to update GCC16 accordingly.
I wrote a blog post "My vision for an interdisciplinary RSE institute: how to actually help scientists": https://mattkretz.github.io/2026/04/28/vision-rse-institute.html after learning about @futursi@mas.to
I'm happy to learn what others think about the topic!
@mhoemmen@c.im mdspan feature request 😉:
Allow mdspan::operator[] with one argument less than rank.
Mandates/Constraints: The resulting range is contiguous in memory.
Returns: A span (of static extent, if possible).
Then I can use std::simd CTAD from range:
simd::basic_vec(B[k], simd::flag_aligned);
instead of:
simd::unchecked_load>(&B[k, 0], &B[k, N-1], simd::flag_aligned);
The former is not only simpler but also safer.
@JSAMcFarlane@mastodon.ie Oh wow, I was not aware of your P0827! I agree on the usefulness of having a UDL for std::cw for even terser syntax. However, the obvious suffix cw is going to be a hard sell because of hex literals. (It just needs an additional w literal and a smart parser that drops the final c 🙈)