News for hackers. Stuff that matters.
Re:KolibriOS – operating system written entirely in assembly... by Someone on Wednesday April 15, 2020 @08:28AM (#22876901)
When using Clang org CC (possibly other compilers, too), you don’t need to use intrinsics. These compilers have some support for vector types (https://clang.llvm.org/docs/LanguageExtensions.html#vectors-..., https://gcc.gnu.org/onlinedocs/gcc/Vector-Extensions.html)

One can, for example, write:

  typedef int v4si __attribute__ ((vector_size (16)));

  v4si a, b, c;
  […]
  b += 3; // add 3 to each of b’s elements
  c = a + b; // pairwise addition
Using this gives up some control over assembly; it doesn’t guarantee vector instructions get used, but it makes it easier for the compiler to generate them.

Also, I’m fairly sure there are vector instructions not covered by this extension.

There are no comments on this comment yet.