├── .gitattributes ├── .gitignore ├── CMakeLists.txt ├── CONTRIBUTING.md ├── GNUlinux_config.cmake ├── LICENSE ├── README.md ├── android ├── Android.mk ├── NE10Demo │ ├── AndroidManifest.xml │ ├── assets │ │ ├── demo.html │ │ └── main.js │ ├── jni │ │ ├── Android.mk │ │ ├── CMakeLists.txt │ │ ├── NE10_test_demo.c │ │ └── test_funcs.h │ ├── proguard-project.txt │ ├── project.properties │ ├── res │ │ ├── drawable-hdpi │ │ │ └── ic_launcher.png │ │ ├── drawable-mdpi │ │ │ └── ic_launcher.png │ │ ├── drawable-xhdpi │ │ │ └── ic_launcher.png │ │ ├── drawable-xxhdpi │ │ │ └── ic_launcher.png │ │ ├── layout │ │ │ └── activity_main.xml │ │ ├── menu │ │ │ └── main.xml │ │ ├── values-sw600dp │ │ │ └── dimens.xml │ │ ├── values-sw720dp-land │ │ │ └── dimens.xml │ │ ├── values-v11 │ │ │ └── styles.xml │ │ ├── values-v14 │ │ │ └── styles.xml │ │ └── values │ │ │ ├── dimens.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ └── src │ │ └── com │ │ └── arm │ │ └── ne10 │ │ └── demo │ │ └── MainActivity.java └── android_config.cmake ├── circle.yml ├── circle ├── build_android.sh ├── build_ios.sh └── build_linux.sh ├── cmake └── FunctionSwitch.cmake ├── common ├── NE10_mask_table.c ├── NE10_mask_table.h ├── NE10header.s ├── factor.h ├── macros.h ├── versionheader.h └── versionheader.s ├── dco.txt ├── doc ├── Doxyfile ├── LICENSE ├── NOTICE ├── building.md └── images │ ├── CFFT.gif │ ├── FIR.gif │ ├── FIRDecimator.gif │ ├── FIRInterpolator.gif │ ├── FIRLattice.gif │ ├── FIRSparse.gif │ ├── IIRLattice.gif │ ├── RFFT.gif │ ├── RIFFT.gif │ └── ne10.png ├── inc ├── NE10.h ├── NE10_dsp.h ├── NE10_imgproc.h ├── NE10_init.h ├── NE10_macros.h ├── NE10_math.h ├── NE10_physics.h └── NE10_types.h ├── ios ├── CMakeLists.txt ├── NE10Demo │ ├── Default-568h@2x.png │ ├── Default-Portrait@2x~ipad.png │ ├── Default-Portrait~ipad.png │ ├── Default.png │ ├── Default@2x.png │ ├── NE10Demo.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcuserdata │ │ │ │ └── zhongwei.xcuserdatad │ │ │ │ └── WorkspaceSettings.xcsettings │ │ └── xcuserdata │ │ │ └── zhongwei.xcuserdatad │ │ │ └── xcschemes │ │ │ ├── NE10Demo.xcscheme │ │ │ └── xcschememanagement.plist │ ├── NE10Demo │ │ ├── NE10Demo-Info.plist │ │ ├── NE10Demo-Prefix.pch │ │ ├── NE10DemoAppDelegate.h │ │ ├── NE10DemoAppDelegate.m │ │ ├── NE10DemoViewController.h │ │ ├── NE10DemoViewController.m │ │ ├── NE10_runtest.c │ │ ├── demo.html │ │ ├── en.lproj │ │ │ ├── InfoPlist.strings │ │ │ ├── MainStoryboard_iPad.storyboard │ │ │ └── MainStoryboard_iPhone.storyboard │ │ ├── main.js │ │ ├── main.m │ │ └── test_funcs.h │ ├── icon_pad1.png │ ├── icon_pad2.png │ ├── icon_phone1.png │ └── icon_phone2.png └── ios_config.cmake ├── modules ├── CMakeLists.txt ├── NE10_init.c ├── dsp │ ├── NE10_fft.c │ ├── NE10_fft.h │ ├── NE10_fft.neonintrinsic.h │ ├── NE10_fft_bfly.h │ ├── NE10_fft_common_varibles.h │ ├── NE10_fft_cplx_ops.h │ ├── NE10_fft_debug_macro.h │ ├── NE10_fft_float32.c │ ├── NE10_fft_float32.neon.c │ ├── NE10_fft_float32.neon.s │ ├── NE10_fft_float32.neonintrinsic.c │ ├── NE10_fft_float32.neonv8.S │ ├── NE10_fft_generic_float32.c │ ├── NE10_fft_generic_float32.h │ ├── NE10_fft_generic_float32.neonintrinsic.cpp │ ├── NE10_fft_generic_int32.cpp │ ├── NE10_fft_generic_int32.h │ ├── NE10_fft_generic_int32.neonintrinsic.cpp │ ├── NE10_fft_generic_int32.neonintrinsic.h │ ├── NE10_fft_int16.c │ ├── NE10_fft_int16.neon.c │ ├── NE10_fft_int16.neon.s │ ├── NE10_fft_int16.neonintrinsic.c │ ├── NE10_fft_int32.c │ ├── NE10_fft_int32.neon.c │ ├── NE10_fft_int32.neon.s │ ├── NE10_fft_int32.neonintrinsic.c │ ├── NE10_fir.c │ ├── NE10_fir.neon.s │ ├── NE10_fir_init.c │ ├── NE10_iir.c │ ├── NE10_iir.neon.s │ ├── NE10_iir_init.c │ ├── NE10_init_dsp.c │ ├── NE10_rfft_float32.c │ ├── NE10_rfft_float32.neonintrinsic.c │ └── test │ │ ├── test_main.c │ │ ├── test_suite_fft_float32.c │ │ ├── test_suite_fft_int16.c │ │ ├── test_suite_fft_int32.c │ │ ├── test_suite_fir.c │ │ ├── test_suite_fir_decimate.c │ │ ├── test_suite_fir_interpolate.c │ │ ├── test_suite_fir_lattice.c │ │ ├── test_suite_fir_sparse.c │ │ └── test_suite_iir.c ├── imgproc │ ├── NE10_boxfilter.c │ ├── NE10_boxfilter.neon.c │ ├── NE10_init_imgproc.c │ ├── NE10_resize.c │ ├── NE10_resize.neon.c │ ├── NE10_rotate.c │ ├── NE10_rotate.neon.s │ └── test │ │ ├── test_main.c │ │ ├── test_suite_boxfilter.c │ │ ├── test_suite_resize.c │ │ └── test_suite_rotate.c ├── math │ ├── NE10_abs.asm.s │ ├── NE10_abs.c │ ├── NE10_abs.neon.s │ ├── NE10_add.asm.s │ ├── NE10_add.c │ ├── NE10_add.neon.s │ ├── NE10_addc.asm.s │ ├── NE10_addc.c │ ├── NE10_addc.neon.c │ ├── NE10_addmat.asm.s │ ├── NE10_addmat.c │ ├── NE10_addmat.neon.c │ ├── NE10_cross.asm.s │ ├── NE10_cross.c │ ├── NE10_cross.neon.s │ ├── NE10_detmat.asm.s │ ├── NE10_detmat.c │ ├── NE10_detmat.c.h │ ├── NE10_detmat.neon.inc.s │ ├── NE10_detmat.neon.s │ ├── NE10_div.asm.s │ ├── NE10_div.c │ ├── NE10_div.neon.s │ ├── NE10_divc.asm.s │ ├── NE10_divc.c │ ├── NE10_divc.neon.c │ ├── NE10_dot.asm.s │ ├── NE10_dot.c │ ├── NE10_dot.neon.s │ ├── NE10_identitymat.asm.s │ ├── NE10_identitymat.c │ ├── NE10_identitymat.neon.s │ ├── NE10_init_math.c │ ├── NE10_invmat.asm.s │ ├── NE10_invmat.c │ ├── NE10_invmat.neon.s │ ├── NE10_len.asm.s │ ├── NE10_len.c │ ├── NE10_len.neon.s │ ├── NE10_mla.asm.s │ ├── NE10_mla.c │ ├── NE10_mla.neon.s │ ├── NE10_mlac.asm.s │ ├── NE10_mlac.c │ ├── NE10_mlac.neon.c │ ├── NE10_mul.asm.s │ ├── NE10_mul.c │ ├── NE10_mul.neon.s │ ├── NE10_mulc.asm.s │ ├── NE10_mulc.c │ ├── NE10_mulc.neon.c │ ├── NE10_mulcmatvec.asm.s │ ├── NE10_mulcmatvec.c │ ├── NE10_mulcmatvec.neon.s │ ├── NE10_mulmat.asm.s │ ├── NE10_mulmat.c │ ├── NE10_mulmat.neon.s │ ├── NE10_normalize.asm.s │ ├── NE10_normalize.c │ ├── NE10_normalize.neon.s │ ├── NE10_rsbc.asm.s │ ├── NE10_rsbc.c │ ├── NE10_rsbc.neon.c │ ├── NE10_setc.asm.s │ ├── NE10_setc.c │ ├── NE10_setc.neon.c │ ├── NE10_sub.asm.s │ ├── NE10_sub.c │ ├── NE10_sub.neon.s │ ├── NE10_subc.asm.s │ ├── NE10_subc.c │ ├── NE10_subc.neon.c │ ├── NE10_submat.asm.s │ ├── NE10_submat.c │ ├── NE10_submat.neon.c │ ├── NE10_transmat.asm.s │ ├── NE10_transmat.c │ ├── NE10_transmat.neon.s │ └── test │ │ ├── test_main.c │ │ └── test_suite_math.c └── physics │ ├── NE10_init_physics.c │ ├── NE10_physics.c │ ├── NE10_physics.neon.c │ ├── NE10_physics.neon.s │ └── test │ ├── test_main.c │ └── test_suite_physics.c ├── samples ├── CMakeLists.txt ├── NE10_sample_complex_fft.c ├── NE10_sample_fir.c ├── NE10_sample_intro.c ├── NE10_sample_matrix_multiply.c ├── NE10_sample_real_fft.c └── NE10_samples.c ├── test ├── CMakeLists.txt ├── include │ ├── NE10_random.h │ ├── seatest.h │ └── unit_test_common.h ├── license_seatest.txt └── src │ ├── NE10_random.c │ ├── seatest.c │ └── unit_test_common.c └── tools ├── change_copyright.py ├── cleanall.sh ├── gas2ios_convert.py ├── getlog.sh ├── removetabs.sh └── review.sh /.gitattributes: -------------------------------------------------------------------------------- 1 | temp/* -diff 2 | 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # ignore executables 2 | *.ex 3 | 4 | # ignore binary/compiled files 5 | *.[oa] 6 | 7 | # ignore temporary files 8 | *~ 9 | .DS_Store 10 | 11 | # ignore vim files 12 | .*.swp 13 | 14 | # ignore output text files 15 | testlog.txt 16 | res_*.txt 17 | 18 | # Release files 19 | release_* 20 | release_*/* 21 | NE10_*.tgz 22 | docs/* 23 | doc/* 24 | 25 | #build directory 26 | build/ 27 | 28 | # throw away xcode project all personal settings 29 | xcuserdata 30 | 31 | # built application files 32 | *.apk 33 | *.ap_ 34 | 35 | # files for the dex VM 36 | *.dex 37 | 38 | # Java class files 39 | *.class 40 | 41 | # generated files 42 | bin/ 43 | gen/ 44 | 45 | # Local configuration file (sdk path, etc) 46 | local.properties 47 | 48 | # Eclipse project files 49 | .classpath 50 | .project 51 | *.prefs 52 | 53 | *.so 54 | 55 | -------------------------------------------------------------------------------- /GNUlinux_config.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2013-16 ARM Limited and Contributors. 3 | # All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are met: 7 | # * Redistributions of source code must retain the above copyright 8 | # notice, this list of conditions and the following disclaimer. 9 | # * Redistributions in binary form must reproduce the above copyright 10 | # notice, this list of conditions and the following disclaimer in the 11 | # documentation and/or other materials provided with the distribution. 12 | # * Neither the name of ARM Limited nor the 13 | # names of its contributors may be used to endorse or promote products 14 | # derived from this software without specific prior written permission. 15 | # 16 | # THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | # DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | # 27 | 28 | # Usage: 29 | # $ mkdir build && cd build 30 | # $ cmake -DCMAKE_TOOLCHAIN_FILE=path/of/GNUlinux_config.cmake .. 31 | # $ make 32 | # 33 | # Option: 34 | # - Choose target architecture 35 | # Target architecture can be specified by setting NE10_LINUX_TARGET_ARCH to 36 | # armv7 or aarch64 (Not done yet). Defaut is armv7. 37 | 38 | set(GNULINUX_PLATFORM ON) 39 | set(CMAKE_SYSTEM_NAME "Linux") 40 | set(CMAKE_SYSTEM_PROCESSOR "arm") 41 | 42 | if(NOT DEFINED ENV{NE10_LINUX_TARGET_ARCH}) 43 | set(NE10_LINUX_TARGET_ARCH "armv7") 44 | else() 45 | set(NE10_LINUX_TARGET_ARCH $ENV{NE10_LINUX_TARGET_ARCH}) 46 | endif() 47 | 48 | if(NE10_LINUX_TARGET_ARCH STREQUAL "armv7") 49 | set(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc) 50 | set(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++) 51 | set(CMAKE_ASM_COMPILER arm-linux-gnueabihf-as) 52 | find_program(CMAKE_AR NAMES "arm-linux-gnueabihf-ar") 53 | find_program(CMAKE_RANLIB NAMES "arm-linux-gnueabihf-ranlib") 54 | elseif(NE10_LINUX_TARGET_ARCH STREQUAL "aarch64") 55 | set(CMAKE_C_COMPILER aarch64-linux-gnu-gcc) 56 | set(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++) 57 | set(CMAKE_ASM_COMPILER aarch64-linux-gnu-as) 58 | find_program(CMAKE_AR NAMES "aarch64-linux-gnu-ar") 59 | find_program(CMAKE_RANLIB NAMES "aarch64-linux-gnu-ranlib") 60 | endif() 61 | 62 | mark_as_advanced(CMAKE_AR) 63 | mark_as_advanced(CMAKE_RANLIB) 64 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-16 ARM Limited and Contributors. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ARM Limited nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * See: http://opensource.org/licenses/BSD-3-Clause for template 30 | */ 31 | -------------------------------------------------------------------------------- /android/NE10Demo/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 16 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /android/NE10Demo/jni/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | LOCAL_MODULE := NE10_test_demo 6 | LOCAL_SRC_FILES := NE10_test_demo.c 7 | 8 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../inc 9 | LOCAL_CFLAGS := -L 10 | LOCAL_LDLIBS := -lNE10_test 11 | 12 | include $(BUILD_SHARED_LIBRARY) 13 | -------------------------------------------------------------------------------- /android/NE10Demo/jni/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2013-16 ARM Limited and Contributors. 3 | # All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are met: 7 | # * Redistributions of source code must retain the above copyright 8 | # notice, this list of conditions and the following disclaimer. 9 | # * Redistributions in binary form must reproduce the above copyright 10 | # notice, this list of conditions and the following disclaimer in the 11 | # documentation and/or other materials provided with the distribution. 12 | # * Neither the name of ARM Limited nor the 13 | # names of its contributors may be used to endorse or promote products 14 | # derived from this software without specific prior written permission. 15 | # 16 | # THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | # DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | # 27 | 28 | # we run performance test in Android Demo 29 | add_definitions(-DPERFORMANCE_TEST) 30 | 31 | include_directories ( 32 | ${PROJECT_SOURCE_DIR}/inc 33 | ${PROJECT_SOURCE_DIR}/test/include 34 | ) 35 | 36 | # Define common test files. 37 | set(NE10_TEST_COMMON_SRCS 38 | ${PROJECT_SOURCE_DIR}/test/src/seatest.c 39 | ${PROJECT_SOURCE_DIR}/test/src/unit_test_common.c 40 | ${PROJECT_SOURCE_DIR}/test/src/NE10_random.c 41 | ) 42 | 43 | # Define math test files. 44 | set(NE10_TEST_MATH_SRCS 45 | ${PROJECT_SOURCE_DIR}/modules/math/test/test_suite_math.c 46 | ) 47 | 48 | # Define dsp test files. 49 | set(NE10_TEST_DSP_SRCS 50 | ${PROJECT_SOURCE_DIR}/modules/dsp/test/test_main.c 51 | ${PROJECT_SOURCE_DIR}/modules/dsp/test/test_suite_fir.c 52 | ${PROJECT_SOURCE_DIR}/modules/dsp/test/test_suite_fir_decimate.c 53 | ${PROJECT_SOURCE_DIR}/modules/dsp/test/test_suite_fir_interpolate.c 54 | ${PROJECT_SOURCE_DIR}/modules/dsp/test/test_suite_fir_lattice.c 55 | ${PROJECT_SOURCE_DIR}/modules/dsp/test/test_suite_fir_sparse.c 56 | ${PROJECT_SOURCE_DIR}/modules/dsp/test/test_suite_iir.c 57 | ${PROJECT_SOURCE_DIR}/modules/dsp/test/test_suite_fft_float32.c 58 | ${PROJECT_SOURCE_DIR}/modules/dsp/test/test_suite_fft_int16.c 59 | ${PROJECT_SOURCE_DIR}/modules/dsp/test/test_suite_fft_int32.c 60 | ) 61 | 62 | add_library(NE10_test_demo SHARED 63 | ${NE10_TEST_MATH_SRCS} 64 | ${NE10_TEST_COMMON_SRCS} 65 | ${NE10_TEST_DSP_SRCS} 66 | NE10_test_demo.c) 67 | 68 | #add the static NE10 to target 69 | target_link_libraries(NE10_test_demo 70 | NE10 71 | m 72 | ) 73 | 74 | #install NE10_test_demo library to android demo apk library directory. 75 | install(TARGETS NE10_test_demo 76 | DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/../libs/armeabi/) 77 | -------------------------------------------------------------------------------- /android/NE10Demo/jni/NE10_test_demo.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-16 ARM Limited and Contributors. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ARM Limited nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | #include 28 | #include 29 | #include 30 | #include "NE10.h" 31 | #include "test_funcs.h" 32 | #include "unit_test_common.h" 33 | 34 | jstring 35 | Java_com_arm_ne10_demo_MainActivity_NE10RunTest(JNIEnv *env, 36 | jobject thiz) 37 | { 38 | static int test_count = 0; 39 | 40 | void (*test_funcs[])(void) = {test_abs, test_addc, test_add, test_divc, 41 | test_div, test_dot, test_len, test_mlac, 42 | test_mla, test_mulc, test_mul, test_normalize, 43 | test_rsbc, test_setc, test_subc, test_sub, 44 | test_addmat, test_detmat, test_identitymat, 45 | test_invmat, test_mulmat, test_mulcmatvec, 46 | test_submat, test_transmat, 47 | test_fir, test_fir_decimate, 48 | test_fir_interpolate, test_fir_lattice, 49 | test_fir_sparse, test_iir_lattice}; 50 | 51 | while (test_count < (sizeof(test_funcs) / sizeof(void (*)(void)))) { 52 | /* ne10_log_buffer is a global buffer which contain test's result 53 | * ne10_log_buffer's position need be setup first 54 | */ 55 | ne10_log_buffer_ptr = ne10_log_buffer; 56 | *ne10_log_buffer_ptr++ = '['; 57 | 58 | (*test_funcs[test_count])(); 59 | ++test_count; 60 | 61 | /* ne10_log_buffer_ptr is updated in test_funcs */ 62 | --ne10_log_buffer_ptr; 63 | *ne10_log_buffer_ptr = ']'; 64 | 65 | return ((*env)->NewStringUTF(env, ne10_log_buffer)); 66 | } 67 | return NULL; 68 | } 69 | -------------------------------------------------------------------------------- /android/NE10Demo/jni/test_funcs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-16 ARM Limited and Contributors. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ARM Limited nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | #ifndef TEST_FUNCS_H 28 | #define TEST_FUNCS_H 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | void test_abs(); 35 | void test_addc(); 36 | void test_add(); 37 | void test_divc(); 38 | void test_div(); 39 | void test_dot(); 40 | void test_len(); 41 | void test_mlac(); 42 | void test_mla(); 43 | void test_mulc(); 44 | void test_mul(); 45 | void test_normalize(); 46 | void test_rsbc(); 47 | void test_setc(); 48 | void test_subc(); 49 | void test_sub(); 50 | void test_addmat(); 51 | void test_detmat(); 52 | void test_identitymat(); 53 | void test_invmat(); 54 | void test_mulmat(); 55 | void test_mulcmatvec(); 56 | void test_submat(); 57 | void test_transmat(); 58 | 59 | void test_fir(); 60 | void test_fir_decimate(); 61 | void test_fir_interpolate(); 62 | void test_fir_lattice(); 63 | void test_fir_sparse(); 64 | void test_iir_lattice(); 65 | 66 | #ifdef __cplusplus 67 | } 68 | #endif 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /android/NE10Demo/proguard-project.txt: -------------------------------------------------------------------------------- 1 | # To enable ProGuard in your project, edit project.properties 2 | # to define the proguard.config property as described in that file. 3 | # 4 | # Add project specific ProGuard rules here. 5 | # By default, the flags in this file are appended to flags specified 6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt 7 | # You can edit the include path and order by changing the ProGuard 8 | # include property in project.properties. 9 | # 10 | # For more details, see 11 | # http://developer.android.com/guide/developing/tools/proguard.html 12 | 13 | # Add any project specific keep options here: 14 | 15 | # If your project uses WebView with JS, uncomment the following 16 | # and specify the fully qualified class name to the JavaScript interface 17 | # class: 18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 19 | # public *; 20 | #} 21 | -------------------------------------------------------------------------------- /android/NE10Demo/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system edit 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | # 10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): 11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 12 | 13 | # Project target. 14 | target=android-17 15 | -------------------------------------------------------------------------------- /android/NE10Demo/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectNe10/Ne10/1f059a764d0e1bc2481c0055c0e71538470baa83/android/NE10Demo/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/NE10Demo/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectNe10/Ne10/1f059a764d0e1bc2481c0055c0e71538470baa83/android/NE10Demo/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/NE10Demo/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectNe10/Ne10/1f059a764d0e1bc2481c0055c0e71538470baa83/android/NE10Demo/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/NE10Demo/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectNe10/Ne10/1f059a764d0e1bc2481c0055c0e71538470baa83/android/NE10Demo/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/NE10Demo/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /android/NE10Demo/res/menu/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /android/NE10Demo/res/values-sw600dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | -------------------------------------------------------------------------------- /android/NE10Demo/res/values-sw720dp-land/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 128dp 8 | 9 | -------------------------------------------------------------------------------- /android/NE10Demo/res/values-v11/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /android/NE10Demo/res/values-v14/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 11 | 12 | -------------------------------------------------------------------------------- /android/NE10Demo/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16dp 5 | 16dp 6 | 7 | -------------------------------------------------------------------------------- /android/NE10Demo/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | demo 5 | Settings 6 | Hello world! 7 | 8 | -------------------------------------------------------------------------------- /android/NE10Demo/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 14 | 15 | 16 | 19 | 20 | -------------------------------------------------------------------------------- /circle/build_android.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | export ANDROID_NDK=${HOME}/android-ndk 6 | export NE10_ANDROID_TARGET_ARCH=${ARCH:-armv7} 7 | BUILD_DEBUG=${DEBUG:-0} 8 | 9 | TEST_TYPES=" 10 | -DNE10_SMOKE_TEST=ON \ 11 | -DNE10_REGRESSION_TEST=ON \ 12 | -DNE10_PERFORMANCE_TEST=ON 13 | " 14 | for test_type in ${TEST_TYPES}; do 15 | rm -rf build && mkdir build && pushd build 16 | cmake \ 17 | -DCMAKE_TOOLCHAIN_FILE=../android/android_config.cmake \ 18 | -DNE10_BUILD_UNIT_TEST=ON \ 19 | -DBUILD_DEBUG=${BUILD_DEBUG} \ 20 | ${test_type} \ 21 | .. 22 | VERBOSE=1 make -j8 23 | popd 24 | done 25 | -------------------------------------------------------------------------------- /circle/build_ios.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | export IOS_DEVELOPER_PATH=/Applications/Xcode.app/Contents/Developer 6 | export NE10_IOS_TARGET_ARCH=${ARCH:-armv7} 7 | BUILD_DEBUG=${DEBUG:-0} 8 | 9 | TEST_TYPES=" 10 | -DNE10_SMOKE_TEST=ON \ 11 | -DNE10_REGRESSION_TEST=ON \ 12 | -DNE10_PERFORMANCE_TEST=ON 13 | " 14 | for test_type in ${TEST_TYPES}; do 15 | rm -rf build && mkdir build && pushd build 16 | cmake \ 17 | -DCMAKE_TOOLCHAIN_FILE=../ios/ios_config.cmake \ 18 | -DNE10_BUILD_UNIT_TEST=ON \ 19 | -DBUILD_DEBUG=${BUILD_DEBUG} \ 20 | ${test_type} \ 21 | .. 22 | VERBOSE=1 make -j8 23 | popd 24 | done 25 | -------------------------------------------------------------------------------- /circle/build_linux.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | export NE10_LINUX_TARGET_ARCH=${ARCH:-armv7} 6 | BUILD_DEBUG=${DEBUG:-0} 7 | 8 | TEST_TYPES=" 9 | -DNE10_SMOKE_TEST=ON \ 10 | -DNE10_REGRESSION_TEST=ON \ 11 | -DNE10_PERFORMANCE_TEST=ON 12 | " 13 | for test_type in ${TEST_TYPES}; do 14 | rm -rf build && mkdir build && pushd build 15 | cmake \ 16 | -DCMAKE_TOOLCHAIN_FILE=../GNUlinux_config.cmake \ 17 | -DNE10_BUILD_UNIT_TEST=ON \ 18 | -DBUILD_DEBUG=${BUILD_DEBUG} \ 19 | ${test_type} \ 20 | .. 21 | VERBOSE=1 make -j8 22 | popd 23 | done 24 | -------------------------------------------------------------------------------- /cmake/FunctionSwitch.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-16 ARM Limited and Contributors. 3 | # All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are met: 7 | # * Redistributions of source code must retain the above copyright 8 | # notice, this list of conditions and the following disclaimer. 9 | # * Redistributions in binary form must reproduce the above copyright 10 | # notice, this list of conditions and the following disclaimer in the 11 | # documentation and/or other materials provided with the distribution. 12 | # * Neither the name of ARM Limited nor the 13 | # names of its contributors may be used to endorse or promote products 14 | # derived from this software without specific prior written permission. 15 | # 16 | # THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | # DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | # 27 | 28 | # Following definition is only available under armv7. 29 | if("${NE10_TARGET_ARCH}" STREQUAL "armv7") 30 | if(IOS_PLATFORM) 31 | # We use intrinsic for iOS, no definition is needed. 32 | else() 33 | if(NE10_ENABLE_DSP) 34 | add_definitions(-DENABLE_NE10_FIR_FLOAT_NEON) 35 | add_definitions(-DENABLE_NE10_FIR_DECIMATE_FLOAT_NEON) 36 | add_definitions(-DENABLE_NE10_FIR_INTERPOLATE_FLOAT_NEON) 37 | add_definitions(-DENABLE_NE10_FIR_LATTICE_FLOAT_NEON) 38 | add_definitions(-DENABLE_NE10_FIR_SPARSE_FLOAT_NEON) 39 | add_definitions(-DENABLE_NE10_IIR_LATTICE_FLOAT_NEON) 40 | endif() 41 | if(NE10_ENABLE_PHYSICS) 42 | add_definitions(-DENABLE_NE10_PHYSICS_COMPUTE_AABB_VEC2F_NEON) 43 | add_definitions(-DENABLE_NE10_PHYSICS_RELATIVE_V_VEC2F_NEON) 44 | add_definitions(-DENABLE_NE10_PHYSICS_APPLY_IMPULSE_VEC2F_NEON) 45 | endif() 46 | if(NE10_ENABLE_IMGPROC) 47 | add_definitions(-DENABLE_NE10_IMG_ROTATE_RGBA_NEON) 48 | endif() 49 | endif() 50 | endif() 51 | -------------------------------------------------------------------------------- /common/NE10_mask_table.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-16 ARM Limited and Contributors. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ARM Limited nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * NE10 Library : common/NE10_mask_table.h 30 | */ 31 | 32 | #include "NE10_types.h" 33 | #ifndef _ARM_MASK_TABLE_H 34 | #define _ARM_MASK_TABLE_H 35 | 36 | #define Q_MASK_TABLE_SIZE 20 37 | #define D_MASK_TABLE_SIZE 6 38 | #define DIV_LOOKUP_TABLE_SIZE 255 39 | 40 | /* mask table for dsp module */ 41 | extern const ne10_uint32_t ne10_qMaskTable32[Q_MASK_TABLE_SIZE] asm ("ne10_qMaskTable32"); 42 | extern const ne10_uint32_t ne10_dMaskTable32[D_MASK_TABLE_SIZE] asm ("ne10_dMaskTable32"); 43 | extern const ne10_uint32_t ne10_divLookUpTable[DIV_LOOKUP_TABLE_SIZE] \ 44 | asm ("ne10_divLookUpTable"); 45 | 46 | /* mask table for imgproc module */ 47 | #define NE10_VRESIZE_LINEAR_MASK_TABLE_SIZE 7 48 | extern const ne10_uint64_t ne10_img_vresize_linear_mask_residual_table[NE10_VRESIZE_LINEAR_MASK_TABLE_SIZE] \ 49 | asm ("ne10_vresize_mask_residual_table"); 50 | 51 | #endif 52 | 53 | -------------------------------------------------------------------------------- /common/NE10header.s: -------------------------------------------------------------------------------- 1 | @ 2 | @ Copyright 2011-16 ARM Limited and Contributors. 3 | @ All rights reserved. 4 | @ 5 | @ Redistribution and use in source and binary forms, with or without 6 | @ modification, are permitted provided that the following conditions are met: 7 | @ * Redistributions of source code must retain the above copyright 8 | @ notice, this list of conditions and the following disclaimer. 9 | @ * Redistributions in binary form must reproduce the above copyright 10 | @ notice, this list of conditions and the following disclaimer in the 11 | @ documentation and/or other materials provided with the distribution. 12 | @ * Neither the name of ARM Limited nor the 13 | @ names of its contributors may be used to endorse or promote products 14 | @ derived from this software without specific prior written permission. 15 | @ 16 | @ THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | @ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | @ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | @ DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | @ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | @ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | @ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | @ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | @ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | @ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | @ 27 | 28 | @ 29 | @ NE10 Library : common/NE10header.s 30 | @ 31 | 32 | .include "versionheader.s" 33 | 34 | @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 35 | @ constant values that are used across the library 36 | @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 37 | .equ NE10_OK, 0 38 | .equ NE10_ERR, -1 39 | -------------------------------------------------------------------------------- /common/versionheader.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-16 ARM Limited and Contributors. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ARM Limited nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * NE10 Library : common/versionheader.h 30 | */ 31 | 32 | ///////////////////////////////////////////////////////// 33 | // version information 34 | ///////////////////////////////////////////////////////// 35 | 36 | #define VERSION_MAJOR 0 37 | #define VERSION_MINOR 9 38 | #define VERSION_REVISION 10 39 | 40 | #define PHASE 1 41 | #define COPYRIGHT_YEAR 2012 42 | #define COPYRIGHT_HOLDER "ARM Ltd." 43 | -------------------------------------------------------------------------------- /common/versionheader.s: -------------------------------------------------------------------------------- 1 | @ 2 | @ Copyright 2011-16 ARM Limited and Contributors. 3 | @ All rights reserved. 4 | @ 5 | @ Redistribution and use in source and binary forms, with or without 6 | @ modification, are permitted provided that the following conditions are met: 7 | @ * Redistributions of source code must retain the above copyright 8 | @ notice, this list of conditions and the following disclaimer. 9 | @ * Redistributions in binary form must reproduce the above copyright 10 | @ notice, this list of conditions and the following disclaimer in the 11 | @ documentation and/or other materials provided with the distribution. 12 | @ * Neither the name of ARM Limited nor the 13 | @ names of its contributors may be used to endorse or promote products 14 | @ derived from this software without specific prior written permission. 15 | @ 16 | @ THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | @ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | @ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | @ DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | @ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | @ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | @ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | @ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | @ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | @ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | @ 27 | 28 | @ 29 | @ NE10 Library : common/versionheader.s 30 | @ 31 | 32 | @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 33 | @ version information 34 | @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 35 | 36 | .equ VERSION_MAJOR, 0 37 | .equ VERSION_MINOR, 9 38 | .equ VERSION_REVISION, 10 39 | 40 | .equ PHASE, 1 41 | .equ COPYRIGHT_YEAR, 2012 42 | 43 | COPYRIGHT_HOLDER: 44 | .asciz "ARM Ltd." 45 | -------------------------------------------------------------------------------- /dco.txt: -------------------------------------------------------------------------------- 1 | Developer Certificate of Origin 2 | Version 1.1 3 | 4 | Copyright (C) 2004, 2006 The Linux Foundation and its contributors. 5 | 1 Letterman Drive 6 | Suite D4700 7 | San Francisco, CA, 94129 8 | 9 | Everyone is permitted to copy and distribute verbatim copies of this 10 | license document, but changing it is not allowed. 11 | 12 | 13 | Developer's Certificate of Origin 1.1 14 | 15 | By making a contribution to this project, I certify that: 16 | 17 | (a) The contribution was created in whole or in part by me and I 18 | have the right to submit it under the open source license 19 | indicated in the file; or 20 | 21 | (b) The contribution is based upon previous work that, to the best 22 | of my knowledge, is covered under an appropriate open source 23 | license and I have the right under that license to submit that 24 | work with modifications, whether created in whole or in part 25 | by me, under the same open source license (unless I am 26 | permitted to submit under a different license), as indicated 27 | in the file; or 28 | 29 | (c) The contribution was provided directly to me by some other 30 | person who certified (a), (b) or (c) and I have not modified 31 | it. 32 | 33 | (d) I understand and agree that this project and the contribution 34 | are public and that a record of the contribution (including all 35 | personal information I submit with it, including my sign-off) is 36 | maintained indefinitely and may be redistributed consistent with 37 | this project or the open source license(s) involved. 38 | -------------------------------------------------------------------------------- /doc/LICENSE: -------------------------------------------------------------------------------- 1 | ================ 2 | New BSD License: 3 | ================ 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | (1) Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | 12 | (2) Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in 14 | the documentation and/or other materials provided with the 15 | distribution. 16 | 17 | (3)The name of the author may not be used to 18 | endorse or promote products derived from this software without 19 | specific prior written permission. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 22 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, 25 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 27 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 29 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 30 | IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | POSSIBILITY OF SUCH DAMAGE. 32 | -------------------------------------------------------------------------------- /doc/NOTICE: -------------------------------------------------------------------------------- 1 | NE10 Library 2 | Copyright 2011-16 ARM Limited and Contributors. 3 | 4 | This product was produced by ARM Limited and Contributors. 5 | -------------------------------------------------------------------------------- /doc/images/CFFT.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectNe10/Ne10/1f059a764d0e1bc2481c0055c0e71538470baa83/doc/images/CFFT.gif -------------------------------------------------------------------------------- /doc/images/FIR.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectNe10/Ne10/1f059a764d0e1bc2481c0055c0e71538470baa83/doc/images/FIR.gif -------------------------------------------------------------------------------- /doc/images/FIRDecimator.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectNe10/Ne10/1f059a764d0e1bc2481c0055c0e71538470baa83/doc/images/FIRDecimator.gif -------------------------------------------------------------------------------- /doc/images/FIRInterpolator.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectNe10/Ne10/1f059a764d0e1bc2481c0055c0e71538470baa83/doc/images/FIRInterpolator.gif -------------------------------------------------------------------------------- /doc/images/FIRLattice.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectNe10/Ne10/1f059a764d0e1bc2481c0055c0e71538470baa83/doc/images/FIRLattice.gif -------------------------------------------------------------------------------- /doc/images/FIRSparse.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectNe10/Ne10/1f059a764d0e1bc2481c0055c0e71538470baa83/doc/images/FIRSparse.gif -------------------------------------------------------------------------------- /doc/images/IIRLattice.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectNe10/Ne10/1f059a764d0e1bc2481c0055c0e71538470baa83/doc/images/IIRLattice.gif -------------------------------------------------------------------------------- /doc/images/RFFT.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectNe10/Ne10/1f059a764d0e1bc2481c0055c0e71538470baa83/doc/images/RFFT.gif -------------------------------------------------------------------------------- /doc/images/RIFFT.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectNe10/Ne10/1f059a764d0e1bc2481c0055c0e71538470baa83/doc/images/RIFFT.gif -------------------------------------------------------------------------------- /doc/images/ne10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectNe10/Ne10/1f059a764d0e1bc2481c0055c0e71538470baa83/doc/images/ne10.png -------------------------------------------------------------------------------- /inc/NE10.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-16 ARM Limited and Contributors. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ARM Limited nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * NE10 Library : inc/NE10.h 30 | */ 31 | 32 | 33 | /** 34 | * @defgroup groupMaths Math Functions 35 | * 36 | * An assortment of vector/matrix math operations. 37 | */ 38 | 39 | /** 40 | * @defgroup groupDSPs Signal Processing Functions 41 | * 42 | * 43 | * An assortment of signal processing operations, including FFT/IFFT, FIR, 44 | * and IIR operations. 45 | */ 46 | 47 | /** 48 | * @defgroup groupIMGPROCs Image Processing Functions 49 | * 50 | * 51 | * An assortment of image processing operations, including image resize 52 | * and rotation operations. 53 | */ 54 | 55 | /** 56 | * @defgroup groupPhysics Physics Functions 57 | * 58 | * 59 | * An assortment of collision detection operations, including AABB, relative 60 | * velocity, and contact impulse calculations. 61 | */ 62 | 63 | #ifndef NE10_H 64 | #define NE10_H 65 | 66 | #ifdef __cplusplus 67 | extern "C" { 68 | #endif 69 | 70 | #include "NE10_types.h" 71 | #include "NE10_macros.h" 72 | #include "NE10_init.h" 73 | #include "NE10_math.h" 74 | #include "NE10_dsp.h" 75 | #include "NE10_imgproc.h" 76 | #include "NE10_physics.h" 77 | 78 | #ifdef __cplusplus 79 | } 80 | #endif 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /inc/NE10_init.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-16 ARM Limited and Contributors. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ARM Limited nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include "NE10.h" 29 | 30 | #ifndef NE10_init_H 31 | #define NE10_init_H 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | 37 | /*! 38 | This routine returns NE10_OK if the running platform supports NEON, otherwise it returns NE10_ERR 39 | */ 40 | extern ne10_result_t ne10_HasNEON(void); 41 | 42 | /*! 43 | This routine initializes all the function pointers. 44 | */ 45 | extern ne10_result_t ne10_init(void); 46 | 47 | /*! 48 | This routine initializes all the math function pointers defined in "NE10_math.h" with pointers to ARM NEON or ARM VFP implementations. 49 | */ 50 | extern ne10_result_t ne10_init_math (ne10_int32_t is_NEON_available); 51 | extern ne10_result_t ne10_init_dsp (ne10_int32_t is_NEON_available); 52 | 53 | #ifdef __cplusplus 54 | } 55 | #endif 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /ios/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2013-16 ARM Limited and Contributors. 3 | # All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are met: 7 | # * Redistributions of source code must retain the above copyright 8 | # notice, this list of conditions and the following disclaimer. 9 | # * Redistributions in binary form must reproduce the above copyright 10 | # notice, this list of conditions and the following disclaimer in the 11 | # documentation and/or other materials provided with the distribution. 12 | # * Neither the name of ARM Limited nor the 13 | # names of its contributors may be used to endorse or promote products 14 | # derived from this software without specific prior written permission. 15 | # 16 | # THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | # DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | # 27 | 28 | # we run performance test in iOS Demo 29 | add_definitions(-DPERFORMANCE_TEST) 30 | 31 | include_directories ( 32 | ${PROJECT_SOURCE_DIR}/inc 33 | ${PROJECT_SOURCE_DIR}/test/include 34 | ) 35 | 36 | # Define common test files. 37 | set(NE10_TEST_COMMON_SRCS 38 | ${PROJECT_SOURCE_DIR}/test/src/seatest.c 39 | ${PROJECT_SOURCE_DIR}/test/src/unit_test_common.c 40 | ${PROJECT_SOURCE_DIR}/test/src/NE10_random.c 41 | ) 42 | 43 | # Define math test files. 44 | set(NE10_TEST_MATH_SRCS 45 | ${PROJECT_SOURCE_DIR}/modules/math/test/test_suite_math.c 46 | ) 47 | 48 | # Define dsp test files. 49 | set(NE10_TEST_DSP_SRCS 50 | ${PROJECT_SOURCE_DIR}/modules/dsp/test/test_main.c 51 | ${PROJECT_SOURCE_DIR}/modules/dsp/test/test_suite_fir.c 52 | ${PROJECT_SOURCE_DIR}/modules/dsp/test/test_suite_fir_decimate.c 53 | ${PROJECT_SOURCE_DIR}/modules/dsp/test/test_suite_fir_interpolate.c 54 | ${PROJECT_SOURCE_DIR}/modules/dsp/test/test_suite_fir_lattice.c 55 | ${PROJECT_SOURCE_DIR}/modules/dsp/test/test_suite_fir_sparse.c 56 | ${PROJECT_SOURCE_DIR}/modules/dsp/test/test_suite_iir.c 57 | ${PROJECT_SOURCE_DIR}/modules/dsp/test/test_suite_fft_float32.c 58 | ${PROJECT_SOURCE_DIR}/modules/dsp/test/test_suite_fft_int16.c 59 | ${PROJECT_SOURCE_DIR}/modules/dsp/test/test_suite_fft_int32.c 60 | ) 61 | 62 | add_library(NE10_test_demo STATIC ${NE10_TEST_MATH_SRCS} ${NE10_TEST_COMMON_SRCS} ${NE10_TEST_DSP_SRCS}) 63 | 64 | #add the static NE10 to target 65 | target_link_libraries(NE10_test_demo 66 | NE10 67 | m 68 | ) 69 | 70 | #install NE10_test_demo library to iOS demo directory. 71 | install(TARGETS NE10_test_demo 72 | DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/NE10Demo/libs/) 73 | -------------------------------------------------------------------------------- /ios/NE10Demo/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectNe10/Ne10/1f059a764d0e1bc2481c0055c0e71538470baa83/ios/NE10Demo/Default-568h@2x.png -------------------------------------------------------------------------------- /ios/NE10Demo/Default-Portrait@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectNe10/Ne10/1f059a764d0e1bc2481c0055c0e71538470baa83/ios/NE10Demo/Default-Portrait@2x~ipad.png -------------------------------------------------------------------------------- /ios/NE10Demo/Default-Portrait~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectNe10/Ne10/1f059a764d0e1bc2481c0055c0e71538470baa83/ios/NE10Demo/Default-Portrait~ipad.png -------------------------------------------------------------------------------- /ios/NE10Demo/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectNe10/Ne10/1f059a764d0e1bc2481c0055c0e71538470baa83/ios/NE10Demo/Default.png -------------------------------------------------------------------------------- /ios/NE10Demo/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectNe10/Ne10/1f059a764d0e1bc2481c0055c0e71538470baa83/ios/NE10Demo/Default@2x.png -------------------------------------------------------------------------------- /ios/NE10Demo/NE10Demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/NE10Demo/NE10Demo.xcodeproj/project.xcworkspace/xcuserdata/zhongwei.xcuserdatad/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges 6 | 7 | SnapshotAutomaticallyBeforeSignificantChanges 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ios/NE10Demo/NE10Demo.xcodeproj/xcuserdata/zhongwei.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | NE10Demo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 4AA09B081737BB8900276C69 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /ios/NE10Demo/NE10Demo/NE10Demo-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIcons 12 | 13 | CFBundlePrimaryIcon 14 | 15 | CFBundleIconFiles 16 | 17 | icon_phone1.png 18 | icon_phone2.png 19 | icon_pad1.png 20 | icon_pad2.png 21 | 22 | 23 | 24 | CFBundleIdentifier 25 | ARM.${PRODUCT_NAME:rfc1034identifier} 26 | CFBundleInfoDictionaryVersion 27 | 6.0 28 | CFBundleName 29 | ${PRODUCT_NAME} 30 | CFBundlePackageType 31 | APPL 32 | CFBundleShortVersionString 33 | 1.0 34 | CFBundleSignature 35 | ???? 36 | CFBundleVersion 37 | 1.0 38 | LSRequiresIPhoneOS 39 | 40 | UIMainStoryboardFile 41 | MainStoryboard_iPhone 42 | UIMainStoryboardFile~ipad 43 | MainStoryboard_iPad 44 | UIRequiredDeviceCapabilities 45 | 46 | armv7 47 | 48 | UISupportedInterfaceOrientations 49 | 50 | UIInterfaceOrientationPortrait 51 | UIInterfaceOrientationLandscapeLeft 52 | UIInterfaceOrientationLandscapeRight 53 | 54 | UISupportedInterfaceOrientations~ipad 55 | 56 | UIInterfaceOrientationPortrait 57 | UIInterfaceOrientationPortraitUpsideDown 58 | UIInterfaceOrientationLandscapeLeft 59 | UIInterfaceOrientationLandscapeRight 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /ios/NE10Demo/NE10Demo/NE10Demo-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'NE10Demo' target in the 'NE10Demo' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_5_0 8 | #warning "This project uses features only available in iOS SDK 5.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /ios/NE10Demo/NE10Demo/NE10DemoAppDelegate.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-16 ARM Limited and Contributors. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ARM Limited nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #import 29 | 30 | @interface NE10DemoAppDelegate : UIResponder 31 | 32 | @property (strong, nonatomic) UIWindow *window; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /ios/NE10Demo/NE10Demo/NE10DemoViewController.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-16 ARM Limited and Contributors. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ARM Limited nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #import 29 | 30 | @interface NE10DemoViewController : UIViewController { 31 | NSString* ne10Result; 32 | NSLock* lock; 33 | volatile bool ne10Finished; 34 | } 35 | @property (weak, nonatomic) IBOutlet UIWebView *webView; 36 | @end 37 | -------------------------------------------------------------------------------- /ios/NE10Demo/NE10Demo/NE10_runtest.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-16 ARM Limited and Contributors. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ARM Limited nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include 29 | #include 30 | #include "NE10.h" 31 | #include "test_funcs.h" 32 | #include "unit_test_common.h" 33 | 34 | char* NE10RunTest(void) 35 | { 36 | static int test_count = 0; 37 | 38 | void (*test_funcs[])(void) = {test_abs, test_addc, test_add, test_divc, 39 | test_div, test_dot, test_len, test_mlac, 40 | test_mla, test_mulc, test_mul, test_normalize, 41 | test_rsbc, test_setc, test_subc, test_sub, 42 | test_addmat, test_detmat, test_identitymat, 43 | test_invmat, test_mulmat, test_mulcmatvec, 44 | test_submat, test_transmat, 45 | test_fir, test_fir_decimate, 46 | test_fir_interpolate, test_fir_lattice, 47 | test_fir_sparse, test_iir_lattice}; 48 | 49 | while (test_count < (sizeof(test_funcs) / sizeof(void (*)(void)))) { 50 | /* ne10_log_buffer is a global buffer which contain test's result 51 | * ne10_log_buffer's position need be setup first 52 | */ 53 | ne10_log_buffer_ptr = ne10_log_buffer; 54 | *ne10_log_buffer_ptr++ = '['; 55 | 56 | (*test_funcs[test_count])(); 57 | ++test_count; 58 | 59 | /* ne10_log_buffer_ptr is updated in test_funcs */ 60 | --ne10_log_buffer_ptr; 61 | *ne10_log_buffer_ptr = ']'; 62 | 63 | return ne10_log_buffer; 64 | } 65 | return NULL; 66 | } 67 | -------------------------------------------------------------------------------- /ios/NE10Demo/NE10Demo/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /ios/NE10Demo/NE10Demo/en.lproj/MainStoryboard_iPad.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /ios/NE10Demo/NE10Demo/en.lproj/MainStoryboard_iPhone.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /ios/NE10Demo/NE10Demo/main.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-16 ARM Limited and Contributors. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ARM Limited nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #import 29 | 30 | #import "NE10DemoAppDelegate.h" 31 | 32 | int main(int argc, char *argv[]) 33 | { 34 | @autoreleasepool { 35 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([NE10DemoAppDelegate class])); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /ios/NE10Demo/NE10Demo/test_funcs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-16 ARM Limited and Contributors. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ARM Limited nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef TEST_FUNCS_H 29 | #define TEST_FUNCS_H 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | void test_abs(); 36 | void test_addc(); 37 | void test_add(); 38 | void test_divc(); 39 | void test_div(); 40 | void test_dot(); 41 | void test_len(); 42 | void test_mlac(); 43 | void test_mla(); 44 | void test_mulc(); 45 | void test_mul(); 46 | void test_normalize(); 47 | void test_rsbc(); 48 | void test_setc(); 49 | void test_subc(); 50 | void test_sub(); 51 | void test_addmat(); 52 | void test_detmat(); 53 | void test_identitymat(); 54 | void test_invmat(); 55 | void test_mulmat(); 56 | void test_mulcmatvec(); 57 | void test_submat(); 58 | void test_transmat(); 59 | 60 | void test_fir(); 61 | void test_fir_decimate(); 62 | void test_fir_interpolate(); 63 | void test_fir_lattice(); 64 | void test_fir_sparse(); 65 | void test_iir_lattice(); 66 | 67 | char* NE10RunTest(void); 68 | #ifdef __cplusplus 69 | } 70 | #endif 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /ios/NE10Demo/icon_pad1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectNe10/Ne10/1f059a764d0e1bc2481c0055c0e71538470baa83/ios/NE10Demo/icon_pad1.png -------------------------------------------------------------------------------- /ios/NE10Demo/icon_pad2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectNe10/Ne10/1f059a764d0e1bc2481c0055c0e71538470baa83/ios/NE10Demo/icon_pad2.png -------------------------------------------------------------------------------- /ios/NE10Demo/icon_phone1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectNe10/Ne10/1f059a764d0e1bc2481c0055c0e71538470baa83/ios/NE10Demo/icon_phone1.png -------------------------------------------------------------------------------- /ios/NE10Demo/icon_phone2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectNe10/Ne10/1f059a764d0e1bc2481c0055c0e71538470baa83/ios/NE10Demo/icon_phone2.png -------------------------------------------------------------------------------- /modules/dsp/NE10_fft_common_varibles.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-16 ARM Limited and Contributors. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ARM Limited nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * NE10 Library : dsp/NE10_fft_common_varibles.h 30 | */ 31 | 32 | #include "NE10_types.h" 33 | #include 34 | 35 | #ifndef NE10_FFT_COMMON_VARIBLES_H 36 | #define NE10_FFT_COMMON_VARIBLES_H 37 | 38 | /////////////////////////// 39 | // common varibles 40 | /////////////////////////// 41 | 42 | /* Twiddles used in Radix-8 FFT */ 43 | const static ne10_float32_t TW_81_F32 = 0.70710678; // sqrt (2) / 2 44 | const static ne10_float32_t TW_81N_F32 = -0.70710678; // - TW_81_F32 45 | 46 | /* Twiddles used in Radix-5 FFT */ 47 | const static ne10_fft_cpx_float32_t TW_5A_F32 = 48 | { 49 | 0.309016994374947, // cos (2 * pi / 5) 50 | -0.951056516295154 // - sin (2 * pi / 5) 51 | }; 52 | const static ne10_fft_cpx_int32_t TW_5A_S32 = 53 | { 54 | 663608942, // round (TW_5A_F32.r * 2^31) 55 | -2042378317 // round (TW_5A_F32.i * 2^31) 56 | }; 57 | 58 | const static ne10_fft_cpx_float32_t TW_5B_F32 = 59 | { 60 | -0.809016994374947, // cos (4 * pi / 5) 61 | -0.587785252292473 // - sin (4 * pi / 5) 62 | }; 63 | const static ne10_fft_cpx_int32_t TW_5B_S32 = 64 | { 65 | -1737350766, // round (TW_5B_F32.r * 2^31) 66 | -1262259218 // round (TW_5B_F32.i * 2^31) 67 | }; 68 | 69 | /* Twiddles used in Radix-3 FFT */ 70 | const static ne10_float32_t TW_3I_F32 = 0.866025403784439; // sqrt (3) / 2 71 | const static ne10_float32_t TW_3IN_F32 = - 0.866025403784439; // - TW_3IN_F32 72 | const static ne10_int32_t TW_3I_S32 = 1859775393; // round (TW_3I_F32 * 2^31) 73 | const static ne10_int32_t TW_3IN_S32 = -1859775393; // round (TW_3IN_F32 * 2^31) 74 | 75 | #endif // NE10_FFT_COMMON_VARIBLES_H 76 | -------------------------------------------------------------------------------- /modules/dsp/NE10_iir_init.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-16 ARM Limited and Contributors. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ARM Limited nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * NE10 Library : dsp/NE10_iir_init.c 30 | */ 31 | #include "NE10_types.h" 32 | #include 33 | 34 | 35 | /** 36 | * @brief Initialization function for the floating-point IIR lattice filter. 37 | * @param[in] *S points to an instance of the floating-point IIR lattice structure. 38 | * @param[in] numStages number of stages in the filter. 39 | * @param[in] *pkCoeffs points to the reflection coefficient buffer. The array is of length numStages. 40 | * @param[in] *pvCoeffs points to the ladder coefficient buffer. The array is of length numStages+1. 41 | * @param[in] *pState points to the state buffer. The array is of length numStages+blockSize. 42 | * @param[in] blockSize number of samples to process. 43 | */ 44 | 45 | ne10_result_t ne10_iir_lattice_init_float (ne10_iir_lattice_instance_f32_t * S, 46 | ne10_uint16_t numStages, 47 | ne10_float32_t * pkCoeffs, 48 | ne10_float32_t * pvCoeffs, 49 | ne10_float32_t * pState, 50 | ne10_uint32_t blockSize) 51 | { 52 | /* Assign filter taps */ 53 | S->numStages = numStages; 54 | 55 | /* Assign reflection coefficient pointer */ 56 | S->pkCoeffs = pkCoeffs; 57 | 58 | /* Assign ladder coefficient pointer */ 59 | S->pvCoeffs = pvCoeffs; 60 | 61 | /* Clear state buffer and size is always blockSize + numStages */ 62 | memset (pState, 0, (numStages + blockSize) * sizeof (ne10_float32_t)); 63 | 64 | /* Assign state pointer */ 65 | S->pState = pState; 66 | 67 | return NE10_OK; 68 | } 69 | 70 | /** 71 | * @} end of IIR_Lattice group 72 | */ 73 | -------------------------------------------------------------------------------- /modules/dsp/test/test_main.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-16 ARM Limited and Contributors. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ARM Limited nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * NE10 Library : test_main.c 30 | */ 31 | 32 | #include "seatest.h" 33 | #include 34 | 35 | void test_fixture_fft_c2c_1d_float32 (void); 36 | void test_fixture_fft_c2c_1d_int32 (void); 37 | void test_fixture_fft_c2c_1d_int16 (void); 38 | void test_fixture_fft_r2c_1d_float32 (void); 39 | void test_fixture_fft_r2c_1d_int32 (void); 40 | void test_fixture_fft_r2c_1d_int16 (void); 41 | void test_fixture_fir (void); 42 | void test_fixture_fir_decimate (void); 43 | void test_fixture_fir_interpolate (void); 44 | void test_fixture_fir_lattice (void); 45 | void test_fixture_fir_sparse (void); 46 | void test_fixture_iir_lattice (void); 47 | 48 | void all_tests (void) 49 | { 50 | test_fixture_fft_c2c_1d_float32(); 51 | test_fixture_fft_r2c_1d_float32(); 52 | test_fixture_fft_c2c_1d_int32(); 53 | test_fixture_fft_r2c_1d_int32(); 54 | test_fixture_fft_c2c_1d_int16(); 55 | test_fixture_fft_r2c_1d_int16(); 56 | test_fixture_fir(); 57 | test_fixture_fir_decimate(); 58 | test_fixture_fir_interpolate(); 59 | test_fixture_fir_lattice(); 60 | test_fixture_fir_sparse(); 61 | test_fixture_iir_lattice(); 62 | } 63 | 64 | 65 | void my_suite_setup (void) 66 | { 67 | //printf("I'm done before every single test in the suite\r\n"); 68 | } 69 | 70 | void my_suite_teardown (void) 71 | { 72 | //printf("I'm done after every single test in the suite\r\n"); 73 | } 74 | 75 | int main (ne10_int32_t argc, char** argv) 76 | { 77 | suite_setup (my_suite_setup); 78 | suite_teardown (my_suite_teardown); 79 | return !run_tests (all_tests); 80 | } 81 | -------------------------------------------------------------------------------- /modules/imgproc/test/test_main.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-16 ARM Limited and Contributors. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ARM Limited nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * NE10 Library : test_main.c 30 | */ 31 | 32 | #include "seatest.h" 33 | 34 | void test_fixture_resize (void); 35 | void test_fixture_rotate (void); 36 | 37 | void all_tests (void) 38 | { 39 | test_fixture_resize(); 40 | test_fixture_rotate(); 41 | test_fixture_boxfilter(); 42 | } 43 | 44 | 45 | void my_suite_setup (void) 46 | { 47 | } 48 | 49 | void my_suite_teardown (void) 50 | { 51 | } 52 | 53 | int main (ne10_int32_t argc, char** argv) 54 | { 55 | suite_setup (my_suite_setup); 56 | suite_teardown (my_suite_teardown); 57 | return !run_tests (all_tests); 58 | } 59 | -------------------------------------------------------------------------------- /modules/math/NE10_abs.asm.s: -------------------------------------------------------------------------------- 1 | @ 2 | @ Copyright 2011-16 ARM Limited and Contributors. 3 | @ All rights reserved. 4 | @ 5 | @ Redistribution and use in source and binary forms, with or without 6 | @ modification, are permitted provided that the following conditions are met: 7 | @ * Redistributions of source code must retain the above copyright 8 | @ notice, this list of conditions and the following disclaimer. 9 | @ * Redistributions in binary form must reproduce the above copyright 10 | @ notice, this list of conditions and the following disclaimer in the 11 | @ documentation and/or other materials provided with the distribution. 12 | @ * Neither the name of ARM Limited nor the 13 | @ names of its contributors may be used to endorse or promote products 14 | @ derived from this software without specific prior written permission. 15 | @ 16 | @ THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | @ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | @ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | @ DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | @ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | @ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | @ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | @ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | @ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | @ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | @ 27 | 28 | @ 29 | @ NE10 Library : math/NE10_abs.asm.s 30 | @ 31 | 32 | .text 33 | .syntax unified 34 | 35 | .include "NE10header.s" 36 | 37 | .balign 4 38 | .global ne10_abs_float_asm 39 | .thumb 40 | .thumb_func 41 | 42 | ne10_abs_float_asm: 43 | @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 44 | @ 45 | @ arm_result_t ne10_abs_float(arm_float_t * dst, 46 | @ arm_float_t * src, 47 | @ unsigned int count) 48 | @ 49 | @ r0: *dst 50 | @ r1: *src 51 | @ r2: int count 52 | @ 53 | @ r2: loop counter 54 | @ 55 | @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 56 | 57 | cbz r2, .LoopEndFloat 58 | mov r3, #0 59 | vmov s2, r3 60 | 61 | .LoopBeginFloat: 62 | vldr s1, [r1] @ Load s1 = src[i] 63 | add r1, r1, #4 @ move to the next item 64 | vabs.f32 s1, s1 @ get the absolute value; s1 = abs(s1 - 0) 65 | vstr s1, [r0] @ Store it back into the main memory; dst[i] = s1 66 | add r0, r0, #4 @ move to the next entry 67 | subs r2, r2, #1 @ count down using the current index (i--) 68 | bne .LoopBeginFloat @ Continue if "i < count" 69 | 70 | .LoopEndFloat: 71 | mov r0, NE10_OK @ Return NE10_OK 72 | bx lr 73 | -------------------------------------------------------------------------------- /modules/math/NE10_abs.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-16 ARM Limited and Contributors. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ARM Limited nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * NE10 Library : math/NE10_abs.c 30 | */ 31 | 32 | #include "NE10_types.h" 33 | #include "macros.h" 34 | 35 | #include 36 | 37 | #include 38 | 39 | ne10_result_t ne10_abs_float_c (ne10_float32_t * dst, ne10_float32_t * src, ne10_uint32_t count) 40 | { 41 | NE10_CHECKPOINTER_DstSrc; 42 | for ( unsigned int itr = 0; itr < count; itr++ ) 43 | { 44 | dst[itr] = fabs (src[itr]); 45 | } 46 | return NE10_OK; 47 | } 48 | 49 | ne10_result_t ne10_abs_vec2f_c (ne10_vec2f_t * dst, ne10_vec2f_t * src, ne10_uint32_t count) 50 | { 51 | NE10_CHECKPOINTER_DstSrc; 52 | for ( unsigned int itr = 0; itr < count; itr++ ) 53 | { 54 | dst[ itr ].x = fabs (src[ itr ].x); 55 | dst[ itr ].y = fabs (src[ itr ].y); 56 | } 57 | return NE10_OK; 58 | } 59 | 60 | ne10_result_t ne10_abs_vec3f_c (ne10_vec3f_t * dst, ne10_vec3f_t * src, ne10_uint32_t count) 61 | { 62 | NE10_CHECKPOINTER_DstSrc; 63 | for ( unsigned int itr = 0; itr < count; itr++ ) 64 | { 65 | dst[ itr ].x = fabs (src[ itr ].x); 66 | dst[ itr ].y = fabs (src[ itr ].y); 67 | dst[ itr ].z = fabs (src[ itr ].z); 68 | } 69 | return NE10_OK; 70 | } 71 | 72 | ne10_result_t ne10_abs_vec4f_c (ne10_vec4f_t * dst, ne10_vec4f_t * src, ne10_uint32_t count) 73 | { 74 | NE10_CHECKPOINTER_DstSrc; 75 | for ( unsigned int itr = 0; itr < count; itr++ ) 76 | { 77 | dst[ itr ].x = fabs (src[ itr ].x); 78 | dst[ itr ].y = fabs (src[ itr ].y); 79 | dst[ itr ].z = fabs (src[ itr ].z); 80 | dst[ itr ].w = fabs (src[ itr ].w); 81 | } 82 | return NE10_OK; 83 | } 84 | -------------------------------------------------------------------------------- /modules/math/NE10_add.asm.s: -------------------------------------------------------------------------------- 1 | @ 2 | @ Copyright 2011-16 ARM Limited and Contributors. 3 | @ All rights reserved. 4 | @ 5 | @ Redistribution and use in source and binary forms, with or without 6 | @ modification, are permitted provided that the following conditions are met: 7 | @ * Redistributions of source code must retain the above copyright 8 | @ notice, this list of conditions and the following disclaimer. 9 | @ * Redistributions in binary form must reproduce the above copyright 10 | @ notice, this list of conditions and the following disclaimer in the 11 | @ documentation and/or other materials provided with the distribution. 12 | @ * Neither the name of ARM Limited nor the 13 | @ names of its contributors may be used to endorse or promote products 14 | @ derived from this software without specific prior written permission. 15 | @ 16 | @ THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | @ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | @ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | @ DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | @ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | @ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | @ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | @ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | @ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | @ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | @ 27 | 28 | @ 29 | @ NE10 Library : math/NE10_add.asm.s 30 | @ 31 | 32 | .text 33 | .syntax unified 34 | 35 | .include "NE10header.s" 36 | 37 | .balign 4 38 | .global ne10_add_float_asm 39 | .thumb 40 | .thumb_func 41 | 42 | ne10_add_float_asm: 43 | @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 44 | @ 45 | @ arm_result_t ne10_add_float(arm_vec2f_t * dst, 46 | @ arm_float_t * src1, const arm_float_t * src2, 47 | @ unsigned int count) 48 | @ 49 | @ r0: *dst & current src1 entry's address - made of base(r0)+offset(r5) 50 | @ r1: *src1 & current src1 entry's address - made of base(r1)+offset(r5) 51 | @ r2: *src2 & current src2 entry's address - made of base(r2)+offset(r5) 52 | @ r3: int count 53 | @ 54 | @ r3: loop counter 55 | @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 56 | 57 | cbz r3, .LoopEndFloat 58 | 59 | .LoopBeginFloat: 60 | vldr s1, [r1] @ Load s1 = src1[i] 61 | add r1, r1, #4 @ move to the next entry 62 | vldr s2, [r2] @ Load s2 = src2[i] 63 | add r2, r2, #4 @ next entry 64 | vadd.f32 s10, s1, s2 @ s10 = src1[i] * src2[i] 65 | vstr s10, [r0] @ Store the result back into the main memory 66 | add r0, r0, #4 @ next entry in the dst 67 | subs r3, r3, #1 @ count down using the current index (i--) 68 | bne .LoopBeginFloat @ Continue if "i < count" 69 | 70 | .LoopEndFloat: 71 | mov r0, NE10_OK @ Return NE10_OK 72 | bx lr 73 | -------------------------------------------------------------------------------- /modules/math/NE10_add.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-16 ARM Limited and Contributors. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ARM Limited nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * NE10 Library : math/NE10_add.c 30 | */ 31 | 32 | #include "NE10_types.h" 33 | #include "macros.h" 34 | 35 | #include 36 | 37 | 38 | ne10_result_t ne10_add_float_c (ne10_float32_t * dst, ne10_float32_t * src1, ne10_float32_t * src2, ne10_uint32_t count) 39 | { 40 | NE10_CHECKPOINTER_DstSrc1Src2; 41 | for ( unsigned int itr = 0; itr < count; itr++ ) 42 | { 43 | dst[ itr ] = src1[ itr ] + src2[ itr ]; 44 | } 45 | return NE10_OK; 46 | } 47 | 48 | ne10_result_t ne10_add_vec2f_c (ne10_vec2f_t * dst, ne10_vec2f_t * src1, ne10_vec2f_t * src2, ne10_uint32_t count) 49 | { 50 | NE10_CHECKPOINTER_DstSrc1Src2; 51 | for ( unsigned int itr = 0; itr < count; itr++ ) 52 | { 53 | dst[ itr ].x = src1[ itr ].x + src2[ itr ].x; 54 | dst[ itr ].y = src1[ itr ].y + src2[ itr ].y; 55 | } 56 | return NE10_OK; 57 | } 58 | 59 | ne10_result_t ne10_add_vec3f_c (ne10_vec3f_t * dst, ne10_vec3f_t * src1, ne10_vec3f_t * src2, ne10_uint32_t count) 60 | { 61 | NE10_CHECKPOINTER_DstSrc1Src2; 62 | for ( unsigned int itr = 0; itr < count; itr++ ) 63 | { 64 | dst[ itr ].x = src1[ itr ].x + src2[ itr ].x; 65 | dst[ itr ].y = src1[ itr ].y + src2[ itr ].y; 66 | dst[ itr ].z = src1[ itr ].z + src2[ itr ].z; 67 | } 68 | return NE10_OK; 69 | } 70 | 71 | ne10_result_t ne10_add_vec4f_c (ne10_vec4f_t * dst, ne10_vec4f_t * src1, ne10_vec4f_t * src2, ne10_uint32_t count) 72 | { 73 | NE10_CHECKPOINTER_DstSrc1Src2; 74 | for ( unsigned int itr = 0; itr < count; itr++ ) 75 | { 76 | dst[ itr ].x = src1[ itr ].x + src2[ itr ].x; 77 | dst[ itr ].y = src1[ itr ].y + src2[ itr ].y; 78 | dst[ itr ].z = src1[ itr ].z + src2[ itr ].z; 79 | dst[ itr ].w = src1[ itr ].w + src2[ itr ].w; 80 | } 81 | return NE10_OK; 82 | } 83 | -------------------------------------------------------------------------------- /modules/math/NE10_addc.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-16 ARM Limited and Contributors. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ARM Limited nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * NE10 Library : math/NE10_addc.c 30 | */ 31 | 32 | #include "NE10_types.h" 33 | #include "macros.h" 34 | 35 | #include 36 | 37 | ne10_result_t ne10_addc_float_c (ne10_float32_t * dst, ne10_float32_t * src, const ne10_float32_t cst, ne10_uint32_t count) 38 | { 39 | NE10_CHECKPOINTER_DstSrcCst; 40 | for ( unsigned int itr = 0; itr < count; itr++ ) 41 | { 42 | dst[ itr ] = src[ itr ] + cst; 43 | } 44 | return NE10_OK; 45 | } 46 | 47 | ne10_result_t ne10_addc_vec2f_c (ne10_vec2f_t * dst, ne10_vec2f_t * src, const ne10_vec2f_t * cst, ne10_uint32_t count) 48 | { 49 | NE10_CHECKPOINTER_DstSrcCst; 50 | for ( unsigned int itr = 0; itr < count; itr++ ) 51 | { 52 | dst[ itr ].x = src[ itr ].x + cst->x; 53 | dst[ itr ].y = src[ itr ].y + cst->y; 54 | } 55 | return NE10_OK; 56 | } 57 | 58 | ne10_result_t ne10_addc_vec3f_c (ne10_vec3f_t * dst, ne10_vec3f_t * src, const ne10_vec3f_t * cst, ne10_uint32_t count) 59 | { 60 | NE10_CHECKPOINTER_DstSrcCst; 61 | for ( unsigned int itr = 0; itr < count; itr++ ) 62 | { 63 | dst[ itr ].x = src[ itr ].x + cst->x; 64 | dst[ itr ].y = src[ itr ].y + cst->y; 65 | dst[ itr ].z = src[ itr ].z + cst->z; 66 | } 67 | return NE10_OK; 68 | } 69 | 70 | ne10_result_t ne10_addc_vec4f_c (ne10_vec4f_t * dst, ne10_vec4f_t * src, const ne10_vec4f_t * cst, ne10_uint32_t count) 71 | { 72 | NE10_CHECKPOINTER_DstSrcCst; 73 | for ( unsigned int itr = 0; itr < count; itr++ ) 74 | { 75 | dst[ itr ].x = src[ itr ].x + cst->x; 76 | dst[ itr ].y = src[ itr ].y + cst->y; 77 | dst[ itr ].z = src[ itr ].z + cst->z; 78 | dst[ itr ].w = src[ itr ].w + cst->w; 79 | } 80 | return NE10_OK; 81 | } 82 | -------------------------------------------------------------------------------- /modules/math/NE10_addc.neon.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-16 ARM Limited and Contributors. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ARM Limited nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * NE10 Library : math/NE10_addc.neon.c 30 | */ 31 | 32 | #include 33 | #include 34 | 35 | #include "NE10.h" 36 | #include "macros.h" 37 | 38 | 39 | ne10_result_t ne10_addc_float_neon (ne10_float32_t * dst, ne10_float32_t * src, const ne10_float32_t cst, ne10_uint32_t count) 40 | { 41 | NE10_DstSrcCst_DO_COUNT_TIMES_FLOAT_NEON 42 | ( 43 | n_dst = vaddq_f32 (n_src, n_cst); 44 | , 45 | n_rest = vadd_f32 (n_rest, n_rest_cst); 46 | ); 47 | } 48 | 49 | ne10_result_t ne10_addc_vec2f_neon (ne10_vec2f_t * dst, ne10_vec2f_t * src, const ne10_vec2f_t * cst, ne10_uint32_t count) 50 | { 51 | NE10_DstSrcCst_DO_COUNT_TIMES_VEC2F_NEON 52 | ( 53 | n_dst = vaddq_f32 (n_src , n_cst); 54 | , 55 | n_rest = vadd_f32 (n_rest, n_rest_cst); 56 | ); 57 | } 58 | 59 | ne10_result_t ne10_addc_vec3f_neon (ne10_vec3f_t * dst, ne10_vec3f_t * src, const ne10_vec3f_t * cst, ne10_uint32_t count) 60 | { 61 | NE10_DstSrcCst_DO_COUNT_TIMES_VEC3F_NEON 62 | ( 63 | n_dst1 = vaddq_f32 (n_src1 , n_cst1); 64 | n_dst2 = vaddq_f32 (n_src2 , n_cst2); 65 | n_dst3 = vaddq_f32 (n_src3 , n_cst3); 66 | , 67 | n_rest.val[0] = vadd_f32 (n_rest.val[0], n_rest_cst.val[0]); /* the X lane */ 68 | n_rest.val[1] = vadd_f32 (n_rest.val[1], n_rest_cst.val[1]); /* the Y lane */ 69 | n_rest.val[2] = vadd_f32 (n_rest.val[2], n_rest_cst.val[2]); /* the Z lane */ 70 | ); 71 | } 72 | 73 | ne10_result_t ne10_addc_vec4f_neon (ne10_vec4f_t * dst, ne10_vec4f_t * src, const ne10_vec4f_t * cst, ne10_uint32_t count) 74 | { 75 | NE10_DstSrcCst_DO_COUNT_TIMES_VEC4F_NEON 76 | ( 77 | n_dst = vaddq_f32 (n_src , n_cst); 78 | ); 79 | } 80 | -------------------------------------------------------------------------------- /modules/math/NE10_addmat.asm.s: -------------------------------------------------------------------------------- 1 | @ 2 | @ Copyright 2011-16 ARM Limited and Contributors. 3 | @ All rights reserved. 4 | @ 5 | @ Redistribution and use in source and binary forms, with or without 6 | @ modification, are permitted provided that the following conditions are met: 7 | @ * Redistributions of source code must retain the above copyright 8 | @ notice, this list of conditions and the following disclaimer. 9 | @ * Redistributions in binary form must reproduce the above copyright 10 | @ notice, this list of conditions and the following disclaimer in the 11 | @ documentation and/or other materials provided with the distribution. 12 | @ * Neither the name of ARM Limited nor the 13 | @ names of its contributors may be used to endorse or promote products 14 | @ derived from this software without specific prior written permission. 15 | @ 16 | @ THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | @ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | @ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | @ DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | @ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | @ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | @ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | @ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | @ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | @ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | @ 27 | @ 28 | @ NE10 Library : math/NE10_addmat.asm.s 29 | @ 30 | -------------------------------------------------------------------------------- /modules/math/NE10_addmat.neon.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-16 ARM Limited and Contributors. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ARM Limited nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include "NE10_types.h" 29 | #include "NE10_math.h" 30 | 31 | ne10_result_t ne10_addmat_2x2f_neon (ne10_mat2x2f_t * dst, ne10_mat2x2f_t * src1, ne10_mat2x2f_t * src2, ne10_uint32_t count) 32 | { 33 | return ne10_add_vec2f_neon ( (ne10_vec2f_t*) dst, (ne10_vec2f_t*) src1, (ne10_vec2f_t*) src2, count * 2); 34 | } 35 | 36 | ne10_result_t ne10_addmat_3x3f_neon (ne10_mat3x3f_t * dst, ne10_mat3x3f_t * src1, ne10_mat3x3f_t * src2, ne10_uint32_t count) 37 | { 38 | return ne10_add_vec3f_neon ( (ne10_vec3f_t*) dst, (ne10_vec3f_t*) src1, (ne10_vec3f_t*) src2, count * 3); 39 | } 40 | 41 | ne10_result_t ne10_addmat_4x4f_neon (ne10_mat4x4f_t * dst, ne10_mat4x4f_t * src1, ne10_mat4x4f_t * src2, ne10_uint32_t count) 42 | { 43 | return ne10_add_vec4f_neon ( (ne10_vec4f_t*) dst, (ne10_vec4f_t*) src1, (ne10_vec4f_t*) src2, count * 4); 44 | } 45 | 46 | -------------------------------------------------------------------------------- /modules/math/NE10_cross.asm.s: -------------------------------------------------------------------------------- 1 | @ 2 | @ Copyright 2011-16 ARM Limited and Contributors. 3 | @ All rights reserved. 4 | @ 5 | @ Redistribution and use in source and binary forms, with or without 6 | @ modification, are permitted provided that the following conditions are met: 7 | @ * Redistributions of source code must retain the above copyright 8 | @ notice, this list of conditions and the following disclaimer. 9 | @ * Redistributions in binary form must reproduce the above copyright 10 | @ notice, this list of conditions and the following disclaimer in the 11 | @ documentation and/or other materials provided with the distribution. 12 | @ * Neither the name of ARM Limited nor the 13 | @ names of its contributors may be used to endorse or promote products 14 | @ derived from this software without specific prior written permission. 15 | @ 16 | @ THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | @ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | @ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | @ DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | @ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | @ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | @ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | @ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | @ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | @ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | @ 27 | 28 | @ 29 | @ NE10 Library : math/NE10_cross.asm.s 30 | @ 31 | -------------------------------------------------------------------------------- /modules/math/NE10_cross.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-16 ARM Limited and Contributors. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ARM Limited nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * NE10 Library : math/NE10_cross.c 30 | */ 31 | 32 | #include "NE10_types.h" 33 | #include "macros.h" 34 | 35 | #include 36 | 37 | ne10_result_t ne10_cross_vec3f_c (ne10_vec3f_t * dst, ne10_vec3f_t * src1, ne10_vec3f_t * src2, ne10_uint32_t count) 38 | { 39 | NE10_CHECKPOINTER_DstSrc1Src2; 40 | for ( unsigned int itr = 0; itr < count; itr++ ) 41 | { 42 | dst[ itr ].x = (src1[ itr ].y * src2[ itr ].z) - (src1[ itr ].z * src2[ itr ].y); 43 | dst[ itr ].y = (src1[ itr ].z * src2[ itr ].x) - (src1[ itr ].x * src2[ itr ].z); 44 | dst[ itr ].z = (src1[ itr ].x * src2[ itr ].y) - (src1[ itr ].y * src2[ itr ].x); 45 | } 46 | return NE10_OK; 47 | } 48 | -------------------------------------------------------------------------------- /modules/math/NE10_detmat.asm.s: -------------------------------------------------------------------------------- 1 | @ 2 | @ Copyright 2011-16 ARM Limited and Contributors. 3 | @ All rights reserved. 4 | @ 5 | @ Redistribution and use in source and binary forms, with or without 6 | @ modification, are permitted provided that the following conditions are met: 7 | @ * Redistributions of source code must retain the above copyright 8 | @ notice, this list of conditions and the following disclaimer. 9 | @ * Redistributions in binary form must reproduce the above copyright 10 | @ notice, this list of conditions and the following disclaimer in the 11 | @ documentation and/or other materials provided with the distribution. 12 | @ * Neither the name of ARM Limited nor the 13 | @ names of its contributors may be used to endorse or promote products 14 | @ derived from this software without specific prior written permission. 15 | @ 16 | @ THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | @ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | @ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | @ DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | @ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | @ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | @ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | @ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | @ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | @ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | @ 27 | 28 | @ 29 | @ NE10 Library : math/NE10_detmat.asm.s 30 | @ 31 | -------------------------------------------------------------------------------- /modules/math/NE10_detmat.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-16 ARM Limited and Contributors. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ARM Limited nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * NE10 Library : math/NE10_detmat.c 30 | */ 31 | 32 | #include "NE10_types.h" 33 | #include "macros.h" 34 | #include "NE10_detmat.c.h" 35 | 36 | #include 37 | 38 | ne10_result_t ne10_detmat_2x2f_c (ne10_float32_t * dst, ne10_mat2x2f_t * src, ne10_uint32_t count) 39 | { 40 | NE10_CHECKPOINTER_DstSrc; 41 | for ( unsigned int itr = 0; itr < count; itr++ ) 42 | { 43 | dst[ itr ] = DET2x2 (&src[ itr ]); 44 | } 45 | return NE10_OK; 46 | } 47 | 48 | ne10_result_t ne10_detmat_3x3f_c (ne10_float32_t * dst, ne10_mat3x3f_t * src, ne10_uint32_t count) 49 | { 50 | NE10_CHECKPOINTER_DstSrc; 51 | for ( unsigned int itr = 0; itr < count; itr++ ) 52 | { 53 | dst[ itr ] = DET3x3 (& (src[ itr ])); 54 | } 55 | return NE10_OK; 56 | } 57 | 58 | ne10_result_t ne10_detmat_4x4f_c (ne10_float32_t * dst, ne10_mat4x4f_t * src, ne10_uint32_t count) 59 | { 60 | NE10_CHECKPOINTER_DstSrc; 61 | for ( unsigned int itr = 0; itr < count; itr++ ) 62 | { 63 | dst[ itr ] = DET4x4 (&src[ itr ]); 64 | } 65 | return NE10_OK; 66 | } 67 | -------------------------------------------------------------------------------- /modules/math/NE10_div.asm.s: -------------------------------------------------------------------------------- 1 | @ 2 | @ Copyright 2011-16 ARM Limited and Contributors. 3 | @ All rights reserved. 4 | @ 5 | @ Redistribution and use in source and binary forms, with or without 6 | @ modification, are permitted provided that the following conditions are met: 7 | @ * Redistributions of source code must retain the above copyright 8 | @ notice, this list of conditions and the following disclaimer. 9 | @ * Redistributions in binary form must reproduce the above copyright 10 | @ notice, this list of conditions and the following disclaimer in the 11 | @ documentation and/or other materials provided with the distribution. 12 | @ * Neither the name of ARM Limited nor the 13 | @ names of its contributors may be used to endorse or promote products 14 | @ derived from this software without specific prior written permission. 15 | @ 16 | @ THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | @ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | @ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | @ DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | @ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | @ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | @ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | @ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | @ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | @ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | @ 27 | 28 | @ 29 | @ NE10 Library : math/NE10_div.asm.s 30 | @ 31 | 32 | .text 33 | .syntax unified 34 | 35 | .include "NE10header.s" 36 | 37 | .balign 4 38 | .global ne10_div_float_asm 39 | .thumb 40 | .thumb_func 41 | 42 | ne10_div_float_asm: 43 | @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 44 | @ 45 | @ arm_result_t ne10_div_float(arm_vec2f_t * dst, 46 | @ arm_float_t * src1, const arm_float_t * src2, 47 | @ unsigned int count) 48 | @ 49 | @ r0: *dst & current src1 entry's address - made of base(r0)+offset(r5) 50 | @ r1: *src1 & current src1 entry's address - made of base(r1)+offset(r5) 51 | @ r2: *src2 & current src2 entry's address - made of base(r2)+offset(r5) 52 | @ r3: int count 53 | @ 54 | @ r3: loop counter 55 | @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 56 | 57 | cbz r3, .LoopEndFloat 58 | 59 | .LoopBeginFloat: 60 | vldr s1, [r1] @ Load s1 = src1[i] 61 | add r1, r1, #4 @ move to the next entry 62 | vldr s2, [r2] @ Load s2 = src2[i] 63 | add r2, r2, #4 @ next entry 64 | vdiv.f32 s10, s1, s2 @ s10 = src1[i] / src2[i] 65 | vstr s10, [r0] @ Store the result back into the main memory 66 | add r0, r0, #4 @ next entry in the dst 67 | subs r3, r3, #1 @ count down using the current index (i--) 68 | bne .LoopBeginFloat @ Continue if "i < count" 69 | 70 | .LoopEndFloat: 71 | mov r0, NE10_OK @ Return NE10_OK 72 | bx lr 73 | -------------------------------------------------------------------------------- /modules/math/NE10_div.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-16 ARM Limited and Contributors. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ARM Limited nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * NE10 Library : math/NE10_div.c 30 | */ 31 | 32 | #include "NE10_types.h" 33 | #include "macros.h" 34 | 35 | #include 36 | 37 | ne10_result_t ne10_div_float_c (ne10_float32_t * dst, ne10_float32_t * src1, ne10_float32_t * src2, ne10_uint32_t count) 38 | { 39 | NE10_CHECKPOINTER_DstSrc1Src2; 40 | for ( unsigned int itr = 0; itr < count; itr++ ) 41 | { 42 | dst[ itr ] = src1[ itr ] / src2[ itr ]; 43 | } 44 | return NE10_OK; 45 | } 46 | 47 | ne10_result_t ne10_vdiv_vec2f_c (ne10_vec2f_t * dst, ne10_vec2f_t * src1, ne10_vec2f_t * src2, ne10_uint32_t count) 48 | { 49 | NE10_CHECKPOINTER_DstSrc1Src2; 50 | for ( unsigned int itr = 0; itr < count; itr++ ) 51 | { 52 | dst[ itr ].x = src1[ itr ].x / src2[ itr ].x; 53 | dst[ itr ].y = src1[ itr ].y / src2[ itr ].y; 54 | } 55 | return NE10_OK; 56 | } 57 | 58 | ne10_result_t ne10_vdiv_vec3f_c (ne10_vec3f_t * dst, ne10_vec3f_t * src1, ne10_vec3f_t * src2, ne10_uint32_t count) 59 | { 60 | NE10_CHECKPOINTER_DstSrc1Src2; 61 | for ( unsigned int itr = 0; itr < count; itr++ ) 62 | { 63 | dst[ itr ].x = src1[ itr ].x / src2[ itr ].x; 64 | dst[ itr ].y = src1[ itr ].y / src2[ itr ].y; 65 | dst[ itr ].z = src1[ itr ].z / src2[ itr ].z; 66 | } 67 | return NE10_OK; 68 | } 69 | 70 | ne10_result_t ne10_vdiv_vec4f_c (ne10_vec4f_t * dst, ne10_vec4f_t * src1, ne10_vec4f_t * src2, ne10_uint32_t count) 71 | { 72 | NE10_CHECKPOINTER_DstSrc1Src2; 73 | for ( unsigned int itr = 0; itr < count; itr++ ) 74 | { 75 | dst[ itr ].x = src1[ itr ].x / src2[ itr ].x; 76 | dst[ itr ].y = src1[ itr ].y / src2[ itr ].y; 77 | dst[ itr ].z = src1[ itr ].z / src2[ itr ].z; 78 | dst[ itr ].w = src1[ itr ].w / src2[ itr ].w; 79 | } 80 | return NE10_OK; 81 | } 82 | -------------------------------------------------------------------------------- /modules/math/NE10_divc.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-16 ARM Limited and Contributors. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ARM Limited nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * NE10 Library : math/NE10_divc.c 30 | */ 31 | 32 | #include "NE10_types.h" 33 | #include "macros.h" 34 | 35 | #include 36 | 37 | ne10_result_t ne10_divc_float_c (ne10_float32_t * dst, ne10_float32_t * src, const ne10_float32_t cst, ne10_uint32_t count) 38 | { 39 | NE10_CHECKPOINTER_DstSrcCst; 40 | for ( unsigned int itr = 0; itr < count; itr++ ) 41 | { 42 | dst[ itr ] = src[ itr ] / cst; 43 | } 44 | return NE10_OK; 45 | } 46 | 47 | ne10_result_t ne10_divc_vec2f_c (ne10_vec2f_t * dst, ne10_vec2f_t * src, const ne10_vec2f_t * cst, ne10_uint32_t count) 48 | { 49 | NE10_CHECKPOINTER_DstSrcCst; 50 | for ( unsigned int itr = 0; itr < count; itr++ ) 51 | { 52 | dst[ itr ].x = src[ itr ].x / cst->x; 53 | dst[ itr ].y = src[ itr ].y / cst->y; 54 | } 55 | return NE10_OK; 56 | } 57 | 58 | ne10_result_t ne10_divc_vec3f_c (ne10_vec3f_t * dst, ne10_vec3f_t * src, const ne10_vec3f_t * cst, ne10_uint32_t count) 59 | { 60 | NE10_CHECKPOINTER_DstSrcCst; 61 | for ( unsigned int itr = 0; itr < count; itr++ ) 62 | { 63 | dst[ itr ].x = src[ itr ].x / cst->x; 64 | dst[ itr ].y = src[ itr ].y / cst->y; 65 | dst[ itr ].z = src[ itr ].z / cst->z; 66 | } 67 | return NE10_OK; 68 | } 69 | 70 | ne10_result_t ne10_divc_vec4f_c (ne10_vec4f_t * dst, ne10_vec4f_t * src, const ne10_vec4f_t * cst, ne10_uint32_t count) 71 | { 72 | NE10_CHECKPOINTER_DstSrcCst; 73 | for ( unsigned int itr = 0; itr < count; itr++ ) 74 | { 75 | dst[ itr ].x = src[ itr ].x / cst->x; 76 | dst[ itr ].y = src[ itr ].y / cst->y; 77 | dst[ itr ].z = src[ itr ].z / cst->z; 78 | dst[ itr ].w = src[ itr ].w / cst->w; 79 | } 80 | return NE10_OK; 81 | } 82 | -------------------------------------------------------------------------------- /modules/math/NE10_dot.asm.s: -------------------------------------------------------------------------------- 1 | @ 2 | @ Copyright 2011-16 ARM Limited and Contributors. 3 | @ All rights reserved. 4 | @ 5 | @ Redistribution and use in source and binary forms, with or without 6 | @ modification, are permitted provided that the following conditions are met: 7 | @ * Redistributions of source code must retain the above copyright 8 | @ notice, this list of conditions and the following disclaimer. 9 | @ * Redistributions in binary form must reproduce the above copyright 10 | @ notice, this list of conditions and the following disclaimer in the 11 | @ documentation and/or other materials provided with the distribution. 12 | @ * Neither the name of ARM Limited nor the 13 | @ names of its contributors may be used to endorse or promote products 14 | @ derived from this software without specific prior written permission. 15 | @ 16 | @ THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | @ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | @ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | @ DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | @ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | @ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | @ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | @ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | @ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | @ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | @ 27 | 28 | @ 29 | @ NE10 Library : math/NE10_dot.asm.s 30 | @ 31 | -------------------------------------------------------------------------------- /modules/math/NE10_dot.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-16 ARM Limited and Contributors. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ARM Limited nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * NE10 Library : math/NE10_dot.c 30 | */ 31 | 32 | #include "NE10_types.h" 33 | #include "macros.h" 34 | 35 | #include 36 | 37 | ne10_result_t ne10_dot_vec2f_c (ne10_float32_t * dst, ne10_vec2f_t * src1, ne10_vec2f_t * src2, ne10_uint32_t count) 38 | { 39 | NE10_CHECKPOINTER_DstSrc1Src2; 40 | for ( unsigned int itr = 0; itr < count; itr++ ) 41 | { 42 | dst[ itr ] = src1[ itr ].x * src2[ itr ].x + 43 | src1[ itr ].y * src2[ itr ].y; 44 | } 45 | return NE10_OK; 46 | } 47 | 48 | ne10_result_t ne10_dot_vec3f_c (ne10_float32_t * dst, ne10_vec3f_t * src1, ne10_vec3f_t * src2, ne10_uint32_t count) 49 | { 50 | NE10_CHECKPOINTER_DstSrc1Src2; 51 | for ( unsigned int itr = 0; itr < count; itr++ ) 52 | { 53 | dst[ itr ] = src1[ itr ].x * src2[ itr ].x + 54 | src1[ itr ].y * src2[ itr ].y + 55 | src1[ itr ].z * src2[ itr ].z; 56 | } 57 | return NE10_OK; 58 | } 59 | 60 | ne10_result_t ne10_dot_vec4f_c (ne10_float32_t * dst, ne10_vec4f_t * src1, ne10_vec4f_t * src2, ne10_uint32_t count) 61 | { 62 | NE10_CHECKPOINTER_DstSrc1Src2; 63 | for ( unsigned int itr = 0; itr < count; itr++ ) 64 | { 65 | dst[ itr ] = src1[ itr ].x * src2[ itr ].x + 66 | src1[ itr ].y * src2[ itr ].y + 67 | src1[ itr ].z * src2[ itr ].z + 68 | src1[ itr ].w * src2[ itr ].w; 69 | } 70 | return NE10_OK; 71 | } 72 | -------------------------------------------------------------------------------- /modules/math/NE10_identitymat.asm.s: -------------------------------------------------------------------------------- 1 | @ 2 | @ Copyright 2011-16 ARM Limited and Contributors. 3 | @ All rights reserved. 4 | @ 5 | @ Redistribution and use in source and binary forms, with or without 6 | @ modification, are permitted provided that the following conditions are met: 7 | @ * Redistributions of source code must retain the above copyright 8 | @ notice, this list of conditions and the following disclaimer. 9 | @ * Redistributions in binary form must reproduce the above copyright 10 | @ notice, this list of conditions and the following disclaimer in the 11 | @ documentation and/or other materials provided with the distribution. 12 | @ * Neither the name of ARM Limited nor the 13 | @ names of its contributors may be used to endorse or promote products 14 | @ derived from this software without specific prior written permission. 15 | @ 16 | @ THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | @ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | @ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | @ DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | @ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | @ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | @ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | @ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | @ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | @ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | @ 27 | 28 | @ 29 | @ NE10 Library : math/NE10_identitymat.asm.s 30 | @ 31 | -------------------------------------------------------------------------------- /modules/math/NE10_invmat.asm.s: -------------------------------------------------------------------------------- 1 | @ 2 | @ Copyright 2011-16 ARM Limited and Contributors. 3 | @ All rights reserved. 4 | @ 5 | @ Redistribution and use in source and binary forms, with or without 6 | @ modification, are permitted provided that the following conditions are met: 7 | @ * Redistributions of source code must retain the above copyright 8 | @ notice, this list of conditions and the following disclaimer. 9 | @ * Redistributions in binary form must reproduce the above copyright 10 | @ notice, this list of conditions and the following disclaimer in the 11 | @ documentation and/or other materials provided with the distribution. 12 | @ * Neither the name of ARM Limited nor the 13 | @ names of its contributors may be used to endorse or promote products 14 | @ derived from this software without specific prior written permission. 15 | @ 16 | @ THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | @ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | @ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | @ DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | @ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | @ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | @ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | @ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | @ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | @ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | @ 27 | 28 | @ 29 | @ NE10 Library : math/NE10_invmat.asm.s 30 | @ 31 | -------------------------------------------------------------------------------- /modules/math/NE10_len.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-16 ARM Limited and Contributors. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ARM Limited nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * NE10 Library : math/NE10_len.c 30 | */ 31 | 32 | #include "NE10_types.h" 33 | #include "macros.h" 34 | 35 | #include 36 | 37 | #include 38 | 39 | ne10_result_t ne10_len_vec2f_c (ne10_float32_t * dst, ne10_vec2f_t * src, ne10_uint32_t count) 40 | { 41 | NE10_CHECKPOINTER_DstSrc; 42 | for ( unsigned int itr = 0; itr < count; itr++ ) 43 | { 44 | dst[ itr ] = sqrt (src[ itr ].x * src[ itr ].x + 45 | src[ itr ].y * src[ itr ].y); 46 | } 47 | return NE10_OK; 48 | } 49 | 50 | ne10_result_t ne10_len_vec3f_c (ne10_float32_t * dst, ne10_vec3f_t * src, ne10_uint32_t count) 51 | { 52 | NE10_CHECKPOINTER_DstSrc; 53 | for ( unsigned int itr = 0; itr < count; itr++ ) 54 | { 55 | dst[ itr ] = sqrt (src[ itr ].x * src[ itr ].x + 56 | src[ itr ].y * src[ itr ].y + 57 | src[ itr ].z * src[ itr ].z); 58 | } 59 | return NE10_OK; 60 | } 61 | 62 | ne10_result_t ne10_len_vec4f_c (ne10_float32_t * dst, ne10_vec4f_t * src, ne10_uint32_t count) 63 | { 64 | NE10_CHECKPOINTER_DstSrc; 65 | for ( unsigned int itr = 0; itr < count; itr++ ) 66 | { 67 | dst[ itr ] = sqrt (src[ itr ].x * src[ itr ].x + 68 | src[ itr ].y * src[ itr ].y + 69 | src[ itr ].z * src[ itr ].z + 70 | src[ itr ].w * src[ itr ].w); 71 | } 72 | return NE10_OK; 73 | } 74 | -------------------------------------------------------------------------------- /modules/math/NE10_mul.asm.s: -------------------------------------------------------------------------------- 1 | @ 2 | @ Copyright 2011-16 ARM Limited and Contributors. 3 | @ All rights reserved. 4 | @ 5 | @ Redistribution and use in source and binary forms, with or without 6 | @ modification, are permitted provided that the following conditions are met: 7 | @ * Redistributions of source code must retain the above copyright 8 | @ notice, this list of conditions and the following disclaimer. 9 | @ * Redistributions in binary form must reproduce the above copyright 10 | @ notice, this list of conditions and the following disclaimer in the 11 | @ documentation and/or other materials provided with the distribution. 12 | @ * Neither the name of ARM Limited nor the 13 | @ names of its contributors may be used to endorse or promote products 14 | @ derived from this software without specific prior written permission. 15 | @ 16 | @ THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | @ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | @ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | @ DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | @ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | @ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | @ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | @ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | @ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | @ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | @ 27 | 28 | @ 29 | @ NE10 Library : math/NE10_mul.asm.s 30 | @ 31 | 32 | .text 33 | .syntax unified 34 | 35 | .include "NE10header.s" 36 | 37 | .balign 4 38 | .global ne10_mul_float_asm 39 | .thumb 40 | .thumb_func 41 | 42 | ne10_mul_float_asm: 43 | @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 44 | @ 45 | @ arm_result_t ne10_mul_float(arm_vec2f_t * dst, 46 | @ arm_float_t * src1, const arm_float_t * src2, 47 | @ unsigned int count) 48 | @ 49 | @ r0: *dst & current src1 entry's address - made of base(r0)+offset(r5) 50 | @ r1: *src1 & current src1 entry's address - made of base(r1)+offset(r5) 51 | @ r2: *src2 & current src2 entry's address - made of base(r2)+offset(r5) 52 | @ r3: int count 53 | @ 54 | @ r3: loop counter 55 | @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 56 | 57 | cbz r3, .LoopEndFloat 58 | 59 | .LoopBeginFloat: 60 | vldr s1, [r1] @ Load s1 = src1[i] 61 | add r1, r1, #4 @ move to the next entry 62 | vldr s2, [r2] @ Load s2 = src2[i] 63 | add r2, r2, #4 @ next entry 64 | vmul.f32 s10, s1, s2 @ s10 = src1[i] * src2[i] 65 | vstr s10, [r0] @ Store the result back into the main memory 66 | add r0, r0, #4 @ next entry in the dst 67 | subs r3, r3, #1 @ count down using the current index (i--) 68 | bne .LoopBeginFloat @ Continue if "i < count" 69 | 70 | .LoopEndFloat: 71 | mov r0, NE10_OK @ Return NE10_OK 72 | bx lr 73 | -------------------------------------------------------------------------------- /modules/math/NE10_mul.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-16 ARM Limited and Contributors. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ARM Limited nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * NE10 Library : math/NE10_mul.c 30 | */ 31 | 32 | #include "NE10_types.h" 33 | #include "macros.h" 34 | 35 | #include 36 | 37 | ne10_result_t ne10_mul_float_c (ne10_float32_t * dst, ne10_float32_t * src1, ne10_float32_t * src2, ne10_uint32_t count) 38 | { 39 | NE10_CHECKPOINTER_DstSrc1Src2; 40 | for ( unsigned int itr = 0; itr < count; itr++ ) 41 | { 42 | dst[ itr ] = src1[ itr ] * src2[ itr ]; 43 | } 44 | return NE10_OK; 45 | } 46 | 47 | ne10_result_t ne10_vmul_vec2f_c (ne10_vec2f_t * dst, ne10_vec2f_t * src1, ne10_vec2f_t * src2, ne10_uint32_t count) 48 | { 49 | NE10_CHECKPOINTER_DstSrc1Src2; 50 | for ( unsigned int itr = 0; itr < count; itr++ ) 51 | { 52 | dst[ itr ].x = src1[ itr ].x * src2[ itr ].x; 53 | dst[ itr ].y = src1[ itr ].y * src2[ itr ].y; 54 | } 55 | return NE10_OK; 56 | } 57 | 58 | ne10_result_t ne10_vmul_vec3f_c (ne10_vec3f_t * dst, ne10_vec3f_t * src1, ne10_vec3f_t * src2, ne10_uint32_t count) 59 | { 60 | NE10_CHECKPOINTER_DstSrc1Src2; 61 | for ( unsigned int itr = 0; itr < count; itr++ ) 62 | { 63 | dst[ itr ].x = src1[ itr ].x * src2[ itr ].x; 64 | dst[ itr ].y = src1[ itr ].y * src2[ itr ].y; 65 | dst[ itr ].z = src1[ itr ].z * src2[ itr ].z; 66 | } 67 | return NE10_OK; 68 | } 69 | 70 | ne10_result_t ne10_vmul_vec4f_c (ne10_vec4f_t * dst, ne10_vec4f_t * src1, ne10_vec4f_t * src2, ne10_uint32_t count) 71 | { 72 | NE10_CHECKPOINTER_DstSrc1Src2; 73 | for ( unsigned int itr = 0; itr < count; itr++ ) 74 | { 75 | dst[ itr ].x = src1[ itr ].x * src2[ itr ].x; 76 | dst[ itr ].y = src1[ itr ].y * src2[ itr ].y; 77 | dst[ itr ].z = src1[ itr ].z * src2[ itr ].z; 78 | dst[ itr ].w = src1[ itr ].w * src2[ itr ].w; 79 | } 80 | return NE10_OK; 81 | } 82 | -------------------------------------------------------------------------------- /modules/math/NE10_mulc.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-16 ARM Limited and Contributors. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ARM Limited nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * NE10 Library : math/NE10_mulc.c 30 | */ 31 | 32 | #include "NE10_types.h" 33 | #include "macros.h" 34 | 35 | #include 36 | 37 | ne10_result_t ne10_mulc_float_c (ne10_float32_t * dst, ne10_float32_t * src, const ne10_float32_t cst, ne10_uint32_t count) 38 | { 39 | NE10_CHECKPOINTER_DstSrcCst; 40 | for ( unsigned int itr = 0; itr < count; itr++ ) 41 | { 42 | dst[ itr ] = src[ itr ] * cst; 43 | } 44 | return NE10_OK; 45 | } 46 | 47 | ne10_result_t ne10_mulc_vec2f_c (ne10_vec2f_t * dst, ne10_vec2f_t * src, const ne10_vec2f_t * cst, ne10_uint32_t count) 48 | { 49 | NE10_CHECKPOINTER_DstSrcCst; 50 | for ( unsigned int itr = 0; itr < count; itr++ ) 51 | { 52 | dst[ itr ].x = src[ itr ].x * cst->x; 53 | dst[ itr ].y = src[ itr ].y * cst->y; 54 | } 55 | return NE10_OK; 56 | } 57 | 58 | ne10_result_t ne10_mulc_vec3f_c (ne10_vec3f_t * dst, ne10_vec3f_t * src, const ne10_vec3f_t * cst, ne10_uint32_t count) 59 | { 60 | NE10_CHECKPOINTER_DstSrcCst; 61 | for ( unsigned int itr = 0; itr < count; itr++ ) 62 | { 63 | dst[ itr ].x = src[ itr ].x * cst->x; 64 | dst[ itr ].y = src[ itr ].y * cst->y; 65 | dst[ itr ].z = src[ itr ].z * cst->z; 66 | } 67 | return NE10_OK; 68 | } 69 | 70 | ne10_result_t ne10_mulc_vec4f_c (ne10_vec4f_t * dst, ne10_vec4f_t * src, const ne10_vec4f_t * cst, ne10_uint32_t count) 71 | { 72 | NE10_CHECKPOINTER_DstSrcCst; 73 | for ( unsigned int itr = 0; itr < count; itr++ ) 74 | { 75 | dst[ itr ].x = src[ itr ].x * cst->x; 76 | dst[ itr ].y = src[ itr ].y * cst->y; 77 | dst[ itr ].z = src[ itr ].z * cst->z; 78 | dst[ itr ].w = src[ itr ].w * cst->w; 79 | } 80 | return NE10_OK; 81 | } 82 | -------------------------------------------------------------------------------- /modules/math/NE10_mulc.neon.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-16 ARM Limited and Contributors. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ARM Limited nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * NE10 Library : math/NE10_mulc.neon.c 30 | */ 31 | 32 | #include "NE10_types.h" 33 | #include "macros.h" 34 | 35 | #include 36 | #include 37 | 38 | 39 | ne10_result_t ne10_mulc_float_neon (ne10_float32_t * dst, ne10_float32_t * src, const ne10_float32_t cst, ne10_uint32_t count) 40 | { 41 | NE10_DstSrcCst_DO_COUNT_TIMES_FLOAT_NEON 42 | ( 43 | n_dst = vmulq_f32 (n_src , n_cst); 44 | , 45 | n_rest = vmul_f32 (n_rest, n_rest_cst); 46 | ); 47 | } 48 | 49 | ne10_result_t ne10_mulc_vec2f_neon (ne10_vec2f_t * dst, ne10_vec2f_t * src, const ne10_vec2f_t * cst, ne10_uint32_t count) 50 | { 51 | NE10_DstSrcCst_DO_COUNT_TIMES_VEC2F_NEON 52 | ( 53 | n_dst = vmulq_f32 (n_src , n_cst); 54 | , 55 | n_rest = vmul_f32 (n_rest, n_rest_cst); 56 | ); 57 | } 58 | 59 | ne10_result_t ne10_mulc_vec3f_neon (ne10_vec3f_t * dst, ne10_vec3f_t * src, const ne10_vec3f_t * cst, ne10_uint32_t count) 60 | { 61 | NE10_DstSrcCst_DO_COUNT_TIMES_VEC3F_NEON 62 | ( 63 | n_dst1 = vmulq_f32 (n_src1 , n_cst1); 64 | n_dst2 = vmulq_f32 (n_src2 , n_cst2); 65 | n_dst3 = vmulq_f32 (n_src3 , n_cst3); 66 | , 67 | n_rest.val[0] = vmul_f32 (n_rest.val[0], n_rest_cst.val[0]); 68 | n_rest.val[1] = vmul_f32 (n_rest.val[1], n_rest_cst.val[1]); 69 | n_rest.val[2] = vmul_f32 (n_rest.val[2], n_rest_cst.val[2]); 70 | ); 71 | } 72 | 73 | ne10_result_t ne10_mulc_vec4f_neon (ne10_vec4f_t * dst, ne10_vec4f_t * src, const ne10_vec4f_t * cst, ne10_uint32_t count) 74 | { 75 | NE10_DstSrcCst_DO_COUNT_TIMES_VEC4F_NEON 76 | ( 77 | n_dst = vmulq_f32 (n_src , n_cst); 78 | ); 79 | } 80 | -------------------------------------------------------------------------------- /modules/math/NE10_mulcmatvec.asm.s: -------------------------------------------------------------------------------- 1 | @ 2 | @ Copyright 2011-16 ARM Limited and Contributors. 3 | @ All rights reserved. 4 | @ 5 | @ Redistribution and use in source and binary forms, with or without 6 | @ modification, are permitted provided that the following conditions are met: 7 | @ * Redistributions of source code must retain the above copyright 8 | @ notice, this list of conditions and the following disclaimer. 9 | @ * Redistributions in binary form must reproduce the above copyright 10 | @ notice, this list of conditions and the following disclaimer in the 11 | @ documentation and/or other materials provided with the distribution. 12 | @ * Neither the name of ARM Limited nor the 13 | @ names of its contributors may be used to endorse or promote products 14 | @ derived from this software without specific prior written permission. 15 | @ 16 | @ THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | @ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | @ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | @ DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | @ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | @ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | @ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | @ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | @ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | @ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | @ 27 | 28 | @ 29 | @ NE10 Library : math/NE10_mulcmatvec.asm.s 30 | @ 31 | -------------------------------------------------------------------------------- /modules/math/NE10_mulmat.asm.s: -------------------------------------------------------------------------------- 1 | @ 2 | @ Copyright 2011-16 ARM Limited and Contributors. 3 | @ All rights reserved. 4 | @ 5 | @ Redistribution and use in source and binary forms, with or without 6 | @ modification, are permitted provided that the following conditions are met: 7 | @ * Redistributions of source code must retain the above copyright 8 | @ notice, this list of conditions and the following disclaimer. 9 | @ * Redistributions in binary form must reproduce the above copyright 10 | @ notice, this list of conditions and the following disclaimer in the 11 | @ documentation and/or other materials provided with the distribution. 12 | @ * Neither the name of ARM Limited nor the 13 | @ names of its contributors may be used to endorse or promote products 14 | @ derived from this software without specific prior written permission. 15 | @ 16 | @ THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | @ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | @ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | @ DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | @ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | @ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | @ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | @ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | @ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | @ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | @ 27 | 28 | @ 29 | @ NE10 Library : math/NE10_mulmat.asm.s 30 | @ 31 | -------------------------------------------------------------------------------- /modules/math/NE10_rsbc.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-16 ARM Limited and Contributors. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ARM Limited nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * NE10 Library : math/NE10_rsbc.c 30 | */ 31 | 32 | #include "NE10_types.h" 33 | #include "macros.h" 34 | 35 | #include 36 | 37 | ne10_result_t ne10_rsbc_float_c (ne10_float32_t * dst, ne10_float32_t * src, const ne10_float32_t cst, ne10_uint32_t count) 38 | { 39 | NE10_CHECKPOINTER_DstSrcCst; 40 | for ( unsigned int itr = 0; itr < count; itr++ ) 41 | { 42 | dst[ itr ] = cst - src[ itr ]; 43 | } 44 | return NE10_OK; 45 | } 46 | 47 | ne10_result_t ne10_rsbc_vec2f_c (ne10_vec2f_t * dst, ne10_vec2f_t * src, const ne10_vec2f_t * cst, ne10_uint32_t count) 48 | { 49 | NE10_CHECKPOINTER_DstSrcCst; 50 | for ( unsigned int itr = 0; itr < count; itr++ ) 51 | { 52 | dst[ itr ].x = cst->x - src[ itr ].x; 53 | dst[ itr ].y = cst->y - src[ itr ].y; 54 | } 55 | return NE10_OK; 56 | } 57 | 58 | ne10_result_t ne10_rsbc_vec3f_c (ne10_vec3f_t * dst, ne10_vec3f_t * src, const ne10_vec3f_t * cst, ne10_uint32_t count) 59 | { 60 | NE10_CHECKPOINTER_DstSrcCst; 61 | for ( unsigned int itr = 0; itr < count; itr++ ) 62 | { 63 | dst[ itr ].x = cst->x - src[ itr ].x; 64 | dst[ itr ].y = cst->y - src[ itr ].y; 65 | dst[ itr ].z = cst->z - src[ itr ].z; 66 | } 67 | return NE10_OK; 68 | } 69 | 70 | ne10_result_t ne10_rsbc_vec4f_c (ne10_vec4f_t * dst, ne10_vec4f_t * src, const ne10_vec4f_t * cst, ne10_uint32_t count) 71 | { 72 | NE10_CHECKPOINTER_DstSrcCst; 73 | for ( unsigned int itr = 0; itr < count; itr++ ) 74 | { 75 | dst[ itr ].x = cst->x - src[ itr ].x; 76 | dst[ itr ].y = cst->y - src[ itr ].y; 77 | dst[ itr ].z = cst->z - src[ itr ].z; 78 | dst[ itr ].w = cst->w - src[ itr ].w; 79 | } 80 | return NE10_OK; 81 | } 82 | -------------------------------------------------------------------------------- /modules/math/NE10_rsbc.neon.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-16 ARM Limited and Contributors. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ARM Limited nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * NE10 Library : math/NE10_rsbc.neon.c 30 | */ 31 | 32 | #include "NE10_types.h" 33 | #include "macros.h" 34 | 35 | #include 36 | #include 37 | 38 | 39 | ne10_result_t ne10_rsbc_float_neon (ne10_float32_t * dst, ne10_float32_t * src, const ne10_float32_t cst, ne10_uint32_t count) 40 | { 41 | NE10_DstSrcCst_DO_COUNT_TIMES_FLOAT_NEON 42 | ( 43 | n_dst = vsubq_f32 (n_cst, n_src); 44 | , 45 | n_rest = vsub_f32 (n_rest_cst, n_rest); 46 | ); 47 | } 48 | 49 | ne10_result_t ne10_rsbc_vec2f_neon (ne10_vec2f_t * dst, ne10_vec2f_t * src, const ne10_vec2f_t * cst, ne10_uint32_t count) 50 | { 51 | NE10_DstSrcCst_DO_COUNT_TIMES_VEC2F_NEON 52 | ( 53 | n_dst = vsubq_f32 (n_cst, n_src); 54 | , 55 | n_rest = vsub_f32 (n_rest_cst, n_rest); 56 | ); 57 | } 58 | 59 | ne10_result_t ne10_rsbc_vec3f_neon (ne10_vec3f_t * dst, ne10_vec3f_t * src, const ne10_vec3f_t * cst, ne10_uint32_t count) 60 | { 61 | NE10_DstSrcCst_DO_COUNT_TIMES_VEC3F_NEON 62 | ( 63 | n_dst1 = vsubq_f32 (n_cst1, n_src1); 64 | n_dst2 = vsubq_f32 (n_cst2, n_src2); 65 | n_dst3 = vsubq_f32 (n_cst3, n_src3); 66 | , 67 | n_rest.val[0] = vsub_f32 (n_rest_cst.val[0], n_rest.val[0]); 68 | n_rest.val[1] = vsub_f32 (n_rest_cst.val[1], n_rest.val[1]); 69 | n_rest.val[2] = vsub_f32 (n_rest_cst.val[2], n_rest.val[2]); 70 | ); 71 | } 72 | 73 | ne10_result_t ne10_rsbc_vec4f_neon (ne10_vec4f_t * dst, ne10_vec4f_t * src, const ne10_vec4f_t * cst, ne10_uint32_t count) 74 | { 75 | NE10_DstSrcCst_DO_COUNT_TIMES_VEC4F_NEON 76 | ( 77 | n_dst = vsubq_f32 (n_cst, n_src); 78 | ); 79 | } 80 | -------------------------------------------------------------------------------- /modules/math/NE10_setc.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-16 ARM Limited and Contributors. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ARM Limited nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * NE10 Library : math/NE10_setc.c 30 | */ 31 | 32 | #include "NE10_types.h" 33 | #include "macros.h" 34 | 35 | #include 36 | 37 | ne10_result_t ne10_setc_float_c (ne10_float32_t * dst, const ne10_float32_t cst, ne10_uint32_t count) 38 | { 39 | NE10_CHECKPOINTER_DstCst; 40 | for ( unsigned int itr = 0; itr < count; itr++ ) 41 | { 42 | dst[itr] = cst; 43 | } 44 | return NE10_OK; 45 | } 46 | 47 | ne10_result_t ne10_setc_vec2f_c (ne10_vec2f_t * dst, const ne10_vec2f_t * cst, ne10_uint32_t count) 48 | { 49 | NE10_CHECKPOINTER_DstCst; 50 | for ( unsigned int itr = 0; itr < count; itr++ ) 51 | { 52 | dst[itr].x = cst->x; 53 | dst[itr].y = cst->y; 54 | } 55 | return NE10_OK; 56 | } 57 | 58 | ne10_result_t ne10_setc_vec3f_c (ne10_vec3f_t * dst, const ne10_vec3f_t * cst, ne10_uint32_t count) 59 | { 60 | NE10_CHECKPOINTER_DstCst; 61 | for ( unsigned int itr = 0; itr < count; itr++ ) 62 | { 63 | dst[itr].x = cst->x; 64 | dst[itr].y = cst->y; 65 | dst[itr].z = cst->z; 66 | } 67 | return NE10_OK; 68 | } 69 | 70 | ne10_result_t ne10_setc_vec4f_c (ne10_vec4f_t * dst, const ne10_vec4f_t * cst, ne10_uint32_t count) 71 | { 72 | NE10_CHECKPOINTER_DstCst; 73 | for ( unsigned int itr = 0; itr < count; itr++ ) 74 | { 75 | dst[itr].x = cst->x; 76 | dst[itr].y = cst->y; 77 | dst[itr].z = cst->z; 78 | dst[itr].w = cst->w; 79 | } 80 | return NE10_OK; 81 | } 82 | -------------------------------------------------------------------------------- /modules/math/NE10_setc.neon.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-16 ARM Limited and Contributors. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ARM Limited nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * NE10 Library : math/NE10_setc.neon.c 30 | */ 31 | 32 | #include "NE10_types.h" 33 | #include "macros.h" 34 | 35 | #include 36 | #include 37 | 38 | 39 | ne10_result_t ne10_setc_float_neon (ne10_float32_t * dst, const ne10_float32_t cst, ne10_uint32_t count) 40 | { 41 | NE10_DstCst_DO_COUNT_TIMES_FLOAT_NEON 42 | ( 43 | ;// The cst need not be altered 44 | , 45 | ;// n_rest_cst need not be altered 46 | ); 47 | } 48 | 49 | ne10_result_t ne10_setc_vec2f_neon (ne10_vec2f_t * dst, const ne10_vec2f_t * cst, ne10_uint32_t count) 50 | { 51 | NE10_DstCst_DO_COUNT_TIMES_VEC2F_NEON 52 | ( 53 | ;// The cst need not be altered 54 | , 55 | ;// n_rest_cst need not be altered 56 | ); 57 | } 58 | 59 | ne10_result_t ne10_setc_vec3f_neon (ne10_vec3f_t * dst, const ne10_vec3f_t * cst, ne10_uint32_t count) 60 | { 61 | NE10_DstCst_DO_COUNT_TIMES_VEC3F_NEON 62 | ( 63 | ;// cst1, cst2, and cst3 need not be altered 64 | , 65 | ;// n_rest_cst.val[0], .val[1], and .val[2] need not be altered 66 | ); 67 | } 68 | 69 | ne10_result_t ne10_setc_vec4f_neon (ne10_vec4f_t * dst, const ne10_vec4f_t * cst, ne10_uint32_t count) 70 | { 71 | NE10_DstCst_DO_COUNT_TIMES_VEC4F_NEON 72 | ( 73 | ;// n_cst need not be altered 74 | ); 75 | } 76 | -------------------------------------------------------------------------------- /modules/math/NE10_sub.asm.s: -------------------------------------------------------------------------------- 1 | @ 2 | @ Copyright 2011-16 ARM Limited and Contributors. 3 | @ All rights reserved. 4 | @ 5 | @ Redistribution and use in source and binary forms, with or without 6 | @ modification, are permitted provided that the following conditions are met: 7 | @ * Redistributions of source code must retain the above copyright 8 | @ notice, this list of conditions and the following disclaimer. 9 | @ * Redistributions in binary form must reproduce the above copyright 10 | @ notice, this list of conditions and the following disclaimer in the 11 | @ documentation and/or other materials provided with the distribution. 12 | @ * Neither the name of ARM Limited nor the 13 | @ names of its contributors may be used to endorse or promote products 14 | @ derived from this software without specific prior written permission. 15 | @ 16 | @ THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | @ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | @ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | @ DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | @ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | @ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | @ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | @ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | @ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | @ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | @ 27 | 28 | @ 29 | @ NE10 Library : math/NE10_sub.asm.s 30 | @ 31 | 32 | .text 33 | .syntax unified 34 | 35 | .include "NE10header.s" 36 | 37 | .balign 4 38 | .global ne10_sub_float_asm 39 | .thumb 40 | .thumb_func 41 | 42 | ne10_sub_float_asm: 43 | @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 44 | @ 45 | @ arm_result_t ne10_sub_float(arm_vec2f_t * dst, 46 | @ arm_float_t * src1, const arm_float_t * src2, 47 | @ unsigned int count) 48 | @ 49 | @ r0: *dst & current src1 entry's address - made of base(r0)+offset(r5) 50 | @ r1: *src1 & current src1 entry's address - made of base(r1)+offset(r5) 51 | @ r2: *src2 & current src2 entry's address - made of base(r2)+offset(r5) 52 | @ r3: int count 53 | @ 54 | @ r3: loop counter 55 | @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 56 | 57 | cbz r3, .LoopEndFloat 58 | 59 | .LoopBeginFloat: 60 | vldr s1, [r1] @ Load s1 = src1[i] 61 | add r1, r1, #4 @ move to the next entry 62 | vldr s2, [r2] @ Load s2 = src2[i] 63 | add r2, r2, #4 @ next entry 64 | vsub.f32 s10, s1, s2 @ s10 = src1[i] - src2[i] 65 | vstr s10, [r0] @ Store the result back into the main memory 66 | add r0, r0, #4 @ next entry in the dst 67 | subs r3, r3, #1 @ count down using the current index (i--) 68 | bne .LoopBeginFloat @ Continue if "i < count" 69 | 70 | .LoopEndFloat: 71 | mov r0, NE10_OK @ Return NE10_OK 72 | bx lr 73 | -------------------------------------------------------------------------------- /modules/math/NE10_sub.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-16 ARM Limited and Contributors. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ARM Limited nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * NE10 Library : math/NE10_sub.c 30 | */ 31 | 32 | #include "NE10_types.h" 33 | #include "macros.h" 34 | 35 | #include 36 | 37 | ne10_result_t ne10_sub_float_c (ne10_float32_t * dst, ne10_float32_t * src1, ne10_float32_t * src2, ne10_uint32_t count) 38 | { 39 | NE10_CHECKPOINTER_DstSrc1Src2; 40 | for ( unsigned int itr = 0; itr < count; itr++ ) 41 | { 42 | dst[ itr ] = src1[ itr ] - src2[ itr ]; 43 | } 44 | return NE10_OK; 45 | } 46 | 47 | ne10_result_t ne10_sub_vec2f_c (ne10_vec2f_t * dst, ne10_vec2f_t * src1, ne10_vec2f_t * src2, ne10_uint32_t count) 48 | { 49 | NE10_CHECKPOINTER_DstSrc1Src2; 50 | for ( unsigned int itr = 0; itr < count; itr++ ) 51 | { 52 | dst[ itr ].x = src1[ itr ].x - src2[ itr ].x; 53 | dst[ itr ].y = src1[ itr ].y - src2[ itr ].y; 54 | } 55 | return NE10_OK; 56 | } 57 | 58 | ne10_result_t ne10_sub_vec3f_c (ne10_vec3f_t * dst, ne10_vec3f_t * src1, ne10_vec3f_t * src2, ne10_uint32_t count) 59 | { 60 | NE10_CHECKPOINTER_DstSrc1Src2; 61 | for ( unsigned int itr = 0; itr < count; itr++ ) 62 | { 63 | dst[ itr ].x = src1[ itr ].x - src2[ itr ].x; 64 | dst[ itr ].y = src1[ itr ].y - src2[ itr ].y; 65 | dst[ itr ].z = src1[ itr ].z - src2[ itr ].z; 66 | } 67 | return NE10_OK; 68 | } 69 | 70 | ne10_result_t ne10_sub_vec4f_c (ne10_vec4f_t * dst, ne10_vec4f_t * src1, ne10_vec4f_t * src2, ne10_uint32_t count) 71 | { 72 | NE10_CHECKPOINTER_DstSrc1Src2; 73 | for ( unsigned int itr = 0; itr < count; itr++ ) 74 | { 75 | dst[ itr ].x = src1[ itr ].x - src2[ itr ].x; 76 | dst[ itr ].y = src1[ itr ].y - src2[ itr ].y; 77 | dst[ itr ].z = src1[ itr ].z - src2[ itr ].z; 78 | dst[ itr ].w = src1[ itr ].w - src2[ itr ].w; 79 | } 80 | return NE10_OK; 81 | } 82 | -------------------------------------------------------------------------------- /modules/math/NE10_subc.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-16 ARM Limited and Contributors. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ARM Limited nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * NE10 Library : math/NE10_subc.c 30 | */ 31 | 32 | #include "NE10_types.h" 33 | #include "macros.h" 34 | 35 | #include 36 | 37 | ne10_result_t ne10_subc_float_c (ne10_float32_t * dst, ne10_float32_t * src, const ne10_float32_t cst, ne10_uint32_t count) 38 | { 39 | NE10_CHECKPOINTER_DstSrcCst; 40 | for ( unsigned int itr = 0; itr < count; itr++ ) 41 | { 42 | dst[ itr ] = src[ itr ] - cst; 43 | } 44 | return NE10_OK; 45 | } 46 | 47 | ne10_result_t ne10_subc_vec2f_c (ne10_vec2f_t * dst, ne10_vec2f_t * src, const ne10_vec2f_t * cst, ne10_uint32_t count) 48 | { 49 | NE10_CHECKPOINTER_DstSrcCst; 50 | for ( unsigned int itr = 0; itr < count; itr++ ) 51 | { 52 | dst[ itr ].x = src[ itr ].x - cst->x; 53 | dst[ itr ].y = src[ itr ].y - cst->y; 54 | } 55 | return NE10_OK; 56 | } 57 | 58 | ne10_result_t ne10_subc_vec3f_c (ne10_vec3f_t * dst, ne10_vec3f_t * src, const ne10_vec3f_t * cst, ne10_uint32_t count) 59 | { 60 | NE10_CHECKPOINTER_DstSrcCst; 61 | for ( unsigned int itr = 0; itr < count; itr++ ) 62 | { 63 | dst[ itr ].x = src[ itr ].x - cst->x; 64 | dst[ itr ].y = src[ itr ].y - cst->y; 65 | dst[ itr ].z = src[ itr ].z - cst->z; 66 | } 67 | return NE10_OK; 68 | } 69 | 70 | ne10_result_t ne10_subc_vec4f_c (ne10_vec4f_t * dst, ne10_vec4f_t * src, const ne10_vec4f_t * cst, ne10_uint32_t count) 71 | { 72 | NE10_CHECKPOINTER_DstSrcCst; 73 | for ( unsigned int itr = 0; itr < count; itr++ ) 74 | { 75 | dst[ itr ].x = src[ itr ].x - cst->x; 76 | dst[ itr ].y = src[ itr ].y - cst->y; 77 | dst[ itr ].z = src[ itr ].z - cst->z; 78 | dst[ itr ].w = src[ itr ].w - cst->w; 79 | } 80 | return NE10_OK; 81 | } 82 | -------------------------------------------------------------------------------- /modules/math/NE10_subc.neon.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-16 ARM Limited and Contributors. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ARM Limited nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * NE10 Library : math/NE10_subc.neon.c 30 | */ 31 | 32 | #include "NE10_types.h" 33 | #include "macros.h" 34 | 35 | #include 36 | #include 37 | 38 | 39 | ne10_result_t ne10_subc_float_neon (ne10_float32_t * dst, ne10_float32_t * src, const ne10_float32_t cst, ne10_uint32_t count) 40 | { 41 | NE10_DstSrcCst_DO_COUNT_TIMES_FLOAT_NEON 42 | ( 43 | n_dst = vsubq_f32 (n_src , n_cst); 44 | , 45 | n_rest = vsub_f32 (n_rest, n_rest_cst); 46 | ); 47 | } 48 | 49 | ne10_result_t ne10_subc_vec2f_neon (ne10_vec2f_t * dst, ne10_vec2f_t * src, const ne10_vec2f_t * cst, ne10_uint32_t count) 50 | { 51 | NE10_DstSrcCst_DO_COUNT_TIMES_VEC2F_NEON 52 | ( 53 | n_dst = vsubq_f32 (n_src , n_cst); 54 | , 55 | n_rest = vsub_f32 (n_rest, n_rest_cst); 56 | ); 57 | } 58 | 59 | ne10_result_t ne10_subc_vec3f_neon (ne10_vec3f_t * dst, ne10_vec3f_t * src, const ne10_vec3f_t * cst, ne10_uint32_t count) 60 | { 61 | NE10_DstSrcCst_DO_COUNT_TIMES_VEC3F_NEON 62 | ( 63 | n_dst1 = vsubq_f32 (n_src1 , n_cst1); 64 | n_dst2 = vsubq_f32 (n_src2 , n_cst2); 65 | n_dst3 = vsubq_f32 (n_src3 , n_cst3); 66 | , 67 | n_rest.val[0] = vsub_f32 (n_rest.val[0], n_rest_cst.val[0]); 68 | n_rest.val[1] = vsub_f32 (n_rest.val[1], n_rest_cst.val[1]); 69 | n_rest.val[2] = vsub_f32 (n_rest.val[2], n_rest_cst.val[2]); 70 | ); 71 | } 72 | 73 | ne10_result_t ne10_subc_vec4f_neon (ne10_vec4f_t * dst, ne10_vec4f_t * src, const ne10_vec4f_t * cst, ne10_uint32_t count) 74 | { 75 | NE10_DstSrcCst_DO_COUNT_TIMES_VEC4F_NEON 76 | ( 77 | n_dst = vsubq_f32 (n_src , n_cst); 78 | ); 79 | } 80 | -------------------------------------------------------------------------------- /modules/math/NE10_submat.asm.s: -------------------------------------------------------------------------------- 1 | @ 2 | @ Copyright 2011-16 ARM Limited and Contributors. 3 | @ All rights reserved. 4 | @ 5 | @ Redistribution and use in source and binary forms, with or without 6 | @ modification, are permitted provided that the following conditions are met: 7 | @ * Redistributions of source code must retain the above copyright 8 | @ notice, this list of conditions and the following disclaimer. 9 | @ * Redistributions in binary form must reproduce the above copyright 10 | @ notice, this list of conditions and the following disclaimer in the 11 | @ documentation and/or other materials provided with the distribution. 12 | @ * Neither the name of ARM Limited nor the 13 | @ names of its contributors may be used to endorse or promote products 14 | @ derived from this software without specific prior written permission. 15 | @ 16 | @ THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | @ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | @ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | @ DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | @ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | @ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | @ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | @ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | @ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | @ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | @ 27 | 28 | @ 29 | @ NE10 Library : math/NE10_submat.asm.s 30 | @ 31 | -------------------------------------------------------------------------------- /modules/math/NE10_submat.neon.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-16 ARM Limited and Contributors. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ARM Limited nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include "NE10_types.h" 29 | #include "NE10_math.h" 30 | 31 | ne10_result_t ne10_submat_2x2f_neon (ne10_mat2x2f_t * dst, ne10_mat2x2f_t * src1, ne10_mat2x2f_t * src2, ne10_uint32_t count) 32 | { 33 | return ne10_sub_vec2f_neon ( (ne10_vec2f_t*) dst, (ne10_vec2f_t*) src1, (ne10_vec2f_t*) src2, count * 2); 34 | } 35 | 36 | ne10_result_t ne10_submat_3x3f_neon (ne10_mat3x3f_t * dst, ne10_mat3x3f_t * src1, ne10_mat3x3f_t * src2, ne10_uint32_t count) 37 | { 38 | return ne10_sub_vec3f_neon ( (ne10_vec3f_t*) dst, (ne10_vec3f_t*) src1, (ne10_vec3f_t*) src2, count * 3); 39 | } 40 | 41 | ne10_result_t ne10_submat_4x4f_neon (ne10_mat4x4f_t * dst, ne10_mat4x4f_t * src1, ne10_mat4x4f_t * src2, ne10_uint32_t count) 42 | { 43 | return ne10_sub_vec4f_neon ( (ne10_vec4f_t*) dst, (ne10_vec4f_t*) src1, (ne10_vec4f_t*) src2, count * 4); 44 | } 45 | 46 | -------------------------------------------------------------------------------- /modules/math/NE10_transmat.asm.s: -------------------------------------------------------------------------------- 1 | @ 2 | @ Copyright 2011-16 ARM Limited and Contributors. 3 | @ All rights reserved. 4 | @ 5 | @ Redistribution and use in source and binary forms, with or without 6 | @ modification, are permitted provided that the following conditions are met: 7 | @ * Redistributions of source code must retain the above copyright 8 | @ notice, this list of conditions and the following disclaimer. 9 | @ * Redistributions in binary form must reproduce the above copyright 10 | @ notice, this list of conditions and the following disclaimer in the 11 | @ documentation and/or other materials provided with the distribution. 12 | @ * Neither the name of ARM Limited nor the 13 | @ names of its contributors may be used to endorse or promote products 14 | @ derived from this software without specific prior written permission. 15 | @ 16 | @ THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | @ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | @ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | @ DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | @ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | @ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | @ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | @ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | @ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | @ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | @ 27 | 28 | @ 29 | @ NE10 Library : math/NE10_transmat.asm.s 30 | @ 31 | -------------------------------------------------------------------------------- /modules/math/test/test_main.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-16 ARM Limited and Contributors. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ARM Limited nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * NE10 Library : test_main.c 30 | */ 31 | 32 | #include "seatest.h" 33 | #include 34 | 35 | void test_fixture_math (void); 36 | 37 | void all_tests (void) 38 | { 39 | test_fixture_math(); 40 | } 41 | 42 | 43 | void my_suite_setup (void) 44 | { 45 | //printf("I'm done before every single test in the suite\r\n"); 46 | } 47 | 48 | void my_suite_teardown (void) 49 | { 50 | //printf("I'm done after every single test in the suite\r\n"); 51 | } 52 | 53 | int main (ne10_int32_t argc, char** argv) 54 | { 55 | suite_setup (my_suite_setup); 56 | suite_teardown (my_suite_teardown); 57 | return !run_tests (all_tests); 58 | } 59 | -------------------------------------------------------------------------------- /modules/physics/test/test_main.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-16 ARM Limited and Contributors. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ARM Limited nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * NE10 Library : test/test_main.c 30 | */ 31 | 32 | #include "seatest.h" 33 | #include 34 | 35 | void test_fixture_physics (void); 36 | 37 | void all_tests (void) 38 | { 39 | test_fixture_physics(); 40 | } 41 | 42 | 43 | void my_suite_setup (void) 44 | { 45 | //printf("I'm done before every single test in the suite\r\n"); 46 | } 47 | 48 | void my_suite_teardown (void) 49 | { 50 | //printf("I'm done after every single test in the suite\r\n"); 51 | } 52 | 53 | int main (ne10_int32_t argc, char** argv) 54 | { 55 | suite_setup (my_suite_setup); 56 | suite_teardown (my_suite_teardown); 57 | return !run_tests (all_tests); 58 | } 59 | -------------------------------------------------------------------------------- /samples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2011-16 ARM Limited and Contributors. 3 | # All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are met: 7 | # * Redistributions of source code must retain the above copyright 8 | # notice, this list of conditions and the following disclaimer. 9 | # * Redistributions in binary form must reproduce the above copyright 10 | # notice, this list of conditions and the following disclaimer in the 11 | # documentation and/or other materials provided with the distribution. 12 | # * Neither the name of ARM Limited nor the 13 | # names of its contributors may be used to endorse or promote products 14 | # derived from this software without specific prior written permission. 15 | # 16 | # THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | # DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | # 27 | 28 | # header 29 | include_directories ( 30 | ${PROJECT_SOURCE_DIR}/inc 31 | ) 32 | 33 | file(GLOB SAMPLE_SOURCE_FILES "${PROJECT_SOURCE_DIR}/samples/*.c") 34 | 35 | if(NE10_BUILD_SHARED) 36 | add_executable(NE10_test_dynamic ${SAMPLE_SOURCE_FILES}) 37 | target_link_libraries ( 38 | NE10_test_dynamic 39 | NE10_test 40 | m 41 | ) 42 | endif() 43 | 44 | if(NE10_BUILD_STATIC) 45 | add_executable(NE10_test_static ${SAMPLE_SOURCE_FILES}) 46 | target_link_libraries ( 47 | NE10_test_static 48 | NE10 49 | m 50 | ) 51 | endif() 52 | -------------------------------------------------------------------------------- /samples/NE10_sample_complex_fft.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-16 ARM Limited and Contributors. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ARM Limited nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | #include 28 | #include 29 | 30 | #include "NE10.h" 31 | 32 | #define SAMPLES 16 33 | 34 | /** 35 | * @example NE10_sample_complex_fft.c 36 | * An example of using the complex-to-complex FFT functions. 37 | */ 38 | int complex_fft_sample_main(void) 39 | { 40 | ne10_fft_cpx_float32_t src[SAMPLES]; // A source array of input data 41 | ne10_fft_cpx_float32_t dst[SAMPLES]; // A destination array for the transformed data 42 | ne10_fft_cfg_float32_t cfg; // An FFT "configuration structure" 43 | 44 | // Initialise Ne10, using hardware auto-detection to set library function pointers 45 | if (ne10_init() != NE10_OK) 46 | { 47 | fprintf(stderr, "Failed to initialise Ne10.\n"); 48 | return 1; 49 | } 50 | 51 | // Prepare the complex-to-complex single precision floating point FFT configuration 52 | // structure for inputs of length `SAMPLES`. (You need only generate this once for a 53 | // particular input size.) 54 | cfg = ne10_fft_alloc_c2c_float32(SAMPLES); 55 | 56 | // Generate test input values (with both real and imaginary components) 57 | for (int i = 0; i < SAMPLES; i++) 58 | { 59 | src[i].r = (ne10_float32_t)rand() / RAND_MAX * 50.0f; 60 | src[i].i = (ne10_float32_t)rand() / RAND_MAX * 50.0f; 61 | } 62 | 63 | // Perform the FFT (for an IFFT, the last parameter should be `1`) 64 | ne10_fft_c2c_1d_float32(dst, src, cfg, 0); 65 | 66 | // Display the results 67 | for (int i = 0; i < SAMPLES; i++) 68 | { 69 | printf( "IN[%2d]: %10.4f + %10.4fi\t", i, src[i].r, src[i].i); 70 | printf("OUT[%2d]: %10.4f + %10.4fi\n", i, dst[i].r, dst[i].i); 71 | } 72 | 73 | // Free the allocated configuration structure 74 | ne10_fft_destroy_c2c_float32(cfg); 75 | 76 | return 0; 77 | } 78 | -------------------------------------------------------------------------------- /samples/NE10_sample_real_fft.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-16 ARM Limited and Contributors. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ARM Limited nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | #include 28 | #include 29 | 30 | #include "NE10.h" 31 | 32 | #define SAMPLES 16 33 | 34 | /** 35 | * @example NE10_sample_real_fft.c 36 | * An example of using the real-to-complex FFT functions. 37 | */ 38 | int real_fft_sample_main(void) 39 | { 40 | ne10_float32_t src[SAMPLES] = {}; // A source array of input data 41 | ne10_fft_cpx_float32_t dst[(SAMPLES / 2) + 1] = {}; // A destination array for the transformed data 42 | ne10_fft_r2c_cfg_float32_t cfg; // An FFT "configuration structure" 43 | 44 | // Initialise Ne10, using hardware auto-detection to set library function pointers 45 | if (ne10_init() != NE10_OK) 46 | { 47 | fprintf(stderr, "Failed to initialise Ne10.\n"); 48 | return 1; 49 | } 50 | 51 | // Prepare the real-to-complex single precision floating point FFT configuration 52 | // structure for inputs of length `SAMPLES`. (You need only generate this once for a 53 | // particular input size.) 54 | cfg = ne10_fft_alloc_r2c_float32(SAMPLES); 55 | 56 | // Generate test input values 57 | for (int i = 0; i < SAMPLES; i++) 58 | { 59 | src[i] = (ne10_float32_t)rand() / RAND_MAX * 50.0f; 60 | } 61 | 62 | // Perform the FFT 63 | ne10_fft_r2c_1d_float32(dst, src, cfg); 64 | 65 | // Display the results 66 | for (int i = 0; i < SAMPLES; i++) 67 | { 68 | printf( "IN[%2d]: %10.4f\t", i, src[i]); 69 | if (i <= SAMPLES / 2) 70 | printf("OUT[%2d]: %10.4f + %10.4fi", i, dst[i].r, dst[i].i); 71 | printf("\n"); 72 | } 73 | 74 | // Free the allocated configuration structure 75 | ne10_fft_destroy_r2c_float32(cfg); 76 | 77 | return 0; 78 | } 79 | -------------------------------------------------------------------------------- /samples/NE10_samples.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-16 ARM Limited and Contributors. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ARM Limited nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include 29 | #include 30 | 31 | #include "NE10.h" 32 | 33 | int intro_sample_main(void); 34 | int matrix_multiply_sample_main(void); 35 | int complex_fft_sample_main(void); 36 | int real_fft_sample_main(void); 37 | int fir_sample_main(void); 38 | 39 | /* 40 | * Run all the sample code snippets in series. 41 | * 42 | * Note that this will call `ne10_init` multiple times unnecessarily, as each sample is 43 | * supposed to be an isolated illustration of how to use a certain part of Ne10. 44 | */ 45 | int main(void) 46 | { 47 | printf("==== Ne10 Samples ===\n\n"); 48 | 49 | printf("# Introduction\n"); 50 | intro_sample_main(); 51 | printf("\n"); 52 | 53 | printf("# Matrix Multiply\n"); 54 | matrix_multiply_sample_main(); 55 | printf("\n"); 56 | 57 | printf("# Complex-to-Complex FFT\n"); 58 | complex_fft_sample_main(); 59 | printf("\n"); 60 | 61 | printf("# Real-to-Complex FFT\n"); 62 | real_fft_sample_main(); 63 | printf("\n"); 64 | 65 | printf("# FIR\n"); 66 | fir_sample_main(); 67 | printf("\n"); 68 | 69 | return 0; 70 | } 71 | -------------------------------------------------------------------------------- /test/license_seatest.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010 Keith Nicholas 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | 21 | NOTES: 22 | the following files are licensed under this license: 23 | ./include/seatest.h 24 | ./src/seatest.c 25 | -------------------------------------------------------------------------------- /tools/cleanall.sh: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2011-16 ARM Limited and Contributors. 3 | # All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are met: 7 | # * Redistributions of source code must retain the above copyright 8 | # notice, this list of conditions and the following disclaimer. 9 | # * Redistributions in binary form must reproduce the above copyright 10 | # notice, this list of conditions and the following disclaimer in the 11 | # documentation and/or other materials provided with the distribution. 12 | # * Neither the name of ARM Limited nor the 13 | # names of its contributors may be used to endorse or promote products 14 | # derived from this software without specific prior written permission. 15 | # 16 | # THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | # DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | # 27 | 28 | # 29 | # NE10 Library : cleanall.sh 30 | # 31 | #!/bin/bash 32 | 33 | PRODUCT_NAME=NE10 34 | 35 | rm *.ex *.a *.o *.so 36 | rm res_*.txt 37 | rm .*.swp 38 | rm .exp.tmp 39 | rm testlog.txt 40 | for dir in `find * -maxdepth 0 -type d -name "${PRODUCT_NAME}_*"`; do rm -rf $dir; done; 41 | rm -rf ./java 42 | for fl in `find * -maxdepth 0 -type f -name "${PRODUCT_NAME}_*.tgz"`; do rm -rf $fl; done; 43 | if [ "$CLS" != "0" ]; then 44 | clear 45 | echo 46 | ls -la --color=auto 47 | echo 48 | fi 49 | echo 50 | 51 | -------------------------------------------------------------------------------- /tools/getlog.sh: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2011-16 ARM Limited and Contributors. 3 | # All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are met: 7 | # * Redistributions of source code must retain the above copyright 8 | # notice, this list of conditions and the following disclaimer. 9 | # * Redistributions in binary form must reproduce the above copyright 10 | # notice, this list of conditions and the following disclaimer in the 11 | # documentation and/or other materials provided with the distribution. 12 | # * Neither the name of ARM Limited nor the 13 | # names of its contributors may be used to endorse or promote products 14 | # derived from this software without specific prior written permission. 15 | # 16 | # THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | # DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | # 27 | 28 | # 29 | # NE10 Library : getlog.sh 30 | # 31 | #!/bin/bash 32 | 33 | echo "NE10 NIGHTLY BUILD SCRIPT" 34 | echo "(C) 2011, ARM Ltd." 35 | date 36 | 37 | echo 38 | echo 39 | echo -e "\033[4mSYSTEM:\033[0m" 40 | uname -a 41 | cat /proc/cpuinfo 42 | 43 | echo 44 | echo 45 | echo -e "\033[4mINSTALLED TOOLS:\033[0m" 46 | echo "git:" 47 | if [ "`which git`" = "" ]; then 48 | echo "fatal: 'git' is not installed on this system" 1>&2 49 | exit 1 50 | fi 51 | git --version | paste -s -d ';' - 52 | echo 53 | echo "gcc:" 54 | if [ "`which gcc`" = "" ]; then 55 | echo "fatal: 'gcc' is not installed on this system" 1>&2 56 | exit 1 57 | fi 58 | gcc --version | paste -s -d ';' - 59 | echo 60 | echo "as:" 61 | if [ "`which as`" = "" ]; then 62 | echo "fatal: 'as' is not installed on this system" 1>&2 63 | exit 1 64 | fi 65 | as --version | paste -s -d ';' - 66 | echo 67 | echo "ar:" 68 | if [ "`which ar`" = "" ]; then 69 | echo "fatal: 'ar' is not installed on this system" 1>&2 70 | exit 1 71 | fi 72 | ar --version | paste -s -d ';' - 73 | echo 74 | echo 75 | echo "perl:" 76 | if [ "`which perl`" = "" ]; then 77 | echo "fatal: 'perl' is not installed on this system" 1>&2 78 | exit 1 79 | fi 80 | perl --version | paste -s -d ';' - 81 | 82 | echo 83 | if [ -e .git ]; then 84 | echo 85 | echo -e "\033[4mCURRENT 'git' CONFIGURATION:\033[0m" 86 | git config -l 87 | fi 88 | 89 | echo 90 | echo 91 | echo -e "\033[4mCURRENT USER AND PATH:\033[0m" 92 | echo `whoami` "@" `pwd` 93 | 94 | echo 95 | echo 96 | echo -e "\033[4mENVIRONMENT VARIABLES:\033[0m" 97 | echo 98 | echo "PATH = " $PATH 99 | echo 100 | echo "LD_LIBRARY_PATH = " $LD_LIBRARY_PATH 101 | 102 | 103 | echo 104 | if [ -e .git ]; then 105 | echo 106 | echo -e "\033[4mCURRENT GIT/SOURCE STATUS:\033[0m" 107 | git show 108 | fi 109 | 110 | 111 | -------------------------------------------------------------------------------- /tools/removetabs.sh: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2011-16 ARM Limited and Contributors. 3 | # All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are met: 7 | # * Redistributions of source code must retain the above copyright 8 | # notice, this list of conditions and the following disclaimer. 9 | # * Redistributions in binary form must reproduce the above copyright 10 | # notice, this list of conditions and the following disclaimer in the 11 | # documentation and/or other materials provided with the distribution. 12 | # * Neither the name of ARM Limited nor the 13 | # names of its contributors may be used to endorse or promote products 14 | # derived from this software without specific prior written permission. 15 | # 16 | # THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | # DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | # 27 | 28 | # 29 | # NE10 Library : removetabs.sh 30 | # 31 | #!/bin/bash 32 | 33 | # This script removes tab characters in files and replaces them with 34 | # the right number of spaces. It also removes trailing whitespaces. 35 | 36 | # remove trailing whitespaces 37 | LSw=`grep -lsri --exclude="Makefile" --exclude-dir=".git" '\s$' .`; 38 | for flw in $LSw 39 | do 40 | echo "HAS SPACES: " $flw; # just to see a list of the files that include unwanted tabs 41 | perms=`stat -c '%a' $flw`; 42 | sed 's/[ \t]*$//gi' $flw > .exp.tmp; 43 | sync; 44 | # rename the file to the original file 45 | mv .exp.tmp $flw; 46 | chmod $perms $flw; 47 | sync; 48 | done 49 | 50 | # remove tabs 51 | chtab=$'\t'; # only works in bash but not in sh 52 | LSt=`grep -lrsi --exclude="Makefile" --exclude-dir=".git" "$chtab" .`; 53 | for flt in $LSt 54 | do 55 | echo "HAS TABS: " $flt; # just to see a list of the files that include unwanted tabs 56 | perms=`stat -c '%a' $flt`; 57 | # remove tabs 58 | expand $flt > .exp.tmp; 59 | sync; 60 | # rename the file to the original file 61 | mv .exp.tmp $flt; 62 | chmod $perms $flt; 63 | sync; 64 | done 65 | 66 | -------------------------------------------------------------------------------- /tools/review.sh: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2011-16 ARM Limited and Contributors. 3 | # All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are met: 7 | # * Redistributions of source code must retain the above copyright 8 | # notice, this list of conditions and the following disclaimer. 9 | # * Redistributions in binary form must reproduce the above copyright 10 | # notice, this list of conditions and the following disclaimer in the 11 | # documentation and/or other materials provided with the distribution. 12 | # * Neither the name of ARM Limited nor the 13 | # names of its contributors may be used to endorse or promote products 14 | # derived from this software without specific prior written permission. 15 | # 16 | # THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND 17 | # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | # DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY 20 | # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | # 27 | 28 | # 29 | # NE10 Library : review.sh 30 | # 31 | #!/bin/sh 32 | 33 | BRANCH=$1 34 | 35 | BASE=${2-"master"} 36 | 37 | if [ "$BRANCH" = "" ]; then 38 | echo "Usage: review.sh [parent branch]" 39 | exit 40 | else 41 | 42 | LABEL=`echo $1 | perl -pe '$_ =~ /dev\/([a-zA-Z0-9]+)\/(.+)/;$_=$2'` 43 | GLUSER=`echo $1 | perl -pe '$_ =~ /dev\/([a-zA-Z0-9]+)\/(.+)/;$_=$1'` 44 | 45 | NEWBRANCH="staging/$GLUSER/$LABEL" 46 | 47 | echo "Pushing $BRANCH from $BASE for review as $NEWBRANCH" 48 | 49 | git branch $NEWBRANCH $BASE 50 | git push origin $NEWBRANCH 51 | git checkout $NEWBRANCH 52 | git rebase $BRANCH 53 | git push origin $NEWBRANCH 54 | 55 | fi 56 | 57 | --------------------------------------------------------------------------------