4 ms·
Yawn. Tell me when they standardize 2,3,and 4 element vector types so I don't need to use intrinsics.
by phkahler 11y ago
Yawn. Tell me when they standardize 2,3,and 4 element vector types so I don't need to use intrinsics.
- Animats 11y agoI once proposed a library for 2, 3 and 4 element vectors based on the one in Graphic Gems.[1] It was rejected because it didn't use templates. [1] http://www.animats.com/source/graphics/algebra3.h http://www.animats.com/source/graphics/algebra3.h
- phkahler 11y agoThe nice thing about the intrinsics is that they can be passed by value or as a return type. They map nicely to modern vector hardware. Anything done with templates is going to be very generic and will not have these characteristics. But let them continue adding abstractions with funky syntax instead of optimized versions of widely used constructs. ;-)
- Animats 11y agoThey're inlines, not intrinsics. Intrinsics would be built into the language. Not a bad idea for basic constructs such as short vectors of floating point numbers, which are very close to the hardware. I was writing a physics engine at the time, and it was a huge hassle that this wasn't standardized in C++. I used three libraries which each had their own definition of short vectors. Way too much conversion. Matlab has one notation for arrays and matrices. So all Matlib libraries are compatible at the array and matrix level. This is one reason that much number-crunching is done in Matlab. Rust already has at least three libraries for short vectors.
- Joky 11y agoI don't see why template-based types would be able to be passed by value or returned? An interesting library is Boost::SIMD (!! not part of Boost !!): https://github.com/NumScale/boost.simd https://github.com/NumScale/boost.simd