Single instruction multiple data

 The single instruction multiple data (SIMD) CPU features have revolutionized the way operations are performed in our CPUs. Using processor-specific features, we can now run the same operation with multiple inputs simultaneously. Let's suppose that we need to add four numbers in pairs. We could first add the first two and then the second two, and get the two results. SIMD allows us to compute both results at the same time, by applying that adding operation to both pairs at the same time.

This requires assembly, though, and even though LLVM does the best job it can to use as much SIMD as possible, it's sometimes not enough for some high-performance applications. We could use inline assembly, of course, but it's not rare to mess things up when using assembly, and you will need to rewrite it for each target, so a SIMD specific frontend is being developed.

The API is still a work in progress, but check the simd feature to get a grasp on how it will be done. It seems, for now, that an external crate will be developed with all the intrinsics. You will be able to generate groups of data and apply simultaneous operations to every element in supporting processors.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.21.46.92