/[svn]/linuxsampler/trunk/src/common/RTMath.h
ViewVC logotype

Diff of /linuxsampler/trunk/src/common/RTMath.h

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

revision 684 by schoenebeck, Wed Jun 8 21:00:06 2005 UTC revision 685 by persson, Tue Jul 5 19:30:37 2005 UTC
# Line 95  class __RTMath : public RTMathBase { Line 95  class __RTMath : public RTMathBase {
95          // conversion using truncate          // conversion using truncate
96          inline static int Int(const float a) {          inline static int Int(const float a) {
97              switch (IMPL) {              switch (IMPL) {
                 case CPP: {  
                     return (int) a;  
                 }  
98                  #if CONFIG_ASM && ARCH_X86                  #if CONFIG_ASM && ARCH_X86
99                  case ASM_X86_MMX_SSE: {                  case ASM_X86_MMX_SSE: {
100                      int ret;                      int ret;
# Line 109  class __RTMath : public RTMathBase { Line 106  class __RTMath : public RTMathBase {
106                      return ret;                      return ret;
107                  }                  }
108                  #endif // CONFIG_ASM && ARCH_X86                  #endif // CONFIG_ASM && ARCH_X86
109                    default: {
110                        return (int) a;
111                    }
112              }              }
113          }          }
114    
# Line 119  class __RTMath : public RTMathBase { Line 119  class __RTMath : public RTMathBase {
119    
120          inline static float Float(const int a) {          inline static float Float(const int a) {
121              switch (IMPL) {              switch (IMPL) {
                 case CPP: {  
                     return (float) a;  
                 }  
122                  #if CONFIG_ASM && ARCH_X86                  #if CONFIG_ASM && ARCH_X86
123                  case ASM_X86_MMX_SSE: {                  case ASM_X86_MMX_SSE: {
124                      float ret;                      float ret;
# Line 134  class __RTMath : public RTMathBase { Line 131  class __RTMath : public RTMathBase {
131                      return ret;                      return ret;
132                  }                  }
133                  #endif // CONFIG_ASM && ARCH_X86                  #endif // CONFIG_ASM && ARCH_X86
134                    default: {
135                        return (float) a;
136                    }
137              }              }
138          }          }
139    
# Line 146  class __RTMath : public RTMathBase { Line 146  class __RTMath : public RTMathBase {
146    
147          inline static float Sum(const float& a, const float& b) {          inline static float Sum(const float& a, const float& b) {
148              switch (IMPL) {              switch (IMPL) {
                 case CPP: {  
                     return (a + b);  
                 }  
149                  #if CONFIG_ASM && ARCH_X86                  #if CONFIG_ASM && ARCH_X86
150                  case ASM_X86_MMX_SSE: {                  case ASM_X86_MMX_SSE: {
151                      float ret;                      float ret;
# Line 162  class __RTMath : public RTMathBase { Line 159  class __RTMath : public RTMathBase {
159                      return ret;                      return ret;
160                  }                  }
161                  #endif // CONFIG_ASM && ARCH_X86                  #endif // CONFIG_ASM && ARCH_X86
162                    default: {
163                        return (a + b);
164                    }
165              }              }
166          }          }
167    
# Line 171  class __RTMath : public RTMathBase { Line 171  class __RTMath : public RTMathBase {
171    
172          inline static float Sub(const float& a, const float& b) {          inline static float Sub(const float& a, const float& b) {
173              switch (IMPL) {              switch (IMPL) {
                 case CPP: {  
                     return (a - b);  
                 }  
174                  #if CONFIG_ASM && ARCH_X86                  #if CONFIG_ASM && ARCH_X86
175                  case ASM_X86_MMX_SSE: {                  case ASM_X86_MMX_SSE: {
176                      float ret;                      float ret;
# Line 187  class __RTMath : public RTMathBase { Line 184  class __RTMath : public RTMathBase {
184                      return ret;                      return ret;
185                  }                  }
186                  #endif // CONFIG_ASM && ARCH_X86                  #endif // CONFIG_ASM && ARCH_X86
187                    default: {
188                        return (a - b);
189                    }
190              }              }
191          }          }
192    
# Line 196  class __RTMath : public RTMathBase { Line 196  class __RTMath : public RTMathBase {
196    
197          inline static float Mul(const float a, const float b) {          inline static float Mul(const float a, const float b) {
198              switch (IMPL) {              switch (IMPL) {
                 case CPP: {  
                     return (a * b);  
                 }  
199                  #if CONFIG_ASM && ARCH_X86                  #if CONFIG_ASM && ARCH_X86
200                  case ASM_X86_MMX_SSE: {                  case ASM_X86_MMX_SSE: {
201                      float ret;                      float ret;
# Line 212  class __RTMath : public RTMathBase { Line 209  class __RTMath : public RTMathBase {
209                      return ret;                      return ret;
210                  }                  }
211                  #endif // CONFIG_ASM && ARCH_X86                  #endif // CONFIG_ASM && ARCH_X86
212                    default: {
213                        return (a * b);
214                    }
215              }              }
216          }          }
217    
# Line 221  class __RTMath : public RTMathBase { Line 221  class __RTMath : public RTMathBase {
221    
222          inline static float Div(const float a, const float b) {          inline static float Div(const float a, const float b) {
223              switch (IMPL) {              switch (IMPL) {
                 case CPP: {  
                     return (a / b);  
                 }  
224                  #if CONFIG_ASM && ARCH_X86                  #if CONFIG_ASM && ARCH_X86
225                  case ASM_X86_MMX_SSE: {                  case ASM_X86_MMX_SSE: {
226                      float ret;                      float ret;
# Line 237  class __RTMath : public RTMathBase { Line 234  class __RTMath : public RTMathBase {
234                      return ret;                      return ret;
235                  }                  }
236                  #endif // CONFIG_ASM && ARCH_X86                  #endif // CONFIG_ASM && ARCH_X86
237                    default: {
238                        return (a / b);
239                    }
240              }              }
241          }          }
242    
# Line 246  class __RTMath : public RTMathBase { Line 246  class __RTMath : public RTMathBase {
246    
247          inline static float Min(const float a, const float b) {          inline static float Min(const float a, const float b) {
248              switch (IMPL) {              switch (IMPL) {
                 case CPP: {  
                     return (b < a) ? b : a;  
                 }  
249                  #if CONFIG_ASM && ARCH_X86                  #if CONFIG_ASM && ARCH_X86
250                  case ASM_X86_MMX_SSE: {                  case ASM_X86_MMX_SSE: {
251                      float ret;                      float ret;
# Line 262  class __RTMath : public RTMathBase { Line 259  class __RTMath : public RTMathBase {
259                      return ret;                      return ret;
260                  }                  }
261                  #endif // CONFIG_ASM && ARCH_X86                  #endif // CONFIG_ASM && ARCH_X86
262                    default: {
263                        return (b < a) ? b : a;
264                    }
265              }              }
266          }          }
267    
# Line 271  class __RTMath : public RTMathBase { Line 271  class __RTMath : public RTMathBase {
271    
272          inline static float Max(const float a, const float b) {          inline static float Max(const float a, const float b) {
273              switch (IMPL) {              switch (IMPL) {
                 case CPP: {  
                     return (b > a) ? b : a;  
                 }  
274                  #if CONFIG_ASM && ARCH_X86                  #if CONFIG_ASM && ARCH_X86
275                  case ASM_X86_MMX_SSE: {                  case ASM_X86_MMX_SSE: {
276                      float ret;                      float ret;
# Line 287  class __RTMath : public RTMathBase { Line 284  class __RTMath : public RTMathBase {
284                      return ret;                      return ret;
285                  }                  }
286                  #endif // CONFIG_ASM && ARCH_X86                  #endif // CONFIG_ASM && ARCH_X86
287                    default: {
288                        return (b > a) ? b : a;
289                    }
290              }              }
291          }          }
292    
# Line 296  class __RTMath : public RTMathBase { Line 296  class __RTMath : public RTMathBase {
296    
297          inline static float Fmodf(const float &a, const float &b) {          inline static float Fmodf(const float &a, const float &b) {
298              switch (IMPL) {              switch (IMPL) {
                 case CPP: {  
                     return fmodf(a, b);  
                 }  
299                  #if CONFIG_ASM && ARCH_X86                  #if CONFIG_ASM && ARCH_X86
300                  case ASM_X86_MMX_SSE: {                  case ASM_X86_MMX_SSE: {
301                      float ret;                      float ret;
# Line 319  class __RTMath : public RTMathBase { Line 316  class __RTMath : public RTMathBase {
316                      return ret;                      return ret;
317                  }                  }
318                  #endif // CONFIG_ASM && ARCH_X86                  #endif // CONFIG_ASM && ARCH_X86
319                    default: {
320                        return fmodf(a, b);
321                    }
322              }              }
323          }          }
324  };  };

Legend:
Removed from v.684  
changed lines
  Added in v.685

  ViewVC Help
Powered by ViewVC