Various architectural changes to make Intel plus Apple Silicon build successfully

CQTexperiment
Christopher Snowhill 2020-09-11 17:08:37 -07:00
parent 002e16260c
commit 640e8b7304
49 changed files with 799 additions and 39 deletions

View File

@ -32,8 +32,12 @@
#ifndef _WIN32
#define __cdecl
#ifdef __aarch64__
#define __fastcall
#else
#define __fastcall __attribute__((regparm(3)))
#endif
#endif
/* No dynarec for x86_64 yet */
#if defined(_WIN32) || defined(__i386__)

View File

@ -24,8 +24,12 @@
#ifndef _WIN32
#define __cdecl
#ifdef __aarch64__
#define __fastcall
#else
#define __fastcall __attribute__((regparm(3)))
#endif
#endif
/* No dynarec for x86_64 yet */
#if defined(_WIN32) || defined(__i386__)

View File

@ -18,8 +18,13 @@ typedef char TEXT;
#ifdef _WIN32
typedef int BOOL;
#else
#ifdef __aarch64__
#include <stdbool.h>
typedef bool BOOL;
#else
typedef signed char BOOL;
#endif
#endif
#define TRUE 1
#define FALSE 0

View File

@ -9,6 +9,22 @@
/* Begin PBXBuildFile section */
830F884C19C9107E00420FB0 /* Ogg.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 830F884719C9105E00420FB0 /* Ogg.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
830F885F19C9145E00420FB0 /* Ogg.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 830F884719C9105E00420FB0 /* Ogg.framework */; };
8374715B2509BC1A00A6D7CA /* fft_arm.h in Headers */ = {isa = PBXBuildFile; fileRef = 8374714A2509BC1A00A6D7CA /* fft_arm.h */; };
8374715C2509BC1A00A6D7CA /* kiss_fft_armv4.h in Headers */ = {isa = PBXBuildFile; fileRef = 8374714B2509BC1A00A6D7CA /* kiss_fft_armv4.h */; };
8374715F2509BC1A00A6D7CA /* fixed_armv4.h in Headers */ = {isa = PBXBuildFile; fileRef = 8374714E2509BC1A00A6D7CA /* fixed_armv4.h */; };
837471612509BC1A00A6D7CA /* kiss_fft_armv5e.h in Headers */ = {isa = PBXBuildFile; fileRef = 837471502509BC1A00A6D7CA /* kiss_fft_armv5e.h */; };
837471622509BC1A00A6D7CA /* pitch_arm.h in Headers */ = {isa = PBXBuildFile; fileRef = 837471512509BC1A00A6D7CA /* pitch_arm.h */; };
837471632509BC1A00A6D7CA /* mdct_arm.h in Headers */ = {isa = PBXBuildFile; fileRef = 837471522509BC1A00A6D7CA /* mdct_arm.h */; };
837471642509BC1A00A6D7CA /* armcpu.c in Sources */ = {isa = PBXBuildFile; fileRef = 837471532509BC1A00A6D7CA /* armcpu.c */; };
837471652509BC1A00A6D7CA /* fixed_armv5e.h in Headers */ = {isa = PBXBuildFile; fileRef = 837471542509BC1A00A6D7CA /* fixed_armv5e.h */; };
837471662509BC1A00A6D7CA /* arm_celt_map.c in Sources */ = {isa = PBXBuildFile; fileRef = 837471552509BC1A00A6D7CA /* arm_celt_map.c */; };
837471692509BC1A00A6D7CA /* celt_neon_intr.c in Sources */ = {isa = PBXBuildFile; fileRef = 837471582509BC1A00A6D7CA /* celt_neon_intr.c */; };
8374716A2509BC1A00A6D7CA /* armopts.s.in in Resources */ = {isa = PBXBuildFile; fileRef = 837471592509BC1A00A6D7CA /* armopts.s.in */; };
8374716B2509BC1A00A6D7CA /* armcpu.h in Headers */ = {isa = PBXBuildFile; fileRef = 8374715A2509BC1A00A6D7CA /* armcpu.h */; };
837471712509C5D100A6D7CA /* macros_armv4.h in Headers */ = {isa = PBXBuildFile; fileRef = 8374716D2509C5D100A6D7CA /* macros_armv4.h */; };
837471722509C5D100A6D7CA /* SigProc_FIX_armv4.h in Headers */ = {isa = PBXBuildFile; fileRef = 8374716E2509C5D100A6D7CA /* SigProc_FIX_armv4.h */; };
837471732509C5D100A6D7CA /* macros_armv5e.h in Headers */ = {isa = PBXBuildFile; fileRef = 8374716F2509C5D100A6D7CA /* macros_armv5e.h */; };
837471742509C5D100A6D7CA /* SigProc_FIX_armv5e.h in Headers */ = {isa = PBXBuildFile; fileRef = 837471702509C5D100A6D7CA /* SigProc_FIX_armv5e.h */; };
8375B07017FFEABB0092A79F /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8375B06E17FFEABB0092A79F /* InfoPlist.strings */; };
8375B20B17FFEB2C0092A79F /* _kiss_fft_guts.h in Headers */ = {isa = PBXBuildFile; fileRef = 8375B0A317FFEB2C0092A79F /* _kiss_fft_guts.h */; };
8375B20C17FFEB2C0092A79F /* arch.h in Headers */ = {isa = PBXBuildFile; fileRef = 8375B0A417FFEB2C0092A79F /* arch.h */; };
@ -273,6 +289,22 @@
/* Begin PBXFileReference section */
830F884119C9105E00420FB0 /* Ogg.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Ogg.xcodeproj; path = ../Ogg/macosx/Ogg.xcodeproj; sourceTree = "<group>"; };
833F68421CDBCABC00AFB9F0 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/InfoPlist.strings; sourceTree = "<group>"; };
8374714A2509BC1A00A6D7CA /* fft_arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fft_arm.h; sourceTree = "<group>"; };
8374714B2509BC1A00A6D7CA /* kiss_fft_armv4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = kiss_fft_armv4.h; sourceTree = "<group>"; };
8374714E2509BC1A00A6D7CA /* fixed_armv4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fixed_armv4.h; sourceTree = "<group>"; };
837471502509BC1A00A6D7CA /* kiss_fft_armv5e.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = kiss_fft_armv5e.h; sourceTree = "<group>"; };
837471512509BC1A00A6D7CA /* pitch_arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pitch_arm.h; sourceTree = "<group>"; };
837471522509BC1A00A6D7CA /* mdct_arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mdct_arm.h; sourceTree = "<group>"; };
837471532509BC1A00A6D7CA /* armcpu.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = armcpu.c; sourceTree = "<group>"; };
837471542509BC1A00A6D7CA /* fixed_armv5e.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fixed_armv5e.h; sourceTree = "<group>"; };
837471552509BC1A00A6D7CA /* arm_celt_map.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = arm_celt_map.c; sourceTree = "<group>"; };
837471582509BC1A00A6D7CA /* celt_neon_intr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = celt_neon_intr.c; sourceTree = "<group>"; };
837471592509BC1A00A6D7CA /* armopts.s.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = armopts.s.in; sourceTree = "<group>"; };
8374715A2509BC1A00A6D7CA /* armcpu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = armcpu.h; sourceTree = "<group>"; };
8374716D2509C5D100A6D7CA /* macros_armv4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = macros_armv4.h; sourceTree = "<group>"; };
8374716E2509C5D100A6D7CA /* SigProc_FIX_armv4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SigProc_FIX_armv4.h; sourceTree = "<group>"; };
8374716F2509C5D100A6D7CA /* macros_armv5e.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = macros_armv5e.h; sourceTree = "<group>"; };
837471702509C5D100A6D7CA /* SigProc_FIX_armv5e.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SigProc_FIX_armv5e.h; sourceTree = "<group>"; };
8375B06217FFEABB0092A79F /* Opus.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Opus.framework; sourceTree = BUILT_PRODUCTS_DIR; };
8375B06D17FFEABB0092A79F /* Opus-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Opus-Info.plist"; sourceTree = "<group>"; };
8375B06F17FFEABB0092A79F /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
@ -520,6 +552,36 @@
name = Products;
sourceTree = "<group>";
};
837471492509BC1A00A6D7CA /* arm */ = {
isa = PBXGroup;
children = (
837471552509BC1A00A6D7CA /* arm_celt_map.c */,
837471532509BC1A00A6D7CA /* armcpu.c */,
8374715A2509BC1A00A6D7CA /* armcpu.h */,
837471592509BC1A00A6D7CA /* armopts.s.in */,
837471582509BC1A00A6D7CA /* celt_neon_intr.c */,
8374714A2509BC1A00A6D7CA /* fft_arm.h */,
8374714E2509BC1A00A6D7CA /* fixed_armv4.h */,
837471542509BC1A00A6D7CA /* fixed_armv5e.h */,
8374714B2509BC1A00A6D7CA /* kiss_fft_armv4.h */,
837471502509BC1A00A6D7CA /* kiss_fft_armv5e.h */,
837471522509BC1A00A6D7CA /* mdct_arm.h */,
837471512509BC1A00A6D7CA /* pitch_arm.h */,
);
path = arm;
sourceTree = "<group>";
};
8374716C2509C5D100A6D7CA /* arm */ = {
isa = PBXGroup;
children = (
8374716D2509C5D100A6D7CA /* macros_armv4.h */,
8374716E2509C5D100A6D7CA /* SigProc_FIX_armv4.h */,
8374716F2509C5D100A6D7CA /* macros_armv5e.h */,
837471702509C5D100A6D7CA /* SigProc_FIX_armv5e.h */,
);
path = arm;
sourceTree = "<group>";
};
8375B05817FFEABB0092A79F = {
isa = PBXGroup;
children = (
@ -588,6 +650,7 @@
8375B0A217FFEB2C0092A79F /* celt */ = {
isa = PBXGroup;
children = (
837471492509BC1A00A6D7CA /* arm */,
837928B81C293C78005DBCEA /* x86 */,
837928AF1C293C6F005DBCEA /* cpu_support.h */,
837928DA1C29406E005DBCEA /* celt_encoder.c */,
@ -656,6 +719,7 @@
8375B10917FFEB2C0092A79F /* silk */ = {
isa = PBXGroup;
children = (
8374716C2509C5D100A6D7CA /* arm */,
837928CB1C293CA1005DBCEA /* x86 */,
8375B10A17FFEB2C0092A79F /* A2NLSF.c */,
8375B10B17FFEB2C0092A79F /* ana_filt_bank_1.c */,
@ -900,11 +964,14 @@
8375B30417FFEB2C0092A79F /* tables.h in Headers */,
8375B2B817FFEB2C0092A79F /* main_FLP.h in Headers */,
8375B2D817FFEB2C0092A79F /* macros.h in Headers */,
837471712509C5D100A6D7CA /* macros_armv4.h in Headers */,
837928D61C293CA1005DBCEA /* SigProc_FIX_sse.h in Headers */,
837928C51C293C78005DBCEA /* pitch_sse.h in Headers */,
8375B27617FFEB2C0092A79F /* control.h in Headers */,
8375B2E417FFEB2C0092A79F /* pitch_est_defines.h in Headers */,
837471732509C5D100A6D7CA /* macros_armv5e.h in Headers */,
8375B2D917FFEB2C0092A79F /* main.h in Headers */,
837471612509BC1A00A6D7CA /* kiss_fft_armv5e.h in Headers */,
8375B22417FFEB2C0092A79F /* laplace.h in Headers */,
8375B23117FFEB2C0092A79F /* quant_bands.h in Headers */,
8375B22F17FFEB2C0092A79F /* pitch.h in Headers */,
@ -917,12 +984,15 @@
8375B30117FFEB2C0092A79F /* structs.h in Headers */,
8375B31C17FFEB2C0092A79F /* opus_private.h in Headers */,
8375B25417FFEB2C0092A79F /* opus_custom.h in Headers */,
837471652509BC1A00A6D7CA /* fixed_armv5e.h in Headers */,
8375B20C17FFEB2C0092A79F /* arch.h in Headers */,
8375B22817FFEB2C0092A79F /* mdct.h in Headers */,
8375B30C17FFEB2C0092A79F /* tuning_parameters.h in Headers */,
8375B2E717FFEB2C0092A79F /* PLC.h in Headers */,
8375B2ED17FFEB2C0092A79F /* resampler_private.h in Headers */,
837471622509BC1A00A6D7CA /* pitch_arm.h in Headers */,
8375B27B17FFEB2C0092A79F /* debug.h in Headers */,
837471742509C5D100A6D7CA /* SigProc_FIX_armv5e.h in Headers */,
8375B21417FFEB2C0092A79F /* celt_lpc.h in Headers */,
8375B36917FFEFFF0092A79F /* version.h in Headers */,
8375B2F717FFEB2C0092A79F /* SigProc_FIX.h in Headers */,
@ -934,6 +1004,7 @@
8375B23317FFEB2C0092A79F /* rate.h in Headers */,
8375B22017FFEB2C0092A79F /* float_cast.h in Headers */,
8375B20B17FFEB2C0092A79F /* _kiss_fft_guts.h in Headers */,
8374715C2509BC1A00A6D7CA /* kiss_fft_armv4.h in Headers */,
8375B21717FFEB2C0092A79F /* ecintrin.h in Headers */,
837928B41C293C6F005DBCEA /* static_modes_fixed_arm_ne10.h in Headers */,
8375B30D17FFEB2C0092A79F /* typedef.h in Headers */,
@ -941,14 +1012,18 @@
8375B22217FFEB2C0092A79F /* kiss_fft.h in Headers */,
8375B23517FFEB2C0092A79F /* static_modes_fixed.h in Headers */,
8375B22917FFEB2C0092A79F /* mfrngcod.h in Headers */,
8374715F2509BC1A00A6D7CA /* fixed_armv4.h in Headers */,
837471632509BC1A00A6D7CA /* mdct_arm.h in Headers */,
8375B22617FFEB2C0092A79F /* mathops.h in Headers */,
837928B51C293C6F005DBCEA /* static_modes_float_arm_ne10.h in Headers */,
8375B21D17FFEB2C0092A79F /* entenc.h in Headers */,
8375B36817FFEFFF0092A79F /* config.h in Headers */,
8375B21F17FFEB2C0092A79F /* fixed_generic.h in Headers */,
8375B2D617FFEB2C0092A79F /* MacroCount.h in Headers */,
8374715B2509BC1A00A6D7CA /* fft_arm.h in Headers */,
8375B21617FFEB2C0092A79F /* cwrs.h in Headers */,
837928D31C293CA1005DBCEA /* main_sse.h in Headers */,
8374716B2509BC1A00A6D7CA /* armcpu.h in Headers */,
8375B2D717FFEB2C0092A79F /* MacroDebug.h in Headers */,
837928E01C2940A9005DBCEA /* analysis.h in Headers */,
8375B35217FFEB2C0092A79F /* internal.h in Headers */,
@ -956,6 +1031,7 @@
8375B2C717FFEB2C0092A79F /* structs_FLP.h in Headers */,
8375B28417FFEB2C0092A79F /* define.h in Headers */,
8375B21B17FFEB2C0092A79F /* entdec.h in Headers */,
837471722509C5D100A6D7CA /* SigProc_FIX_armv4.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -1045,6 +1121,7 @@
buildActionMask = 2147483647;
files = (
8375B07017FFEABB0092A79F /* InfoPlist.strings in Resources */,
8374716A2509BC1A00A6D7CA /* armopts.s.in in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -1096,6 +1173,7 @@
8375B27C17FFEB2C0092A79F /* dec_API.c in Sources */,
8375B2EA17FFEB2C0092A79F /* resampler.c in Sources */,
837928D81C293CA1005DBCEA /* VQ_WMat_EC_sse.c in Sources */,
837471662509BC1A00A6D7CA /* arm_celt_map.c in Sources */,
837928C41C293C78005DBCEA /* pitch_sse.c in Sources */,
8375B2F517FFEB2C0092A79F /* shell_coder.c in Sources */,
8375B2CC17FFEB2C0092A79F /* init_decoder.c in Sources */,
@ -1107,6 +1185,7 @@
8375B28317FFEB2C0092A79F /* decoder_set_fs.c in Sources */,
8375B2E817FFEB2C0092A79F /* process_NLSFs.c in Sources */,
8375B26D17FFEB2C0092A79F /* A2NLSF.c in Sources */,
837471692509BC1A00A6D7CA /* celt_neon_intr.c in Sources */,
8375B2E217FFEB2C0092A79F /* NSQ.c in Sources */,
8375B2AE17FFEB2C0092A79F /* find_LTP_FLP.c in Sources */,
8375B2B917FFEB2C0092A79F /* noise_shape_analysis_FLP.c in Sources */,
@ -1184,6 +1263,7 @@
8375B2E017FFEB2C0092A79F /* NLSF_VQ.c in Sources */,
8375B30E17FFEB2C0092A79F /* VAD.c in Sources */,
8375B23017FFEB2C0092A79F /* quant_bands.c in Sources */,
837471642509BC1A00A6D7CA /* armcpu.c in Sources */,
8375B21A17FFEB2C0092A79F /* entdec.c in Sources */,
8375B27E17FFEB2C0092A79F /* decode_frame.c in Sources */,
8375B2A817FFEB2C0092A79F /* burg_modified_FLP.c in Sources */,

View File

@ -31,7 +31,7 @@
#include "config.h"
#endif
#ifdef OPUS_HAVE_RTCD
#if defined(OPUS_HAVE_RTCD) && defined(__aarch64__)
#include "armcpu.h"
#include "cpu_support.h"

View File

@ -34,10 +34,11 @@
#include "config.h"
#endif
#if !defined(FIXED_POINT) && defined(OPUS_ARM_MAY_HAVE_NEON_INTR)
#include <arm_neon.h>
#include "../pitch.h"
#if !defined(FIXED_POINT)
/*
* Function: xcorr_kernel_neon_float
* ---------------------------------

View File

@ -549,3 +549,4 @@ celt_pitch_xcorr_edsp_done:
@ END:
.section .note.GNU-stack,"",%progbits

View File

@ -29,7 +29,7 @@
#include "config.h"
#endif
#if defined(FIXED_POINT)
#if defined(FIXED_POINT) && defined(OPUS_X86_MAY_HAVE_SSE4_1)
#include <xmmintrin.h>
#include <emmintrin.h>

View File

@ -29,6 +29,8 @@
#include "config.h"
#endif
#ifdef __x86_64__
#include "macros.h"
#include "celt_lpc.h"
#include "stack_alloc.h"
@ -182,4 +184,6 @@ void comb_filter_const_sse(opus_val32 *y, opus_val32 *x, int T, int N,
}
#endif
#endif

View File

@ -29,6 +29,8 @@
#include "config.h"
#endif
#ifdef __x86_64__
#include <xmmintrin.h>
#include <emmintrin.h>
@ -93,3 +95,5 @@ opus_val32 celt_inner_prod_sse2(const opus_val16 *x, const opus_val16 *y,
return sum;
}
#endif
#endif

View File

@ -29,6 +29,8 @@
#include "config.h"
#endif
#if defined(OPUS_X86_MAY_HAVE_SSE4_1) && defined(FIXED_POINT)
#include <xmmintrin.h>
#include <emmintrin.h>
@ -38,7 +40,6 @@
#include "mathops.h"
#include "pitch.h"
#if defined(OPUS_X86_MAY_HAVE_SSE4_1) && defined(FIXED_POINT)
#include <smmintrin.h>
#include "x86cpu.h"

View File

@ -29,11 +29,17 @@
#include "config.h"
#endif
#ifdef __x86_64__
#include "cpu_support.h"
#include "arch.h"
#include "x86/x86cpu.h"
#include "celt_lpc.h"
#include "pitch.h"
#include "pitch_sse.h"
#if defined(OPUS_HAVE_RTCD)
# if defined(FIXED_POINT)
@ -146,3 +152,5 @@ void (*const COMB_FILTER_CONST_IMPL[OPUS_ARCHMASK + 1])(
#endif
#endif
#endif

View File

@ -29,17 +29,16 @@
#include "config.h"
#endif
#if (defined(OPUS_X86_MAY_HAVE_SSE) && !defined(OPUS_X86_PRESUME_SSE)) || \
(defined(OPUS_X86_MAY_HAVE_SSE2) && !defined(OPUS_X86_PRESUME_SSE2)) || \
(defined(OPUS_X86_MAY_HAVE_SSE4_1) && !defined(OPUS_X86_PRESUME_SSE4_1))
#include "cpu_support.h"
#include "macros.h"
#include "main.h"
#include "pitch.h"
#include "x86cpu.h"
#if (defined(OPUS_X86_MAY_HAVE_SSE) && !defined(OPUS_X86_PRESUME_SSE)) || \
(defined(OPUS_X86_MAY_HAVE_SSE2) && !defined(OPUS_X86_PRESUME_SSE2)) || \
(defined(OPUS_X86_MAY_HAVE_SSE4_1) && !defined(OPUS_X86_PRESUME_SSE4_1))
#if defined(_MSC_VER)
#include <intrin.h>

View File

@ -41,9 +41,19 @@ POSSIBILITY OF SUCH DAMAGE.
#define __MACOSX__
#ifndef __aarch64__
#define OPUS_HAVE_RTCD 1
#define OPUS_X86_MAY_HAVE_SSE 1
#define OPUS_X86_MAY_HAVE_SSE2 1
#define OPUS_X86_MAY_HAVE_SSE4_1 1
#else
#undef OPUS_HAVE_RTCD
#define OPUS_ARM_MAY_HAVE_NEON 1
#define OPUS_ARM_MAY_HAVE_NEON_INTR 1
#define OPUS_ARM_PRESUME_NEON 1
#define OPUS_ARM_PRESUME_NEON_INTR 1
#endif
#endif CONFIG_H

View File

@ -29,6 +29,8 @@
#include "config.h"
#endif
#if defined(OPUS_X86_MAY_HAVE_SSE4_1)
#include <xmmintrin.h>
#include <emmintrin.h>
#include <smmintrin.h>
@ -855,3 +857,5 @@ static OPUS_INLINE void silk_nsq_del_dec_scale_states_sse4_1(
}
}
}
#endif

View File

@ -29,6 +29,8 @@
#include "config.h"
#endif
#ifdef __x86_64__
#include <xmmintrin.h>
#include <emmintrin.h>
#include <smmintrin.h>
@ -718,3 +720,5 @@ static OPUS_INLINE void silk_nsq_scale_states_sse4_1(
}
}
}
#endif

View File

@ -29,6 +29,8 @@
#include "config.h"
#endif
#ifdef __x86_64__
#include <xmmintrin.h>
#include <emmintrin.h>
#include <smmintrin.h>
@ -275,3 +277,5 @@ opus_int silk_VAD_GetSA_Q8_sse4_1( /* O Return value, 0 if s
RESTORE_STACK;
return( ret );
}
#endif

View File

@ -29,6 +29,8 @@
#include "config.h"
#endif
#ifdef __x86_64__
#include <xmmintrin.h>
#include <emmintrin.h>
#include <smmintrin.h>
@ -140,3 +142,5 @@ void silk_VQ_WMat_EC_sse4_1(
cb_row_Q7 += LTP_ORDER;
}
}
#endif

View File

@ -35,7 +35,7 @@
#include "pitch.h"
#include "main.h"
#if !defined(OPUS_X86_PRESUME_SSE4_1)
#if !defined(OPUS_X86_PRESUME_SSE4_1) && defined(__x86_64__)
#if defined(FIXED_POINT)

View File

@ -1186,9 +1186,9 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
FRAMEWORK_VERSION = A;
GCC_PREPROCESSOR_DEFINITIONS = (
GCC_PREPROCESSOR_DEFINITIONS = "DEBUG=1";
"GCC_PREPROCESSOR_DEFINITIONS[arch=i386]" = (
"DEBUG=1",
ARCH_MIN_SSE2,
DYNAREC,
);
GCC_WARN_PEDANTIC = YES;
@ -1215,9 +1215,9 @@
DYLIB_CURRENT_VERSION = 1;
FRAMEWORK_VERSION = A;
GCC_OPTIMIZATION_LEVEL = fast;
GCC_PREPROCESSOR_DEFINITIONS = (
GCC_PREPROCESSOR_DEFINITIONS = "$(inherit)";
"GCC_PREPROCESSOR_DEFINITIONS[arch=i386]" = (
"$(inherit)",
ARCH_MIN_SSE2,
DYNAREC,
);
GCC_WARN_PEDANTIC = YES;

View File

@ -154,7 +154,9 @@ static void osal_fastcall FIN_BLOCK(usf_state_t * state)
Used by dynarec only, check should be unnecessary
*/
state->PC->ops(state);
#ifdef DYNAREC
if (state->r4300emu == CORE_DYNAREC) dyna_jump(state);
#endif
}
else
{
@ -176,7 +178,9 @@ Used by dynarec only, check should be unnecessary
else
state->PC->ops(state);
#ifdef DYNAREC
if (state->r4300emu == CORE_DYNAREC) dyna_jump(state);
#endif
}
}
@ -196,8 +200,10 @@ The preceeding update_debugger SHOULD be unnecessary since it should have been
called before NOTCOMPILED would have been executed
*/
state->PC->ops(state);
#ifdef DYNAREC
if (state->r4300emu == CORE_DYNAREC)
dyna_jump(state);
#endif
}
static void osal_fastcall NOTCOMPILED2(usf_state_t * state)
@ -537,7 +543,9 @@ void osal_fastcall jump_to_func(usf_state_t * state)
}
state->PC=state->actual->block+((addr-state->actual->start)>>2);
#ifdef DYNAREC
if (state->r4300emu == CORE_DYNAREC) dyna_jump(state);
#endif
}
#undef addr

View File

@ -96,11 +96,13 @@ void TLB_refill_exception(usf_state_t * state, unsigned int address, int w)
state->last_addr = state->PC->addr;
#ifdef DYNAREC
if (state->r4300emu == CORE_DYNAREC)
{
dyna_jump(state);
if (!state->dyna_interp) state->delay_slot = 0;
}
#endif
if (state->r4300emu != CORE_DYNAREC || state->dyna_interp)
{
@ -131,11 +133,13 @@ void osal_fastcall exception_general(usf_state_t * state)
}
generic_jump_to(state, 0x80000180);
state->last_addr = state->PC->addr;
#ifdef DYNAREC
if (state->r4300emu == CORE_DYNAREC)
{
dyna_jump(state);
if (!state->dyna_interp) state->delay_slot = 0;
}
#endif
if (state->r4300emu != CORE_DYNAREC || state->dyna_interp)
{
state->dyna_interp = 0;

View File

@ -506,7 +506,9 @@ void osal_fastcall gen_interupt(usf_state_t * state)
if (state->stop == 1)
{
state->g_gs_vi_counter = 0; // debug
#ifdef DYNAREC
dyna_stop(state);
#endif
}
if (!state->interupt_unsafe_state)

View File

@ -206,6 +206,7 @@ void r4300_reset_soft(usf_state_t * state)
/* ready to execute IPL3 */
}
#ifdef DYNAREC
#if !defined(NO_ASM)
static void dynarec_setup_code()
{
@ -236,6 +237,7 @@ static void dynarec_setup_code()
dyna_stop(state);
}
#endif
#endif
void r4300_begin(usf_state_t * state)
{

File diff suppressed because it is too large Load Diff

View File

@ -73,7 +73,9 @@ typedef struct _precomp_instr
} f;
unsigned int addr; /* word-aligned instruction address in r4300 address space */
unsigned int local_addr; /* byte offset to start of corresponding x86_64 instructions, from start of code block */
#ifdef DYNAREC
reg_cache_struct reg_cache_infos;
#endif
} precomp_instr;
typedef struct _precomp_block

View File

@ -44,6 +44,7 @@
/* Static Functions */
#ifdef DYNAREC
void add_jump(usf_state_t * state, unsigned int pc_addr, unsigned int mi_addr, unsigned int absolute64)
{
if (state->jumps_number == state->max_jumps_number)
@ -199,3 +200,6 @@ void jump_end_rel32(usf_state_t * state)
put32(state, jump_vec);
state->code_length = jump_end;
}
#endif

View File

@ -77,6 +77,7 @@
#define RP3 RCX
#endif
#ifdef DYNAREC
void jump_start_rel8(usf_state_t *);
void jump_end_rel8(usf_state_t *);
void jump_start_rel32(usf_state_t *);
@ -1192,6 +1193,7 @@ static inline void ffree_fpreg(usf_state_t * state, int fpreg)
put8(state, 0xDD);
put8(state, 0xC0 + fpreg);
}
#endif
#endif /* M64P_R4300_ASSEMBLE_H */

View File

@ -23,6 +23,7 @@
#ifndef M64P_R4300_ASSEMBLE_STRUCT_H
#define M64P_R4300_ASSEMBLE_STRUCT_H
#ifdef DYNAREC
typedef struct _reg_cache_struct
{
int need_map;
@ -30,5 +31,6 @@ typedef struct _reg_cache_struct
unsigned char jump_wrapper[84];
int need_cop1_check;
} reg_cache_struct;
#endif
#endif /* M64P_R4300_ASSEMBLE_STRUCT_H */

View File

@ -39,6 +39,7 @@
#include "r4300/instr_counters.h"
#endif
#ifdef DYNAREC
static void genbc1f_test(usf_state_t * state)
{
test_m32rel_imm32(state, (unsigned int*)&state->FCR31, 0x800000);
@ -303,3 +304,4 @@ void genbc1tl_idle(usf_state_t * state)
#endif
}
#endif

View File

@ -38,6 +38,7 @@
#include "r4300/instr_counters.h"
#endif
#ifdef DYNAREC
void genmfc0(usf_state_t * state)
{
#if defined(COUNT_INSTR)
@ -53,4 +54,4 @@ void genmtc0(usf_state_t * state)
#endif
gencallinterp(state, (unsigned long long)state->current_instruction_table.MTC0, 0);
}
#endif

View File

@ -42,6 +42,7 @@
#include "r4300/instr_counters.h"
#endif
#ifdef DYNAREC
void genmfc1(usf_state_t * state)
{
#if defined(COUNT_INSTR)
@ -160,4 +161,4 @@ void genctc1(usf_state_t * state)
fldcw_m16rel(state, (unsigned short*)&state->rounding_mode);
#endif
}
#endif

View File

@ -38,6 +38,7 @@
#include "r4300/instr_counters.h"
#endif
#ifdef DYNAREC
void genadd_d(usf_state_t * state)
{
#if defined(COUNT_INSTR)
@ -716,4 +717,4 @@ void genc_ngt_d(usf_state_t * state)
and_m32rel_imm32(state, (unsigned int*)&state->FCR31, ~0x800000); // 11
#endif
}
#endif

View File

@ -36,6 +36,7 @@
#include "r4300/instr_counters.h"
#endif
#ifdef DYNAREC
void gencvt_s_l(usf_state_t * state)
{
#if defined(COUNT_INSTR)
@ -67,4 +68,4 @@ void gencvt_d_l(usf_state_t * state)
fstp_preg64_qword(state, RAX);
#endif
}
#endif

View File

@ -39,6 +39,7 @@
#include "r4300/instr_counters.h"
#endif
#ifdef DYNAREC
void genadd_s(usf_state_t * state)
{
#if defined(COUNT_INSTR)
@ -715,4 +716,4 @@ void genc_ngt_s(usf_state_t * state)
and_m32rel_imm32(state, (unsigned int*)&state->FCR31, ~0x800000); // 11
#endif
}
#endif

View File

@ -38,6 +38,7 @@
#include "r4300/instr_counters.h"
#endif
#ifdef DYNAREC
void gencvt_s_w(usf_state_t * state)
{
#if defined(COUNT_INSTR)
@ -69,4 +70,4 @@ void gencvt_d_w(usf_state_t * state)
fstp_preg64_qword(state, RAX);
#endif
}
#endif

View File

@ -49,6 +49,7 @@
/* static functions */
#ifdef DYNAREC
static void genupdate_count(usf_state_t * state, unsigned int addr)
{
mov_reg32_imm32(state, EAX, addr);
@ -2257,4 +2258,4 @@ void gensc(usf_state_t * state)
#endif
gencallinterp(state, (unsigned long long)state->current_instruction_table.SC, 0);
}
#endif

View File

@ -42,6 +42,7 @@
#include "r4300/instr_counters.h"
#endif
#ifdef DYNAREC
static void genbltz_test(usf_state_t * state)
{
int rs_64bit = is64(state, (unsigned int *)state->dst->f.i.rs);
@ -608,4 +609,4 @@ void genbgezall_idle(usf_state_t * state)
genbgezall(state);
#endif
}
#endif

View File

@ -45,6 +45,7 @@
# define offsetof(TYPE,MEMBER) ((unsigned int) &((TYPE*)0)->MEMBER)
#endif
#ifdef DYNAREC
void gensll(usf_state_t * state)
{
#if defined(COUNT_INSTR)
@ -1075,4 +1076,4 @@ void genbreak(usf_state_t * state)
{
gencallinterp(state, (unsigned long long)state->current_instruction_table.BREAK, 0);
}
#endif

View File

@ -37,6 +37,7 @@
#include "r4300/instr_counters.h"
#endif
#ifdef DYNAREC
void gentlbwi(usf_state_t * state)
{
#if defined(COUNT_INSTR)
@ -98,4 +99,4 @@ void gentlbwr(usf_state_t * state)
#endif
gencallinterp(state, (unsigned long long)state->current_instruction_table.TLBWR, 0);
}
#endif

View File

@ -34,6 +34,7 @@
#include "r4300/r4300.h"
#include "r4300/recomph.h"
#ifdef DYNAREC
void init_cache(usf_state_t * state, precomp_instr* start)
{
int i;
@ -622,4 +623,4 @@ void build_wrappers(usf_state_t * state, precomp_instr *instr, int start, int en
}
}
}
#endif

View File

@ -25,6 +25,7 @@
#include "r4300/recomp.h"
#ifdef DYNAREC
void init_cache(usf_state_t *, precomp_instr* start);
void free_registers_move_start(usf_state_t *);
void free_all_registers(usf_state_t *);
@ -42,6 +43,7 @@ int allocate_register_64_w(usf_state_t *, unsigned long long *addr);
void allocate_register_32_manually(usf_state_t *, int reg, unsigned int *addr);
void allocate_register_32_manually_w(usf_state_t *, int reg, unsigned int *addr);
void build_wrappers(usf_state_t *, precomp_instr*, int, int, precomp_block*);
#endif
#endif /* M64P_R4300_REGCACHE_H */

View File

@ -20,6 +20,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifdef DYNAREC
#include <stdlib.h>
#include "usf/usf.h"
@ -108,4 +110,4 @@ void dyna_stop(usf_state_t * state)
*state->return_address = (unsigned long long) state->save_rip;
}
}
#endif

View File

@ -27,6 +27,12 @@
/*
* Streaming SIMD Extensions version import management
*/
#ifdef __aarch64__
#define ARCH_MIN_ARM_NEON 1
#else
#define ARCH_MIN_SSE2 1
#endif
#ifdef ARCH_MIN_SSSE3
#define ARCH_MIN_SSE2
#include <tmmintrin.h>

View File

@ -34,22 +34,22 @@ static void VSAR(usf_state_t * state, int vd, int vs, int vt, int e)
if (e > 2)
{
message(state, "VSAR\nInvalid mask.", 2);
#if ARCH_MIN_ARM_NEON
#if ARCH_MIN_ARM_NEON
int16x8_t zero = vdupq_n_s16(0);
vst1q_s16(VR[vd], zero);
#else
#else
for (i = 0; i < N; i++)
state->VR[vd][i] = 0x0000; /* override behavior (zilmar) */
#endif
#endif
}
else
{
#if ARCH_MIN_ARM_NEON
#if ARCH_MIN_ARM_NEON
vector_copy(VR[vd], VACC[e]);
#else
#else
for (i = 0; i < N; i++)
state->VR[vd][i] = state->VACC[e][i];
#endif
#endif
}
for (i = 0; i < N; i++)
@ -72,18 +72,18 @@ static void VSAW(usf_state_t * state, int vd, int vs, int vt, int e)
{ /* branch very unlikely...never seen a game do VSAW illegally */
message(state, "VSAW\nIllegal mask.", 2);
#if ARCH_MIN_ARM_NEON
#if ARCH_MIN_ARM_NEON
int16x8_t zero = vdupq_n_s16(0);
vst1q_s16(state->VR[vd], zero);
#else
#else
for (i = 0; i < N; i++)
state->VR[vd][i] = 0x0000; /* override behavior (zilmar) */
return;
#endif
#endif
}
vector_copy(state->VR[vd], state->VACC[e]);
return;

View File

@ -167,7 +167,9 @@ typedef struct _precomp_instr
} f;
unsigned int addr; /* word-aligned instruction address in r4300 address space */
unsigned int local_addr; /* byte offset to start of corresponding x86_64 instructions, from start of code block */
#ifdef DYNAREC
reg_cache_struct reg_cache_infos;
#endif
} precomp_instr;
typedef struct _precomp_block

View File

@ -5,7 +5,9 @@
#define HAVE_BOOL 1
#if !defined(__aarch64__)
#define HAVE_MMINTRIN_H 1
#endif
#define HAVE_STRCASECMP 1

View File

@ -187,13 +187,21 @@ struct SPU_struct
void ShutUp();
};
#ifdef __cplusplus
extern "C" {
#endif
SoundInterface_struct *SPU_SoundCore(NDS_state *);
void SPU_Pause(NDS_state *, int pause);
void SPU_SetVolume(NDS_state *, int volume);
void SPU_KeyOn(NDS_state *, int channel);
void SPU_Emulate_core(NDS_state *);
void SPU_Emulate_user(NDS_state *, bool mix = true);
void SPU_Emulate_user(NDS_state *, BOOL mix = true);
#ifdef __cplusplus
}
#endif
class WavWriter
{
@ -207,10 +215,17 @@ private:
FILE *spufp;
};
#ifdef __cplusplus
extern "C" {
#endif
void WAV_End(NDS_state *);
bool WAV_Begin(NDS_state *, const char* fname);
bool WAV_IsRecording(NDS_state *);
void WAV_WavSoundUpdate(NDS_state *, void* soundData, int numSamples);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -100,8 +100,13 @@ typedef s16 v10;
#ifdef WIN32
typedef int BOOL;
#else
#ifdef __aarch64__
#include <stdbool.h>
typedef bool BOOL;
#else
typedef signed char BOOL;
#endif
#endif
#else
//apple also defines BOOL
typedef int desmume_BOOL;