aboutsummaryrefslogtreecommitdiffstats
path: root/peakval.c
diff options
context:
space:
mode:
Diffstat (limited to 'peakval.c')
-rw-r--r--peakval.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/peakval.c b/peakval.c
new file mode 100644
index 0000000..811a3a9
--- /dev/null
+++ b/peakval.c
@@ -0,0 +1,39 @@
+/* Switch to appropriate version of peakval routine
+ * Copyright 2004, Phil Karn, KA9Q
+ */
+
+#include <stdlib.h>
+#include "fec.h"
+
+int peakval_port(signed short *b,int cnt);
+#ifdef __i386__
+int peakval_mmx(signed short *b,int cnt);
+int peakval_sse(signed short *b,int cnt);
+int peakval_sse2(signed short *b,int cnt);
+#endif
+
+#ifdef __VEC__
+int peakval_av(signed short *b,int cnt);
+#endif
+
+int peakval(signed short *b,int cnt){
+ find_cpu_mode();
+
+ switch(Cpu_mode){
+ case PORT:
+ default:
+ return peakval_port(b,cnt);
+#ifdef __i386__
+ case MMX:
+ return peakval_mmx(b,cnt);
+ case SSE:
+ return peakval_sse(b,cnt);
+ case SSE2:
+ return peakval_sse2(b,cnt);
+#endif
+#ifdef __VEC__
+ case ALTIVEC:
+ return peakval_av(b,cnt);
+#endif
+ }
+}