[beast/devel: 11/26] BSE: use new Rapicorn::cpu_info()
- From: Tim Janik <timj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [beast/devel: 11/26] BSE: use new Rapicorn::cpu_info()
- Date: Mon, 13 Oct 2014 02:27:02 +0000 (UTC)
commit b3fb897bad277c83740972a7cb91ba159c997e40
Author: Tim Janik <timj gnu org>
Date: Sun Oct 12 01:25:53 2014 +0200
BSE: use new Rapicorn::cpu_info()
bse/bsemain.cc | 5 +++--
bse/bseplugin.cc | 35 ++++++++++++++++++++---------------
bse/tests/blocktests.cc | 5 +++--
bse/tests/resamplehandle.cc | 5 +++--
4 files changed, 29 insertions(+), 21 deletions(-)
---
diff --git a/bse/bsemain.cc b/bse/bsemain.cc
index ff71d88..5bd2992 100644
--- a/bse/bsemain.cc
+++ b/bse/bsemain.cc
@@ -302,8 +302,9 @@ bse_init_intern (int *argc, char **argv, const char *app_name, const Bse::String
}
if (as_test)
{
- Bse::CPUInfo ci = Rapicorn::cpu_info();
- TMSG (" NOTE Running on: %s+%s", ci.machine, bse_block_impl_name());
+ StringVector sv = Rapicorn::string_split (Rapicorn::cpu_info(), " ");
+ String machine = sv.size() >= 2 ? sv[1] : "Unknown";
+ TMSG (" NOTE Running on: %s+%s", machine.c_str(), bse_block_impl_name());
}
// sfi_glue_gc_run ();
}
diff --git a/bse/bseplugin.cc b/bse/bseplugin.cc
index 328067d..e9413ae 100644
--- a/bse/bseplugin.cc
+++ b/bse/bseplugin.cc
@@ -164,24 +164,27 @@ bse_plugin_init_builtins (void)
static guint64
runtime_export_config (void)
{
- const Bse::CPUInfo cinfo = Rapicorn::cpu_info();
+ const std::string cinfo = Rapicorn::cpu_info();
guint64 emask = 0;
- if (cinfo.x86_mmx)
+ if (cinfo.find (" MMX ") != cinfo.npos)
emask |= BSE_EXPORT_FLAG_MMX;
- if (cinfo.x86_mmxext)
+ if (cinfo.find (" MMXEXT ") != cinfo.npos)
emask |= BSE_EXPORT_FLAG_MMXEXT;
- if (cinfo.x86_3dnow)
+ if (cinfo.find (" 3DNOW ") != cinfo.npos)
emask |= BSE_EXPORT_FLAG_3DNOW;
- if (cinfo.x86_3dnowext)
+ if (cinfo.find (" 3DNOWEXT ") != cinfo.npos)
emask |= BSE_EXPORT_FLAG_3DNOWEXT;
- if (cinfo.x86_sse && cinfo.x86_ssesys)
- emask |= BSE_EXPORT_FLAG_SSE;
- if (cinfo.x86_sse2 && cinfo.x86_ssesys)
- emask |= BSE_EXPORT_FLAG_SSE2;
- if (cinfo.x86_sse3 && cinfo.x86_ssesys)
- emask |= BSE_EXPORT_FLAG_SSE3;
- if (cinfo.x86_sse4_2 && cinfo.x86_ssesys)
- emask |= BSE_EXPORT_FLAG_SSE4;
+ if (cinfo.find (" SSESYS ") != cinfo.npos)
+ {
+ if (cinfo.find (" SSE ") != cinfo.npos)
+ emask |= BSE_EXPORT_FLAG_SSE;
+ if (cinfo.find (" SSE2 ") != cinfo.npos)
+ emask |= BSE_EXPORT_FLAG_SSE2;
+ if (cinfo.find (" SSE3 ") != cinfo.npos)
+ emask |= BSE_EXPORT_FLAG_SSE3;
+ if (cinfo.find (" SSE4.2 ") != cinfo.npos)
+ emask |= BSE_EXPORT_FLAG_SSE4;
+ }
return emask;
}
@@ -757,10 +760,12 @@ bse_plugin_path_list_files (gboolean include_drivers,
}
if (true)
{
- const Bse::CPUInfo cpu_info = Rapicorn::cpu_info();
+ const std::string cinfo = Rapicorn::cpu_info();
const char *exts[] = { ".FPU" PLUGIN_EXTENSION, ".FPU.la", PLUGIN_EXTENSION, ".la", };
if (BSE_WITH_SSE_FLAGS && !bse_main_args->force_fpu &&
- cpu_info.x86_mmx && cpu_info.x86_sse && cpu_info.x86_ssesys)
+ cinfo.find (" MMX ") != cinfo.npos &&
+ cinfo.find (" SSE ") != cinfo.npos &&
+ cinfo.find (" SSESYS ") != cinfo.npos)
{
exts[0] = ".SSE" PLUGIN_EXTENSION; /* !".FPU.so" / ".FPU.dll" */
exts[1] = ".SSE.la"; /* !".FPU.la" */
diff --git a/bse/tests/blocktests.cc b/bse/tests/blocktests.cc
index 38ab325..924e21a 100644
--- a/bse/tests/blocktests.cc
+++ b/bse/tests/blocktests.cc
@@ -529,8 +529,9 @@ main (int argc,
{
// usually we'd call bse_init_test() here, but we have tests to rnu before plugins are loaded
Rapicorn::init_core_test (RAPICORN_PRETTY_FILE, &argc, argv);
- Bse::CPUInfo ci = Rapicorn::cpu_info(); // usually done by bse_init_test
- TMSG (" NOTE Running on: %s+%s", ci.machine, bse_block_impl_name());
+ Rapicorn::StringVector sv = Rapicorn::string_split (Rapicorn::cpu_info(), " ");
+ Rapicorn::String machine = sv.size() >= 2 ? sv[1] : "Unknown";
+ TMSG (" NOTE Running on: %s+%s", machine.c_str(), bse_block_impl_name()); // usually done by
bse_init_test
TSTART ("Running Default Block Ops");
TASSERT (Bse::Block::default_singleton() == Bse::Block::current_singleton());
diff --git a/bse/tests/resamplehandle.cc b/bse/tests/resamplehandle.cc
index 4635e63..a77f369 100644
--- a/bse/tests/resamplehandle.cc
+++ b/bse/tests/resamplehandle.cc
@@ -477,8 +477,9 @@ main (int argc,
{
// usually we'd call bse_init_test() here, but we have tests to rnu before plugins are loaded
Rapicorn::init_core_test (RAPICORN_PRETTY_FILE, &argc, argv);
- Bse::CPUInfo ci = Rapicorn::cpu_info(); // usually done by bse_init_test
- TMSG (" NOTE Running on: %s+%s", ci.machine, bse_block_impl_name());
+ Rapicorn::StringVector sv = Rapicorn::string_split (Rapicorn::cpu_info(), " ");
+ Rapicorn::String machine = sv.size() >= 2 ? sv[1] : "Unknown";
+ TMSG (" NOTE Running on: %s+%s", machine.c_str(), bse_block_impl_name()); // usually done by
bse_init_test
test_c_api ("FPU");
test_delay_compensation ("FPU");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]