Forum > General

SIMD Intrinsics in FPC/Lazarus

(1/3) > >>

ChrisR:
 Single instruction, multiple data (SIMD) can dramatically accelerate some computations. C programmers can use intrinsics to write SSE/AVX (for x86-64) and Neon (for ARM) SIMD, which is more familiar to many relative to assembly language. However, FPC does not yet provide intrinsics. I created a repository that demonstrates writing intrinsics in C and inserting the resulting objects into FPC code. I demonstrate this on both ARM and x86-64 CPUs. I also show how the C SSE2Neon library allows you to write your SIMD code once in SSE and then compile the resulting code for either x86-64 or ARM

https://github.com/neurolabusc/FPCintrinsics

While I would prefer native FPC intrinsics, in truth only a tiny fraction of time critical code really benefits from SIMD. This kludge can provide a convenient way to optimize that critical code.

marcov:

--- Quote from: ChrisR on May 09, 2021, 08:02:58 pm --- However, FPC does not yet provide intrinsics. 

--- End quote ---

Check rtl/i386/cpummprocs.inc (and rtl/x86_64) in trunk

PascalDragon:

--- Quote from: ChrisR on May 09, 2021, 08:02:58 pm ---While I would prefer native FPC intrinsics, in truth only a tiny fraction of time critical code really benefits from SIMD. This kludge can provide a convenient way to optimize that critical code.

--- End quote ---

SIMD intrinsics are a work-in-progress.


--- Quote from: marcov on May 09, 2021, 10:21:33 pm ---
--- Quote from: ChrisR on May 09, 2021, 08:02:58 pm --- However, FPC does not yet provide intrinsics. 

--- End quote ---

Check rtl/i386/cpummprocs.inc (and rtl/x86_64) in trunk

--- End quote ---

They are not yet enabled.

Laksen:
I have a branch somewhere with a lot of fixes to the Intrinsics, enough to where they seem to work consistently. I'll see if I can clean it up soon

ChrisR:
Laksen, this sounds terrific! I look forward to native FPC intrinsics.

Navigation

[0] Message Index

[#] Next page

Go to full version