summaryrefslogtreecommitdiff
path: root/gnuradio-core/src/lib
diff options
context:
space:
mode:
authorjcoy <jcoy@221aa14e-8319-0410-a670-987f0aec2ac5>2008-08-06 00:15:23 +0000
committerjcoy <jcoy@221aa14e-8319-0410-a670-987f0aec2ac5>2008-08-06 00:15:23 +0000
commit7de54eabe4405115d51fdf52905f794b5131ca10 (patch)
tree6615dfb002cec92a5b941457074b0c60019346ec /gnuradio-core/src/lib
parent955cb47cb9b6c07dbbb54ab14c16dd8e297e567d (diff)
added cpuid for sse3,ssse3,sse4.1, and sse4.2
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@9176 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gnuradio-core/src/lib')
-rw-r--r--gnuradio-core/src/lib/filter/gr_cpu.cc31
-rw-r--r--gnuradio-core/src/lib/filter/gr_cpu.h6
2 files changed, 35 insertions, 2 deletions
diff --git a/gnuradio-core/src/lib/filter/gr_cpu.cc b/gnuradio-core/src/lib/filter/gr_cpu.cc
index 6fe3591cda..517c10e9ad 100644
--- a/gnuradio-core/src/lib/filter/gr_cpu.cc
+++ b/gnuradio-core/src/lib/filter/gr_cpu.cc
@@ -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
*
@@ -85,6 +85,35 @@ gr_cpu::has_sse2 ()
}
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 ()
{
unsigned int extended_fct_count = cpuid_eax (0x80000000);
diff --git a/gnuradio-core/src/lib/filter/gr_cpu.h b/gnuradio-core/src/lib/filter/gr_cpu.h
index 2d42eb6108..5967d98685 100644
--- a/gnuradio-core/src/lib/filter/gr_cpu.h
+++ b/gnuradio-core/src/lib/filter/gr_cpu.h
@@ -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 ();
};