Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /branches/pure-cfg/src/include/Diderot/diderot.h
ViewVC logotype

Diff of /branches/pure-cfg/src/include/Diderot/diderot.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 588, Wed Mar 9 21:45:37 2011 UTC revision 601, Fri Mar 11 16:57:31 2011 UTC
# Line 14  Line 14 
14  #ifndef _DIDEROT_H_  #ifndef _DIDEROT_H_
15  #define _DIDEROT_H_  #define _DIDEROT_H_
16    
17    /* gcc has a bug that breaks code that uses 8-byte vectors (e.g., vec2f_t), but clang
18     * handles the code correctly.
19     */
20    #if defined(__clang__)
21    #  define VEC2_OK
22    #endif
23    
24  #ifdef NDEBUG  #ifdef NDEBUG
25  #define STATIC_INLINE   static inline  #define STATIC_INLINE   static inline
26  #else  #else
# Line 33  Line 40 
40    
41  /* SSE vector types */  /* SSE vector types */
42  typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__));  typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__));
43    #ifdef VEC2_OK
44  typedef float vec2f_t __attribute__ ((vector_size (8)));  typedef float vec2f_t __attribute__ ((vector_size (8)));
45    #else
46    typedef float vec2f_t __attribute__ ((vector_size (16)));  // pad so that gcc aligns correctly
47    #endif
48  typedef float vec4f_t __attribute__ ((vector_size (16)));  typedef float vec4f_t __attribute__ ((vector_size (16)));
49  typedef float vec8f_t __attribute__ ((vector_size (32)));  typedef float vec8f_t __attribute__ ((vector_size (32)));
50    
51    #ifdef VEC2_OK
52  typedef int32_t vec2i_t __attribute__ ((vector_size (8)));  typedef int32_t vec2i_t __attribute__ ((vector_size (8)));
53    #else
54    typedef int32_t vec2i_t __attribute__ ((vector_size (16)));  // pad so that gcc aligns correctly
55    #endif
56  typedef int32_t vec4i_t __attribute__ ((vector_size (16)));  typedef int32_t vec4i_t __attribute__ ((vector_size (16)));
57  typedef int32_t vec8i_t __attribute__ ((vector_size (32)));  typedef int32_t vec8i_t __attribute__ ((vector_size (32)));
58    
# Line 166  Line 181 
181    
182  STATIC_INLINE vec2f_t vec2f (float a, float b)  STATIC_INLINE vec2f_t vec2f (float a, float b)
183  {  {
184    #ifdef VEC2_OK
185      return __extension__ (vec2f_t){ a, b };      return __extension__ (vec2f_t){ a, b };
186    #else
187        return __extension__ (vec2f_t){ a, b, 0.0, 0.0 };
188    #endif
189  }  }
190    
191  STATIC_INLINE float dot2f (vec2f_t u, vec2f_t v)  STATIC_INLINE float dot2f (vec2f_t u, vec2f_t v)

Legend:
Removed from v.588  
changed lines
  Added in v.601

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0