Move performance.c to libretro-common/features/features_cpu.c

This commit is contained in:
twinaphex 2016-05-10 20:31:27 +02:00
parent 1fdc547a97
commit 9aed52ac65
20 changed files with 118 additions and 109 deletions

View File

@ -204,7 +204,7 @@ OBJ += frontend/frontend.o \
movie.o \
record/record_driver.o \
record/drivers/record_null.o \
performance.o \
libretro-common/features/features_cpu.o \
performance_counters.o \
verbosity.o

View File

@ -23,13 +23,13 @@
#include <file/file_path.h>
#include <lists/dir_list.h>
#include <features/features_cpu.h>
#include "audio_dsp_filter.h"
#include "audio_filters/dspfilter.h"
#include "../config_file_userdata.h"
#include "../frontend/frontend_driver.h"
#include "../performance.h"
#include "../performance_counters.h"
#include "../dynamic.h"

View File

@ -17,11 +17,11 @@
#include <string.h>
#include <string/stdstring.h>
#include <features/features_cpu.h>
#include "audio_resampler_driver.h"
#include "../config_file_userdata.h"
#ifdef RARCH_INTERNAL
#include "../performance.h"
#include "../performance_counters.h"
#endif
#ifndef DONT_HAVE_STRING_LIST
@ -142,11 +142,7 @@ retro_get_cpu_features_t perf_get_cpu_features_cb;
static resampler_simd_mask_t resampler_get_cpu_features(void)
{
#ifdef RARCH_INTERNAL
return cpu_features_get();
#else
return perf_get_cpu_features_cb();
#endif
}
/**

View File

@ -13,18 +13,18 @@
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include <boolean.h>
#include "audio_utils.h"
#if defined(__SSE2__)
#include <emmintrin.h>
#elif defined(__ALTIVEC__)
#include <altivec.h>
#endif
#include <boolean.h>
#include <features/features_cpu.h>
#include "audio_utils.h"
#ifdef RARCH_INTERNAL
#include "../performance.h"
#include "../performance_counters.h"
#endif

View File

@ -25,6 +25,8 @@
#include <string/stdstring.h>
#include <retro_assert.h>
#include <features/features_cpu.h>
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@ -38,7 +40,6 @@
#include "record/record_driver.h"
#include "core.h"
#include "performance_counters.h"
#include "performance.h"
#include "system.h"
#include "gfx/video_context_driver.h"

View File

@ -41,6 +41,7 @@
#include <compat/strl.h>
#include <rhash.h>
#include <file/file_path.h>
#include <streams/file_stream.h>
#include <string/stdstring.h>
#include "../frontend.h"

View File

@ -25,6 +25,7 @@
#endif
#include <file/config_file.h>
#include <features/features_cpu.h>
#include "video_thread_wrapper.h"
#include "../frontend/frontend_driver.h"
@ -33,7 +34,6 @@
#include "../config.def.h"
#include "../retroarch.h"
#include "../runloop.h"
#include "../performance.h"
#include "../performance_counters.h"
#include "../list_special.h"
#include "../core.h"

View File

@ -19,12 +19,12 @@
#include <file/file_path.h>
#include <lists/dir_list.h>
#include <dynamic/dylib.h>
#include <features/features_cpu.h>
#include "../frontend/frontend_driver.h"
#include "../config_file_userdata.h"
#include "../dynamic.h"
#include "../general.h"
#include "../performance.h"
#include "../performance_counters.h"
#include "../verbosity.h"
#include "video_filter.h"

View File

@ -18,12 +18,12 @@
#include <string.h>
#include <limits.h>
#include <features/features_cpu.h>
#include <rthreads/rthreads.h>
#include "video_thread_wrapper.h"
#include "font_driver.h"
#include "video_shader_driver.h"
#include "../performance.h"
#include "../performance_counters.h"
#include "../runloop.h"
#include "../verbosity.h"

View File

@ -62,7 +62,7 @@ ENCODINGS
/*============================================================
PERFORMANCE
============================================================ */
#include "../performance.c"
#include "../libretro-common/features/features_cpu.c"
#include "../performance_counters.c"
/*============================================================

View File

@ -1,17 +1,23 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
* Copyright (C) 2011-2016 - Daniel De Matteis
/* Copyright (C) 2010-2016 The RetroArch team
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (features_cpu.c).
* ---------------------------------------------------------------------------------------
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
* Permission is hereby granted, free of charge,
* to any person obtaining a copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <stdio.h>
@ -769,8 +775,6 @@ uint64_t cpu_features_get(void)
/* read the initial decimal number, ignore the rest */
long arch_number = strtol(cpu_arch, &end, 10);
RARCH_LOG("Found CPU architecture = '%s'\n", cpu_arch);
/* Here we assume that ARMv8 will be upwards compatible with v7
* in the future. Unfortunately, there is no 'Features' field to
* indicate that Thumb-2 is supported.
@ -795,7 +799,6 @@ uint64_t cpu_features_get(void)
if (cpu_proc != NULL)
{
RARCH_LOG("found cpu_proc = '%s'\n", cpu_proc);
if (has_list_item(cpu_proc, "(v6l)"))
{
/* CPU processor and architecture mismatch. */
@ -820,8 +823,6 @@ uint64_t cpu_features_get(void)
if (cpu_features)
{
RARCH_LOG("found cpu_features = '%s'\n", cpu_features);
if (has_list_item(cpu_features, "vfpv3"))
g_cpuFeatures |= CPU_ARM_FEATURE_VFPv3;

View File

@ -0,0 +1,75 @@
/* Copyright (C) 2010-2016 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (features_cpu.h).
* ---------------------------------------------------------------------------------------
*
* Permission is hereby granted, free of charge,
* to any person obtaining a copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef _LIBRETRO_SDK_CPU_INFO_H
#define _LIBRETRO_SDK_CPU_INFO_H
#include <stdint.h>
#include <libretro.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* cpu_features_get_perf_counter:
*
* Gets performance counter.
*
* Returns: performance counter.
**/
retro_perf_tick_t cpu_features_get_perf_counter(void);
/**
* cpu_features_get_time_usec:
*
* Gets time in microseconds. *
* Returns: time in microseconds.
**/
retro_time_t cpu_features_get_time_usec(void);
/**
* cpu_features_get:
*
* Gets CPU features..
*
* Returns: bitmask of all CPU features available.
**/
uint64_t cpu_features_get(void);
/**
* cpu_features_get_core_amount:
*
* Gets the amount of available CPU cores.
*
* Returns: amount of CPU cores available.
**/
unsigned cpu_features_get_core_amount(void);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -17,6 +17,7 @@
#include <compat/strl.h>
#include <string/stdstring.h>
#include <features/features_cpu.h>
#include "menu_generic.h"
@ -28,7 +29,6 @@
#include "../menu_entries.h"
#include "../../configuration.h"
#include "../../performance.h"
#include "../../performance_counters.h"
#include "../../input/input_autodetect.h"
#include "../../input/input_config.h"

View File

@ -16,13 +16,14 @@
#include <math.h>
#include <string.h>
#include <compat/strl.h>
#include <encodings/utf.h>
#include <retro_miscellaneous.h>
#include <features/features_cpu.h>
#include "menu_animation.h"
#include "../configuration.h"
#include "../performance.h"
#include "../performance_counters.h"
#define IDEAL_DELTA_TIME (1.0 / 60.0 * 1000000.0)

View File

@ -27,6 +27,8 @@
#include <stdlib.h>
#include <string.h>
#include <features/features_cpu.h>
#include "menu_driver.h"
#include "menu_input.h"
#include "menu_animation.h"
@ -39,7 +41,6 @@
#include "../general.h"
#include "../managers/cheat_manager.h"
#include "../performance.h"
#include "../performance_counters.h"
#include "../core.h"
#include "../input/input_joypad_driver.h"

View File

@ -17,8 +17,8 @@
#include <stdlib.h>
#include <net/net_http.h>
#include <features/features_cpu.h>
#include "../performance.h"
#include "../performance_counters.h"
#include "net_http_special.h"

View File

@ -1,69 +0,0 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
* Copyright (C) 2011-2016 - Daniel De Matteis
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _LIBRETRO_SDK_CPU_INFO_H
#define _LIBRETRO_SDK_CPU_INFO_H
#include <stdint.h>
#include <libretro.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* cpu_features_get_perf_counter:
*
* Gets performance counter.
*
* Returns: performance counter.
**/
retro_perf_tick_t cpu_features_get_perf_counter(void);
/**
* cpu_features_get_time_usec:
*
* Gets time in microseconds. *
* Returns: time in microseconds.
**/
retro_time_t cpu_features_get_time_usec(void);
/**
* cpu_features_get:
*
* Gets CPU features..
*
* Returns: bitmask of all CPU features available.
**/
uint64_t cpu_features_get(void);
/**
* cpu_features_get_core_amount:
*
* Gets the amount of available CPU cores.
*
* Returns: amount of CPU cores available.
**/
unsigned cpu_features_get_core_amount(void);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -17,7 +17,8 @@
#include <stdio.h>
#include <string.h>
#include "performance.h"
#include <features/features_cpu.h>
#include "performance_counters.h"
#include "general.h"

View File

@ -43,6 +43,8 @@
#include <retro_stat.h>
#include <retro_assert.h>
#include <features/features_cpu.h>
#include "content.h"
#include "core_type.h"
#include "core_info.h"
@ -58,7 +60,6 @@
#include "configuration.h"
#include "general.h"
#include "runloop.h"
#include "performance.h"
#include "managers/cheat_manager.h"
#include "system.h"

View File

@ -29,6 +29,7 @@
#endif
#include <queues/task_queue.h>
#include <string/stdstring.h>
#include <features/features_cpu.h>
#include <compat/strl.h>
@ -38,7 +39,6 @@
#include "autosave.h"
#include "core_info.h"
#include "configuration.h"
#include "performance.h"
#include "movie.h"
#include "retroarch.h"
#include "runloop.h"