Intel® ISA Extensions
Use hardware-based isolation and memory encryption to provide more code protection in your solutions.

Pointer Arithmetic using Intel AVX2

Nicolai_B_
Beginner
200 Views

Hi,

is there an opportunity to operate on pointers in 256 bit AVX2 registers (e.g. incrementing, border check, masking operations) and load from pointer, stored in a vector register?

Thank you in advance!

Nicolai

0 Kudos
1 Solution
jimdempseyatthecove
Black Belt
200 Views

Yes. Download the Intel(R) Intrinsics Guid and the appropriate ISA guide. (you will have to search for the link)

AVX2 (and earlier) support integer 32 and 64 formats. You may have a minor issue in that the compare instructions are signed. But you can program around this.

Jim Dempsey

View solution in original post

2 Replies
jimdempseyatthecove
Black Belt
201 Views

Yes. Download the Intel(R) Intrinsics Guid and the appropriate ISA guide. (you will have to search for the link)

AVX2 (and earlier) support integer 32 and 64 formats. You may have a minor issue in that the compare instructions are signed. But you can program around this.

Jim Dempsey

andysem
New Contributor III
200 Views

You can operate on 32 and 64-bit integers in vector registers, and you can also use gather instructions which use vector registers as offsets relative to a pointer in a general purpose register. But you cannot use vector registers as pointers in instructions, and as such boundary checking extensions (i.e. MPX) do not apply. You have to move pointers between general purpose registers or memory and vector registers if you want to operate on them in vector fashion, and this adds a certain performance overhead. On the other hand, you can perform manual boundary checking on vector registers, so that could be beneficial.

 

Reply