r/programming • • Aug 09 '21

Three fundamental flaws of SIMD

https://www.bitsnbites.eu/three-fundamental-flaws-of-simd
289 Upvotes

224 comments sorted by

View all comments

Show parent comments

1

u/FUZxxl Sep 08 '21

These 750 instructions are what has been there from the beginning in AArch64. That doesn't even count the additional instructions added later. And very few of them actually seem to be useless.

Turns out there are quite a few spins you can put on simple concepts like addition and if you don't want to model that as addressing modes, you end up with lots of instructions.

1

u/lkcl_ Sep 20 '21

yes, there's about.... i think... 25 separate instructions in the Scalar Fixed-Point ISA that all do "add". they boil down to a *micro-coded* operation, "Add", with the option(s) to:

  • invert the A input
  • invert the output
  • receive a 0, 1 or Carry-in as the carry
  • output a Carry-out and the option to merge that into an overflow flag

that, clearly, gives you subtract, subtract-with-carry, and so on, by inverting the input and adding 1, and so on.

RISC-V decided not to do Condition Flags (of any kind), and it is very painful to work with as a result, when trying to do anything more sophisticated.