- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, all. I'm new with intrinsics and your help would be very appreciated.
I want to vectorize some std::vectors processing and my question is, how can I add(or subtract) std::vector<uint8_t> and std::vector<uint32_t>?
Thanks in advance!
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The data types need to be of the same type. Also data access must be done using single stride for vectorization. These condition will not be met in your case.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks om-sachan.
The Auto-Vectorizer is able to vectorize this for loop, right?
std::vector<uint8_t> vec1; vec1.resize(8192); std::vector<uint32_t> vec2; vec2.resize(8192); for (int i = 0; i < 8192; i++) { vec2 += vec1; }
So I thought I could code it with intrinsics to start learning.
Thanks again om-sachan!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@maeshiro_mi
Run your code and inspect disassembly you should see vmovaps(d) and vaddps(d) instructions or their integer counterparts.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks iliyapolak.
I found very interesting checking assembly and converting it to intrinsics.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
maeshiro_mi wrote:
Thanks iliyapolak.
I found very interesting checking assembly and converting it to intrinsics.
I must admit that I am doing the same:)

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page