~bkerensa/ubuntu/raring/valgrind/merge-from-deb

« back to all changes in this revision

Viewing changes to helgrind/tests/tc11_XCHG.c

  • Committer: Benjamin Kerensa
  • Date: 2012-11-21 23:57:58 UTC
  • mfrom: (1.1.16)
  • Revision ID: bkerensa@ubuntu.com-20121121235758-bd1rv5uc5vzov2p6
Merge from debian unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
#undef PLAT_ppc64_linux
18
18
#undef PLAT_arm_linux
19
19
#undef PLAT_s390x_linux
 
20
#undef PLAT_mips32_linux
20
21
 
21
22
#if defined(__APPLE__) && defined(__i386__)
22
23
#  define PLAT_x86_darwin 1
34
35
#  define PLAT_arm_linux 1
35
36
#elif defined(__linux__) && defined(__s390x__)
36
37
#  define PLAT_s390x_linux 1
 
38
#elif defined(__linux__) && defined(__mips__)
 
39
#  define PLAT_mips32_linux 1
37
40
#endif
38
41
 
39
42
 
71
74
#  define XCHG_M_R_with_redundant_LOCK(_addr,_lval) \
72
75
      XCHG_M_R(_addr,_lval)
73
76
 
 
77
#elif defined(PLAT_mips32_linux) || defined(PLAT_mips64_linux)
 
78
#  define XCHG_M_R(_addr,_lval)                              \
 
79
     __asm__ __volatile__(                                   \
 
80
        "move $12, %2\n"                                     \
 
81
        "move $13, %1\n"                                     \
 
82
        "ll $14, 0($13)\n"                                   \
 
83
        "sc $12, 0($13)\n"                                   \
 
84
        "move %0, $14\n"                                     \
 
85
        : /*out*/ "=r"(_lval)                                \
 
86
        : /*in*/  "r"(&_addr), "r"(_lval)                    \
 
87
        : "$12", "$13", "$14", "memory", "cc"                \
 
88
     )
 
89
 
 
90
#  define XCHG_M_R_with_redundant_LOCK(_addr,_lval) \
 
91
      XCHG_M_R(_addr,_lval)
 
92
 
74
93
#elif defined(PLAT_ppc32_linux) || defined(PLAT_ppc64_linux) \
75
94
      || defined(PLAT_arm_linux)
76
95
#  if defined(HAVE_BUILTIN_ATOMIC)