├── COPYING ├── INSTALL ├── README ├── ROADMAP ├── VERSION ├── core ├── config │ ├── rtarch.h │ ├── rtarch_a32.h │ ├── rtarch_a32_128x1v1.h │ ├── rtarch_a32_128x2v1.h │ ├── rtarch_a32_SVEx1v1.h │ ├── rtarch_a32_SVEx2v1.h │ ├── rtarch_a64.h │ ├── rtarch_a64_128x1v1.h │ ├── rtarch_a64_128x2v1.h │ ├── rtarch_a64_SVEx1v1.h │ ├── rtarch_a64_SVEx2v1.h │ ├── rtarch_aHB.h │ ├── rtarch_aHB_128x1v1.h │ ├── rtarch_aHB_128x2v1.h │ ├── rtarch_aHB_SVEx1v1.h │ ├── rtarch_aHB_SVEx2v1.h │ ├── rtarch_aHF_128x1v2.h │ ├── rtarch_aHF_128x2v2.h │ ├── rtarch_aHF_SVEx1v1.h │ ├── rtarch_aHF_SVEx2v1.h │ ├── rtarch_arm.h │ ├── rtarch_arm_128x1v4.h │ ├── rtarch_m32.h │ ├── rtarch_m32_128x1v1.h │ ├── rtarch_m32_128x2v1.h │ ├── rtarch_m64.h │ ├── rtarch_m64_128x1v1.h │ ├── rtarch_m64_128x2v1.h │ ├── rtarch_mHB.h │ ├── rtarch_mHB_128x1v1.h │ ├── rtarch_mHB_128x2v1.h │ ├── rtarch_p32.h │ ├── rtarch_p32_128x1v1.h │ ├── rtarch_p32_128x1v2.h │ ├── rtarch_p32_128x1v4.h │ ├── rtarch_p32_128x2v1.h │ ├── rtarch_p32_128x2v2.h │ ├── rtarch_p32_128x2v4.h │ ├── rtarch_p32_128x2v8.h │ ├── rtarch_p32_128x2vG.h │ ├── rtarch_p32_128x4v1.h │ ├── rtarch_p32_128x4v2.h │ ├── rtarch_p64.h │ ├── rtarch_p64_128x1v1.h │ ├── rtarch_p64_128x1v2.h │ ├── rtarch_p64_128x2v1.h │ ├── rtarch_p64_128x2v2.h │ ├── rtarch_p64_128x2v4.h │ ├── rtarch_p64_128x2v8.h │ ├── rtarch_p64_128x4v1.h │ ├── rtarch_p64_128x4v2.h │ ├── rtarch_pHB.h │ ├── rtarch_pHB_128x1v1.h │ ├── rtarch_pHB_128x1v2.h │ ├── rtarch_pHB_128x1v4.h │ ├── rtarch_pHB_128x2v1.h │ ├── rtarch_pHB_128x2v2.h │ ├── rtarch_pHB_128x2vG.h │ ├── rtarch_pQF_128x1v2.h │ ├── rtarch_pQF_128x2v2.h │ ├── rtarch_x32.h │ ├── rtarch_x32_128x1v2.h │ ├── rtarch_x32_128x1v4.h │ ├── rtarch_x32_128x1v8.h │ ├── rtarch_x32_128x2v4.h │ ├── rtarch_x32_256x1v2.h │ ├── rtarch_x32_256x1v8.h │ ├── rtarch_x32_256x2v2.h │ ├── rtarch_x32_512x1v8.h │ ├── rtarch_x32_512x2v2.h │ ├── rtarch_x32_512x4v2.h │ ├── rtarch_x64.h │ ├── rtarch_x64_128x1v2.h │ ├── rtarch_x64_128x1v4.h │ ├── rtarch_x64_128x1v8.h │ ├── rtarch_x64_128x2v4.h │ ├── rtarch_x64_256x1v2.h │ ├── rtarch_x64_256x1v8.h │ ├── rtarch_x64_256x2v2.h │ ├── rtarch_x64_512x1v8.h │ ├── rtarch_x64_512x2v2.h │ ├── rtarch_x64_512x4v2.h │ ├── rtarch_x86.h │ ├── rtarch_x86_128x1v4.h │ ├── rtarch_x86_128x1v8.h │ ├── rtarch_x86_256x1v2.h │ ├── rtarch_x86_512x1v2.h │ ├── rtarch_xHB.h │ ├── rtarch_xHB_128x1v2.h │ ├── rtarch_xHB_128x1v4.h │ ├── rtarch_xHB_128x1v8.h │ ├── rtarch_xHB_128x2v4.h │ ├── rtarch_xHB_256x1v2.h │ ├── rtarch_xHB_256x1v8.h │ ├── rtarch_xHB_256x2v2.h │ ├── rtarch_xHB_512x1v8.h │ ├── rtarch_xHB_512x2v2.h │ ├── rtarch_xHB_512x4v2.h │ ├── rtarch_xHF_128x1v2.h │ ├── rtarch_xHF_256x1v8.h │ ├── rtarch_xHF_512x1v8.h │ ├── rtarch_xHF_512x2v2.h │ ├── rtarch_xHF_512x4v2.h │ ├── rtbase.h │ ├── rtconf.h │ ├── rtdocs.h │ └── rtzero.h ├── engine │ ├── engine.cpp │ ├── engine.h │ ├── format.h │ ├── object.cpp │ ├── object.h │ ├── rtgeom.cpp │ ├── rtgeom.h │ ├── rtimag.cpp │ └── rtimag.h ├── system │ ├── system.cpp │ └── system.h └── tracer │ ├── tracer.cpp │ ├── tracer.h │ ├── tracer_128v1.cpp │ ├── tracer_128v2.cpp │ ├── tracer_128v4.cpp │ ├── tracer_128v8.cpp │ ├── tracer_1K4v1.cpp │ ├── tracer_1K4v2.cpp │ ├── tracer_1K4v4.cpp │ ├── tracer_256v1.cpp │ ├── tracer_256v2.cpp │ ├── tracer_256v4.cpp │ ├── tracer_256v4_r8.cpp │ ├── tracer_256v8.cpp │ ├── tracer_2K8v1_r8.cpp │ ├── tracer_2K8v2_r8.cpp │ ├── tracer_2K8v4_r8.cpp │ ├── tracer_512v1.cpp │ ├── tracer_512v1_r8.cpp │ ├── tracer_512v2.cpp │ ├── tracer_512v2_r8.cpp │ ├── tracer_512v4.cpp │ └── tracer_512v8.cpp ├── data ├── materials │ └── all_mat.h ├── objects │ ├── all_obj.h │ ├── obj_aliencube.h │ └── obj_frametable.h ├── scenes │ ├── all_scn.h │ ├── scn_demo01.h │ ├── scn_demo02.h │ └── scn_demo03.h └── textures │ ├── all_tex.h │ └── tex_crate01.h ├── dump ├── err.txt └── log.txt ├── root ├── RooT.h ├── RooT_linux.cpp ├── RooT_make_a32.mk ├── RooT_make_a64.mk ├── RooT_make_a64.sh ├── RooT_make_arm.mk ├── RooT_make_m32.mk ├── RooT_make_m64.mk ├── RooT_make_m64.sh ├── RooT_make_p32.mk ├── RooT_make_p64.mk ├── RooT_make_p64.sh ├── RooT_make_w64.bat ├── RooT_make_w64.mk ├── RooT_make_x32.mk ├── RooT_make_x64.mk ├── RooT_make_x64.sh ├── RooT_make_x86.mk ├── RooT_winxx.cpp ├── RooT_x64.sln ├── RooT_x64.vcxproj ├── RooT_x64.vcxproj.filters └── RooT_x64.vcxproj.user └── test ├── build_cross.sh ├── build_linux.sh ├── build_macM1.sh ├── build_macOS.sh ├── build_multi.sh ├── build_nokia.sh ├── build_raspi.sh ├── build_win64.bat ├── clean_cross.sh ├── clean_linux.sh ├── clean_macM1.sh ├── clean_macOS.sh ├── clean_multi.sh ├── clean_nokia.sh ├── clean_raspi.sh ├── clean_win64.bat ├── core_make_a32.mk ├── core_make_a64.mk ├── core_make_arm.mk ├── core_make_m32.mk ├── core_make_m64.mk ├── core_make_p32.mk ├── core_make_p64.mk ├── core_make_w64.bat ├── core_make_w64.mk ├── core_make_x32.mk ├── core_make_x64.mk ├── core_make_x86.mk ├── core_qemu32.sh ├── core_qemu64.sh ├── core_test.cpp ├── core_test64.sh ├── core_test86.sh ├── core_test_x64.sln ├── core_test_x64.vcxproj ├── core_test_x64.vcxproj.filters ├── core_test_x64.vcxproj.user ├── scenes ├── scn_test01.h ├── scn_test02.h ├── scn_test03.h ├── scn_test04.h ├── scn_test05.h ├── scn_test06.h ├── scn_test07.h ├── scn_test08.h ├── scn_test09.h ├── scn_test10.h ├── scn_test11.h ├── scn_test12.h ├── scn_test13.h ├── scn_test14.h ├── scn_test15.h ├── scn_test16.h ├── scn_test17.h └── scn_test18.h ├── simd_make_a32.mk ├── simd_make_a64.mk ├── simd_make_arm.mk ├── simd_make_m32.mk ├── simd_make_m64.mk ├── simd_make_p32.mk ├── simd_make_p64.mk ├── simd_make_w64.bat ├── simd_make_w64.mk ├── simd_make_x32.mk ├── simd_make_x64.mk ├── simd_make_x86.mk ├── simd_qemu32.sh ├── simd_qemu64.sh ├── simd_test.cpp ├── simd_test64.sh ├── simd_test86.sh ├── simd_test_x64.sln ├── simd_test_x64.vcxproj ├── simd_test_x64.vcxproj.filters └── simd_test_x64.vcxproj.user /COPYING: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013-2025 VectorChief (at github, bitbucket, sourceforge) 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 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | QuadRay engine is a realtime raytracing project aimed at full SIMD utilization 2 | on ARM, MIPS, POWER and x86 architectures. The efficient use of SIMD is achieved 3 | by processing four rays at a time to match SIMD register width (hence the name). 4 | The rendering core of the engine is written in a unified SIMD assembler 5 | allowing single assembler code to be compatible with different processor 6 | architectures, thus reducing the need to maintain multiple parallel versions. 7 | 8 | Initial documentation for the assembler is provided in core/config/rtdocs.h. 9 | 10 | At present, Intel SSE/SSE2/SSE4 and AVX/AVX2/AVX-512 (32/64-bit x86 ISAs), 11 | ARMv7 NEON/NEONv2, ARMv8 AArch32 and AArch64 NEON, SVE (32/64-bit ARM ISAs), 12 | MIPS 32/64-bit r5/r6 MSA and POWER 32/64-bit VMX/VSX (little/big-endian ISAs) 13 | are mostly implemented (w/ horizontal reductions and byte/half SIMD+BASE ops) 14 | although scalar improvements, wider SIMD vectors with zeroing/merging predicates 15 | in 3/4-operand instructions, cross-precision fp-converters on modern CPU targets 16 | are planned as extensions to current 2/3-operand SPMD-driven vertical SIMD ISA. 17 | 18 | The project has a test framework for Linux/GCC/Clang and Windows/VC++/TDM64-GCC. 19 | Support for macOS is provided via Command Line Tools with GCC and Clang options. 20 | Instructions for resolving dependencies and building the binaries 21 | for supported platforms can be found in the accompanying INSTALL file. 22 | 23 | RooT demo features: 24 | - Move/rotate camera with W,A,S,D + arrow keys 25 | - Print state (to dump) of all objects in the scene (on F1/'I') 26 | - Runtime toggling of antialiasing (on F2/'2') 27 | - Runtime cycling through cameras (on F3/'3') 28 | - Runtime saving (to dump) of BMP screenshots (on F4/'4') 29 | - Runtime toggling of FPS logging (on F5/'L') 30 | - Runtime switching of SIMD targets (F6/'6', F7/'7', F8/'8') 31 | - Runtime scene selection (F11/'1'), hide nums (F12/'5') 32 | - Multi-threading support with core count (df: 120 threads) 33 | - Multi-group affinity for Windows threading (> 64 threads) 34 | - Fullscreen support on Linux, macOS and Windows (-w 0) 35 | - Offscreen rendering support for benchmarking (-o or '0'/'O') 36 | - Pause mode (-p or 'P'), update/render stages (-u n or '9'/'U') 37 | - Quake mode (-q or 'Q'/'T'), frames in update (-m n or 'E'/'Y') 38 | - Refer to VERSION file (section 0.6.7) for cli options 39 | 40 | QuadRay core features: 41 | - Full set of plane + quadric solvers 42 | - Custom clipping (with surface), boolean ops 43 | - Full geometry transform (hierarchical) 44 | - Basic RGB texturing for planes, no UV-mapping yet 45 | - Ambient + diffuse + specular + attenuation lights 46 | - All lights are colored points with infinite range 47 | - Hard shadows (opaque) from all light sources 48 | - Reflections/refractions + translucency, Fresnel (df: off) 49 | - Fullscreen 2x/4x antialiasing, Gamma correction (df: off) 50 | - Tiled scanline rendering, custom tree-like accelerators 51 | - Statically-linkable data format (C/C++ structs) 52 | - Programmable animators for all objects (below root) 53 | - 8 registers deep SIMD rendering pipeline (core/tracer) 54 | - Preliminary support for path-tracer with SIMD buffers 55 | - Written in UniSIMD assembler 56 | -------------------------------------------------------------------------------- /core/engine/rtimag.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | /* Copyright (c) 2013-2025 VectorChief (at github, bitbucket, sourceforge) */ 3 | /* Distributed under the MIT software license, see the accompanying */ 4 | /* file COPYING or http://www.opensource.org/licenses/mit-license.php */ 5 | /******************************************************************************/ 6 | 7 | #ifndef RT_RTIMAG_H 8 | #define RT_RTIMAG_H 9 | 10 | #include "rtbase.h" 11 | #include "format.h" 12 | #include "system.h" 13 | 14 | /******************************************************************************/ 15 | /********************************* LEGEND *********************************/ 16 | /******************************************************************************/ 17 | 18 | /* 19 | * rtimag.h: Interface for the image utils library. 20 | * 21 | * More detailed description of this subsystem is given in rtimag.cpp. 22 | * Recommended naming scheme for C++ types and definitions is given in rtbase.h. 23 | */ 24 | 25 | /******************************************************************************/ 26 | /******************************* DEFINITIONS ******************************/ 27 | /******************************************************************************/ 28 | 29 | #if RT_EMBED_FILEIO == 1 && RT_EMBED_TEX == 0 30 | #error "RT_EMBED_TEX must be enabled if RT_EMBED_FILEIO is enabled" 31 | #endif /* RT_EMBED_FILEIO, RT_EMBED_TEX */ 32 | 33 | #define RT_PATH_TEXTURES RT_PATH_TOSTR(RT_PATH)"data/textures/" 34 | 35 | /******************************************************************************/ 36 | /******************************** TEXTURE *********************************/ 37 | /******************************************************************************/ 38 | 39 | /* 40 | * Load image from file to memory. 41 | */ 42 | rt_void load_image(rt_Heap *hp, rt_pstr name, rt_TEX *tx); 43 | 44 | /* 45 | * Save image from memory to file. 46 | */ 47 | rt_void save_image(rt_Heap *hp, rt_pstr name, rt_TEX *tx); 48 | 49 | /* 50 | * Convert image from file to C static array initializer format. 51 | */ 52 | rt_si32 convert_image(rt_Heap *hp, rt_pstr name); 53 | 54 | #endif /* RT_RTIMAG_H */ 55 | 56 | /******************************************************************************/ 57 | /******************************************************************************/ 58 | /******************************************************************************/ 59 | -------------------------------------------------------------------------------- /core/tracer/tracer_128v1.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | /* Copyright (c) 2013-2025 VectorChief (at github, bitbucket, sourceforge) */ 3 | /* Distributed under the MIT software license, see the accompanying */ 4 | /* file COPYING or http://www.opensource.org/licenses/mit-license.php */ 5 | /******************************************************************************/ 6 | 7 | #ifndef RT_REGS 8 | #define RT_REGS 32 /* define maximum of available SIMD registers for code */ 9 | #endif /* RT_REGS */ 10 | 11 | #undef RT_SIMD 12 | #define RT_SIMD 128 /* map vector-length-agnostic SIMD subsets to 128-bit */ 13 | #define RT_SIMD_CODE /* enable SIMD instruction definitions */ 14 | 15 | #if (defined RT_128) && (RT_128 & 1) 16 | #define RT_RENDER_CODE /* enable contents of render0 routine */ 17 | #endif /* RT_128 */ 18 | 19 | /* 20 | * Determine SIMD total-quads for backend structs (maximal for a given build). 21 | */ 22 | #if (defined RT_MAXQ) 23 | /* RT_MAXQ is already defined outside */ 24 | #elif (RT_2K8_R8) 25 | #define RT_MAXQ 16 26 | #elif (RT_1K4 || RT_1K4_R8) 27 | #define RT_MAXQ 8 28 | #elif (RT_512 || RT_512_R8) 29 | #define RT_MAXQ 4 30 | #elif (RT_256 || RT_256_R8) 31 | #define RT_MAXQ 2 32 | #elif (RT_128) 33 | #define RT_MAXQ 1 34 | #endif /* RT_MAXQ: 16, 8, 4, 2, 1 */ 35 | 36 | #undef RT_2K8_R8 37 | #undef RT_1K4 38 | #undef RT_1K4_R8 39 | #undef RT_512 40 | #undef RT_512_R8 41 | #undef RT_256 42 | #undef RT_256_R8 43 | #undef RT_128 44 | 45 | #define RT_128 1 46 | 47 | #include "tracer.h" 48 | #include "format.h" 49 | 50 | #undef RT_FEAT_PT 51 | #undef RT_FEAT_BUFFERS 52 | #define RT_FEAT_PT 0 53 | #define RT_FEAT_BUFFERS 0 54 | 55 | #undef STORE_SIMD 56 | #undef PAINT_FRAG 57 | #undef GET_RANDOM_I 58 | 59 | namespace rt_simd_128v1 60 | { 61 | #include "tracer.cpp" 62 | } 63 | 64 | #undef RT_FEAT_PT 65 | #undef RT_FEAT_BUFFERS 66 | #define RT_FEAT_PT 1 67 | #define RT_FEAT_BUFFERS 1 68 | 69 | #undef STORE_SIMD 70 | #undef PAINT_FRAG 71 | #undef GET_RANDOM_I 72 | 73 | namespace pt_simd_128v1 74 | { 75 | #include "tracer.cpp" 76 | } 77 | 78 | /******************************************************************************/ 79 | /******************************************************************************/ 80 | /******************************************************************************/ 81 | -------------------------------------------------------------------------------- /core/tracer/tracer_128v2.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | /* Copyright (c) 2013-2025 VectorChief (at github, bitbucket, sourceforge) */ 3 | /* Distributed under the MIT software license, see the accompanying */ 4 | /* file COPYING or http://www.opensource.org/licenses/mit-license.php */ 5 | /******************************************************************************/ 6 | 7 | #ifndef RT_REGS 8 | #define RT_REGS 32 /* define maximum of available SIMD registers for code */ 9 | #endif /* RT_REGS */ 10 | 11 | #undef RT_SIMD 12 | #define RT_SIMD 128 /* map vector-length-agnostic SIMD subsets to 128-bit */ 13 | #define RT_SIMD_CODE /* enable SIMD instruction definitions */ 14 | 15 | #if (defined RT_128) && (RT_128 & 2) 16 | #define RT_RENDER_CODE /* enable contents of render0 routine */ 17 | #endif /* RT_128 */ 18 | 19 | /* 20 | * Determine SIMD total-quads for backend structs (maximal for a given build). 21 | */ 22 | #if (defined RT_MAXQ) 23 | /* RT_MAXQ is already defined outside */ 24 | #elif (RT_2K8_R8) 25 | #define RT_MAXQ 16 26 | #elif (RT_1K4 || RT_1K4_R8) 27 | #define RT_MAXQ 8 28 | #elif (RT_512 || RT_512_R8) 29 | #define RT_MAXQ 4 30 | #elif (RT_256 || RT_256_R8) 31 | #define RT_MAXQ 2 32 | #elif (RT_128) 33 | #define RT_MAXQ 1 34 | #endif /* RT_MAXQ: 16, 8, 4, 2, 1 */ 35 | 36 | #undef RT_2K8_R8 37 | #undef RT_1K4 38 | #undef RT_1K4_R8 39 | #undef RT_512 40 | #undef RT_512_R8 41 | #undef RT_256 42 | #undef RT_256_R8 43 | #undef RT_128 44 | 45 | #define RT_128 2 46 | 47 | #include "tracer.h" 48 | #include "format.h" 49 | 50 | #undef RT_FEAT_PT 51 | #undef RT_FEAT_BUFFERS 52 | #define RT_FEAT_PT 0 53 | #define RT_FEAT_BUFFERS 0 54 | 55 | #undef STORE_SIMD 56 | #undef PAINT_FRAG 57 | #undef GET_RANDOM_I 58 | 59 | namespace rt_simd_128v2 60 | { 61 | #include "tracer.cpp" 62 | } 63 | 64 | #undef RT_FEAT_PT 65 | #undef RT_FEAT_BUFFERS 66 | #define RT_FEAT_PT 1 67 | #define RT_FEAT_BUFFERS 1 68 | 69 | #undef STORE_SIMD 70 | #undef PAINT_FRAG 71 | #undef GET_RANDOM_I 72 | 73 | namespace pt_simd_128v2 74 | { 75 | #include "tracer.cpp" 76 | } 77 | 78 | /******************************************************************************/ 79 | /******************************************************************************/ 80 | /******************************************************************************/ 81 | -------------------------------------------------------------------------------- /core/tracer/tracer_128v4.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | /* Copyright (c) 2013-2025 VectorChief (at github, bitbucket, sourceforge) */ 3 | /* Distributed under the MIT software license, see the accompanying */ 4 | /* file COPYING or http://www.opensource.org/licenses/mit-license.php */ 5 | /******************************************************************************/ 6 | 7 | #ifndef RT_REGS 8 | #define RT_REGS 16 /* define maximum of available SIMD registers for code */ 9 | #endif /* RT_REGS */ 10 | 11 | #undef RT_SIMD 12 | #define RT_SIMD 128 /* map vector-length-agnostic SIMD subsets to 128-bit */ 13 | #define RT_SIMD_CODE /* enable SIMD instruction definitions */ 14 | 15 | #if (defined RT_128) && (RT_128 & 4) 16 | #define RT_RENDER_CODE /* enable contents of render0 routine */ 17 | #endif /* RT_128 */ 18 | 19 | /* 20 | * Determine SIMD total-quads for backend structs (maximal for a given build). 21 | */ 22 | #if (defined RT_MAXQ) 23 | /* RT_MAXQ is already defined outside */ 24 | #elif (RT_2K8_R8) 25 | #define RT_MAXQ 16 26 | #elif (RT_1K4 || RT_1K4_R8) 27 | #define RT_MAXQ 8 28 | #elif (RT_512 || RT_512_R8) 29 | #define RT_MAXQ 4 30 | #elif (RT_256 || RT_256_R8) 31 | #define RT_MAXQ 2 32 | #elif (RT_128) 33 | #define RT_MAXQ 1 34 | #endif /* RT_MAXQ: 16, 8, 4, 2, 1 */ 35 | 36 | #undef RT_2K8_R8 37 | #undef RT_1K4 38 | #undef RT_1K4_R8 39 | #undef RT_512 40 | #undef RT_512_R8 41 | #undef RT_256 42 | #undef RT_256_R8 43 | #undef RT_128 44 | 45 | #define RT_128 4 46 | 47 | #include "tracer.h" 48 | #include "format.h" 49 | 50 | #undef RT_FEAT_PT 51 | #undef RT_FEAT_BUFFERS 52 | #define RT_FEAT_PT 0 53 | #define RT_FEAT_BUFFERS 0 54 | 55 | #undef STORE_SIMD 56 | #undef PAINT_FRAG 57 | #undef GET_RANDOM_I 58 | 59 | namespace rt_simd_128v4 60 | { 61 | #include "tracer.cpp" 62 | } 63 | 64 | #undef RT_FEAT_PT 65 | #undef RT_FEAT_BUFFERS 66 | #define RT_FEAT_PT 1 67 | #define RT_FEAT_BUFFERS 1 68 | 69 | #undef STORE_SIMD 70 | #undef PAINT_FRAG 71 | #undef GET_RANDOM_I 72 | 73 | namespace pt_simd_128v4 74 | { 75 | #include "tracer.cpp" 76 | } 77 | 78 | /******************************************************************************/ 79 | /******************************************************************************/ 80 | /******************************************************************************/ 81 | -------------------------------------------------------------------------------- /core/tracer/tracer_128v8.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | /* Copyright (c) 2013-2025 VectorChief (at github, bitbucket, sourceforge) */ 3 | /* Distributed under the MIT software license, see the accompanying */ 4 | /* file COPYING or http://www.opensource.org/licenses/mit-license.php */ 5 | /******************************************************************************/ 6 | 7 | #ifndef RT_REGS 8 | #define RT_REGS 16 /* define maximum of available SIMD registers for code */ 9 | #endif /* RT_REGS */ 10 | 11 | #undef RT_SIMD 12 | #define RT_SIMD 128 /* map vector-length-agnostic SIMD subsets to 128-bit */ 13 | #define RT_SIMD_CODE /* enable SIMD instruction definitions */ 14 | 15 | #if (defined RT_128) && (RT_128 & 8) 16 | #define RT_RENDER_CODE /* enable contents of render0 routine */ 17 | #endif /* RT_128 */ 18 | 19 | /* 20 | * Determine SIMD total-quads for backend structs (maximal for a given build). 21 | */ 22 | #if (defined RT_MAXQ) 23 | /* RT_MAXQ is already defined outside */ 24 | #elif (RT_2K8_R8) 25 | #define RT_MAXQ 16 26 | #elif (RT_1K4 || RT_1K4_R8) 27 | #define RT_MAXQ 8 28 | #elif (RT_512 || RT_512_R8) 29 | #define RT_MAXQ 4 30 | #elif (RT_256 || RT_256_R8) 31 | #define RT_MAXQ 2 32 | #elif (RT_128) 33 | #define RT_MAXQ 1 34 | #endif /* RT_MAXQ: 16, 8, 4, 2, 1 */ 35 | 36 | #undef RT_2K8_R8 37 | #undef RT_1K4 38 | #undef RT_1K4_R8 39 | #undef RT_512 40 | #undef RT_512_R8 41 | #undef RT_256 42 | #undef RT_256_R8 43 | #undef RT_128 44 | 45 | #define RT_128 8 46 | 47 | #include "tracer.h" 48 | #include "format.h" 49 | 50 | #undef RT_FEAT_PT 51 | #undef RT_FEAT_BUFFERS 52 | #define RT_FEAT_PT 0 53 | #define RT_FEAT_BUFFERS 0 54 | 55 | #undef STORE_SIMD 56 | #undef PAINT_FRAG 57 | #undef GET_RANDOM_I 58 | 59 | namespace rt_simd_128v8 60 | { 61 | #include "tracer.cpp" 62 | } 63 | 64 | #undef RT_FEAT_PT 65 | #undef RT_FEAT_BUFFERS 66 | #define RT_FEAT_PT 1 67 | #define RT_FEAT_BUFFERS 1 68 | 69 | #undef STORE_SIMD 70 | #undef PAINT_FRAG 71 | #undef GET_RANDOM_I 72 | 73 | namespace pt_simd_128v8 74 | { 75 | #include "tracer.cpp" 76 | } 77 | 78 | /******************************************************************************/ 79 | /******************************************************************************/ 80 | /******************************************************************************/ 81 | -------------------------------------------------------------------------------- /core/tracer/tracer_1K4v1.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | /* Copyright (c) 2013-2025 VectorChief (at github, bitbucket, sourceforge) */ 3 | /* Distributed under the MIT software license, see the accompanying */ 4 | /* file COPYING or http://www.opensource.org/licenses/mit-license.php */ 5 | /******************************************************************************/ 6 | 7 | #ifndef RT_REGS 8 | #define RT_REGS 16 /* define maximum of available SIMD registers for code */ 9 | #endif /* RT_REGS */ 10 | 11 | #undef RT_SIMD 12 | #define RT_SIMD 1024 /* map vector-length-agnostic SIMD subsets to 1K4-bit */ 13 | #define RT_SIMD_CODE /* enable SIMD instruction definitions */ 14 | 15 | #if (defined RT_1K4) && (RT_1K4 & 1) 16 | #define RT_RENDER_CODE /* enable contents of render0 routine */ 17 | #endif /* RT_1K4 */ 18 | 19 | /* 20 | * Determine SIMD total-quads for backend structs (maximal for a given build). 21 | */ 22 | #if (defined RT_MAXQ) 23 | /* RT_MAXQ is already defined outside */ 24 | #elif (RT_2K8_R8) 25 | #define RT_MAXQ 16 26 | #elif (RT_1K4 || RT_1K4_R8) 27 | #define RT_MAXQ 8 28 | #elif (RT_512 || RT_512_R8) 29 | #define RT_MAXQ 4 30 | #elif (RT_256 || RT_256_R8) 31 | #define RT_MAXQ 2 32 | #elif (RT_128) 33 | #define RT_MAXQ 1 34 | #endif /* RT_MAXQ: 16, 8, 4, 2, 1 */ 35 | 36 | #undef RT_2K8_R8 37 | #undef RT_1K4 38 | #undef RT_1K4_R8 39 | #undef RT_512 40 | #undef RT_512_R8 41 | #undef RT_256 42 | #undef RT_256_R8 43 | #undef RT_128 44 | 45 | #define RT_1K4 1 46 | 47 | #include "tracer.h" 48 | #include "format.h" 49 | 50 | #undef RT_FEAT_PT 51 | #undef RT_FEAT_BUFFERS 52 | #define RT_FEAT_PT 0 53 | #define RT_FEAT_BUFFERS 0 54 | 55 | #undef STORE_SIMD 56 | #undef PAINT_FRAG 57 | #undef GET_RANDOM_I 58 | 59 | namespace rt_simd_1K4v1 60 | { 61 | #include "tracer.cpp" 62 | } 63 | 64 | #undef RT_FEAT_PT 65 | #undef RT_FEAT_BUFFERS 66 | #define RT_FEAT_PT 1 67 | #define RT_FEAT_BUFFERS 1 68 | 69 | #undef STORE_SIMD 70 | #undef PAINT_FRAG 71 | #undef GET_RANDOM_I 72 | 73 | namespace pt_simd_1K4v1 74 | { 75 | #include "tracer.cpp" 76 | } 77 | 78 | /******************************************************************************/ 79 | /******************************************************************************/ 80 | /******************************************************************************/ 81 | -------------------------------------------------------------------------------- /core/tracer/tracer_1K4v2.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | /* Copyright (c) 2013-2025 VectorChief (at github, bitbucket, sourceforge) */ 3 | /* Distributed under the MIT software license, see the accompanying */ 4 | /* file COPYING or http://www.opensource.org/licenses/mit-license.php */ 5 | /******************************************************************************/ 6 | 7 | #ifndef RT_REGS 8 | #define RT_REGS 16 /* define maximum of available SIMD registers for code */ 9 | #endif /* RT_REGS */ 10 | 11 | #undef RT_SIMD 12 | #define RT_SIMD 1024 /* map vector-length-agnostic SIMD subsets to 1K4-bit */ 13 | #define RT_SIMD_CODE /* enable SIMD instruction definitions */ 14 | 15 | #if (defined RT_1K4) && (RT_1K4 & 2) 16 | #define RT_RENDER_CODE /* enable contents of render0 routine */ 17 | #endif /* RT_1K4 */ 18 | 19 | /* 20 | * Determine SIMD total-quads for backend structs (maximal for a given build). 21 | */ 22 | #if (defined RT_MAXQ) 23 | /* RT_MAXQ is already defined outside */ 24 | #elif (RT_2K8_R8) 25 | #define RT_MAXQ 16 26 | #elif (RT_1K4 || RT_1K4_R8) 27 | #define RT_MAXQ 8 28 | #elif (RT_512 || RT_512_R8) 29 | #define RT_MAXQ 4 30 | #elif (RT_256 || RT_256_R8) 31 | #define RT_MAXQ 2 32 | #elif (RT_128) 33 | #define RT_MAXQ 1 34 | #endif /* RT_MAXQ: 16, 8, 4, 2, 1 */ 35 | 36 | #undef RT_2K8_R8 37 | #undef RT_1K4 38 | #undef RT_1K4_R8 39 | #undef RT_512 40 | #undef RT_512_R8 41 | #undef RT_256 42 | #undef RT_256_R8 43 | #undef RT_128 44 | 45 | #define RT_1K4 2 46 | 47 | #include "tracer.h" 48 | #include "format.h" 49 | 50 | #undef RT_FEAT_PT 51 | #undef RT_FEAT_BUFFERS 52 | #define RT_FEAT_PT 0 53 | #define RT_FEAT_BUFFERS 0 54 | 55 | #undef STORE_SIMD 56 | #undef PAINT_FRAG 57 | #undef GET_RANDOM_I 58 | 59 | namespace rt_simd_1K4v2 60 | { 61 | #include "tracer.cpp" 62 | } 63 | 64 | #undef RT_FEAT_PT 65 | #undef RT_FEAT_BUFFERS 66 | #define RT_FEAT_PT 1 67 | #define RT_FEAT_BUFFERS 1 68 | 69 | #undef STORE_SIMD 70 | #undef PAINT_FRAG 71 | #undef GET_RANDOM_I 72 | 73 | namespace pt_simd_1K4v2 74 | { 75 | #include "tracer.cpp" 76 | } 77 | 78 | /******************************************************************************/ 79 | /******************************************************************************/ 80 | /******************************************************************************/ 81 | -------------------------------------------------------------------------------- /core/tracer/tracer_1K4v4.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | /* Copyright (c) 2013-2025 VectorChief (at github, bitbucket, sourceforge) */ 3 | /* Distributed under the MIT software license, see the accompanying */ 4 | /* file COPYING or http://www.opensource.org/licenses/mit-license.php */ 5 | /******************************************************************************/ 6 | 7 | #ifndef RT_REGS 8 | #define RT_REGS 32 /* define maximum of available SIMD registers for code */ 9 | #endif /* RT_REGS */ 10 | 11 | #undef RT_SIMD 12 | #define RT_SIMD 1024 /* map vector-length-agnostic SIMD subsets to 1K4-bit */ 13 | #define RT_SIMD_CODE /* enable SIMD instruction definitions */ 14 | 15 | #if (defined RT_1K4) && (RT_1K4 & 4) 16 | #define RT_RENDER_CODE /* enable contents of render0 routine */ 17 | #endif /* RT_1K4 */ 18 | 19 | /* 20 | * Determine SIMD total-quads for backend structs (maximal for a given build). 21 | */ 22 | #if (defined RT_MAXQ) 23 | /* RT_MAXQ is already defined outside */ 24 | #elif (RT_2K8_R8) 25 | #define RT_MAXQ 16 26 | #elif (RT_1K4 || RT_1K4_R8) 27 | #define RT_MAXQ 8 28 | #elif (RT_512 || RT_512_R8) 29 | #define RT_MAXQ 4 30 | #elif (RT_256 || RT_256_R8) 31 | #define RT_MAXQ 2 32 | #elif (RT_128) 33 | #define RT_MAXQ 1 34 | #endif /* RT_MAXQ: 16, 8, 4, 2, 1 */ 35 | 36 | #undef RT_2K8_R8 37 | #undef RT_1K4 38 | #undef RT_1K4_R8 39 | #undef RT_512 40 | #undef RT_512_R8 41 | #undef RT_256 42 | #undef RT_256_R8 43 | #undef RT_128 44 | 45 | #define RT_1K4 4 46 | 47 | #include "tracer.h" 48 | #include "format.h" 49 | 50 | #undef RT_FEAT_PT 51 | #undef RT_FEAT_BUFFERS 52 | #define RT_FEAT_PT 0 53 | #define RT_FEAT_BUFFERS 0 54 | 55 | #undef STORE_SIMD 56 | #undef PAINT_FRAG 57 | #undef GET_RANDOM_I 58 | 59 | namespace rt_simd_1K4v4 60 | { 61 | #include "tracer.cpp" 62 | } 63 | 64 | #undef RT_FEAT_PT 65 | #undef RT_FEAT_BUFFERS 66 | #define RT_FEAT_PT 1 67 | #define RT_FEAT_BUFFERS 1 68 | 69 | #undef STORE_SIMD 70 | #undef PAINT_FRAG 71 | #undef GET_RANDOM_I 72 | 73 | namespace pt_simd_1K4v4 74 | { 75 | #include "tracer.cpp" 76 | } 77 | 78 | /******************************************************************************/ 79 | /******************************************************************************/ 80 | /******************************************************************************/ 81 | -------------------------------------------------------------------------------- /core/tracer/tracer_256v1.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | /* Copyright (c) 2013-2025 VectorChief (at github, bitbucket, sourceforge) */ 3 | /* Distributed under the MIT software license, see the accompanying */ 4 | /* file COPYING or http://www.opensource.org/licenses/mit-license.php */ 5 | /******************************************************************************/ 6 | 7 | #ifndef RT_REGS 8 | #define RT_REGS 16 /* define maximum of available SIMD registers for code */ 9 | #endif /* RT_REGS */ 10 | 11 | #undef RT_SIMD 12 | #define RT_SIMD 256 /* map vector-length-agnostic SIMD subsets to 256-bit */ 13 | #define RT_SIMD_CODE /* enable SIMD instruction definitions */ 14 | 15 | #if (defined RT_256) && (RT_256 & 1) 16 | #define RT_RENDER_CODE /* enable contents of render0 routine */ 17 | #endif /* RT_256 */ 18 | 19 | /* 20 | * Determine SIMD total-quads for backend structs (maximal for a given build). 21 | */ 22 | #if (defined RT_MAXQ) 23 | /* RT_MAXQ is already defined outside */ 24 | #elif (RT_2K8_R8) 25 | #define RT_MAXQ 16 26 | #elif (RT_1K4 || RT_1K4_R8) 27 | #define RT_MAXQ 8 28 | #elif (RT_512 || RT_512_R8) 29 | #define RT_MAXQ 4 30 | #elif (RT_256 || RT_256_R8) 31 | #define RT_MAXQ 2 32 | #elif (RT_128) 33 | #define RT_MAXQ 1 34 | #endif /* RT_MAXQ: 16, 8, 4, 2, 1 */ 35 | 36 | #undef RT_2K8_R8 37 | #undef RT_1K4 38 | #undef RT_1K4_R8 39 | #undef RT_512 40 | #undef RT_512_R8 41 | #undef RT_256 42 | #undef RT_256_R8 43 | #undef RT_128 44 | 45 | #define RT_256 1 46 | 47 | #include "tracer.h" 48 | #include "format.h" 49 | 50 | #undef RT_FEAT_PT 51 | #undef RT_FEAT_BUFFERS 52 | #define RT_FEAT_PT 0 53 | #define RT_FEAT_BUFFERS 0 54 | 55 | #undef STORE_SIMD 56 | #undef PAINT_FRAG 57 | #undef GET_RANDOM_I 58 | 59 | namespace rt_simd_256v1 60 | { 61 | #include "tracer.cpp" 62 | } 63 | 64 | #undef RT_FEAT_PT 65 | #undef RT_FEAT_BUFFERS 66 | #define RT_FEAT_PT 1 67 | #define RT_FEAT_BUFFERS 1 68 | 69 | #undef STORE_SIMD 70 | #undef PAINT_FRAG 71 | #undef GET_RANDOM_I 72 | 73 | namespace pt_simd_256v1 74 | { 75 | #include "tracer.cpp" 76 | } 77 | 78 | /******************************************************************************/ 79 | /******************************************************************************/ 80 | /******************************************************************************/ 81 | -------------------------------------------------------------------------------- /core/tracer/tracer_256v2.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | /* Copyright (c) 2013-2025 VectorChief (at github, bitbucket, sourceforge) */ 3 | /* Distributed under the MIT software license, see the accompanying */ 4 | /* file COPYING or http://www.opensource.org/licenses/mit-license.php */ 5 | /******************************************************************************/ 6 | 7 | #ifndef RT_REGS 8 | #define RT_REGS 16 /* define maximum of available SIMD registers for code */ 9 | #endif /* RT_REGS */ 10 | 11 | #undef RT_SIMD 12 | #define RT_SIMD 256 /* map vector-length-agnostic SIMD subsets to 256-bit */ 13 | #define RT_SIMD_CODE /* enable SIMD instruction definitions */ 14 | 15 | #if (defined RT_256) && (RT_256 & 2) 16 | #define RT_RENDER_CODE /* enable contents of render0 routine */ 17 | #endif /* RT_256 */ 18 | 19 | /* 20 | * Determine SIMD total-quads for backend structs (maximal for a given build). 21 | */ 22 | #if (defined RT_MAXQ) 23 | /* RT_MAXQ is already defined outside */ 24 | #elif (RT_2K8_R8) 25 | #define RT_MAXQ 16 26 | #elif (RT_1K4 || RT_1K4_R8) 27 | #define RT_MAXQ 8 28 | #elif (RT_512 || RT_512_R8) 29 | #define RT_MAXQ 4 30 | #elif (RT_256 || RT_256_R8) 31 | #define RT_MAXQ 2 32 | #elif (RT_128) 33 | #define RT_MAXQ 1 34 | #endif /* RT_MAXQ: 16, 8, 4, 2, 1 */ 35 | 36 | #undef RT_2K8_R8 37 | #undef RT_1K4 38 | #undef RT_1K4_R8 39 | #undef RT_512 40 | #undef RT_512_R8 41 | #undef RT_256 42 | #undef RT_256_R8 43 | #undef RT_128 44 | 45 | #define RT_256 2 46 | 47 | #include "tracer.h" 48 | #include "format.h" 49 | 50 | #undef RT_FEAT_PT 51 | #undef RT_FEAT_BUFFERS 52 | #define RT_FEAT_PT 0 53 | #define RT_FEAT_BUFFERS 0 54 | 55 | #undef STORE_SIMD 56 | #undef PAINT_FRAG 57 | #undef GET_RANDOM_I 58 | 59 | namespace rt_simd_256v2 60 | { 61 | #include "tracer.cpp" 62 | } 63 | 64 | #undef RT_FEAT_PT 65 | #undef RT_FEAT_BUFFERS 66 | #define RT_FEAT_PT 1 67 | #define RT_FEAT_BUFFERS 1 68 | 69 | #undef STORE_SIMD 70 | #undef PAINT_FRAG 71 | #undef GET_RANDOM_I 72 | 73 | namespace pt_simd_256v2 74 | { 75 | #include "tracer.cpp" 76 | } 77 | 78 | /******************************************************************************/ 79 | /******************************************************************************/ 80 | /******************************************************************************/ 81 | -------------------------------------------------------------------------------- /core/tracer/tracer_256v4.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | /* Copyright (c) 2013-2025 VectorChief (at github, bitbucket, sourceforge) */ 3 | /* Distributed under the MIT software license, see the accompanying */ 4 | /* file COPYING or http://www.opensource.org/licenses/mit-license.php */ 5 | /******************************************************************************/ 6 | 7 | #ifndef RT_REGS 8 | #define RT_REGS 32 /* define maximum of available SIMD registers for code */ 9 | #endif /* RT_REGS */ 10 | 11 | #undef RT_SIMD 12 | #define RT_SIMD 256 /* map vector-length-agnostic SIMD subsets to 256-bit */ 13 | #define RT_SIMD_CODE /* enable SIMD instruction definitions */ 14 | 15 | #if (defined RT_256) && (RT_256 & 4) 16 | #define RT_RENDER_CODE /* enable contents of render0 routine */ 17 | #endif /* RT_256 */ 18 | 19 | /* 20 | * Determine SIMD total-quads for backend structs (maximal for a given build). 21 | */ 22 | #if (defined RT_MAXQ) 23 | /* RT_MAXQ is already defined outside */ 24 | #elif (RT_2K8_R8) 25 | #define RT_MAXQ 16 26 | #elif (RT_1K4 || RT_1K4_R8) 27 | #define RT_MAXQ 8 28 | #elif (RT_512 || RT_512_R8) 29 | #define RT_MAXQ 4 30 | #elif (RT_256 || RT_256_R8) 31 | #define RT_MAXQ 2 32 | #elif (RT_128) 33 | #define RT_MAXQ 1 34 | #endif /* RT_MAXQ: 16, 8, 4, 2, 1 */ 35 | 36 | #undef RT_2K8_R8 37 | #undef RT_1K4 38 | #undef RT_1K4_R8 39 | #undef RT_512 40 | #undef RT_512_R8 41 | #undef RT_256 42 | #undef RT_256_R8 43 | #undef RT_128 44 | 45 | #define RT_256 4 46 | 47 | #include "tracer.h" 48 | #include "format.h" 49 | 50 | #undef RT_FEAT_PT 51 | #undef RT_FEAT_BUFFERS 52 | #define RT_FEAT_PT 0 53 | #define RT_FEAT_BUFFERS 0 54 | 55 | #undef STORE_SIMD 56 | #undef PAINT_FRAG 57 | #undef GET_RANDOM_I 58 | 59 | namespace rt_simd_256v4 60 | { 61 | #include "tracer.cpp" 62 | } 63 | 64 | #undef RT_FEAT_PT 65 | #undef RT_FEAT_BUFFERS 66 | #define RT_FEAT_PT 1 67 | #define RT_FEAT_BUFFERS 1 68 | 69 | #undef STORE_SIMD 70 | #undef PAINT_FRAG 71 | #undef GET_RANDOM_I 72 | 73 | namespace pt_simd_256v4 74 | { 75 | #include "tracer.cpp" 76 | } 77 | 78 | /******************************************************************************/ 79 | /******************************************************************************/ 80 | /******************************************************************************/ 81 | -------------------------------------------------------------------------------- /core/tracer/tracer_256v4_r8.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | /* Copyright (c) 2013-2025 VectorChief (at github, bitbucket, sourceforge) */ 3 | /* Distributed under the MIT software license, see the accompanying */ 4 | /* file COPYING or http://www.opensource.org/licenses/mit-license.php */ 5 | /******************************************************************************/ 6 | 7 | #ifndef RT_REGS 8 | #define RT_REGS 8 /* define maximum of available SIMD registers for code */ 9 | #endif /* RT_REGS */ 10 | 11 | #undef RT_SIMD 12 | #define RT_SIMD 256 /* map vector-length-agnostic SIMD subsets to 256-bit */ 13 | #define RT_SIMD_CODE /* enable SIMD instruction definitions */ 14 | 15 | #if (defined RT_256_R8) && (RT_256_R8 & 4) 16 | #define RT_RENDER_CODE /* enable contents of render0 routine */ 17 | #endif /* RT_256_R8 */ 18 | 19 | /* 20 | * Determine SIMD total-quads for backend structs (maximal for a given build). 21 | */ 22 | #if (defined RT_MAXQ) 23 | /* RT_MAXQ is already defined outside */ 24 | #elif (RT_2K8_R8) 25 | #define RT_MAXQ 16 26 | #elif (RT_1K4 || RT_1K4_R8) 27 | #define RT_MAXQ 8 28 | #elif (RT_512 || RT_512_R8) 29 | #define RT_MAXQ 4 30 | #elif (RT_256 || RT_256_R8) 31 | #define RT_MAXQ 2 32 | #elif (RT_128) 33 | #define RT_MAXQ 1 34 | #endif /* RT_MAXQ: 16, 8, 4, 2, 1 */ 35 | 36 | #undef RT_2K8_R8 37 | #undef RT_1K4 38 | #undef RT_1K4_R8 39 | #undef RT_512 40 | #undef RT_512_R8 41 | #undef RT_256 42 | #undef RT_256_R8 43 | #undef RT_128 44 | 45 | #define RT_256_R8 4 46 | 47 | #include "tracer.h" 48 | #include "format.h" 49 | 50 | #undef RT_FEAT_PT 51 | #undef RT_FEAT_BUFFERS 52 | #define RT_FEAT_PT 0 53 | #define RT_FEAT_BUFFERS 0 54 | 55 | #undef STORE_SIMD 56 | #undef PAINT_FRAG 57 | #undef GET_RANDOM_I 58 | 59 | namespace rt_simd_256v4_r8 60 | { 61 | #include "tracer.cpp" 62 | } 63 | 64 | #undef RT_FEAT_PT 65 | #undef RT_FEAT_BUFFERS 66 | #define RT_FEAT_PT 1 67 | #define RT_FEAT_BUFFERS 1 68 | 69 | #undef STORE_SIMD 70 | #undef PAINT_FRAG 71 | #undef GET_RANDOM_I 72 | 73 | namespace pt_simd_256v4_r8 74 | { 75 | #include "tracer.cpp" 76 | } 77 | 78 | /******************************************************************************/ 79 | /******************************************************************************/ 80 | /******************************************************************************/ 81 | -------------------------------------------------------------------------------- /core/tracer/tracer_256v8.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | /* Copyright (c) 2013-2025 VectorChief (at github, bitbucket, sourceforge) */ 3 | /* Distributed under the MIT software license, see the accompanying */ 4 | /* file COPYING or http://www.opensource.org/licenses/mit-license.php */ 5 | /******************************************************************************/ 6 | 7 | #ifndef RT_REGS 8 | #define RT_REGS 32 /* define maximum of available SIMD registers for code */ 9 | #endif /* RT_REGS */ 10 | 11 | #undef RT_SIMD 12 | #define RT_SIMD 256 /* map vector-length-agnostic SIMD subsets to 256-bit */ 13 | #define RT_SIMD_CODE /* enable SIMD instruction definitions */ 14 | 15 | #if (defined RT_256) && (RT_256 & 8) 16 | #define RT_RENDER_CODE /* enable contents of render0 routine */ 17 | #endif /* RT_256 */ 18 | 19 | /* 20 | * Determine SIMD total-quads for backend structs (maximal for a given build). 21 | */ 22 | #if (defined RT_MAXQ) 23 | /* RT_MAXQ is already defined outside */ 24 | #elif (RT_2K8_R8) 25 | #define RT_MAXQ 16 26 | #elif (RT_1K4 || RT_1K4_R8) 27 | #define RT_MAXQ 8 28 | #elif (RT_512 || RT_512_R8) 29 | #define RT_MAXQ 4 30 | #elif (RT_256 || RT_256_R8) 31 | #define RT_MAXQ 2 32 | #elif (RT_128) 33 | #define RT_MAXQ 1 34 | #endif /* RT_MAXQ: 16, 8, 4, 2, 1 */ 35 | 36 | #undef RT_2K8_R8 37 | #undef RT_1K4 38 | #undef RT_1K4_R8 39 | #undef RT_512 40 | #undef RT_512_R8 41 | #undef RT_256 42 | #undef RT_256_R8 43 | #undef RT_128 44 | 45 | #define RT_256 8 46 | 47 | #include "tracer.h" 48 | #include "format.h" 49 | 50 | #undef RT_FEAT_PT 51 | #undef RT_FEAT_BUFFERS 52 | #define RT_FEAT_PT 0 53 | #define RT_FEAT_BUFFERS 0 54 | 55 | #undef STORE_SIMD 56 | #undef PAINT_FRAG 57 | #undef GET_RANDOM_I 58 | 59 | namespace rt_simd_256v8 60 | { 61 | #include "tracer.cpp" 62 | } 63 | 64 | #undef RT_FEAT_PT 65 | #undef RT_FEAT_BUFFERS 66 | #define RT_FEAT_PT 1 67 | #define RT_FEAT_BUFFERS 1 68 | 69 | #undef STORE_SIMD 70 | #undef PAINT_FRAG 71 | #undef GET_RANDOM_I 72 | 73 | namespace pt_simd_256v8 74 | { 75 | #include "tracer.cpp" 76 | } 77 | 78 | /******************************************************************************/ 79 | /******************************************************************************/ 80 | /******************************************************************************/ 81 | -------------------------------------------------------------------------------- /core/tracer/tracer_2K8v1_r8.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | /* Copyright (c) 2013-2025 VectorChief (at github, bitbucket, sourceforge) */ 3 | /* Distributed under the MIT software license, see the accompanying */ 4 | /* file COPYING or http://www.opensource.org/licenses/mit-license.php */ 5 | /******************************************************************************/ 6 | 7 | #ifndef RT_REGS 8 | #define RT_REGS 8 /* define maximum of available SIMD registers for code */ 9 | #endif /* RT_REGS */ 10 | 11 | #undef RT_SIMD 12 | #define RT_SIMD 2048 /* map vector-length-agnostic SIMD subsets to 2K8-bit */ 13 | #define RT_SIMD_CODE /* enable SIMD instruction definitions */ 14 | 15 | #if (defined RT_2K8_R8) && (RT_2K8_R8 & 1) 16 | #define RT_RENDER_CODE /* enable contents of render0 routine */ 17 | #endif /* RT_2K8_R8 */ 18 | 19 | /* 20 | * Determine SIMD total-quads for backend structs (maximal for a given build). 21 | */ 22 | #if (defined RT_MAXQ) 23 | /* RT_MAXQ is already defined outside */ 24 | #elif (RT_2K8_R8) 25 | #define RT_MAXQ 16 26 | #elif (RT_1K4 || RT_1K4_R8) 27 | #define RT_MAXQ 8 28 | #elif (RT_512 || RT_512_R8) 29 | #define RT_MAXQ 4 30 | #elif (RT_256 || RT_256_R8) 31 | #define RT_MAXQ 2 32 | #elif (RT_128) 33 | #define RT_MAXQ 1 34 | #endif /* RT_MAXQ: 16, 8, 4, 2, 1 */ 35 | 36 | #undef RT_2K8_R8 37 | #undef RT_1K4 38 | #undef RT_1K4_R8 39 | #undef RT_512 40 | #undef RT_512_R8 41 | #undef RT_256 42 | #undef RT_256_R8 43 | #undef RT_128 44 | 45 | #define RT_2K8_R8 1 46 | 47 | #include "tracer.h" 48 | #include "format.h" 49 | 50 | #undef RT_FEAT_PT 51 | #undef RT_FEAT_BUFFERS 52 | #define RT_FEAT_PT 0 53 | #define RT_FEAT_BUFFERS 0 54 | 55 | #undef STORE_SIMD 56 | #undef PAINT_FRAG 57 | #undef GET_RANDOM_I 58 | 59 | namespace rt_simd_2K8v1_r8 60 | { 61 | #include "tracer.cpp" 62 | } 63 | 64 | #undef RT_FEAT_PT 65 | #undef RT_FEAT_BUFFERS 66 | #define RT_FEAT_PT 1 67 | #define RT_FEAT_BUFFERS 1 68 | 69 | #undef STORE_SIMD 70 | #undef PAINT_FRAG 71 | #undef GET_RANDOM_I 72 | 73 | namespace pt_simd_2K8v1_r8 74 | { 75 | #include "tracer.cpp" 76 | } 77 | 78 | /******************************************************************************/ 79 | /******************************************************************************/ 80 | /******************************************************************************/ 81 | -------------------------------------------------------------------------------- /core/tracer/tracer_2K8v2_r8.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | /* Copyright (c) 2013-2025 VectorChief (at github, bitbucket, sourceforge) */ 3 | /* Distributed under the MIT software license, see the accompanying */ 4 | /* file COPYING or http://www.opensource.org/licenses/mit-license.php */ 5 | /******************************************************************************/ 6 | 7 | #ifndef RT_REGS 8 | #define RT_REGS 8 /* define maximum of available SIMD registers for code */ 9 | #endif /* RT_REGS */ 10 | 11 | #undef RT_SIMD 12 | #define RT_SIMD 2048 /* map vector-length-agnostic SIMD subsets to 2K8-bit */ 13 | #define RT_SIMD_CODE /* enable SIMD instruction definitions */ 14 | 15 | #if (defined RT_2K8_R8) && (RT_2K8_R8 & 2) 16 | #define RT_RENDER_CODE /* enable contents of render0 routine */ 17 | #endif /* RT_2K8_R8 */ 18 | 19 | /* 20 | * Determine SIMD total-quads for backend structs (maximal for a given build). 21 | */ 22 | #if (defined RT_MAXQ) 23 | /* RT_MAXQ is already defined outside */ 24 | #elif (RT_2K8_R8) 25 | #define RT_MAXQ 16 26 | #elif (RT_1K4 || RT_1K4_R8) 27 | #define RT_MAXQ 8 28 | #elif (RT_512 || RT_512_R8) 29 | #define RT_MAXQ 4 30 | #elif (RT_256 || RT_256_R8) 31 | #define RT_MAXQ 2 32 | #elif (RT_128) 33 | #define RT_MAXQ 1 34 | #endif /* RT_MAXQ: 16, 8, 4, 2, 1 */ 35 | 36 | #undef RT_2K8_R8 37 | #undef RT_1K4 38 | #undef RT_1K4_R8 39 | #undef RT_512 40 | #undef RT_512_R8 41 | #undef RT_256 42 | #undef RT_256_R8 43 | #undef RT_128 44 | 45 | #define RT_2K8_R8 2 46 | 47 | #include "tracer.h" 48 | #include "format.h" 49 | 50 | #undef RT_FEAT_PT 51 | #undef RT_FEAT_BUFFERS 52 | #define RT_FEAT_PT 0 53 | #define RT_FEAT_BUFFERS 0 54 | 55 | #undef STORE_SIMD 56 | #undef PAINT_FRAG 57 | #undef GET_RANDOM_I 58 | 59 | namespace rt_simd_2K8v2_r8 60 | { 61 | #include "tracer.cpp" 62 | } 63 | 64 | #undef RT_FEAT_PT 65 | #undef RT_FEAT_BUFFERS 66 | #define RT_FEAT_PT 1 67 | #define RT_FEAT_BUFFERS 1 68 | 69 | #undef STORE_SIMD 70 | #undef PAINT_FRAG 71 | #undef GET_RANDOM_I 72 | 73 | namespace pt_simd_2K8v2_r8 74 | { 75 | #include "tracer.cpp" 76 | } 77 | 78 | /******************************************************************************/ 79 | /******************************************************************************/ 80 | /******************************************************************************/ 81 | -------------------------------------------------------------------------------- /core/tracer/tracer_2K8v4_r8.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | /* Copyright (c) 2013-2025 VectorChief (at github, bitbucket, sourceforge) */ 3 | /* Distributed under the MIT software license, see the accompanying */ 4 | /* file COPYING or http://www.opensource.org/licenses/mit-license.php */ 5 | /******************************************************************************/ 6 | 7 | #ifndef RT_REGS 8 | #define RT_REGS 16 /* define maximum of available SIMD registers for code */ 9 | #endif /* RT_REGS */ 10 | 11 | #undef RT_SIMD 12 | #define RT_SIMD 2048 /* map vector-length-agnostic SIMD subsets to 2K8-bit */ 13 | #define RT_SIMD_CODE /* enable SIMD instruction definitions */ 14 | 15 | #if (defined RT_2K8_R8) && (RT_2K8_R8 & 4) 16 | #define RT_RENDER_CODE /* enable contents of render0 routine */ 17 | #endif /* RT_2K8_R8 */ 18 | 19 | /* 20 | * Determine SIMD total-quads for backend structs (maximal for a given build). 21 | */ 22 | #if (defined RT_MAXQ) 23 | /* RT_MAXQ is already defined outside */ 24 | #elif (RT_2K8_R8) 25 | #define RT_MAXQ 16 26 | #elif (RT_1K4 || RT_1K4_R8) 27 | #define RT_MAXQ 8 28 | #elif (RT_512 || RT_512_R8) 29 | #define RT_MAXQ 4 30 | #elif (RT_256 || RT_256_R8) 31 | #define RT_MAXQ 2 32 | #elif (RT_128) 33 | #define RT_MAXQ 1 34 | #endif /* RT_MAXQ: 16, 8, 4, 2, 1 */ 35 | 36 | #undef RT_2K8_R8 37 | #undef RT_1K4 38 | #undef RT_1K4_R8 39 | #undef RT_512 40 | #undef RT_512_R8 41 | #undef RT_256 42 | #undef RT_256_R8 43 | #undef RT_128 44 | 45 | #define RT_2K8_R8 4 46 | 47 | #include "tracer.h" 48 | #include "format.h" 49 | 50 | #undef RT_FEAT_PT 51 | #undef RT_FEAT_BUFFERS 52 | #define RT_FEAT_PT 0 53 | #define RT_FEAT_BUFFERS 0 54 | 55 | #undef STORE_SIMD 56 | #undef PAINT_FRAG 57 | #undef GET_RANDOM_I 58 | 59 | namespace rt_simd_2K8v4_r8 60 | { 61 | #include "tracer.cpp" 62 | } 63 | 64 | #undef RT_FEAT_PT 65 | #undef RT_FEAT_BUFFERS 66 | #define RT_FEAT_PT 1 67 | #define RT_FEAT_BUFFERS 1 68 | 69 | #undef STORE_SIMD 70 | #undef PAINT_FRAG 71 | #undef GET_RANDOM_I 72 | 73 | namespace pt_simd_2K8v4_r8 74 | { 75 | #include "tracer.cpp" 76 | } 77 | 78 | /******************************************************************************/ 79 | /******************************************************************************/ 80 | /******************************************************************************/ 81 | -------------------------------------------------------------------------------- /core/tracer/tracer_512v1.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | /* Copyright (c) 2013-2025 VectorChief (at github, bitbucket, sourceforge) */ 3 | /* Distributed under the MIT software license, see the accompanying */ 4 | /* file COPYING or http://www.opensource.org/licenses/mit-license.php */ 5 | /******************************************************************************/ 6 | 7 | #ifndef RT_REGS 8 | #define RT_REGS 16 /* define maximum of available SIMD registers for code */ 9 | #endif /* RT_REGS */ 10 | 11 | #undef RT_SIMD 12 | #define RT_SIMD 512 /* map vector-length-agnostic SIMD subsets to 512-bit */ 13 | #define RT_SIMD_CODE /* enable SIMD instruction definitions */ 14 | 15 | #if (defined RT_512) && (RT_512 & 1) 16 | #define RT_RENDER_CODE /* enable contents of render0 routine */ 17 | #endif /* RT_512 */ 18 | 19 | /* 20 | * Determine SIMD total-quads for backend structs (maximal for a given build). 21 | */ 22 | #if (defined RT_MAXQ) 23 | /* RT_MAXQ is already defined outside */ 24 | #elif (RT_2K8_R8) 25 | #define RT_MAXQ 16 26 | #elif (RT_1K4 || RT_1K4_R8) 27 | #define RT_MAXQ 8 28 | #elif (RT_512 || RT_512_R8) 29 | #define RT_MAXQ 4 30 | #elif (RT_256 || RT_256_R8) 31 | #define RT_MAXQ 2 32 | #elif (RT_128) 33 | #define RT_MAXQ 1 34 | #endif /* RT_MAXQ: 16, 8, 4, 2, 1 */ 35 | 36 | #undef RT_2K8_R8 37 | #undef RT_1K4 38 | #undef RT_1K4_R8 39 | #undef RT_512 40 | #undef RT_512_R8 41 | #undef RT_256 42 | #undef RT_256_R8 43 | #undef RT_128 44 | 45 | #define RT_512 1 46 | 47 | #include "tracer.h" 48 | #include "format.h" 49 | 50 | #undef RT_FEAT_PT 51 | #undef RT_FEAT_BUFFERS 52 | #define RT_FEAT_PT 0 53 | #define RT_FEAT_BUFFERS 0 54 | 55 | #undef STORE_SIMD 56 | #undef PAINT_FRAG 57 | #undef GET_RANDOM_I 58 | 59 | namespace rt_simd_512v1 60 | { 61 | #include "tracer.cpp" 62 | } 63 | 64 | #undef RT_FEAT_PT 65 | #undef RT_FEAT_BUFFERS 66 | #define RT_FEAT_PT 1 67 | #define RT_FEAT_BUFFERS 1 68 | 69 | #undef STORE_SIMD 70 | #undef PAINT_FRAG 71 | #undef GET_RANDOM_I 72 | 73 | namespace pt_simd_512v1 74 | { 75 | #include "tracer.cpp" 76 | } 77 | 78 | /******************************************************************************/ 79 | /******************************************************************************/ 80 | /******************************************************************************/ 81 | -------------------------------------------------------------------------------- /core/tracer/tracer_512v1_r8.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | /* Copyright (c) 2013-2025 VectorChief (at github, bitbucket, sourceforge) */ 3 | /* Distributed under the MIT software license, see the accompanying */ 4 | /* file COPYING or http://www.opensource.org/licenses/mit-license.php */ 5 | /******************************************************************************/ 6 | 7 | #ifndef RT_REGS 8 | #define RT_REGS 8 /* define maximum of available SIMD registers for code */ 9 | #endif /* RT_REGS */ 10 | 11 | #undef RT_SIMD 12 | #define RT_SIMD 512 /* map vector-length-agnostic SIMD subsets to 512-bit */ 13 | #define RT_SIMD_CODE /* enable SIMD instruction definitions */ 14 | 15 | #if (defined RT_512_R8) && (RT_512_R8 & 1) 16 | #define RT_RENDER_CODE /* enable contents of render0 routine */ 17 | #endif /* RT_512_R8 */ 18 | 19 | /* 20 | * Determine SIMD total-quads for backend structs (maximal for a given build). 21 | */ 22 | #if (defined RT_MAXQ) 23 | /* RT_MAXQ is already defined outside */ 24 | #elif (RT_2K8_R8) 25 | #define RT_MAXQ 16 26 | #elif (RT_1K4 || RT_1K4_R8) 27 | #define RT_MAXQ 8 28 | #elif (RT_512 || RT_512_R8) 29 | #define RT_MAXQ 4 30 | #elif (RT_256 || RT_256_R8) 31 | #define RT_MAXQ 2 32 | #elif (RT_128) 33 | #define RT_MAXQ 1 34 | #endif /* RT_MAXQ: 16, 8, 4, 2, 1 */ 35 | 36 | #undef RT_2K8_R8 37 | #undef RT_1K4 38 | #undef RT_1K4_R8 39 | #undef RT_512 40 | #undef RT_512_R8 41 | #undef RT_256 42 | #undef RT_256_R8 43 | #undef RT_128 44 | 45 | #define RT_512_R8 1 46 | 47 | #include "tracer.h" 48 | #include "format.h" 49 | 50 | #undef RT_FEAT_PT 51 | #undef RT_FEAT_BUFFERS 52 | #define RT_FEAT_PT 0 53 | #define RT_FEAT_BUFFERS 0 54 | 55 | #undef STORE_SIMD 56 | #undef PAINT_FRAG 57 | #undef GET_RANDOM_I 58 | 59 | namespace rt_simd_512v1_r8 60 | { 61 | #include "tracer.cpp" 62 | } 63 | 64 | #undef RT_FEAT_PT 65 | #undef RT_FEAT_BUFFERS 66 | #define RT_FEAT_PT 1 67 | #define RT_FEAT_BUFFERS 1 68 | 69 | #undef STORE_SIMD 70 | #undef PAINT_FRAG 71 | #undef GET_RANDOM_I 72 | 73 | namespace pt_simd_512v1_r8 74 | { 75 | #include "tracer.cpp" 76 | } 77 | 78 | /******************************************************************************/ 79 | /******************************************************************************/ 80 | /******************************************************************************/ 81 | -------------------------------------------------------------------------------- /core/tracer/tracer_512v2.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | /* Copyright (c) 2013-2025 VectorChief (at github, bitbucket, sourceforge) */ 3 | /* Distributed under the MIT software license, see the accompanying */ 4 | /* file COPYING or http://www.opensource.org/licenses/mit-license.php */ 5 | /******************************************************************************/ 6 | 7 | #ifndef RT_REGS 8 | #define RT_REGS 16 /* define maximum of available SIMD registers for code */ 9 | #endif /* RT_REGS */ 10 | 11 | #undef RT_SIMD 12 | #define RT_SIMD 512 /* map vector-length-agnostic SIMD subsets to 512-bit */ 13 | #define RT_SIMD_CODE /* enable SIMD instruction definitions */ 14 | 15 | #if (defined RT_512) && (RT_512 & 2) 16 | #define RT_RENDER_CODE /* enable contents of render0 routine */ 17 | #endif /* RT_512 */ 18 | 19 | /* 20 | * Determine SIMD total-quads for backend structs (maximal for a given build). 21 | */ 22 | #if (defined RT_MAXQ) 23 | /* RT_MAXQ is already defined outside */ 24 | #elif (RT_2K8_R8) 25 | #define RT_MAXQ 16 26 | #elif (RT_1K4 || RT_1K4_R8) 27 | #define RT_MAXQ 8 28 | #elif (RT_512 || RT_512_R8) 29 | #define RT_MAXQ 4 30 | #elif (RT_256 || RT_256_R8) 31 | #define RT_MAXQ 2 32 | #elif (RT_128) 33 | #define RT_MAXQ 1 34 | #endif /* RT_MAXQ: 16, 8, 4, 2, 1 */ 35 | 36 | #undef RT_2K8_R8 37 | #undef RT_1K4 38 | #undef RT_1K4_R8 39 | #undef RT_512 40 | #undef RT_512_R8 41 | #undef RT_256 42 | #undef RT_256_R8 43 | #undef RT_128 44 | 45 | #define RT_512 2 46 | 47 | #include "tracer.h" 48 | #include "format.h" 49 | 50 | #undef RT_FEAT_PT 51 | #undef RT_FEAT_BUFFERS 52 | #define RT_FEAT_PT 0 53 | #define RT_FEAT_BUFFERS 0 54 | 55 | #undef STORE_SIMD 56 | #undef PAINT_FRAG 57 | #undef GET_RANDOM_I 58 | 59 | namespace rt_simd_512v2 60 | { 61 | #include "tracer.cpp" 62 | } 63 | 64 | #undef RT_FEAT_PT 65 | #undef RT_FEAT_BUFFERS 66 | #define RT_FEAT_PT 1 67 | #define RT_FEAT_BUFFERS 1 68 | 69 | #undef STORE_SIMD 70 | #undef PAINT_FRAG 71 | #undef GET_RANDOM_I 72 | 73 | namespace pt_simd_512v2 74 | { 75 | #include "tracer.cpp" 76 | } 77 | 78 | /******************************************************************************/ 79 | /******************************************************************************/ 80 | /******************************************************************************/ 81 | -------------------------------------------------------------------------------- /core/tracer/tracer_512v2_r8.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | /* Copyright (c) 2013-2025 VectorChief (at github, bitbucket, sourceforge) */ 3 | /* Distributed under the MIT software license, see the accompanying */ 4 | /* file COPYING or http://www.opensource.org/licenses/mit-license.php */ 5 | /******************************************************************************/ 6 | 7 | #ifndef RT_REGS 8 | #define RT_REGS 8 /* define maximum of available SIMD registers for code */ 9 | #endif /* RT_REGS */ 10 | 11 | #undef RT_SIMD 12 | #define RT_SIMD 512 /* map vector-length-agnostic SIMD subsets to 512-bit */ 13 | #define RT_SIMD_CODE /* enable SIMD instruction definitions */ 14 | 15 | #if (defined RT_512_R8) && (RT_512_R8 & 2) 16 | #define RT_RENDER_CODE /* enable contents of render0 routine */ 17 | #endif /* RT_512_R8 */ 18 | 19 | /* 20 | * Determine SIMD total-quads for backend structs (maximal for a given build). 21 | */ 22 | #if (defined RT_MAXQ) 23 | /* RT_MAXQ is already defined outside */ 24 | #elif (RT_2K8_R8) 25 | #define RT_MAXQ 16 26 | #elif (RT_1K4 || RT_1K4_R8) 27 | #define RT_MAXQ 8 28 | #elif (RT_512 || RT_512_R8) 29 | #define RT_MAXQ 4 30 | #elif (RT_256 || RT_256_R8) 31 | #define RT_MAXQ 2 32 | #elif (RT_128) 33 | #define RT_MAXQ 1 34 | #endif /* RT_MAXQ: 16, 8, 4, 2, 1 */ 35 | 36 | #undef RT_2K8_R8 37 | #undef RT_1K4 38 | #undef RT_1K4_R8 39 | #undef RT_512 40 | #undef RT_512_R8 41 | #undef RT_256 42 | #undef RT_256_R8 43 | #undef RT_128 44 | 45 | #define RT_512_R8 2 46 | 47 | #include "tracer.h" 48 | #include "format.h" 49 | 50 | #undef RT_FEAT_PT 51 | #undef RT_FEAT_BUFFERS 52 | #define RT_FEAT_PT 0 53 | #define RT_FEAT_BUFFERS 0 54 | 55 | #undef STORE_SIMD 56 | #undef PAINT_FRAG 57 | #undef GET_RANDOM_I 58 | 59 | namespace rt_simd_512v2_r8 60 | { 61 | #include "tracer.cpp" 62 | } 63 | 64 | #undef RT_FEAT_PT 65 | #undef RT_FEAT_BUFFERS 66 | #define RT_FEAT_PT 1 67 | #define RT_FEAT_BUFFERS 1 68 | 69 | #undef STORE_SIMD 70 | #undef PAINT_FRAG 71 | #undef GET_RANDOM_I 72 | 73 | namespace pt_simd_512v2_r8 74 | { 75 | #include "tracer.cpp" 76 | } 77 | 78 | /******************************************************************************/ 79 | /******************************************************************************/ 80 | /******************************************************************************/ 81 | -------------------------------------------------------------------------------- /core/tracer/tracer_512v4.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | /* Copyright (c) 2013-2025 VectorChief (at github, bitbucket, sourceforge) */ 3 | /* Distributed under the MIT software license, see the accompanying */ 4 | /* file COPYING or http://www.opensource.org/licenses/mit-license.php */ 5 | /******************************************************************************/ 6 | 7 | #ifndef RT_REGS 8 | #define RT_REGS 32 /* define maximum of available SIMD registers for code */ 9 | #endif /* RT_REGS */ 10 | 11 | #undef RT_SIMD 12 | #define RT_SIMD 512 /* map vector-length-agnostic SIMD subsets to 512-bit */ 13 | #define RT_SIMD_CODE /* enable SIMD instruction definitions */ 14 | 15 | #if (defined RT_512) && (RT_512 & 4) 16 | #define RT_RENDER_CODE /* enable contents of render0 routine */ 17 | #endif /* RT_512 */ 18 | 19 | /* 20 | * Determine SIMD total-quads for backend structs (maximal for a given build). 21 | */ 22 | #if (defined RT_MAXQ) 23 | /* RT_MAXQ is already defined outside */ 24 | #elif (RT_2K8_R8) 25 | #define RT_MAXQ 16 26 | #elif (RT_1K4 || RT_1K4_R8) 27 | #define RT_MAXQ 8 28 | #elif (RT_512 || RT_512_R8) 29 | #define RT_MAXQ 4 30 | #elif (RT_256 || RT_256_R8) 31 | #define RT_MAXQ 2 32 | #elif (RT_128) 33 | #define RT_MAXQ 1 34 | #endif /* RT_MAXQ: 16, 8, 4, 2, 1 */ 35 | 36 | #undef RT_2K8_R8 37 | #undef RT_1K4 38 | #undef RT_1K4_R8 39 | #undef RT_512 40 | #undef RT_512_R8 41 | #undef RT_256 42 | #undef RT_256_R8 43 | #undef RT_128 44 | 45 | #define RT_512 4 46 | 47 | #include "tracer.h" 48 | #include "format.h" 49 | 50 | #undef RT_FEAT_PT 51 | #undef RT_FEAT_BUFFERS 52 | #define RT_FEAT_PT 0 53 | #define RT_FEAT_BUFFERS 0 54 | 55 | #undef STORE_SIMD 56 | #undef PAINT_FRAG 57 | #undef GET_RANDOM_I 58 | 59 | namespace rt_simd_512v4 60 | { 61 | #include "tracer.cpp" 62 | } 63 | 64 | #undef RT_FEAT_PT 65 | #undef RT_FEAT_BUFFERS 66 | #define RT_FEAT_PT 1 67 | #define RT_FEAT_BUFFERS 1 68 | 69 | #undef STORE_SIMD 70 | #undef PAINT_FRAG 71 | #undef GET_RANDOM_I 72 | 73 | namespace pt_simd_512v4 74 | { 75 | #include "tracer.cpp" 76 | } 77 | 78 | /******************************************************************************/ 79 | /******************************************************************************/ 80 | /******************************************************************************/ 81 | -------------------------------------------------------------------------------- /core/tracer/tracer_512v8.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | /* Copyright (c) 2013-2025 VectorChief (at github, bitbucket, sourceforge) */ 3 | /* Distributed under the MIT software license, see the accompanying */ 4 | /* file COPYING or http://www.opensource.org/licenses/mit-license.php */ 5 | /******************************************************************************/ 6 | 7 | #ifndef RT_REGS 8 | #define RT_REGS 32 /* define maximum of available SIMD registers for code */ 9 | #endif /* RT_REGS */ 10 | 11 | #undef RT_SIMD 12 | #define RT_SIMD 512 /* map vector-length-agnostic SIMD subsets to 512-bit */ 13 | #define RT_SIMD_CODE /* enable SIMD instruction definitions */ 14 | 15 | #if (defined RT_512) && (RT_512 & 8) 16 | #define RT_RENDER_CODE /* enable contents of render0 routine */ 17 | #endif /* RT_512 */ 18 | 19 | /* 20 | * Determine SIMD total-quads for backend structs (maximal for a given build). 21 | */ 22 | #if (defined RT_MAXQ) 23 | /* RT_MAXQ is already defined outside */ 24 | #elif (RT_2K8_R8) 25 | #define RT_MAXQ 16 26 | #elif (RT_1K4 || RT_1K4_R8) 27 | #define RT_MAXQ 8 28 | #elif (RT_512 || RT_512_R8) 29 | #define RT_MAXQ 4 30 | #elif (RT_256 || RT_256_R8) 31 | #define RT_MAXQ 2 32 | #elif (RT_128) 33 | #define RT_MAXQ 1 34 | #endif /* RT_MAXQ: 16, 8, 4, 2, 1 */ 35 | 36 | #undef RT_2K8_R8 37 | #undef RT_1K4 38 | #undef RT_1K4_R8 39 | #undef RT_512 40 | #undef RT_512_R8 41 | #undef RT_256 42 | #undef RT_256_R8 43 | #undef RT_128 44 | 45 | #define RT_512 8 46 | 47 | #include "tracer.h" 48 | #include "format.h" 49 | 50 | #undef RT_FEAT_PT 51 | #undef RT_FEAT_BUFFERS 52 | #define RT_FEAT_PT 0 53 | #define RT_FEAT_BUFFERS 0 54 | 55 | #undef STORE_SIMD 56 | #undef PAINT_FRAG 57 | #undef GET_RANDOM_I 58 | 59 | namespace rt_simd_512v8 60 | { 61 | #include "tracer.cpp" 62 | } 63 | 64 | #undef RT_FEAT_PT 65 | #undef RT_FEAT_BUFFERS 66 | #define RT_FEAT_PT 1 67 | #define RT_FEAT_BUFFERS 1 68 | 69 | #undef STORE_SIMD 70 | #undef PAINT_FRAG 71 | #undef GET_RANDOM_I 72 | 73 | namespace pt_simd_512v8 74 | { 75 | #include "tracer.cpp" 76 | } 77 | 78 | /******************************************************************************/ 79 | /******************************************************************************/ 80 | /******************************************************************************/ 81 | -------------------------------------------------------------------------------- /data/scenes/all_scn.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | /* Copyright (c) 2013-2025 VectorChief (at github, bitbucket, sourceforge) */ 3 | /* Distributed under the MIT software license, see the accompanying */ 4 | /* file COPYING or http://www.opensource.org/licenses/mit-license.php */ 5 | /******************************************************************************/ 6 | 7 | #ifndef RT_ALL_SCN_H 8 | #define RT_ALL_SCN_H 9 | 10 | #include "format.h" 11 | 12 | /******************************************************************************/ 13 | /********************************* LEGEND *********************************/ 14 | /******************************************************************************/ 15 | 16 | /* 17 | * all_scn.h: Common file for all scenes. 18 | * 19 | * Recommended naming scheme for scenes: 20 | * 21 | * - All scene namespaces start with scn_ followed by scene's specific name, 22 | * which is usually demo or test followed by the scene number. 23 | * 24 | * - Every scene must have SCENE object defined in format.h called sc_root. 25 | * The root object contains references to the rest of the objects tree 26 | * and is used by the engine to instantiate the scene in run time. 27 | * 28 | * - Every scene must have at least one CAMERA object defined in format.h. 29 | * 30 | * - Scenes are usually placed in separate files scn_*.h, where * is 31 | * scene's name (for example scn_demo01.h), scene names in this 32 | * case follow the same rules as described above (for example scn_demo01) 33 | */ 34 | 35 | /******************************************************************************/ 36 | /*********************************** SCN **********************************/ 37 | /******************************************************************************/ 38 | 39 | #include "scn_demo01.h" 40 | #include "scn_demo02.h" 41 | #include "scn_demo03.h" 42 | 43 | #endif /* RT_ALL_SCN_H */ 44 | 45 | /******************************************************************************/ 46 | /******************************************************************************/ 47 | /******************************************************************************/ 48 | -------------------------------------------------------------------------------- /data/textures/all_tex.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | /* Copyright (c) 2013-2025 VectorChief (at github, bitbucket, sourceforge) */ 3 | /* Distributed under the MIT software license, see the accompanying */ 4 | /* file COPYING or http://www.opensource.org/licenses/mit-license.php */ 5 | /******************************************************************************/ 6 | 7 | #ifndef RT_ALL_TEX_H 8 | #define RT_ALL_TEX_H 9 | 10 | #include "format.h" 11 | 12 | /******************************************************************************/ 13 | /********************************* LEGEND *********************************/ 14 | /******************************************************************************/ 15 | 16 | /* 17 | * all_tex.h: Common file for all textures. 18 | * 19 | * Recommended naming scheme for textures: 20 | * 21 | * - Textures can be loaded from external binary image files or embedded 22 | * as C static array initializers converted from respective images. 23 | * In the latter case static array names start with dt_ prefix 24 | * followed by a three-letter code corresponding to texture's type 25 | * in a form of ***_ followed by texture's name. 26 | * 27 | * - Textures can be of the following types defined in format.h: 28 | * 29 | * tex for PCOLOR, ACOLOR 30 | * trn for PALPHA 31 | * nrm for NORMAL 32 | * dff for DIFFUS 33 | * spc for SPECUL 34 | * rfl for REFLEC 35 | * rfr for REFRAC 36 | * lum for LUMINA 37 | * dtl for DETAIL 38 | * 39 | * - Textures are usually placed in separate files ***_*.h, where *** is 40 | * a three-letter code corresponding to texture's type described above 41 | * and * is texture's name (for example tex_crate01.h), texture names in this 42 | * case follow the same rules as described above (for example dt_tex_crate01). 43 | * 44 | * - Binary image files follow the same naming scheme as .h files above 45 | * with the exception for file extension, which must correspond 46 | * to a particular binary format. 47 | */ 48 | 49 | /******************************************************************************/ 50 | /*********************************** TEX **********************************/ 51 | /******************************************************************************/ 52 | 53 | #if RT_EMBED_TEX == 1 54 | #include "tex_crate01.h" 55 | #endif /* RT_EMBED_TEX */ 56 | 57 | #endif /* RT_ALL_TEX_H */ 58 | 59 | /******************************************************************************/ 60 | /******************************************************************************/ 61 | /******************************************************************************/ 62 | -------------------------------------------------------------------------------- /dump/err.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VectorChief/QuadRay-engine/48d553128e6b0d24654ec352ae4a252b0a9ee06c/dump/err.txt -------------------------------------------------------------------------------- /dump/log.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VectorChief/QuadRay-engine/48d553128e6b0d24654ec352ae4a252b0a9ee06c/dump/log.txt -------------------------------------------------------------------------------- /root/RooT_make_a32.mk: -------------------------------------------------------------------------------- 1 | 2 | INC_PATH = \ 3 | -I../core/config/ \ 4 | -I../core/engine/ \ 5 | -I../core/system/ \ 6 | -I../core/tracer/ \ 7 | -I../data/materials/ \ 8 | -I../data/objects/ \ 9 | -I../data/scenes/ \ 10 | -I../data/textures/ 11 | 12 | SRC_LIST = \ 13 | ../core/engine/engine.cpp \ 14 | ../core/engine/object.cpp \ 15 | ../core/engine/rtgeom.cpp \ 16 | ../core/engine/rtimag.cpp \ 17 | ../core/system/system.cpp \ 18 | ../core/tracer/tracer.cpp \ 19 | ../core/tracer/tracer_128v1.cpp \ 20 | ../core/tracer/tracer_128v4.cpp \ 21 | ../core/tracer/tracer_256v1.cpp \ 22 | RooT_linux.cpp 23 | 24 | LIB_PATH = 25 | 26 | LIB_LIST = \ 27 | -lm \ 28 | -lstdc++ \ 29 | -lX11 \ 30 | -lXext \ 31 | -lpthread 32 | 33 | 34 | build: RooT_a32 35 | 36 | strip: 37 | strip RooT.a32* 38 | 39 | clean: 40 | rm RooT.a32* 41 | 42 | 43 | RooT_a32: 44 | g++ -O3 -g -pthread -mabi=ilp32 \ 45 | -DRT_LINUX -DRT_A32 -DRT_128=1 -DRT_256=1 \ 46 | -DRT_POINTER=32 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=0 \ 47 | -DRT_DEBUG=0 -DRT_PATH="../" -DRT_FULLSCREEN=0 \ 48 | -DRT_EMBED_STDOUT=0 -DRT_EMBED_FILEIO=0 -DRT_EMBED_TEX=1 \ 49 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o RooT.a32 50 | 51 | 52 | clang: RooT.a32 53 | 54 | RooT.a32: 55 | clang++ -O3 -g -pthread -mabi=ilp32 \ 56 | -DRT_LINUX -DRT_A32 -DRT_128=1 -DRT_256=1 \ 57 | -DRT_POINTER=32 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=0 \ 58 | -DRT_DEBUG=0 -DRT_PATH="../" -DRT_FULLSCREEN=0 \ 59 | -DRT_EMBED_STDOUT=0 -DRT_EMBED_FILEIO=0 -DRT_EMBED_TEX=1 \ 60 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o RooT.a32 61 | 62 | 63 | # Prerequisites for the build: 64 | # multilib-compiler for AArch64 is installed and in the PATH variable, 65 | # sudo apt-get update (on AArch64 host or QEMU system mode) 66 | # sudo apt-get install make g++-multilib (plus X11/Xext libs for ILP32 ABI) 67 | # (recent upstream g++-5-aarch64 series may not fully support ILP32 ABI) 68 | # 69 | # Compiling/running RooT demo: 70 | # make -f RooT_make_a32.mk 71 | # ./RooT.a32 (on AArch64 host or QEMU system mode with ILP32 X11/Xext libs) 72 | # (hasn't been verified yet due to lack of available libs) 73 | 74 | # Clang native build should theoretically work too (not tested): 75 | # sudo apt-get update (on Ubuntu add "universe" to "main" /etc/apt/sources.list) 76 | # sudo apt-get install clang g++-multilib (plus X11/Xext libs for ILP32 ABI) 77 | # make -f RooT_make_a32.mk clean 78 | # make -f RooT_make_a32.mk clang 79 | # (hasn't been verified yet due to lack of available libs) 80 | 81 | # RooT demo uses runtime SIMD target selection, multiple can be specified above 82 | # on RISC targets top value above is chosen by default, use -n/-k/-s to override 83 | # 256-bit SIMD is achieved by combining pairs of 128-bit registers/instructions 84 | 85 | # For interpretation of SIMD build flags check compatibility layer in rtzero.h 86 | # or refer to the corresponding simd_make_***.mk file. 87 | 88 | # 32-bit ABI hasn't been fully tested yet due to lack of available libs, 89 | # check out 64/32-bit (ptr/adr) hybrid mode for 64-bit ABI in RooT_make_a64.mk 90 | -------------------------------------------------------------------------------- /root/RooT_make_a64.sh: -------------------------------------------------------------------------------- 1 | make -f RooT_make_a64.mk clang -j4 2 | ./RooT.a64f32 3 | -------------------------------------------------------------------------------- /root/RooT_make_arm.mk: -------------------------------------------------------------------------------- 1 | 2 | INC_PATH = \ 3 | -I../core/config/ \ 4 | -I../core/engine/ \ 5 | -I../core/system/ \ 6 | -I../core/tracer/ \ 7 | -I../data/materials/ \ 8 | -I../data/objects/ \ 9 | -I../data/scenes/ \ 10 | -I../data/textures/ 11 | 12 | SRC_LIST = \ 13 | ../core/engine/engine.cpp \ 14 | ../core/engine/object.cpp \ 15 | ../core/engine/rtgeom.cpp \ 16 | ../core/engine/rtimag.cpp \ 17 | ../core/system/system.cpp \ 18 | ../core/tracer/tracer.cpp \ 19 | ../core/tracer/tracer_128v1.cpp \ 20 | ../core/tracer/tracer_128v2.cpp \ 21 | ../core/tracer/tracer_128v4.cpp \ 22 | RooT_linux.cpp 23 | 24 | LIB_PATH = 25 | 26 | LIB_LIST = \ 27 | -lm \ 28 | -lstdc++ \ 29 | -lX11 \ 30 | -lXext \ 31 | -lpthread 32 | 33 | 34 | build: RooT_arm_v1 35 | 36 | strip: 37 | strip RooT.arm_v* 38 | 39 | clean: 40 | rm RooT.arm_v* 41 | 42 | 43 | RooT_arm_v1: 44 | g++ -O3 -g -pthread -march=armv7-a -marm \ 45 | -DRT_LINUX -DRT_ARM -DRT_128=1 \ 46 | -DRT_POINTER=32 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=0 \ 47 | -DRT_DEBUG=0 -DRT_PATH="../" -DRT_FULLSCREEN=0 \ 48 | -DRT_EMBED_STDOUT=0 -DRT_EMBED_FILEIO=0 -DRT_EMBED_TEX=1 \ 49 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o RooT.arm_v1 50 | 51 | 52 | clang: RooT.arm_v1 53 | 54 | RooT.arm_v1: 55 | clang++ -O3 -g -pthread -march=armv7-a -marm \ 56 | -DRT_LINUX -DRT_ARM -DRT_128=1 \ 57 | -DRT_POINTER=32 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=0 \ 58 | -DRT_DEBUG=0 -DRT_PATH="../" -DRT_FULLSCREEN=0 \ 59 | -DRT_EMBED_STDOUT=0 -DRT_EMBED_FILEIO=0 -DRT_EMBED_TEX=1 \ 60 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o RooT.arm_v1 61 | 62 | 63 | build_n900: RooT_arm_n900 64 | 65 | strip_n900: 66 | strip RooT.arm_n900* 67 | 68 | clean_n900: 69 | rm RooT.arm_n900* 70 | 71 | 72 | RooT_arm_n900: 73 | g++ -O3 -g -pthread -march=armv7-a -marm \ 74 | -DRT_LINUX -DRT_ARM -DRT_128=1 \ 75 | -DRT_POINTER=32 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=0 \ 76 | -DRT_DEBUG=0 -DRT_PATH="../" -DRT_FULLSCREEN=1 \ 77 | -DRT_EMBED_STDOUT=0 -DRT_EMBED_FILEIO=1 -DRT_EMBED_TEX=1 \ 78 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o RooT.arm_n900 79 | 80 | 81 | build_rpiX: RooT_arm_rpi2 RooT_arm_rpi3 82 | 83 | strip_rpiX: 84 | strip RooT.arm_rpi* 85 | 86 | clean_rpiX: 87 | rm RooT.arm_rpi* 88 | 89 | 90 | RooT_arm_rpi2: 91 | g++ -O3 -g -pthread -march=armv7-a -marm \ 92 | -DRT_LINUX -DRT_ARM -DRT_128=1+2 \ 93 | -DRT_POINTER=32 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=0 \ 94 | -DRT_DEBUG=0 -DRT_PATH="../" -DRT_FULLSCREEN=0 \ 95 | -DRT_EMBED_STDOUT=0 -DRT_EMBED_FILEIO=0 -DRT_EMBED_TEX=1 \ 96 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o RooT.arm_rpi2 97 | 98 | RooT_arm_rpi3: 99 | g++ -O3 -g -pthread -march=armv7-a -marm \ 100 | -DRT_LINUX -DRT_ARM -DRT_128=1+2+4 \ 101 | -DRT_POINTER=32 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=0 \ 102 | -DRT_DEBUG=0 -DRT_PATH="../" -DRT_FULLSCREEN=0 \ 103 | -DRT_EMBED_STDOUT=0 -DRT_EMBED_FILEIO=0 -DRT_EMBED_TEX=1 \ 104 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o RooT.arm_rpi3 105 | 106 | 107 | clang_rpiX: RooT.arm_rpi2 RooT.arm_rpi3 108 | 109 | RooT.arm_rpi2: 110 | clang++ -O3 -g -pthread -march=armv7-a -marm \ 111 | -DRT_LINUX -DRT_ARM -DRT_128=1+2 \ 112 | -DRT_POINTER=32 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=0 \ 113 | -DRT_DEBUG=0 -DRT_PATH="../" -DRT_FULLSCREEN=0 \ 114 | -DRT_EMBED_STDOUT=0 -DRT_EMBED_FILEIO=0 -DRT_EMBED_TEX=1 \ 115 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o RooT.arm_rpi2 116 | 117 | RooT.arm_rpi3: 118 | clang++ -O3 -g -pthread -march=armv7-a -marm \ 119 | -DRT_LINUX -DRT_ARM -DRT_128=1+2+4 \ 120 | -DRT_POINTER=32 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=0 \ 121 | -DRT_DEBUG=0 -DRT_PATH="../" -DRT_FULLSCREEN=0 \ 122 | -DRT_EMBED_STDOUT=0 -DRT_EMBED_FILEIO=0 -DRT_EMBED_TEX=1 \ 123 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o RooT.arm_rpi3 124 | 125 | 126 | # Prerequisites for the build: 127 | # native-compiler for ARMv7 is installed and in the PATH variable. 128 | # sudo apt-get update (on ARMv7 host or QEMU system mode) 129 | # sudo apt-get install make g++ libxext-dev 130 | # 131 | # Compiling/running RooT demo: 132 | # make -f RooT_make_arm.mk 133 | # ./RooT.arm_v1 (on ARMv7 host or QEMU system mode) 134 | # (has been tested on Raspberry Pi 2/3 target host system with Raspbian/Ubuntu) 135 | # (SIMD and CORE tests pass in QEMU linux-user mode, check test subfolder) 136 | 137 | # Clang native build works too (takes much longer prior to 3.8): 138 | # sudo apt-get update (on Ubuntu add "universe" to "main" /etc/apt/sources.list) 139 | # sudo apt-get install clang libxext-dev (on ARMv7 host or QEMU system mode) 140 | # make -f RooT_make_arm.mk clean 141 | # make -f RooT_make_arm.mk clang 142 | 143 | # RooT demo uses runtime SIMD target selection, multiple can be specified above 144 | # on RISC targets top value above is chosen by default, use -n/-k/-s to override 145 | 146 | # For interpretation of SIMD build flags check compatibility layer in rtzero.h 147 | # or refer to the corresponding simd_make_***.mk file. 148 | 149 | # 1) Nokia N900, Maemo 5 scratchbox: -DRT_FULLSCREEN=1 -DRT_EMBED_FILEIO=1 150 | # 2) Raspberry Pi 2, Raspbian: clang++ -DRT_128=1+2 151 | # 3) Raspberry Pi 3, Raspbian: clang++ -DRT_128=1+2+4 152 | -------------------------------------------------------------------------------- /root/RooT_make_m32.mk: -------------------------------------------------------------------------------- 1 | 2 | INC_PATH = \ 3 | -I../core/config/ \ 4 | -I../core/engine/ \ 5 | -I../core/system/ \ 6 | -I../core/tracer/ \ 7 | -I../data/materials/ \ 8 | -I../data/objects/ \ 9 | -I../data/scenes/ \ 10 | -I../data/textures/ 11 | 12 | SRC_LIST = \ 13 | ../core/engine/engine.cpp \ 14 | ../core/engine/object.cpp \ 15 | ../core/engine/rtgeom.cpp \ 16 | ../core/engine/rtimag.cpp \ 17 | ../core/system/system.cpp \ 18 | ../core/tracer/tracer.cpp \ 19 | ../core/tracer/tracer_128v1.cpp \ 20 | ../core/tracer/tracer_128v4.cpp \ 21 | ../core/tracer/tracer_256v1.cpp \ 22 | RooT_linux.cpp 23 | 24 | LIB_PATH = 25 | 26 | LIB_LIST = \ 27 | -lm \ 28 | -lstdc++ \ 29 | -lX11 \ 30 | -lXext \ 31 | -lpthread 32 | 33 | 34 | build: RooT_m32Lr5 35 | 36 | strip: 37 | strip RooT.m32* 38 | 39 | clean: 40 | rm RooT.m32* 41 | 42 | 43 | RooT_m32Lr5: 44 | g++ -O3 -g -pthread -mips32r5 -mmsa -mnan=2008 \ 45 | -DRT_LINUX -DRT_M32 -DRT_128=1 -DRT_256=1 \ 46 | -DRT_POINTER=32 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=0 \ 47 | -DRT_DEBUG=0 -DRT_PATH="../" -DRT_FULLSCREEN=0 \ 48 | -DRT_EMBED_STDOUT=0 -DRT_EMBED_FILEIO=0 -DRT_EMBED_TEX=1 \ 49 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o RooT.m32Lr5 50 | 51 | 52 | clang: RooT.m32Lr5 53 | 54 | RooT.m32Lr5: 55 | clang++ -O0 -g -pthread -mips32r5 -mmsa -mnan=2008 \ 56 | -DRT_LINUX -DRT_M32 -DRT_128=1 -DRT_256=1 \ 57 | -DRT_POINTER=32 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=0 \ 58 | -DRT_DEBUG=0 -DRT_PATH="../" -DRT_FULLSCREEN=0 \ 59 | -DRT_EMBED_STDOUT=0 -DRT_EMBED_FILEIO=0 -DRT_EMBED_TEX=1 \ 60 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o RooT.m32Lr5 61 | 62 | 63 | # Prerequisites for the build: 64 | # native-compiler for MIPSr5+MSA is installed and in the PATH variable. 65 | # sudo apt-get update (on MIPS32 host or QEMU system mode) 66 | # sudo apt-get install make g++ libxext-dev 67 | # (recent upstream g++-5-mipsel series may not fully support MSA) 68 | # 69 | # Compiling/running RooT demo: 70 | # make -f RooT_make_m32.mk 71 | # ./RooT.m32Lr5 (on MIPS32 host or QEMU system mode) 72 | # (hasn't been verified yet due to lack of target host system) 73 | # (SIMD and CORE tests pass in QEMU linux-user mode, check test subfolder) 74 | 75 | # Clang native build should theoretically work too (not tested): 76 | # sudo apt-get update (on Ubuntu add "universe" to "main" /etc/apt/sources.list) 77 | # sudo apt-get install clang libxext-dev (on MIPS32 host or QEMU system mode) 78 | # make -f RooT_make_m32.mk clean 79 | # make -f RooT_make_m32.mk clang 80 | 81 | # RooT demo uses runtime SIMD target selection, multiple can be specified above 82 | # on RISC targets top value above is chosen by default, use -n/-k/-s to override 83 | # 256-bit SIMD is achieved by combining pairs of 128-bit registers/instructions 84 | 85 | # For interpretation of SIMD build flags check compatibility layer in rtzero.h 86 | # or refer to the corresponding simd_make_***.mk file. 87 | -------------------------------------------------------------------------------- /root/RooT_make_m64.sh: -------------------------------------------------------------------------------- 1 | make -f RooT_make_m64.mk clang -j4 2 | ./RooT.m64f32Lr6 3 | -------------------------------------------------------------------------------- /root/RooT_make_p32.mk: -------------------------------------------------------------------------------- 1 | 2 | INC_PATH = \ 3 | -I../core/config/ \ 4 | -I../core/engine/ \ 5 | -I../core/system/ \ 6 | -I../core/tracer/ \ 7 | -I../data/materials/ \ 8 | -I../data/objects/ \ 9 | -I../data/scenes/ \ 10 | -I../data/textures/ 11 | 12 | SRC_LIST = \ 13 | ../core/engine/engine.cpp \ 14 | ../core/engine/object.cpp \ 15 | ../core/engine/rtgeom.cpp \ 16 | ../core/engine/rtimag.cpp \ 17 | ../core/system/system.cpp \ 18 | ../core/tracer/tracer.cpp \ 19 | ../core/tracer/tracer_128v4.cpp \ 20 | ../core/tracer/tracer_256v4_r8.cpp \ 21 | RooT_linux.cpp 22 | 23 | LIB_PATH = 24 | 25 | LIB_LIST = \ 26 | -lm \ 27 | -lstdc++ \ 28 | -lX11 \ 29 | -lXext \ 30 | -lpthread 31 | 32 | 33 | build: RooT_p32Bg4 34 | 35 | strip: 36 | strip RooT.p32* 37 | 38 | clean: 39 | rm RooT.p32* 40 | 41 | 42 | RooT_p32Bg4: 43 | g++ -O3 -g -pthread \ 44 | -DRT_LINUX -DRT_P32 -DRT_128=4 -DRT_256_R8=4 -DRT_SIMD_COMPAT_VSX=0 \ 45 | -DRT_POINTER=32 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=1 \ 46 | -DRT_DEBUG=0 -DRT_PATH="../" -DRT_FULLSCREEN=0 \ 47 | -DRT_EMBED_STDOUT=0 -DRT_EMBED_FILEIO=0 -DRT_EMBED_TEX=1 \ 48 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o RooT.p32Bg4 49 | 50 | 51 | clang: RooT.p32Bg4 52 | 53 | RooT.p32Bg4: 54 | clang++ -O0 -g -pthread \ 55 | -DRT_LINUX -DRT_P32 -DRT_128=4 -DRT_256_R8=4 -DRT_SIMD_COMPAT_VSX=0 \ 56 | -DRT_POINTER=32 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=1 \ 57 | -DRT_DEBUG=0 -DRT_PATH="../" -DRT_FULLSCREEN=0 \ 58 | -DRT_EMBED_STDOUT=0 -DRT_EMBED_FILEIO=0 -DRT_EMBED_TEX=1 \ 59 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o RooT.p32Bg4 60 | 61 | 62 | # Prerequisites for the build: 63 | # native-compiler for PowerPC is installed and in the PATH variable. 64 | # sudo apt-get update (on PowerPC host or QEMU system mode) 65 | # sudo apt-get install make g++ libxext-dev 66 | # (legacy 32-bit PowerPC target may no longer be supported on latest distros) 67 | # 68 | # Compiling/running RooT demo: 69 | # make -f RooT_make_p32.mk 70 | # ./RooT.p32Bg4 (on PowerPC host or QEMU system mode) 71 | # (hasn't been verified yet due to lack of target host system) 72 | # (SIMD and CORE tests pass in QEMU linux-user mode, check test subfolder) 73 | 74 | # Clang native build should theoretically work too (not tested): 75 | # sudo apt-get update (on Ubuntu add "universe" to "main" /etc/apt/sources.list) 76 | # sudo apt-get install clang libxext-dev (on PowerPC host or QEMU system mode) 77 | # make -f RooT_make_p32.mk clean 78 | # make -f RooT_make_p32.mk clang 79 | 80 | # RooT demo uses runtime SIMD target selection, multiple can be specified above 81 | # on RISC targets top value above is chosen by default, use -n/-k/-s to override 82 | # 256-bit SIMD is achieved by combining pairs of 128-bit registers/instructions 83 | 84 | # For interpretation of SIMD build flags check compatibility layer in rtzero.h 85 | # or refer to the corresponding simd_make_***.mk file. 86 | -------------------------------------------------------------------------------- /root/RooT_make_p64.sh: -------------------------------------------------------------------------------- 1 | make -f RooT_make_p64.mk clang -j4 2 | ./RooT.p64f32Lp8 3 | -------------------------------------------------------------------------------- /root/RooT_make_w64.bat: -------------------------------------------------------------------------------- 1 | mingw32-make -f RooT_make_w64.mk -j4 2 | RooT_w64f32.exe 3 | -------------------------------------------------------------------------------- /root/RooT_make_w64.mk: -------------------------------------------------------------------------------- 1 | 2 | INC_PATH = \ 3 | -I../core/config/ \ 4 | -I../core/engine/ \ 5 | -I../core/system/ \ 6 | -I../core/tracer/ \ 7 | -I../data/materials/ \ 8 | -I../data/objects/ \ 9 | -I../data/scenes/ \ 10 | -I../data/textures/ 11 | 12 | SRC_LIST = \ 13 | ../core/engine/engine.cpp \ 14 | ../core/engine/object.cpp \ 15 | ../core/engine/rtgeom.cpp \ 16 | ../core/engine/rtimag.cpp \ 17 | ../core/system/system.cpp \ 18 | ../core/tracer/tracer.cpp \ 19 | ../core/tracer/tracer_128v2.cpp \ 20 | ../core/tracer/tracer_128v4.cpp \ 21 | ../core/tracer/tracer_128v8.cpp \ 22 | ../core/tracer/tracer_256v4_r8.cpp \ 23 | ../core/tracer/tracer_256v1.cpp \ 24 | ../core/tracer/tracer_256v2.cpp \ 25 | ../core/tracer/tracer_256v8.cpp \ 26 | ../core/tracer/tracer_512v1_r8.cpp \ 27 | ../core/tracer/tracer_512v2_r8.cpp \ 28 | ../core/tracer/tracer_512v1.cpp \ 29 | ../core/tracer/tracer_512v2.cpp \ 30 | ../core/tracer/tracer_512v4.cpp \ 31 | ../core/tracer/tracer_512v8.cpp \ 32 | ../core/tracer/tracer_1K4v1.cpp \ 33 | ../core/tracer/tracer_1K4v2.cpp \ 34 | ../core/tracer/tracer_2K8v1_r8.cpp \ 35 | ../core/tracer/tracer_2K8v2_r8.cpp \ 36 | RooT_winxx.cpp 37 | 38 | LIB_PATH = 39 | 40 | LIB_LIST = \ 41 | -lm \ 42 | -lstdc++ \ 43 | -lgdi32 44 | 45 | 46 | build: RooT_w64_32 RooT_w64_64 RooT_w64f32 RooT_w64f64 47 | 48 | strip: 49 | strip RooT_w64*.exe 50 | 51 | clean: 52 | del RooT_w64*.exe 53 | 54 | 55 | RooT_w64_32: 56 | g++ -O3 -g -D_WIN32_WINNT=0x0601 -static -m64 \ 57 | -DRT_WIN64 -DRT_X64 -DRT_128=2+4+8 -DRT_256_R8=4 -DRT_256=1+2+8 \ 58 | -DRT_512_R8=1+2 -DRT_512=1+2 -DRT_1K4=1+2 -DRT_SIMD_COMPAT_SSE=2 \ 59 | -DRT_POINTER=64 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=0 \ 60 | -DRT_DEBUG=0 -DRT_PATH="../" -DRT_FULLSCREEN=0 \ 61 | -DRT_EMBED_STDOUT=0 -DRT_EMBED_FILEIO=0 -DRT_EMBED_TEX=1 \ 62 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o RooT_w64_32.exe 63 | 64 | RooT_w64_64: 65 | g++ -O3 -g -D_WIN32_WINNT=0x0601 -static -m64 \ 66 | -DRT_WIN64 -DRT_X64 -DRT_128=2+4+8 -DRT_256_R8=4 -DRT_256=1+2+8 \ 67 | -DRT_512_R8=1+2 -DRT_512=1+2 -DRT_1K4=1+2 -DRT_SIMD_COMPAT_SSE=2 \ 68 | -DRT_POINTER=64 -DRT_ADDRESS=32 -DRT_ELEMENT=64 -DRT_ENDIAN=0 \ 69 | -DRT_DEBUG=0 -DRT_PATH="../" -DRT_FULLSCREEN=0 \ 70 | -DRT_EMBED_STDOUT=0 -DRT_EMBED_FILEIO=0 -DRT_EMBED_TEX=1 \ 71 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o RooT_w64_64.exe 72 | 73 | RooT_w64f32: 74 | g++ -O3 -g -D_WIN32_WINNT=0x0601 -static -m64 \ 75 | -DRT_WIN64 -DRT_X64 -DRT_128=2+4+8 -DRT_256_R8=4 -DRT_256=1+2+8 \ 76 | -DRT_512_R8=1+2 -DRT_512=1+2 -DRT_1K4=1+2 -DRT_SIMD_COMPAT_SSE=2 \ 77 | -DRT_POINTER=64 -DRT_ADDRESS=64 -DRT_ELEMENT=32 -DRT_ENDIAN=0 \ 78 | -DRT_DEBUG=0 -DRT_PATH="../" -DRT_FULLSCREEN=0 \ 79 | -DRT_EMBED_STDOUT=0 -DRT_EMBED_FILEIO=0 -DRT_EMBED_TEX=1 \ 80 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o RooT_w64f32.exe 81 | 82 | RooT_w64f64: 83 | g++ -O3 -g -D_WIN32_WINNT=0x0601 -static -m64 \ 84 | -DRT_WIN64 -DRT_X64 -DRT_128=2+4+8 -DRT_256_R8=4 -DRT_256=1+2+8 \ 85 | -DRT_512_R8=1+2 -DRT_512=1+2 -DRT_1K4=1+2 -DRT_SIMD_COMPAT_SSE=2 \ 86 | -DRT_POINTER=64 -DRT_ADDRESS=64 -DRT_ELEMENT=64 -DRT_ENDIAN=0 \ 87 | -DRT_DEBUG=0 -DRT_PATH="../" -DRT_FULLSCREEN=0 \ 88 | -DRT_EMBED_STDOUT=0 -DRT_EMBED_FILEIO=0 -DRT_EMBED_TEX=1 \ 89 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o RooT_w64f64.exe 90 | 91 | 92 | # Prerequisites for the build: 93 | # TDM64-GCC compiler for Win32/64 is installed and in the PATH variable. 94 | # Download tdm64-gcc-5.1.0-2.exe from sourceforge and run the installer. 95 | # Alternatively download and install tdm64-gcc-10.3.0-2.exe from github. 96 | # The multi-group threading implementation requires Windows 7 or newer. 97 | # Remove -D_WIN32_WINNT=0x0601 for compatibility with Windows XP/Vista. 98 | # 99 | # Compiling/running RooT demo: 100 | # run RooT_make_w64.bat from Windows Explorer or 101 | # run the following from Command Prompt "cmd": 102 | # mingw32-make -f RooT_make_w64.mk 103 | # RooT_w64f32.exe 104 | 105 | # Clang native build should theoretically work too (not tested), use (replace): 106 | # clang++ (in place of g++) may require Visual Studio 107 | # once clang for Windows is installed and in the PATH variable. 108 | 109 | # RooT demo uses runtime SIMD target selection, multiple can be specified above 110 | # on x86 targets top cpuid-value is chosen by default, use -n/-k/-s to override 111 | # 1K4-bit SIMD is achieved by combining pairs of 512-bit registers/instructions 112 | # 2K8-bit SIMD is achieved by combining quads of 512-bit registers/instructions 113 | # For 30-regs 512-bit AVX512F/DQ targets on Skylake-X use (replace): RT_512=4+8 114 | 115 | # For interpretation of SIMD build flags check compatibility layer in rtzero.h 116 | # or refer to the corresponding simd_make_***.mk file. 117 | 118 | # 64/32-bit (ptr/adr) hybrid mode is compatible with native 64-bit ABI, 119 | # use (replace): RT_ADDRESS=32, rename the binary to RooT_w64_**.exe 120 | # 64-bit packed SIMD mode (fp64/int64) is supported on 64-bit targets, 121 | # use (replace): RT_ELEMENT=64, rename the binary to RooT_w64*64.exe 122 | -------------------------------------------------------------------------------- /root/RooT_make_x32.mk: -------------------------------------------------------------------------------- 1 | 2 | INC_PATH = \ 3 | -I../core/config/ \ 4 | -I../core/engine/ \ 5 | -I../core/system/ \ 6 | -I../core/tracer/ \ 7 | -I../data/materials/ \ 8 | -I../data/objects/ \ 9 | -I../data/scenes/ \ 10 | -I../data/textures/ 11 | 12 | SRC_LIST = \ 13 | ../core/engine/engine.cpp \ 14 | ../core/engine/object.cpp \ 15 | ../core/engine/rtgeom.cpp \ 16 | ../core/engine/rtimag.cpp \ 17 | ../core/system/system.cpp \ 18 | ../core/tracer/tracer.cpp \ 19 | ../core/tracer/tracer_128v2.cpp \ 20 | ../core/tracer/tracer_128v4.cpp \ 21 | ../core/tracer/tracer_128v8.cpp \ 22 | ../core/tracer/tracer_256v4_r8.cpp \ 23 | ../core/tracer/tracer_256v1.cpp \ 24 | ../core/tracer/tracer_256v2.cpp \ 25 | ../core/tracer/tracer_256v8.cpp \ 26 | ../core/tracer/tracer_512v1_r8.cpp \ 27 | ../core/tracer/tracer_512v2_r8.cpp \ 28 | ../core/tracer/tracer_512v1.cpp \ 29 | ../core/tracer/tracer_512v2.cpp \ 30 | ../core/tracer/tracer_512v4.cpp \ 31 | ../core/tracer/tracer_512v8.cpp \ 32 | ../core/tracer/tracer_1K4v1.cpp \ 33 | ../core/tracer/tracer_1K4v2.cpp \ 34 | ../core/tracer/tracer_2K8v1_r8.cpp \ 35 | ../core/tracer/tracer_2K8v2_r8.cpp \ 36 | RooT_linux.cpp 37 | 38 | LIB_PATH = 39 | 40 | LIB_LIST = \ 41 | -lm \ 42 | -lstdc++ \ 43 | -lX11 \ 44 | -lXext \ 45 | -lpthread 46 | 47 | 48 | build: RooT_x32 49 | 50 | strip: 51 | strip RooT.x32* 52 | 53 | clean: 54 | rm RooT.x32* 55 | 56 | 57 | RooT_x32: 58 | g++ -O3 -g -pthread -mx32 \ 59 | -DRT_LINUX -DRT_X32 -DRT_128=2+4+8 -DRT_256_R8=4 -DRT_256=1+2+8 \ 60 | -DRT_512_R8=1+2 -DRT_512=1+2 -DRT_1K4=1+2 -DRT_SIMD_COMPAT_SSE=2 \ 61 | -DRT_POINTER=32 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=0 \ 62 | -DRT_DEBUG=0 -DRT_PATH="../" -DRT_FULLSCREEN=0 \ 63 | -DRT_EMBED_STDOUT=0 -DRT_EMBED_FILEIO=0 -DRT_EMBED_TEX=1 \ 64 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o RooT.x32 65 | 66 | 67 | clang: RooT.x32 68 | 69 | RooT.x32: 70 | clang++ -O3 -g -pthread -mx32 \ 71 | -DRT_LINUX -DRT_X32 -DRT_128=2+4+8 -DRT_256_R8=4 -DRT_256=1+2+8 \ 72 | -DRT_512_R8=1+2 -DRT_512=1+2 -DRT_1K4=1+2 -DRT_SIMD_COMPAT_SSE=2 \ 73 | -DRT_POINTER=32 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=0 \ 74 | -DRT_DEBUG=0 -DRT_PATH="../" -DRT_FULLSCREEN=0 \ 75 | -DRT_EMBED_STDOUT=0 -DRT_EMBED_FILEIO=0 -DRT_EMBED_TEX=1 \ 76 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o RooT.x32 77 | 78 | 79 | # Prerequisites for the build: 80 | # multilib-compiler for x86_64 is installed and in the PATH variable. 81 | # sudo apt-get update 82 | # sudo apt-get install make g++-multilib (plus X11/Xext libs for x32 ABI) 83 | # (installation of g++-multilib removes any g++ cross-compilers) 84 | # 85 | # Compiling/running RooT demo: 86 | # make -f RooT_make_x32.mk 87 | # ./RooT.x32 88 | # (hasn't been verified yet due to lack of available libs, SIMD/CORE tests pass) 89 | 90 | # Clang native build should theoretically work too (not tested): 91 | # sudo apt-get update (on Ubuntu add "universe" to "main" /etc/apt/sources.list) 92 | # sudo apt-get install clang g++-multilib (plus X11/Xext libs for x32 ABI) 93 | # (installation of g++-multilib removes any g++ cross-compilers) 94 | # make -f RooT_make_x32.mk clean 95 | # make -f RooT_make_x32.mk clang 96 | # (hasn't been verified yet due to lack of available libs, SIMD/CORE tests pass) 97 | 98 | # RooT demo uses runtime SIMD target selection, multiple can be specified above 99 | # on x86 targets top cpuid-value is chosen by default, use -n/-k/-s to override 100 | # 1K4-bit SIMD is achieved by combining pairs of 512-bit registers/instructions 101 | # 2K8-bit SIMD is achieved by combining quads of 512-bit registers/instructions 102 | # For 30-regs 512-bit AVX512F/DQ targets on Skylake-X use (replace): RT_512=4+8 103 | 104 | # For interpretation of SIMD build flags check compatibility layer in rtzero.h 105 | # or refer to the corresponding simd_make_***.mk file. 106 | 107 | # 32-bit ABI hasn't been fully tested yet due to lack of available libs, 108 | # check out 64/32-bit (ptr/adr) hybrid mode for 64-bit ABI in RooT_make_x64.mk 109 | -------------------------------------------------------------------------------- /root/RooT_make_x64.sh: -------------------------------------------------------------------------------- 1 | make -f RooT_make_x64.mk clang -j4 2 | ./RooT.x64f32 3 | -------------------------------------------------------------------------------- /root/RooT_make_x86.mk: -------------------------------------------------------------------------------- 1 | 2 | INC_PATH = \ 3 | -I../core/config/ \ 4 | -I../core/engine/ \ 5 | -I../core/system/ \ 6 | -I../core/tracer/ \ 7 | -I../data/materials/ \ 8 | -I../data/objects/ \ 9 | -I../data/scenes/ \ 10 | -I../data/textures/ \ 11 | -I/usr/X11/include/ 12 | 13 | SRC_LIST = \ 14 | ../core/engine/engine.cpp \ 15 | ../core/engine/object.cpp \ 16 | ../core/engine/rtgeom.cpp \ 17 | ../core/engine/rtimag.cpp \ 18 | ../core/system/system.cpp \ 19 | ../core/tracer/tracer.cpp \ 20 | ../core/tracer/tracer_128v1.cpp \ 21 | ../core/tracer/tracer_128v2.cpp \ 22 | ../core/tracer/tracer_128v4.cpp \ 23 | ../core/tracer/tracer_128v8.cpp \ 24 | ../core/tracer/tracer_256v1.cpp \ 25 | ../core/tracer/tracer_256v2.cpp \ 26 | ../core/tracer/tracer_512v1.cpp \ 27 | ../core/tracer/tracer_512v2.cpp \ 28 | RooT_linux.cpp 29 | 30 | LIB_PATH = \ 31 | -L/usr/X11/lib/ 32 | 33 | LIB_LIST = \ 34 | -lm \ 35 | -lstdc++ \ 36 | -lX11 \ 37 | -lXext \ 38 | -lpthread 39 | 40 | 41 | build: RooT_x86 42 | 43 | strip: 44 | strip RooT.x86* 45 | 46 | clean: 47 | rm RooT.x86* 48 | 49 | macOS: 50 | mv RooT.x86 RooT.o86 51 | 52 | macRD: 53 | rm -fr RooT.x86*.dSYM/ 54 | 55 | macRM: 56 | rm RooT.o86* 57 | 58 | 59 | RooT_x86: 60 | g++ -O3 -g -pthread -m32 \ 61 | -DRT_LINUX -DRT_X86 -DRT_128=1+2+4+8 -DRT_256=1+2 -DRT_512=1+2 \ 62 | -DRT_POINTER=32 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=0 \ 63 | -DRT_DEBUG=0 -DRT_PATH="../" -DRT_FULLSCREEN=0 \ 64 | -DRT_EMBED_STDOUT=0 -DRT_EMBED_FILEIO=0 -DRT_EMBED_TEX=1 \ 65 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o RooT.x86 66 | 67 | 68 | clang: RooT.x86 69 | 70 | RooT.x86: 71 | clang++ -O3 -g -pthread -m32 \ 72 | -DRT_LINUX -DRT_X86 -DRT_128=1+2+4+8 -DRT_256=1+2 -DRT_512=1+2 \ 73 | -DRT_POINTER=32 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=0 \ 74 | -DRT_DEBUG=0 -DRT_PATH="../" -DRT_FULLSCREEN=0 \ 75 | -DRT_EMBED_STDOUT=0 -DRT_EMBED_FILEIO=0 -DRT_EMBED_TEX=1 \ 76 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o RooT.x86 77 | 78 | 79 | # Prerequisites for the build: 80 | # native/multilib-compiler for x86/x86_64 is installed and in the PATH variable. 81 | # sudo apt-get update 82 | # sudo apt-get install make g++ libxext-dev (x86 host) or if libs are present: 83 | # sudo apt-get install make g++-multilib libxext-dev:i386 (x86_64 host, Mint 18) 84 | # (installation of g++-multilib removes any g++ cross-compilers) 85 | # 86 | # When building on macOS install Command Line Tools and XQuartz first. 87 | # http://osxdaily.com/2014/02/12/install-command-line-tools-mac-os-x/ 88 | # https://www.youtube.com/watch?v=uS4zTqfwSSQ https://www.xquartz.org/ 89 | # As pthread affinity features are not supported on a Mac, use "-t n" option 90 | # when running produced binary (below), where "n" is the number of CPU cores. 91 | # Otherwise default maximum number of threads (120) will be created. 92 | # 93 | # Compiling/running RooT demo: 94 | # make -f RooT_make_x86.mk 95 | # ./RooT.x86 96 | 97 | # Clang native build works too (takes much longer prior to 3.8): 98 | # sudo apt-get update (on Ubuntu add "universe" to "main" /etc/apt/sources.list) 99 | # sudo apt-get install clang libxext-dev (on x86 host) or if libs are present: 100 | # sudo apt-get install clang g++-multilib libxext-dev:i386 (on x86_64, Mint 18) 101 | # (installation of g++-multilib removes any g++ cross-compilers) 102 | # make -f RooT_make_x86.mk clean 103 | # make -f RooT_make_x86.mk clang 104 | 105 | # RooT demo uses runtime SIMD target selection, multiple can be specified above 106 | # on x86 targets top cpuid-value is chosen by default, use -n/-k/-s to override 107 | 108 | # For interpretation of SIMD build flags check compatibility layer in rtzero.h 109 | # or refer to the corresponding simd_make_***.mk file. 110 | -------------------------------------------------------------------------------- /root/RooT_x64.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.1.32328.378 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RooT_x64", "RooT_x64.vcxproj", "{B6712C43-F85A-4093-A9A0-57E5FDDB8EF6}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Release|x64 = Release|x64 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {B6712C43-F85A-4093-A9A0-57E5FDDB8EF6}.Debug|x64.ActiveCfg = Debug|x64 15 | {B6712C43-F85A-4093-A9A0-57E5FDDB8EF6}.Debug|x64.Build.0 = Debug|x64 16 | {B6712C43-F85A-4093-A9A0-57E5FDDB8EF6}.Release|x64.ActiveCfg = Release|x64 17 | {B6712C43-F85A-4093-A9A0-57E5FDDB8EF6}.Release|x64.Build.0 = Release|x64 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {37AB6927-7739-4E03-96CD-0D9B20CE9813} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /root/RooT_x64.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /test/build_cross.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Intended for x86_64 Linux build environment 3 | # with many g++ cross-compilers installed (64-bit Ubuntu MATE 20.04 LTS tested) 4 | # refer to individual makefiles for installation instructions 5 | 6 | make -f simd_make_arm.mk build -j2 7 | make -f simd_make_m32.mk build -j2 8 | make -f simd_make_p32.mk build -j4 9 | make -f simd_make_a64.mk build -j8 10 | make -f simd_make_m64.mk build -j8 11 | make -f simd_make_p64.mk build -j8 12 | 13 | make -f simd_make_arm.mk strip 14 | make -f simd_make_m32.mk strip 15 | make -f simd_make_p32.mk strip 16 | make -f simd_make_a64.mk strip 17 | make -f simd_make_m64.mk strip 18 | make -f simd_make_p64.mk strip 19 | 20 | 21 | make -f core_make_arm.mk build -j2 22 | make -f core_make_m32.mk build -j2 23 | make -f core_make_p32.mk build -j4 24 | make -f core_make_a64.mk build -j8 25 | make -f core_make_m64.mk build -j8 26 | make -f core_make_p64.mk build -j8 27 | 28 | make -f core_make_arm.mk strip 29 | make -f core_make_m32.mk strip 30 | make -f core_make_p32.mk strip 31 | make -f core_make_a64.mk strip 32 | make -f core_make_m64.mk strip 33 | make -f core_make_p64.mk strip 34 | -------------------------------------------------------------------------------- /test/build_linux.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Intended for x86_64 Linux build environment 3 | # with native g++ compiler installed (64-bit Linux Mint 18 tested) 4 | # works on Ubuntu MATE 18.04/20.04 LTS (binaries aren't backward compatible) 5 | 6 | make -f simd_make_x64.mk build -j8 7 | 8 | make -f simd_make_x64.mk strip 9 | 10 | 11 | make -f core_make_x64.mk build -j4 12 | 13 | make -f core_make_x64.mk strip 14 | 15 | 16 | # RooT demo compilation requires Xext development library in addition to g++ 17 | 18 | cd ../root 19 | 20 | make -f RooT_make_x64.mk build -j4 21 | 22 | make -f RooT_make_x64.mk strip 23 | 24 | cd ../test 25 | -------------------------------------------------------------------------------- /test/build_macM1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Intended for AArch64 macOS build environment with Apple Silicon (M1 chip) 3 | # with Command Line Tools installed (macOS BigSur/Monterey tested) 4 | # build on the least recent OS as binaries aren't always backward compatible 5 | 6 | make -f simd_make_a64.mk clang -j8 7 | 8 | make -f simd_make_a64.mk macRD 9 | 10 | make -f simd_make_a64.mk macST 11 | 12 | make -f simd_make_a64.mk macOS 13 | 14 | 15 | make -f core_make_a64.mk clang -j8 16 | 17 | make -f core_make_a64.mk macRD 18 | 19 | make -f core_make_a64.mk macST 20 | 21 | make -f core_make_a64.mk macOS 22 | 23 | 24 | # RooT demo compilation also requires XQuartz starting from version 2.8.0 25 | 26 | cd ../root 27 | 28 | make -f RooT_make_a64.mk clang -j8 29 | 30 | make -f RooT_make_a64.mk macRD 31 | 32 | make -f RooT_make_a64.mk strip 33 | 34 | make -f RooT_make_a64.mk macOS 35 | 36 | cd ../test 37 | -------------------------------------------------------------------------------- /test/build_macOS.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Intended for x86_64 Mac OS X / OS X / macOS build environment 3 | # with Command Line Tools installed (Mac OS X Lion / macOS High Sierra tested) 4 | # build on the least recent OS as binaries aren't always backward compatible 5 | 6 | make -f simd_make_x64.mk build -j8 7 | 8 | make -f simd_make_x64.mk macRD 9 | 10 | make -f simd_make_x64.mk strip 11 | 12 | make -f simd_make_x64.mk macOS 13 | 14 | 15 | make -f core_make_x64.mk build -j4 16 | 17 | make -f core_make_x64.mk macRD 18 | 19 | make -f core_make_x64.mk strip 20 | 21 | make -f core_make_x64.mk macOS 22 | 23 | 24 | # RooT demo compilation also requires XQuartz starting from OS X Mountain Lion 25 | 26 | cd ../root 27 | 28 | make -f RooT_make_x64.mk build -j4 29 | 30 | make -f RooT_make_x64.mk macRD 31 | 32 | make -f RooT_make_x64.mk strip 33 | 34 | make -f RooT_make_x64.mk macOS 35 | 36 | cd ../test 37 | -------------------------------------------------------------------------------- /test/build_multi.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Intended for x86_64 Linux build environment 3 | # with native g++ multilib-compiler installed (64-bit Linux Mint 18 tested) 4 | # refer to individual makefiles for installation instructions 5 | 6 | make -f simd_make_x86.mk build -j4 7 | make -f simd_make_x32.mk build 8 | 9 | make -f simd_make_x86.mk strip 10 | make -f simd_make_x32.mk strip 11 | 12 | 13 | make -f core_make_x86.mk build 14 | make -f core_make_x32.mk build 15 | 16 | make -f core_make_x86.mk strip 17 | make -f core_make_x32.mk strip 18 | 19 | 20 | # RooT demo compilation requires Xext development library in addition to g++ 21 | 22 | cd ../root 23 | 24 | make -f RooT_make_x86.mk build 25 | 26 | make -f RooT_make_x86.mk strip 27 | 28 | cd ../test 29 | -------------------------------------------------------------------------------- /test/build_nokia.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Intended for scratchbox Linux build environment (32-bit Ubuntu 10.10 tested) 3 | # http://wiki.maemo.org/Documentation/Maemo_5_Final_SDK_Installation 4 | 5 | make -f simd_make_arm.mk build_n900 6 | 7 | make -f simd_make_arm.mk strip_n900 8 | 9 | 10 | make -f core_make_arm.mk build_n900 11 | 12 | make -f core_make_arm.mk strip_n900 13 | 14 | 15 | # RooT demo compilation requires Xext development library in addition to g++ 16 | 17 | cd ../root 18 | 19 | make -f RooT_make_arm.mk build_n900 20 | 21 | make -f RooT_make_arm.mk strip_n900 22 | 23 | cd ../test 24 | -------------------------------------------------------------------------------- /test/build_raspi.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Intended for ARMv7 Linux build environment 3 | # with native g++ compiler installed (32-bit Raspbian 7 and 8 tested) 4 | 5 | make -f simd_make_arm.mk build_rpiX -j4 6 | 7 | make -f simd_make_arm.mk strip_rpiX 8 | 9 | 10 | make -f core_make_arm.mk build_rpiX -j4 11 | 12 | make -f core_make_arm.mk strip_rpiX 13 | 14 | 15 | # RooT demo compilation requires Xext development library in addition to g++ 16 | 17 | cd ../root 18 | 19 | make -f RooT_make_arm.mk build_rpiX -j4 20 | 21 | make -f RooT_make_arm.mk strip_rpiX 22 | 23 | cd ../test 24 | -------------------------------------------------------------------------------- /test/build_win64.bat: -------------------------------------------------------------------------------- 1 | :: Intended for x86_64 Windows build environment 2 | :: with TDM64-GCC compiler installed (64-bit Windows 7 SP1, Windows 10 tested) 3 | 4 | mingw32-make -f simd_make_w64.mk build -j4 5 | 6 | mingw32-make -f simd_make_w64.mk strip 7 | 8 | 9 | mingw32-make -f core_make_w64.mk build -j4 10 | 11 | mingw32-make -f core_make_w64.mk strip 12 | 13 | 14 | :: RooT demo links with native GDI32 library for graphical output 15 | 16 | cd ../root 17 | 18 | mingw32-make -f RooT_make_w64.mk build -j4 19 | 20 | mingw32-make -f RooT_make_w64.mk strip 21 | 22 | cd ../test 23 | -------------------------------------------------------------------------------- /test/clean_cross.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Intended for x86_64 Linux build environment 3 | # with many g++ cross-compilers installed (64-bit Ubuntu MATE 20.04 LTS tested) 4 | # refer to individual makefiles for installation instructions 5 | 6 | make -f simd_make_arm.mk clean 7 | make -f simd_make_m32.mk clean 8 | make -f simd_make_p32.mk clean 9 | make -f simd_make_a64.mk clean 10 | make -f simd_make_m64.mk clean 11 | make -f simd_make_p64.mk clean 12 | 13 | 14 | make -f core_make_arm.mk clean 15 | make -f core_make_m32.mk clean 16 | make -f core_make_p32.mk clean 17 | make -f core_make_a64.mk clean 18 | make -f core_make_m64.mk clean 19 | make -f core_make_p64.mk clean 20 | -------------------------------------------------------------------------------- /test/clean_linux.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Intended for x86_64 Linux build environment 3 | # with native g++ compiler installed (64-bit Linux Mint 18 tested) 4 | # works on Ubuntu MATE 18.04/20.04 LTS (binaries aren't backward compatible) 5 | 6 | make -f simd_make_x64.mk clean 7 | 8 | 9 | make -f core_make_x64.mk clean 10 | 11 | 12 | # RooT demo compilation requires Xext development library in addition to g++ 13 | 14 | cd ../root 15 | 16 | make -f RooT_make_x64.mk clean 17 | 18 | cd ../test 19 | -------------------------------------------------------------------------------- /test/clean_macM1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Intended for AArch64 macOS build environment with Apple Silicon (M1 chip) 3 | # with Command Line Tools installed (macOS BigSur/Monterey tested) 4 | # build on the least recent OS as binaries aren't always backward compatible 5 | 6 | make -f simd_make_a64.mk macRM 7 | 8 | 9 | make -f core_make_a64.mk macRM 10 | 11 | 12 | # RooT demo compilation also requires XQuartz starting from version 2.8.0 13 | 14 | cd ../root 15 | 16 | make -f RooT_make_a64.mk macRM 17 | 18 | cd ../test 19 | -------------------------------------------------------------------------------- /test/clean_macOS.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Intended for x86_64 Mac OS X / OS X / macOS build environment 3 | # with Command Line Tools installed (Mac OS X Lion / macOS High Sierra tested) 4 | # build on the least recent OS as binaries aren't always backward compatible 5 | 6 | make -f simd_make_x64.mk macRM 7 | 8 | 9 | make -f core_make_x64.mk macRM 10 | 11 | 12 | # RooT demo compilation also requires XQuartz starting from OS X Mountain Lion 13 | 14 | cd ../root 15 | 16 | make -f RooT_make_x64.mk macRM 17 | 18 | cd ../test 19 | -------------------------------------------------------------------------------- /test/clean_multi.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Intended for x86_64 Linux build environment 3 | # with native g++ multilib-compiler installed (64-bit Linux Mint 18 tested) 4 | # refer to individual makefiles for installation instructions 5 | 6 | make -f simd_make_x86.mk clean 7 | make -f simd_make_x32.mk clean 8 | 9 | 10 | make -f core_make_x86.mk clean 11 | make -f core_make_x32.mk clean 12 | 13 | 14 | # RooT demo compilation requires Xext development library in addition to g++ 15 | 16 | cd ../root 17 | 18 | make -f RooT_make_x86.mk clean 19 | 20 | cd ../test 21 | -------------------------------------------------------------------------------- /test/clean_nokia.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Intended for scratchbox Linux build environment (32-bit Ubuntu 10.10 tested) 3 | # http://wiki.maemo.org/Documentation/Maemo_5_Final_SDK_Installation 4 | 5 | make -f simd_make_arm.mk clean_n900 6 | 7 | 8 | make -f core_make_arm.mk clean_n900 9 | 10 | 11 | # RooT demo compilation requires Xext development library in addition to g++ 12 | 13 | cd ../root 14 | 15 | make -f RooT_make_arm.mk clean_n900 16 | 17 | cd ../test 18 | -------------------------------------------------------------------------------- /test/clean_raspi.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Intended for ARMv7 Linux build environment 3 | # with native g++ compiler installed (32-bit Raspbian 7 and 8 tested) 4 | 5 | make -f simd_make_arm.mk clean_rpiX 6 | 7 | 8 | make -f core_make_arm.mk clean_rpiX 9 | 10 | 11 | # RooT demo compilation requires Xext development library in addition to g++ 12 | 13 | cd ../root 14 | 15 | make -f RooT_make_arm.mk clean_rpiX 16 | 17 | cd ../test 18 | -------------------------------------------------------------------------------- /test/clean_win64.bat: -------------------------------------------------------------------------------- 1 | :: Intended for x86_64 Windows build environment 2 | :: with TDM64-GCC compiler installed (64-bit Windows 7 SP1 tested) 3 | 4 | mingw32-make -f simd_make_w64.mk clean 5 | 6 | 7 | mingw32-make -f core_make_w64.mk clean 8 | 9 | 10 | :: RooT demo links with native GDI32 library for graphical output 11 | 12 | cd ../root 13 | 14 | mingw32-make -f RooT_make_w64.mk clean 15 | 16 | cd ../test 17 | -------------------------------------------------------------------------------- /test/core_make_a32.mk: -------------------------------------------------------------------------------- 1 | 2 | INC_PATH = \ 3 | -I../core/config/ \ 4 | -I../core/engine/ \ 5 | -I../core/system/ \ 6 | -I../core/tracer/ \ 7 | -I../data/materials/ \ 8 | -I../data/objects/ \ 9 | -I../data/textures/ \ 10 | -Iscenes/ 11 | 12 | SRC_LIST = \ 13 | ../core/engine/engine.cpp \ 14 | ../core/engine/object.cpp \ 15 | ../core/engine/rtgeom.cpp \ 16 | ../core/engine/rtimag.cpp \ 17 | ../core/system/system.cpp \ 18 | ../core/tracer/tracer.cpp \ 19 | ../core/tracer/tracer_128v1.cpp \ 20 | ../core/tracer/tracer_128v4.cpp \ 21 | ../core/tracer/tracer_256v1.cpp \ 22 | core_test.cpp 23 | 24 | LIB_PATH = 25 | 26 | LIB_LIST = \ 27 | -lm \ 28 | -lstdc++ 29 | 30 | 31 | build: core_test_a32 32 | 33 | strip: 34 | aarch64-linux-gnu-strip core_test.a32* 35 | 36 | clean: 37 | rm core_test.a32* 38 | 39 | 40 | core_test_a32: 41 | aarch64-linux-gnu-g++ -O3 -g -static -mabi=ilp32 \ 42 | -DRT_LINUX -DRT_A32 -DRT_128=1 -DRT_256=1 \ 43 | -DRT_POINTER=32 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=0 \ 44 | -DRT_DEBUG=0 -DRT_PATH="../" \ 45 | -DRT_EMBED_STDOUT=0 -DRT_EMBED_FILEIO=0 -DRT_EMBED_TEX=1 \ 46 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o core_test.a32 47 | 48 | 49 | # On Ubuntu (MATE) 16.04-22.04 add "universe multiverse" to "main restricted" 50 | # in /etc/apt/sources.list (sudo nano /etc/apt/sources.list) then run: 51 | # sudo apt-get update 52 | # (Ubuntu MATE is set up for an update without a need to edit the file) 53 | # (extended repositories "universe multiverse" are only needed for clang) 54 | # 55 | # Prerequisites for the build: 56 | # (cross-)compiler for AArch64 is installed and in the PATH variable. 57 | # sudo apt-get install make g++-aarch64-linux-gnu 58 | # (recent upstream g++-5-aarch64 series may not fully support ILP32 ABI) 59 | # 60 | # Compiling/running CORE test: 61 | # make -f core_make_a32.mk 62 | 63 | # Clang native build should theoretically work too (not tested), use (replace): 64 | # clang++ (in place of ...-g++) on AArch64 host (Raspberry Pi 3/4) 65 | # sudo apt-get install clang 66 | 67 | # core_test uses runtime SIMD target selection, multiple can be specified above 68 | # on RISC targets top value above is chosen by default, use -n/-k/-s to override 69 | # 256-bit SIMD is achieved by combining pairs of 128-bit registers/instructions 70 | 71 | # For interpretation of SIMD build flags check compatibility layer in rtzero.h 72 | # or refer to the corresponding simd_make_***.mk file. 73 | 74 | # 32-bit ABI hasn't been fully tested yet due to lack of available libs, 75 | # check out 64/32-bit (ptr/adr) hybrid mode for 64-bit ABI in core_make_a64.mk 76 | -------------------------------------------------------------------------------- /test/core_make_arm.mk: -------------------------------------------------------------------------------- 1 | 2 | INC_PATH = \ 3 | -I../core/config/ \ 4 | -I../core/engine/ \ 5 | -I../core/system/ \ 6 | -I../core/tracer/ \ 7 | -I../data/materials/ \ 8 | -I../data/objects/ \ 9 | -I../data/textures/ \ 10 | -Iscenes/ 11 | 12 | SRC_LIST = \ 13 | ../core/engine/engine.cpp \ 14 | ../core/engine/object.cpp \ 15 | ../core/engine/rtgeom.cpp \ 16 | ../core/engine/rtimag.cpp \ 17 | ../core/system/system.cpp \ 18 | ../core/tracer/tracer.cpp \ 19 | ../core/tracer/tracer_128v1.cpp \ 20 | ../core/tracer/tracer_128v2.cpp \ 21 | ../core/tracer/tracer_128v4.cpp \ 22 | core_test.cpp 23 | 24 | LIB_PATH = 25 | 26 | LIB_LIST = \ 27 | -lm \ 28 | -lstdc++ 29 | 30 | 31 | build: core_test_arm_v1 core_test_arm_v2 32 | 33 | strip: 34 | arm-linux-gnueabi-strip core_test.arm_v* 35 | 36 | clean: 37 | rm core_test.arm_v* 38 | 39 | 40 | core_test_arm_v1: 41 | arm-linux-gnueabi-g++ -O3 -g -static -march=armv7-a -marm \ 42 | -DRT_LINUX -DRT_ARM -DRT_128=1 \ 43 | -DRT_POINTER=32 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=0 \ 44 | -DRT_DEBUG=0 -DRT_PATH="../" \ 45 | -DRT_EMBED_STDOUT=0 -DRT_EMBED_FILEIO=0 -DRT_EMBED_TEX=1 \ 46 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o core_test.arm_v1 47 | 48 | core_test_arm_v2: 49 | arm-linux-gnueabi-g++ -O3 -g -static -march=armv7-a -marm \ 50 | -DRT_LINUX -DRT_ARM -DRT_128=2 \ 51 | -DRT_POINTER=32 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=0 \ 52 | -DRT_DEBUG=0 -DRT_PATH="../" \ 53 | -DRT_EMBED_STDOUT=0 -DRT_EMBED_FILEIO=0 -DRT_EMBED_TEX=1 \ 54 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o core_test.arm_v2 55 | 56 | 57 | build_n900: core_test_arm_n900 58 | 59 | strip_n900: 60 | arm-linux-gnueabi-strip core_test.arm_n900* 61 | 62 | clean_n900: 63 | rm core_test.arm_n900* 64 | 65 | 66 | core_test_arm_n900: 67 | arm-linux-gnueabi-g++ -O3 -g -static -march=armv7-a -marm \ 68 | -DRT_LINUX -DRT_ARM -DRT_128=1 \ 69 | -DRT_POINTER=32 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=0 \ 70 | -DRT_DEBUG=0 -DRT_PATH="../" \ 71 | -DRT_EMBED_STDOUT=0 -DRT_EMBED_FILEIO=1 -DRT_EMBED_TEX=1 \ 72 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o core_test.arm_n900 73 | 74 | 75 | build_rpiX: core_test_arm_rpi2 core_test_arm_rpi3 76 | 77 | strip_rpiX: 78 | arm-linux-gnueabihf-strip core_test.arm_rpi* 79 | 80 | clean_rpiX: 81 | rm core_test.arm_rpi* 82 | 83 | 84 | core_test_arm_rpi2: 85 | arm-linux-gnueabihf-g++ -O3 -g -static -march=armv7-a -marm \ 86 | -DRT_LINUX -DRT_ARM -DRT_128=2 \ 87 | -DRT_POINTER=32 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=0 \ 88 | -DRT_DEBUG=0 -DRT_PATH="../" \ 89 | -DRT_EMBED_STDOUT=0 -DRT_EMBED_FILEIO=0 -DRT_EMBED_TEX=1 \ 90 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o core_test.arm_rpi2 91 | 92 | core_test_arm_rpi3: 93 | arm-linux-gnueabihf-g++ -O3 -g -static -march=armv7-a -marm \ 94 | -DRT_LINUX -DRT_ARM -DRT_128=4 \ 95 | -DRT_POINTER=32 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=0 \ 96 | -DRT_DEBUG=0 -DRT_PATH="../" \ 97 | -DRT_EMBED_STDOUT=0 -DRT_EMBED_FILEIO=0 -DRT_EMBED_TEX=1 \ 98 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o core_test.arm_rpi3 99 | 100 | 101 | # On Ubuntu (MATE) 16.04-22.04 add "universe multiverse" to "main restricted" 102 | # in /etc/apt/sources.list (sudo nano /etc/apt/sources.list) then run: 103 | # sudo apt-get update 104 | # (Ubuntu MATE is set up for an update without a need to edit the file) 105 | # (extended repositories "universe multiverse" are only needed for clang) 106 | # 107 | # Prerequisites for the build: 108 | # (cross-)compiler for ARMv7 is installed and in the PATH variable. 109 | # sudo apt-get install make g++-arm-linux-gnueabi 110 | # 111 | # Prerequisites for emulation: 112 | # recent QEMU(-2.5) is installed or built from source and in the PATH variable. 113 | # sudo apt-get install qemu-user 114 | # 115 | # Compiling/running CORE test: 116 | # make -f core_make_arm.mk 117 | # qemu-arm -cpu cortex-a8 core_test.arm_v1 -i -a -c 1 118 | # qemu-arm -cpu cortex-a15 core_test.arm_v2 -i -a -c 1 119 | # (should produce antialiased "-a" images "-i" in the ../dump subfolder) 120 | # Use "-c 1" option to reduce test time when emulating with QEMU 121 | 122 | # Clang native build works too (takes much longer prior to 3.8), use (replace): 123 | # clang++ (in place of ...-g++) on ARMv7 host (Raspberry Pi 2) 124 | # sudo apt-get install clang 125 | 126 | # core_test uses runtime SIMD target selection, multiple can be specified above 127 | # on RISC targets top value above is chosen by default, use -n/-k/-s to override 128 | 129 | # For interpretation of SIMD build flags check compatibility layer in rtzero.h 130 | # or refer to the corresponding simd_make_***.mk file. 131 | 132 | # 1) Nokia N900, Maemo 5 scratchbox: -DRT_EMBED_FILEIO=1 133 | # 2) Raspberry Pi 2, Raspbian: arm-linux-gnueabihf-g++ -DRT_128=2 134 | # 3) Raspberry Pi 3, Raspbian: arm-linux-gnueabihf-g++ -DRT_128=4 135 | -------------------------------------------------------------------------------- /test/core_make_m32.mk: -------------------------------------------------------------------------------- 1 | 2 | INC_PATH = \ 3 | -I../core/config/ \ 4 | -I../core/engine/ \ 5 | -I../core/system/ \ 6 | -I../core/tracer/ \ 7 | -I../data/materials/ \ 8 | -I../data/objects/ \ 9 | -I../data/textures/ \ 10 | -Iscenes/ 11 | 12 | SRC_LIST = \ 13 | ../core/engine/engine.cpp \ 14 | ../core/engine/object.cpp \ 15 | ../core/engine/rtgeom.cpp \ 16 | ../core/engine/rtimag.cpp \ 17 | ../core/system/system.cpp \ 18 | ../core/tracer/tracer.cpp \ 19 | ../core/tracer/tracer_128v1.cpp \ 20 | ../core/tracer/tracer_128v4.cpp \ 21 | ../core/tracer/tracer_256v1.cpp \ 22 | core_test.cpp 23 | 24 | LIB_PATH = 25 | 26 | LIB_LIST = \ 27 | -lm \ 28 | -lstdc++ 29 | 30 | 31 | build: core_test_m32Lr5 core_test_m32Br5 32 | 33 | strip: 34 | mips-mti-linux-gnu-strip core_test.m32?r5* 35 | 36 | clean: 37 | rm core_test.m32* 38 | 39 | 40 | core_test_m32Lr5: 41 | mips-mti-linux-gnu-g++ -O3 -g -static -EL -mips32r5 -mmsa -mnan=2008 \ 42 | -DRT_LINUX -DRT_M32 -DRT_128=1 -DRT_256=1 \ 43 | -DRT_POINTER=32 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=0 \ 44 | -DRT_DEBUG=0 -DRT_PATH="../" \ 45 | -DRT_EMBED_STDOUT=0 -DRT_EMBED_FILEIO=0 -DRT_EMBED_TEX=1 \ 46 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o core_test.m32Lr5 47 | 48 | core_test_m32Br5: 49 | mips-mti-linux-gnu-g++ -O3 -g -static -EB -mips32r5 -mmsa -mnan=2008 \ 50 | -DRT_LINUX -DRT_M32 -DRT_128=1 -DRT_256=1 \ 51 | -DRT_POINTER=32 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=1 \ 52 | -DRT_DEBUG=0 -DRT_PATH="../" \ 53 | -DRT_EMBED_STDOUT=0 -DRT_EMBED_FILEIO=0 -DRT_EMBED_TEX=1 \ 54 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o core_test.m32Br5 55 | 56 | 57 | # On Ubuntu (MATE) 16.04-22.04 add "universe multiverse" to "main restricted" 58 | # in /etc/apt/sources.list (sudo nano /etc/apt/sources.list) then run: 59 | # sudo apt-get update 60 | # (Ubuntu MATE is set up for an update without a need to edit the file) 61 | # (extended repositories "universe multiverse" are only needed for clang) 62 | # 63 | # Download and unpack MIPS toolchain: 64 | # https://codescape.mips.com/components/toolchain/2020.06-01/downloads.html 65 | # 66 | # Prerequisites for the build: 67 | # (cross-)compiler for MIPSr5+MSA is installed and in the PATH variable. 68 | # Codescape.GNU.Tools.Package.2020.06-01.for.MIPS.MTI.Linux.CentOS-6.x86_64 69 | # is unpacked and folder mips-mti-linux-gnu/2020.06-01/bin is added to PATH: 70 | # PATH=/home/ubuntu/Downloads/mips-mti-linux-gnu/2020.06-01/bin:$PATH 71 | # PATH=/home/ubuntu-mate/Downloads/mips-mti-linux-gnu/2020.06-01/bin:$PATH 72 | # 73 | # Prerequisites for emulation: 74 | # recent QEMU(-2.5) is installed or built from source and in the PATH variable. 75 | # standalone toolchain from 2020.06-01 comes with QEMU 4.1.0 for MIPS in PATH. 76 | # sudo apt-get install qemu-user make 77 | # 78 | # Compiling/running CORE test: 79 | # make -f core_make_m32.mk 80 | # qemu-mipsel -cpu P5600 core_test.m32Lr5 -i -a -c 1 81 | # qemu-mips -cpu P5600 core_test.m32Br5 -i -a -c 1 82 | # (should produce antialiased "-a" images "-i" in the ../dump subfolder) 83 | # Use "-c 1" option to reduce test time when emulating with QEMU 84 | 85 | # Clang native build should theoretically work too (not tested), use (replace): 86 | # clang++ -O0 (in place of ...-g++ -O3) on MIPS32r5 host (P5600) 87 | # sudo apt-get install clang 88 | 89 | # core_test uses runtime SIMD target selection, multiple can be specified above 90 | # on RISC targets top value above is chosen by default, use -n/-k/-s to override 91 | # 256-bit SIMD is achieved by combining pairs of 128-bit registers/instructions 92 | 93 | # For interpretation of SIMD build flags check compatibility layer in rtzero.h 94 | # or refer to the corresponding simd_make_***.mk file. 95 | -------------------------------------------------------------------------------- /test/core_make_p32.mk: -------------------------------------------------------------------------------- 1 | 2 | INC_PATH = \ 3 | -I../core/config/ \ 4 | -I../core/engine/ \ 5 | -I../core/system/ \ 6 | -I../core/tracer/ \ 7 | -I../data/materials/ \ 8 | -I../data/objects/ \ 9 | -I../data/textures/ \ 10 | -Iscenes/ 11 | 12 | SRC_LIST = \ 13 | ../core/engine/engine.cpp \ 14 | ../core/engine/object.cpp \ 15 | ../core/engine/rtgeom.cpp \ 16 | ../core/engine/rtimag.cpp \ 17 | ../core/system/system.cpp \ 18 | ../core/tracer/tracer.cpp \ 19 | ../core/tracer/tracer_128v1.cpp \ 20 | ../core/tracer/tracer_128v2.cpp \ 21 | ../core/tracer/tracer_128v4.cpp \ 22 | ../core/tracer/tracer_256v4_r8.cpp \ 23 | ../core/tracer/tracer_256v1.cpp \ 24 | ../core/tracer/tracer_256v2.cpp \ 25 | ../core/tracer/tracer_256v4.cpp \ 26 | ../core/tracer/tracer_256v8.cpp \ 27 | ../core/tracer/tracer_512v1.cpp \ 28 | ../core/tracer/tracer_512v2.cpp \ 29 | core_test.cpp 30 | 31 | LIB_PATH = 32 | 33 | LIB_LIST = \ 34 | -lm \ 35 | -lstdc++ 36 | 37 | 38 | build: core_test_p32Bg4 core_test_p32Bp7 core_test_p32Bp8 core_test_p32Bp9 39 | 40 | strip: 41 | powerpc-linux-gnu-strip core_test.p32* 42 | 43 | clean: 44 | rm core_test.p32* 45 | 46 | 47 | core_test_p32Bg4: 48 | powerpc-linux-gnu-g++ -O3 -g -static -DRT_SIMD_COMPAT_VSX=0 \ 49 | -DRT_LINUX -DRT_P32 -DRT_128=4 -DRT_256_R8=4 \ 50 | -DRT_POINTER=32 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=1 \ 51 | -DRT_DEBUG=0 -DRT_PATH="../" \ 52 | -DRT_EMBED_STDOUT=0 -DRT_EMBED_FILEIO=0 -DRT_EMBED_TEX=1 \ 53 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o core_test.p32Bg4 54 | 55 | core_test_p32Bp7: 56 | powerpc-linux-gnu-g++ -O3 -g -static \ 57 | -DRT_LINUX -DRT_P32 -DRT_128=1 -DRT_256=1 \ 58 | -DRT_POINTER=32 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=1 \ 59 | -DRT_DEBUG=0 -DRT_PATH="../" \ 60 | -DRT_EMBED_STDOUT=0 -DRT_EMBED_FILEIO=0 -DRT_EMBED_TEX=1 \ 61 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o core_test.p32Bp7 62 | 63 | core_test_p32Bp8: 64 | powerpc-linux-gnu-g++ -O3 -g -static -DRT_SIMD_COMPAT_PW8=1 \ 65 | -DRT_LINUX -DRT_P32 -DRT_128=1 -DRT_256=1 \ 66 | -DRT_POINTER=32 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=1 \ 67 | -DRT_DEBUG=0 -DRT_PATH="../" \ 68 | -DRT_EMBED_STDOUT=0 -DRT_EMBED_FILEIO=0 -DRT_EMBED_TEX=1 \ 69 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o core_test.p32Bp8 70 | 71 | core_test_p32Bp9: 72 | powerpc-linux-gnu-g++ -O3 -g -static -DRT_SIMD_COMPAT_PW8=1 \ 73 | -DRT_LINUX -DRT_P32 -DRT_128=1+2 -DRT_256=1+2 \ 74 | -DRT_POINTER=32 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=1 \ 75 | -DRT_DEBUG=0 -DRT_PATH="../" \ 76 | -DRT_EMBED_STDOUT=0 -DRT_EMBED_FILEIO=0 -DRT_EMBED_TEX=1 \ 77 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o core_test.p32Bp9 78 | 79 | 80 | # On Ubuntu (MATE) 16.04-22.04 add "universe multiverse" to "main restricted" 81 | # in /etc/apt/sources.list (sudo nano /etc/apt/sources.list) then run: 82 | # sudo apt-get update 83 | # (Ubuntu MATE is set up for an update without a need to edit the file) 84 | # (extended repositories "universe multiverse" are only needed for clang) 85 | # 86 | # Prerequisites for the build: 87 | # (cross-)compiler for PowerPC is installed and in the PATH variable. 88 | # sudo apt-get install make g++-powerpc-linux-gnu 89 | # 90 | # Prerequisites for emulation: 91 | # recent QEMU(-2.5) is installed or built from source and in the PATH variable. 92 | # POWER9 target requires more recent QEMU, tested with 3.x.y series and 4.2.0. 93 | # QEMU versions 4.x.y prior to 4.2.0 show issues with POWER8/9 fp32 LE targets. 94 | # sudo apt-get install qemu-user 95 | # 96 | # Compiling/running CORE test: 97 | # make -f core_make_p32.mk 98 | # qemu-ppc -cpu G4 core_test.p32Bg4 -i -a -c 1 99 | # qemu-ppc64abi32 -cpu POWER7 core_test.p32Bp7 -i -a -c 1 100 | # qemu-ppc64abi32 -cpu POWER8 core_test.p32Bp8 -i -a -c 1 101 | # qemu-ppc64abi32 -cpu POWER9 core_test.p32Bp9 -i -a -c 1 102 | # (should produce antialiased "-a" images "-i" in the ../dump subfolder) 103 | # Use "-c 1" option to reduce test time when emulating with QEMU 104 | 105 | # Clang native build should theoretically work too (not tested), use (replace): 106 | # clang++ -O0 (in place of ...-g++ -O3) on PowerPC host (G4) 107 | # sudo apt-get install clang 108 | 109 | # core_test uses runtime SIMD target selection, multiple can be specified above 110 | # on RISC targets top value above is chosen by default, use -n/-k/-s to override 111 | # 256-bit SIMD is achieved by combining pairs of 128-bit registers/instructions 112 | # 512-bit SIMD is achieved by combining quads of 128-bit registers/instructions 113 | # For 30 256-bit VSX1/3 registers on POWER7/9 targets use (replace): RT_256=4+8 114 | # For 15 512-bit VSX2/3 registers on POWER8/9 targets use (replace): RT_512=1+2 115 | # SIMD-buffers only work up to RT_256=1+2 due to instruction limitation (no 512) 116 | 117 | # For interpretation of SIMD build flags check compatibility layer in rtzero.h 118 | # or refer to the corresponding simd_make_***.mk file. 119 | -------------------------------------------------------------------------------- /test/core_make_w64.bat: -------------------------------------------------------------------------------- 1 | mingw32-make -f core_make_w64.mk -j4 2 | core_test_w64f32.exe -i -a 3 | -------------------------------------------------------------------------------- /test/core_make_w64.mk: -------------------------------------------------------------------------------- 1 | 2 | INC_PATH = \ 3 | -I../core/config/ \ 4 | -I../core/engine/ \ 5 | -I../core/system/ \ 6 | -I../core/tracer/ \ 7 | -I../data/materials/ \ 8 | -I../data/objects/ \ 9 | -I../data/textures/ \ 10 | -Iscenes/ 11 | 12 | SRC_LIST = \ 13 | ../core/engine/engine.cpp \ 14 | ../core/engine/object.cpp \ 15 | ../core/engine/rtgeom.cpp \ 16 | ../core/engine/rtimag.cpp \ 17 | ../core/system/system.cpp \ 18 | ../core/tracer/tracer.cpp \ 19 | ../core/tracer/tracer_128v2.cpp \ 20 | ../core/tracer/tracer_128v4.cpp \ 21 | ../core/tracer/tracer_128v8.cpp \ 22 | ../core/tracer/tracer_256v4_r8.cpp \ 23 | ../core/tracer/tracer_256v1.cpp \ 24 | ../core/tracer/tracer_256v2.cpp \ 25 | ../core/tracer/tracer_256v8.cpp \ 26 | ../core/tracer/tracer_512v1_r8.cpp \ 27 | ../core/tracer/tracer_512v2_r8.cpp \ 28 | ../core/tracer/tracer_512v1.cpp \ 29 | ../core/tracer/tracer_512v2.cpp \ 30 | ../core/tracer/tracer_512v4.cpp \ 31 | ../core/tracer/tracer_512v8.cpp \ 32 | ../core/tracer/tracer_1K4v1.cpp \ 33 | ../core/tracer/tracer_1K4v2.cpp \ 34 | ../core/tracer/tracer_2K8v1_r8.cpp \ 35 | ../core/tracer/tracer_2K8v2_r8.cpp \ 36 | core_test.cpp 37 | 38 | LIB_PATH = 39 | 40 | LIB_LIST = \ 41 | -lm \ 42 | -lstdc++ 43 | 44 | 45 | build: core_test_w64_32 core_test_w64_64 core_test_w64f32 core_test_w64f64 46 | 47 | strip: 48 | strip core_test_w64*.exe 49 | 50 | clean: 51 | del core_test_w64*.exe 52 | 53 | 54 | core_test_w64_32: 55 | g++ -O3 -g -static -m64 \ 56 | -DRT_WIN64 -DRT_X64 -DRT_128=2+4+8 -DRT_256_R8=4 -DRT_256=1+2+8 \ 57 | -DRT_512_R8=1+2 -DRT_512=1+2 -DRT_1K4=1+2 -DRT_SIMD_COMPAT_SSE=2 \ 58 | -DRT_POINTER=64 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=0 \ 59 | -DRT_DEBUG=0 -DRT_PATH="../" \ 60 | -DRT_EMBED_STDOUT=0 -DRT_EMBED_FILEIO=0 -DRT_EMBED_TEX=1 \ 61 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o core_test_w64_32.exe 62 | 63 | core_test_w64_64: 64 | g++ -O3 -g -static -m64 \ 65 | -DRT_WIN64 -DRT_X64 -DRT_128=2+4+8 -DRT_256_R8=4 -DRT_256=1+2+8 \ 66 | -DRT_512_R8=1+2 -DRT_512=1+2 -DRT_1K4=1+2 -DRT_SIMD_COMPAT_SSE=2 \ 67 | -DRT_POINTER=64 -DRT_ADDRESS=32 -DRT_ELEMENT=64 -DRT_ENDIAN=0 \ 68 | -DRT_DEBUG=0 -DRT_PATH="../" \ 69 | -DRT_EMBED_STDOUT=0 -DRT_EMBED_FILEIO=0 -DRT_EMBED_TEX=1 \ 70 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o core_test_w64_64.exe 71 | 72 | core_test_w64f32: 73 | g++ -O3 -g -static -m64 \ 74 | -DRT_WIN64 -DRT_X64 -DRT_128=2+4+8 -DRT_256_R8=4 -DRT_256=1+2+8 \ 75 | -DRT_512_R8=1+2 -DRT_512=1+2 -DRT_1K4=1+2 -DRT_SIMD_COMPAT_SSE=2 \ 76 | -DRT_POINTER=64 -DRT_ADDRESS=64 -DRT_ELEMENT=32 -DRT_ENDIAN=0 \ 77 | -DRT_DEBUG=0 -DRT_PATH="../" \ 78 | -DRT_EMBED_STDOUT=0 -DRT_EMBED_FILEIO=0 -DRT_EMBED_TEX=1 \ 79 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o core_test_w64f32.exe 80 | 81 | core_test_w64f64: 82 | g++ -O3 -g -static -m64 \ 83 | -DRT_WIN64 -DRT_X64 -DRT_128=2+4+8 -DRT_256_R8=4 -DRT_256=1+2+8 \ 84 | -DRT_512_R8=1+2 -DRT_512=1+2 -DRT_1K4=1+2 -DRT_SIMD_COMPAT_SSE=2 \ 85 | -DRT_POINTER=64 -DRT_ADDRESS=64 -DRT_ELEMENT=64 -DRT_ENDIAN=0 \ 86 | -DRT_DEBUG=0 -DRT_PATH="../" \ 87 | -DRT_EMBED_STDOUT=0 -DRT_EMBED_FILEIO=0 -DRT_EMBED_TEX=1 \ 88 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o core_test_w64f64.exe 89 | 90 | 91 | # Prerequisites for the build: 92 | # TDM64-GCC compiler for Win32/64 is installed and in the PATH variable. 93 | # Download tdm64-gcc-5.1.0-2.exe from sourceforge and run the installer. 94 | # Alternatively download and install tdm64-gcc-10.3.0-2.exe from github. 95 | # 96 | # Compiling/running CORE test: 97 | # run core_make_w64.bat from Windows Explorer or 98 | # run the following from Command Prompt "cmd": 99 | # mingw32-make -f core_make_w64.mk 100 | # core_test_w64f32.exe -i -a -c 1 101 | # (should produce antialiased "-a" images "-i" in the ../dump subfolder) 102 | # Use "-c 1" option to reduce test time when emulating with Intel SDE 103 | 104 | # Clang native build should theoretically work too (not tested), use (replace): 105 | # clang++ (in place of g++) may require Visual Studio 106 | # once clang for Windows is installed and in the PATH variable. 107 | 108 | # core_test uses runtime SIMD target selection, multiple can be specified above 109 | # on x86 targets top cpuid-value is chosen by default, use -n/-k/-s to override 110 | # 1K4-bit SIMD is achieved by combining pairs of 512-bit registers/instructions 111 | # 2K8-bit SIMD is achieved by combining quads of 512-bit registers/instructions 112 | # For 30-regs 512-bit AVX512F/DQ targets on Skylake-X use (replace): RT_512=4+8 113 | 114 | # For interpretation of SIMD build flags check compatibility layer in rtzero.h 115 | # or refer to the corresponding simd_make_***.mk file. 116 | 117 | # 64/32-bit (ptr/adr) hybrid mode is compatible with native 64-bit ABI, 118 | # use (replace): RT_ADDRESS=32, rename the binary to core_test_w64_**.exe 119 | # 64-bit packed SIMD mode (fp64/int64) is supported on 64-bit targets, 120 | # use (replace): RT_ELEMENT=64, rename the binary to core_test_w64*64.exe 121 | -------------------------------------------------------------------------------- /test/core_make_x32.mk: -------------------------------------------------------------------------------- 1 | 2 | INC_PATH = \ 3 | -I../core/config/ \ 4 | -I../core/engine/ \ 5 | -I../core/system/ \ 6 | -I../core/tracer/ \ 7 | -I../data/materials/ \ 8 | -I../data/objects/ \ 9 | -I../data/textures/ \ 10 | -Iscenes/ 11 | 12 | SRC_LIST = \ 13 | ../core/engine/engine.cpp \ 14 | ../core/engine/object.cpp \ 15 | ../core/engine/rtgeom.cpp \ 16 | ../core/engine/rtimag.cpp \ 17 | ../core/system/system.cpp \ 18 | ../core/tracer/tracer.cpp \ 19 | ../core/tracer/tracer_128v2.cpp \ 20 | ../core/tracer/tracer_128v4.cpp \ 21 | ../core/tracer/tracer_128v8.cpp \ 22 | ../core/tracer/tracer_256v4_r8.cpp \ 23 | ../core/tracer/tracer_256v1.cpp \ 24 | ../core/tracer/tracer_256v2.cpp \ 25 | ../core/tracer/tracer_256v8.cpp \ 26 | ../core/tracer/tracer_512v1_r8.cpp \ 27 | ../core/tracer/tracer_512v2_r8.cpp \ 28 | ../core/tracer/tracer_512v1.cpp \ 29 | ../core/tracer/tracer_512v2.cpp \ 30 | ../core/tracer/tracer_512v4.cpp \ 31 | ../core/tracer/tracer_512v8.cpp \ 32 | ../core/tracer/tracer_1K4v1.cpp \ 33 | ../core/tracer/tracer_1K4v2.cpp \ 34 | ../core/tracer/tracer_2K8v1_r8.cpp \ 35 | ../core/tracer/tracer_2K8v2_r8.cpp \ 36 | core_test.cpp 37 | 38 | LIB_PATH = 39 | 40 | LIB_LIST = \ 41 | -lm \ 42 | -lstdc++ 43 | 44 | 45 | build: core_test_x32 46 | 47 | strip: 48 | strip core_test.x32* 49 | 50 | clean: 51 | rm core_test.x32* 52 | 53 | 54 | core_test_x32: 55 | g++ -O3 -g -mx32 \ 56 | -DRT_LINUX -DRT_X32 -DRT_128=2+4+8 -DRT_256_R8=4 -DRT_256=1+2+8 \ 57 | -DRT_512_R8=1+2 -DRT_512=1+2 -DRT_1K4=1+2 -DRT_SIMD_COMPAT_SSE=2 \ 58 | -DRT_POINTER=32 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=0 \ 59 | -DRT_DEBUG=0 -DRT_PATH="../" \ 60 | -DRT_EMBED_STDOUT=0 -DRT_EMBED_FILEIO=0 -DRT_EMBED_TEX=1 \ 61 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o core_test.x32 62 | 63 | 64 | # On Ubuntu (MATE) 16.04-22.04 add "universe multiverse" to "main restricted" 65 | # in /etc/apt/sources.list (sudo nano /etc/apt/sources.list) then run: 66 | # sudo apt-get update 67 | # (Ubuntu MATE is set up for an update without a need to edit the file) 68 | # (extended repositories "universe multiverse" are only needed for clang) 69 | # 70 | # Prerequisites for the build: 71 | # multilib-compiler for x86_64 is installed and in the PATH variable. 72 | # sudo apt-get install make g++-multilib 73 | # (installation of g++-multilib removes any g++ cross-compilers) 74 | # 75 | # Compiling/running CORE test: 76 | # make -f core_make_x32.mk 77 | # ./core_test.x32 -i -a -c 1 78 | # (should produce antialiased "-a" images "-i" in the ../dump subfolder) 79 | # Use "-c 1" option to reduce test time when emulating with Intel SDE 80 | 81 | # Clang native build works too (takes much longer prior to 3.8), use (replace): 82 | # clang++ (in place of g++) 83 | # sudo apt-get install clang (requires g++-multilib for non-native ABI) 84 | 85 | # core_test uses runtime SIMD target selection, multiple can be specified above 86 | # on x86 targets top cpuid-value is chosen by default, use -n/-k/-s to override 87 | # 1K4-bit SIMD is achieved by combining pairs of 512-bit registers/instructions 88 | # 2K8-bit SIMD is achieved by combining quads of 512-bit registers/instructions 89 | # For 30-regs 512-bit AVX512F/DQ targets on Skylake-X use (replace): RT_512=4+8 90 | 91 | # For interpretation of SIMD build flags check compatibility layer in rtzero.h 92 | # or refer to the corresponding simd_make_***.mk file. 93 | -------------------------------------------------------------------------------- /test/core_make_x86.mk: -------------------------------------------------------------------------------- 1 | 2 | INC_PATH = \ 3 | -I../core/config/ \ 4 | -I../core/engine/ \ 5 | -I../core/system/ \ 6 | -I../core/tracer/ \ 7 | -I../data/materials/ \ 8 | -I../data/objects/ \ 9 | -I../data/textures/ \ 10 | -Iscenes/ 11 | 12 | SRC_LIST = \ 13 | ../core/engine/engine.cpp \ 14 | ../core/engine/object.cpp \ 15 | ../core/engine/rtgeom.cpp \ 16 | ../core/engine/rtimag.cpp \ 17 | ../core/system/system.cpp \ 18 | ../core/tracer/tracer.cpp \ 19 | ../core/tracer/tracer_128v1.cpp \ 20 | ../core/tracer/tracer_128v2.cpp \ 21 | ../core/tracer/tracer_128v4.cpp \ 22 | ../core/tracer/tracer_128v8.cpp \ 23 | ../core/tracer/tracer_256v1.cpp \ 24 | ../core/tracer/tracer_256v2.cpp \ 25 | ../core/tracer/tracer_512v1.cpp \ 26 | ../core/tracer/tracer_512v2.cpp \ 27 | core_test.cpp 28 | 29 | LIB_PATH = 30 | 31 | LIB_LIST = \ 32 | -lm \ 33 | -lstdc++ 34 | 35 | 36 | build: core_test_x86 37 | 38 | strip: 39 | strip core_test.x86* 40 | 41 | clean: 42 | rm core_test.x86* 43 | 44 | 45 | core_test_x86: 46 | g++ -O3 -g -m32 \ 47 | -DRT_LINUX -DRT_X86 -DRT_128=1+2+4+8 -DRT_256=1+2 -DRT_512=1+2 \ 48 | -DRT_POINTER=32 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=0 \ 49 | -DRT_DEBUG=0 -DRT_PATH="../" \ 50 | -DRT_EMBED_STDOUT=0 -DRT_EMBED_FILEIO=0 -DRT_EMBED_TEX=1 \ 51 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o core_test.x86 52 | 53 | 54 | # On Ubuntu (MATE) 16.04-22.04 add "universe multiverse" to "main restricted" 55 | # in /etc/apt/sources.list (sudo nano /etc/apt/sources.list) then run: 56 | # sudo apt-get update 57 | # (Ubuntu MATE is set up for an update without a need to edit the file) 58 | # (extended repositories "universe multiverse" are only needed for clang) 59 | # 60 | # Prerequisites for the build: 61 | # native/multilib-compiler for x86/x86_64 is installed and in the PATH variable. 62 | # sudo apt-get install make g++ (for x86 host) 63 | # sudo apt-get install make g++-multilib (for x86_64 host) 64 | # (installation of g++-multilib removes any g++ cross-compilers) 65 | # 66 | # Compiling/running CORE test: 67 | # make -f core_make_x86.mk 68 | # ./core_test.x86 -i -a -c 1 69 | # (should produce antialiased "-a" images "-i" in the ../dump subfolder) 70 | # Use "-c 1" option to reduce test time when emulating with Intel SDE 71 | 72 | # Clang native build works too (takes much longer prior to 3.8), use (replace): 73 | # clang++ (in place of g++) 74 | # sudo apt-get install clang (requires g++-multilib for non-native ABI) 75 | 76 | # core_test uses runtime SIMD target selection, multiple can be specified above 77 | # on x86 targets top cpuid-value is chosen by default, use -n/-k/-s to override 78 | 79 | # For interpretation of SIMD build flags check compatibility layer in rtzero.h 80 | # or refer to the corresponding simd_make_***.mk file. 81 | -------------------------------------------------------------------------------- /test/core_qemu32.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Intended for x86_64 Linux test environment 3 | # with QEMU linux-user mode installed (64-bit Ubuntu MATE 20.04 LTS tested) 4 | # run this script after bulid_cross.sh with 32-bit cross-compilers installed 5 | 6 | # run before core_qemu64.sh to check all 18 image-sets 7 | # run after core_qemu64.sh to compare results in place 8 | # to change antialiasing mode (n = 2, 4) use/add: -a n 9 | # to draw target-specific numbers in images use/add: -h 10 | 11 | 12 | echo "========================================================" 13 | echo "=== running core_qemu32 in background, check ../dump ===" 14 | echo "=== wait for all 18 image-sets to be present: scr18* ===" 15 | echo "=== use top to monitor when all qemu-* have finished ===" 16 | echo "========================================================" 17 | 18 | qemu-arm -cpu cortex-a8 core_test.arm_v1 -c 1 -o -l -i 1 & 19 | qemu-arm -cpu cortex-a15 core_test.arm_v2 -c 1 -o -l -i 2 & 20 | 21 | qemu-mipsel -cpu P5600 core_test.m32Lr5 -c 1 -o -l -i 5 & 22 | qemu-mips -cpu P5600 core_test.m32Br5 -c 1 -o -l -i 6 & 23 | 24 | # ppc64abi32 targets are deprecated since QEMU 5.2.0 (dropped in Ubuntu 22.04) 25 | 26 | qemu-ppc -cpu G4 core_test.p32Bg4 -c 1 -o -l -i 4 & 27 | #qemu-ppc64abi32 -cpu POWER7 core_test.p32Bp7 -c 1 -o -l -i 7 & 28 | #qemu-ppc64abi32 -cpu POWER8 core_test.p32Bp8 -c 1 -o -l -i 8 & 29 | #qemu-ppc64abi32 -cpu POWER9 core_test.p32Bp9 -c 1 -o -l -i 9 & 30 | 31 | 32 | -------------------------------------------------------------------------------- /test/core_qemu64.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Intended for x86_64 Linux test environment 3 | # with QEMU linux-user mode installed (64-bit Ubuntu MATE 20.04 LTS tested) 4 | # run this script after bulid_cross.sh with 64-bit cross-compilers installed 5 | 6 | # for fp64 version replace *f32 to *f64 below 7 | # to change SIMD size-factor (n = 1, 2) use/add: -k n 8 | # to change antialiasing mode (n = 2, 4) use/add: -a n 9 | # to draw target-specific numbers in images use/add: -h 10 | 11 | 12 | echo "========================================================" 13 | echo "=== running core_qemu64 in background, check ../dump ===" 14 | echo "=== wait for all 18 image-sets to be present: scr18* ===" 15 | echo "=== use top to monitor when all qemu-* have finished ===" 16 | echo "========================================================" 17 | 18 | qemu-aarch64 -cpu cortex-a57 core_test.a64f32 -c 1 -o -l -i 3 & 19 | qemu-aarch64 -cpu max,sve-max-vq=4 core_test.a64f32sve -c 1 -o -l -i 4 & 20 | 21 | qemu-mips64el -cpu I6400 core_test.m64f32Lr6 -c 1 -o -l -i 5 & 22 | qemu-mips64 -cpu I6400 core_test.m64f32Br6 -c 1 -o -l -i 6 & 23 | 24 | # using -cpu power9 for power8 targets is a workaround for Ubuntu 22.04 LTS 25 | # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109007 26 | 27 | qemu-ppc64 -cpu POWER7 core_test.p64f32Bp7 -c 1 -o -l -i 7 & 28 | qemu-ppc64le -cpu POWER9 core_test.p64f32Lp8 -c 1 -o -l -i 8 & 29 | qemu-ppc64le -cpu POWER9 core_test.p64f32Lp9 -c 1 -o -l -i 9 & 30 | 31 | 32 | -------------------------------------------------------------------------------- /test/core_test64.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Intended for x86_64 Linux test environment 3 | # tested on 64-bit Linux Mint 18, 64-bit Ubuntu MATE 18.04/20.04 LTS 4 | # run this script after bulid_linux.sh with native compiler installed 5 | 6 | # for fp64 version replace *f32 to *f64 below 7 | # to change SIMD size-factor (n = 1, 2) use/add: -k n 8 | # to change antialiasing mode (n = 2, 4) use/add: -a n 9 | # to draw target-specific numbers in images use/add: -h 10 | 11 | 12 | echo "========================================================" 13 | echo "=== running core_test64 in background, check ../dump ===" 14 | echo "=== wait for all 18 image-sets to be present: scr18* ===" 15 | echo "=== use top to monitor when all core_* have finished ===" 16 | echo "========================================================" 17 | 18 | ./core_test.x64f32 -n 1 -c 1 -o -l -i 0 & 19 | ./core_test.x64f32 -n 2 -c 1 -o -l -i 1 & 20 | ./core_test.x64f32 -n 4 -c 1 -o -l -i 2 & 21 | 22 | 23 | -------------------------------------------------------------------------------- /test/core_test86.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Intended for x86_64 Linux test environment 3 | # with multilib capabilities (64-bit Linux Mint 18 tested) 4 | # run this script after bulid_multi.sh with multilib-compiler installed 5 | 6 | # run before core_test64.sh to check all 18 image-sets 7 | # run core_test64.sh after to compare results in place 8 | # to change antialiasing mode (n = 2, 4) use/add: -a n 9 | # to draw target-specific numbers in images use/add: -h 10 | 11 | 12 | echo "========================================================" 13 | echo "=== running core_test86 in background, check ../dump ===" 14 | echo "=== wait for all 18 image-sets to be present: scr18* ===" 15 | echo "=== use top to monitor when all core_* have finished ===" 16 | echo "========================================================" 17 | 18 | ./core_test.x86 -n 1 -c 1 -o -l -i 0 & 19 | ./core_test.x86 -n 2 -c 1 -o -l -i 1 & 20 | ./core_test.x86 -n 4 -c 1 -o -l -i 2 & 21 | ./core_test.x32 -c 1 -o -l -i 3 & 22 | 23 | 24 | -------------------------------------------------------------------------------- /test/core_test_x64.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.1.32328.378 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core_test_x64", "core_test_x64.vcxproj", "{8B5C8D18-E058-40AC-8749-0EFB7A0726CE}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Release|x64 = Release|x64 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {8B5C8D18-E058-40AC-8749-0EFB7A0726CE}.Debug|x64.ActiveCfg = Debug|x64 15 | {8B5C8D18-E058-40AC-8749-0EFB7A0726CE}.Debug|x64.Build.0 = Debug|x64 16 | {8B5C8D18-E058-40AC-8749-0EFB7A0726CE}.Release|x64.ActiveCfg = Release|x64 17 | {8B5C8D18-E058-40AC-8749-0EFB7A0726CE}.Release|x64.Build.0 = Release|x64 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {136F727E-8469-4814-9623-467111887C0C} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /test/core_test_x64.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /test/scenes/scn_test04.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | /* Copyright (c) 2013-2025 VectorChief (at github, bitbucket, sourceforge) */ 3 | /* Distributed under the MIT software license, see the accompanying */ 4 | /* file COPYING or http://www.opensource.org/licenses/mit-license.php */ 5 | /******************************************************************************/ 6 | 7 | #ifndef RT_SCN_TEST04_H 8 | #define RT_SCN_TEST04_H 9 | 10 | #include "format.h" 11 | 12 | #include "all_mat.h" 13 | #include "all_obj.h" 14 | 15 | namespace scn_test04 16 | { 17 | 18 | /******************************************************************************/ 19 | /********************************** BASE **********************************/ 20 | /******************************************************************************/ 21 | 22 | rt_HYPERBOLOID hb_frame01 = 23 | { 24 | { /* RT_I, RT_J, RT_K */ 25 | /* min */ { -RT_INF, -RT_INF, -1.5 }, 26 | /* max */ { +RT_INF, +RT_INF, +1.5 }, 27 | { 28 | /* OUTER RT_U, RT_V */ 29 | /* scl */ { 1.0, 1.0 }, 30 | /* rot */ 0.0 , 31 | /* pos */ { 0.0, 0.0 }, 32 | 33 | /* mat */ &mt_metal01_pink01, 34 | }, 35 | { 36 | /* INNER RT_U, RT_V */ 37 | /* scl */ { 1.0, 1.0 }, 38 | /* rot */ 0.0 , 39 | /* pos */ { 0.0, 0.0 }, 40 | 41 | /* mat */ &mt_plain01_gray02, 42 | }, 43 | }, 44 | /* rat */ 2.5, 45 | /* hyp */ 0.5, 46 | }; 47 | 48 | /******************************************************************************/ 49 | /********************************* CAMERA *********************************/ 50 | /******************************************************************************/ 51 | 52 | rt_OBJECT ob_camera01[] = 53 | { 54 | { 55 | { /* RT_X, RT_Y, RT_Z */ 56 | /* scl */ { 1.0, 1.0, 1.0 }, 57 | /* rot */ { -105.0, 0.0, 0.0 }, 58 | /* pos */ { 0.0, -12.0, 0.0 }, 59 | }, 60 | RT_OBJ_CAMERA(&cm_camera01) 61 | }, 62 | }; 63 | 64 | /******************************************************************************/ 65 | /********************************* LIGHTS *********************************/ 66 | /******************************************************************************/ 67 | 68 | rt_OBJECT ob_light01[] = 69 | { 70 | { 71 | { /* RT_X, RT_Y, RT_Z */ 72 | /* scl */ { 1.0, 1.0, 1.0 }, 73 | /* rot */ { 0.0, 0.0, 0.0 }, 74 | /* pos */ { 0.0, 0.0, 0.0 }, 75 | }, 76 | RT_OBJ_LIGHT(<_light01) 77 | }, 78 | { 79 | { /* RT_X, RT_Y, RT_Z */ 80 | /* scl */ { 1.0, 1.0, 1.0 }, 81 | /* rot */ { 0.0, 0.0, 0.0 }, 82 | /* pos */ { 0.0, 0.0, 0.0 }, 83 | }, 84 | RT_OBJ_SPHERE(&sp_bulb01) 85 | }, 86 | }; 87 | 88 | /******************************************************************************/ 89 | /********************************** TREE **********************************/ 90 | /******************************************************************************/ 91 | 92 | rt_OBJECT ob_tree[] = 93 | { 94 | { 95 | { /* RT_X, RT_Y, RT_Z */ 96 | /* scl */ { 1.0, 1.0, 1.0 }, 97 | /* rot */ { 0.0, 0.0, 0.0 }, 98 | /* pos */ { 0.0, 0.0, 2.0 }, 99 | }, 100 | RT_OBJ_HYPERBOLOID(&hb_frame01) 101 | }, 102 | { 103 | { /* RT_X, RT_Y, RT_Z */ 104 | /* scl */ { 0.5, 0.5, 1.0 }, 105 | /* rot */ { 90.0, 0.0, 0.0 }, 106 | /* pos */ { 0.0, -2.8, 3.8 }, 107 | }, 108 | RT_OBJ_HYPERBOLOID(&hb_frame01) 109 | }, 110 | { 111 | { /* RT_X, RT_Y, RT_Z */ 112 | /* scl */ { 1.0, 1.0, 1.0 }, 113 | /* rot */ { 0.0, 0.0, 0.0 }, 114 | /* pos */ { 0.0, -4.8, 3.3 }, 115 | }, 116 | RT_OBJ_ARRAY(&ob_light01), 117 | }, 118 | { 119 | { /* RT_X, RT_Y, RT_Z */ 120 | /* scl */ { 1.0, 1.0, 1.0 }, 121 | /* rot */ { 0.0, 0.0, 0.0 }, 122 | /* pos */ { 0.0, 0.0, 5.0 }, 123 | }, 124 | RT_OBJ_ARRAY(&ob_camera01) 125 | }, 126 | }; 127 | 128 | rt_RELATION rl_tree[] = 129 | { 130 | { 1, RT_REL_MINUS_OUTER, 0 }, 131 | { 0, RT_REL_MINUS_INNER, 1 }, 132 | }; 133 | 134 | /******************************************************************************/ 135 | /********************************** SCENE *********************************/ 136 | /******************************************************************************/ 137 | 138 | rt_SCENE sc_root = 139 | { 140 | RT_OBJ_ARRAY_REL(&ob_tree, &rl_tree), 141 | /* list of optimizations to be turned off * 142 | * refer to core/engine/format.h for defs */ 143 | RT_OPTS_PT 144 | /* turning off GAMMA|FRESNEL opts in turn * 145 | * enables respective GAMMA|FRESNEL props */ 146 | }; 147 | 148 | } /* namespace scn_test04 */ 149 | 150 | #endif /* RT_SCN_TEST04_H */ 151 | 152 | /******************************************************************************/ 153 | /******************************************************************************/ 154 | /******************************************************************************/ 155 | -------------------------------------------------------------------------------- /test/scenes/scn_test05.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | /* Copyright (c) 2013-2025 VectorChief (at github, bitbucket, sourceforge) */ 3 | /* Distributed under the MIT software license, see the accompanying */ 4 | /* file COPYING or http://www.opensource.org/licenses/mit-license.php */ 5 | /******************************************************************************/ 6 | 7 | #ifndef RT_SCN_TEST05_H 8 | #define RT_SCN_TEST05_H 9 | 10 | #include "format.h" 11 | 12 | #include "all_mat.h" 13 | #include "all_obj.h" 14 | 15 | namespace scn_test05 16 | { 17 | 18 | /******************************************************************************/ 19 | /********************************** BASE **********************************/ 20 | /******************************************************************************/ 21 | 22 | rt_PLANE pl_frame01 = 23 | { 24 | { /* RT_I, RT_J, RT_K */ 25 | /* min */ { -5.0, -5.0, -RT_INF }, 26 | /* max */ { +5.0, +5.0, +RT_INF }, 27 | { 28 | /* OUTER RT_U, RT_V */ 29 | /* scl */ { 2.0, 2.0 }, 30 | /* rot */ 0.0 , 31 | /* pos */ { 0.0, 0.0 }, 32 | 33 | /* mat */ &mt_plain01_tile01, 34 | }, 35 | { 36 | /* INNER RT_U, RT_V */ 37 | /* scl */ { 1.0, 1.0 }, 38 | /* rot */ 0.0 , 39 | /* pos */ { 0.0, 0.0 }, 40 | 41 | /* mat */ &mt_plain01_gray02, 42 | }, 43 | }, 44 | }; 45 | 46 | rt_CYLINDER cl_tube01 = 47 | { 48 | { /* RT_I, RT_J, RT_K */ 49 | /* min */ { -RT_INF, -RT_INF, 0.0 }, 50 | /* max */ { +RT_INF, +RT_INF, +4.5 }, 51 | { 52 | /* OUTER RT_U, RT_V */ 53 | /* scl */ { 1.0, 1.0 }, 54 | /* rot */ 0.0 , 55 | /* pos */ { 0.0, 0.0 }, 56 | 57 | /* mat */ &mt_metal01_pink01, 58 | }, 59 | { 60 | /* INNER RT_U, RT_V */ 61 | /* scl */ { 1.0, 1.0 }, 62 | /* rot */ 0.0 , 63 | /* pos */ { 0.0, 0.0 }, 64 | 65 | /* mat */ &mt_metal01_cyan01, 66 | }, 67 | }, 68 | /* rad */ 1.5, 69 | }; 70 | 71 | /******************************************************************************/ 72 | /********************************* CAMERA *********************************/ 73 | /******************************************************************************/ 74 | 75 | rt_OBJECT ob_camera01[] = 76 | { 77 | { 78 | { /* RT_X, RT_Y, RT_Z */ 79 | /* scl */ { 1.0, 1.0, 1.0 }, 80 | /* rot */ { -90.0, 0.0, 45.0 }, 81 | /* pos */ { 2.0, -2.0, 0.0 }, 82 | }, 83 | RT_OBJ_CAMERA(&cm_camera01) 84 | }, 85 | }; 86 | 87 | /******************************************************************************/ 88 | /********************************* LIGHTS *********************************/ 89 | /******************************************************************************/ 90 | 91 | rt_OBJECT ob_light01[] = 92 | { 93 | { 94 | { /* RT_X, RT_Y, RT_Z */ 95 | /* scl */ { 1.0, 1.0, 1.0 }, 96 | /* rot */ { 0.0, 0.0, 0.0 }, 97 | /* pos */ { 0.0, 0.0, 0.0 }, 98 | }, 99 | RT_OBJ_LIGHT(<_light01) 100 | }, 101 | { 102 | { /* RT_X, RT_Y, RT_Z */ 103 | /* scl */ { 1.0, 1.0, 1.0 }, 104 | /* rot */ { 0.0, 0.0, 0.0 }, 105 | /* pos */ { 0.0, 0.0, 0.0 }, 106 | }, 107 | RT_OBJ_SPHERE(&sp_bulb01) 108 | }, 109 | }; 110 | 111 | /******************************************************************************/ 112 | /********************************** TREE **********************************/ 113 | /******************************************************************************/ 114 | 115 | rt_OBJECT ob_tree[] = 116 | { 117 | { 118 | { /* RT_X, RT_Y, RT_Z */ 119 | /* scl */ { 1.0, 1.0, 1.0 }, 120 | /* rot */ { 90.0, 0.0, 0.0 }, 121 | /* pos */ { 0.0, 0.0, 5.0 }, 122 | }, 123 | RT_OBJ_PLANE(&pl_frame01) 124 | }, 125 | { 126 | { /* RT_X, RT_Y, RT_Z */ 127 | /* scl */ { 0.5, 0.5, 1.0 }, 128 | /* rot */ { -90.0, 0.0, 0.0 }, 129 | /* pos */ { 0.0, -0.5, 5.0 }, 130 | }, 131 | RT_OBJ_CYLINDER(&cl_tube01) 132 | }, 133 | { 134 | { /* RT_X, RT_Y, RT_Z */ 135 | /* scl */ { 1.0, 1.0, 1.0 }, 136 | /* rot */ { 0.0, 0.0, 0.0 }, 137 | /* pos */ { 0.0, -2.8, 3.3 }, 138 | }, 139 | RT_OBJ_ARRAY(&ob_light01), 140 | }, 141 | { 142 | { /* RT_X, RT_Y, RT_Z */ 143 | /* scl */ { 1.0, 1.0, 1.0 }, 144 | /* rot */ { 0.0, 0.0, 0.0 }, 145 | /* pos */ { 0.0, 0.0, 5.0 }, 146 | }, 147 | RT_OBJ_ARRAY(&ob_camera01) 148 | }, 149 | }; 150 | 151 | /******************************************************************************/ 152 | /********************************** SCENE *********************************/ 153 | /******************************************************************************/ 154 | 155 | rt_SCENE sc_root = 156 | { 157 | RT_OBJ_ARRAY(&ob_tree), 158 | /* list of optimizations to be turned off * 159 | * refer to core/engine/format.h for defs */ 160 | RT_OPTS_PT 161 | /* turning off GAMMA|FRESNEL opts in turn * 162 | * enables respective GAMMA|FRESNEL props */ 163 | }; 164 | 165 | } /* namespace scn_test05 */ 166 | 167 | #endif /* RT_SCN_TEST05_H */ 168 | 169 | /******************************************************************************/ 170 | /******************************************************************************/ 171 | /******************************************************************************/ 172 | -------------------------------------------------------------------------------- /test/scenes/scn_test06.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | /* Copyright (c) 2013-2025 VectorChief (at github, bitbucket, sourceforge) */ 3 | /* Distributed under the MIT software license, see the accompanying */ 4 | /* file COPYING or http://www.opensource.org/licenses/mit-license.php */ 5 | /******************************************************************************/ 6 | 7 | #ifndef RT_SCN_TEST06_H 8 | #define RT_SCN_TEST06_H 9 | 10 | #include "format.h" 11 | 12 | #include "all_mat.h" 13 | #include "all_obj.h" 14 | 15 | namespace scn_test06 16 | { 17 | 18 | /******************************************************************************/ 19 | /********************************** BASE **********************************/ 20 | /******************************************************************************/ 21 | 22 | rt_SPHERE sp_frame01 = 23 | { 24 | { /* RT_I, RT_J, RT_K */ 25 | /* min */ { -RT_INF, -0.0, -RT_INF }, 26 | /* max */ { +RT_INF, +RT_INF, +0.0 }, 27 | { 28 | /* OUTER RT_U, RT_V */ 29 | /* scl */ { 1.0, 1.0 }, 30 | /* rot */ 0.0 , 31 | /* pos */ { 0.0, 0.0 }, 32 | 33 | /* mat */ &mt_plain01_gray02, 34 | }, 35 | { 36 | /* INNER RT_U, RT_V */ 37 | /* scl */ { 1.0, 1.0 }, 38 | /* rot */ 0.0 , 39 | /* pos */ { 0.0, 0.0 }, 40 | 41 | /* mat */ &mt_metal01_pink01, 42 | }, 43 | }, 44 | /* rad */ 3.5, 45 | }; 46 | 47 | rt_SPHERE sp_ball01 = 48 | { 49 | { /* RT_I, RT_J, RT_K */ 50 | /* min */ { -RT_INF, -RT_INF, -RT_INF }, 51 | /* max */ { +RT_INF, +RT_INF, +RT_INF }, 52 | { 53 | /* OUTER RT_U, RT_V */ 54 | /* scl */ { 1.0, 1.0 }, 55 | /* rot */ 0.0 , 56 | /* pos */ { 0.0, 0.0 }, 57 | 58 | /* mat */ &mt_plain01_red01, 59 | }, 60 | { 61 | /* INNER RT_U, RT_V */ 62 | /* scl */ { 1.0, 1.0 }, 63 | /* rot */ 0.0 , 64 | /* pos */ { 0.0, 0.0 }, 65 | 66 | /* mat */ &mt_plain01_gray02, 67 | }, 68 | }, 69 | /* rad */ 0.5, 70 | }; 71 | 72 | /******************************************************************************/ 73 | /********************************* CAMERA *********************************/ 74 | /******************************************************************************/ 75 | 76 | rt_OBJECT ob_camera01[] = 77 | { 78 | { 79 | { /* RT_X, RT_Y, RT_Z */ 80 | /* scl */ { 1.0, 1.0, 1.0 }, 81 | /* rot */ { -160.0, 0.0, 90.0 }, 82 | /* pos */ { 2.1, 3.2, 0.0 }, 83 | }, 84 | RT_OBJ_CAMERA(&cm_camera01) 85 | }, 86 | }; 87 | 88 | /******************************************************************************/ 89 | /********************************* LIGHTS *********************************/ 90 | /******************************************************************************/ 91 | 92 | rt_OBJECT ob_light01[] = 93 | { 94 | { 95 | { /* RT_X, RT_Y, RT_Z */ 96 | /* scl */ { 1.0, 1.0, 1.0 }, 97 | /* rot */ { 0.0, 0.0, 0.0 }, 98 | /* pos */ { 0.0, 0.0, 0.0 }, 99 | }, 100 | RT_OBJ_LIGHT(<_light01) 101 | }, 102 | { 103 | { /* RT_X, RT_Y, RT_Z */ 104 | /* scl */ { 1.0, 1.0, 1.0 }, 105 | /* rot */ { 0.0, 0.0, 0.0 }, 106 | /* pos */ { 0.0, 0.0, 0.0 }, 107 | }, 108 | RT_OBJ_SPHERE(&sp_bulb01) 109 | }, 110 | }; 111 | 112 | /******************************************************************************/ 113 | /********************************** TREE **********************************/ 114 | /******************************************************************************/ 115 | 116 | rt_OBJECT ob_tree[] = 117 | { 118 | { 119 | { /* RT_X, RT_Y, RT_Z */ 120 | /* scl */ { 1.0, 1.0, 1.0 }, 121 | /* rot */ { 0.0, 0.0, 0.0 }, 122 | /* pos */ { 0.0, 0.0, 3.5 }, 123 | }, 124 | RT_OBJ_SPHERE(&sp_frame01) 125 | }, 126 | { 127 | { /* RT_X, RT_Y, RT_Z */ 128 | /* scl */ { 3.5, 0.5, 0.5 }, 129 | /* rot */ { 0.0, 0.0, 0.0 }, 130 | /* pos */ { 0.0, +2.8, 1.1 }, 131 | }, 132 | RT_OBJ_SPHERE(&sp_ball01) 133 | }, 134 | { 135 | { /* RT_X, RT_Y, RT_Z */ 136 | /* scl */ { 1.0, 1.0, 1.0 }, 137 | /* rot */ { 0.0, 0.0, 0.0 }, 138 | /* pos */ { 0.0, 0.0, 3.3 }, 139 | }, 140 | RT_OBJ_ARRAY(&ob_light01), 141 | }, 142 | { 143 | { /* RT_X, RT_Y, RT_Z */ 144 | /* scl */ { 1.0, 1.0, 1.0 }, 145 | /* rot */ { 0.0, 0.0, 0.0 }, 146 | /* pos */ { 0.0, 0.0, 5.0 }, 147 | }, 148 | RT_OBJ_ARRAY(&ob_camera01) 149 | }, 150 | }; 151 | 152 | /******************************************************************************/ 153 | /********************************** SCENE *********************************/ 154 | /******************************************************************************/ 155 | 156 | rt_SCENE sc_root = 157 | { 158 | RT_OBJ_ARRAY(&ob_tree), 159 | /* list of optimizations to be turned off * 160 | * refer to core/engine/format.h for defs */ 161 | RT_OPTS_PT 162 | /* turning off GAMMA|FRESNEL opts in turn * 163 | * enables respective GAMMA|FRESNEL props */ 164 | }; 165 | 166 | } /* namespace scn_test06 */ 167 | 168 | #endif /* RT_SCN_TEST06_H */ 169 | 170 | /******************************************************************************/ 171 | /******************************************************************************/ 172 | /******************************************************************************/ 173 | -------------------------------------------------------------------------------- /test/scenes/scn_test07.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | /* Copyright (c) 2013-2025 VectorChief (at github, bitbucket, sourceforge) */ 3 | /* Distributed under the MIT software license, see the accompanying */ 4 | /* file COPYING or http://www.opensource.org/licenses/mit-license.php */ 5 | /******************************************************************************/ 6 | 7 | #ifndef RT_SCN_TEST07_H 8 | #define RT_SCN_TEST07_H 9 | 10 | #include "format.h" 11 | 12 | #include "all_mat.h" 13 | #include "all_obj.h" 14 | 15 | namespace scn_test07 16 | { 17 | 18 | /******************************************************************************/ 19 | /********************************** BASE **********************************/ 20 | /******************************************************************************/ 21 | 22 | rt_PLANE pl_frame01 = 23 | { 24 | { /* RT_I, RT_J, RT_K */ 25 | /* min */ { -RT_INF, -5.0, -RT_INF }, 26 | /* max */ { +RT_INF, +5.0, +RT_INF }, 27 | { 28 | /* OUTER RT_U, RT_V */ 29 | /* scl */ { 1.0, 1.0 }, 30 | /* rot */ 0.0 , 31 | /* pos */ { 0.0, 0.0 }, 32 | 33 | /* mat */ &mt_metal01_cyan01, 34 | }, 35 | { 36 | /* INNER RT_U, RT_V */ 37 | /* scl */ { 1.0, 1.0 }, 38 | /* rot */ 0.0 , 39 | /* pos */ { 0.0, 0.0 }, 40 | 41 | /* mat */ &mt_plain01_gray02, 42 | }, 43 | }, 44 | }; 45 | 46 | rt_CYLINDER cl_tube01 = 47 | { 48 | { /* RT_I, RT_J, RT_K */ 49 | /* min */ { -RT_INF, -RT_INF, -RT_INF, }, 50 | /* max */ { +RT_INF, +RT_INF, +RT_INF, }, 51 | { 52 | /* OUTER RT_U, RT_V */ 53 | /* scl */ { 1.0, 1.0 }, 54 | /* rot */ 0.0 , 55 | /* pos */ { 0.0, 0.0 }, 56 | 57 | /* mat */ &mt_metal01_pink01, 58 | }, 59 | { 60 | /* INNER RT_U, RT_V */ 61 | /* scl */ { 1.0, 1.0 }, 62 | /* rot */ 0.0 , 63 | /* pos */ { 0.0, 0.0 }, 64 | 65 | /* mat */ &mt_plain01_gray02, 66 | }, 67 | }, 68 | /* rad */ 1.5, 69 | }; 70 | 71 | /******************************************************************************/ 72 | /********************************* CAMERA *********************************/ 73 | /******************************************************************************/ 74 | 75 | rt_OBJECT ob_camera01[] = 76 | { 77 | { 78 | { /* RT_X, RT_Y, RT_Z */ 79 | /* scl */ { 1.0, 1.0, 1.0 }, 80 | /* rot */ { -90.0, 0.0, -40.0 }, 81 | /* pos */ { -11.0, -11.0, 0.0 }, 82 | }, 83 | RT_OBJ_CAMERA(&cm_camera01) 84 | }, 85 | }; 86 | 87 | /******************************************************************************/ 88 | /********************************* LIGHTS *********************************/ 89 | /******************************************************************************/ 90 | 91 | rt_OBJECT ob_light01[] = 92 | { 93 | { 94 | { /* RT_X, RT_Y, RT_Z */ 95 | /* scl */ { 1.0, 1.0, 1.0 }, 96 | /* rot */ { 0.0, 0.0, 0.0 }, 97 | /* pos */ { 0.0, 0.0, 0.0 }, 98 | }, 99 | RT_OBJ_LIGHT(<_light01) 100 | }, 101 | { 102 | { /* RT_X, RT_Y, RT_Z */ 103 | /* scl */ { 1.0, 1.0, 1.0 }, 104 | /* rot */ { 0.0, 0.0, 0.0 }, 105 | /* pos */ { 0.0, 0.0, 0.0 }, 106 | }, 107 | RT_OBJ_SPHERE(&sp_bulb01) 108 | }, 109 | }; 110 | 111 | /******************************************************************************/ 112 | /********************************** TREE **********************************/ 113 | /******************************************************************************/ 114 | 115 | rt_OBJECT ob_tree[] = 116 | { 117 | { 118 | { /* RT_X, RT_Y, RT_Z */ 119 | /* scl */ { 1.0, 1.0, 1.0 }, 120 | /* rot */ { 90.0, 0.0, 0.0 }, 121 | /* pos */ { 0.0, +2.0, 5.0 }, 122 | }, 123 | RT_OBJ_PLANE(&pl_frame01) 124 | }, 125 | { 126 | { /* RT_X, RT_Y, RT_Z */ 127 | /* scl */ { 0.5, 0.5, 1.0 }, 128 | /* rot */ { 0.0, 0.0, 0.0 }, 129 | /* pos */ { 0.0, -2.0, 5.0 }, 130 | }, 131 | RT_OBJ_CYLINDER(&cl_tube01) 132 | }, 133 | { 134 | { /* RT_X, RT_Y, RT_Z */ 135 | /* scl */ { 1.0, 1.0, 1.0 }, 136 | /* rot */ { 0.0, 0.0, 0.0 }, 137 | /* pos */ { -1.0, -6.0, 5.0 }, 138 | }, 139 | RT_OBJ_ARRAY(&ob_light01), 140 | }, 141 | { 142 | { /* RT_X, RT_Y, RT_Z */ 143 | /* scl */ { 1.0, 1.0, 1.0 }, 144 | /* rot */ { 0.0, 0.0, 0.0 }, 145 | /* pos */ { 0.0, 0.0, 5.0 }, 146 | }, 147 | RT_OBJ_ARRAY(&ob_camera01) 148 | }, 149 | }; 150 | 151 | /******************************************************************************/ 152 | /********************************** SCENE *********************************/ 153 | /******************************************************************************/ 154 | 155 | rt_SCENE sc_root = 156 | { 157 | RT_OBJ_ARRAY(&ob_tree), 158 | /* list of optimizations to be turned off * 159 | * refer to core/engine/format.h for defs */ 160 | RT_OPTS_PT 161 | /* turning off GAMMA|FRESNEL opts in turn * 162 | * enables respective GAMMA|FRESNEL props */ 163 | }; 164 | 165 | } /* namespace scn_test07 */ 166 | 167 | #endif /* RT_SCN_TEST07_H */ 168 | 169 | /******************************************************************************/ 170 | /******************************************************************************/ 171 | /******************************************************************************/ 172 | -------------------------------------------------------------------------------- /test/scenes/scn_test08.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | /* Copyright (c) 2013-2025 VectorChief (at github, bitbucket, sourceforge) */ 3 | /* Distributed under the MIT software license, see the accompanying */ 4 | /* file COPYING or http://www.opensource.org/licenses/mit-license.php */ 5 | /******************************************************************************/ 6 | 7 | #ifndef RT_SCN_TEST08_H 8 | #define RT_SCN_TEST08_H 9 | 10 | #include "format.h" 11 | 12 | #include "all_mat.h" 13 | #include "all_obj.h" 14 | 15 | namespace scn_test08 16 | { 17 | 18 | /******************************************************************************/ 19 | /********************************** BASE **********************************/ 20 | /******************************************************************************/ 21 | 22 | rt_SPHERE sp_frame01 = 23 | { 24 | { /* RT_I, RT_J, RT_K */ 25 | /* min */ { -RT_INF, -0.0, -RT_INF }, 26 | /* max */ { +RT_INF, +RT_INF, +RT_INF }, 27 | { 28 | /* OUTER RT_U, RT_V */ 29 | /* scl */ { 1.0, 1.0 }, 30 | /* rot */ 0.0 , 31 | /* pos */ { 0.0, 0.0 }, 32 | 33 | /* mat */ &mt_plain01_red01, 34 | }, 35 | { 36 | /* INNER RT_U, RT_V */ 37 | /* scl */ { 1.0, 1.0 }, 38 | /* rot */ 0.0 , 39 | /* pos */ { 0.0, 0.0 }, 40 | 41 | /* mat */ &mt_metal01_cyan01, 42 | }, 43 | }, 44 | /* rad */ 3.5, 45 | }; 46 | 47 | /******************************************************************************/ 48 | /********************************* CAMERA *********************************/ 49 | /******************************************************************************/ 50 | 51 | rt_OBJECT ob_camera01[] = 52 | { 53 | { 54 | { /* RT_X, RT_Y, RT_Z */ 55 | /* scl */ { 1.0, 1.0, 1.0 }, 56 | /* rot */ { -90.0, 0.0, 0.0 }, 57 | /* pos */ { 0.0, -10.0, 0.0 }, 58 | }, 59 | RT_OBJ_CAMERA(&cm_camera01) 60 | }, 61 | }; 62 | 63 | /******************************************************************************/ 64 | /********************************* LIGHTS *********************************/ 65 | /******************************************************************************/ 66 | 67 | rt_OBJECT ob_light01[] = 68 | { 69 | { 70 | { /* RT_X, RT_Y, RT_Z */ 71 | /* scl */ { 1.0, 1.0, 1.0 }, 72 | /* rot */ { 0.0, 0.0, 0.0 }, 73 | /* pos */ { 0.0, 0.0, 0.0 }, 74 | }, 75 | RT_OBJ_LIGHT(<_light01) 76 | }, 77 | { 78 | { /* RT_X, RT_Y, RT_Z */ 79 | /* scl */ { 1.0, 1.0, 1.0 }, 80 | /* rot */ { 0.0, 0.0, 0.0 }, 81 | /* pos */ { 0.0, 0.0, 0.0 }, 82 | }, 83 | RT_OBJ_SPHERE(&sp_bulb01) 84 | }, 85 | }; 86 | 87 | /******************************************************************************/ 88 | /********************************** TREE **********************************/ 89 | /******************************************************************************/ 90 | 91 | rt_OBJECT ob_tree[] = 92 | { 93 | { 94 | { /* RT_X, RT_Y, RT_Z */ 95 | /* scl */ { 1.0, 1.0, 1.0 }, 96 | /* rot */ { 0.0, 0.0, 0.0 }, 97 | /* pos */ { 0.0, -3.3, 5.0 }, 98 | }, 99 | RT_OBJ_SPHERE(&sp_frame01) 100 | }, 101 | { 102 | { /* RT_X, RT_Y, RT_Z */ 103 | /* scl */ { 1.0, 1.0, 1.0 }, 104 | /* rot */ { 180.0, 0.0, 0.0 }, 105 | /* pos */ { 0.0, +3.3, 5.0 }, 106 | }, 107 | RT_OBJ_SPHERE(&sp_frame01) 108 | }, 109 | { 110 | { /* RT_X, RT_Y, RT_Z */ 111 | /* scl */ { 1.0, 1.0, 1.0 }, 112 | /* rot */ { 0.0, 0.0, 0.0 }, 113 | /* pos */ { 0.0, -3.3, 5.0 }, 114 | }, 115 | RT_OBJ_ARRAY(&ob_light01), 116 | }, 117 | { 118 | { /* RT_X, RT_Y, RT_Z */ 119 | /* scl */ { 1.0, 1.0, 1.0 }, 120 | /* rot */ { 0.0, 0.0, 0.0 }, 121 | /* pos */ { 0.0, 0.0, 5.0 }, 122 | }, 123 | RT_OBJ_ARRAY(&ob_camera01) 124 | }, 125 | }; 126 | 127 | /******************************************************************************/ 128 | /********************************** SCENE *********************************/ 129 | /******************************************************************************/ 130 | 131 | rt_SCENE sc_root = 132 | { 133 | RT_OBJ_ARRAY(&ob_tree), 134 | /* list of optimizations to be turned off * 135 | * refer to core/engine/format.h for defs */ 136 | RT_OPTS_PT | RT_OPTS_INSERT 137 | /* turning off GAMMA|FRESNEL opts in turn * 138 | * enables respective GAMMA|FRESNEL props */ 139 | }; 140 | 141 | } /* namespace scn_test08 */ 142 | 143 | #endif /* RT_SCN_TEST08_H */ 144 | 145 | /******************************************************************************/ 146 | /******************************************************************************/ 147 | /******************************************************************************/ 148 | -------------------------------------------------------------------------------- /test/simd_make_a32.mk: -------------------------------------------------------------------------------- 1 | 2 | INC_PATH = \ 3 | -I../core/config/ 4 | 5 | SRC_LIST = \ 6 | simd_test.cpp 7 | 8 | LIB_PATH = 9 | 10 | LIB_LIST = \ 11 | -lm 12 | 13 | 14 | build: simd_test_a32 15 | 16 | strip: 17 | aarch64-linux-gnu-strip simd_test.a32* 18 | 19 | clean: 20 | rm simd_test.a32* 21 | 22 | 23 | simd_test_a32: 24 | aarch64-linux-gnu-g++ -O3 -g -static -mabi=ilp32 \ 25 | -DRT_LINUX -DRT_A32 -DRT_128=1 -DRT_DEBUG=0 \ 26 | -DRT_POINTER=32 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=0 \ 27 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o simd_test.a32 28 | 29 | 30 | # On Ubuntu (MATE) 16.04-22.04 add "universe multiverse" to "main restricted" 31 | # in /etc/apt/sources.list (sudo nano /etc/apt/sources.list) then run: 32 | # sudo apt-get update 33 | # (Ubuntu MATE is set up for an update without a need to edit the file) 34 | # (extended repositories "universe multiverse" are only needed for clang) 35 | # 36 | # Prerequisites for the build: 37 | # (cross-)compiler for AArch64 is installed and in the PATH variable. 38 | # sudo apt-get install make g++-aarch64-linux-gnu 39 | # (recent upstream g++-5-aarch64 series may not fully support ILP32 ABI) 40 | # 41 | # Compiling/running SIMD test: 42 | # make -f simd_make_a32.mk 43 | 44 | # Clang native build should theoretically work too (not tested), use (replace): 45 | # clang++ (in place of ...-g++) on AArch64 host (Raspberry Pi 3/4) 46 | # sudo apt-get install clang 47 | 48 | # For interpretation of SIMD build flags check compatibility layer in rtzero.h. 49 | # The 128-bit 15-reg targets are supported for compatibility with x86/POWER. 50 | 51 | # For 128-bit NEON build use (replace): RT_128=1 (30 SIMD registers) 52 | # For 128-bit ARMv8.2 build use (replace): RT_128=2 (adds new fp16 ops) (30 rs) 53 | # For 128-bit NEON build use (replace): RT_128=4 (15 SIMD registers) 54 | # For 128-bit ARMv8.2 build use (replace): RT_128=8 (adds new fp16 ops) (15 rs) 55 | # For 256-bit NEON build use (replace): RT_256=1 (15 SIMD reg-pairs) 56 | # For 256-bit ARMv8.2 build use (replace): RT_256=2 (adds new fp16 ops) (15 rp) 57 | 58 | # For 256-bit SVEx1 build use (replace): RT_256=4 (30 SIMD registers) 59 | # For 512-bit SVEx2 build use (replace): RT_512=1 (15 SIMD reg-pairs) 60 | # For 512-bit SVEx1 build use (replace): RT_512=4 (30 SIMD registers) 61 | # For 1024-bit SVEx2 build use (replace): RT_1K4=1 (15 SIMD reg-pairs) 62 | # For 1024-bit SVEx1 build use (replace): RT_1K4=4 (30 SIMD registers) 63 | # For 2048-bit SVEx2 build use (replace): RT_2K8_R8=1 (8 SIMD reg-pairs) 64 | # For 2048-bit SVEx1 build use (replace): RT_2K8_R8=4 (15 SIMD registers) 65 | # The last two slots are artificially reg-limited for compatibility with AVX512 66 | 67 | # 32-bit ABI hasn't been fully tested yet due to lack of available libs, 68 | # check out 64/32-bit (ptr/adr) hybrid mode for 64-bit ABI in simd_make_a64.mk 69 | -------------------------------------------------------------------------------- /test/simd_make_arm.mk: -------------------------------------------------------------------------------- 1 | 2 | INC_PATH = \ 3 | -I../core/config/ 4 | 5 | SRC_LIST = \ 6 | simd_test.cpp 7 | 8 | LIB_PATH = 9 | 10 | LIB_LIST = \ 11 | -lm 12 | 13 | 14 | build: simd_test_arm_v1 simd_test_arm_v2 15 | 16 | strip: 17 | arm-linux-gnueabi-strip simd_test.arm_v* 18 | 19 | clean: 20 | rm simd_test.arm_v* 21 | 22 | 23 | simd_test_arm_v1: 24 | arm-linux-gnueabi-g++ -O3 -g -static -march=armv7-a -marm \ 25 | -DRT_LINUX -DRT_ARM -DRT_128=1 -DRT_DEBUG=0 \ 26 | -DRT_POINTER=32 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=0 \ 27 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o simd_test.arm_v1 28 | 29 | simd_test_arm_v2: 30 | arm-linux-gnueabi-g++ -O3 -g -static -march=armv7-a -marm \ 31 | -DRT_LINUX -DRT_ARM -DRT_128=2 -DRT_DEBUG=0 \ 32 | -DRT_POINTER=32 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=0 \ 33 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o simd_test.arm_v2 34 | 35 | 36 | build_n900: simd_test_arm_n900 37 | 38 | strip_n900: 39 | arm-linux-gnueabi-strip simd_test.arm_n900* 40 | 41 | clean_n900: 42 | rm simd_test.arm_n900* 43 | 44 | 45 | simd_test_arm_n900: 46 | arm-linux-gnueabi-g++ -O3 -g -static -march=armv7-a -marm \ 47 | -DRT_LINUX -DRT_ARM -DRT_128=1 -DRT_DEBUG=0 \ 48 | -DRT_POINTER=32 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=0 \ 49 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o simd_test.arm_n900 50 | 51 | 52 | build_rpiX: simd_test_arm_rpi2 simd_test_arm_rpi3 53 | 54 | strip_rpiX: 55 | arm-linux-gnueabihf-strip simd_test.arm_rpi* 56 | 57 | clean_rpiX: 58 | rm simd_test.arm_rpi* 59 | 60 | 61 | simd_test_arm_rpi2: 62 | arm-linux-gnueabihf-g++ -O3 -g -static -march=armv7-a -marm \ 63 | -DRT_LINUX -DRT_ARM -DRT_128=2 -DRT_DEBUG=0 \ 64 | -DRT_POINTER=32 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=0 \ 65 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o simd_test.arm_rpi2 66 | 67 | simd_test_arm_rpi3: 68 | arm-linux-gnueabihf-g++ -O3 -g -static -march=armv7-a -marm \ 69 | -DRT_LINUX -DRT_ARM -DRT_128=4 -DRT_DEBUG=0 \ 70 | -DRT_POINTER=32 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=0 \ 71 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o simd_test.arm_rpi3 72 | 73 | 74 | # On Ubuntu (MATE) 16.04-22.04 add "universe multiverse" to "main restricted" 75 | # in /etc/apt/sources.list (sudo nano /etc/apt/sources.list) then run: 76 | # sudo apt-get update 77 | # (Ubuntu MATE is set up for an update without a need to edit the file) 78 | # (extended repositories "universe multiverse" are only needed for clang) 79 | # 80 | # Prerequisites for the build: 81 | # (cross-)compiler for ARMv7 is installed and in the PATH variable. 82 | # sudo apt-get install make g++-arm-linux-gnueabi 83 | # 84 | # Prerequisites for emulation: 85 | # recent QEMU(-2.5) is installed or built from source and in the PATH variable. 86 | # sudo apt-get install qemu-user 87 | # 88 | # Compiling/running SIMD test: 89 | # make -f simd_make_arm.mk 90 | # qemu-arm -cpu cortex-a8 simd_test.arm_v1 -c 1 91 | # qemu-arm -cpu cortex-a15 simd_test.arm_v2 -c 1 92 | # Use "-c 1" option to reduce test time when emulating with QEMU 93 | 94 | # Clang native build works too (takes much longer prior to 3.8), use (replace): 95 | # clang++ (in place of ...-g++) on ARMv7 host (Raspberry Pi 2) 96 | # sudo apt-get install clang 97 | 98 | # For interpretation of SIMD build flags check compatibility layer in rtzero.h. 99 | # Original legacy 32-bit ARMv7/x86 targets only support 8 SIMD registers. 100 | 101 | # 1) Nokia N900, Maemo 5 scratchbox: "vanilla" (-DRT_128=1) (8 SIMD registers) 102 | # 2) Raspberry Pi 2, Raspbian: arm-linux-gnueabihf-g++ -DRT_128=2 (8 SIMD regs) 103 | # 3) Raspberry Pi 3, Raspbian: arm-linux-gnueabihf-g++ -DRT_128=4 (8 SIMD regs) 104 | -------------------------------------------------------------------------------- /test/simd_make_m32.mk: -------------------------------------------------------------------------------- 1 | 2 | INC_PATH = \ 3 | -I../core/config/ 4 | 5 | SRC_LIST = \ 6 | simd_test.cpp 7 | 8 | LIB_PATH = 9 | 10 | LIB_LIST = \ 11 | -lm 12 | 13 | 14 | build: simd_test_m32Lr5 simd_test_m32Br5 15 | 16 | strip: 17 | mips-mti-linux-gnu-strip simd_test.m32?r5* 18 | 19 | clean: 20 | rm simd_test.m32* 21 | 22 | 23 | simd_test_m32Lr5: 24 | mips-mti-linux-gnu-g++ -O3 -g -static -EL -mips32r5 -mmsa -mnan=2008 \ 25 | -DRT_LINUX -DRT_M32 -DRT_128=1 -DRT_DEBUG=0 \ 26 | -DRT_POINTER=32 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=0 \ 27 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o simd_test.m32Lr5 28 | 29 | simd_test_m32Br5: 30 | mips-mti-linux-gnu-g++ -O3 -g -static -EB -mips32r5 -mmsa -mnan=2008 \ 31 | -DRT_LINUX -DRT_M32 -DRT_128=1 -DRT_DEBUG=0 \ 32 | -DRT_POINTER=32 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=1 \ 33 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o simd_test.m32Br5 34 | 35 | 36 | # On Ubuntu (MATE) 16.04-22.04 add "universe multiverse" to "main restricted" 37 | # in /etc/apt/sources.list (sudo nano /etc/apt/sources.list) then run: 38 | # sudo apt-get update 39 | # (Ubuntu MATE is set up for an update without a need to edit the file) 40 | # (extended repositories "universe multiverse" are only needed for clang) 41 | # 42 | # Download and unpack MIPS toolchain: 43 | # https://codescape.mips.com/components/toolchain/2020.06-01/downloads.html 44 | # 45 | # Prerequisites for the build: 46 | # (cross-)compiler for MIPSr5+MSA is installed and in the PATH variable. 47 | # Codescape.GNU.Tools.Package.2020.06-01.for.MIPS.MTI.Linux.CentOS-6.x86_64 48 | # is unpacked and folder mips-mti-linux-gnu/2020.06-01/bin is added to PATH: 49 | # PATH=/home/ubuntu/Downloads/mips-mti-linux-gnu/2020.06-01/bin:$PATH 50 | # PATH=/home/ubuntu-mate/Downloads/mips-mti-linux-gnu/2020.06-01/bin:$PATH 51 | # 52 | # Prerequisites for emulation: 53 | # recent QEMU(-2.5) is installed or built from source and in the PATH variable. 54 | # standalone toolchain from 2020.06-01 comes with QEMU 4.1.0 for MIPS in PATH. 55 | # sudo apt-get install qemu-user make 56 | # 57 | # Compiling/running SIMD test: 58 | # make -f simd_make_m32.mk 59 | # qemu-mipsel -cpu P5600 simd_test.m32Lr5 -c 1 60 | # qemu-mips -cpu P5600 simd_test.m32Br5 -c 1 61 | # Use "-c 1" option to reduce test time when emulating with QEMU 62 | 63 | # Clang native build should theoretically work too (not tested), use (replace): 64 | # clang++ -O0 (in place of ...-g++ -O3) on MIPS32r5 host (P5600) 65 | # sudo apt-get install clang 66 | 67 | # For interpretation of SIMD build flags check compatibility layer in rtzero.h. 68 | # The 128-bit 15-reg targets are supported for compatibility with x86/POWER. 69 | 70 | # For 128-bit SIMD build use (replace): RT_128=1 (30 SIMD registers) 71 | # For 128-bit SIMD build use (replace): RT_128=4 (15 SIMD registers) 72 | # For 256-bit SIMD build use (replace): RT_256=1 (15 SIMD reg-pairs) 73 | -------------------------------------------------------------------------------- /test/simd_make_m64.mk: -------------------------------------------------------------------------------- 1 | 2 | INC_PATH = \ 3 | -I../core/config/ 4 | 5 | SRC_LIST = \ 6 | simd_test.cpp 7 | 8 | LIB_PATH = 9 | 10 | LIB_LIST = \ 11 | -lm 12 | 13 | 14 | build: build_le build_be 15 | 16 | strip: 17 | mips-mti-linux-gnu-strip simd_test.m64???Lr6 18 | mips-mti-linux-gnu-strip simd_test.m64???Br6 19 | 20 | clean: 21 | rm simd_test.m64* 22 | 23 | 24 | build_le: simd_test_m64_32Lr6 simd_test_m64_64Lr6 \ 25 | simd_test_m64f32Lr6 simd_test_m64f64Lr6 26 | 27 | simd_test_m64_32Lr6: 28 | mips-mti-linux-gnu-g++ -O3 -g -static -EL -mips64r6 -mmsa -mabi=64 \ 29 | -DRT_LINUX -DRT_M64=6 -DRT_128=1 -DRT_DEBUG=0 \ 30 | -DRT_POINTER=64 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=0 \ 31 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o simd_test.m64_32Lr6 32 | 33 | simd_test_m64_64Lr6: 34 | mips-mti-linux-gnu-g++ -O3 -g -static -EL -mips64r6 -mmsa -mabi=64 \ 35 | -DRT_LINUX -DRT_M64=6 -DRT_128=1 -DRT_DEBUG=0 \ 36 | -DRT_POINTER=64 -DRT_ADDRESS=32 -DRT_ELEMENT=64 -DRT_ENDIAN=0 \ 37 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o simd_test.m64_64Lr6 38 | 39 | simd_test_m64f32Lr6: 40 | mips-mti-linux-gnu-g++ -O3 -g -static -EL -mips64r6 -mmsa -mabi=64 \ 41 | -DRT_LINUX -DRT_M64=6 -DRT_256=1 -DRT_DEBUG=0 \ 42 | -DRT_POINTER=64 -DRT_ADDRESS=64 -DRT_ELEMENT=32 -DRT_ENDIAN=0 \ 43 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o simd_test.m64f32Lr6 44 | 45 | simd_test_m64f64Lr6: 46 | mips-mti-linux-gnu-g++ -O3 -g -static -EL -mips64r6 -mmsa -mabi=64 \ 47 | -DRT_LINUX -DRT_M64=6 -DRT_256=1 -DRT_DEBUG=0 \ 48 | -DRT_POINTER=64 -DRT_ADDRESS=64 -DRT_ELEMENT=64 -DRT_ENDIAN=0 \ 49 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o simd_test.m64f64Lr6 50 | 51 | 52 | build_be: simd_test_m64_32Br6 simd_test_m64_64Br6 \ 53 | simd_test_m64f32Br6 simd_test_m64f64Br6 54 | 55 | simd_test_m64_32Br6: 56 | mips-mti-linux-gnu-g++ -O3 -g -static -EB -mips64r6 -mmsa -mabi=64 \ 57 | -DRT_LINUX -DRT_M64=6 -DRT_128=1 -DRT_DEBUG=0 \ 58 | -DRT_POINTER=64 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=1 \ 59 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o simd_test.m64_32Br6 60 | 61 | simd_test_m64_64Br6: 62 | mips-mti-linux-gnu-g++ -O3 -g -static -EB -mips64r6 -mmsa -mabi=64 \ 63 | -DRT_LINUX -DRT_M64=6 -DRT_128=1 -DRT_DEBUG=0 \ 64 | -DRT_POINTER=64 -DRT_ADDRESS=32 -DRT_ELEMENT=64 -DRT_ENDIAN=1 \ 65 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o simd_test.m64_64Br6 66 | 67 | simd_test_m64f32Br6: 68 | mips-mti-linux-gnu-g++ -O3 -g -static -EB -mips64r6 -mmsa -mabi=64 \ 69 | -DRT_LINUX -DRT_M64=6 -DRT_256=1 -DRT_DEBUG=0 \ 70 | -DRT_POINTER=64 -DRT_ADDRESS=64 -DRT_ELEMENT=32 -DRT_ENDIAN=1 \ 71 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o simd_test.m64f32Br6 72 | 73 | simd_test_m64f64Br6: 74 | mips-mti-linux-gnu-g++ -O3 -g -static -EB -mips64r6 -mmsa -mabi=64 \ 75 | -DRT_LINUX -DRT_M64=6 -DRT_256=1 -DRT_DEBUG=0 \ 76 | -DRT_POINTER=64 -DRT_ADDRESS=64 -DRT_ELEMENT=64 -DRT_ENDIAN=1 \ 77 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o simd_test.m64f64Br6 78 | 79 | 80 | # On Ubuntu (MATE) 16.04-22.04 add "universe multiverse" to "main restricted" 81 | # in /etc/apt/sources.list (sudo nano /etc/apt/sources.list) then run: 82 | # sudo apt-get update 83 | # (Ubuntu MATE is set up for an update without a need to edit the file) 84 | # (extended repositories "universe multiverse" are only needed for clang) 85 | # 86 | # Download and unpack MIPS toolchain: 87 | # https://codescape.mips.com/components/toolchain/2020.06-01/downloads.html 88 | # 89 | # Prerequisites for the build: 90 | # (cross-)compiler for MIPSr6+MSA is installed and in the PATH variable. 91 | # Codescape.GNU.Tools.Package.2020.06-01.for.MIPS.MTI.Linux.CentOS-6.x86_64 92 | # is unpacked and folder mips-mti-linux-gnu/2020.06-01/bin is added to PATH: 93 | # PATH=/home/ubuntu/Downloads/mips-mti-linux-gnu/2020.06-01/bin:$PATH 94 | # PATH=/home/ubuntu-mate/Downloads/mips-mti-linux-gnu/2020.06-01/bin:$PATH 95 | # 96 | # Starting from Ubuntu (MATE) 19.10 upstream (cross-)compiler supports MSA. 97 | # sudo apt-get install make g++-mipsisa64r6el-linux-gnuabi64 98 | # sudo apt-get install make g++-mipsisa64r6-linux-gnuabi64 99 | # (replace mips-mti-linux-gnu with mipsisa64r6el-linux-gnuabi64 for LE) 100 | # (replace mips-mti-linux-gnu with mipsisa64r6-linux-gnuabi64 for BE) 101 | # 102 | # Prerequisites for emulation: 103 | # recent QEMU(-2.7) is installed or built from source and in the PATH variable. 104 | # standalone toolchain from 2020.06-01 comes with QEMU 4.1.0 for MIPS in PATH. 105 | # sudo apt-get install qemu-user make 106 | # 107 | # Compiling/running SIMD test: 108 | # make -f simd_make_m64.mk 109 | # qemu-mips64el -cpu I6400 simd_test.m64_32Lr6 -c 1 110 | # qemu-mips64el -cpu I6400 simd_test.m64_64Lr6 -c 1 111 | # qemu-mips64el -cpu I6400 simd_test.m64f32Lr6 -c 1 112 | # qemu-mips64el -cpu I6400 simd_test.m64f64Lr6 -c 1 113 | # qemu-mips64 -cpu I6400 simd_test.m64_32Br6 -c 1 114 | # qemu-mips64 -cpu I6400 simd_test.m64_64Br6 -c 1 115 | # qemu-mips64 -cpu I6400 simd_test.m64f32Br6 -c 1 116 | # qemu-mips64 -cpu I6400 simd_test.m64f64Br6 -c 1 117 | # Use "-c 1" option to reduce test time when emulating with QEMU 118 | 119 | # Clang native build should theoretically work too (not tested), use (replace): 120 | # clang++ -O0 (in place of ...-g++ -O3) on MIPS64r6 host (I6400/P6600) 121 | # sudo apt-get install clang 122 | 123 | # For interpretation of SIMD build flags check compatibility layer in rtzero.h. 124 | # The 128-bit 15-reg targets are supported for compatibility with x86/POWER. 125 | 126 | # For 128-bit SIMD build use (replace): RT_128=1 (30 SIMD registers) 127 | # For 128-bit SIMD build use (replace): RT_128=4 (15 SIMD registers) 128 | # For 256-bit SIMD build use (replace): RT_256=1 (15 SIMD reg-pairs) 129 | 130 | # 64/32-bit (ptr/adr) hybrid mode is compatible with native 64-bit ABI, 131 | # use (replace): RT_ADDRESS=32, rename the binary to simd_test.m64_** 132 | # 64-bit packed SIMD mode (fp64/int64) is supported on 64-bit targets, 133 | # use (replace): RT_ELEMENT=64, rename the binary to simd_test.m64*64 134 | -------------------------------------------------------------------------------- /test/simd_make_p32.mk: -------------------------------------------------------------------------------- 1 | 2 | INC_PATH = \ 3 | -I../core/config/ 4 | 5 | SRC_LIST = \ 6 | simd_test.cpp 7 | 8 | LIB_PATH = 9 | 10 | LIB_LIST = \ 11 | -lm 12 | 13 | 14 | build: simd_test_p32Bg4 simd_test_p32Bp7 simd_test_p32Bp8 simd_test_p32Bp9 15 | 16 | strip: 17 | powerpc-linux-gnu-strip simd_test.p32* 18 | 19 | clean: 20 | rm simd_test.p32* 21 | 22 | 23 | simd_test_p32Bg4: 24 | powerpc-linux-gnu-g++ -O3 -g -static -DRT_SIMD_COMPAT_VSX=0 \ 25 | -DRT_LINUX -DRT_P32 -DRT_128=4 -DRT_DEBUG=0 \ 26 | -DRT_POINTER=32 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=1 \ 27 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o simd_test.p32Bg4 28 | 29 | simd_test_p32Bp7: 30 | powerpc-linux-gnu-g++ -O3 -g -static \ 31 | -DRT_LINUX -DRT_P32 -DRT_128=1 -DRT_DEBUG=0 \ 32 | -DRT_POINTER=32 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=1 \ 33 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o simd_test.p32Bp7 34 | 35 | simd_test_p32Bp8: 36 | powerpc-linux-gnu-g++ -O3 -g -static -DRT_SIMD_COMPAT_PW8=1 \ 37 | -DRT_LINUX -DRT_P32 -DRT_128=1 -DRT_DEBUG=0 \ 38 | -DRT_POINTER=32 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=1 \ 39 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o simd_test.p32Bp8 40 | 41 | simd_test_p32Bp9: 42 | powerpc-linux-gnu-g++ -O3 -g -static \ 43 | -DRT_LINUX -DRT_P32 -DRT_128=2 -DRT_DEBUG=0 \ 44 | -DRT_POINTER=32 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=1 \ 45 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o simd_test.p32Bp9 46 | 47 | 48 | # On Ubuntu (MATE) 16.04-22.04 add "universe multiverse" to "main restricted" 49 | # in /etc/apt/sources.list (sudo nano /etc/apt/sources.list) then run: 50 | # sudo apt-get update 51 | # (Ubuntu MATE is set up for an update without a need to edit the file) 52 | # (extended repositories "universe multiverse" are only needed for clang) 53 | # 54 | # Prerequisites for the build: 55 | # (cross-)compiler for PowerPC is installed and in the PATH variable. 56 | # sudo apt-get install make g++-powerpc-linux-gnu 57 | # 58 | # Prerequisites for emulation: 59 | # recent QEMU(-2.5) is installed or built from source and in the PATH variable. 60 | # POWER9 target requires more recent QEMU, tested with 3.x.y series and 4.2.0. 61 | # QEMU versions 4.x.y prior to 4.2.0 show issues with POWER8/9 fp32 LE targets. 62 | # sudo apt-get install qemu-user 63 | # 64 | # Compiling/running SIMD test: 65 | # make -f simd_make_p32.mk 66 | # qemu-ppc -cpu G4 simd_test.p32Bg4 -c 1 67 | # qemu-ppc64abi32 -cpu POWER7 simd_test.p32Bp7 -c 1 68 | # qemu-ppc64abi32 -cpu POWER8 simd_test.p32Bp8 -c 1 69 | # qemu-ppc64abi32 -cpu POWER9 simd_test.p32Bp9 -c 1 70 | # Use "-c 1" option to reduce test time when emulating with QEMU 71 | 72 | # Clang native build should theoretically work too (not tested), use (replace): 73 | # clang++ -O0 (in place of ...-g++ -O3) on PowerPC host (G4) 74 | # sudo apt-get install clang 75 | 76 | # For interpretation of SIMD build flags check compatibility layer in rtzero.h. 77 | # The RT_SIMD_COMPAT_PW8=1 flag below is redundant when building in LE mode. 78 | 79 | # For 128-bit VSX1 build use (replace): RT_128=1 (30 SIMD registers) 80 | # For 128-bit VSX2 build use (replace): RT_128=1 RT_SIMD_COMPAT_PW8=1 (30 regs) 81 | # For 128-bit VSX3 build use (replace): RT_128=2 (30 SIMD registers) 82 | # For 128-bit VMX build use (replace): RT_128=4 RT_SIMD_COMPAT_VSX=0 (15 regs) 83 | 84 | # For 256-bit VMX build use (replace): RT_256_R8=4 RT_SIMD_COMPAT_VSX=0 (8 rp) 85 | # For 256-bit VSX1 build use (replace): RT_256=1 (15 SIMD reg-pairs) 86 | # For 256-bit VSX2 build use (replace): RT_256=1 RT_SIMD_COMPAT_PW8=1 (15 rp) 87 | # For 256-bit VSX3 build use (replace): RT_256=2 (15 SIMD reg-pairs) 88 | # For 256-bit VSX1 build use (replace): RT_256=4 (<=test29) (30 SIMD reg-pairs) 89 | # For 256-bit VSX2 build use (replace): RT_256=4 RT_SIMD_COMPAT_PW8=1 (30 rp) 90 | # For 256-bit VSX3 build use (replace): RT_256=8 (<=test29) (30 SIMD reg-pairs) 91 | 92 | # For 512-bit VSX1 build use (replace): RT_512=1 (<=test29) (15 SIMD reg-quads) 93 | # For 512-bit VSX2 build use (replace): RT_512=1 RT_SIMD_COMPAT_PW8=1 (15 rq) 94 | # For 512-bit VSX3 build use (replace): RT_512=2 (<=test29) (15 SIMD reg-quads) 95 | -------------------------------------------------------------------------------- /test/simd_make_w64.bat: -------------------------------------------------------------------------------- 1 | mingw32-make -f simd_make_w64.mk -j4 2 | simd_test_w64f32.exe 3 | -------------------------------------------------------------------------------- /test/simd_make_x32.mk: -------------------------------------------------------------------------------- 1 | 2 | INC_PATH = \ 3 | -I../core/config/ 4 | 5 | SRC_LIST = \ 6 | simd_test.cpp 7 | 8 | LIB_PATH = 9 | 10 | LIB_LIST = \ 11 | -lm 12 | 13 | 14 | build: simd_test_x32 15 | 16 | strip: 17 | strip simd_test.x32* 18 | 19 | clean: 20 | rm simd_test.x32* 21 | 22 | 23 | simd_test_x32: 24 | g++ -O3 -g -mx32 \ 25 | -DRT_LINUX -DRT_X32 -DRT_256_R8=4 -DRT_SIMD_COMPAT_SSE=2 -DRT_DEBUG=0 \ 26 | -DRT_POINTER=32 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=0 \ 27 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o simd_test.x32 28 | 29 | 30 | # On Ubuntu (MATE) 16.04-22.04 add "universe multiverse" to "main restricted" 31 | # in /etc/apt/sources.list (sudo nano /etc/apt/sources.list) then run: 32 | # sudo apt-get update 33 | # (Ubuntu MATE is set up for an update without a need to edit the file) 34 | # (extended repositories "universe multiverse" are only needed for clang) 35 | # 36 | # Prerequisites for the build: 37 | # multilib-compiler for x86_64 is installed and in the PATH variable. 38 | # sudo apt-get install make g++-multilib 39 | # (installation of g++-multilib removes any g++ cross-compilers) 40 | # 41 | # Compiling/running SIMD test: 42 | # make -f simd_make_x32.mk 43 | # ./simd_test.x32 44 | 45 | # Clang native build works too (takes much longer prior to 3.8), use (replace): 46 | # clang++ (in place of g++) 47 | # sudo apt-get install clang (requires g++-multilib for non-native ABI) 48 | 49 | # For interpretation of SIMD build flags check compatibility layer in rtzero.h. 50 | # The 30-reg targets on top of AVX1+2/SSEx below will require in-mem emulation. 51 | 52 | # For 128-bit 30-reg build use (replace): RT_128=1 (reserved for AVX1+2/SSEx) 53 | # For 128-bit 30-reg build use (replace): RT_128=2 (Skylake-X w/ AVX512DQ+VL) 54 | # For 128-bit SSE2 build use (replace): RT_128=4 RT_SIMD_COMPAT_SSE=2 (15 regs) 55 | # For 128-bit SSE4 build use (replace): RT_128=4 (15 SIMD registers) 56 | # For 128-bit AVX1 build use (replace): RT_128=8 (15 SIMD registers) 57 | # For 128-bit FMA3 build use (replace): RT_128=16 (AMD's AVX1+FMA3) (15 regs) 58 | # For 128-bit AVX2 build use (replace): RT_128=32 (AMD's AVX2+FMA3) (15 regs) 59 | 60 | # For 256-bit SSE2 build use (replace): RT_256_R8=4 RT_SIMD_COMPAT_SSE=2 (8 rp) 61 | # For 256-bit SSE4 build use (replace): RT_256_R8=4 (8 SIMD reg-pairs) 62 | # For 256-bit AVX1 build use (replace): RT_256=1 (15 SIMD registers) 63 | # For 256-bit AVX2 build use (replace): RT_256=2 (15 SIMD registers) 64 | # For 256-bit 30-reg build use (replace): RT_256=4 (reserved for AVX1+2/SSEx) 65 | # For 256-bit 30-reg build use (replace): RT_256=8 (Skylake-X w/ AVX512DQ+VL) 66 | 67 | # For 512-bit AVX1 build use (replace): RT_512_R8=1 (8 SIMD reg-pairs) 68 | # For 512-bit AVX2 build use (replace): RT_512_R8=2 (8 SIMD reg-pairs) 69 | # For 512-bit AVX512F build use (replace): RT_512=1 (15 SIMD registers) 70 | # For 512-bit AVX512DQ build use (replace): RT_512=2 (15 SIMD registers) 71 | # For 512-bit AVX512F build use (replace): RT_512=4 (30 SIMD registers) 72 | # For 512-bit AVX512DQ build use (replace): RT_512=8 (30 SIMD registers) 73 | 74 | # For 1024-bit AVX512F build use (replace): RT_1K4=1 (15 SIMD reg-pairs) 75 | # For 1024-bit AVX512DQ build use (replace): RT_1K4=2 (15 SIMD reg-pairs) 76 | # For 2048-bit AVX512F build use (replace): RT_2K8_R8=1 (8 SIMD reg-quads) 77 | # For 2048-bit AVX512DQ build use (replace): RT_2K8_R8=2 (8 SIMD reg-quads) 78 | -------------------------------------------------------------------------------- /test/simd_make_x86.mk: -------------------------------------------------------------------------------- 1 | 2 | INC_PATH = \ 3 | -I../core/config/ 4 | 5 | SRC_LIST = \ 6 | simd_test.cpp 7 | 8 | LIB_PATH = 9 | 10 | LIB_LIST = \ 11 | -lm 12 | 13 | 14 | build: simd_test_x86 simd_test_x86avx simd_test_x86avx512 15 | 16 | strip: 17 | strip simd_test.x86* 18 | 19 | clean: 20 | rm simd_test.x86* 21 | 22 | 23 | simd_test_x86: 24 | g++ -O3 -g -m32 \ 25 | -DRT_LINUX -DRT_X86 -DRT_128=2 -DRT_DEBUG=0 \ 26 | -DRT_POINTER=32 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=0 \ 27 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o simd_test.x86 28 | 29 | simd_test_x86avx: 30 | g++ -O3 -g -m32 \ 31 | -DRT_LINUX -DRT_X86 -DRT_256=1 -DRT_DEBUG=0 \ 32 | -DRT_POINTER=32 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=0 \ 33 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o simd_test.x86avx 34 | 35 | simd_test_x86avx512: 36 | g++ -O3 -g -m32 \ 37 | -DRT_LINUX -DRT_X86 -DRT_512=1 -DRT_DEBUG=0 \ 38 | -DRT_POINTER=32 -DRT_ADDRESS=32 -DRT_ELEMENT=32 -DRT_ENDIAN=0 \ 39 | ${INC_PATH} ${SRC_LIST} ${LIB_PATH} ${LIB_LIST} -o simd_test.x86avx512 40 | 41 | 42 | # On Ubuntu (MATE) 16.04-22.04 add "universe multiverse" to "main restricted" 43 | # in /etc/apt/sources.list (sudo nano /etc/apt/sources.list) then run: 44 | # sudo apt-get update 45 | # (Ubuntu MATE is set up for an update without a need to edit the file) 46 | # (extended repositories "universe multiverse" are only needed for clang) 47 | # 48 | # Prerequisites for the build: 49 | # native/multilib-compiler for x86/x86_64 is installed and in the PATH variable. 50 | # sudo apt-get install make g++ (for x86 host) 51 | # sudo apt-get install make g++-multilib (for x86_64 host) 52 | # (installation of g++-multilib removes any g++ cross-compilers) 53 | # 54 | # Prerequisites for emulation: 55 | # http://software.intel.com/en-us/articles/intel-software-development-emulator 56 | # Intel SDE is downloaded, unpacked and in the PATH variable. 57 | # 58 | # Compiling/running SIMD test: 59 | # make -f simd_make_x86.mk 60 | # ./simd_test.x86 61 | # ./simd_test.x86avx 62 | # ./simd_test.x86avx512 63 | # sde -snb -- ./simd_test.x86avx -c 1 64 | # sde -knl -- ./simd_test.x86avx512 -c 1 65 | # Use "-c 1" option to reduce test time when emulating with Intel SDE 66 | 67 | # Clang native build works too (takes much longer prior to 3.8), use (replace): 68 | # clang++ (in place of g++) 69 | # sudo apt-get install clang (requires g++-multilib for non-native ABI) 70 | 71 | # For interpretation of SIMD build flags check compatibility layer in rtzero.h. 72 | # Original legacy 32-bit ARMv7/x86 targets only support 8 SIMD registers. 73 | 74 | # For 128-bit SSE1 build use (replace): RT_128=1 (test36/37) (8 SIMD registers) 75 | # For 128-bit SSE2 build use (replace): RT_128=2 (8 SIMD registers) 76 | # For 128-bit SSE4 build use (replace): RT_128=4 (8 SIMD registers) 77 | # For 128-bit AVX1 build use (replace): RT_128=8 (AMD's AVX1-only) (8 regs) 78 | # For 128-bit FMA3 build use (replace): RT_128=16 (AMD's AVX1+FMA3) (8 regs) 79 | # For 128-bit AVX2 build use (replace): RT_128=32 (AMD's AVX2+FMA3) (8 regs) 80 | 81 | # For 256-bit AVX1 build use (replace): RT_256=1 (Intel's AVX1-only) (8 regs) 82 | # For 256-bit AVX2 build use (replace): RT_256=2 (Intel's AVX2+FMA3) (8 regs) 83 | # For 512-bit AVX512F build use (replace): RT_512=1 (8 SIMD registers) 84 | # For 512-bit AVX512DQ build use (replace): RT_512=2 (8 SIMD registers) 85 | -------------------------------------------------------------------------------- /test/simd_qemu32.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Intended for x86_64 Linux test environment 3 | # with QEMU linux-user mode installed (64-bit Ubuntu MATE 20.04 LTS tested) 4 | # run this script after bulid_cross.sh with 32-bit cross-compilers installed 5 | 6 | touch qemu32; rm qemu32 7 | 8 | # fully successful test pass results in qemu32 file of 41524 bytes (51 tests) 9 | # unlike simd_test64/86.sh the result is the same on all CPU types (51 tests) 10 | # check the output if qemu32 file size differs, look for printouts 11 | 12 | 13 | echo "========================================================" | tee -a qemu32 14 | echo "Testing arm_v1 target (ARMv7 Cortex-A8 NEON)" | tee -a qemu32 15 | echo "========================================================" | tee -a qemu32 16 | qemu-arm -cpu cortex-a8 simd_test.arm_v1 -c 1 | tee -a qemu32 17 | echo "========================================================" | tee -a qemu32 18 | echo "Testing arm_v2 target (ARMv7 Cortex-A15 NEON)" | tee -a qemu32 19 | echo "========================================================" | tee -a qemu32 20 | qemu-arm -cpu cortex-a15 simd_test.arm_v2 -c 1 | tee -a qemu32 21 | 22 | 23 | echo "========================================================" | tee -a qemu32 24 | echo "Testing m32Lr5 target (MIPS32r5 MSA little-endian)" | tee -a qemu32 25 | echo "========================================================" | tee -a qemu32 26 | qemu-mipsel -cpu P5600 simd_test.m32Lr5 -c 1 | tee -a qemu32 27 | echo "========================================================" | tee -a qemu32 28 | echo "Testing m32Br5 target (MIPS32r5 MSA big-endian)" | tee -a qemu32 29 | echo "========================================================" | tee -a qemu32 30 | qemu-mips -cpu P5600 simd_test.m32Br5 -c 1 | tee -a qemu32 31 | 32 | 33 | # ppc64abi32 targets are deprecated since QEMU 5.2.0 (dropped in Ubuntu 22.04) 34 | # fully successful test pass writes 66442 bytes to qemu32 with ppc64abi32 runs 35 | 36 | echo "========================================================" | tee -a qemu32 37 | echo "Testing p32Bg4 target (PPC G4 VMX big-endian)" | tee -a qemu32 38 | echo "========================================================" | tee -a qemu32 39 | qemu-ppc -cpu G4 simd_test.p32Bg4 -c 1 | tee -a qemu32 40 | #echo "========================================================" | tee -a qemu32 41 | #echo "Testing p32Bp7 target (POWER7 VSX1 big-endian)" | tee -a qemu32 42 | #echo "========================================================" | tee -a qemu32 43 | #qemu-ppc64abi32 -cpu POWER7 simd_test.p32Bp7 -c 1 | tee -a qemu32 44 | #echo "========================================================" | tee -a qemu32 45 | #echo "Testing p32Bp8 target (POWER8 VSX2 big-endian)" | tee -a qemu32 46 | #echo "========================================================" | tee -a qemu32 47 | #qemu-ppc64abi32 -cpu POWER8 simd_test.p32Bp8 -c 1 | tee -a qemu32 48 | #echo "========================================================" | tee -a qemu32 49 | #echo "Testing p32Bp9 target (POWER9 VSX3 big-endian)" | tee -a qemu32 50 | #echo "========================================================" | tee -a qemu32 51 | #qemu-ppc64abi32 -cpu POWER9 simd_test.p32Bp9 -c 1 | tee -a qemu32 52 | 53 | 54 | echo "========================================================" 55 | echo "fully successful test pass writes 41524 bytes to qemu32" 56 | echo "the result doesn't depend on CPU type (unlike test64/86)" 57 | echo "check the output if qemu32 size differs, check printouts" 58 | echo "========================================================" 59 | echo "the actual file size after the test run is listed below:" 60 | ls -al qemu32 61 | echo "========================================================" 62 | 63 | 64 | -------------------------------------------------------------------------------- /test/simd_test64.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Intended for x86_64 Linux test environment 3 | # tested on 64-bit Linux Mint 18, 64-bit Ubuntu MATE 18.04/20.04 LTS 4 | # run this script after bulid_linux.sh with native compiler installed 5 | 6 | touch test64; rm test64 7 | 8 | # fully successful test pass results in test64 file of 99666 bytes (51 tests) 9 | # test pass on AVX2-only CPU results in test64 file of 69286 bytes (51 tests) 10 | # for any other CPU check the output or use Intel SDE within script 11 | 12 | 13 | echo "========================================================" | tee -a test64 14 | echo "Testing x64_32 target (Intel Core 2 Duo SSE2)" | tee -a test64 15 | echo "========================================================" | tee -a test64 16 | ./simd_test.x64_32 -c 1 | tee -a test64 17 | echo "========================================================" | tee -a test64 18 | echo "Testing x64_64 target (Intel Core 2 Duo SSE2)" | tee -a test64 19 | echo "========================================================" | tee -a test64 20 | ./simd_test.x64_64 -c 1 | tee -a test64 21 | echo "========================================================" | tee -a test64 22 | echo "Testing x64f32 target (Intel Nehalem SSE4)" | tee -a test64 23 | echo "========================================================" | tee -a test64 24 | ./simd_test.x64f32 -c 1 | tee -a test64 25 | echo "========================================================" | tee -a test64 26 | echo "Testing x64f64 target (Intel Nehalem SSE4)" | tee -a test64 27 | echo "========================================================" | tee -a test64 28 | ./simd_test.x64f64 -c 1 | tee -a test64 29 | 30 | echo "========================================================" | tee -a test64 31 | echo "Testing x64_32avx target (Intel Sandy Bridge AVX1)" | tee -a test64 32 | echo "========================================================" | tee -a test64 33 | ./simd_test.x64_32avx -c 1 | tee -a test64 34 | echo "========================================================" | tee -a test64 35 | echo "Testing x64_64avx target (Intel Sandy Bridge AVX1)" | tee -a test64 36 | echo "========================================================" | tee -a test64 37 | ./simd_test.x64_64avx -c 1 | tee -a test64 38 | echo "========================================================" | tee -a test64 39 | echo "Testing x64f32avx target (Intel Haswell AVX2)" | tee -a test64 40 | echo "========================================================" | tee -a test64 41 | ./simd_test.x64f32avx -c 1 | tee -a test64 42 | echo "========================================================" | tee -a test64 43 | echo "Testing x64f64avx target (Intel Haswell AVX2)" | tee -a test64 44 | echo "========================================================" | tee -a test64 45 | ./simd_test.x64f64avx -c 1 | tee -a test64 46 | 47 | echo "========================================================" | tee -a test64 48 | echo "Testing x64_32avx512 target (Intel Xeon Phi KNL AVX512)" | tee -a test64 49 | echo "========================================================" | tee -a test64 50 | ./simd_test.x64_32avx512 -c 1 | tee -a test64 51 | echo "========================================================" | tee -a test64 52 | echo "Testing x64_64avx512 target (Intel Xeon Phi KNL AVX512)" | tee -a test64 53 | echo "========================================================" | tee -a test64 54 | ./simd_test.x64_64avx512 -c 1 | tee -a test64 55 | echo "========================================================" | tee -a test64 56 | echo "Testing x64f32avx512 target (Intel Rocket Lake AVX512)" | tee -a test64 57 | echo "========================================================" | tee -a test64 58 | ./simd_test.x64f32avx512 -c 1 | tee -a test64 59 | echo "========================================================" | tee -a test64 60 | echo "Testing x64f64avx512 target (Intel Rocket Lake AVX512)" | tee -a test64 61 | echo "========================================================" | tee -a test64 62 | ./simd_test.x64f64avx512 -c 1 | tee -a test64 63 | 64 | 65 | echo "========================================================" 66 | echo "fully successful test pass writes 99666 bytes to test64" 67 | echo "test pass on AVX2-only CPU writes 69286 bytes to test64" 68 | echo "for other CPUs check the output, use Intel SDE in script" 69 | echo "========================================================" 70 | echo "the actual file size after the test run is listed below:" 71 | ls -al test64 72 | echo "========================================================" 73 | 74 | 75 | -------------------------------------------------------------------------------- /test/simd_test86.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Intended for x86_64 Linux test environment 3 | # with multilib capabilities (64-bit Linux Mint 18 tested) 4 | # run this script after bulid_multi.sh with multilib-compiler installed 5 | 6 | touch test86; rm test86 7 | 8 | # fully successful test pass results in test86 file of 35482 bytes (51 tests) 9 | # test pass on AVX2-only CPU results in test86 file of 25616 bytes (51 tests) 10 | # for any other CPU check the output or use Intel SDE within script 11 | 12 | 13 | echo "========================================================" | tee -a test86 14 | echo "Testing x86 target (Intel Core 2 Duo SSE2)" | tee -a test86 15 | echo "========================================================" | tee -a test86 16 | ./simd_test.x86 -c 1 | tee -a test86 17 | echo "========================================================" | tee -a test86 18 | echo "Testing x86avx target (Intel Sandy Bridge AVX1)" | tee -a test86 19 | echo "========================================================" | tee -a test86 20 | ./simd_test.x86avx -c 1 | tee -a test86 21 | echo "========================================================" | tee -a test86 22 | echo "Testing x86avx512 target (Intel Xeon Phi KNL AVX512)" | tee -a test86 23 | echo "========================================================" | tee -a test86 24 | ./simd_test.x86avx512 -c 1 | tee -a test86 25 | echo "========================================================" | tee -a test86 26 | echo "Testing x32 target (Intel Core 2 Duo SSE2)" | tee -a test86 27 | echo "========================================================" | tee -a test86 28 | ./simd_test.x32 -c 1 | tee -a test86 29 | 30 | 31 | echo "========================================================" 32 | echo "fully successful test pass writes 35482 bytes to test86" 33 | echo "test pass on AVX2-only CPU writes 25616 bytes to test86" 34 | echo "for other CPUs check the output, use Intel SDE in script" 35 | echo "========================================================" 36 | echo "the actual file size after the test run is listed below:" 37 | ls -al test86 38 | echo "========================================================" 39 | 40 | 41 | -------------------------------------------------------------------------------- /test/simd_test_x64.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.1.32328.378 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "simd_test_x64", "simd_test_x64.vcxproj", "{3CDB5A0F-6E4A-45F8-A234-25B9491748D9}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Release|x64 = Release|x64 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {3CDB5A0F-6E4A-45F8-A234-25B9491748D9}.Debug|x64.ActiveCfg = Debug|x64 15 | {3CDB5A0F-6E4A-45F8-A234-25B9491748D9}.Debug|x64.Build.0 = Debug|x64 16 | {3CDB5A0F-6E4A-45F8-A234-25B9491748D9}.Release|x64.ActiveCfg = Release|x64 17 | {3CDB5A0F-6E4A-45F8-A234-25B9491748D9}.Release|x64.Build.0 = Release|x64 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {11D5CE55-10D6-484B-AEE7-878D57BF69CE} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /test/simd_test_x64.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | --------------------------------------------------------------------------------