]> git.gag.com Git - debian/gnuradio/commitdiff
added cpuid for sse3,ssse3,sse4.1, and sse4.2
authorjcoy <jcoy@221aa14e-8319-0410-a670-987f0aec2ac5>
Wed, 6 Aug 2008 00:15:23 +0000 (00:15 +0000)
committerjcoy <jcoy@221aa14e-8319-0410-a670-987f0aec2ac5>
Wed, 6 Aug 2008 00:15:23 +0000 (00:15 +0000)
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@9176 221aa14e-8319-0410-a670-987f0aec2ac5

gnuradio-core/src/lib/filter/gr_cpu.cc
gnuradio-core/src/lib/filter/gr_cpu.h

index 6fe3591cda48c5d7d0117bd2068c8e8a78a2a03b..517c10e9ad5a05458c798f0593c696fb20cab90e 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2002 Free Software Foundation, Inc.
+ * Copyright 2002,2008 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -84,6 +84,35 @@ gr_cpu::has_sse2 ()
   return (edx & (1 << 26)) != 0;
 }
 
+bool
+gr_cpu::has_sse3 ()
+{
+  unsigned int ecx = cpuid_ecx (1);    // standard features
+  return (ecx & (1 << 0)) != 0;
+}
+
+bool
+gr_cpu::has_ssse3 ()
+{
+  unsigned int ecx = cpuid_ecx (1);    // standard features
+  return (ecx & (1 << 9)) != 0;
+}
+
+bool
+gr_cpu::has_sse4_1 ()
+{
+  unsigned int ecx = cpuid_ecx (1);    // standard features
+  return (ecx & (1 << 19)) != 0;
+}
+
+bool
+gr_cpu::has_sse4_2 ()
+{
+  unsigned int ecx = cpuid_ecx (1);    // standard features
+  return (ecx & (1 << 20)) != 0;
+}
+
+
 bool
 gr_cpu::has_3dnow ()
 {
index 2d42eb610826bb0525e1fbb8ca7f3b446b3cdb66..5967d986857f3387cc72e7f81f65b6f9667941ca 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2002 Free Software Foundation, Inc.
+ * Copyright 2002,2008 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -27,6 +27,10 @@ struct gr_cpu {
   static bool has_mmx ();
   static bool has_sse ();
   static bool has_sse2 ();
+  static bool has_sse3 ();
+  static bool has_ssse3 ();
+  static bool has_sse4_1 ();
+  static bool has_sse4_2 ();
   static bool has_3dnow ();
   static bool has_3dnowext ();
 };