News for hackers. Stuff that matters.
Re:All C++20 core language features with examples by aidenn0 on Wednesday April 07, 2021 @07:54PM (#26733186)
That's quite well thought out; without the compile-time checks for operations existing, you end up with code either needing to target a very small subset of the operations that are widely supported or something that is not really cross-platform -- I've seen too much of the following using what is theoretically portable code because software-fallback will typically be an order of magnitude worse than using a different set of datatypes and operators

  #if defined(__NEON__)
  "portable" SIMD goes here
  #elif defined(__ALTIVEC__)
  different "portable" SIMD goes here
  ...
Re:All C++20 core language features with examples by WalterBright on Wednesday April 07, 2021 @08:06PM (#26733282)
There was some discussion about what to do with vector types and operations that weren't supported by the hardware. We decided on compiler error instead of emulation, because the emulation would be terribly slow and the user may be unaware that he's getting emulation.

With a compiler error, the user unambiguously knows if the SIMD hardware is being used or not.

Re:All C++20 core language features with examples by nicwilson on Wednesday April 07, 2021 @08:31PM (#26733520)
> We decided on compiler error instead of emulation

DMD does that, LDC (based on LLVM) does the sensible thing and vectorises with the widest available native SIMD. No idea what GDC (based on GCC) does.

Re:All C++20 core language features with examples by mhh__ on Wednesday April 07, 2021 @11:17PM (#26734730)