Skip to content

Commit

Permalink
Merge branch 'csound6' of https://github.com/csound/csound into csound6
Browse files Browse the repository at this point in the history
  • Loading branch information
vlazzarini committed Apr 25, 2023
2 parents 6329e68 + 839cc81 commit c12f8e1
Show file tree
Hide file tree
Showing 9 changed files with 66 additions and 63 deletions.
2 changes: 1 addition & 1 deletion Android/CsoundAndroid/jni/Application.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
APP_ABI := armeabi-v7a arm64-v8a
APP_ABI := armeabi-v7a arm64-v8a x86 x86_64
APP_CPPFLAGS += -fexceptions -frtti
APP_OPTIM := release
APP_PLATFORM := android-21
Expand Down
2 changes: 1 addition & 1 deletion Android/pluginlibs/doppler/jni/Application.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
APP_ABI := armeabi-v7a arm64-v8a
APP_ABI := armeabi-v7a arm64-v8a x86 x86_64
APP_CPPFLAGS += -fexceptions -frtti
APP_OPTIM := release
APP_PLATFORM := android-21
Expand Down
2 changes: 1 addition & 1 deletion Android/pluginlibs/libOSC/jni/Application.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
APP_ABI := armeabi-v7a arm64-v8a
APP_ABI := armeabi-v7a arm64-v8a x86 x86_64
APP_CPPFLAGS += -fexceptions -frtti
APP_OPTIM := release
APP_PLATFORM := android-21
Expand Down
2 changes: 1 addition & 1 deletion Android/pluginlibs/libscansyn/jni/Application.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
APP_ABI := armeabi-v7a arm64-v8a
APP_ABI := armeabi-v7a arm64-v8a x86 x86_64
APP_CPPFLAGS += -fexceptions -frtti
APP_OPTIM := release
APP_PLATFORM := android-21
Expand Down
2 changes: 1 addition & 1 deletion Android/pluginlibs/libstdutil/jni/Application.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
APP_CFLAGS += -Wno-error=format-security
APP_ABI := armeabi-v7a arm64-v8a
APP_ABI := armeabi-v7a arm64-v8a x86 x86_64
APP_CPPFLAGS += -fexceptions -frtti
APP_OPTIM := release
APP_PLATFORM := android-21
Expand Down
2 changes: 1 addition & 1 deletion Android/pluginlibs/signalflowgraph/jni/Application.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
APP_ABI := armeabi-v7a arm64-v8a
APP_ABI := armeabi-v7a arm64-v8a x86 x86_64
APP_CPPFLAGS += -fexceptions -frtti
APP_OPTIM := release
APP_PLATFORM := android-21
Expand Down
2 changes: 1 addition & 1 deletion Engine/namedins.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ MYFLT named_instr_find_in_engine(CSOUND *csound, char *s,
buff[len] = '\0';
inm = cs_hash_table_get(csound, engineState->instrumentNames, buff);
frac = atof(tt);
// printf("** fraction found %f\n", frac);
//printf("** fraction found %f\n", frac);
return (inm == NULL) ? 0L : (ss ? -(inm->instno+frac) : inm->instno+frac);
}
}
Expand Down
8 changes: 5 additions & 3 deletions Opcodes/serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ uintptr_t arduino_listen(void *p)
uint16_t c, val;
ARDUINO_GLOBALS *q = (ARDUINO_GLOBALS*)p;
CSOUND *csound = q->csound;
//printf("Q=%p\n", q);
if (DEBUG) printf("Q=%p\n", q);
// Read until we see a header word
while((c = arduino_get_byte(q->port))!=SYN) {
if (DEBUG) printf("ignore low %.2x\n", c);
Expand All @@ -579,7 +579,7 @@ uintptr_t arduino_listen(void *p)
if (q->stop)
//#ifndef WIN32
//pthread_exit(NULL);
//#else
//#elsex
return 0;
//#endif
low = arduino_get_byte(q->port);
Expand All @@ -589,6 +589,8 @@ uintptr_t arduino_listen(void *p)
if (DEBUG) printf("low hi = %.2x %.2x\n", low, hi);
val = ((hi&0x7)<<7) | (low&0x7f);
c = (hi>>3)&0x1f;
if (DEBUG) printf("In bits: va1=%.2x va2= %.2x; c1=%.2x\n",
(hi&0x7)<<7, low&0x7f, (hi>>3)&0x1f);
if (DEBUG) printf("Sensor %d value %d(%.2x)\n", c, val, val);
q->buffer[c] = val;
}
Expand Down Expand Up @@ -672,7 +674,7 @@ int32_t arduinoRead(CSOUND* csound, ARD_READ* p)
csound->LockMutex(q->lock);
val = (MYFLT)q->values[ind];
csound->UnlockMutex(q->lock);
//printf("ind %d val %d\n", ind, q->values[ind]);
if (DEBUG) printf("ind %d val %d\n", ind, q->values[ind]);
p->yt1 = p->c1 * val + p->c2 * p->yt1;
*p->val = p->yt1;
return OK;
Expand Down
107 changes: 54 additions & 53 deletions cmake/CompilerOptimizations.cmake
Original file line number Diff line number Diff line change
@@ -1,53 +1,54 @@

check_c_compiler_flag(-ftree-vectorize HAS_TREE_VECTORIZE)
check_cxx_compiler_flag(-ftree-vectorize HAS_CXX_TREE_VECTORIZE)
if (HAS_TREE_VECTORISE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ftree-vectorize")
endif()
if (HAS_CXX_TREE_VECTORISE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftree-vectorize")
endif()


check_c_compiler_flag(-ffast-math HAS_FAST_MATH)
check_cxx_compiler_flag(-ffast-math HAS_CXX_FAST_MATH)
if (HAS_FAST_MATH AND NOT MINGW)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffast-math")
endif()
if (HAS_CXX_FAST_MATH AND NOT MINGW)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffast-math")
endif()



if(NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
check_c_compiler_flag(-mfpmath=sse HAS_FPMATH_SSE)
check_cxx_compiler_flag(-mfpmath=sse HAS_CXX_FPMATH_SSE)
if (HAS_FPMATH_SSE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfpmath=sse")
endif()
if (HAS_CXX_FPMATH_SSE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpmath=sse")
endif()

endif()


check_c_compiler_flag(-msse2 HAS_SSE2)
check_cxx_compiler_flag(-msse2 HAS_CXX_SSE2)
if (HAS_SSE2 AND NOT IOS AND NOT WASM)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2")
endif()
if (HAS_CXX_SSE2 AND NOT IOS AND NOT WASM)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2")
endif()


check_c_compiler_flag(-fomit-frame-pointer HAS_OMIT_FRAME_POINTER)
check_cxx_compiler_flag(-fomit-frame-pointer HAS_CXX_OMIT_FRAME_POINTER)
if (HAS_OMIT_FRAME_POINTER)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fomit-frame-pointer")
endif()
if (HAS_CXX_OMIT_FRAME_POINTER)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fomit-frame-pointer")
endif()

check_c_compiler_flag(-ftree-vectorize HAS_TREE_VECTORIZE)
check_cxx_compiler_flag(-ftree-vectorize HAS_CXX_TREE_VECTORIZE)
if (HAS_TREE_VECTORISE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ftree-vectorize")
endif()
if (HAS_CXX_TREE_VECTORISE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftree-vectorize")
endif()


check_c_compiler_flag(-ffast-math HAS_FAST_MATH)
check_cxx_compiler_flag(-ffast-math HAS_CXX_FAST_MATH)
if (HAS_FAST_MATH AND NOT MINGW)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffast-math")
endif()
if (HAS_CXX_FAST_MATH AND NOT MINGW)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffast-math")
endif()



if(NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
check_c_compiler_flag(-mfpmath=sse HAS_FPMATH_SSE)
check_cxx_compiler_flag(-mfpmath=sse HAS_CXX_FPMATH_SSE)
if (HAS_FPMATH_SSE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfpmath=sse")
endif()
if (HAS_CXX_FPMATH_SSE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpmath=sse")
endif()

endif()


check_c_compiler_flag(-msse2 HAS_SSE2)
check_cxx_compiler_flag(-msse2 HAS_CXX_SSE2)
message(STATUS "CPU: ${CMAKE_SYSTEM_PROCESSOR}")
if (HAS_SSE2 AND NOT IOS AND NOT WASM AND NOT CMAKE_SYSTEM_PROCESSOR MATCHES "arm")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2")
endif()
if (HAS_CXX_SSE2 AND NOT IOS AND NOT WASM AND NOT CMAKE_SYSTEM_PROCESSOR MATCHES "arm")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2")
endif()


check_c_compiler_flag(-fomit-frame-pointer HAS_OMIT_FRAME_POINTER)
check_cxx_compiler_flag(-fomit-frame-pointer HAS_CXX_OMIT_FRAME_POINTER)
if (HAS_OMIT_FRAME_POINTER)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fomit-frame-pointer")
endif()
if (HAS_CXX_OMIT_FRAME_POINTER)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fomit-frame-pointer")
endif()

0 comments on commit c12f8e1

Please sign in to comment.