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 544, Wed Feb 16 23:14:14 2011 UTC revision 545, Wed Feb 16 23:19:14 2011 UTC
# Line 24  Line 24 
24    
25  /* SSE vector types */  /* SSE vector types */
26  typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__));  typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__));
27  typedef float float4 __attribute__ ((__vector_size__ (16)));  typedef float vec2f __attribute__ ((vector_size (8)));
28  //typedef double double2 __attribute__ ((__vector_size__ (16)));  typedef float vec4f __attribute__ ((vector_size (16)));
29    typedef float vec8f __attribute__ ((vector_size (32)));
30  /* union types for converting extracting vector data */  
31  typedef union {  typedef float vec2d __attribute__ ((vector_size (16)));
32      float       f[4];  typedef float vec4d __attribute__ ((vector_size (32)));
33      float4      v;  typedef float vec8d __attribute__ ((vector_size (64)));
34  } f4union;  
35    typedef union { float r[2]; vec2f v; } union2f;
36  typedef union {  typedef union { float r[4]; vec4f v; } union4f;
37      double      d[2];  typedef union { float r[8]; vec8f v; } union8f;
38      double2     v;  
39  } d2union;  typedef union { double r[2]; vec2d v; } union2d;
40    typedef union { double r[4]; vec4d v; } union4d;
41    typedef union { double r[8]; vec8d v; } union8d;
42    
43    /* vector lengths must be power of 2, but vec3 is useful, so we pad to 4 */
44    typedef vec4f vec3f;
45    typedef vec4d vec3d;
46    
47  /* typedefs for Diderot types */  /* typedefs for Diderot types */
48  typedef int32_t Diderot_int_t;  typedef int32_t Diderot_int_t;
# Line 76  Line 82 
82  /* Diderot library functions */  /* Diderot library functions */
83    
84  /* load image data from Nrrd files */  /* load image data from Nrrd files */
85  extern Status_t Diderot_LoadImage1D (Diderot_string_t name, Diderot_image1D_t *img);  extern Status_t Diderot_LoadImage1D (Diderot_string_t name, Diderot_image1D_t **img);
86  extern Status_t Diderot_LoadImage2D (Diderot_string_t name, Diderot_image2D_t *img);  extern Status_t Diderot_LoadImage2D (Diderot_string_t name, Diderot_image2D_t **img);
87  extern Status_t Diderot_LoadImage3D (Diderot_string_t name, Diderot_image3D_t *img);  extern Status_t Diderot_LoadImage3D (Diderot_string_t name, Diderot_image3D_t **img);
88    
89  /* functions to get input-parameter values */  /* functions to get input-parameter values */
90  extern Status_t Diderot_InputString (const char *, const char **, bool);  extern Status_t Diderot_InputString (const char *, const char **, bool);
91  extern Status_t Diderot_InputReal (const char *, Diderot_real_t *, bool);  extern Status_t Diderot_InputReal (const char *, Diderot_real_t *, bool);
92  extern Status_t Diderot_InputVec3 (const char *, Diderot_vec3_t *v);  extern Status_t Diderot_InputVec3 (const char *, Diderot_vec3_t *, bool);
93    
94  /* inline vector arithmetic functions */  /* inline vector arithmetic functions */
95  STATIC_INLINE float4 Diderot_Vec3 (Diderot_real_t a, Diderot_real_t b, Diderot_real_t c)  STATIC_INLINE vec3d Diderot_Vec3 (Diderot_real_t a, Diderot_real_t b, Diderot_real_t c)
96  {  {
97      return __extension__ (float4){ a, b, c, 0.0f };      return __extension__ (vec4f){ a, b, c, 0.0f };
98  }  }
99    
100  STATIC_INLINE float4 Diderot_Vec4 (Diderot_real_t a, Diderot_real_t b, Diderot_real_t c, Diderot_real_t d)  STATIC_INLINE vec4f Diderot_Vec4 (Diderot_real_t a, Diderot_real_t b, Diderot_real_t c, Diderot_real_t d)
101  {  {
102      return __extension__ (float4){ a, b, c, d };      return __extension__ (vec4f){ a, b, c, d };
103  }  }
104    
105  STATIC_INLINE float4 Diderot_ScaleV3 (float4 dstV, Diderot_real_t s, float4 v)  STATIC_INLINE vec4f Diderot_ScaleV3 (vec4f dstV, Diderot_real_t s, vec4f v)
106  {  {
107      return Diderot_Vec3(s, s, s) * v;      return Diderot_Vec3(s, s, s) * v;
108  }  }
109    
 STATIC_INLINE float4 Diderot_AddV3 (float4 a, float4 b)  
 {  
     return a + b;  
 }  
   
 STATIC_INLINE float4 Diderot_SubV3 (float4 a, float4 b)  
 {  
     return a - b;  
 }  
   
 STATIC_INLINE float4 Diderot_MulV3 (float4 a, float4 b)  
 {  
     return a * b;  
 }  
   
110  // check if pos is inside the img, assuming that we have a border of width s.  // check if pos is inside the img, assuming that we have a border of width s.
111  //  //
112  STATIC_INLINE bool Diderot_Inside3D (Diderot_vec3_t pos, Diderot_image3D_t *img, int s)  STATIC_INLINE bool Diderot_Inside3D (Diderot_vec3_t pos, Diderot_image3D_t *img, int s)

Legend:
Removed from v.544  
changed lines
  Added in v.545

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