tlds
Transactional Operations for Linked Data Structures
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
icc-sync.hpp File Reference
#include <cstddef>
#include <stdint.h>
Include dependency graph for icc-sync.hpp:

Go to the source code of this file.

Classes

struct  stm::iccsync::SYNC< T, W, N >
 
struct  stm::iccsync::SYNC< T, W, 1 >
 
struct  stm::iccsync::SYNC< T, W, 2 >
 
struct  stm::iccsync::SYNC< T, W, 4 >
 
struct  stm::iccsync::SYNC< T, 4, 8 >
 
struct  stm::iccsync::SYNC< T, 8, 8 >
 
struct  stm::iccsync::SYNC< T, 8, 16 >
 
struct  stm::iccsync::CAS_ADAPTER< T, S, D >
 
struct  stm::iccsync::CAS_ADAPTER< T, T, 1 >
 
struct  stm::iccsync::CAS_ADAPTER< T, S, 0 >
 
struct  stm::iccsync::SWAP_ADAPTER< T, S, D >
 
struct  stm::iccsync::SWAP_ADAPTER< T, T, 1 >
 
struct  stm::iccsync::SWAP_ADAPTER< T, S, 1 >
 
struct  stm::iccsync::SWAP_ADAPTER< T, S, 0 >
 

Namespaces

 stm
 
 stm::iccsync
 

Macros

#define __sync_synchronize()   asm volatile("mfence":::"memory")
 
#define __sync_bool_compare_and_swap(p, f, t)   stm::iccsync::bool_compare_and_swap(p, f, t)
 
#define __sync_val_compare_and_swap(p, f, t)   stm::iccsync::val_compare_and_swap(p, f, t)
 
#define __sync_lock_test_and_set(p, v)   stm::iccsync::lock_test_and_set(p, v)
 
#define __sync_fetch_and_add(p, a)   stm::iccsync::fetch_and_add(p, a)
 

Functions

template<typename T , typename S >
stm::iccsync::lock_test_and_set (volatile T *address, S value)
 
template<typename T , typename S >
bool stm::iccsync::bool_compare_and_swap (volatile T *address, S from, S to)
 
template<typename T , typename S >
stm::iccsync::val_compare_and_swap (volatile T *address, S from, S to)
 
template<typename T , typename S >
stm::iccsync::fetch_and_add (volatile T *address, S value)
 

Macro Definition Documentation

#define __sync_bool_compare_and_swap (   p,
  f,
 
)    stm::iccsync::bool_compare_and_swap(p, f, t)
#define __sync_fetch_and_add (   p,
 
)    stm::iccsync::fetch_and_add(p, a)
#define __sync_lock_test_and_set (   p,
 
)    stm::iccsync::lock_test_and_set(p, v)
#define __sync_synchronize ( )    asm volatile("mfence":::"memory")

Copyright (C) 2011 University of Rochester Department of Computer Science and Lehigh University Department of Computer Science and Engineering

License: Modified BSD Please see the file LICENSE.RSTM for licensing information The icc stm compiler is based on ICC 11.0, which has fake support for __sync builtins. It knows what they are, and emits __sync_..._N symbols for them, but does not implement them, even when given a -march=i686 or greater.

http://origin-software.intel.com/en-us/forums/showthread.php?t=71183

The version 4 compiler that we used is still based on 11.0 (610), and has the same limitation. We provide our own support in this file. We're going to do some basic metaprogramming to emulate the interface that we expect from the __sync builtins, i.e., if there is a correct __sync for the type, then we'll use it. Ultimately, what this file provides is a set of 5 macros that look, feel, and smell just like the __sync builtins. Here are the macros, the implementations follow.

#define __sync_val_compare_and_swap (   p,
  f,
 
)    stm::iccsync::val_compare_and_swap(p, f, t)