Recent

Author Topic: State of SIMD Intrinsics  (Read 1253 times)

Okoba

  • Hero Member
  • *****
  • Posts: 573
State of SIMD Intrinsics
« on: October 21, 2024, 03:24:08 pm »
I can see discussions about this from years ago, but is there a place or issue to follow?
It would be nice to have them instead of hand written assembly.

carl_caulkett

  • Hero Member
  • *****
  • Posts: 649
Re: State of SIMD Intrinsics
« Reply #1 on: October 21, 2024, 05:39:37 pm »
If you want to get connected to a user community who are actively using SIMD related software, you could check out the Mojo programming language. The parent company Modular has a very active Discord server at https://discord.gg/x2xdThTr.
"It builds... ship it!"

Thaddy

  • Hero Member
  • *****
  • Posts: 16408
  • Censorship about opinions does not belong here.
Re: State of SIMD Intrinsics
« Reply #2 on: October 21, 2024, 06:06:38 pm »
I can see discussions about this from years ago, but is there a place or issue to follow?
It would be nice to have them instead of hand written assembly.
Not really, apart from fpc-devel, but why would you? When specified, the compiler will use simd instructions for many years, since the mmx days.
But you need to know the correct compiler setup for your project.
You can check the assembler to see that it really uses the simd instructions you specified, also on plain pascal code.
Can be more efficient, sometimes, but the compiler does a dccent job.
« Last Edit: October 21, 2024, 06:18:11 pm by Thaddy »
There is nothing wrong with being blunt. At a minimum it is also honest.

Laksen

  • Hero Member
  • *****
  • Posts: 787
    • J-Software
Re: State of SIMD Intrinsics
« Reply #3 on: October 21, 2024, 06:17:54 pm »
To my knowledge not much has happened in FPC in the last 5 years. Around that time previously there were some discussions about how to do it meaningfully.

There were discussions about the shape of API's and naming considerations. Should it follow the C style convention or make it more pascal like? Etc
There were some bugs still in how the codegenerator handled SIMD registers, not super problematic ones. There were issues with passing this as arguments to functions.

Some code was merged back then (rtl/x86_64/cpummprocs.inc as an example of the API) but it was never enabled due to the above questions and discussions that were never finalized.
And of course for good reason. It's a huge API surface that is only ever growing each year


If SIMD has to be supported today maybe it would make sense to look towards the way it has been added to C# in recent years. It is quite elegant and well thought-out

Thaddy

  • Hero Member
  • *****
  • Posts: 16408
  • Censorship about opinions does not belong here.
Re: State of SIMD Intrinsics
« Reply #4 on: October 21, 2024, 06:20:17 pm »
To my knowledge not much has happened in FPC in the last 5 years.
To the contrary, quite a lot has demonstrably happened. These are the silent little commits by Florian and tend to disappear under the radar unless you actually follow the commits. Also Kit has done a lot in that field and some others. All recent, very recent.
If you mean C++ style macro intrinsics, then you are right, but the use of simd instructions (any generation ) is covered in the compiler.
« Last Edit: October 21, 2024, 06:26:40 pm by Thaddy »
There is nothing wrong with being blunt. At a minimum it is also honest.

Okoba

  • Hero Member
  • *****
  • Posts: 573
Re: State of SIMD Intrinsics
« Reply #5 on: October 22, 2024, 10:12:03 am »
Thaddy compiler automatic use of SIMD is great but I am sure you know there is places that can benefit from hand written assembly and these days, it is much more useful when you use SIMD if possible.

Okoba

  • Hero Member
  • *****
  • Posts: 573
Re: State of SIMD Intrinsics
« Reply #6 on: October 27, 2024, 03:43:57 pm »

 

TinyPortal © 2005-2018