~ubuntu-branches/ubuntu/quantal/libgc/quantal

« back to all changes in this revision

Viewing changes to libatomic_ops-1.2/src/atomic_ops/sysdeps/standard_ao_double_t.h

  • Committer: Bazaar Package Importer
  • Author(s): Christoph Egger
  • Date: 2011-02-19 12:19:56 UTC
  • mfrom: (1.3.2 upstream) (0.1.5 experimental)
  • mto: This revision was merged to the branch mainline in revision 14.
  • Revision ID: james.westby@ubuntu.com-20110219121956-67rb69xlt5nud3v2
Tags: 1:7.1-5
Upload to unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* NEC LE-IT: For 64Bit OS we extend the double type to hold two int64's
 
2
*       
 
3
*  x86-64: __m128 serves as placeholder which also requires the compiler
 
4
*          to align     it on 16 byte boundary (as required by cmpxchg16.
 
5
* Similar things could be done for PowerPC 64bit using a VMX data type...       */
 
6
 
 
7
#if defined(__GNUC__)
 
8
# if defined(__x86_64__)
 
9
# include<xmmintrin.h>
 
10
   typedef __m128 double_ptr_storage;
 
11
#  define AO_HAVE_DOUBLE_PTR_STORAGE
 
12
# endif /* __x86_64__ */
 
13
#endif
 
14
 
 
15
#ifdef _MSC_VER
 
16
# ifdef _WIN64
 
17
   typedef __m128 double_ptr_storage;
 
18
#  define AO_HAVE_DOUBLE_PTR_STORAGE
 
19
# elif _WIN32
 
20
   typedef unsigned __int64 double_ptr_storage;
 
21
#  define AO_HAVE_DOUBLE_PTR_STORAGE
 
22
# endif
 
23
#endif
 
24
 
 
25
#ifndef AO_HAVE_DOUBLE_PTR_STORAGE
 
26
   typedef unsigned long long double_ptr_storage;
 
27
#endif
 
28
 
 
29
typedef union {
 
30
    double_ptr_storage AO_whole;
 
31
    struct {AO_t AO_v1; AO_t AO_v2;} AO_parts;
 
32
} AO_double_t;
 
33
 
 
34
#define AO_HAVE_double_t
 
35
#define AO_val1 AO_parts.AO_v1
 
36
#define AO_val2 AO_parts.AO_v2