Software Archive
Read-only legacy content
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
17060 Discussions

Is it possible to vectorize atomic operation on MIC?

Yuan_Y_
Beginner
619 Views

Hi all,

I use gcc built-in function such as __sync_fetch_and_add in my program for atomic operations. Is it posibble to vectorize these atomic operations?

Thanks.

0 Kudos
1 Reply
jimdempseyatthecove
Honored Contributor III
619 Views

__sync_fetch_and_add uses:

LOCK; XADD regValue, [location]

LOCK prefix is not supported for PADDB/PADDW/PADD
Additionally, the destination must be an XMM register.

You could use a CMPXCHG16B (or CMPXCHG8B) as a DCAS. This will get you partway to where you want to go.

Jim Dempsey

0 Kudos
Reply