├── .gitattributes ├── .gitignore ├── .gitmodules ├── README.txt ├── builtins ├── CMakeLists.txt ├── Makefile ├── include │ ├── clc.h │ ├── cpu.h │ ├── custom.h │ ├── dsp.h │ ├── dsp_c.h │ └── dsp_edmamgr.h └── lib │ ├── all.cl │ ├── any.cl │ ├── bitselect.cl │ ├── clamp.cl │ ├── convert.cl │ ├── convert_gen.sh │ ├── convert_round.cl │ ├── cross.cl │ ├── degrees.cl │ ├── dsp │ ├── abs.cl │ ├── abs_diff.cl │ ├── add_sat.cl │ ├── atomics.cl │ ├── clz.cl │ ├── mad_sat.cl │ ├── misc.cl │ ├── mul_hi.cl │ ├── rotate.cl │ ├── sub_sat.cl │ └── upsample.cl │ ├── fract.cl │ ├── frexp.cl │ ├── hadd.cl │ ├── half.cl │ ├── length.cl │ ├── lgamma_r.cl │ ├── math.cl │ ├── max.cl │ ├── mix.cl │ ├── modf.cl │ ├── relationals.cl │ ├── remquo.cl │ ├── select.cl │ ├── shuffle.cl │ ├── sign.cl │ ├── sincos.cl │ ├── smoothstep.cl │ └── step.cl ├── debian ├── changelog ├── compat ├── control ├── copyright ├── libopencl1.install ├── libopencl1.lintian-overrides ├── rules ├── source.lintian-overrides ├── ti-opencl.install └── ti-opencl.lintian-overrides ├── docs └── sphinx-doc │ ├── Makefile │ ├── make.bat │ └── source │ ├── _static │ ├── custom.css │ └── theme_overrides.css │ ├── _templates │ └── layout.html │ ├── _themes │ └── sphinx_rtd_theme │ │ ├── __init__.py │ │ ├── breadcrumbs.html │ │ ├── footer.html │ │ ├── layout.html │ │ ├── layout_old.html │ │ ├── search.html │ │ ├── searchbox.html │ │ ├── static │ │ ├── css │ │ │ ├── badge_only.css │ │ │ └── theme.css │ │ ├── fonts │ │ │ ├── FontAwesome.otf │ │ │ ├── Inconsolata-Bold.ttf │ │ │ ├── Inconsolata.ttf │ │ │ ├── Lato-Bold.ttf │ │ │ ├── Lato-Regular.ttf │ │ │ ├── RobotoSlab-Bold.ttf │ │ │ ├── RobotoSlab-Regular.ttf │ │ │ ├── fontawesome-webfont.eot │ │ │ ├── fontawesome-webfont.svg │ │ │ ├── fontawesome-webfont.ttf │ │ │ └── fontawesome-webfont.woff │ │ └── js │ │ │ ├── modernizr.min.js │ │ │ └── theme.js │ │ └── theme.conf │ ├── compilation.rst │ ├── conf.py │ ├── debug │ ├── debug_ccs.rst │ ├── debug_dsptop.rst │ ├── debug_gdb.rst │ ├── debug_printf.rst │ └── index.rst │ ├── disclaimer.rst │ ├── dspc8681-getting-started.rst │ ├── environment_variables.rst │ ├── examples │ ├── build_and_run.rst │ ├── float_compute.rst │ ├── index.rst │ ├── monte_carlo.rst │ └── overview.rst │ ├── execution │ ├── device-discovery.rst │ ├── index.rst │ ├── kernels-workgroups-workitems.rst │ └── terminology.rst │ ├── extensions │ ├── bios-apis.rst │ ├── c66-intrinsics.rst │ ├── extended-memory.rst │ ├── index.rst │ ├── kernel-timeout.rst │ ├── msmc-buffers.rst │ ├── opencl-c-builtin-function-extensions.rst │ ├── openmp-dsp.rst │ ├── openmp_dsp_dispatch.rst │ ├── printf.rst │ └── standard-c-code.rst │ ├── faq │ ├── ddr-partition.rst │ ├── dload-error.rst │ ├── evm-logsize.rst │ ├── host-omp-interop.rst │ ├── icd.rst │ ├── images.rst │ ├── index.rst │ ├── lock.rst │ ├── pyopencl.rst │ ├── standalone-app-diffs.rst │ ├── support.rst │ └── version.rst │ ├── images │ ├── Extended_memory_example.png │ ├── Extended_memory_overlay.png │ ├── NDRangeKernel.png │ ├── Optimization.png │ ├── WG-vs-WI.png │ ├── flowARM_DSP.jpg │ ├── flowARM_Only.jpg │ ├── logo_opencl.png │ ├── opencl_memory_cache.png │ ├── openmp_dsp_dispatch_with_opencl.png │ ├── platform_red.png │ ├── ti_hz_2c_pos_rgbRev1.gif │ ├── tiicon.ico │ └── tinn_api.png │ ├── index.rst │ ├── intro.rst │ ├── listings │ ├── matmul_arm.cpp │ └── matmul_ocl.cpp │ ├── memory │ ├── access-model.rst │ ├── buffers.rst │ ├── cache-operations.rst │ ├── ddr-partition.rst │ ├── device-memory.rst │ ├── discovery.rst │ ├── dsp-malloc-extension.rst │ ├── edmamgr.rst │ ├── extended-memory.rst │ ├── host-malloc-extension.rst │ ├── index.rst │ └── memory-model.rst │ ├── multiprocess.rst │ ├── offload.rst │ ├── optimization │ ├── code │ │ ├── ast.c │ │ ├── dao.c │ │ ├── dp.c │ │ ├── gen_ocl.c │ │ └── natc.c │ ├── dsp_code.rst │ ├── example_conv1d.rst │ ├── examples.rst │ ├── host_code.rst │ ├── index.rst │ ├── performance_data.rst │ └── typical_steps.rst │ ├── profiling.rst │ ├── readme │ ├── index.rst │ ├── readme_v01.01.07.x.rst │ ├── readme_v01.01.08.x.rst │ ├── readme_v01.01.09.x.rst │ ├── readme_v01.01.10.x.rst │ ├── readme_v01.01.11.x.rst │ ├── readme_v01.01.12.x.rst │ ├── readme_v01.01.13.x.rst │ ├── readme_v01.01.14.x.rst │ ├── readme_v01.01.15.x.rst │ ├── readme_v01.01.16.x.rst │ ├── readme_v01.01.17.x.rst │ ├── readme_v01.01.18.x.rst │ ├── readme_v01.01.19.x.rst │ └── readme_v01.02.00.x.rst │ ├── reference.rst │ └── rtos │ ├── advanced.rst │ ├── basic.rst │ ├── index.rst │ └── overview.rst ├── examples ├── CMakeLists.txt ├── Makefile ├── abort_exit │ ├── Makefile │ ├── Makefile.rtos │ ├── kernel.cl │ └── main.cpp ├── buffer │ ├── Makefile │ ├── Makefile.rtos │ └── main.cpp ├── ccode │ ├── Makefile │ ├── Makefile.rtos │ ├── ccode.c │ ├── main.cpp │ └── oclwrapper.cl ├── conv1d │ ├── Makefile │ ├── Makefile.rtos │ ├── k_extc.c │ ├── main.cpp │ └── ti_kernels.cl ├── dgemm │ ├── Makefile │ ├── cblas.h │ ├── cblas_dgemm_dsp.h │ ├── libcblas_atlas_arm │ │ ├── libatlas.a │ │ ├── libcblas.a │ │ └── libptcblas.a │ ├── libcblas_dgemm_dsp │ │ ├── Makefile │ │ ├── cblas.h │ │ ├── cblas_dgemm.cpp │ │ ├── data.h │ │ ├── data_move.c │ │ ├── dgemm.c │ │ ├── dgemm_kernel.c │ │ ├── dgemm_kernel.h │ │ ├── dgemm_omp.c │ │ ├── init.cpp │ │ ├── kernel.cl │ │ └── ocl.h │ └── main.cpp ├── dspheap │ ├── Makefile │ ├── kernels.cl │ └── main.cpp ├── dsplib_fft │ ├── Makefile │ ├── Makefile.rtos │ ├── dsplib_3_4_0_0.ae66 │ ├── fft_ocl.cpp │ └── kernel.cl ├── edmabw │ ├── Makefile │ ├── Makefile.rtos │ ├── bandwidth.h │ ├── kernel.cl │ └── main.cpp ├── edmamgr │ ├── Makefile │ ├── Makefile.rtos │ ├── kernel.cl │ └── main.cpp ├── float_compute │ ├── Makefile │ ├── Makefile.rtos │ ├── dsp_compute.cl │ └── main.cpp ├── load_am57_rtos.js ├── make.inc ├── make_rtos.inc ├── mandelbrot │ ├── Makefile │ ├── main.cpp │ └── mandelbrot.cl ├── mandelbrot_native │ ├── Makefile │ ├── main.cpp │ └── mandelbrot.cpp ├── matmpy │ ├── Makefile │ ├── Makefile.rtos │ ├── ccode.c │ ├── kernel.cl │ ├── main.cpp │ └── random.h ├── monte_carlo │ ├── Makefile │ ├── cpu_main.cpp │ ├── dsp_ccode.c │ ├── dsp_kernels.cl │ ├── gaussRandom.h │ ├── generateRandomGaussian.h │ ├── initial.h │ └── utilityRoutines.h ├── null │ ├── Makefile │ ├── Makefile.rtos │ ├── kernel.cl │ └── main.cpp ├── offline │ ├── Makefile │ ├── main.cpp │ └── vadd.cl ├── offline_embed │ ├── Makefile │ ├── Makefile.rtos │ ├── main.cpp │ └── vadd.cl ├── ooo │ ├── Makefile │ ├── ooo-dependencies.jpg │ └── ooo.cpp ├── ooo_callback │ ├── Makefile │ ├── Makefile.rtos │ ├── kernel.cl │ ├── ooo-dependencies.jpg │ └── ooo_callback.cpp ├── ooo_map │ ├── Makefile │ └── ooo.cpp ├── persistent_clock_concurrent │ ├── Makefile │ ├── dsp.c │ ├── host.cpp │ └── kernel.cl ├── persistent_clock_spanning │ ├── Makefile │ ├── dsp.c │ ├── host.cpp │ └── kernel.cl ├── persistent_common │ ├── host_assist.cpp │ ├── host_assist.h │ └── shared.h ├── persistent_kernel_timeout │ ├── Makefile │ ├── dsp.c │ ├── host.cpp │ └── kernel.cl ├── persistent_messageq_concurrent │ ├── Makefile │ ├── dsp │ │ ├── Makefile │ │ ├── dsp.c │ │ ├── heapbuf.h │ │ ├── kernel.cl │ │ └── messageq.h │ └── host │ │ ├── Makefile │ │ ├── host.cpp │ │ └── msgq.h ├── persistent_task_concurrent │ ├── Makefile │ ├── dsp.c │ ├── host.cpp │ └── kernel.cl ├── persistent_task_spanning │ ├── Makefile │ ├── dsp.c │ ├── host.cpp │ └── kernel.cl ├── platforms │ ├── Makefile │ ├── Makefile.rtos │ └── main.cpp ├── rtos_main.c ├── sgemm │ ├── Makefile │ ├── Makefile.rtos │ ├── cblas.h │ ├── data.h │ ├── data_move.c │ ├── kernel.cl │ ├── libcblas_atlas_arm │ │ ├── libatlas.a │ │ ├── libcblas.a │ │ └── libptcblas.a │ ├── main.cpp │ ├── sgemm.c │ ├── sgemm_kernel.c │ └── sgemm_kernel.h ├── simple │ ├── Makefile │ ├── Makefile.rtos │ ├── kernel.cl │ └── simple.cpp ├── timeout │ ├── Makefile │ ├── Makefile.rtos │ ├── kernel.cl │ └── main.cpp ├── vecadd │ ├── Makefile │ ├── Makefile.rtos │ ├── MyHost.cfg │ ├── kernel.cl │ ├── main.cpp │ ├── main_map_prof.cpp │ ├── main_md.cpp │ └── main_prof.cpp ├── vecadd_compile_link │ ├── Makefile │ └── main.cpp ├── vecadd_compile_link_loadbinary │ ├── Makefile │ └── main.cpp ├── vecadd_mpax │ ├── Makefile │ └── main.cpp ├── vecadd_mpax_openmp │ ├── Makefile │ ├── main.cpp │ ├── vadd_openmp.c │ └── vadd_wrapper.cl ├── vecadd_openmp │ ├── Makefile │ ├── Makefile.rtos │ ├── main.cpp │ ├── main.map.cpp │ ├── vadd_openmp.c │ └── vadd_wrapper.cl ├── vecadd_openmp_t │ ├── Makefile │ ├── Makefile.rtos │ ├── main.cpp │ ├── vadd_openmp.c │ └── vadd_wrapper.cl └── vecadd_subdevice │ ├── Makefile │ ├── kernel.cl │ └── main.cpp ├── host ├── CMakeLists.txt ├── Makefile.inc ├── clocl │ ├── .gitignore │ ├── CMakeLists.txt │ ├── CMakeListsWin.txt │ ├── Makefile │ ├── compiler.cpp │ ├── compiler.h │ ├── file_manip.cpp │ ├── file_manip.h │ ├── getopt.h │ ├── getopt_long.c │ ├── llvm_util.cpp │ ├── llvm_util.h │ ├── llvmopencl │ │ ├── AllocasToEntry.cc │ │ ├── AllocasToEntry.h │ │ ├── Barrier.h │ │ ├── BarrierTailReplication.cc │ │ ├── BarrierTailReplication.h │ │ ├── BreakConstantGEPs.cpp │ │ ├── BreakConstantGEPs.h │ │ ├── CanonicalizeBarriers.cc │ │ ├── CanonicalizeBarriers.h │ │ ├── CompilerWarnings.h │ │ ├── DebugHelpers.cc │ │ ├── DebugHelpers.h │ │ ├── Flatten.cc │ │ ├── Flatten.h │ │ ├── IsolateRegions.cc │ │ ├── IsolateRegions.h │ │ ├── Kernel.cc │ │ ├── Kernel.h │ │ ├── LLVMUtils.cc │ │ ├── LLVMUtils.h │ │ ├── LoopBarriers.cc │ │ ├── LoopBarriers.h │ │ ├── PHIsToAllocas.cc │ │ ├── PHIsToAllocas.h │ │ ├── ParallelRegion.cc │ │ ├── ParallelRegion.h │ │ ├── PrivatizationAliasAnalysis.cpp │ │ ├── PrivatizationAliasAnalysis.h │ │ ├── SimplifyShuffleBIFCall.cpp │ │ ├── SimplifyShuffleBIFCall.h │ │ ├── TargetAddressSpaces.cc │ │ ├── TargetAddressSpaces.h │ │ ├── VariableUniformityAnalysis.cc │ │ ├── VariableUniformityAnalysis.h │ │ ├── WorkItemAliasAnalysis.cc │ │ ├── WorkItemAliasAnalysis.h │ │ ├── Workgroup.cc │ │ ├── Workgroup.h │ │ ├── WorkitemHandler.cc │ │ ├── WorkitemHandler.h │ │ ├── WorkitemHandlerChooser.cc │ │ ├── WorkitemHandlerChooser.h │ │ ├── WorkitemLoops.cc │ │ ├── WorkitemLoops.h │ │ ├── WorkitemReplication.cc │ │ ├── WorkitemReplication.h │ │ ├── config.h │ │ ├── pocl.h │ │ ├── ti_pocl.cc │ │ └── ti_pocl.h │ ├── main.cpp │ ├── options.cpp │ ├── options.h │ ├── program.cpp │ ├── wga.cpp │ └── wga.h ├── cmake │ ├── CMakeARMToolChain.txt │ ├── CMakeBiosARMToolChain.txt │ └── modules │ │ ├── FindCheck.cmake │ │ ├── FindClang.cmake │ │ └── FindLLVM.cmake ├── include │ └── CL │ │ ├── cl.h │ │ ├── cl.hpp │ │ ├── cl_d3d10.h │ │ ├── cl_d3d11.h │ │ ├── cl_dx9_media_sharing.h │ │ ├── cl_egl.h │ │ ├── cl_ext.h │ │ ├── cl_gl.h │ │ ├── cl_gl_ext.h │ │ ├── cl_platform.h │ │ └── opencl.h ├── mct-daemon │ ├── CMakeLists.txt │ ├── cmem_allocator.h │ ├── heap_check.cpp │ ├── mctd.cpp │ ├── mctd_config.h │ ├── mpm_load.cpp │ ├── ti-mct-daemon.service.am57x │ ├── ti-mct-daemon.service.k2x │ ├── ti_mctd_config.json.am57x │ ├── ti_mctd_config.json.k2eg │ ├── ti_mctd_config.json.k2h │ └── ti_mctd_config.json.k2l ├── src │ ├── .gitignore │ ├── CMakeLists.txt │ ├── api │ │ ├── api_command.cpp │ │ ├── api_context.cpp │ │ ├── api_device.cpp │ │ ├── api_enqueue.cpp │ │ ├── api_event.cpp │ │ ├── api_flush.cpp │ │ ├── api_gl.cpp │ │ ├── api_kernel.cpp │ │ ├── api_memory.cpp │ │ ├── api_platform.cpp │ │ ├── api_profiling.cpp │ │ ├── api_program.cpp │ │ └── api_sampler.cpp │ ├── core │ │ ├── builtinkernel.cpp │ │ ├── builtinkernel.h │ │ ├── builtinprogram.cpp │ │ ├── builtinprogram.h │ │ ├── commandqueue.cpp │ │ ├── commandqueue.h │ │ ├── compiler.cpp │ │ ├── compiler.h │ │ ├── config.h │ │ ├── config.h.cmake │ │ ├── context.cpp │ │ ├── context.h │ │ ├── cpu │ │ │ ├── buffer.cpp │ │ │ ├── buffer.h │ │ │ ├── builtins.cpp │ │ │ ├── builtins.h │ │ │ ├── device.cpp │ │ │ ├── device.h │ │ │ ├── kernel.cpp │ │ │ ├── kernel.h │ │ │ ├── program.cpp │ │ │ ├── program.h │ │ │ ├── sampler.cpp │ │ │ ├── worker.cpp │ │ │ └── worker.h │ │ ├── deviceinterface.h │ │ ├── dsp │ │ │ ├── buffer.cpp │ │ │ ├── buffer.h │ │ │ ├── core_scheduler.h │ │ │ ├── database.h │ │ │ ├── device.cpp │ │ │ ├── device.h │ │ │ ├── device_info.cpp │ │ │ ├── device_info.h │ │ │ ├── driver.cpp │ │ │ ├── dspmem.h │ │ │ ├── dynamic_loader_interface.h │ │ │ ├── genfile_cache.cpp │ │ │ ├── genfile_cache.h │ │ │ ├── heap_manager.h │ │ │ ├── heap_manager_policy_process.h │ │ │ ├── heap_manager_policy_thread.h │ │ │ ├── kernel.cpp │ │ │ ├── kernel.h │ │ │ ├── mbox_interface.h │ │ │ ├── memmap.h │ │ │ ├── memory_provider_interface.h │ │ │ ├── message.h │ │ │ ├── mmap_resource.cpp │ │ │ ├── program.cpp │ │ │ ├── program.h │ │ │ ├── rm_qmss_res.c │ │ │ ├── rootdevice.cpp │ │ │ ├── rootdevice.h │ │ │ ├── source_cache.h │ │ │ ├── subdevice.cpp │ │ │ ├── subdevice.h │ │ │ ├── symbol_address_interface.h │ │ │ ├── tal │ │ │ │ ├── dload.cpp │ │ │ │ ├── dload_impl.h │ │ │ │ ├── heaps_policy_process.h │ │ │ │ ├── heaps_policy_thread.h │ │ │ │ ├── ion_allocator.cpp │ │ │ │ ├── ion_allocator.h │ │ │ │ ├── ion_memory_provider.cpp │ │ │ │ ├── ion_memory_provider.h │ │ │ │ ├── mbox_factory.cpp │ │ │ │ ├── mbox_impl_msgq.cpp │ │ │ │ ├── mbox_impl_msgq.h │ │ │ │ ├── mbox_msgq_shared.h │ │ │ │ ├── memory_provider_cmem.cpp │ │ │ │ ├── memory_provider_cmem.h │ │ │ │ ├── memory_provider_factory.cpp │ │ │ │ ├── memory_provider_factory.h │ │ │ │ ├── memory_provider_rtos.cpp │ │ │ │ ├── memory_provider_rtos.h │ │ │ │ ├── ocl_load │ │ │ │ │ ├── C60_DLOAD_DYN │ │ │ │ │ │ ├── c60_dynamic.c │ │ │ │ │ │ ├── c60_dynamic.h │ │ │ │ │ │ └── c60_elf32.h │ │ │ │ │ ├── C60_DLOAD_REL │ │ │ │ │ │ ├── c60_reloc.c │ │ │ │ │ │ ├── c60_reloc.h │ │ │ │ │ │ ├── test_c60_reloc.cpp │ │ │ │ │ │ └── test_c60_reloc.h │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ ├── DLOAD │ │ │ │ │ │ ├── ArrayList.c │ │ │ │ │ │ ├── ArrayList.h │ │ │ │ │ │ ├── Queue.h │ │ │ │ │ │ ├── Stack.h │ │ │ │ │ │ ├── dload.c │ │ │ │ │ │ ├── dload.h │ │ │ │ │ │ ├── dload_endian.c │ │ │ │ │ │ ├── dload_endian.h │ │ │ │ │ │ ├── elf32.c │ │ │ │ │ │ ├── elf32.h │ │ │ │ │ │ ├── relocate.h │ │ │ │ │ │ ├── symtab.h │ │ │ │ │ │ ├── util.h │ │ │ │ │ │ ├── version.h │ │ │ │ │ │ └── virtual_targets.h │ │ │ │ │ ├── DLOAD_API │ │ │ │ │ │ ├── api_version_change.log │ │ │ │ │ │ └── dload_api.h │ │ │ │ │ ├── DLOAD_SYM │ │ │ │ │ │ └── symtab.c │ │ │ │ │ ├── README │ │ │ │ │ ├── Stack.h │ │ │ │ │ └── ocl_load.c │ │ │ │ ├── rtos_shmem_provider_factory.cpp │ │ │ │ ├── shared_memory_provider.cpp │ │ │ │ ├── shared_memory_provider.h │ │ │ │ ├── shmem_cmem.cpp │ │ │ │ ├── shmem_init_policy_cmem.cpp │ │ │ │ ├── shmem_init_policy_cmem.h │ │ │ │ ├── shmem_init_policy_rtos.cpp │ │ │ │ ├── shmem_init_policy_rtos.h │ │ │ │ ├── shmem_provider_factory.cpp │ │ │ │ ├── shmem_rtos.cpp │ │ │ │ ├── shmem_rw_policy_cmem.cpp │ │ │ │ ├── shmem_rw_policy_cmem.h │ │ │ │ ├── shmem_rw_policy_rtos.cpp │ │ │ │ ├── shmem_rw_policy_rtos.h │ │ │ │ ├── symbol_address_elf.cpp │ │ │ │ └── symbol_address_elf.h │ │ │ ├── u_concurrent_map.h │ │ │ ├── u_concurrent_set.h │ │ │ ├── u_concurrent_stack.h │ │ │ ├── u_lockable.h │ │ │ ├── u_locks_pthread.h │ │ │ ├── utils.h │ │ │ └── worker.cpp │ │ ├── error_report.cpp │ │ ├── error_report.h │ │ ├── eve │ │ │ ├── device.cpp │ │ │ ├── device.h │ │ │ ├── kernel.cpp │ │ │ ├── kernel.h │ │ │ ├── program.cpp │ │ │ ├── program.h │ │ │ └── worker.cpp │ │ ├── events.cpp │ │ ├── events.h │ │ ├── icd.cpp │ │ ├── icd.h │ │ ├── kernel.cpp │ │ ├── kernel.h │ │ ├── kernelentry.cpp │ │ ├── kernelentry.h │ │ ├── memobject.cpp │ │ ├── memobject.h │ │ ├── memory_range.h │ │ ├── object.cpp │ │ ├── object.h │ │ ├── oclenv.cpp │ │ ├── oclenv.h │ │ ├── offload │ │ │ └── worker.h │ │ ├── platform.cpp │ │ ├── platform.h │ │ ├── program.cpp │ │ ├── program.h │ │ ├── propertylist.h │ │ ├── sampler.cpp │ │ ├── sampler.h │ │ ├── shared_memory_interface.h │ │ ├── tiocl_thread.h │ │ ├── tiocl_types.h │ │ ├── util.cpp │ │ └── util.h │ └── runtime │ │ ├── CMakeLists.txt │ │ ├── builtins.def │ │ ├── builtins.py │ │ ├── embed.py │ │ └── stdlib.c └── util │ ├── CMakeLists.txt │ ├── decode_error.cpp │ ├── ocl_util.h │ ├── read_binary.cpp │ └── report_timing.cpp ├── libm ├── .mailmap ├── LICENSE.md ├── Make.inc ├── Makefile ├── README.md ├── Symbol.map ├── amd64 │ ├── Make.files │ ├── Symbol.map │ ├── bsd_asm.h │ ├── bsd_cdefs.h │ ├── bsd_fpu.h │ ├── bsd_ieeefp.h │ ├── e_remainder.S │ ├── e_remainderf.S │ ├── e_remainderl.S │ ├── e_sqrt.S │ ├── e_sqrtf.S │ ├── e_sqrtl.S │ ├── fenv.c │ ├── fenv.h │ ├── s_llrint.S │ ├── s_llrintf.S │ ├── s_llrintl.S │ ├── s_logbl.S │ ├── s_lrint.S │ ├── s_lrintf.S │ ├── s_lrintl.S │ ├── s_remquo.S │ ├── s_remquof.S │ ├── s_remquol.S │ ├── s_rintl.S │ ├── s_scalbn.S │ ├── s_scalbnf.S │ └── s_scalbnl.S ├── arm │ ├── Make.files │ ├── Makefile.inc │ ├── Symbol.map │ ├── fenv.c │ └── fenv.h ├── bsdsrc │ ├── Make.files │ ├── b_exp.c │ ├── b_log.c │ ├── b_tgamma.c │ └── mathimpl.h ├── c66 │ ├── c66_helper.h │ ├── c_div.c │ ├── c_exp10.c │ ├── c_floorf.c │ ├── c_fmaf.c │ ├── c_fmax.c │ ├── c_fpconv.c │ ├── c_frexp.c │ ├── c_hypotf.c │ ├── c_ldexp.c │ ├── c_maxmag.c │ ├── c_outlined.c │ ├── c_pown.c │ ├── c_powr.c │ ├── c_recip.c │ ├── c_remquof.c │ ├── c_rootn.c │ ├── c_rsqrt.c │ ├── c_sinpi.c │ ├── c_sqrt.c │ ├── c_truncf.c │ ├── fenv.c │ ├── fenv.h │ └── normalize.c ├── i387 │ ├── Make.files │ ├── Symbol.map │ ├── bsd_asm.h │ ├── bsd_cdefs.h │ ├── bsd_ieeefp.h │ ├── bsd_npx.h │ ├── e_exp.S │ ├── e_fmod.S │ ├── e_log.S │ ├── e_log10.S │ ├── e_log10f.S │ ├── e_logf.S │ ├── e_remainder.S │ ├── e_remainderf.S │ ├── e_remainderl.S │ ├── e_sqrt.S │ ├── e_sqrtf.S │ ├── e_sqrtl.S │ ├── fenv.c │ ├── fenv.h │ ├── invtrig.c │ ├── osx_asm.h │ ├── s_ceil.S │ ├── s_ceilf.S │ ├── s_ceill.S │ ├── s_copysign.S │ ├── s_copysignf.S │ ├── s_copysignl.S │ ├── s_cos.S │ ├── s_finite.S │ ├── s_floor.S │ ├── s_floorf.S │ ├── s_floorl.S │ ├── s_llrint.S │ ├── s_llrintf.S │ ├── s_llrintl.S │ ├── s_logb.S │ ├── s_logbf.S │ ├── s_logbl.S │ ├── s_lrint.S │ ├── s_lrintf.S │ ├── s_lrintl.S │ ├── s_remquo.S │ ├── s_remquof.S │ ├── s_remquol.S │ ├── s_rint.S │ ├── s_rintf.S │ ├── s_rintl.S │ ├── s_scalbn.S │ ├── s_scalbnf.S │ ├── s_scalbnl.S │ ├── s_significand.S │ ├── s_significandf.S │ ├── s_sin.S │ ├── s_tan.S │ ├── s_trunc.S │ ├── s_truncf.S │ └── s_truncl.S ├── ia64 │ ├── Make.files │ ├── Makefile.inc │ ├── Symbol.map │ ├── fenv.c │ ├── fenv.h │ ├── s_fma.S │ ├── s_fmaf.S │ └── s_fmal.S ├── include │ ├── amd64_fpmath.h │ ├── cdefs-compat.h │ ├── fenv.h │ ├── fpmath.h │ ├── i386_fpmath.h │ └── types-compat.h ├── ld128 │ ├── Make.files │ ├── e_rem_pio2l.h │ ├── invtrig.c │ ├── invtrig.h │ ├── k_cosl.c │ ├── k_sinl.c │ ├── k_tanl.c │ ├── s_exp2l.c │ └── s_nanl.c ├── ld80 │ ├── Make.files │ ├── e_rem_pio2l.h │ ├── invtrig.c │ ├── invtrig.h │ ├── k_cosl.c │ ├── k_sinl.c │ ├── k_tanl.c │ ├── s_exp2l.c │ └── s_nanl.c ├── mips │ ├── Make.files │ ├── Makefile.inc │ ├── Symbol.map │ ├── fenv.c │ └── fenv.h ├── powerpc │ ├── Make.files │ ├── Makefile.inc │ ├── Symbol.map │ ├── fenv.c │ └── fenv.h ├── sparc64 │ ├── Make.files │ ├── Makefile.inc │ ├── Symbol.map │ ├── e_sqrt.S │ ├── e_sqrtf.S │ ├── fenv.c │ └── fenv.h ├── src │ ├── Make.files │ ├── common.c │ ├── e_acos.c │ ├── e_acosf.c │ ├── e_acosh.c │ ├── e_acoshf.c │ ├── e_acosl.c │ ├── e_asin.c │ ├── e_asinf.c │ ├── e_asinl.c │ ├── e_atan2.c │ ├── e_atan2f.c │ ├── e_atan2l.c │ ├── e_atanh.c │ ├── e_atanhf.c │ ├── e_cosh.c │ ├── e_coshf.c │ ├── e_exp.c │ ├── e_expf.c │ ├── e_fmod.c │ ├── e_fmodf.c │ ├── e_fmodl.c │ ├── e_gamma.c │ ├── e_gamma_r.c │ ├── e_gammaf.c │ ├── e_gammaf_r.c │ ├── e_hypot.c │ ├── e_hypotf.c │ ├── e_hypotl.c │ ├── e_j0.c │ ├── e_j0f.c │ ├── e_j1.c │ ├── e_j1f.c │ ├── e_jn.c │ ├── e_jnf.c │ ├── e_lgamma.c │ ├── e_lgamma_r.c │ ├── e_lgammaf.c │ ├── e_lgammaf_r.c │ ├── e_log.c │ ├── e_log10.c │ ├── e_log10f.c │ ├── e_log2.c │ ├── e_log2f.c │ ├── e_logf.c │ ├── e_pow.c │ ├── e_powf.c │ ├── e_rem_pio2.c │ ├── e_rem_pio2f.c │ ├── e_remainder.c │ ├── e_remainderf.c │ ├── e_remainderl.c │ ├── e_scalb.c │ ├── e_scalbf.c │ ├── e_sinh.c │ ├── e_sinhf.c │ ├── e_sqrt.c │ ├── e_sqrtf.c │ ├── e_sqrtl.c │ ├── k_cos.c │ ├── k_cosf.c │ ├── k_exp.c │ ├── k_expf.c │ ├── k_log.h │ ├── k_logf.h │ ├── k_rem_pio2.c │ ├── k_sin.c │ ├── k_sinf.c │ ├── k_tan.c │ ├── k_tanf.c │ ├── math_private.h │ ├── openlibm.h │ ├── s_asinh.c │ ├── s_asinhf.c │ ├── s_atan.c │ ├── s_atanf.c │ ├── s_atanl.c │ ├── s_carg.c │ ├── s_cargf.c │ ├── s_cargl.c │ ├── s_cbrt.c │ ├── s_cbrtf.c │ ├── s_cbrtl.c │ ├── s_ccosh.c │ ├── s_ccoshf.c │ ├── s_ceil.c │ ├── s_ceilf.c │ ├── s_ceill.c │ ├── s_cexp.c │ ├── s_cexpf.c │ ├── s_cimag.c │ ├── s_cimagf.c │ ├── s_cimagl.c │ ├── s_conj.c │ ├── s_conjf.c │ ├── s_conjl.c │ ├── s_copysign.c │ ├── s_copysignf.c │ ├── s_copysignl.c │ ├── s_cos.c │ ├── s_cosf.c │ ├── s_cosl.c │ ├── s_cpow.c │ ├── s_cpowf.c │ ├── s_cpowl.c │ ├── s_cproj.c │ ├── s_cprojf.c │ ├── s_cprojl.c │ ├── s_creal.c │ ├── s_crealf.c │ ├── s_creall.c │ ├── s_csinh.c │ ├── s_csinhf.c │ ├── s_csqrt.c │ ├── s_csqrtf.c │ ├── s_csqrtl.c │ ├── s_ctanh.c │ ├── s_ctanhf.c │ ├── s_erf.c │ ├── s_erff.c │ ├── s_exp2.c │ ├── s_exp2f.c │ ├── s_expm1.c │ ├── s_expm1f.c │ ├── s_fabs.c │ ├── s_fabsf.c │ ├── s_fabsl.c │ ├── s_fdim.c │ ├── s_finite.c │ ├── s_finitef.c │ ├── s_floor.c │ ├── s_floorf.c │ ├── s_floorl.c │ ├── s_fma.c │ ├── s_fmaf.c │ ├── s_fmal.c │ ├── s_fmax.c │ ├── s_fmaxf.c │ ├── s_fmaxl.c │ ├── s_fmin.c │ ├── s_fminf.c │ ├── s_fminl.c │ ├── s_fpclassify.c │ ├── s_frexp.c │ ├── s_frexpf.c │ ├── s_frexpl.c │ ├── s_ilogb.c │ ├── s_ilogbf.c │ ├── s_ilogbl.c │ ├── s_isfinite.c │ ├── s_isinf.c │ ├── s_isnan.c │ ├── s_isnormal.c │ ├── s_llrint.c │ ├── s_llrintf.c │ ├── s_llrintl.c │ ├── s_llround.c │ ├── s_llroundf.c │ ├── s_llroundl.c │ ├── s_log1p.c │ ├── s_log1pf.c │ ├── s_logb.c │ ├── s_logbf.c │ ├── s_logbl.c │ ├── s_lrint.c │ ├── s_lrintf.c │ ├── s_lrintl.c │ ├── s_lround.c │ ├── s_lroundf.c │ ├── s_lroundl.c │ ├── s_modf.c │ ├── s_modff.c │ ├── s_modfl.c │ ├── s_nan.c │ ├── s_nearbyint.c │ ├── s_nextafter.c │ ├── s_nextafterf.c │ ├── s_nextafterl.c │ ├── s_nexttoward.c │ ├── s_nexttowardf.c │ ├── s_remquo.c │ ├── s_remquof.c │ ├── s_remquol.c │ ├── s_rint.c │ ├── s_rintf.c │ ├── s_rintl.c │ ├── s_round.c │ ├── s_roundf.c │ ├── s_roundl.c │ ├── s_scalbln.c │ ├── s_scalbn.c │ ├── s_scalbnf.c │ ├── s_scalbnl.c │ ├── s_signbit.c │ ├── s_signgam.c │ ├── s_significand.c │ ├── s_significandf.c │ ├── s_sin.c │ ├── s_sincos.c │ ├── s_sincosf.c │ ├── s_sincosl.c │ ├── s_sinf.c │ ├── s_sinl.c │ ├── s_tan.c │ ├── s_tanf.c │ ├── s_tanh.c │ ├── s_tanhf.c │ ├── s_tanl.c │ ├── s_tgammaf.c │ ├── s_trunc.c │ ├── s_truncf.c │ ├── s_truncl.c │ ├── w_cabs.c │ ├── w_cabsf.c │ ├── w_cabsl.c │ ├── w_drem.c │ └── w_dremf.c └── test │ ├── .gitignore │ ├── Makefile │ ├── ieeetestnew.c │ ├── inf_torture.c │ ├── libm-test-ulps.h │ ├── libm-test.c │ ├── test-double.c │ └── test-float.c ├── makefile ├── monitor ├── CMakeLists.txt ├── Makefile ├── Makefile.am57x ├── Makefile.am57x_rtos ├── Makefile.evmk2g ├── Makefile.k2hle ├── cfg │ ├── monitor.am57x.cfg │ ├── monitor.cfg │ └── monitor.evmk2g.cfg ├── cmds │ ├── dsp_link_commands.template │ ├── monitor.am57x.cmd │ ├── monitor.am57x_rtos.cmd │ ├── monitor.cmd │ └── monitor.evmk2g.cmd ├── config.bld ├── export_syms ├── platforms │ ├── am57x │ │ ├── Makefile │ │ ├── Platform.xdc │ │ ├── Platform.xs │ │ ├── config.bld │ │ ├── package.bld │ │ └── package.xdc │ ├── dspc868x │ │ ├── Makefile │ │ ├── Platform.xdc │ │ ├── Platform.xs │ │ ├── config.bld │ │ ├── package.bld │ │ └── package.xdc │ ├── evmk2e │ │ ├── Makefile │ │ ├── Platform.xdc │ │ ├── Platform.xs │ │ ├── config.bld │ │ ├── package.bld │ │ └── package.xdc │ ├── evmk2g │ │ ├── Makefile │ │ ├── Platform.xdc │ │ ├── Platform.xs │ │ ├── config.bld │ │ ├── package.bld │ │ └── package.xdc │ ├── evmk2h │ │ ├── Makefile │ │ ├── Platform.xdc │ │ ├── Platform.xs │ │ ├── config.bld │ │ ├── package.bld │ │ └── package.xdc │ └── evmk2l │ │ ├── Makefile │ │ ├── Platform.xdc │ │ ├── Platform.xs │ │ ├── config.bld │ │ ├── package.bld │ │ └── package.xdc └── src │ ├── _ltoa.c │ ├── _printfi.c │ ├── builtins.c │ ├── custom_rsc_table_tci6638.h │ ├── custom_rsc_table_vayu_dsp.h │ ├── custom_rsc_table_vayu_dsp0.c │ ├── custom_rsc_table_vayu_dsp1.c │ ├── device_am57.c │ ├── device_k2g.c │ ├── device_k2x.c │ ├── dsp_builtins.c │ ├── dsp_builtins.h │ ├── dsp_builtins_table.c │ ├── dsp_rpc.asm │ ├── edma.c │ ├── edma.h │ ├── edma3_config_evmTCI6638K2K.c │ ├── edma3_tci66ak2g02_cfg.c │ ├── edma_am57x_config.c │ ├── edma_config.c │ ├── format.h │ ├── monitor.c │ ├── monitor.h │ ├── printf.c │ ├── rtos_ocl_main.c │ ├── rtos_ocl_main.h │ ├── touch.asm │ ├── trace.h │ ├── util.c │ └── util.h ├── monitor_ipu ├── CMakeLists.txt ├── Makefile ├── cfg │ ├── Ipu1.cfg │ ├── IpuAmmu.cfg │ ├── config.bld │ ├── ipc.cfg.xs │ └── mem_segment_definition_linux.xs ├── lib │ └── sbl_lib_1_9_0_9.aem4 └── src │ ├── custom_rsc_table_vayu_ipu1.h │ ├── eve_firmware.c │ ├── main_ipu1.c │ ├── sbl_lib.h │ ├── sbl_lib_tda2xx.h │ ├── utils_eve_boot.c │ ├── utils_eveloader.c │ └── utils_eveloader.h ├── opencl-manifest.html ├── packages ├── CMakeLists.txt └── ti │ └── opencl │ ├── DSPMonitor.xdc │ ├── DSPMonitor.xs │ ├── Dsp.cfg │ ├── Host.cfg │ ├── Makefile │ ├── OpenCL.xdc │ ├── OpenCL.xs │ ├── config.bld │ ├── configuration.c │ ├── configuration.h │ ├── configuration_dsp.c │ ├── configuration_dsp.h │ ├── ipc.cfg.xs │ ├── linkcmd_dsp.xdt │ ├── package.bld │ ├── package.xdc │ ├── package.xs │ └── platforms │ └── am57x_rtos │ ├── Makefile │ ├── Platform.xdc │ ├── Platform.xs │ ├── config.bld │ ├── package.bld │ └── package.xdc └── profiling ├── classes ├── __init__.py ├── core.py ├── event.py ├── event_list.py ├── graph.py ├── kernel.py └── table.py ├── oclaet.py └── oclaet.sh /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.obj 2 | *.lib 3 | !/monitor/libs/ocl_tidl_dsp.lib 4 | *.bc 5 | libm.lib 6 | *.o 7 | *~ 8 | *.dll* 9 | *.so* 10 | *.dylib* 11 | .xdcenv.mak 12 | .executables 13 | .interfaces 14 | .libraries 15 | package.mak 16 | monitor*/monitor 17 | monitor*/monitor_dspc868x 18 | monitor*/monitor_evmk2h 19 | monitor*/monitor_evmk2l 20 | monitor*/monitor_evmk2e 21 | monitor*/platforms/dspc868x/package 22 | monitor*/platforms/evmk2h/package 23 | monitor*/platforms/evmk2l/package 24 | monitor*/platforms/evmk2e/package 25 | monitor*/platforms/am57x*/package/ 26 | monitor*/platforms/evmk2g/package 27 | eclipse/package 28 | install/ 29 | monitor0 30 | monitor1 31 | *.map 32 | *.out 33 | *.syms 34 | *.ae66 35 | libm.cmd 36 | libm.fcns 37 | builtins.cmd 38 | builtins.fcns 39 | build/ 40 | ti-opencl*.tar.gz 41 | depend 42 | depend.bak 43 | CMakeCache.txt 44 | CMakeFiles/ 45 | host/build/ 46 | cmake_install.cmake 47 | host/.settings/ 48 | host/.kdev4/ 49 | host/nbproject/private/ 50 | *.hex 51 | tags 52 | build.log 53 | *.embed.h 54 | host/clocl/arm 55 | host/clocl/x86 56 | packages/ti/opencl/lib/ 57 | packages/ti/opencl/package/ 58 | packages/ti/opencl/platforms/am57x_rtos/package/ 59 | packages/ti/opencl/OpenCL.h 60 | packages/ti/opencl/DSPMonitor.h 61 | *.swp 62 | *.swo 63 | /monitor_ipu/bin/ 64 | monitor/monitor_am57x* 65 | monitor_ipu/src/eve_firmware.h 66 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "monitor_ipu/monitor_dla"] 2 | path = monitor_ipu/monitor_eve 3 | url = ssh://git@bitbucket.itg.ti.com/mctools/eve-opencl-monitor.git 4 | -------------------------------------------------------------------------------- /README.txt: -------------------------------------------------------------------------------- 1 | TI DSP OpenCL Runtime 2 | --------------------- 3 | 4 | OpenCL user guide available at: 5 | http://software-dl.ti.com/mctools/esd/docs/opencl/index.html 6 | 7 | Building OpenCL 8 | --------------- 9 | 10 | 1. Download and build Clang/LLVM using instructions available at: 11 | http://git.ti.com/opencl/llvm/blobs/release_36_ti/README.ti 12 | 2. Update variables in host/Makefile.inc based on the location of the 13 | Processor SDK. 14 | 3. Set environment variable DESTDIR to the location to install the OpenCL build 15 | 4. To build for a given SoC, run one of: 16 | * make BUILD_AM57=1 17 | * make BUILD_K2H=1 18 | * make BUILD_K2L=1 19 | * make BUILD_K2E=1 20 | * make BUILD_K2G=1 21 | 5. Additional build command options: 22 | * BUILD_OS=SYS_BIOS: only valid with BUILD_AM57=1 23 | * BUILD_EXAMPLES=1: only valid with BUILD_OS=SYS_BIOS 24 | -------------------------------------------------------------------------------- /builtins/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | install(FILES include/dsp.h DESTINATION /usr/share/ti/opencl ${OCL_FPERMS}) 2 | install(FILES include/dsp_c.h DESTINATION /usr/share/ti/opencl ${OCL_FPERMS}) 3 | install(FILES include/clc.h DESTINATION /usr/share/ti/opencl ${OCL_FPERMS}) 4 | install(FILES include/cpu.h DESTINATION /usr/share/ti/opencl ${OCL_FPERMS}) 5 | install(FILES include/dsp_edmamgr.h 6 | DESTINATION /usr/share/ti/opencl ${OCL_FPERMS}) 7 | install(FILES include/custom.h DESTINATION /usr/share/ti/opencl ${OCL_FPERMS}) 8 | -------------------------------------------------------------------------------- /debian/compat: -------------------------------------------------------------------------------- 1 | 9 2 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: ti-opencl 2 | Section: partner/misc 3 | Priority: extra 4 | Maintainer: TI Keystone PPA 5 | Build-Depends: debhelper (>= 9), 6 | mesa-common-dev (>= 8.0.4), 7 | binutils-dev, 8 | libsqlite3-dev, 9 | libffi-dev, 10 | zlib1g-dev, 11 | libmpmtransport-dev, 12 | libmpmclient-dev, 13 | cmem-dev, 14 | pdk-keystone2 (>= 03.00.04.18), 15 | pkg-config, 16 | check, 17 | libboost-dev, 18 | cmake, 19 | python, 20 | libtiulm-dev, 21 | ti-llvm-3.3, 22 | libloki-dev, 23 | gdbserver-c6x 24 | Standards-Version: 3.9.5 25 | 26 | Package: ti-opencl 27 | Depends: ${shlibs:Depends}, 28 | ${misc:Depends}, 29 | libopencl1 (= ${binary:Version}), 30 | mesa-common-dev (>= 8.0.4), 31 | mpm, 32 | cmem-mod-dkms, 33 | ti-cgt-c6x 34 | Conflicts: opencl-headers 35 | Architecture: armhf 36 | Description: OpenCL for TI Keystone 37 | OpenCL implementation for TI Keystone. 38 | 39 | Package: libopencl1 40 | Section: partner/libs 41 | Depends: ${shlibs:Depends}, 42 | ${misc:Depends} 43 | Breaks: ti-opencl (<< 0.9.0-0ubuntu1) 44 | Replaces: ti-opencl (<< 0.9.0-5) 45 | Architecture: armhf 46 | Description: OpenCL for TI Keystone - runtime libraries 47 | OpenCL implementation for TI Keystone. 48 | 49 | -------------------------------------------------------------------------------- /debian/libopencl1.install: -------------------------------------------------------------------------------- 1 | usr/lib/libOpenCL.so.1* 2 | usr/share/ti/opencl 3 | -------------------------------------------------------------------------------- /debian/libopencl1.lintian-overrides: -------------------------------------------------------------------------------- 1 | libopencl1 binary: arch-dependent-file-in-usr-share usr/share/ti/opencl/dsp.out 2 | libopencl1 binary: binary-from-other-architecture usr/share/ti/opencl/dsp.out 3 | libopencl1 binary: unstripped-binary-or-object usr/share/ti/opencl/dsp.out 4 | libopencl1 binary: statically-linked-binary usr/share/ti/opencl/dsp.out 5 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | %: 3 | dh $@ 4 | 5 | # A bug in pkgbinarymangle causes it to try to strip foreign-arch objects 6 | # located in /usr/share. 7 | override_dh_strip: 8 | NO_PKG_MANGLE=1 dh_strip 9 | 10 | override_dh_auto_clean: 11 | dh_auto_clean 12 | rm -rf llvm33-build llvm33-install-arm opencl/clocl/x86 13 | -------------------------------------------------------------------------------- /debian/source.lintian-overrides: -------------------------------------------------------------------------------- 1 | # BSD-licensed code in partner; sourceless files allowed 2 | ti-opencl source: source-is-missing builtins/*.obj 3 | ti-opencl source: source-is-missing monitor/*.obj 4 | ti-opencl source: source-is-missing monitor/dsp.out 5 | ti-opencl source: source-is-missing llvm33-src/tools/clang/www/analyzer/scripts/dbtree.js 6 | ti-opencl source: source-is-missing monitor/monitor/package/cfg/monitor_pe66.oe66 7 | -------------------------------------------------------------------------------- /debian/ti-opencl.install: -------------------------------------------------------------------------------- 1 | usr/bin/clocl 2 | usr/include 3 | usr/lib/libOpenCL.so 4 | usr/lib/libocl_util.a 5 | usr/share/ti/examples 6 | -------------------------------------------------------------------------------- /debian/ti-opencl.lintian-overrides: -------------------------------------------------------------------------------- 1 | ti-opencl binary: arch-dependent-file-in-usr-share usr/share/ti/examples/opencl+openmp/dgemm/libcblas_atlas_arm/libatlas.a 2 | ti-opencl binary: arch-dependent-file-in-usr-share usr/share/ti/examples/opencl+openmp/dgemm/libcblas_atlas_arm/libcblas.a 3 | ti-opencl binary: arch-dependent-file-in-usr-share usr/share/ti/examples/opencl+openmp/dgemm/libcblas_atlas_arm/libptcblas.a 4 | ti-opencl binary: arch-dependent-file-in-usr-share usr/share/ti/examples/opencl/dsplib_fft/dsplib.ae66 5 | ti-opencl binary: arch-dependent-file-in-usr-share usr/share/ti/examples/opencl/sgemm/libcblas_atlas_arm/libatlas.a 6 | ti-opencl binary: arch-dependent-file-in-usr-share usr/share/ti/examples/opencl/sgemm/libcblas_atlas_arm/libcblas.a 7 | ti-opencl binary: arch-dependent-file-in-usr-share usr/share/ti/examples/opencl/sgemm/libcblas_atlas_arm/libptcblas.a 8 | -------------------------------------------------------------------------------- /docs/sphinx-doc/source/_static/custom.css: -------------------------------------------------------------------------------- 1 | /* override table width restrictions */ 2 | .wy-table-responsive table td, .wy-table-responsive table th { 3 | white-space: normal; 4 | } 5 | 6 | .wy-table-responsive { 7 | margin-bottom: 24px; 8 | max-width: 100%; 9 | overflow: visible; 10 | } 11 | -------------------------------------------------------------------------------- /docs/sphinx-doc/source/_themes/sphinx_rtd_theme/__init__.py: -------------------------------------------------------------------------------- 1 | """Sphinx ReadTheDocs theme. 2 | 3 | From https://github.com/ryan-roemer/sphinx-bootstrap-theme. 4 | 5 | """ 6 | import os 7 | 8 | VERSION = (0, 1, 8) 9 | 10 | __version__ = ".".join(str(v) for v in VERSION) 11 | __version_full__ = __version__ 12 | 13 | 14 | def get_html_theme_path(): 15 | """Return list of HTML theme paths.""" 16 | cur_dir = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) 17 | return cur_dir 18 | -------------------------------------------------------------------------------- /docs/sphinx-doc/source/_themes/sphinx_rtd_theme/breadcrumbs.html: -------------------------------------------------------------------------------- 1 |
2 | Texas Instruments 3 | 10 |
11 |
12 | -------------------------------------------------------------------------------- /docs/sphinx-doc/source/_themes/sphinx_rtd_theme/footer.html: -------------------------------------------------------------------------------- 1 | 32 | 33 | -------------------------------------------------------------------------------- /docs/sphinx-doc/source/_themes/sphinx_rtd_theme/searchbox.html: -------------------------------------------------------------------------------- 1 | {%- if builder != 'singlehtml' %} 2 |
3 |
4 | 5 | 6 | 7 |
8 |
9 | {%- endif %} 10 | -------------------------------------------------------------------------------- /docs/sphinx-doc/source/_themes/sphinx_rtd_theme/static/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcn-ee/ti-opencl/b1dfed9af21a1236380b9d643c432e4f0c619fce/docs/sphinx-doc/source/_themes/sphinx_rtd_theme/static/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /docs/sphinx-doc/source/_themes/sphinx_rtd_theme/static/fonts/Inconsolata-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcn-ee/ti-opencl/b1dfed9af21a1236380b9d643c432e4f0c619fce/docs/sphinx-doc/source/_themes/sphinx_rtd_theme/static/fonts/Inconsolata-Bold.ttf -------------------------------------------------------------------------------- /docs/sphinx-doc/source/_themes/sphinx_rtd_theme/static/fonts/Inconsolata.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcn-ee/ti-opencl/b1dfed9af21a1236380b9d643c432e4f0c619fce/docs/sphinx-doc/source/_themes/sphinx_rtd_theme/static/fonts/Inconsolata.ttf -------------------------------------------------------------------------------- /docs/sphinx-doc/source/_themes/sphinx_rtd_theme/static/fonts/Lato-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcn-ee/ti-opencl/b1dfed9af21a1236380b9d643c432e4f0c619fce/docs/sphinx-doc/source/_themes/sphinx_rtd_theme/static/fonts/Lato-Bold.ttf -------------------------------------------------------------------------------- /docs/sphinx-doc/source/_themes/sphinx_rtd_theme/static/fonts/Lato-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcn-ee/ti-opencl/b1dfed9af21a1236380b9d643c432e4f0c619fce/docs/sphinx-doc/source/_themes/sphinx_rtd_theme/static/fonts/Lato-Regular.ttf -------------------------------------------------------------------------------- /docs/sphinx-doc/source/_themes/sphinx_rtd_theme/static/fonts/RobotoSlab-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcn-ee/ti-opencl/b1dfed9af21a1236380b9d643c432e4f0c619fce/docs/sphinx-doc/source/_themes/sphinx_rtd_theme/static/fonts/RobotoSlab-Bold.ttf -------------------------------------------------------------------------------- /docs/sphinx-doc/source/_themes/sphinx_rtd_theme/static/fonts/RobotoSlab-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcn-ee/ti-opencl/b1dfed9af21a1236380b9d643c432e4f0c619fce/docs/sphinx-doc/source/_themes/sphinx_rtd_theme/static/fonts/RobotoSlab-Regular.ttf -------------------------------------------------------------------------------- /docs/sphinx-doc/source/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcn-ee/ti-opencl/b1dfed9af21a1236380b9d643c432e4f0c619fce/docs/sphinx-doc/source/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /docs/sphinx-doc/source/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcn-ee/ti-opencl/b1dfed9af21a1236380b9d643c432e4f0c619fce/docs/sphinx-doc/source/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /docs/sphinx-doc/source/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcn-ee/ti-opencl/b1dfed9af21a1236380b9d643c432e4f0c619fce/docs/sphinx-doc/source/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /docs/sphinx-doc/source/_themes/sphinx_rtd_theme/theme.conf: -------------------------------------------------------------------------------- 1 | [theme] 2 | inherit = basic 3 | stylesheet = css/theme.css 4 | 5 | [options] 6 | typekit_id = hiw1hhg 7 | analytics_id = 8 | sticky_navigation = False 9 | logo_only = 10 | -------------------------------------------------------------------------------- /docs/sphinx-doc/source/debug/index.rst: -------------------------------------------------------------------------------- 1 | ################### 2 | Debug 3 | ################### 4 | 5 | .. toctree:: 6 | :maxdepth: 2 7 | 8 | debug_printf 9 | debug_gdb 10 | debug_ccs 11 | debug_dsptop 12 | -------------------------------------------------------------------------------- /docs/sphinx-doc/source/examples/index.rst: -------------------------------------------------------------------------------- 1 | ################### 2 | Examples 3 | ################### 4 | 5 | .. _ti-opencl-examples: 6 | 7 | .. toctree:: 8 | :glob: 9 | :maxdepth: 2 10 | 11 | build_and_run 12 | overview 13 | float_compute 14 | monte_carlo 15 | -------------------------------------------------------------------------------- /docs/sphinx-doc/source/execution/index.rst: -------------------------------------------------------------------------------- 1 | ################## 2 | Execution Model 3 | ################## 4 | 5 | OpenCL is a host CPU based library containing APIs that allow you to: 6 | 7 | 1. Discover available compute devices in the system, 8 | 2. Define programs to run on those compute devices, 9 | 3. Define buffers that can be used to communicate data between the host 10 | program and programs running on compute devices, and 11 | 4. To queue work to compute devices. 12 | 13 | Step 1 is documented in :doc:`device-discovery`. Step 3 is documented in 14 | :doc:`../memory/index`. Compilation of programs defined in step 2 is documented 15 | in :doc:`../compilation`. 16 | 17 | The remaining items: 18 | 19 | - The expression of programs in step 2, and 20 | - The mechanisms used to queue work in step 4 21 | 22 | are the essence of the execution model as it relates to how work is 23 | accomplished on compute devices and is the main topic for this chapter. 24 | 25 | .. toctree:: 26 | :maxdepth: 2 27 | 28 | terminology 29 | device-discovery 30 | kernels-workgroups-workitems 31 | 32 | .. Kernels 33 | -------------------------------------------------------------------------------- /docs/sphinx-doc/source/extensions/extended-memory.rst: -------------------------------------------------------------------------------- 1 | ******************************************** 2 | Using Extended Memory on the 66AK2x device 3 | ******************************************** 4 | 5 | An extended memory feature is supported on the 66AK2H implementation 6 | of OpenCL. The C66x DSP is a 32-bit architecture and has a limit of 7 | 2GB of DDR that it can access at any given time. The 66AK2H platforms 8 | can support up to 8GB of DDR3. To enable usage of DDRs greater than 9 | 2GB, this OpenCL implementation can use a hardware mapping feature to 10 | move windows over the 8GB DDR into the 32-bit DSP address space. 11 | Movement of these windows will occur at kernel start boundaries so 12 | two sequential kernels dispatched to the DSP device may actually 13 | operate on different 2GB areas within the 8GB DDR. The windows are 14 | not moved within a kernel. As a result of this feature, large buffers 15 | may be created and subsequently populated on the ARM side. However, a 16 | dispatched kernel may not access the entire buffer in one dispatch. 17 | Any given OpenCL Kernel will be limited to a total of 2GB of DDR 18 | access. The :ref:`vecadd_mpax-example` illustrates a 19 | process of defining a large buffer and then defining sub-buffers 20 | within the larger buffer and dispatching multiple OpenCL kernels to 21 | the DSP on these sub-buffers, cumulatively resulting in the entire 22 | large buffer being processed. Also see :doc:`../memory/extended-memory` 23 | -------------------------------------------------------------------------------- /docs/sphinx-doc/source/extensions/index.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Extensions 3 | ############################# 4 | 5 | TI's OpenCL implementation has been extended with a set of features beyond the 6 | OpenCL 1.1 specification. These features were added in order to better support 7 | the execution of code on the C66x DSP, to enable existing DSP libraries, and to 8 | better map to TI's devices. 9 | 10 | .. toctree:: 11 | :maxdepth: 2 12 | 13 | standard-c-code 14 | openmp-dsp 15 | c66-intrinsics 16 | printf 17 | ../memory/edmamgr 18 | extended-memory 19 | msmc-buffers 20 | opencl-c-builtin-function-extensions 21 | ../memory/cache-operations.rst 22 | bios-apis 23 | kernel-timeout 24 | .. ../memory/host-malloc-extension 25 | .. ../memory/dsp-malloc-extension 26 | .. ../memory/cache-operations 27 | -------------------------------------------------------------------------------- /docs/sphinx-doc/source/extensions/msmc-buffers.rst: -------------------------------------------------------------------------------- 1 | ****************************************** 2 | Fast Global buffers in on-chip MSMC memory 3 | ****************************************** 4 | A TI extension for allocating buffers out of MSMC memory has been 5 | added. Other than the location on the DSP where the buffer will 6 | reside, this MSMC defined buffer will act as a standard global buffer 7 | in all other ways. Example: 8 | :: 9 | 10 | Buffer bufMsmc(context, CL_MEM_READ_ONLY|CL_MEM_USE_MSMC_TI, size); 11 | Buffer bufDdr (context, CL_MEM_READ_ONLY, size); } 12 | 13 | The :ref:`matmpy-example` illustrates the use of MSMC buffers. 14 | The :ref:`platforms-example` will query the DSP device and report 15 | the amount of MSMC memory available for OpenCL use. 16 | 17 | .. note:: 18 | MSMC stands for Multicore Shared Memory Controller. It contains on-chip 19 | memory shared across all ARM and DSP cores on the 66AK2x. 20 | CL_MEM_USE_MSMC_TI is available only on 66AK2x. 21 | 22 | -------------------------------------------------------------------------------- /docs/sphinx-doc/source/extensions/openmp-dsp.rst: -------------------------------------------------------------------------------- 1 | ****************************************************** 2 | Calling Standard C code with OpenMP from OpenCL C code 3 | ****************************************************** 4 | 5 | Standard C code called from OpenCL C code can contain OpenMP pragmas. 6 | When using this feature the OpenCL C kernel containing the call to an 7 | OpenMP enabled C function must be submitted as a task (not an 8 | NDRangeKernel) and it must be submitted to an in-order OpenCL command 9 | queue (i.e. not defined with the 10 | *CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE* flag). In this scenario, 11 | OpenCL will dispatch the kernel to one compute unit of the DSP 12 | accelerator and the OpenMP runtime will manage distribution of tasks 13 | across the compute units. Please see 14 | :ref:`vecadd_openmp-example` or :ref:`vecadd_openmp_t-example`. 15 | 16 | .. toctree:: 17 | :maxdepth: 2 18 | 19 | openmp_dsp_dispatch 20 | -------------------------------------------------------------------------------- /docs/sphinx-doc/source/extensions/printf.rst: -------------------------------------------------------------------------------- 1 | ****************************** 2 | OpenCL C code using printf 3 | ****************************** 4 | 5 | A printf capability has been added for kernels running on the DSP. 6 | OpenCL C kernels or standard C code called from an OpenCL C kernel 7 | can call printf. The string resulting from the printf will be 8 | transmitted to the host ARM and displayed using a printf on the ARM 9 | side. This feature can be used to assist in debug of your OpenCL 10 | kernels. Note that there is a performance penalty in using printf 11 | from the DSPs, so it is not a feature that should be used when 12 | evaluating DSP performance. This feature is not the OpenCL 1.2 printf, 13 | which contains additional formatting codes for printing vector types. 14 | 15 | -------------------------------------------------------------------------------- /docs/sphinx-doc/source/faq/ddr-partition.rst: -------------------------------------------------------------------------------- 1 | ****************************************************** 2 | How do I allocate more DDR memory for OpenCL use? 3 | ****************************************************** 4 | 5 | If your application needs more OpenCL global memory than the system default, 6 | you can modify the device tree files to increase the size of the CMEM block 7 | partitioned for OpenCL use. Please see 8 | :ref:`CHANGE_DDR3_PARTITION_FOR_OPENCL` for details. 9 | -------------------------------------------------------------------------------- /docs/sphinx-doc/source/faq/dload-error.rst: -------------------------------------------------------------------------------- 1 | **************************************************************************************** 2 | Why do I get DLOAD error messages when running OpenCL applications? 3 | **************************************************************************************** 4 | 5 | | << D L O A D >> ERROR: File location of segment 0 is past the end of file. 6 | | << D L O A D >> ERROR: Attempt to load invalid ELF file, '(null)'. 7 | 8 | OpenCL uses the directory /tmp to store intermediate compilation results 9 | and to cache compilation results. This error typically results when /tmp 10 | is full. You can issue the command :command"`rm /tmp/opencl*` to free /tmp 11 | space. When either of the environment variables :envvar:`TI_OCL_CACHE_KERNELS` or 12 | :envvar:`TI_OCL_KEEP_FILES` is set, the OpenCL runtime will keep more persistent 13 | data in /tmp and this error could become more frequent. Either unset these 14 | environment variables or modify your Linux setup to increase the amount of 15 | space allocated to /tmp. 16 | 17 | -------------------------------------------------------------------------------- /docs/sphinx-doc/source/faq/evm-logsize.rst: -------------------------------------------------------------------------------- 1 | ********************************************************************** 2 | How do I limit log file sizes on EVM's temporary file storage (tmpfs)? 3 | ********************************************************************** 4 | 5 | On TI's EVMs that support OpenCL, log files are usually stored in the 6 | temporary file storage in the volatile memory, which are usually of limited 7 | sizes. After repeated runs of OpenCL application between EVM reboots, some 8 | log files could potentially use up all available memory. At that point, 9 | OpenCL application won't be able to run because it also uses /tmp directory 10 | in the same memory. 11 | 12 | To avoid the above mentioned problem, one can either reboot the EVM or 13 | redirect some of these logs to "/dev/null" if these logs are not needed 14 | for diagnosis. The following are the steps to limit some of the most common 15 | log files that could grow too large on various EVMs. 16 | 17 | ================== 18 | 66AK2* EVMs 19 | ================== 20 | mpmsrv.log: 21 | #. Edit /etc/mpm/mpm_config.json 22 | #. Change "outputif" line to, ``"outputif": "/dev/null",`` 23 | #. Restart mpmsrv or reboot EVM 24 | 25 | ================== 26 | AM57* EVMs 27 | ================== 28 | lad.txt: 29 | #. Edit /etc/init.d/tiipclad-daemon.sh 30 | #. Change "-l lad.txt" line to, ``tiipclad_params="-l /dev/null"`` 31 | #. Restart lad_dra7xx or reboot EVM 32 | 33 | -------------------------------------------------------------------------------- /docs/sphinx-doc/source/faq/icd.rst: -------------------------------------------------------------------------------- 1 | **************************************************************************************** 2 | Why does the OpenCL ICD installed on my platform not find the TI OpenCL implementation? 3 | **************************************************************************************** 4 | 5 | This TI OpenCL implementation is not yet ICD enabled. It cannot co-exist with 6 | other OpenCL implementations. 7 | -------------------------------------------------------------------------------- /docs/sphinx-doc/source/faq/images.rst: -------------------------------------------------------------------------------- 1 | ****************************************************** 2 | Does TI's OpenCL support images and samplers? 3 | ****************************************************** 4 | 5 | Images and Samplers are optional features in the OpenCL 1.1 spec for non-GPU 6 | devices. The DSP devices do not supported these optional features. 7 | -------------------------------------------------------------------------------- /docs/sphinx-doc/source/faq/index.rst: -------------------------------------------------------------------------------- 1 | ###################################################### 2 | Frequently Asked Questions 3 | ###################################################### 4 | 5 | .. toctree:: 6 | :maxdepth: 2 7 | 8 | support 9 | version 10 | pyopencl 11 | standalone-app-diffs 12 | host-omp-interop 13 | images 14 | icd 15 | lock 16 | dload-error 17 | evm-logsize 18 | ddr-partition 19 | -------------------------------------------------------------------------------- /docs/sphinx-doc/source/faq/lock.rst: -------------------------------------------------------------------------------- 1 | **************************************************************************************** 2 | Why do I get messages about /var/lock/opencl when running OpenCL applications? 3 | **************************************************************************************** 4 | 5 | .. note:: 6 | Starting with TI OpenCL version 1.1.12, this error should no longer occur. Version 7 | 1.1.12 will no longer create this lock, because it will now allow multiple 8 | concurrent OpenCL processes. 9 | 10 | The TI OpenCL implementation currently allows only 1 OpenCL enabled process 11 | to execute at any given time. To enforce this, the OpenCL implementation 12 | locks the file /var/local/opencl when an OpenCL application begins and 13 | frees it when it completes. If two OpenCL processes attempt to run 14 | concurrently, then one will block waiting for the file lock to be released. 15 | It is possible for an OpenCL application to terminate abnormally and leave 16 | the locked file in place. If you determine that no other OpenCL process is 17 | running and your OpenCL application still receives the waiting on 18 | /var/lock/opencl message, then the /var/lock/opencl file can be safely 19 | removed to allow your process to continue. 20 | -------------------------------------------------------------------------------- /docs/sphinx-doc/source/faq/support.rst: -------------------------------------------------------------------------------- 1 | ****************************************************** 2 | How do I get support for TI OpenCL products? 3 | ****************************************************** 4 | 5 | Post your questions and/or suspected defects to the 6 | `High Performance Computing forum `_ with the tag **opencl**. 7 | -------------------------------------------------------------------------------- /docs/sphinx-doc/source/images/Extended_memory_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcn-ee/ti-opencl/b1dfed9af21a1236380b9d643c432e4f0c619fce/docs/sphinx-doc/source/images/Extended_memory_example.png -------------------------------------------------------------------------------- /docs/sphinx-doc/source/images/Extended_memory_overlay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcn-ee/ti-opencl/b1dfed9af21a1236380b9d643c432e4f0c619fce/docs/sphinx-doc/source/images/Extended_memory_overlay.png -------------------------------------------------------------------------------- /docs/sphinx-doc/source/images/NDRangeKernel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcn-ee/ti-opencl/b1dfed9af21a1236380b9d643c432e4f0c619fce/docs/sphinx-doc/source/images/NDRangeKernel.png -------------------------------------------------------------------------------- /docs/sphinx-doc/source/images/Optimization.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcn-ee/ti-opencl/b1dfed9af21a1236380b9d643c432e4f0c619fce/docs/sphinx-doc/source/images/Optimization.png -------------------------------------------------------------------------------- /docs/sphinx-doc/source/images/WG-vs-WI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcn-ee/ti-opencl/b1dfed9af21a1236380b9d643c432e4f0c619fce/docs/sphinx-doc/source/images/WG-vs-WI.png -------------------------------------------------------------------------------- /docs/sphinx-doc/source/images/flowARM_DSP.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcn-ee/ti-opencl/b1dfed9af21a1236380b9d643c432e4f0c619fce/docs/sphinx-doc/source/images/flowARM_DSP.jpg -------------------------------------------------------------------------------- /docs/sphinx-doc/source/images/flowARM_Only.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcn-ee/ti-opencl/b1dfed9af21a1236380b9d643c432e4f0c619fce/docs/sphinx-doc/source/images/flowARM_Only.jpg -------------------------------------------------------------------------------- /docs/sphinx-doc/source/images/logo_opencl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcn-ee/ti-opencl/b1dfed9af21a1236380b9d643c432e4f0c619fce/docs/sphinx-doc/source/images/logo_opencl.png -------------------------------------------------------------------------------- /docs/sphinx-doc/source/images/opencl_memory_cache.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcn-ee/ti-opencl/b1dfed9af21a1236380b9d643c432e4f0c619fce/docs/sphinx-doc/source/images/opencl_memory_cache.png -------------------------------------------------------------------------------- /docs/sphinx-doc/source/images/openmp_dsp_dispatch_with_opencl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcn-ee/ti-opencl/b1dfed9af21a1236380b9d643c432e4f0c619fce/docs/sphinx-doc/source/images/openmp_dsp_dispatch_with_opencl.png -------------------------------------------------------------------------------- /docs/sphinx-doc/source/images/platform_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcn-ee/ti-opencl/b1dfed9af21a1236380b9d643c432e4f0c619fce/docs/sphinx-doc/source/images/platform_red.png -------------------------------------------------------------------------------- /docs/sphinx-doc/source/images/ti_hz_2c_pos_rgbRev1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcn-ee/ti-opencl/b1dfed9af21a1236380b9d643c432e4f0c619fce/docs/sphinx-doc/source/images/ti_hz_2c_pos_rgbRev1.gif -------------------------------------------------------------------------------- /docs/sphinx-doc/source/images/tiicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcn-ee/ti-opencl/b1dfed9af21a1236380b9d643c432e4f0c619fce/docs/sphinx-doc/source/images/tiicon.ico -------------------------------------------------------------------------------- /docs/sphinx-doc/source/images/tinn_api.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcn-ee/ti-opencl/b1dfed9af21a1236380b9d643c432e4f0c619fce/docs/sphinx-doc/source/images/tinn_api.png -------------------------------------------------------------------------------- /docs/sphinx-doc/source/index.rst: -------------------------------------------------------------------------------- 1 | .. _ti-opencl-home: 2 | 3 | ################################ 4 | TI OpenCL v01.01.xx User's Guide 5 | ################################ 6 | 7 | .. note:: 8 | 9 | If you landed on this page via http://downloads.ti.com/mctools/esd/docs/opencl (without the trailing *'/'*), reload the page by clicking `http://software-dl.ti.com/mctools/esd/docs/opencl/index.html `_ to fix relative links in the OpenCL html documentation. 10 | 11 | TI |OpenCL (TM)| Runtime Documentation Contents: 12 | 13 | .. toctree:: 14 | :maxdepth: 3 15 | 16 | intro 17 | reference 18 | offload 19 | compilation 20 | memory/index 21 | execution/index 22 | extensions/index 23 | environment_variables 24 | multiprocess 25 | optimization/index 26 | debug/index 27 | profiling 28 | rtos/index 29 | examples/index 30 | faq/index 31 | readme/index 32 | disclaimer 33 | 34 | .. image:: images/platform_red.png 35 | 36 | .. |OpenCL (TM)| unicode:: OpenCL U+2122 37 | -------------------------------------------------------------------------------- /docs/sphinx-doc/source/listings/matmul_arm.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | const int DIM = 16; 5 | const int mat_N = DIM; 6 | const int mat_K = DIM; 7 | const int mat_M = DIM; 8 | 9 | void mat_mpy(const float *A, const float *B, float *C, int mat_N, 10 | int mat_K, int mat_M) 11 | { 12 | for (int col = 0; col < mat_M; ++col) 13 | for (int row = 0; row < mat_N; ++row) 14 | { 15 | C[row*mat_M+col] = 0; 16 | for (int i = 0; i < mat_K; ++i) 17 | C[row*mat_M+col] += A[row*mat_K+i] * B[i*mat_M+col]; 18 | } 19 | } 20 | 21 | 22 | int main(int argc, char *argv[]) 23 | { 24 | size_t mat_size = DIM * DIM * sizeof(float); 25 | 26 | // Allocate matrices 27 | float *A = (float *) malloc(mat_size); 28 | float *B = (float *) malloc(mat_size); 29 | float *C = (float *) malloc(mat_size); 30 | 31 | assert(A != nullptr && B != nullptr && C != nullptr && C != nullptr); 32 | 33 | // Initialize matrices 34 | srand(42); 35 | for (int i=0; i < mat_N * mat_K; ++i) A[i] = rand() % 5 + 1; 36 | for (int i=0; i < mat_K * mat_M; ++i) B[i] = rand() % 5 + 1; 37 | for (int i=0; i < mat_N * mat_M; ++i) C[i] = 0.0; 38 | 39 | // Multiple matrices C = A x B 40 | mat_mpy(A, B, C, mat_N, mat_K, mat_M); 41 | 42 | free(A); 43 | free(B); 44 | free(C); 45 | 46 | return 0; 47 | } 48 | -------------------------------------------------------------------------------- /docs/sphinx-doc/source/memory/discovery.rst: -------------------------------------------------------------------------------- 1 | ****************************************************** 2 | Discovering OpenCL Memory Sizes and Limits 3 | ****************************************************** 4 | 5 | TBD 6 | -------------------------------------------------------------------------------- /docs/sphinx-doc/source/memory/index.rst: -------------------------------------------------------------------------------- 1 | ###################################################### 2 | Memory Usage 3 | ###################################################### 4 | 5 | .. toctree:: 6 | :maxdepth: 2 7 | 8 | device-memory 9 | ddr-partition 10 | memory-model 11 | buffers 12 | host-malloc-extension 13 | access-model 14 | discovery 15 | cache-operations 16 | extended-memory 17 | dsp-malloc-extension 18 | -------------------------------------------------------------------------------- /docs/sphinx-doc/source/optimization/code/ast.c: -------------------------------------------------------------------------------- 1 | // Serves as bounds check 2 | bool OutsideImage(int2 pos, int width, int height) 3 | { 4 | if (pos.x < 1 || pos.y < 1) 5 | return true; 6 | 7 | if (pos.x >= width - 1 || pos.y >= height - 1) 8 | return true; 9 | 10 | return false; 11 | } 12 | 13 | kernel void gaussian_filter (global uchar* image, 14 | global uchar* filtered_image, 15 | global char* gaussian_kernel, 16 | global int* image_dims, 17 | short weight) 18 | { 19 | const int image_height = image_dims[0]; 20 | const int image_width = image_dims[1]; 21 | 22 | const int global_x = get_global_id(0); 23 | const int global_y = get_global_id(1); 24 | const int2 pixel_pos = { global_x, global_y }; 25 | 26 | if (OutsideImage(pixel_pos, image_width, image_height)) 27 | return; 28 | 29 | short sum = 0; 30 | int index = 0; 31 | int2 pos; 32 | 33 | /* 3x3 Convolution */ 34 | for(int y= -1; y<=1; y++) 35 | for(int x=-1; x<=1; x++) 36 | { 37 | pos = pixel_pos + (int2)(x,y); 38 | sum += gaussian_kernel[index++] * image[pos.y * image_width + pos.x]; 39 | } 40 | 41 | sum /= weight; 42 | 43 | filtered_image[global_y * img_width + global_x] = (uchar) sum; 44 | } 45 | -------------------------------------------------------------------------------- /docs/sphinx-doc/source/optimization/code/dao.c: -------------------------------------------------------------------------------- 1 | 2 | #define ARRAY_SIZE n 3 | #define NUM_BATCHES n_b 4 | #define BATCH_SIZE (ARRAY_SIZE / NUM_BATCHES) // This is the size of a single buffer 5 | #define LOCAL_SIZE (BATCH_SIZE * 2) // This is the size of the double buffer 6 | 7 | kernel __attribute__ ((reqd_work_group_size (1, 1, 1))) 8 | void gaussian_filter (global const uchar4 * restrict imgin_ptr, 9 | global uchar4 * restrict imgout_ptr, 10 | short width, 11 | short pitch, 12 | global const uchar * kernel_coefficient, 13 | short shift) 14 | { 15 | //Initialize the required variables 16 | 17 | //Copy content in the double buffer 18 | 19 | //Compute for the buffer in batch 1 20 | 21 | for (batch = 0; batch < NUM_BATCHES - 2; batch++) 22 | { 23 | if (batch % 2 == 0) 24 | { 25 | Copy content in buffer batch 1 || Compute for buffer in batch 2 26 | } 27 | else 28 | { 29 | Copy content in buffer batch 2 || Compute for buffer in batch 1 30 | } 31 | } 32 | 33 | if (batch % 2 == 0) 34 | { 35 | Copy content in buffer batch 1 || Compute for buffer in batch 2 36 | } 37 | else 38 | { 39 | Copy content in buffer batch 2 || Compute for buffer in batch 1 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /docs/sphinx-doc/source/optimization/code/gen_ocl.c: -------------------------------------------------------------------------------- 1 | // Serves as bounds check 2 | bool OutsideImage(int2 pos, int width, int height) 3 | { 4 | if (pos.x < 1 || pos.y < 1) 5 | return true; 6 | 7 | if (pos.x >= width - 1 || pos.y >= height - 1) 8 | return true; 9 | 10 | return false; 11 | } 12 | 13 | kernel void gaussian_filter (global float* image, 14 | global float* filtered_image, 15 | global float* gaussian_kernel, 16 | global int* image_dims 17 | float weight) 18 | { 19 | const int image_height = image_dims[0]; 20 | const int image_width = image_dims[1]; 21 | 22 | const int global_x = get_global_id(0); 23 | const int global_y = get_global_id(1); 24 | const int2 pixel_pos = { global_x, global_y }; 25 | 26 | if (OutsideImage(pixel_pos, image_width, image_height)) 27 | return; 28 | 29 | float sum = 0; 30 | int index = 0; 31 | int2 pos; 32 | 33 | /* 3x3 Convolution */ 34 | 35 | for(int y= -1; y<=1; y++) 36 | for(int x=-1; x<=1; x++) 37 | { 38 | pos = pixel_pos + (int2)(x,y); 39 | sum += gaussian_kernel[index++] * image[pos.y * image_width + pos.x]; 40 | } 41 | 42 | sum /= weight; 43 | 44 | filtered_image[global_y * img_width + global_x] = sum; 45 | } 46 | -------------------------------------------------------------------------------- /docs/sphinx-doc/source/optimization/code/natc.c: -------------------------------------------------------------------------------- 1 | float image[image_size]; 2 | float gaussian_kernel[9]; 3 | float weight; 4 | float filtered_image[(image_width - 2) * (image_height - 2)]; 5 | 6 | for (i = 1; i < img_height - 1; i++) 7 | { 8 | for (j = 1; j < img_width - 1; j++) 9 | { 10 | sum = 0; 11 | for (p = 0; p < 3; p++) 12 | { 13 | for (q = 0; q < 3; q++) 14 | { 15 | sum += image[(i + p) * img_width + j + q] * 16 | gaussian_kernel[p * 3 + q]; 17 | } 18 | } 19 | sum /= weight; 20 | filtered_image[(i - 1) * img_width + j] = sum; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /docs/sphinx-doc/source/optimization/index.rst: -------------------------------------------------------------------------------- 1 | ################# 2 | Optimization Tips 3 | ################# 4 | 5 | OpenCL applications consist of a host application and a set of device 6 | kernels. There are optimization techniques for both the host code 7 | and the device code. There are some techniques that span the boundary between 8 | host and device. This section provides tips for writing OpenCL 9 | applications that perform well. It targets TI SoCs with DSPs as accelerator devices. These tips are organized into sections based on where the tip is applicable, i.e. the host or device. 10 | 11 | 12 | .. toctree:: 13 | :glob: 14 | :maxdepth: 2 15 | 16 | host_code 17 | dsp_code 18 | typical_steps 19 | example_conv1d 20 | examples 21 | performance_data 22 | 23 | .. MISC 24 | .. ============== 25 | .. #. timing functions 26 | .. #. additional overhead in first kernel dispatch 27 | 28 | -------------------------------------------------------------------------------- /docs/sphinx-doc/source/optimization/performance_data.rst: -------------------------------------------------------------------------------- 1 | ################ 2 | Performance Data 3 | ################ 4 | 5 | The table below show improvements obtained from optimizing a set of image processing kernels for the C66x DSP device using the techniques described in this chapter. 6 | 7 | ================== =================== ================== ============== 8 | Kernel Generic OpenCL C Optimized OpenCL C Improvement 9 | (cycles/pixel) (cycles/pixel) (times faster) 10 | ================== =================== ================== ============== 11 | Convolution 12 5 **2.40** 12 | Histogram 56 1.75 **32.00** 13 | X_Gradient 12.4 1.25 **9.92** 14 | Edge Relaxation 530 48 **11.04** 15 | ================== =================== ================== ============== 16 | -------------------------------------------------------------------------------- /docs/sphinx-doc/source/optimization/typical_steps.rst: -------------------------------------------------------------------------------- 1 | ##################################### 2 | Typical Steps to Optimize Device Code 3 | ##################################### 4 | 5 | The flowchart below describes a typical order in which the various optimizations steps are applied to improve the performance of OpenCL C kernels on the C66x DSP: 6 | 7 | .. image:: ../images/Optimization.png 8 | :align: center 9 | -------------------------------------------------------------------------------- /docs/sphinx-doc/source/readme/readme_v01.01.08.x.rst: -------------------------------------------------------------------------------- 1 | ************************* 2 | v01.01.08.x 3 | ************************* 4 | 5 | Platforms supported 6 | =================== 7 | 8 | * `AM572 EVM`_ 9 | * `66AK2H EVM`_ 10 | * `66AK2L EVM`_ 11 | * `66AK2E EVM`_ 12 | * `66AK2G EVM`_ 13 | 14 | 15 | Release Notes 16 | ============= 17 | 18 | * Added support for the 66AK2G EVM platform. 19 | 20 | Compiler Versions 21 | ================= 22 | This release requires the following compiler versions: 23 | 24 | ======== ======== 25 | Compiler Version 26 | ======== ======== 27 | ARM GCC 4.9.3 (arm-linux-gnueabi) 28 | C6000 8.1.x 29 | ======== ======== 30 | 31 | 32 | .. _AM572 EVM: http://www.ti.com/tool/tmdxevm5728 33 | .. _66AK2H EVM: http://www.ti.com/tool/EVMK2H 34 | .. _66AK2L EVM: http://www.ti.com/tool/XEVMK2LX 35 | .. _66AK2E EVM: http://www.ti.com/tool/XEVMK2EX 36 | .. _66AK2G EVM: http://www.ti.com/tool/EVMK2G 37 | -------------------------------------------------------------------------------- /docs/sphinx-doc/source/readme/readme_v01.01.11.x.rst: -------------------------------------------------------------------------------- 1 | ************************* 2 | v01.01.11.x 3 | ************************* 4 | 5 | Platforms supported 6 | =================== 7 | 8 | * `AM572 EVM`_ (Linux and RTOS) 9 | * AM571x 10 | * `66AK2H EVM`_ 11 | * `66AK2L EVM`_ 12 | * `66AK2E EVM`_ 13 | * `66AK2G EVM`_ 14 | 15 | 16 | Release Notes 17 | ============= 18 | * Support use of exit/abort in C code called from OpenCL C kernels 19 | 20 | Defect Fixes 21 | ------------ 22 | 23 | * [MCT-499] Destruction of the Platform singleton causes a crash in a subsequent clReleaseProgram() during teardown of ViennaCL OCL examples 24 | * [MCT-648] C++ I/O broken for OpenCL RTOS examples with 4Q BIOS 25 | * [MCT-649] OOT being reported as IOT on K2E 26 | 27 | 28 | Compiler Versions 29 | ================= 30 | This release requires the following compiler versions: 31 | 32 | ======== ======== 33 | Compiler Version 34 | ======== ======== 35 | ARM GCC 5.3.1 (arm-linux-gnueabi) 36 | ARM GCC 4.9.3 (arm-none-eabi, for OpenCL over TI-RTOS) 37 | C6000 8.1.0 38 | ======== ======== 39 | 40 | 41 | .. _AM572 EVM: http://www.ti.com/tool/tmdsevm572x 42 | .. _66AK2H EVM: http://www.ti.com/tool/EVMK2H 43 | .. _66AK2L EVM: http://www.ti.com/tool/XEVMK2LX 44 | .. _66AK2E EVM: http://www.ti.com/tool/XEVMK2EX 45 | .. _66AK2G EVM: http://www.ti.com/tool/EVMK2G 46 | -------------------------------------------------------------------------------- /docs/sphinx-doc/source/readme/readme_v01.01.13.x.rst: -------------------------------------------------------------------------------- 1 | ************************* 2 | v01.01.13.x 3 | ************************* 4 | 5 | New Features 6 | ============= 7 | * Added support for configuring the Multicore tools daemon using a JSON file 8 | * Added a section to OpenCL User's Guide describing how to offload to DSPs 9 | 10 | Defect Fixes 11 | ============ 12 | * [MCT-631] ViennaCL: sparse fails with Code generator does not support intrinsic 13 | * [MCT-646] float_compute example prints fixed assumption of 2 CPU cores 14 | 15 | Supported Evaluation Modules (EVMs) 16 | =================================== 17 | * `AM572 EVM`_ (Linux and TI-RTOS hosts) 18 | * `AM571 EVM`_ 19 | * `66AK2H EVM`_ 20 | * `66AK2L EVM`_ 21 | * `66AK2E EVM`_ 22 | * `66AK2G EVM`_ 23 | 24 | Compiler Versions 25 | ================= 26 | This release requires the following compiler versions: 27 | 28 | ======== ======== 29 | Compiler Version 30 | ======== ======== 31 | ARM GCC 6.2.1 (arm-linux-gnueabi) 32 | ARM GCC 4.9.3 (arm-none-eabi, for OpenCL over TI-RTOS) 33 | C6000 8.1.3 34 | ======== ======== 35 | 36 | 37 | .. _AM572 EVM: http://www.ti.com/tool/tmdsevm572x 38 | .. _AM571 EVM: http://www.ti.com/tool/tmdsevm572x 39 | .. _66AK2H EVM: http://www.ti.com/tool/EVMK2H 40 | .. _66AK2L EVM: http://www.ti.com/tool/XEVMK2LX 41 | .. _66AK2E EVM: http://www.ti.com/tool/XEVMK2EX 42 | .. _66AK2G EVM: http://www.ti.com/tool/EVMK2G 43 | -------------------------------------------------------------------------------- /docs/sphinx-doc/source/readme/readme_v01.01.16.x.rst: -------------------------------------------------------------------------------- 1 | ************************* 2 | v01.01.16.x 3 | ************************* 4 | 5 | New Features 6 | ============= 7 | * Export range based cache wb/inv functions for use from DSP device code 8 | 9 | .. code-block:: c++ 10 | 11 | void __cache_l2_wbinv (uint8_t* __ptr, size_t __size); 12 | void __cache_l2_inv (uint8_t* __ptr, size_t __size); 13 | 14 | * EVE frequency - put EVE in same OPP mode as C66x DSP. E.g. Default DSP is OPP_HIGH, then put EVE in OPP_HIGH as well - 650MHz. 15 | 16 | * Changes required for TIDL API v1.1 17 | 18 | Supported Evaluation Modules (EVMs) 19 | =================================== 20 | * `AM574x IDK EVM`_ 21 | * `AM572 EVM`_ (Linux and TI-RTOS hosts) 22 | * `AM571 EVM`_ 23 | * `66AK2H EVM`_ 24 | * `66AK2L EVM`_ 25 | * `66AK2E EVM`_ 26 | * `66AK2G EVM`_ 27 | 28 | .. _AM572 EVM: http://www.ti.com/tool/tmdsevm572x 29 | .. _AM571 EVM: http://www.ti.com/tool/tmdsevm572x 30 | .. _AM574x IDK EVM: http://www.ti.com/tool/tmdsidk574 31 | .. _66AK2H EVM: http://www.ti.com/tool/EVMK2H 32 | .. _66AK2L EVM: http://www.ti.com/tool/XEVMK2LX 33 | .. _66AK2E EVM: http://www.ti.com/tool/XEVMK2EX 34 | .. _66AK2G EVM: http://www.ti.com/tool/EVMK2G 35 | -------------------------------------------------------------------------------- /docs/sphinx-doc/source/readme/readme_v01.01.17.x.rst: -------------------------------------------------------------------------------- 1 | ************************* 2 | v01.01.17.x 3 | ************************* 4 | 5 | New Features 6 | ============= 7 | * Reduce OpenCL runtime overhead by removing calls to setpriority and usleep in worker threads 8 | 9 | These calls were required when OpenCL worker threads used to busy-wait on 10 | mailbox receive APIs on K2x devices. With the transition to MessageQ, the 11 | receive APIs no longer busy wait and the setpriority/sleep calls are no 12 | longer required. 13 | 14 | Removing setpriority improves the response time of worker threads to 15 | kernel completion messages, reducing the overhead of the OpenCL runtime. 16 | 17 | * Changes required for TIDL API v1.2 18 | 19 | Supported Evaluation Modules (EVMs) 20 | =================================== 21 | * `AM574x IDK EVM`_ 22 | * `AM572 EVM`_ (Linux and TI-RTOS hosts) 23 | * `AM571 EVM`_ 24 | * `66AK2H EVM`_ 25 | * `66AK2L EVM`_ 26 | * `66AK2E EVM`_ 27 | * `66AK2G EVM`_ 28 | 29 | .. _AM572 EVM: http://www.ti.com/tool/tmdsevm572x 30 | .. _AM571 EVM: http://www.ti.com/tool/tmdsevm572x 31 | .. _AM574x IDK EVM: http://www.ti.com/tool/tmdsidk574 32 | .. _66AK2H EVM: http://www.ti.com/tool/EVMK2H 33 | .. _66AK2L EVM: http://www.ti.com/tool/XEVMK2LX 34 | .. _66AK2E EVM: http://www.ti.com/tool/XEVMK2EX 35 | .. _66AK2G EVM: http://www.ti.com/tool/EVMK2G 36 | -------------------------------------------------------------------------------- /docs/sphinx-doc/source/readme/readme_v01.01.18.x.rst: -------------------------------------------------------------------------------- 1 | ************************* 2 | v01.01.18.x 3 | ************************* 4 | 5 | New Features 6 | ============= 7 | * Changes required for TIDL API v1.3 8 | 9 | Supported Evaluation Modules (EVMs) 10 | =================================== 11 | * `AM574x IDK EVM`_ 12 | * `AM572 EVM`_ (Linux and TI-RTOS hosts) 13 | * `AM571 EVM`_ 14 | * `66AK2H EVM`_ 15 | * `66AK2L EVM`_ 16 | * `66AK2E EVM`_ 17 | * `66AK2G EVM`_ 18 | 19 | .. _AM572 EVM: http://www.ti.com/tool/tmdsevm572x 20 | .. _AM571 EVM: http://www.ti.com/tool/tmdsevm572x 21 | .. _AM574x IDK EVM: http://www.ti.com/tool/tmdsidk574 22 | .. _66AK2H EVM: http://www.ti.com/tool/EVMK2H 23 | .. _66AK2L EVM: http://www.ti.com/tool/XEVMK2LX 24 | .. _66AK2E EVM: http://www.ti.com/tool/XEVMK2EX 25 | .. _66AK2G EVM: http://www.ti.com/tool/EVMK2G 26 | -------------------------------------------------------------------------------- /docs/sphinx-doc/source/readme/readme_v01.01.19.x.rst: -------------------------------------------------------------------------------- 1 | ************************* 2 | v01.01.19.x 3 | ************************* 4 | 5 | New Features 6 | ============= 7 | * OpenCL 1.2 compatible printf routine with support for vector data types 8 | * Support for select OpenCL 1.2 APIs including: 9 | * clGetKernelArgInfo() 10 | * clEnqueueBarrierWithWaitList() 11 | * clEnqueueMigrateMemObject() 12 | * Support for OpenCL 1.2 buffer creation flags 13 | * CL_MEM_HOST_WRITE_ONLY 14 | * CL_MEM_HOST_READ_ONLY 15 | * CL_MEM_HOST_NO_ACCESS 16 | * Support for cl_map flag CL_MAP_WRITE_INVALIDATE_REGION 17 | 18 | Supported Evaluation Modules (EVMs) 19 | =================================== 20 | * `AM574x IDK EVM`_ 21 | * `AM572 EVM`_ (Linux and TI-RTOS hosts) 22 | * `AM571 EVM`_ 23 | * `66AK2H EVM`_ 24 | * `66AK2L EVM`_ 25 | * `66AK2E EVM`_ 26 | * `66AK2G EVM`_ 27 | 28 | .. _AM572 EVM: http://www.ti.com/tool/tmdsevm572x 29 | .. _AM571 EVM: http://www.ti.com/tool/tmdsevm572x 30 | .. _AM574x IDK EVM: http://www.ti.com/tool/tmdsidk574 31 | .. _66AK2H EVM: http://www.ti.com/tool/EVMK2H 32 | .. _66AK2L EVM: http://www.ti.com/tool/XEVMK2LX 33 | .. _66AK2E EVM: http://www.ti.com/tool/XEVMK2EX 34 | .. _66AK2G EVM: http://www.ti.com/tool/EVMK2G 35 | -------------------------------------------------------------------------------- /docs/sphinx-doc/source/readme/readme_v01.02.00.x.rst: -------------------------------------------------------------------------------- 1 | ************************* 2 | v01.02.00.x 3 | ************************* 4 | 5 | New Features 6 | ============= 7 | * Full OpenCL 1.2 support 8 | * Support for select OpenCL 1.2 APIs including: 9 | * clCompileProgram() 10 | * clLinkProgram() 11 | * Support for OpenCL 1.2 clGetProgramBuildInfo query 12 | * CL_PROGRAM_BINARY_TYPE 13 | 14 | Supported Evaluation Modules (EVMs) 15 | =================================== 16 | * `AM574x IDK EVM`_ 17 | * `AM572 EVM`_ (Linux and TI-RTOS hosts) 18 | * `AM571 EVM`_ 19 | * `66AK2H EVM`_ 20 | * `66AK2L EVM`_ 21 | * `66AK2E EVM`_ 22 | * `66AK2G EVM`_ 23 | 24 | .. _AM572 EVM: http://www.ti.com/tool/tmdsevm572x 25 | .. _AM571 EVM: http://www.ti.com/tool/tmdsevm572x 26 | .. _AM574x IDK EVM: http://www.ti.com/tool/tmdsidk574 27 | .. _66AK2H EVM: http://www.ti.com/tool/EVMK2H 28 | .. _66AK2L EVM: http://www.ti.com/tool/XEVMK2LX 29 | .. _66AK2E EVM: http://www.ti.com/tool/XEVMK2EX 30 | .. _66AK2G EVM: http://www.ti.com/tool/EVMK2G 31 | -------------------------------------------------------------------------------- /docs/sphinx-doc/source/reference.rst: -------------------------------------------------------------------------------- 1 | ****************** 2 | Reference Material 3 | ****************** 4 | 5 | OpenCL is an open standard maintained by the Khronos Group. TI's OpenCL implementation conforms to the OpenCL 1.1 standard. Generic OpenCL 1.1 documentation is applicable to TI's implementation. 6 | 7 | Reference material from Khronos 8 | +++++++++++++++++++++++++++++++ 9 | 10 | .. image:: images/logo_opencl.png 11 | :align: right 12 | 13 | - `OpenCL 1.1 specification `_ 14 | - `OpenCL 1.1 C++ bindings specification `_ 15 | - `OpenCL 1.1 on-line manual pages `_ 16 | - `OpenCL 1.1 quick reference card `_ 17 | - `Khronos OpenCL resources page `_ 18 | 19 | 20 | Specific to TI's implementation 21 | +++++++++++++++++++++++++++++++ 22 | * `Using OpenCL™ to offload to C66x DSPs on Sitara™ AM572x processors `_ 23 | * `Introduction to OpenCL on TI Embedded Processors `_ 24 | * `OpenCL™ & OpenMP® Offload on Sitara™ AM57x Processors `_ 25 | -------------------------------------------------------------------------------- /docs/sphinx-doc/source/rtos/advanced.rst: -------------------------------------------------------------------------------- 1 | ****************************************************** 2 | Advanced OpenCL RTOS Application Development 3 | ****************************************************** 4 | Advanced OpenCL RTOS application development requires much deeper RTOS 5 | knowledge and more RTOS/RTSC application development experience. Essentially, 6 | user can treat OpenCL runtime on host and DSP as libraries that get 7 | invoked and linked into their host and DSP programs. They can customize 8 | the platform, memory map, IPC, both the OpenCL host runtime and the OpenCL 9 | DSP runtime, etc. We reserve this mode for expert TI-RTOS users only 10 | and let them handle their own application development. 11 | 12 | .. Warning:: 13 | 14 | If programs running on DSP1 and DSP2 are different and both DSPs are 15 | participating as OpenCL compute units, user needs to make sure that OpenCL 16 | exported symbols are laid out exactly the same in each DSP's memory. 17 | The reason is that once-compiled OpenCL kernel only links against symbols 18 | on one DSP. Current OpenCL implementation relies on the fact that symbols 19 | are similarly laid out in memory on both DSPs and programs the other DSP's 20 | MMU to ensure that OpenCL exported symbols point to the correct locations. 21 | 22 | -------------------------------------------------------------------------------- /docs/sphinx-doc/source/rtos/index.rst: -------------------------------------------------------------------------------- 1 | ################### 2 | OpenCL on TI-RTOS 3 | ################### 4 | 5 | Starting with version 01.01.09.01, the OpenCL Runtime supports Cortex-A15s running TI-RTOS as host. In this chapter, we describe the OpenCL RTOS package, show how to run examples, and discuss the process of developing OpenCL application with OpenCL RTOS package. 6 | 7 | 8 | .. note:: 9 | OpenCL RTOS is only available on AM572x. 10 | 11 | .. toctree:: 12 | :maxdepth: 2 13 | 14 | overview 15 | basic 16 | advanced 17 | 18 | -------------------------------------------------------------------------------- /examples/Makefile: -------------------------------------------------------------------------------- 1 | .SILENT: 2 | 3 | ifneq ($(BUILD_OS), SYS_BIOS) 4 | # Persistent examples 5 | P_MFS = $(wildcard persistent*/Makefile) 6 | P_DIRS = $(patsubst %/Makefile,%,$(P_MFS)) 7 | 8 | # All other examples 9 | NP_MFS = $(wildcard */Makefile) 10 | NP_DIRS = $(patsubst %/Makefile,%,$(NP_MFS)) 11 | NP_DIRS := $(filter-out $(P_DIRS),$(NP_DIRS)) 12 | 13 | ifeq ($(EXAMPLE_SET), PERSISTENT_ONLY) 14 | DIRS = $(P_DIRS) 15 | else ifeq ($(EXAMPLE_SET), EXCLUDE_PERSISTENT) 16 | DIRS = $(NP_DIRS) 17 | else 18 | DIRS = $(NP_DIRS) $(P_DIRS) 19 | endif 20 | else 21 | MFS = $(wildcard */Makefile.rtos) 22 | DIRS = $(patsubst %/Makefile.rtos,%,$(MFS)) 23 | MAKEFILE = -f Makefile.rtos 24 | endif 25 | 26 | ifeq ($(OS), Windows_NT) 27 | define make_in_dirs 28 | for %%D in ($(1)) do \ 29 | echo =============== %%D ================= & \ 30 | $(MAKE) $(MAKEFILE) -C %%D $(2) 31 | endef 32 | else # Linux 33 | define make_in_dirs 34 | for dir in $(1); do \ 35 | echo "=============== " $$dir " =================" ; \ 36 | $(MAKE) --no-print-directory $(MAKEFILE) -C $$dir $(2); \ 37 | done 38 | endef 39 | endif 40 | 41 | 42 | all: 43 | $(call make_in_dirs, $(DIRS), ) 44 | 45 | .PHONY: test 46 | test: 47 | $(call make_in_dirs, $(DIRS), test) 48 | 49 | .PHONY: cross 50 | cross: all 51 | 52 | .PHONY: clean 53 | clean: 54 | $(call make_in_dirs, $(DIRS), clean) 55 | 56 | -------------------------------------------------------------------------------- /examples/abort_exit/Makefile: -------------------------------------------------------------------------------- 1 | EXE = abort_exit 2 | CXXFLAGS = -O3 3 | 4 | include ../make.inc 5 | 6 | $(EXE): main.o 7 | @$(CXX) $(CXXFLAGS) $< $(LDFLAGS) $(LIBS) -o $@ 8 | 9 | main.o: kernel.dsp_h 10 | -------------------------------------------------------------------------------- /examples/abort_exit/Makefile.rtos: -------------------------------------------------------------------------------- 1 | EXE = abort_exit 2 | srcs = main.cpp 3 | CL6X_FLAGS= -o3 4 | CLOCL_FLAGS= 5 | 6 | include ../make_rtos.inc 7 | 8 | bin/$(PROFILE)/main.oa15fg: kernel.dsp_h 9 | 10 | -------------------------------------------------------------------------------- /examples/abort_exit/kernel.cl: -------------------------------------------------------------------------------- 1 | extern void abort(); 2 | extern void exit(int); 3 | 4 | kernel void devset(global char* buf, int abort_gid) 5 | { 6 | if (get_global_id(0) == abort_gid) abort(); 7 | buf[get_global_id(0)] = 'x'; 8 | } 9 | 10 | kernel void devset_t(global char* buf, int size, int exit_gid) 11 | { 12 | int i; 13 | for (i = 0; i < size; i++) 14 | { 15 | if (i == exit_gid) exit(-42); 16 | buf[i] = 'x'; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /examples/buffer/Makefile: -------------------------------------------------------------------------------- 1 | EXE = buffer 2 | CXXFLAGS = -O3 3 | 4 | include ../make.inc 5 | 6 | $(EXE): main.o 7 | @$(CXX) $(CXXFLAGS) main.o $(LDFLAGS) $(LIBS) -o $@ 8 | 9 | -------------------------------------------------------------------------------- /examples/buffer/Makefile.rtos: -------------------------------------------------------------------------------- 1 | EXE = buffer 2 | srcs = main.cpp 3 | 4 | include ../make_rtos.inc 5 | 6 | -------------------------------------------------------------------------------- /examples/ccode/Makefile: -------------------------------------------------------------------------------- 1 | EXE = ccode 2 | CXXFLAGS = -O3 3 | CL6XFLAGS = -O3 4 | CLOCLFLAGS = 5 | 6 | include ../make.inc 7 | 8 | $(EXE): main.o ccode.obj 9 | @$(CXX) $(CXXFLAGS) main.o $(LDFLAGS) $(LIBS) -o $@ 10 | -------------------------------------------------------------------------------- /examples/ccode/Makefile.rtos: -------------------------------------------------------------------------------- 1 | EXE = ccode 2 | srcs = main.cpp 3 | CL6X_FLAGS= -o3 4 | CLOCL_FLAGS= 5 | 6 | PROFILE=release 7 | 8 | include ../make_rtos.inc 9 | 10 | bin/$(PROFILE)/main.oa15fg: oclwrapper.dsp_h 11 | 12 | oclwrapper.dsp_h: ccode.obj 13 | 14 | -------------------------------------------------------------------------------- /examples/conv1d/Makefile: -------------------------------------------------------------------------------- 1 | EXE = conv1d 2 | CXXFLAGS = -O3 3 | CL6XFLAGS = -o3 -mw --symdebug:none 4 | 5 | include ../make.inc 6 | 7 | $(EXE): main.o 8 | @$(CXX) $(CXXFLAGS) main.o $(LDFLAGS) $(LIBS) -lrt -o $@ 9 | 10 | main.o: ti_kernels.dsp_h 11 | 12 | ti_kernels.dsp_h: k_extc.obj 13 | 14 | -------------------------------------------------------------------------------- /examples/conv1d/Makefile.rtos: -------------------------------------------------------------------------------- 1 | EXE = conv1d 2 | srcs = main.cpp 3 | CL6X_FLAGS = -o3 -mw --symdebug:none 4 | CLOCL_FLAGS = 5 | 6 | include ../make_rtos.inc 7 | 8 | bin/$(PROFILE)/main.oa15fg: ti_kernels.dsp_h 9 | 10 | ti_kernels.dsp_h: k_extc.obj 11 | 12 | -------------------------------------------------------------------------------- /examples/dgemm/Makefile: -------------------------------------------------------------------------------- 1 | EXE = dgemm 2 | CXXFLAGS = -O3 3 | BOTHCBLAS = -Llibcblas_atlas_arm -lcblas -latlas -Llibcblas_dgemm_dsp -lcblas_dgemm_dsp -lOpenCL -locl_util -lpthread 4 | 5 | include ../make.inc 6 | 7 | dgemm: main.o libcblas_dgemm_dsp/libcblas_dgemm_dsp.a 8 | $(CXX) $(CXXFLAGS) main.o $(LDFLAGS) $(BOTHCBLAS) -lrt -o $@ 9 | 10 | libcblas_dgemm_dsp/libcblas_dgemm_dsp.a: 11 | $(MAKE) -C libcblas_dgemm_dsp 12 | 13 | clean:: 14 | $(MAKE) -C libcblas_dgemm_dsp clean 15 | rm -f $(EXES) *.o .a* 16 | 17 | -------------------------------------------------------------------------------- /examples/dgemm/cblas_dgemm_dsp.h: -------------------------------------------------------------------------------- 1 | #ifndef CBLAS_DGEMM_DSP_H 2 | #define CBLAS_DGEMM_DSP_H 3 | 4 | extern "C" 5 | void ocl_init(bool, int *); 6 | 7 | extern "C" 8 | void ocl_free(); 9 | 10 | extern "C" 11 | void dsp_cblas_dgemm(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, 12 | const enum CBLAS_TRANSPOSE TransB, const int M, const int N, 13 | const int K, const double alpha, const double *A, 14 | const int lda, const double *B, const int ldb, 15 | const double beta, double *C, const int ldc); 16 | 17 | #endif // CBLAS_DGEMM_DSP_H 18 | -------------------------------------------------------------------------------- /examples/dgemm/libcblas_atlas_arm/libatlas.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcn-ee/ti-opencl/b1dfed9af21a1236380b9d643c432e4f0c619fce/examples/dgemm/libcblas_atlas_arm/libatlas.a -------------------------------------------------------------------------------- /examples/dgemm/libcblas_atlas_arm/libcblas.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcn-ee/ti-opencl/b1dfed9af21a1236380b9d643c432e4f0c619fce/examples/dgemm/libcblas_atlas_arm/libcblas.a -------------------------------------------------------------------------------- /examples/dgemm/libcblas_atlas_arm/libptcblas.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcn-ee/ti-opencl/b1dfed9af21a1236380b9d643c432e4f0c619fce/examples/dgemm/libcblas_atlas_arm/libptcblas.a -------------------------------------------------------------------------------- /examples/dgemm/libcblas_dgemm_dsp/Makefile: -------------------------------------------------------------------------------- 1 | CXXFLAGS = -O3 -Wall -fpic 2 | CL6XFLAGS = -o3 --omp -mv6600 --abi=eabi -I$(TARGET_ROOTDIR)/usr/share/ti/opencl -I$(TI_OCL_CGT_INSTALL)/include -I$(TARGET_ROOTDIR)/usr/share/ti/cgt-c6x/include 3 | 4 | all: libcblas_dgemm_dsp.a 5 | 6 | include ../../make.inc 7 | 8 | libcblas_dgemm_dsp.a: cblas_dgemm.o init.o 9 | ar r $@ $^ 10 | 11 | init.o : init.cpp kernel.dsp_h 12 | 13 | kernel.dsp_h: kernel.cl dgemm.obj dgemm_kernel.obj data_move.obj dgemm_omp.obj 14 | $(CLOCL) --txt $^ 15 | 16 | %.obj: %.c 17 | $(CL6X) -c $(CL6XFLAGS) $< 18 | 19 | clean:: 20 | rm -f *.o* *.dsp_h *.a 21 | -------------------------------------------------------------------------------- /examples/dgemm/libcblas_dgemm_dsp/ocl.h: -------------------------------------------------------------------------------- 1 | #ifndef _OCL_H_ 2 | #define _OCL_H_ 3 | #include 4 | 5 | #define DLL_PUBLIC __attribute__ ((visibility ("default"))) 6 | 7 | typedef struct 8 | { 9 | cl::Context *context; 10 | cl::CommandQueue *queueInOrder; 11 | cl::CommandQueue *queueOutOfOrder; 12 | cl::Program *program; 13 | cl::Kernel *K_cblas_dgemm; 14 | } ocl_t; 15 | 16 | typedef struct 17 | { 18 | int L2_BUF_SIZE; 19 | int MSMC_BUF_SIZE; 20 | int NUMAPANELS; 21 | int NUMBPANELS; 22 | int NUMCOMPUNITS; 23 | } dgemm_params_t; 24 | 25 | extern ocl_t ocl; 26 | extern dgemm_params_t dparams; 27 | 28 | extern "C" void DLL_PUBLIC ocl_init(bool, int *); 29 | extern "C" void DLL_PUBLIC ocl_free(); 30 | 31 | #endif // _OCL_H_ 32 | -------------------------------------------------------------------------------- /examples/dspheap/Makefile: -------------------------------------------------------------------------------- 1 | EXE = dspheap 2 | CXXFLAGS = -O3 3 | CLOCLFLAGS = 4 | 5 | include ../make.inc 6 | 7 | $(EXE): main.o 8 | @$(CXX) $(CXXFLAGS) main.o $(LDFLAGS) $(LIBS) -o $@ 9 | 10 | main.o: kernels.dsp_h 11 | -------------------------------------------------------------------------------- /examples/dsplib_fft/Makefile: -------------------------------------------------------------------------------- 1 | EXE = dsplib_fft 2 | CXXFLAGS = -O3 3 | 4 | include ../make.inc 5 | 6 | DSPLIB_LIB ?= dsplib_3_4_0_0.ae66 7 | 8 | $(EXE): fft_ocl.o 9 | @$(CXX) $(CXXFLAGS) $< $(LDFLAGS) $(LIBS) -o $@ 10 | 11 | fft_ocl.o: kernel.dsp_h 12 | 13 | kernel.dsp_h: kernel.cl $(DSPLIB_LIB) 14 | 15 | -------------------------------------------------------------------------------- /examples/dsplib_fft/Makefile.rtos: -------------------------------------------------------------------------------- 1 | EXE = dsplib_fft 2 | srcs = fft_ocl.cpp 3 | CL6X_FLAGS= -o3 4 | CLOCL_FLAGS= 5 | 6 | include ../make_rtos.inc 7 | 8 | DSPLIB_LIB ?= dsplib_3_4_0_0.ae66 9 | 10 | bin/$(PROFILE)/fft_ocl.oa15fg: kernel.dsp_h 11 | 12 | kernel.dsp_h: kernel.cl $(DSPLIB_LIB) 13 | 14 | -------------------------------------------------------------------------------- /examples/dsplib_fft/dsplib_3_4_0_0.ae66: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcn-ee/ti-opencl/b1dfed9af21a1236380b9d643c432e4f0c619fce/examples/dsplib_fft/dsplib_3_4_0_0.ae66 -------------------------------------------------------------------------------- /examples/edmabw/Makefile: -------------------------------------------------------------------------------- 1 | EXE = edmabw 2 | CXXFLAGS = -O3 3 | include ../make.inc 4 | 5 | $(EXE): main.o 6 | @$(CXX) $(CXXFLAGS) main.o $(LDFLAGS) $(LIBS) -o $@ 7 | 8 | main.o: kernel.dsp_h 9 | -------------------------------------------------------------------------------- /examples/edmabw/Makefile.rtos: -------------------------------------------------------------------------------- 1 | EXE = edmabw 2 | srcs = main.cpp 3 | CL6X_FLAGS= -o3 4 | CLOCL_FLAGS= -g 5 | 6 | include ../make_rtos.inc 7 | 8 | bin/$(PROFILE)/main.oa15fg: kernel.dsp_h 9 | 10 | -------------------------------------------------------------------------------- /examples/edmamgr/Makefile: -------------------------------------------------------------------------------- 1 | EXE = edmamgr 2 | CXXFLAGS = -O3 3 | include ../make.inc 4 | 5 | $(EXE): main.o 6 | @$(CXX) $(CXXFLAGS) main.o $(LDFLAGS) $(LIBS) -o $@ 7 | 8 | main.o: kernel.dsp_h 9 | -------------------------------------------------------------------------------- /examples/edmamgr/Makefile.rtos: -------------------------------------------------------------------------------- 1 | EXE = edmamgr 2 | srcs = main.cpp 3 | CL6X_FLAGS= -o3 4 | CLOCL_FLAGS= -g 5 | 6 | include ../make_rtos.inc 7 | 8 | bin/$(PROFILE)/main.oa15fg: kernel.dsp_h 9 | 10 | -------------------------------------------------------------------------------- /examples/float_compute/Makefile: -------------------------------------------------------------------------------- 1 | EXE = float_compute 2 | CXXFLAGS = -O3 -ftree-vectorize -fopenmp -march=armv7-a -mfpu=neon -mfloat-abi=hard 3 | CLOCLFLAGS = 4 | 5 | include ../make.inc 6 | 7 | $(EXE): main.o dsp_compute.out 8 | @$(CXX) $(CXXFLAGS) main.o $(LDFLAGS) $(LIBS) -o $@ -lrt -ldl 9 | -------------------------------------------------------------------------------- /examples/float_compute/Makefile.rtos: -------------------------------------------------------------------------------- 1 | EXE = float_compute 2 | srcs = main.cpp 3 | CL6X_FLAGS= -o3 4 | CLOCL_FLAGS= 5 | 6 | PROFILE=release 7 | 8 | include ../make_rtos.inc 9 | 10 | bin/$(PROFILE)/main.oa15fg: dsp_compute.dsp_h 11 | 12 | 13 | -------------------------------------------------------------------------------- /examples/mandelbrot/Makefile: -------------------------------------------------------------------------------- 1 | EXE = mandelbrot 2 | CXXFLAGS = -O3 3 | LIBSDL = -lSDL 4 | 5 | include ../make.inc 6 | 7 | $(EXE): main.o 8 | @$(CXX) $(CXXFLAGS) main.o $(LDFLAGS) $(LIBS) $(LIBSDL) -lrt -o $@ 9 | -------------------------------------------------------------------------------- /examples/mandelbrot_native/Makefile: -------------------------------------------------------------------------------- 1 | EXE = mandelbrot_native 2 | CXXFLAGS = -O3 -fopenmp 3 | LIBSDL = -lSDL 4 | 5 | include ../make.inc 6 | 7 | $(EXE): main.o mandelbrot.o 8 | @$(CXX) $(CXXFLAGS) $^ $(LDFLAGS) $(LIBS) $(LIBSDL) -lgomp -lrt -o $@ 9 | -------------------------------------------------------------------------------- /examples/matmpy/Makefile: -------------------------------------------------------------------------------- 1 | EXE = matmpy 2 | CXXFLAGS = -O3 -fopenmp 3 | CL6XFLAGS = -o3 4 | CLOCLFLAGS = 5 | 6 | include ../make.inc 7 | 8 | $(EXE): main.o kernel.out 9 | @$(CXX) $(CXXFLAGS) main.o $(LDFLAGS) $(LIBS) -lrt -ldl -lgomp -o $@ 10 | 11 | kernel.out: ccode.obj 12 | -------------------------------------------------------------------------------- /examples/matmpy/Makefile.rtos: -------------------------------------------------------------------------------- 1 | EXE = matmpy 2 | srcs = main.cpp 3 | CL6X_FLAGS= -o3 4 | 5 | include ../make_rtos.inc 6 | 7 | bin/$(PROFILE)/main.oa15fg: kernel.dsp_h 8 | 9 | kernel.dsp_h: kernel.cl ccode.obj 10 | 11 | -------------------------------------------------------------------------------- /examples/monte_carlo/Makefile: -------------------------------------------------------------------------------- 1 | EXE = monte_carlo 2 | CXXFLAGS = -O3 -mfpu=neon -ftree-vectorize -funsafe-math-optimizations 3 | CL6XFLAGS = -O3 4 | 5 | include ../make.inc 6 | 7 | cpu_main.o: dsp_kernels.dsp_h initial.h 8 | dsp_ccode.obj: initial.h 9 | dsp_kernels.dsp_h: dsp_ccode.obj 10 | 11 | $(EXE): cpu_main.o dsp_ccode.obj 12 | @$(CXX) $(CXXFLAGS) cpu_main.o $(LDFLAGS) $(LIBS) -o $@ 13 | 14 | -------------------------------------------------------------------------------- /examples/null/Makefile: -------------------------------------------------------------------------------- 1 | EXE = null 2 | CXXFLAGS = -O3 3 | 4 | include ../make.inc 5 | 6 | $(EXE): main.o 7 | @$(CXX) $(CXXFLAGS) main.o $(LDFLAGS) $(LIBS) -lrt -o $@ 8 | -------------------------------------------------------------------------------- /examples/null/Makefile.rtos: -------------------------------------------------------------------------------- 1 | EXE = null 2 | srcs = main.cpp 3 | 4 | include ../make_rtos.inc 5 | 6 | bin/$(PROFILE)/main.oa15fg: kernel.dsp_h 7 | 8 | -------------------------------------------------------------------------------- /examples/null/kernel.cl: -------------------------------------------------------------------------------- 1 | kernel void Null() 2 | { 3 | } 4 | -------------------------------------------------------------------------------- /examples/offline/Makefile: -------------------------------------------------------------------------------- 1 | EXE = offline 2 | CXXFLAGS = -O3 3 | CLOCLFLAGS = 4 | 5 | include ../make.inc 6 | 7 | $(EXE): main.o vadd.out 8 | @$(CXX) $(CXXFLAGS) main.o $(LDFLAGS) $(LIBS) -o $@ 9 | -------------------------------------------------------------------------------- /examples/offline_embed/Makefile: -------------------------------------------------------------------------------- 1 | EXE = offline_embed 2 | CXXFLAGS = -O3 3 | CLOCLFLAGS = 4 | 5 | include ../make.inc 6 | 7 | $(EXE): main.o 8 | @$(CXX) $(CXXFLAGS) main.o $(LDFLAGS) $(LIBS) -o $@ 9 | 10 | main.o: vadd.dsp_h 11 | -------------------------------------------------------------------------------- /examples/offline_embed/Makefile.rtos: -------------------------------------------------------------------------------- 1 | EXE = offline_embed 2 | srcs = main.cpp 3 | 4 | include ../make_rtos.inc 5 | 6 | bin/$(PROFILE)/main.oa15fg: vadd.dsp_h 7 | 8 | -------------------------------------------------------------------------------- /examples/ooo/Makefile: -------------------------------------------------------------------------------- 1 | EXE = ooo 2 | CXXFLAGS = -g -O0 -fno-inline 3 | 4 | include ../make.inc 5 | 6 | $(EXE): ooo.o 7 | @$(CXX) $(CXXFLAGS) $< $(LDFLAGS) $(LIBS) -lrt -o $@ 8 | -------------------------------------------------------------------------------- /examples/ooo/ooo-dependencies.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcn-ee/ti-opencl/b1dfed9af21a1236380b9d643c432e4f0c619fce/examples/ooo/ooo-dependencies.jpg -------------------------------------------------------------------------------- /examples/ooo_callback/Makefile: -------------------------------------------------------------------------------- 1 | EXE = ooo_callback 2 | CXXFLAGS = -g -O0 -fno-inline 3 | 4 | include ../make.inc 5 | 6 | $(EXE): ooo_callback.o 7 | @$(CXX) $(CXXFLAGS) $< $(LDFLAGS) $(LIBS) -lrt -o $@ 8 | 9 | -------------------------------------------------------------------------------- /examples/ooo_callback/Makefile.rtos: -------------------------------------------------------------------------------- 1 | EXE = ooo_callback 2 | srcs = ooo_callback.cpp 3 | 4 | include ../make_rtos.inc 5 | 6 | bin/$(PROFILE)/ooo_callback.oa15fg: kernel.dsp_h 7 | 8 | -------------------------------------------------------------------------------- /examples/ooo_callback/kernel.cl: -------------------------------------------------------------------------------- 1 | kernel void compute(global int* buf, int size) 2 | { 3 | for (int i = 0; i< size; ++i) 4 | buf[i] += 1; 5 | } 6 | -------------------------------------------------------------------------------- /examples/ooo_callback/ooo-dependencies.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcn-ee/ti-opencl/b1dfed9af21a1236380b9d643c432e4f0c619fce/examples/ooo_callback/ooo-dependencies.jpg -------------------------------------------------------------------------------- /examples/ooo_map/Makefile: -------------------------------------------------------------------------------- 1 | EXE = ooo_map 2 | CXXFLAGS = -g -O0 -fno-inline 3 | 4 | include ../make.inc 5 | 6 | $(EXE): ooo.o 7 | @$(CXX) $(CXXFLAGS) $< $(LDFLAGS) $(LIBS) -lrt -o $@ 8 | -------------------------------------------------------------------------------- /examples/persistent_clock_concurrent/Makefile: -------------------------------------------------------------------------------- 1 | EXE = persistent_clock_concurrent 2 | CXXFLAGS = -O3 -I../persistent_common 3 | CL6XFLAGS = -o2 -I../persistent_common --mem_model:data=far --mem_model:const=data 4 | CLOCLFLAGS = 5 | USE_RTOS = 1 6 | 7 | 8 | VPATH = ../persistent_common 9 | 10 | include ../make.inc 11 | 12 | $(EXE): host.o host_assist.o 13 | @echo Linking $@ 14 | $(CXX) $(CXXFLAGS) $^ $(LDFLAGS) $(LIBS) -o $@ 15 | 16 | host.o: kernel.dsp_h 17 | 18 | kernel.dsp_h: dsp.obj 19 | -------------------------------------------------------------------------------- /examples/persistent_clock_concurrent/kernel.cl: -------------------------------------------------------------------------------- 1 | void start_clock(global uint32_t *completion_code); 2 | 3 | kernel void wrapper(global uint32_t *completion_code) 4 | { 5 | start_clock(completion_code); 6 | } 7 | -------------------------------------------------------------------------------- /examples/persistent_clock_spanning/Makefile: -------------------------------------------------------------------------------- 1 | EXE = persistent_clock_spanning 2 | CXXFLAGS = -O3 -I../persistent_common 3 | CL6XFLAGS = -o2 -I../persistent_common --mem_model:data=far --mem_model:const=data 4 | CLOCLFLAGS = 5 | USE_RTOS = 1 6 | 7 | VPATH = ../persistent_common 8 | 9 | include ../make.inc 10 | 11 | $(EXE): host.o host_assist.o 12 | @echo Linking $@ 13 | $(CXX) $(CXXFLAGS) $^ $(LDFLAGS) $(LIBS) -o $@ 14 | 15 | host.o: kernel.dsp_h 16 | 17 | kernel.dsp_h: dsp.obj 18 | -------------------------------------------------------------------------------- /examples/persistent_clock_spanning/kernel.cl: -------------------------------------------------------------------------------- 1 | void start_clock(global uint32_t *completion_code); 2 | void stop_clock (global uint32_t *completion_code); 3 | 4 | kernel void Kstart_clock(global uint32_t *completion_code) 5 | { 6 | start_clock(completion_code); 7 | } 8 | 9 | kernel void Kstop_clock(global uint32_t *completion_code) 10 | { 11 | stop_clock(completion_code); 12 | } 13 | -------------------------------------------------------------------------------- /examples/persistent_common/host_assist.h: -------------------------------------------------------------------------------- 1 | #ifndef _HOST_ASSIST_H_ 2 | #define _HOST_ASSIST_H_ 3 | 4 | #include 5 | #include 6 | 7 | /*----------------------------------------------------------------------------- 8 | * Prototypes 9 | *----------------------------------------------------------------------------*/ 10 | void assert_am57x (cl::Device &device); 11 | void print_completion_code(uint32_t completion_code); 12 | 13 | #endif // _HOST_ASSIST_H_ 14 | -------------------------------------------------------------------------------- /examples/persistent_common/shared.h: -------------------------------------------------------------------------------- 1 | #ifndef _SHARED_H_ 2 | #define _SHARED_H_ 3 | 4 | typedef enum 5 | { 6 | APP_OK, 7 | APP_FAIL, 8 | APP_TIMEOUT, 9 | APP_FAIL_STACK, 10 | APP_FAIL_TASK, 11 | APP_FAIL_SEMAPHORE, 12 | APP_FAIL_CLOCK, 13 | } kernel_status_codes; 14 | 15 | #endif // _SHARED_H_ 16 | -------------------------------------------------------------------------------- /examples/persistent_kernel_timeout/Makefile: -------------------------------------------------------------------------------- 1 | EXE = persistent_kernel_timeout 2 | CXXFLAGS = -O3 -I../persistent_common 3 | CL6XFLAGS = -o2 -I../persistent_common --mem_model:data=far --mem_model:const=data 4 | CLOCLFLAGS = 5 | USE_RTOS = 1 6 | 7 | VPATH = ../persistent_common 8 | 9 | include ../make.inc 10 | 11 | $(EXE): host.o host_assist.o 12 | @echo Linking $@ 13 | $(CXX) $(CXXFLAGS) $^ $(LDFLAGS) $(LIBS) -o $@ 14 | 15 | host.o: kernel.dsp_h 16 | 17 | kernel.dsp_h: dsp.obj 18 | -------------------------------------------------------------------------------- /examples/persistent_kernel_timeout/kernel.cl: -------------------------------------------------------------------------------- 1 | void ccode(uint32_t timeout_ms, global uint32_t *completion_code); 2 | 3 | kernel void wrapper(uint32_t timeout_ms, global uint32_t *completion_code) 4 | { 5 | ccode(timeout_ms, completion_code); 6 | } 7 | -------------------------------------------------------------------------------- /examples/persistent_messageq_concurrent/Makefile: -------------------------------------------------------------------------------- 1 | EXE = persistent_messageq_concurrent 2 | include ../make.inc 3 | 4 | $(EXE): 5 | @$(MAKE) -C dsp kernel.dsp_h 6 | @$(MAKE) -C host 7 | 8 | clean:: 9 | @$(MAKE) -C dsp clean 10 | @$(MAKE) -C host clean 11 | 12 | -------------------------------------------------------------------------------- /examples/persistent_messageq_concurrent/dsp/Makefile: -------------------------------------------------------------------------------- 1 | CL6XFLAGS = -o2 -I../../persistent_common --mem_model:data=far --mem_model:const=data 2 | CLOCLLAGS = 3 | USE_RTOS = 1 4 | 5 | include ../../make.inc 6 | 7 | kernel.dsp_h: dsp.obj 8 | 9 | dsp.obj: heapbuf.h 10 | dsp.obj: messageq.h 11 | -------------------------------------------------------------------------------- /examples/persistent_messageq_concurrent/dsp/dsp.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include "heapbuf.h" 7 | #include "messageq.h" 8 | #include "shared.h" 9 | 10 | #define MESSAGES 500 11 | 12 | /****************************************************************************** 13 | * Called from OpenCL kernel wrapper 14 | ******************************************************************************/ 15 | void ccode(uint32_t qid, uint32_t *completion_code) 16 | { 17 | HeapBuf_Handle heap = heapbuf_construct (1, sizeof(MessageQ_MsgHeader)); 18 | if (!heap) { *completion_code = APP_FAIL; return; } 19 | 20 | MessageQ_QueueId msgq = messageq_construct(qid, heap); 21 | if (!msgq) { *completion_code = APP_FAIL; return; } 22 | 23 | MessageQ_registerHeap(heap, 1); 24 | 25 | int i; 26 | for (i = 0; i < MESSAGES; i++) 27 | { 28 | Task_sleep(1); // simulate 1 ms of computation load 29 | messageq_send(msgq, i); 30 | } 31 | messageq_send(msgq, 0xFFFFu); 32 | 33 | messageq_destruct(msgq); 34 | heapbuf_destruct (heap); 35 | 36 | printf("DSP sent %d messages\n", MESSAGES); 37 | *completion_code = APP_OK; 38 | } 39 | -------------------------------------------------------------------------------- /examples/persistent_messageq_concurrent/dsp/kernel.cl: -------------------------------------------------------------------------------- 1 | void ccode(uint32_t qid, global uint32_t *completion_code); 2 | 3 | kernel void wrapper(uint32_t qid, global uint32_t *completion_code) 4 | { 5 | ccode(qid, completion_code); 6 | } 7 | -------------------------------------------------------------------------------- /examples/persistent_messageq_concurrent/host/Makefile: -------------------------------------------------------------------------------- 1 | EXE = ../persistent_messageq_concurrent 2 | CXXFLAGS = -O2 -I../../persistent_common 3 | 4 | VPATH = ../../persistent_common 5 | 6 | include ../../make.inc 7 | 8 | $(EXE): host.o host_assist.o 9 | @echo Linking $(EXE) 10 | $(CXX) $(CXXFLAGS) $^ $(LDFLAGS) $(LIBS) -ltiipc -o $@ 11 | 12 | host.o: ../dsp/kernel.dsp_h msgq.h 13 | -------------------------------------------------------------------------------- /examples/persistent_task_concurrent/Makefile: -------------------------------------------------------------------------------- 1 | EXE = persistent_task_concurrent 2 | CXXFLAGS = -O3 -I../persistent_common 3 | CL6XFLAGS = -o2 -I../persistent_common --mem_model:data=far --mem_model:const=data 4 | CLOCLFLAGS = 5 | USE_RTOS = 1 6 | 7 | VPATH = ../persistent_common 8 | 9 | include ../make.inc 10 | 11 | $(EXE): host.o host_assist.o 12 | @echo Linking $@ 13 | $(CXX) $(CXXFLAGS) $^ $(LDFLAGS) $(LIBS) -o $@ 14 | 15 | host.o: kernel.dsp_h 16 | 17 | kernel.dsp_h: dsp.obj 18 | -------------------------------------------------------------------------------- /examples/persistent_task_concurrent/kernel.cl: -------------------------------------------------------------------------------- 1 | void ccode(global uint32_t *completion_code); 2 | 3 | kernel void wrapper(global uint32_t *completion_code) 4 | { 5 | ccode(completion_code); 6 | } 7 | -------------------------------------------------------------------------------- /examples/persistent_task_spanning/Makefile: -------------------------------------------------------------------------------- 1 | EXE = persistent_task_spanning 2 | CXXFLAGS = -O3 -I ../persistent_common 3 | CL6XFLAGS = -o2 -I ../persistent_common --mem_model:data=far --mem_model:const=data 4 | CLOCLFLAGS = 5 | USE_RTOS = 1 6 | 7 | VPATH = ../persistent_common 8 | 9 | include ../make.inc 10 | 11 | $(EXE): host.o host_assist.o 12 | @echo Linking $@ 13 | $(CXX) $(CXXFLAGS) $^ $(LDFLAGS) $(LIBS) -o $@ 14 | 15 | host.o: kernel.dsp_h 16 | 17 | kernel.dsp_h: dsp.obj 18 | -------------------------------------------------------------------------------- /examples/persistent_task_spanning/kernel.cl: -------------------------------------------------------------------------------- 1 | void start_task(global uint32_t *completion_code); 2 | void stop_task (global uint32_t *completion_code); 3 | 4 | kernel void Kstart_dsp(global uint32_t *completion_code) 5 | { 6 | start_task(completion_code); 7 | } 8 | 9 | kernel void Kstop_dsp (global uint32_t *completion_code) 10 | { 11 | stop_task (completion_code); 12 | } 13 | -------------------------------------------------------------------------------- /examples/platforms/Makefile: -------------------------------------------------------------------------------- 1 | EXE = platforms 2 | CXXFLAGS = -O3 3 | 4 | include ../make.inc 5 | 6 | $(EXE): main.o 7 | @$(CXX) $(CXXFLAGS) main.o $(LDFLAGS) $(LIBS) -o $@ 8 | -------------------------------------------------------------------------------- /examples/platforms/Makefile.rtos: -------------------------------------------------------------------------------- 1 | EXE = platform 2 | srcs = main.cpp 3 | 4 | include ../make_rtos.inc 5 | 6 | -------------------------------------------------------------------------------- /examples/sgemm/Makefile: -------------------------------------------------------------------------------- 1 | ATLAS_INSTALL=libcblas_atlas_arm 2 | ATLAS_LIB = $(ATLAS_INSTALL)/libcblas.a $(ATLAS_INSTALL)/libatlas.a 3 | 4 | EXE = sgemm 5 | CXXFLAGS = -O3 $(ATLAS_INC) 6 | CL6XFLAGS = -o3 7 | CLOCLFLAGS = 8 | 9 | include ../make.inc 10 | 11 | LIBS += $(ATLAS_LIB) 12 | 13 | main.o: kernel.dsp_h 14 | 15 | $(EXE): main.o 16 | $(CXX) $(CXXFLAGS) main.o $(LDFLAGS) $(LIBS) -lrt -lpthread -lm -o $@ 17 | 18 | kernel.dsp_h: kernel.cl sgemm.obj sgemm_kernel.obj data_move.obj 19 | $(CLOCL) $(CLOCLFLAGS) --txt $^ 20 | -------------------------------------------------------------------------------- /examples/sgemm/Makefile.rtos: -------------------------------------------------------------------------------- 1 | ATLAS_INSTALL=libcblas_atlas_arm 2 | ATLAS_LIB = $(ATLAS_INSTALL)/libcblas.a $(ATLAS_INSTALL)/libatlas.a 3 | ## LDLIBS = $(ATLAS_LIB) 4 | 5 | EXE = sgemm 6 | srcs = main.cpp 7 | CL6X_FLAGS= -o3 8 | CLOCL_FLAGS= 9 | 10 | include ../make_rtos.inc 11 | 12 | bin/$(PROFILE)/main.oa15fg: kernel.dsp_h 13 | 14 | kernel.dsp_h: sgemm.obj sgemm_kernel.obj data_move.obj 15 | 16 | -------------------------------------------------------------------------------- /examples/sgemm/libcblas_atlas_arm/libatlas.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcn-ee/ti-opencl/b1dfed9af21a1236380b9d643c432e4f0c619fce/examples/sgemm/libcblas_atlas_arm/libatlas.a -------------------------------------------------------------------------------- /examples/sgemm/libcblas_atlas_arm/libcblas.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcn-ee/ti-opencl/b1dfed9af21a1236380b9d643c432e4f0c619fce/examples/sgemm/libcblas_atlas_arm/libcblas.a -------------------------------------------------------------------------------- /examples/sgemm/libcblas_atlas_arm/libptcblas.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcn-ee/ti-opencl/b1dfed9af21a1236380b9d643c432e4f0c619fce/examples/sgemm/libcblas_atlas_arm/libptcblas.a -------------------------------------------------------------------------------- /examples/simple/Makefile: -------------------------------------------------------------------------------- 1 | EXE = simple 2 | CXXFLAGS = -O3 3 | 4 | include ../make.inc 5 | 6 | $(EXE): simple.o 7 | @$(CXX) $(CXXFLAGS) $< $(LDFLAGS) $(LIBS) -o $@ 8 | -------------------------------------------------------------------------------- /examples/simple/Makefile.rtos: -------------------------------------------------------------------------------- 1 | EXE = simple 2 | srcs = simple.cpp 3 | CL6X_FLAGS= -o3 4 | CLOCL_FLAGS= 5 | 6 | include ../make_rtos.inc 7 | 8 | bin/$(PROFILE)/simple.oa15fg: kernel.dsp_h 9 | 10 | -------------------------------------------------------------------------------- /examples/simple/kernel.cl: -------------------------------------------------------------------------------- 1 | kernel void devset(global char* buf) 2 | { 3 | buf[get_global_id(0)] = 'x'; 4 | } 5 | -------------------------------------------------------------------------------- /examples/timeout/Makefile: -------------------------------------------------------------------------------- 1 | EXE = timeout 2 | CXXFLAGS = -O3 3 | 4 | include ../make.inc 5 | 6 | $(EXE): main.o 7 | @$(CXX) $(CXXFLAGS) $< $(LDFLAGS) $(LIBS) -o $@ 8 | 9 | main.o: kernel.dsp_h 10 | -------------------------------------------------------------------------------- /examples/timeout/Makefile.rtos: -------------------------------------------------------------------------------- 1 | EXE = timeout 2 | srcs = main.cpp 3 | CL6X_FLAGS= -o3 4 | CLOCL_FLAGS= 5 | 6 | include ../make_rtos.inc 7 | 8 | bin/$(PROFILE)/main.oa15fg: kernel.dsp_h 9 | 10 | -------------------------------------------------------------------------------- /examples/timeout/kernel.cl: -------------------------------------------------------------------------------- 1 | kernel void devset(global char* buf, int timeout_flag) 2 | { 3 | if (timeout_flag == 70 && get_local_id(0) == 0) 4 | { 5 | __cycle_delay(210 * 750000); 6 | return; 7 | } 8 | 9 | buf[get_global_id(0)] = 'x'; 10 | } 11 | 12 | kernel void devset_t(global char* buf, int size, int timeout_flag) 13 | { 14 | if (timeout_flag == 70 && get_local_id(0) == 0) 15 | { 16 | __cycle_delay(210 * 750000); 17 | return; 18 | } 19 | 20 | int i; 21 | for (i = 0; i < size; i++) 22 | buf[i] = 'x'; 23 | } 24 | -------------------------------------------------------------------------------- /examples/vecadd/Makefile: -------------------------------------------------------------------------------- 1 | EXE = vecadd 2 | EXE_MD = vecadd_md 3 | CXXFLAGS = -O3 4 | 5 | include ../make.inc 6 | 7 | $(EXE): main.o $(EXE_MD) 8 | @$(CXX) $(CXXFLAGS) main.o $(LDFLAGS) $(LIBS) -o $@ 9 | 10 | $(EXE_MD): main_md.o 11 | @$(CXX) $(CXXFLAGS) main_md.o $(LDFLAGS) $(LIBS) -lrt -o $@ 12 | 13 | clean:: 14 | @rm -fr $(EXE_MD) 15 | -------------------------------------------------------------------------------- /examples/vecadd/Makefile.rtos: -------------------------------------------------------------------------------- 1 | EXE = vecadd 2 | srcs = main.cpp 3 | 4 | ifneq ($(CORE0_ONLY),) 5 | HOSTCONFIG = MyHost.cfg 6 | $(info *** Only use DSP core 0 as OpenCL compute unit ***) 7 | endif 8 | 9 | include ../make_rtos.inc 10 | 11 | bin/$(PROFILE)/main.oa15fg: kernel.dsp_h 12 | 13 | -------------------------------------------------------------------------------- /examples/vecadd/kernel.cl: -------------------------------------------------------------------------------- 1 | kernel void VectorAdd(global const short4* a, 2 | global const short4* b, 3 | global short4* c) 4 | { 5 | int id = get_global_id(0); 6 | c[id] = a[id] + b[id]; 7 | } 8 | 9 | -------------------------------------------------------------------------------- /examples/vecadd_compile_link/Makefile: -------------------------------------------------------------------------------- 1 | EXE = vecadd_compile_link 2 | CXXFLAGS = -O3 3 | 4 | include ../make.inc 5 | 6 | $(EXE): main.o 7 | @$(CXX) $(CXXFLAGS) main.o $(LDFLAGS) $(LIBS) -o $@ 8 | 9 | clean:: 10 | @rm -fr $(EXE) 11 | -------------------------------------------------------------------------------- /examples/vecadd_compile_link_loadbinary/Makefile: -------------------------------------------------------------------------------- 1 | EXE = vecadd_compile_link_loadbinary 2 | CXXFLAGS = -O3 3 | 4 | include ../make.inc 5 | 6 | $(EXE): main.o 7 | @$(CXX) $(CXXFLAGS) main.o $(LDFLAGS) $(LIBS) -o $@ 8 | 9 | clean:: 10 | @rm -fr $(EXE) 11 | -------------------------------------------------------------------------------- /examples/vecadd_mpax/Makefile: -------------------------------------------------------------------------------- 1 | EXE = vecadd_mpax 2 | CXXFLAGS = -O3 3 | 4 | include ../make.inc 5 | 6 | $(EXE): main.o 7 | @$(CXX) $(CXXFLAGS) main.o $(LDFLAGS) $(LIBS) -o $@ 8 | 9 | -------------------------------------------------------------------------------- /examples/vecadd_mpax_openmp/Makefile: -------------------------------------------------------------------------------- 1 | EXE = vecadd_mpax_openmp 2 | CXXFLAGS = -O3 3 | CL6XFLAGS = -O3 --omp 4 | 5 | include ../make.inc 6 | 7 | $(EXE): main.o vadd_openmp.obj 8 | @$(CXX) $(CXXFLAGS) main.o $(LDFLAGS) $(LIBS) -o $@ 9 | 10 | -------------------------------------------------------------------------------- /examples/vecadd_openmp/Makefile: -------------------------------------------------------------------------------- 1 | EXE = vecadd_openmp 2 | CXXFLAGS = -O3 3 | CL6XFLAGS = -O3 --omp 4 | 5 | include ../make.inc 6 | 7 | $(EXE): main.o vadd_openmp.obj 8 | @$(CXX) $(CXXFLAGS) main.o $(LDFLAGS) $(LIBS) -o $@ 9 | -------------------------------------------------------------------------------- /examples/vecadd_openmp/Makefile.rtos: -------------------------------------------------------------------------------- 1 | EXE = vecadd 2 | CL6X_FLAGS = -O1 --omp 3 | srcs = main.cpp 4 | 5 | ifneq ($(CORE0_ONLY),) 6 | HOSTCONFIG = MyHost.cfg 7 | $(info *** Only use DSP core 0 as OpenCL compute unit ***) 8 | endif 9 | 10 | include ../make_rtos.inc 11 | 12 | bin/$(PROFILE)/main.oa15fg: vadd_wrapper.dsp_h 13 | 14 | vadd_wrapper.dsp_h: vadd_openmp.obj 15 | -------------------------------------------------------------------------------- /examples/vecadd_openmp_t/Makefile: -------------------------------------------------------------------------------- 1 | EXE = vecadd_openmp_t 2 | CXXFLAGS = -O3 3 | CL6XFLAGS = -O3 --omp 4 | 5 | include ../make.inc 6 | 7 | $(EXE): main.o vadd_openmp.obj 8 | @$(CXX) $(CXXFLAGS) main.o $(LDFLAGS) $(LIBS) -o $@ 9 | 10 | -------------------------------------------------------------------------------- /examples/vecadd_openmp_t/Makefile.rtos: -------------------------------------------------------------------------------- 1 | EXE = vecadd 2 | CL6X_FLAGS = -O1 --omp 3 | srcs = main.cpp 4 | 5 | ifneq ($(CORE0_ONLY),) 6 | HOSTCONFIG = MyHost.cfg 7 | $(info *** Only use DSP core 0 as OpenCL compute unit ***) 8 | endif 9 | 10 | include ../make_rtos.inc 11 | 12 | bin/$(PROFILE)/main.oa15fg: vadd_wrapper.dsp_h 13 | 14 | vadd_wrapper.dsp_h: vadd_openmp.obj 15 | -------------------------------------------------------------------------------- /examples/vecadd_subdevice/Makefile: -------------------------------------------------------------------------------- 1 | EXE = vecadd_subdevice 2 | CXXFLAGS = -O3 3 | 4 | include ../make.inc 5 | 6 | $(EXE): main.o 7 | @$(CXX) $(CXXFLAGS) $< $(LD_FLAGS) $(LIBS) -o $@ 8 | -------------------------------------------------------------------------------- /examples/vecadd_subdevice/kernel.cl: -------------------------------------------------------------------------------- 1 | kernel void VectorAdd(global const short4* a, 2 | global const short4* b, 3 | global short4* c) 4 | { 5 | int id = get_global_id(0); 6 | c[id] = a[id] + b[id]; 7 | } 8 | -------------------------------------------------------------------------------- /host/clocl/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | -------------------------------------------------------------------------------- /host/clocl/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | 3 | if (${CMAKE_SYSTEM_NAME} STREQUAL Windows) 4 | include(${CMAKE_CURRENT_SOURCE_DIR}/CMakeListsWin.txt) 5 | else() 6 | 7 | if (CROSS_COMPILE) 8 | set (CROSS_TARGET arm) 9 | install(DIRECTORY DESTINATION ${SHARE_PATH}/opencl ${OCL_DPERMS}) 10 | install(DIRECTORY DESTINATION ${SHARE_PATH}/opencl/bin ${OCL_DPERMS}) 11 | install(DIRECTORY DESTINATION ${SHARE_PATH}/opencl/bin/x86 ${OCL_DPERMS}) 12 | install(PROGRAMS x86/clocl DESTINATION ${SHARE_PATH}/opencl/bin/x86 ${OCL_BPERMS}) 13 | 14 | 15 | add_custom_command(OUTPUT x86/clocl COMMAND make -j4 x86 16 | _PRODUCT_VERSION=${${PROJECT_NAME}_PKG_VERSION} 17 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) 18 | add_custom_target(x86_clocl DEPENDS x86/clocl) 19 | endif() 20 | 21 | if (K2X_BUILD OR K2G_BUILD OR AM57_BUILD) 22 | if (NOT (${BUILD_OS} MATCHES "SYS_BIOS")) 23 | add_custom_command(OUTPUT arm/clocl COMMAND make -j4 ${CROSS_TARGET} 24 | _PRODUCT_VERSION=${${PROJECT_NAME}_PKG_VERSION} 25 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) 26 | 27 | add_custom_target(arm_clocl DEPENDS arm/clocl) 28 | install(PROGRAMS arm/clocl DESTINATION /usr/bin ${OCL_BPERMS}) 29 | endif() 30 | endif() 31 | 32 | endif () 33 | -------------------------------------------------------------------------------- /host/clocl/file_manip.h: -------------------------------------------------------------------------------- 1 | #ifndef _FILE_MANIP_H_ 2 | #define _FILE_MANIP_H_ 3 | #include 4 | 5 | bool fs_exists (std::string path); 6 | std::string fs_filename (std::string path); 7 | std::string fs_stem (std::string path); 8 | std::string fs_ext (std::string path); 9 | std::string fs_path (std::string path); 10 | std::string fs_replace_extension(std::string path, std::string ext); 11 | std::string fs_get_tmp_folder (); 12 | void fs_remove_file (const std::string& filename); 13 | 14 | #endif // _FILE_MANIP_H_ 15 | -------------------------------------------------------------------------------- /host/clocl/llvmopencl/config.h: -------------------------------------------------------------------------------- 1 | // Empty on purpose. Satifies includes from other files. 2 | -------------------------------------------------------------------------------- /host/clocl/options.h: -------------------------------------------------------------------------------- 1 | #ifndef _OPTIONS_H_ 2 | #define _OPTIONS_H_ 3 | 4 | #include 5 | 6 | extern int opt_help; 7 | extern int opt_verbose; 8 | extern int opt_version; 9 | extern int opt_keep; 10 | extern int opt_debug; 11 | extern int opt_symbols; 12 | extern int opt_lib; 13 | extern int opt_link; 14 | extern int opt_expsyms; 15 | extern int opt_ar_lib; 16 | extern int opt_link_opts; 17 | extern int opt_txt; 18 | extern int opt_w; 19 | extern int opt_Werror; 20 | extern int opt_builtin; 21 | extern int opt_tmpdir; 22 | extern int opt_alias; 23 | 24 | extern std::string cl_options; 25 | extern std::string cl_incdef; 26 | extern std::vector files_clc; 27 | extern std::vector files_c; 28 | extern std::string files_a; 29 | extern std::string files_out; 30 | extern std::string files_other; 31 | extern std::string file_expsyms; 32 | 33 | void process_options(int argc, char **argv); 34 | 35 | #endif //_OPTIONS_H_ 36 | -------------------------------------------------------------------------------- /host/cmake/CMakeARMToolChain.txt: -------------------------------------------------------------------------------- 1 | SET(CMAKE_SYSTEM_NAME Linux) 2 | SET(CMAKE_SYSTEM_VERSION 1) 3 | 4 | SET(CMAKE_SYSTEM_PROCESSOR ARM) 5 | SET(CROSS_COMPILE ON) 6 | 7 | # specify the cross compiler 8 | SET(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc) 9 | SET(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++) 10 | 11 | MESSAGE(STATUS "Devkit installation at " ${LINUX_DEVKIT_ROOT}) 12 | 13 | SET(CMAKE_FIND_ROOT_PATH ${LINUX_DEVKIT_ROOT} ${LINUX_DEVKIT_ROOT}/usr/include) 14 | 15 | # search for programs in the build host directories 16 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 17 | 18 | # for libraries and headers in the target directories 19 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 20 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 21 | SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH true) 22 | -------------------------------------------------------------------------------- /host/mct-daemon/ti-mct-daemon.service.am57x: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=TI MultiCore Tools Daemon 3 | 4 | [Service] 5 | Type=forking 6 | ExecStart=/usr/bin/ti-mctd 7 | 8 | [Install] 9 | WantedBy=basic.target 10 | -------------------------------------------------------------------------------- /host/mct-daemon/ti-mct-daemon.service.k2x: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=TI MultiCore Tools Daemon 3 | Wants=mpmsrv-daemon.service 4 | After=mpmsrv-daemon.service 5 | 6 | [Service] 7 | Type=forking 8 | ExecStart=/usr/bin/ti-mctd 9 | 10 | [Install] 11 | WantedBy=basic.target 12 | -------------------------------------------------------------------------------- /host/mct-daemon/ti_mctd_config.json.am57x: -------------------------------------------------------------------------------- 1 | { 2 | "cmem-block-offchip" : "0", 3 | "cmem-block-onchip" : "1", 4 | "compute-unit-list" : "0,1", 5 | "eve-devices-disable" : "0", 6 | "linux-shmem-size-KB" : "128", 7 | } 8 | -------------------------------------------------------------------------------- /host/mct-daemon/ti_mctd_config.json.k2eg: -------------------------------------------------------------------------------- 1 | { 2 | "cmem-block-offchip" : "0", 3 | "cmem-block-onchip" : "1", 4 | "compute-unit-list" : "0", 5 | "linux-shmem-size-KB" : "128", 6 | } 7 | -------------------------------------------------------------------------------- /host/mct-daemon/ti_mctd_config.json.k2h: -------------------------------------------------------------------------------- 1 | { 2 | "cmem-block-offchip" : "0", 3 | "cmem-block-onchip" : "1", 4 | "compute-unit-list" : "0,1,2,3,4,5,6,7", 5 | "linux-shmem-size-KB" : "128", 6 | } 7 | -------------------------------------------------------------------------------- /host/mct-daemon/ti_mctd_config.json.k2l: -------------------------------------------------------------------------------- 1 | { 2 | "cmem-block-offchip" : "0", 3 | "cmem-block-onchip" : "1", 4 | "compute-unit-list" : "0,1,2,3", 5 | "linux-shmem-size-KB" : "128", 6 | } 7 | -------------------------------------------------------------------------------- /host/src/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | CMakeFiles/ 3 | cmake_install.cmake 4 | -------------------------------------------------------------------------------- /host/src/core/config.h: -------------------------------------------------------------------------------- 1 | #ifndef __CONFIG_H__ 2 | #define __CONFIG_H__ 3 | 4 | #define LLVM_VERSION "3.6.0" 5 | #define COAL_VERSION "" 6 | 7 | #define MAX_WORK_DIMS 3 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /host/src/core/config.h.cmake: -------------------------------------------------------------------------------- 1 | #ifndef __CONFIG_H__ 2 | #define __CONFIG_H__ 3 | 4 | #define LLVM_VERSION "@LLVM_VERSION@" 5 | #define COAL_VERSION "@Coal_VERSION@" 6 | 7 | #define MAX_WORK_DIMS 3 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /host/src/core/dsp/tal/memory_provider_factory.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "memory_provider_interface.h" 4 | #include 5 | 6 | namespace tiocl { 7 | 8 | /**************************************************************************** 9 | * Handles creation and destruction of MemoryProvider objects 10 | ***************************************************************************/ 11 | class MemoryProviderFactory 12 | { 13 | public: 14 | 15 | // Create and register a MemoryProvider for a given memory range 16 | void CreateMemoryProvider(const MemoryRange& r); 17 | 18 | // Given an address, return the appropriate MemoryProvider 19 | const MemoryProvider* GetMemoryProvider(DSPDevicePtr64 addr) const; 20 | 21 | 22 | // Destroy all registered MemoryProvider's 23 | void DestroyMemoryProviders(); 24 | 25 | MemoryProviderFactory() =default; 26 | ~MemoryProviderFactory(); 27 | 28 | MemoryProviderFactory(const MemoryProviderFactory&) =delete; 29 | MemoryProviderFactory& operator=(const MemoryProviderFactory&) =delete; 30 | 31 | private: 32 | std::vector mpAreas_; 33 | }; 34 | 35 | } 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /host/src/core/dsp/tal/ocl_load/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories (. 2 | C60_DLOAD_REL 3 | C60_DLOAD_DYN 4 | DLOAD_SYM 5 | DLOAD 6 | DLOAD_API 7 | DLWRAPPER 8 | ) 9 | 10 | if (${BUILD_OS} MATCHES "SYS_BIOS") 11 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mcpu=cortex-a15 -mtune=cortex-a15 -mfloat-abi=hard -D_SYS_BIOS -I${XDC_INSTALL_PATH} -I${BIOS_INSTALL_PATH} -Dxdc_target_types__=${BIOS_INSTALL_PATH}/gnu/targets/arm/std.h -Dxdc_target_name__=A15F") 12 | endif() 13 | 14 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -DC60_TARGET -DLOADER_DEBUG -g -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast") 15 | 16 | set(OCL_LOAD_SRC_FILES 17 | ocl_load.c 18 | C60_DLOAD_REL/c60_reloc.c 19 | C60_DLOAD_DYN/c60_dynamic.c 20 | DLOAD_SYM/symtab.c 21 | DLOAD/ArrayList.c 22 | DLOAD/dload.c 23 | DLOAD/elf32.c 24 | DLOAD/dload_endian.c 25 | ) 26 | 27 | add_library(oclload STATIC ${OCL_LOAD_SRC_FILES}) 28 | 29 | SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib) 30 | 31 | -------------------------------------------------------------------------------- /host/src/core/dsp/tal/ocl_load/DLOAD_API/api_version_change.log: -------------------------------------------------------------------------------- 1 | 2 | Dynamic Loader API and Loader Core - Version Number Change Log 3 | ============================================================== 4 | 5 | Version Number Description 6 | -------------------------- 7 | 8 | The version number associated with the Dynamic Loader API and the Loader Core 9 | sources has three components: 10 | 11 | .. 12 | 13 | major version - is incremented if there is a change to the API that creates a 14 | compatibility discontinuity. 15 | 16 | minor version - is incremented if functionality is added to the API without 17 | causing a compatibility discontinuity. 18 | 19 | patch version - is incremented if a defect has been repaired, a performance 20 | enhancement has been added, or the source code has been 21 | refactored in some way. There should not be a compatibility 22 | discontinuity created by an increment to the patch version. 23 | 24 | Version Number Change Log 25 | ------------------------- 26 | 27 | 1.0.0 - 17 July 2009 - Initial release of dynamic loader API and loader 28 | core sources. 29 | 30 | 2.0.0 - 1 Feb 2013 - Add client handle to several DLIF functions. 31 | - Add DLIF_exit() for loader abort. 32 | 33 | 34 | -------------------------------------------------------------------------------- /host/src/core/dsp/tal/ocl_load/README: -------------------------------------------------------------------------------- 1 | 2 | This program is dependent on these Standard CVS modules 3 | 4 | C60_DLOAD_DYN: 5 | C60_DLOAD_REL: 6 | DLOAD: 7 | DLOAD_API: 8 | DLOAD_SYM: 9 | -------------------------------------------------------------------------------- /host/src/core/dsp/tal/shmem_cmem.cpp: -------------------------------------------------------------------------------- 1 | #include "shared_memory_provider.h" 2 | #include "shmem_rw_policy_cmem.h" 3 | #include "shmem_init_policy_cmem.h" 4 | #include "heaps_policy_process.h" 5 | 6 | using namespace tiocl; 7 | 8 | // Include the file to enable template instantiation 9 | #include "shared_memory_provider.cpp" 10 | 11 | // Instantiate the CMEM shared memory provider 12 | template class 13 | SharedMemoryProvider; 15 | 16 | -------------------------------------------------------------------------------- /host/src/core/dsp/tal/shmem_rtos.cpp: -------------------------------------------------------------------------------- 1 | #include "shared_memory_provider.h" 2 | #include "shmem_rw_policy_rtos.h" 3 | #include "shmem_init_policy_rtos.h" 4 | #include "heaps_policy_thread.h" 5 | 6 | using namespace tiocl; 7 | 8 | // Include the file to enable template instantiation 9 | #include "shared_memory_provider.cpp" 10 | 11 | // Instantiate the CMEM shared memory provider 12 | template class 13 | SharedMemoryProvider; 15 | 16 | 17 | -------------------------------------------------------------------------------- /host/src/core/dsp/tal/shmem_rw_policy_cmem.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include "memory_provider_factory.h" 6 | 7 | using tiocl::MemoryProviderFactory; 8 | 9 | 10 | /**************************************************************************** 11 | * Policy class implementing CMEM specific read/write and map/unmap 12 | * functionality. 13 | ***************************************************************************/ 14 | class ReadWritePolicyCMEM 15 | { 16 | public: 17 | void Configure(int32_t device_id, 18 | const MemoryProviderFactory* mpFactory); 19 | 20 | int32_t Write(uint64_t dst, uint8_t *src, size_t sz); 21 | int32_t Read (uint64_t src, uint8_t *dst, size_t sz); 22 | 23 | void* Map (uint64_t addr, size_t sz, bool is_read = false, 24 | bool allow_fail = false); 25 | int32_t Unmap (void *host_addr, uint64_t buf_addr, 26 | size_t sz, bool is_write = false); 27 | 28 | bool CacheWbInvAll(); 29 | 30 | private: 31 | int32_t device_id_; 32 | const MemoryProviderFactory* mp_factory_; 33 | }; 34 | 35 | -------------------------------------------------------------------------------- /host/src/core/dsp/tal/shmem_rw_policy_rtos.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include "memory_provider_factory.h" 6 | 7 | using tiocl::MemoryProviderFactory; 8 | 9 | 10 | /**************************************************************************** 11 | * Policy class implementing RTOS specific read/write and map/unmap 12 | * functionality. 13 | ***************************************************************************/ 14 | class ReadWritePolicyRTOS 15 | { 16 | public: 17 | void Configure(int32_t device_id, 18 | const MemoryProviderFactory* mpFactory); 19 | 20 | int32_t Write(uint64_t dst, uint8_t *src, size_t sz); 21 | int32_t Read (uint64_t src, uint8_t *dst, size_t sz); 22 | 23 | void* Map (uint64_t addr, size_t sz, bool is_read = false, 24 | bool allow_fail = false); 25 | int32_t Unmap(void *host_addr, uint64_t buf_addr, 26 | size_t sz, bool is_write = false); 27 | 28 | bool CacheWbInvAll(); 29 | 30 | private: 31 | int32_t device_id_; 32 | const MemoryProviderFactory* mp_factory_; 33 | }; 34 | 35 | -------------------------------------------------------------------------------- /host/src/core/memory_range.h: -------------------------------------------------------------------------------- 1 | #include "tiocl_types.h" 2 | #include 3 | 4 | #pragma once 5 | 6 | namespace tiocl { 7 | 8 | // Represents a memory range with a start address and size 9 | // Both are 64bits to handle devices which support >4GB of memory 10 | class MemoryRange 11 | { 12 | public: 13 | enum class Kind { CMEM_PERSISTENT, CMEM_ONDEMAND, DEVMEM, RTOS_SHMEM, 14 | RTOS_HOSTMEM }; 15 | enum class Location {ONCHIP, OFFCHIP}; 16 | 17 | MemoryRange(DSPDevicePtr64 a, uint64_t sz, Kind k, Location l, 18 | uint64_t adjust=0): 19 | start(a), size(sz), kind(k), loc(l), start_adjust(adjust) 20 | {} 21 | 22 | DSPDevicePtr64 GetBase() const { return start; } 23 | uint64_t GetAdjust() const { return start_adjust; } 24 | uint64_t GetSize() const { return size; } 25 | Kind GetKind() const { return kind; } 26 | Location GetLocation() const { return loc; } 27 | 28 | bool IsAddressInRange(DSPDevicePtr64 addr) const { 29 | uint64_t end_exclusive = (uint64_t)start + size; 30 | if (addr >= start && addr < end_exclusive) 31 | return true; 32 | return false; 33 | } 34 | 35 | private: 36 | DSPDevicePtr64 start; 37 | uint64_t start_adjust; 38 | uint64_t size; 39 | Kind kind; 40 | Location loc; 41 | 42 | }; 43 | 44 | } 45 | -------------------------------------------------------------------------------- /host/util/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # libocl_util.a 2 | 3 | include_directories( ${CMAKE_SOURCE_DIR}/include ) 4 | 5 | if (CROSS_COMPILE) 6 | include_directories( ${CMAKE_FIND_ROOT_PATH}) 7 | endif() 8 | 9 | if ((${BUILD_OS} MATCHES "SYS_BIOS")) 10 | include_directories (${BIOS_USR_INCLUDE_PATH}) 11 | endif() 12 | 13 | 14 | set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -std=c++11 -O3 -fPIC -fpermissive") 15 | 16 | set(util_src report_timing.cpp decode_error.cpp read_binary.cpp) 17 | 18 | add_library(ocl_util STATIC ${util_src}) 19 | 20 | SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib) 21 | 22 | install(TARGETS ocl_util DESTINATION /usr/lib ${OCL_FPERMS}) 23 | install(FILES ocl_util.h DESTINATION /usr/include ${OCL_FPERMS}) 24 | -------------------------------------------------------------------------------- /libm/README.md: -------------------------------------------------------------------------------- 1 | ## OpenLIBM 2 | 3 | OpenLIBM is an effort to have a high quality standalone LIBM 4 | library. It is meant to be used standalone in applications and 5 | programming language implementations. 6 | 7 | OpenLibm builds on Linux, Mac OS X, and Windows, and with little effort, 8 | should build on FreeBSD as well. It builds with both, GCC and clang. 9 | 10 | The OpenLIBM code derives from the FreeBSD msun implementation, which 11 | in turn derives from FDLIBM 5.3. As a result, it has a number of fixes and 12 | updates that have accumulated over the years in msun, and also optimized 13 | assembly versions of many functions. 14 | 15 | ### Build instructions: 16 | 17 | 1. `make` or `make USEGCC=1` to build with GCC. 18 | 2. `make USECLANG=1` to build with clang. 19 | -------------------------------------------------------------------------------- /libm/amd64/Make.files: -------------------------------------------------------------------------------- 1 | $(CUR_SRCS) = fenv.c e_remainder.S e_remainderf.S e_remainderl.S \ 2 | e_sqrt.S e_sqrtf.S e_sqrtl.S \ 3 | s_llrint.S s_llrintf.S s_llrintl.S \ 4 | s_logbl.S s_lrint.S s_lrintf.S s_lrintl.S \ 5 | s_remquo.S s_remquof.S s_remquol.S \ 6 | s_rintl.S s_scalbn.S s_scalbnf.S s_scalbnl.S 7 | -------------------------------------------------------------------------------- /libm/amd64/Symbol.map: -------------------------------------------------------------------------------- 1 | /* 2 | * $FreeBSD: src/lib/msun/amd64/Symbol.map,v 1.3 2011/10/10 15:43:09 das Exp $ 3 | */ 4 | FBSD_1.0 { 5 | fesetexceptflag; 6 | feraiseexcept; 7 | fegetenv; 8 | feholdexcept; 9 | feupdateenv; 10 | feenableexcept; 11 | fedisableexcept; 12 | }; 13 | -------------------------------------------------------------------------------- /libm/amd64/e_remainder.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Based on the i387 version written by: 3 | * J.T. Conklin (jtc@netbsd.org) 4 | * Public domain. 5 | */ 6 | 7 | #include 8 | 9 | //RCSID("from: FreeBSD: src/lib/msun/i387/e_remainder.S,v 1.8 2005/02/04 14:08:32 das Exp") 10 | //__FBSDID("$FreeBSD: src/lib/msun/amd64/e_remainder.S,v 1.2 2011/01/07 16:13:12 kib Exp $") 11 | 12 | ENTRY(remainder) 13 | movsd %xmm0,-8(%rsp) 14 | movsd %xmm1,-16(%rsp) 15 | fldl -16(%rsp) 16 | fldl -8(%rsp) 17 | 1: fprem1 18 | fstsw %ax 19 | testw $0x400,%ax 20 | jne 1b 21 | fstpl -8(%rsp) 22 | movsd -8(%rsp),%xmm0 23 | fstp %st 24 | ret 25 | 26 | 27 | /* Enable stack protection */ 28 | #if defined(__linux__) && defined(__ELF__) 29 | .section .note.GNU-stack,"",%progbits 30 | #endif 31 | -------------------------------------------------------------------------------- /libm/amd64/e_remainderf.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Based on the i387 version written by J.T. Conklin . 3 | * Public domain. 4 | */ 5 | 6 | #include 7 | 8 | //RCSID("from: $NetBSD: e_remainderf.S,v 1.2 1995/05/08 23:49:47 jtc Exp $") 9 | //__FBSDID("$FreeBSD: src/lib/msun/amd64/e_remainderf.S,v 1.2 2011/01/07 16:13:12 kib Exp $") 10 | 11 | ENTRY(remainderf) 12 | movss %xmm0,-4(%rsp) 13 | movss %xmm1,-8(%rsp) 14 | flds -8(%rsp) 15 | flds -4(%rsp) 16 | 1: fprem1 17 | fstsw %ax 18 | testw $0x400,%ax 19 | jne 1b 20 | fstps -4(%rsp) 21 | movss -4(%rsp),%xmm0 22 | fstp %st 23 | ret 24 | 25 | 26 | /* Enable stack protection */ 27 | #if defined(__linux__) && defined(__ELF__) 28 | .section .note.GNU-stack,"",%progbits 29 | #endif 30 | -------------------------------------------------------------------------------- /libm/amd64/e_remainderl.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Based on the i387 version written by: 3 | * J.T. Conklin (jtc@netbsd.org) 4 | * Public domain. 5 | */ 6 | 7 | #include 8 | 9 | //__FBSDID("$FreeBSD: src/lib/msun/amd64/e_remainderl.S,v 1.2 2011/01/07 16:13:12 kib Exp $") 10 | 11 | ENTRY(remainderl) 12 | #ifndef _WIN64 13 | fldt 24(%rsp) 14 | fldt 8(%rsp) 15 | #else 16 | fldt (%r8) 17 | fldt (%rdx) 18 | #endif 19 | 1: fprem1 20 | fstsw %ax 21 | testw $0x400,%ax 22 | jne 1b 23 | fstp %st(1) 24 | #ifdef _WIN64 25 | mov %rcx,%rax 26 | movq $0x0,0x8(%rcx) 27 | fstpt (%rcx) 28 | #endif 29 | ret 30 | 31 | 32 | /* Enable stack protection */ 33 | #if defined(__linux__) && defined(__ELF__) 34 | .section .note.GNU-stack,"",%progbits 35 | #endif 36 | -------------------------------------------------------------------------------- /libm/amd64/s_llrint.S: -------------------------------------------------------------------------------- 1 | #include 2 | //__FBSDID("$FreeBSD: src/lib/msun/amd64/s_llrint.S,v 1.3 2011/02/04 21:54:06 kib Exp $") 3 | 4 | ENTRY(llrint) 5 | cvtsd2si %xmm0, %rax 6 | ret 7 | END(llrint) 8 | 9 | /* Enable stack protection */ 10 | #if defined(__linux__) && defined(__ELF__) 11 | .section .note.GNU-stack,"",%progbits 12 | #endif 13 | -------------------------------------------------------------------------------- /libm/amd64/s_llrintf.S: -------------------------------------------------------------------------------- 1 | #include 2 | //__FBSDID("$FreeBSD: src/lib/msun/amd64/s_llrintf.S,v 1.3 2011/02/04 21:54:06 kib Exp $") 3 | 4 | ENTRY(llrintf) 5 | cvtss2si %xmm0, %rax 6 | ret 7 | END(llrintf) 8 | 9 | /* Enable stack protection */ 10 | #if defined(__linux__) && defined(__ELF__) 11 | .section .note.GNU-stack,"",%progbits 12 | #endif 13 | -------------------------------------------------------------------------------- /libm/amd64/s_logbl.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Written by: 3 | * J.T. Conklin (jtc@netbsd.org) 4 | * Public domain. 5 | */ 6 | 7 | #include 8 | //__FBSDID("$FreeBSD: src/lib/msun/amd64/s_logbl.S,v 1.4 2011/01/07 16:13:12 kib Exp $") 9 | 10 | ENTRY(logbl) 11 | #ifndef _WIN64 12 | fldt 8(%rsp) 13 | #else 14 | fldt (%rdx) 15 | #endif 16 | fxtract 17 | fstp %st 18 | #ifdef _WIN64 19 | mov %rcx,%rax 20 | movq $0x0,0x8(%rcx) 21 | fstpt (%rcx) 22 | #endif 23 | ret 24 | 25 | 26 | /* Enable stack protection */ 27 | #if defined(__linux__) && defined(__ELF__) 28 | .section .note.GNU-stack,"",%progbits 29 | #endif 30 | -------------------------------------------------------------------------------- /libm/amd64/s_rintl.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Written by: 3 | * J.T. Conklin (jtc@netbsd.org) 4 | * Public domain. 5 | */ 6 | 7 | #include 8 | 9 | ENTRY(rintl) 10 | #ifndef _WIN64 11 | fldt 8(%rsp) 12 | frndint 13 | #else 14 | fldt (%rdx) 15 | frndint 16 | mov %rcx,%rax 17 | movq $0x0,0x8(%rcx) 18 | fstpt (%rcx) 19 | #endif 20 | ret 21 | 22 | 23 | /* Enable stack protection */ 24 | #if defined(__linux__) && defined(__ELF__) 25 | .section .note.GNU-stack,"",%progbits 26 | #endif 27 | -------------------------------------------------------------------------------- /libm/amd64/s_scalbnl.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Based on code written by J.T. Conklin . 3 | * Public domain. 4 | */ 5 | 6 | #include 7 | //__FBSDID("$FreeBSD: src/lib/msun/amd64/s_scalbnl.S,v 1.3 2011/01/07 16:13:12 kib Exp $") 8 | /* //RCSID("$NetBSD: s_scalbnf.S,v 1.4 1999/01/02 05:15:40 kristerw Exp $") */ 9 | 10 | ENTRY(scalbnl) 11 | #ifndef _WIN64 12 | movl %edi,-4(%rsp) 13 | fildl -4(%rsp) 14 | fldt 8(%rsp) 15 | #else 16 | mov %r8,%rax 17 | movl %eax,-4(%rsp) 18 | fildl -4(%rsp) 19 | fldt (%rdx) 20 | #endif 21 | fscale 22 | fstp %st(1) 23 | #ifdef _WIN64 24 | mov %rcx,%rax 25 | movq $0x0,0x8(%rcx) 26 | fstpt (%rcx) 27 | #endif 28 | ret 29 | END(scalbnl) 30 | 31 | .globl CNAME(ldexpl) 32 | .set CNAME(ldexpl),CNAME(scalbnl) 33 | 34 | 35 | /* Enable stack protection */ 36 | #if defined(__linux__) && defined(__ELF__) 37 | .section .note.GNU-stack,"",%progbits 38 | #endif 39 | -------------------------------------------------------------------------------- /libm/arm/Make.files: -------------------------------------------------------------------------------- 1 | $(CUR_SRCS) = fenv.c 2 | -------------------------------------------------------------------------------- /libm/arm/Makefile.inc: -------------------------------------------------------------------------------- 1 | # $FreeBSD: src/lib/msun/arm/Makefile.inc,v 1.2 2006/03/27 23:59:44 deischen Exp $ 2 | 3 | LDBL_PREC = 53 4 | SYM_MAPS += ${.CURDIR}/arm/Symbol.map 5 | -------------------------------------------------------------------------------- /libm/arm/Symbol.map: -------------------------------------------------------------------------------- 1 | /* 2 | * $FreeBSD: src/lib/msun/arm/Symbol.map,v 1.3 2011/10/10 15:43:09 das Exp $ 3 | */ 4 | FBSD_1.0 { 5 | }; 6 | 7 | FBSD_1.3 { 8 | fesetexceptflag; 9 | feraiseexcept; 10 | fegetenv; 11 | feholdexcept; 12 | feupdateenv; 13 | }; 14 | -------------------------------------------------------------------------------- /libm/bsdsrc/Make.files: -------------------------------------------------------------------------------- 1 | $(CUR_SRCS) += b_exp.c b_log.c b_tgamma.c 2 | -------------------------------------------------------------------------------- /libm/i387/Make.files: -------------------------------------------------------------------------------- 1 | $(CUR_SRCS) = e_exp.S e_fmod.S e_log.S e_log10.S \ 2 | e_remainder.S e_sqrt.S s_ceil.S s_copysign.S \ 3 | s_finite.S s_floor.S s_llrint.S s_logb.S s_lrint.S \ 4 | s_remquo.S s_rint.S s_significand.S s_tan.S \ 5 | s_trunc.S 6 | 7 | ifneq ($(OS), WINNT) 8 | $(CUR_SRCS) += s_scalbn.S s_scalbnf.S s_scalbnl.S 9 | endif 10 | 11 | # float counterparts 12 | $(CUR_SRCS)+= e_log10f.S e_logf.S e_remainderf.S \ 13 | e_sqrtf.S s_ceilf.S s_copysignf.S s_floorf.S \ 14 | s_llrintf.S s_logbf.S s_lrintf.S \ 15 | s_remquof.S s_rintf.S s_significandf.S s_truncf.S 16 | 17 | # long double counterparts 18 | $(CUR_SRCS)+= e_remainderl.S e_sqrtl.S s_ceill.S s_copysignl.S \ 19 | s_floorl.S s_llrintl.S \ 20 | s_logbl.S s_lrintl.S s_remquol.S s_rintl.S s_truncl.S 21 | 22 | $(CUR_SRCS)+= fenv.c -------------------------------------------------------------------------------- /libm/i387/Symbol.map: -------------------------------------------------------------------------------- 1 | /* 2 | * $FreeBSD: src/lib/msun/i387/Symbol.map,v 1.3 2011/10/10 15:43:09 das Exp $ 3 | */ 4 | FBSD_1.0 { 5 | __has_sse; 6 | __test_sse; 7 | fesetexceptflag; 8 | feraiseexcept; 9 | fegetenv; 10 | feholdexcept; 11 | feupdateenv; 12 | feenableexcept; 13 | fedisableexcept; 14 | }; 15 | -------------------------------------------------------------------------------- /libm/i387/bsd_ieeefp.h: -------------------------------------------------------------------------------- 1 | #include "include/cdefs-compat.h" 2 | #include "amd64/bsd_ieeefp.h" -------------------------------------------------------------------------------- /libm/i387/e_fmod.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Written by: 3 | * J.T. Conklin (jtc@netbsd.org) 4 | * Public domain. 5 | */ 6 | 7 | #include 8 | //__FBSDID("$FreeBSD: src/lib/msun/i387/e_fmod.S,v 1.11 2011/01/07 16:13:12 kib Exp $") 9 | 10 | ENTRY(fmod) 11 | fldl 12(%esp) 12 | fldl 4(%esp) 13 | 1: fprem 14 | fstsw %ax 15 | sahf 16 | jp 1b 17 | fstp %st(1) 18 | ret 19 | END(fmod) 20 | 21 | 22 | /* Enable stack protection */ 23 | #if defined(__linux__) && defined(__ELF__) 24 | .section .note.GNU-stack,"",%progbits 25 | #endif 26 | -------------------------------------------------------------------------------- /libm/i387/e_log.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Written by: 3 | * J.T. Conklin (jtc@netbsd.org) 4 | * Public domain. 5 | */ 6 | 7 | #include 8 | //__FBSDID("$FreeBSD: src/lib/msun/i387/e_log.S,v 1.10 2011/01/07 16:13:12 kib Exp $") 9 | 10 | ENTRY(log) 11 | fldln2 12 | fldl 4(%esp) 13 | fyl2x 14 | ret 15 | END(log) 16 | 17 | 18 | /* Enable stack protection */ 19 | #if defined(__linux__) && defined(__ELF__) 20 | .section .note.GNU-stack,"",%progbits 21 | #endif 22 | -------------------------------------------------------------------------------- /libm/i387/e_log10.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Written by: 3 | * J.T. Conklin (jtc@netbsd.org) 4 | * Public domain. 5 | */ 6 | 7 | #include 8 | //__FBSDID("$FreeBSD: src/lib/msun/i387/e_log10.S,v 1.10 2011/01/07 16:13:12 kib Exp $") 9 | 10 | ENTRY(log10) 11 | fldlg2 12 | fldl 4(%esp) 13 | fyl2x 14 | ret 15 | END(log10) 16 | 17 | 18 | /* Enable stack protection */ 19 | #if defined(__linux__) && defined(__ELF__) 20 | .section .note.GNU-stack,"",%progbits 21 | #endif 22 | -------------------------------------------------------------------------------- /libm/i387/e_log10f.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Written by J.T. Conklin . 3 | * Public domain. 4 | */ 5 | 6 | #include 7 | 8 | //__FBSDID("$FreeBSD: src/lib/msun/i387/e_log10f.S,v 1.4 2011/01/07 16:13:12 kib Exp $"); 9 | /* RCSID("$NetBSD: e_log10f.S,v 1.1 1996/07/03 16:50:22 jtc Exp $") */ 10 | 11 | ENTRY(log10f) 12 | fldlg2 13 | flds 4(%esp) 14 | fyl2x 15 | ret 16 | END(log10f) 17 | 18 | 19 | /* Enable stack protection */ 20 | #if defined(__linux__) && defined(__ELF__) 21 | .section .note.GNU-stack,"",%progbits 22 | #endif 23 | -------------------------------------------------------------------------------- /libm/i387/e_logf.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Written by J.T. Conklin . 3 | * Public domain. 4 | */ 5 | 6 | #include 7 | 8 | //__FBSDID("$FreeBSD: src/lib/msun/i387/e_logf.S,v 1.3 2011/01/07 16:13:12 kib Exp $"); 9 | /* RCSID("$NetBSD: e_logf.S,v 1.2 1996/07/06 00:15:45 jtc Exp $") */ 10 | 11 | ENTRY(logf) 12 | fldln2 13 | flds 4(%esp) 14 | fyl2x 15 | ret 16 | 17 | 18 | /* Enable stack protection */ 19 | #if defined(__linux__) && defined(__ELF__) 20 | .section .note.GNU-stack,"",%progbits 21 | #endif 22 | -------------------------------------------------------------------------------- /libm/i387/e_remainder.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Written by: 3 | * J.T. Conklin (jtc@netbsd.org) 4 | * Public domain. 5 | */ 6 | 7 | #include 8 | //__FBSDID("$FreeBSD: src/lib/msun/i387/e_remainder.S,v 1.11 2011/01/07 16:13:12 kib Exp $") 9 | 10 | ENTRY(remainder) 11 | fldl 12(%esp) 12 | fldl 4(%esp) 13 | 1: fprem1 14 | fstsw %ax 15 | sahf 16 | jp 1b 17 | fstp %st(1) 18 | ret 19 | END(remainder) 20 | 21 | 22 | /* Enable stack protection */ 23 | #if defined(__linux__) && defined(__ELF__) 24 | .section .note.GNU-stack,"",%progbits 25 | #endif 26 | -------------------------------------------------------------------------------- /libm/i387/e_remainderf.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Written by J.T. Conklin . 3 | * Public domain. 4 | */ 5 | 6 | #include 7 | 8 | //__FBSDID("$FreeBSD: src/lib/msun/i387/e_remainderf.S,v 1.4 2011/01/07 16:13:12 kib Exp $"); 9 | /* RCSID("$NetBSD: e_remainderf.S,v 1.2 1995/05/08 23:49:47 jtc Exp $") */ 10 | 11 | ENTRY(remainderf) 12 | flds 8(%esp) 13 | flds 4(%esp) 14 | 1: fprem1 15 | fstsw %ax 16 | sahf 17 | jp 1b 18 | fstp %st(1) 19 | ret 20 | END(remainderf) 21 | 22 | 23 | /* Enable stack protection */ 24 | #if defined(__linux__) && defined(__ELF__) 25 | .section .note.GNU-stack,"",%progbits 26 | #endif 27 | -------------------------------------------------------------------------------- /libm/i387/e_remainderl.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Written by: 3 | * J.T. Conklin (jtc@netbsd.org) 4 | * Public domain. 5 | */ 6 | 7 | #include 8 | 9 | //__FBSDID("$FreeBSD: src/lib/msun/i387/e_remainderl.S,v 1.2 2011/01/07 16:13:12 kib Exp $") 10 | 11 | ENTRY(remainderl) 12 | fldt 16(%esp) 13 | fldt 4(%esp) 14 | 1: fprem1 15 | fstsw %ax 16 | sahf 17 | jp 1b 18 | fstp %st(1) 19 | ret 20 | 21 | 22 | /* Enable stack protection */ 23 | #if defined(__linux__) && defined(__ELF__) 24 | .section .note.GNU-stack,"",%progbits 25 | #endif 26 | -------------------------------------------------------------------------------- /libm/i387/e_sqrt.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Written by: 3 | * J.T. Conklin (jtc@netbsd.org) 4 | * Public domain. 5 | */ 6 | 7 | #include 8 | //__FBSDID("$FreeBSD: src/lib/msun/i387/e_sqrt.S,v 1.10 2011/01/07 16:13:12 kib Exp $") 9 | 10 | ENTRY(sqrt) 11 | fldl 4(%esp) 12 | fsqrt 13 | ret 14 | END(sqrt) 15 | 16 | 17 | /* Enable stack protection */ 18 | #if defined(__linux__) && defined(__ELF__) 19 | .section .note.GNU-stack,"",%progbits 20 | #endif 21 | -------------------------------------------------------------------------------- /libm/i387/e_sqrtf.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Written by J.T. Conklin . 3 | * Public domain. 4 | */ 5 | 6 | #include 7 | 8 | //__FBSDID("$FreeBSD: src/lib/msun/i387/e_sqrtf.S,v 1.4 2011/01/07 16:13:12 kib Exp $"); 9 | /* RCSID("$NetBSD: e_sqrtf.S,v 1.2 1995/05/08 23:50:14 jtc Exp $") */ 10 | 11 | ENTRY(sqrtf) 12 | flds 4(%esp) 13 | fsqrt 14 | ret 15 | END(sqrtf) 16 | 17 | 18 | /* Enable stack protection */ 19 | #if defined(__linux__) && defined(__ELF__) 20 | .section .note.GNU-stack,"",%progbits 21 | #endif 22 | -------------------------------------------------------------------------------- /libm/i387/e_sqrtl.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Written by: 3 | * J.T. Conklin (jtc@netbsd.org) 4 | * Public domain. 5 | */ 6 | 7 | #include 8 | //__FBSDID("$FreeBSD: src/lib/msun/i387/e_sqrtl.S,v 1.3 2011/01/07 16:13:12 kib Exp $") 9 | 10 | ENTRY(sqrtl) 11 | fldt 4(%esp) 12 | fsqrt 13 | ret 14 | 15 | 16 | /* Enable stack protection */ 17 | #if defined(__linux__) && defined(__ELF__) 18 | .section .note.GNU-stack,"",%progbits 19 | #endif 20 | -------------------------------------------------------------------------------- /libm/i387/s_ceil.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Written by: 3 | * J.T. Conklin (jtc@netbsd.org) 4 | * Public domain. 5 | */ 6 | 7 | #include 8 | 9 | ENTRY(ceil) 10 | pushl %ebp 11 | movl %esp,%ebp 12 | subl $8,%esp 13 | 14 | fstcw -4(%ebp) /* store fpu control word */ 15 | movw -4(%ebp),%dx 16 | orw $0x0800,%dx /* round towards +oo */ 17 | andw $0xfbff,%dx 18 | movw %dx,-8(%ebp) 19 | fldcw -8(%ebp) /* load modfied control word */ 20 | 21 | fldl 8(%ebp); /* round */ 22 | frndint 23 | 24 | fldcw -4(%ebp) /* restore original control word */ 25 | 26 | leave 27 | ret 28 | END(ceil) 29 | 30 | 31 | /* Enable stack protection */ 32 | #if defined(__linux__) && defined(__ELF__) 33 | .section .note.GNU-stack,"",%progbits 34 | #endif 35 | -------------------------------------------------------------------------------- /libm/i387/s_ceilf.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Written by J.T. Conklin . 3 | * Public domain. 4 | */ 5 | 6 | #include 7 | 8 | //__FBSDID("$FreeBSD: src/lib/msun/i387/s_ceilf.S,v 1.4 2011/01/07 16:13:12 kib Exp $"); 9 | /* RCSID("$NetBSD: s_ceilf.S,v 1.3 1995/05/08 23:52:44 jtc Exp $") */ 10 | 11 | ENTRY(ceilf) 12 | pushl %ebp 13 | movl %esp,%ebp 14 | subl $8,%esp 15 | 16 | fstcw -4(%ebp) /* store fpu control word */ 17 | movw -4(%ebp),%dx 18 | orw $0x0800,%dx /* round towards +oo */ 19 | andw $0xfbff,%dx 20 | movw %dx,-8(%ebp) 21 | fldcw -8(%ebp) /* load modfied control word */ 22 | 23 | flds 8(%ebp); /* round */ 24 | frndint 25 | 26 | fldcw -4(%ebp) /* restore original control word */ 27 | 28 | leave 29 | ret 30 | END(ceilf) 31 | 32 | 33 | /* Enable stack protection */ 34 | #if defined(__linux__) && defined(__ELF__) 35 | .section .note.GNU-stack,"",%progbits 36 | #endif 37 | -------------------------------------------------------------------------------- /libm/i387/s_ceill.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Based on code written by J.T. Conklin . 3 | * Public domain. 4 | */ 5 | 6 | #include 7 | //__FBSDID("$FreeBSD: src/lib/msun/i387/s_ceill.S,v 1.3 2011/01/07 16:13:12 kib Exp $") 8 | 9 | ENTRY(ceill) 10 | pushl %ebp 11 | movl %esp,%ebp 12 | subl $8,%esp 13 | 14 | fstcw -4(%ebp) /* store fpu control word */ 15 | movw -4(%ebp),%dx 16 | orw $0x0800,%dx /* round towards +oo */ 17 | andw $0xfbff,%dx 18 | movw %dx,-8(%ebp) 19 | fldcw -8(%ebp) /* load modfied control word */ 20 | 21 | fldt 8(%ebp) /* round */ 22 | frndint 23 | 24 | fldcw -4(%ebp) /* restore original control word */ 25 | 26 | leave 27 | ret 28 | END(ceill) 29 | 30 | 31 | /* Enable stack protection */ 32 | #if defined(__linux__) && defined(__ELF__) 33 | .section .note.GNU-stack,"",%progbits 34 | #endif 35 | -------------------------------------------------------------------------------- /libm/i387/s_copysign.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Written by: 3 | * J.T. Conklin (jtc@netbsd.org) 4 | * Public domain. 5 | */ 6 | 7 | #include 8 | //__FBSDID("$FreeBSD: src/lib/msun/i387/s_copysign.S,v 1.9 2011/01/07 16:13:12 kib Exp $") 9 | 10 | ENTRY(copysign) 11 | movl 16(%esp),%edx 12 | andl $0x80000000,%edx 13 | movl 8(%esp),%eax 14 | andl $0x7fffffff,%eax 15 | orl %edx,%eax 16 | movl %eax,8(%esp) 17 | fldl 4(%esp) 18 | ret 19 | END(copysign) 20 | 21 | 22 | /* Enable stack protection */ 23 | #if defined(__linux__) && defined(__ELF__) 24 | .section .note.GNU-stack,"",%progbits 25 | #endif 26 | -------------------------------------------------------------------------------- /libm/i387/s_copysignf.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Written by J.T. Conklin . 3 | * Public domain. 4 | */ 5 | 6 | #include 7 | 8 | //__FBSDID("$FreeBSD: src/lib/msun/i387/s_copysignf.S,v 1.3 2011/01/07 16:13:12 kib Exp $"); 9 | /* RCSID("$NetBSD: s_copysignf.S,v 1.3 1995/05/08 23:53:25 jtc Exp $") */ 10 | 11 | ENTRY(copysignf) 12 | movl 8(%esp),%edx 13 | andl $0x80000000,%edx 14 | movl 4(%esp),%eax 15 | andl $0x7fffffff,%eax 16 | orl %edx,%eax 17 | movl %eax,4(%esp) 18 | flds 4(%esp) 19 | ret 20 | END(copysignf) 21 | 22 | 23 | /* Enable stack protection */ 24 | #if defined(__linux__) && defined(__ELF__) 25 | .section .note.GNU-stack,"",%progbits 26 | #endif 27 | -------------------------------------------------------------------------------- /libm/i387/s_copysignl.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Based on code written by J.T. Conklin . 3 | * Public domain. 4 | */ 5 | 6 | #include 7 | //__FBSDID("$FreeBSD: src/lib/msun/i387/s_copysignl.S,v 1.3 2011/01/07 16:13:12 kib Exp $") 8 | 9 | ENTRY(copysignl) 10 | movl 24(%esp),%edx 11 | andl $0x8000,%edx 12 | movl 12(%esp),%eax 13 | andl $0x7fff,%eax 14 | orl %edx,%eax 15 | movl %eax,12(%esp) 16 | fldt 4(%esp) 17 | ret 18 | END(copysignl) 19 | 20 | 21 | /* Enable stack protection */ 22 | #if defined(__linux__) && defined(__ELF__) 23 | .section .note.GNU-stack,"",%progbits 24 | #endif 25 | -------------------------------------------------------------------------------- /libm/i387/s_cos.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Written by: 3 | * J.T. Conklin (jtc@netbsd.org) 4 | * Public domain. 5 | */ 6 | 7 | #include 8 | //__FBSDID("$FreeBSD: src/lib/msun/i387/s_cos.S,v 1.9 2011/01/07 16:13:12 kib Exp $") 9 | 10 | ENTRY(cos) 11 | fldl 4(%esp) 12 | fcos 13 | fnstsw %ax 14 | andw $0x400,%ax 15 | jnz 1f 16 | ret 17 | 1: fldpi 18 | fadd %st(0) 19 | fxch %st(1) 20 | 2: fprem1 21 | fnstsw %ax 22 | andw $0x400,%ax 23 | jnz 2b 24 | fstp %st(1) 25 | fcos 26 | ret 27 | END(cos) 28 | 29 | 30 | /* Enable stack protection */ 31 | #if defined(__linux__) && defined(__ELF__) 32 | .section .note.GNU-stack,"",%progbits 33 | #endif 34 | -------------------------------------------------------------------------------- /libm/i387/s_finite.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Written by: 3 | * J.T. Conklin (jtc@netbsd.org) 4 | * Public domain. 5 | */ 6 | 7 | #include 8 | //__FBSDID("$FreeBSD: src/lib/msun/i387/s_finite.S,v 1.10 2011/01/07 16:13:12 kib Exp $") 9 | 10 | ENTRY(finite) 11 | movl 8(%esp),%eax 12 | andl $0x7ff00000, %eax 13 | cmpl $0x7ff00000, %eax 14 | setneb %al 15 | andl $0x000000ff, %eax 16 | ret 17 | END(finite) 18 | 19 | 20 | /* Enable stack protection */ 21 | #if defined(__linux__) && defined(__ELF__) 22 | .section .note.GNU-stack,"",%progbits 23 | #endif 24 | -------------------------------------------------------------------------------- /libm/i387/s_floor.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Written by: 3 | * J.T. Conklin (jtc@netbsd.org) 4 | * Public domain. 5 | */ 6 | 7 | #include 8 | //__FBSDID("$FreeBSD: src/lib/msun/i387/s_floor.S,v 1.10 2011/01/07 16:13:12 kib Exp $") 9 | 10 | ENTRY(floor) 11 | pushl %ebp 12 | movl %esp,%ebp 13 | subl $8,%esp 14 | 15 | fstcw -4(%ebp) /* store fpu control word */ 16 | movw -4(%ebp),%dx 17 | orw $0x0400,%dx /* round towards -oo */ 18 | andw $0xf7ff,%dx 19 | movw %dx,-8(%ebp) 20 | fldcw -8(%ebp) /* load modfied control word */ 21 | 22 | fldl 8(%ebp); /* round */ 23 | frndint 24 | 25 | fldcw -4(%ebp) /* restore original control word */ 26 | 27 | leave 28 | ret 29 | END(floor) 30 | 31 | 32 | /* Enable stack protection */ 33 | #if defined(__linux__) && defined(__ELF__) 34 | .section .note.GNU-stack,"",%progbits 35 | #endif 36 | -------------------------------------------------------------------------------- /libm/i387/s_floorf.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Written by J.T. Conklin . 3 | * Public domain. 4 | */ 5 | 6 | #include 7 | 8 | //__FBSDID("$FreeBSD: src/lib/msun/i387/s_floorf.S,v 1.4 2011/01/07 16:13:12 kib Exp $"); 9 | /* RCSID("$NetBSD: s_floorf.S,v 1.3 1995/05/09 00:04:32 jtc Exp $") */ 10 | 11 | ENTRY(floorf) 12 | pushl %ebp 13 | movl %esp,%ebp 14 | subl $8,%esp 15 | 16 | fstcw -4(%ebp) /* store fpu control word */ 17 | movw -4(%ebp),%dx 18 | orw $0x0400,%dx /* round towards -oo */ 19 | andw $0xf7ff,%dx 20 | movw %dx,-8(%ebp) 21 | fldcw -8(%ebp) /* load modfied control word */ 22 | 23 | flds 8(%ebp); /* round */ 24 | frndint 25 | 26 | fldcw -4(%ebp) /* restore original control word */ 27 | 28 | leave 29 | ret 30 | END(floorf) 31 | 32 | 33 | /* Enable stack protection */ 34 | #if defined(__linux__) && defined(__ELF__) 35 | .section .note.GNU-stack,"",%progbits 36 | #endif 37 | -------------------------------------------------------------------------------- /libm/i387/s_floorl.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Based on code written by J.T. Conklin . 3 | * Public domain. 4 | */ 5 | 6 | #include 7 | //__FBSDID("$FreeBSD: src/lib/msun/i387/s_floorl.S,v 1.3 2011/01/07 16:13:12 kib Exp $") 8 | 9 | ENTRY(floorl) 10 | pushl %ebp 11 | movl %esp,%ebp 12 | subl $8,%esp 13 | 14 | fstcw -4(%ebp) /* store fpu control word */ 15 | movw -4(%ebp),%dx 16 | orw $0x0400,%dx /* round towards -oo */ 17 | andw $0xf7ff,%dx 18 | movw %dx,-8(%ebp) 19 | fldcw -8(%ebp) /* load modfied control word */ 20 | 21 | fldt 8(%ebp) /* round */ 22 | frndint 23 | 24 | fldcw -4(%ebp) /* restore original control word */ 25 | 26 | leave 27 | ret 28 | END(floorl) 29 | 30 | 31 | /* Enable stack protection */ 32 | #if defined(__linux__) && defined(__ELF__) 33 | .section .note.GNU-stack,"",%progbits 34 | #endif 35 | -------------------------------------------------------------------------------- /libm/i387/s_logb.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Written by: 3 | * J.T. Conklin (jtc@netbsd.org) 4 | * Public domain. 5 | */ 6 | 7 | #include 8 | //__FBSDID("$FreeBSD: src/lib/msun/i387/s_logb.S,v 1.10 2011/01/07 16:13:12 kib Exp $") 9 | 10 | ENTRY(logb) 11 | fldl 4(%esp) 12 | fxtract 13 | fstp %st 14 | ret 15 | END(logb) 16 | 17 | 18 | /* Enable stack protection */ 19 | #if defined(__linux__) && defined(__ELF__) 20 | .section .note.GNU-stack,"",%progbits 21 | #endif 22 | -------------------------------------------------------------------------------- /libm/i387/s_logbf.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Written by J.T. Conklin . 3 | * Public domain. 4 | */ 5 | 6 | #include 7 | 8 | //__FBSDID("$FreeBSD: src/lib/msun/i387/s_logbf.S,v 1.3 2011/01/07 16:13:12 kib Exp $"); 9 | /* RCSID("$NetBSD: s_logbf.S,v 1.3 1995/05/09 00:15:12 jtc Exp $") */ 10 | 11 | ENTRY(logbf) 12 | flds 4(%esp) 13 | fxtract 14 | fstp %st 15 | ret 16 | END(logbf) 17 | 18 | 19 | /* Enable stack protection */ 20 | #if defined(__linux__) && defined(__ELF__) 21 | .section .note.GNU-stack,"",%progbits 22 | #endif 23 | -------------------------------------------------------------------------------- /libm/i387/s_logbl.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Written by: 3 | * J.T. Conklin (jtc@netbsd.org) 4 | * Public domain. 5 | */ 6 | 7 | #include 8 | //__FBSDID("$FreeBSD: src/lib/msun/i387/s_logbl.S,v 1.3 2011/01/07 16:13:12 kib Exp $") 9 | 10 | ENTRY(logbl) 11 | fldt 4(%esp) 12 | fxtract 13 | fstp %st 14 | ret 15 | 16 | 17 | /* Enable stack protection */ 18 | #if defined(__linux__) && defined(__ELF__) 19 | .section .note.GNU-stack,"",%progbits 20 | #endif 21 | -------------------------------------------------------------------------------- /libm/i387/s_rint.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Written by: 3 | * J.T. Conklin (jtc@netbsd.org) 4 | * Public domain. 5 | */ 6 | 7 | #include 8 | //__FBSDID("$FreeBSD: src/lib/msun/i387/s_rint.S,v 1.9 2011/01/07 16:13:12 kib Exp $") 9 | 10 | ENTRY(rint) 11 | fldl 4(%esp) 12 | frndint 13 | ret 14 | END(rint) 15 | 16 | 17 | /* Enable stack protection */ 18 | #if defined(__linux__) && defined(__ELF__) 19 | .section .note.GNU-stack,"",%progbits 20 | #endif 21 | -------------------------------------------------------------------------------- /libm/i387/s_rintf.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Written by J.T. Conklin . 3 | * Public domain. 4 | */ 5 | 6 | #include 7 | 8 | //__FBSDID("$FreeBSD: src/lib/msun/i387/s_rintf.S,v 1.3 2011/01/07 16:13:12 kib Exp $"); 9 | /* RCSID("$NetBSD: s_rintf.S,v 1.3 1995/05/09 00:17:22 jtc Exp $") */ 10 | 11 | ENTRY(rintf) 12 | flds 4(%esp) 13 | frndint 14 | ret 15 | END(rintf) 16 | 17 | 18 | /* Enable stack protection */ 19 | #if defined(__linux__) && defined(__ELF__) 20 | .section .note.GNU-stack,"",%progbits 21 | #endif 22 | -------------------------------------------------------------------------------- /libm/i387/s_rintl.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Written by: 3 | * J.T. Conklin (jtc@netbsd.org) 4 | * Public domain. 5 | */ 6 | 7 | #include 8 | //__FBSDID("$FreeBSD: src/lib/msun/i387/s_rintl.S,v 1.3 2011/01/07 16:13:12 kib Exp $") 9 | 10 | ENTRY(rintl) 11 | fldt 4(%esp) 12 | frndint 13 | ret 14 | 15 | 16 | /* Enable stack protection */ 17 | #if defined(__linux__) && defined(__ELF__) 18 | .section .note.GNU-stack,"",%progbits 19 | #endif 20 | -------------------------------------------------------------------------------- /libm/i387/s_scalbn.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Written by: 3 | * J.T. Conklin (jtc@netbsd.org) 4 | * Public domain. 5 | */ 6 | 7 | #include 8 | //__FBSDID("$FreeBSD: src/lib/msun/i387/s_scalbn.S,v 1.10 2011/01/07 16:13:12 kib Exp $") 9 | 10 | ENTRY(scalbn) 11 | fildl 12(%esp) 12 | fldl 4(%esp) 13 | fscale 14 | fstp %st(1) 15 | ret 16 | END(scalbn) 17 | 18 | .globl CNAME(ldexp) 19 | .set CNAME(ldexp),CNAME(scalbn) 20 | /* Enable stack protection */ 21 | #if defined(__linux__) && defined(__ELF__) 22 | .section .note.GNU-stack,"",%progbits 23 | #endif 24 | -------------------------------------------------------------------------------- /libm/i387/s_scalbnf.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Written by J.T. Conklin . 3 | * Public domain. 4 | */ 5 | 6 | #include 7 | 8 | //__FBSDID("$FreeBSD: src/lib/msun/i387/s_scalbnf.S,v 1.4 2011/01/07 16:13:12 kib Exp $"); 9 | /* RCSID("$NetBSD: s_scalbnf.S,v 1.4 1999/01/02 05:15:40 kristerw Exp $") */ 10 | 11 | ENTRY(scalbnf) 12 | fildl 8(%esp) 13 | flds 4(%esp) 14 | fscale 15 | fstp %st(1) /* bug fix for fp stack overflow */ 16 | ret 17 | END(scalbnf) 18 | 19 | .globl CNAME(ldexpf) 20 | .set CNAME(ldexpf),CNAME(scalbnf) 21 | 22 | 23 | /* Enable stack protection */ 24 | #if defined(__linux__) && defined(__ELF__) 25 | .section .note.GNU-stack,"",%progbits 26 | #endif 27 | -------------------------------------------------------------------------------- /libm/i387/s_scalbnl.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Written by J.T. Conklin . 3 | * Public domain. 4 | */ 5 | 6 | #include 7 | 8 | //__FBSDID("$FreeBSD: src/lib/msun/i387/s_scalbnl.S,v 1.3 2011/01/07 16:13:12 kib Exp $"); 9 | /* RCSID("$NetBSD: s_scalbnf.S,v 1.4 1999/01/02 05:15:40 kristerw Exp $") */ 10 | 11 | ENTRY(scalbnl) 12 | fildl 16(%esp) 13 | fldt 4(%esp) 14 | fscale 15 | fstp %st(1) 16 | ret 17 | END(scalbnl) 18 | 19 | .globl CNAME(ldexpl) 20 | .set CNAME(ldexpl),CNAME(scalbnl) 21 | 22 | 23 | /* Enable stack protection */ 24 | #if defined(__linux__) && defined(__ELF__) 25 | .section .note.GNU-stack,"",%progbits 26 | #endif 27 | -------------------------------------------------------------------------------- /libm/i387/s_significand.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Written by: 3 | * J.T. Conklin (jtc@netbsd.org) 4 | * Public domain. 5 | */ 6 | 7 | #include 8 | //__FBSDID("$FreeBSD: src/lib/msun/i387/s_significand.S,v 1.10 2011/01/07 16:13:12 kib Exp $") 9 | 10 | ENTRY(significand) 11 | fldl 4(%esp) 12 | fxtract 13 | fstp %st(1) 14 | ret 15 | END(significand) 16 | 17 | 18 | /* Enable stack protection */ 19 | #if defined(__linux__) && defined(__ELF__) 20 | .section .note.GNU-stack,"",%progbits 21 | #endif 22 | -------------------------------------------------------------------------------- /libm/i387/s_significandf.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Written by J.T. Conklin . 3 | * Public domain. 4 | */ 5 | 6 | #include 7 | 8 | //__FBSDID("$FreeBSD: src/lib/msun/i387/s_significandf.S,v 1.3 2011/01/07 16:13:12 kib Exp $"); 9 | /* RCSID("$NetBSD: s_significandf.S,v 1.3 1995/05/09 00:24:07 jtc Exp $") */ 10 | 11 | ENTRY(significandf) 12 | flds 4(%esp) 13 | fxtract 14 | fstp %st(1) 15 | ret 16 | END(significandf) 17 | 18 | 19 | /* Enable stack protection */ 20 | #if defined(__linux__) && defined(__ELF__) 21 | .section .note.GNU-stack,"",%progbits 22 | #endif 23 | -------------------------------------------------------------------------------- /libm/i387/s_sin.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Written by: 3 | * J.T. Conklin (jtc@netbsd.org) 4 | * Public domain. 5 | */ 6 | 7 | #include 8 | //__FBSDID("$FreeBSD: src/lib/msun/i387/s_sin.S,v 1.9 2011/01/07 16:13:12 kib Exp $") 9 | 10 | ENTRY(sin) 11 | fldl 4(%esp) 12 | fsin 13 | fnstsw %ax 14 | andw $0x400,%ax 15 | jnz 1f 16 | ret 17 | 1: fldpi 18 | fadd %st(0) 19 | fxch %st(1) 20 | 2: fprem1 21 | fnstsw %ax 22 | andw $0x400,%ax 23 | jnz 2b 24 | fstp %st(1) 25 | fsin 26 | ret 27 | END(sin) 28 | 29 | 30 | /* Enable stack protection */ 31 | #if defined(__linux__) && defined(__ELF__) 32 | .section .note.GNU-stack,"",%progbits 33 | #endif 34 | -------------------------------------------------------------------------------- /libm/i387/s_tan.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Written by: 3 | * J.T. Conklin (jtc@netbsd.org) 4 | * Public domain. 5 | */ 6 | 7 | #include 8 | //__FBSDID("$FreeBSD: src/lib/msun/i387/s_tan.S,v 1.9 2011/01/07 16:13:12 kib Exp $") 9 | 10 | ENTRY(tan) 11 | fldl 4(%esp) 12 | fptan 13 | fnstsw %ax 14 | andw $0x400,%ax 15 | jnz 1f 16 | fstp %st(0) 17 | ret 18 | 1: fldpi 19 | fadd %st(0) 20 | fxch %st(1) 21 | 2: fprem1 22 | fstsw %ax 23 | andw $0x400,%ax 24 | jnz 2b 25 | fstp %st(1) 26 | fptan 27 | fstp %st(0) 28 | ret 29 | END(tan) 30 | 31 | 32 | /* Enable stack protection */ 33 | #if defined(__linux__) && defined(__ELF__) 34 | .section .note.GNU-stack,"",%progbits 35 | #endif 36 | -------------------------------------------------------------------------------- /libm/i387/s_trunc.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Based on code written by J.T. Conklin . 3 | * Public domain. 4 | */ 5 | 6 | #include 7 | //__FBSDID("$FreeBSD: src/lib/msun/i387/s_trunc.S,v 1.3 2011/01/07 16:13:12 kib Exp $") 8 | 9 | ENTRY(trunc) 10 | pushl %ebp 11 | movl %esp,%ebp 12 | subl $8,%esp 13 | 14 | fstcw -4(%ebp) /* store fpu control word */ 15 | movw -4(%ebp),%dx 16 | orw $0x0c00,%dx /* round towards -oo */ 17 | movw %dx,-8(%ebp) 18 | fldcw -8(%ebp) /* load modfied control word */ 19 | 20 | fldl 8(%ebp) /* round */ 21 | frndint 22 | 23 | fldcw -4(%ebp) /* restore original control word */ 24 | 25 | leave 26 | ret 27 | END(trunc) 28 | 29 | 30 | /* Enable stack protection */ 31 | #if defined(__linux__) && defined(__ELF__) 32 | .section .note.GNU-stack,"",%progbits 33 | #endif 34 | -------------------------------------------------------------------------------- /libm/i387/s_truncf.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Based on code written by J.T. Conklin . 3 | * Public domain. 4 | */ 5 | 6 | #include 7 | //__FBSDID("$FreeBSD: src/lib/msun/i387/s_truncf.S,v 1.4 2011/01/07 16:13:12 kib Exp $") 8 | 9 | ENTRY(truncf) 10 | pushl %ebp 11 | movl %esp,%ebp 12 | subl $8,%esp 13 | 14 | fstcw -4(%ebp) /* store fpu control word */ 15 | movw -4(%ebp),%dx 16 | orw $0x0c00,%dx /* round towards -oo */ 17 | movw %dx,-8(%ebp) 18 | fldcw -8(%ebp) /* load modfied control word */ 19 | 20 | flds 8(%ebp) /* round */ 21 | frndint 22 | 23 | fldcw -4(%ebp) /* restore original control word */ 24 | 25 | leave 26 | ret 27 | END(truncf) 28 | 29 | 30 | /* Enable stack protection */ 31 | #if defined(__linux__) && defined(__ELF__) 32 | .section .note.GNU-stack,"",%progbits 33 | #endif 34 | -------------------------------------------------------------------------------- /libm/i387/s_truncl.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Based on code written by J.T. Conklin . 3 | * Public domain. 4 | */ 5 | 6 | #include 7 | //__FBSDID("$FreeBSD: src/lib/msun/i387/s_truncl.S,v 1.3 2011/01/07 16:13:12 kib Exp $") 8 | 9 | ENTRY(truncl) 10 | pushl %ebp 11 | movl %esp,%ebp 12 | subl $8,%esp 13 | 14 | fstcw -4(%ebp) /* store fpu control word */ 15 | movw -4(%ebp),%dx 16 | orw $0x0c00,%dx /* round towards -oo */ 17 | movw %dx,-8(%ebp) 18 | fldcw -8(%ebp) /* load modfied control word */ 19 | 20 | fldt 8(%ebp) /* round */ 21 | frndint 22 | 23 | fldcw -4(%ebp) /* restore original control word */ 24 | 25 | leave 26 | ret 27 | END(truncl) 28 | 29 | 30 | /* Enable stack protection */ 31 | #if defined(__linux__) && defined(__ELF__) 32 | .section .note.GNU-stack,"",%progbits 33 | #endif 34 | -------------------------------------------------------------------------------- /libm/ia64/Make.files: -------------------------------------------------------------------------------- 1 | $(CUR_SRCS) = fenv.c s_fma.S s_fmaf.S s_fmal.S 2 | -------------------------------------------------------------------------------- /libm/ia64/Makefile.inc: -------------------------------------------------------------------------------- 1 | # $FreeBSD: src/lib/msun/ia64/Makefile.inc,v 1.3 2006/03/27 23:59:45 deischen Exp $ 2 | 3 | ARCH_SRCS = s_fma.S s_fmaf.S s_fmal.S 4 | LDBL_PREC = 64 5 | SYM_MAPS += ${.CURDIR}/ia64/Symbol.map 6 | -------------------------------------------------------------------------------- /libm/ia64/Symbol.map: -------------------------------------------------------------------------------- 1 | /* 2 | * $FreeBSD: src/lib/msun/ia64/Symbol.map,v 1.3 2011/10/10 15:43:09 das Exp $ 3 | */ 4 | FBSD_1.0 { 5 | feupdateenv; 6 | }; 7 | 8 | FBSD_1.3 { 9 | fesetexceptflag; 10 | feraiseexcept; 11 | fegetenv; 12 | feholdexcept; 13 | }; 14 | -------------------------------------------------------------------------------- /libm/include/fenv.h: -------------------------------------------------------------------------------- 1 | #if defined (_TMS320C6X) 2 | #include "../c66/fenv.h" 3 | #elif defined( __LP64) 4 | #include "../amd64/fenv.h" 5 | #else 6 | #include "../i387/fenv.h" 7 | #endif 8 | -------------------------------------------------------------------------------- /libm/include/types-compat.h: -------------------------------------------------------------------------------- 1 | #ifndef _TYPES_COMPAT_H_ 2 | #define _TYPES_COMPAT_H_ 3 | 4 | #if (defined(_WIN32) || defined (_MSC_VER)) && !defined(__WIN32__) 5 | #define __WIN32__ 6 | #endif 7 | 8 | //#include 9 | #include 10 | #include 11 | 12 | #ifdef __linux__ 13 | /* Not sure what to do about __pure2 on linux */ 14 | #define __pure2 15 | #endif 16 | 17 | #ifdef __WIN32__ 18 | /* Not sure what to do about __pure2 on windows */ 19 | #define __pure2 20 | typedef uint8_t u_int8_t; 21 | typedef uint16_t u_int16_t; 22 | typedef uint32_t u_int32_t; 23 | typedef uint64_t u_int64_t; 24 | #endif 25 | 26 | #ifdef _TMS320C6X 27 | #define __pure2 28 | typedef uint8_t u_int8_t; 29 | typedef uint16_t u_int16_t; 30 | typedef uint32_t u_int32_t; 31 | typedef uint64_t u_int64_t; 32 | #endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /libm/ld128/Make.files: -------------------------------------------------------------------------------- 1 | SRCS = invtrig.c k_cosl.c k_sinl.c k_tanl.c # s_nanl.c s_exp2l.c 2 | -------------------------------------------------------------------------------- /libm/ld80/Make.files: -------------------------------------------------------------------------------- 1 | $(CUR_SRCS) += invtrig.c k_cosl.c k_sinl.c\ 2 | k_tanl.c s_exp2l.c 3 | 4 | ifneq ($(OS), WINNT) 5 | $(CUR_SRCS) += s_nanl.c 6 | endif -------------------------------------------------------------------------------- /libm/mips/Make.files: -------------------------------------------------------------------------------- 1 | $(CUR_SRCS) = fenv.c 2 | -------------------------------------------------------------------------------- /libm/mips/Makefile.inc: -------------------------------------------------------------------------------- 1 | # $FreeBSD: src/lib/msun/mips/Makefile.inc,v 1.1 2008/04/26 12:20:29 imp Exp $ 2 | 3 | LDBL_PREC = 53 4 | SYM_MAPS += ${.CURDIR}/mips/Symbol.map 5 | -------------------------------------------------------------------------------- /libm/mips/Symbol.map: -------------------------------------------------------------------------------- 1 | /* 2 | * $FreeBSD: src/lib/msun/mips/Symbol.map,v 1.3 2011/10/10 15:43:09 das Exp $ 3 | */ 4 | FBSD_1.0 { 5 | }; 6 | 7 | FBSD_1.3 { 8 | fesetexceptflag; 9 | feraiseexcept; 10 | fegetenv; 11 | feholdexcept; 12 | feupdateenv; 13 | }; 14 | -------------------------------------------------------------------------------- /libm/powerpc/Make.files: -------------------------------------------------------------------------------- 1 | $(CUR_SRCS) = fenv.c 2 | -------------------------------------------------------------------------------- /libm/powerpc/Makefile.inc: -------------------------------------------------------------------------------- 1 | # $FreeBSD: src/lib/msun/powerpc/Makefile.inc,v 1.2 2006/03/27 23:59:45 deischen Exp $ 2 | 3 | LDBL_PREC = 53 4 | SYM_MAPS += ${.CURDIR}/powerpc/Symbol.map 5 | -------------------------------------------------------------------------------- /libm/powerpc/Symbol.map: -------------------------------------------------------------------------------- 1 | /* 2 | * $FreeBSD: src/lib/msun/powerpc/Symbol.map,v 1.3 2011/10/10 15:43:09 das Exp $ 3 | */ 4 | FBSD_1.0 { 5 | }; 6 | 7 | FBSD_1.3 { 8 | fesetexceptflag; 9 | feraiseexcept; 10 | fegetenv; 11 | feholdexcept; 12 | feupdateenv; 13 | }; 14 | -------------------------------------------------------------------------------- /libm/sparc64/Make.files: -------------------------------------------------------------------------------- 1 | $(CUR_SRCS) = fenv.c e_sqrt.S e_sqrtf.S 2 | -------------------------------------------------------------------------------- /libm/sparc64/Makefile.inc: -------------------------------------------------------------------------------- 1 | # $FreeBSD: src/lib/msun/sparc64/Makefile.inc,v 1.3 2006/03/27 23:59:45 deischen Exp $ 2 | 3 | ARCH_SRCS= e_sqrt.S e_sqrtf.S 4 | LDBL_PREC= 113 5 | SYM_MAPS+= ${.CURDIR}/sparc64/Symbol.map 6 | -------------------------------------------------------------------------------- /libm/sparc64/Symbol.map: -------------------------------------------------------------------------------- 1 | /* 2 | * $FreeBSD: src/lib/msun/sparc64/Symbol.map,v 1.3 2011/10/10 15:43:09 das Exp $ 3 | */ 4 | FBSD_1.0 { 5 | }; 6 | 7 | FBSD_1.3 { 8 | fesetexceptflag; 9 | feraiseexcept; 10 | fegetenv; 11 | feholdexcept; 12 | feupdateenv; 13 | }; 14 | -------------------------------------------------------------------------------- /libm/src/common.c: -------------------------------------------------------------------------------- 1 | #include "math_private.h" 2 | DLLEXPORT int isopenlibm() { 3 | return 1; 4 | } 5 | -------------------------------------------------------------------------------- /libm/src/e_atanhf.c: -------------------------------------------------------------------------------- 1 | /* e_atanhf.c -- float version of e_atanh.c. 2 | * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. 3 | */ 4 | 5 | /* 6 | * ==================================================== 7 | * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. 8 | * 9 | * Developed at SunPro, a Sun Microsystems, Inc. business. 10 | * Permission to use, copy, modify, and distribute this 11 | * software is freely granted, provided that this notice 12 | * is preserved. 13 | * ==================================================== 14 | */ 15 | 16 | #include "cdefs-compat.h" 17 | //__FBSDID("$FreeBSD: src/lib/msun/src/e_atanhf.c,v 1.7 2008/02/22 02:30:34 das Exp $"); 18 | 19 | #include "openlibm.h" 20 | #include "math_private.h" 21 | 22 | static const float one = 1.0, huge = 1e30; 23 | 24 | static const float zero = 0.0; 25 | 26 | DLLEXPORT float 27 | __ieee754_atanhf(float x) 28 | { 29 | float t; 30 | int32_t hx,ix; 31 | GET_FLOAT_WORD(hx,x); 32 | ix = hx&0x7fffffff; 33 | if (ix>0x3f800000) /* |x|>1 */ 34 | return (x-x)/(x-x); 35 | if(ix==0x3f800000) 36 | return x/zero; 37 | if(ix<0x31800000&&(huge+x)>zero) return x; /* x<2**-28 */ 38 | SET_FLOAT_WORD(x,ix); 39 | if(ix<0x3f000000) { /* x < 0.5 */ 40 | t = x+x; 41 | t = (float)0.5*log1pf(t+t*x/(one-x)); 42 | } else 43 | t = (float)0.5*log1pf((x+x)/(one-x)); 44 | if(hx>=0) return t; else return -t; 45 | } 46 | -------------------------------------------------------------------------------- /libm/src/e_gamma.c: -------------------------------------------------------------------------------- 1 | 2 | /* @(#)e_gamma.c 1.3 95/01/18 */ 3 | /* 4 | * ==================================================== 5 | * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. 6 | * 7 | * Developed at SunSoft, a Sun Microsystems, Inc. business. 8 | * Permission to use, copy, modify, and distribute this 9 | * software is freely granted, provided that this notice 10 | * is preserved. 11 | * ==================================================== 12 | * 13 | */ 14 | 15 | #include "cdefs-compat.h" 16 | //__FBSDID("$FreeBSD: src/lib/msun/src/e_gamma.c,v 1.8 2008/02/22 02:30:34 das Exp $"); 17 | 18 | /* __ieee754_gamma(x) 19 | * Return the logarithm of the Gamma function of x. 20 | * 21 | * Method: call __ieee754_gamma_r 22 | */ 23 | 24 | #include "openlibm.h" 25 | #include "math_private.h" 26 | 27 | extern int signgam; 28 | 29 | DLLEXPORT double 30 | __ieee754_gamma(double x) 31 | { 32 | return __ieee754_gamma_r(x,&signgam); 33 | } 34 | -------------------------------------------------------------------------------- /libm/src/e_gamma_r.c: -------------------------------------------------------------------------------- 1 | 2 | /* @(#)e_gamma_r.c 1.3 95/01/18 */ 3 | /* 4 | * ==================================================== 5 | * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. 6 | * 7 | * Developed at SunSoft, a Sun Microsystems, Inc. business. 8 | * Permission to use, copy, modify, and distribute this 9 | * software is freely granted, provided that this notice 10 | * is preserved. 11 | * ==================================================== 12 | * 13 | */ 14 | 15 | #include "cdefs-compat.h" 16 | //__FBSDID("$FreeBSD: src/lib/msun/src/e_gamma_r.c,v 1.8 2008/02/22 02:30:34 das Exp $"); 17 | 18 | /* __ieee754_gamma_r(x, signgamp) 19 | * Reentrant version of the logarithm of the Gamma function 20 | * with user provide pointer for the sign of Gamma(x). 21 | * 22 | * Method: See __ieee754_lgamma_r 23 | */ 24 | 25 | #include "openlibm.h" 26 | #include "math_private.h" 27 | 28 | DLLEXPORT double 29 | __ieee754_gamma_r(double x, int *signgamp) 30 | { 31 | return __ieee754_lgamma_r(x,signgamp); 32 | } 33 | -------------------------------------------------------------------------------- /libm/src/e_gammaf.c: -------------------------------------------------------------------------------- 1 | /* e_gammaf.c -- float version of e_gamma.c. 2 | * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. 3 | */ 4 | 5 | /* 6 | * ==================================================== 7 | * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. 8 | * 9 | * Developed at SunPro, a Sun Microsystems, Inc. business. 10 | * Permission to use, copy, modify, and distribute this 11 | * software is freely granted, provided that this notice 12 | * is preserved. 13 | * ==================================================== 14 | */ 15 | 16 | #include "cdefs-compat.h" 17 | //__FBSDID("$FreeBSD: src/lib/msun/src/e_gammaf.c,v 1.7 2008/02/22 02:30:35 das Exp $"); 18 | 19 | /* __ieee754_gammaf(x) 20 | * Return the logarithm of the Gamma function of x. 21 | * 22 | * Method: call __ieee754_gammaf_r 23 | */ 24 | 25 | #include "openlibm.h" 26 | #include "math_private.h" 27 | 28 | extern int signgam; 29 | 30 | DLLEXPORT float 31 | __ieee754_gammaf(float x) 32 | { 33 | return __ieee754_gammaf_r(x,&signgam); 34 | } 35 | -------------------------------------------------------------------------------- /libm/src/e_gammaf_r.c: -------------------------------------------------------------------------------- 1 | /* e_gammaf_r.c -- float version of e_gamma_r.c. 2 | * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. 3 | */ 4 | 5 | /* 6 | * ==================================================== 7 | * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. 8 | * 9 | * Developed at SunPro, a Sun Microsystems, Inc. business. 10 | * Permission to use, copy, modify, and distribute this 11 | * software is freely granted, provided that this notice 12 | * is preserved. 13 | * ==================================================== 14 | */ 15 | 16 | #include "cdefs-compat.h" 17 | //__FBSDID("$FreeBSD: src/lib/msun/src/e_gammaf_r.c,v 1.8 2008/02/22 02:30:35 das Exp $"); 18 | 19 | /* __ieee754_gammaf_r(x, signgamp) 20 | * Reentrant version of the logarithm of the Gamma function 21 | * with user provide pointer for the sign of Gamma(x). 22 | * 23 | * Method: See __ieee754_lgammaf_r 24 | */ 25 | 26 | #include "openlibm.h" 27 | #include "math_private.h" 28 | 29 | DLLEXPORT float 30 | __ieee754_gammaf_r(float x, int *signgamp) 31 | { 32 | return __ieee754_lgammaf_r(x,signgamp); 33 | } 34 | -------------------------------------------------------------------------------- /libm/src/e_lgamma.c: -------------------------------------------------------------------------------- 1 | 2 | /* @(#)e_lgamma.c 1.3 95/01/18 */ 3 | /* 4 | * ==================================================== 5 | * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. 6 | * 7 | * Developed at SunSoft, a Sun Microsystems, Inc. business. 8 | * Permission to use, copy, modify, and distribute this 9 | * software is freely granted, provided that this notice 10 | * is preserved. 11 | * ==================================================== 12 | * 13 | */ 14 | 15 | #include "cdefs-compat.h" 16 | //__FBSDID("$FreeBSD: src/lib/msun/src/e_lgamma.c,v 1.9 2008/02/22 02:30:35 das Exp $"); 17 | 18 | /* __ieee754_lgamma(x) 19 | * Return the logarithm of the Gamma function of x. 20 | * 21 | * Method: call __ieee754_lgamma_r 22 | */ 23 | 24 | #include "openlibm.h" 25 | #include "math_private.h" 26 | 27 | extern int signgam; 28 | 29 | DLLEXPORT double 30 | __ieee754_lgamma(double x) 31 | { 32 | return __ieee754_lgamma_r(x,&signgam); 33 | } 34 | -------------------------------------------------------------------------------- /libm/src/e_lgammaf.c: -------------------------------------------------------------------------------- 1 | /* e_lgammaf.c -- float version of e_lgamma.c. 2 | * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. 3 | */ 4 | 5 | /* 6 | * ==================================================== 7 | * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. 8 | * 9 | * Developed at SunPro, a Sun Microsystems, Inc. business. 10 | * Permission to use, copy, modify, and distribute this 11 | * software is freely granted, provided that this notice 12 | * is preserved. 13 | * ==================================================== 14 | */ 15 | 16 | #include "cdefs-compat.h" 17 | //__FBSDID("$FreeBSD: src/lib/msun/src/e_lgammaf.c,v 1.8 2008/02/22 02:30:35 das Exp $"); 18 | 19 | /* __ieee754_lgammaf(x) 20 | * Return the logarithm of the Gamma function of x. 21 | * 22 | * Method: call __ieee754_lgammaf_r 23 | */ 24 | 25 | #include "openlibm.h" 26 | #include "math_private.h" 27 | 28 | extern int signgam; 29 | 30 | DLLEXPORT float 31 | __ieee754_lgammaf(float x) 32 | { 33 | return __ieee754_lgammaf_r(x,&signgam); 34 | } 35 | -------------------------------------------------------------------------------- /libm/src/e_scalb.c: -------------------------------------------------------------------------------- 1 | 2 | /* @(#)e_scalb.c 1.3 95/01/18 */ 3 | /* 4 | * ==================================================== 5 | * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. 6 | * 7 | * Developed at SunSoft, a Sun Microsystems, Inc. business. 8 | * Permission to use, copy, modify, and distribute this 9 | * software is freely granted, provided that this notice 10 | * is preserved. 11 | * ==================================================== 12 | */ 13 | 14 | #include "cdefs-compat.h" 15 | //__FBSDID("$FreeBSD: src/lib/msun/src/e_scalb.c,v 1.13 2008/02/22 02:30:35 das Exp $"); 16 | 17 | /* 18 | * __ieee754_scalb(x, fn) is provide for 19 | * passing various standard test suite. One 20 | * should use scalbn() instead. 21 | */ 22 | 23 | #include "openlibm.h" 24 | #include "math_private.h" 25 | 26 | #ifdef _SCALB_INT 27 | DLLEXPORT double 28 | __ieee754_scalb(double x, int fn) 29 | #else 30 | DLLEXPORT double 31 | __ieee754_scalb(double x, double fn) 32 | #endif 33 | { 34 | #ifdef _SCALB_INT 35 | return scalbn(x,fn); 36 | #else 37 | if (isnan(x)||isnan(fn)) return x*fn; 38 | if (!finite(fn)) { 39 | if(fn>0.0) return x*fn; 40 | else return x/(-fn); 41 | } 42 | if (rint(fn)!=fn) return (fn-fn)/(fn-fn); 43 | if ( fn > 65000.0) return scalbn(x, 65000); 44 | if (-fn > 65000.0) return scalbn(x,-65000); 45 | return scalbn(x,(int)fn); 46 | #endif 47 | } 48 | -------------------------------------------------------------------------------- /libm/src/e_scalbf.c: -------------------------------------------------------------------------------- 1 | /* e_scalbf.c -- float version of e_scalb.c. 2 | * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. 3 | */ 4 | 5 | /* 6 | * ==================================================== 7 | * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. 8 | * 9 | * Developed at SunPro, a Sun Microsystems, Inc. business. 10 | * Permission to use, copy, modify, and distribute this 11 | * software is freely granted, provided that this notice 12 | * is preserved. 13 | * ==================================================== 14 | */ 15 | 16 | #include "cdefs-compat.h" 17 | //__FBSDID("$FreeBSD: src/lib/msun/src/e_scalbf.c,v 1.13 2008/02/22 02:30:35 das Exp $"); 18 | 19 | #include "openlibm.h" 20 | #include "math_private.h" 21 | 22 | #ifdef _SCALB_INT 23 | DLLEXPORT float 24 | __ieee754_scalbf(float x, int fn) 25 | #else 26 | DLLEXPORT float 27 | __ieee754_scalbf(float x, float fn) 28 | #endif 29 | { 30 | #ifdef _SCALB_INT 31 | return scalbnf(x,fn); 32 | #else 33 | if ((__isnanf)(x)||(__isnanf)(fn)) return x*fn; 34 | if (!finitef(fn)) { 35 | if(fn>(float)0.0) return x*fn; 36 | else return x/(-fn); 37 | } 38 | if (rintf(fn)!=fn) return (fn-fn)/(fn-fn); 39 | if ( fn > (float)65000.0) return scalbnf(x, 65000); 40 | if (-fn > (float)65000.0) return scalbnf(x,-65000); 41 | return scalbnf(x,(int)fn); 42 | #endif 43 | } 44 | -------------------------------------------------------------------------------- /libm/src/k_logf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================== 3 | * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. 4 | * 5 | * Developed at SunPro, a Sun Microsystems, Inc. business. 6 | * Permission to use, copy, modify, and distribute this 7 | * software is freely granted, provided that this notice 8 | * is preserved. 9 | * ==================================================== 10 | */ 11 | 12 | #include "cdefs-compat.h" 13 | //__FBSDID("$FreeBSD: src/lib/msun/src/k_logf.h,v 1.3 2011/10/15 05:23:28 das Exp $"); 14 | 15 | /* 16 | * Float version of k_log.h. See the latter for most comments. 17 | */ 18 | 19 | static const float 20 | /* |(log(1+s)-log(1-s))/s - Lg(s)| < 2**-34.24 (~[-4.95e-11, 4.97e-11]). */ 21 | Lg1 = 0xaaaaaa.0p-24, /* 0.66666662693 */ 22 | Lg2 = 0xccce13.0p-25, /* 0.40000972152 */ 23 | Lg3 = 0x91e9ee.0p-25, /* 0.28498786688 */ 24 | Lg4 = 0xf89e26.0p-26; /* 0.24279078841 */ 25 | 26 | static inline float 27 | k_log1pf(float f) 28 | { 29 | float hfsq,s,z,R,w,t1,t2; 30 | 31 | s = f/((float)2.0+f); 32 | z = s*s; 33 | w = z*z; 34 | t1= w*(Lg2+w*Lg4); 35 | t2= z*(Lg1+w*Lg3); 36 | R = t2+t1; 37 | hfsq=(float)0.5*f*f; 38 | return s*(hfsq+R); 39 | } 40 | -------------------------------------------------------------------------------- /libm/src/s_copysign.c: -------------------------------------------------------------------------------- 1 | /* @(#)s_copysign.c 5.1 93/09/24 */ 2 | /* 3 | * ==================================================== 4 | * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. 5 | * 6 | * Developed at SunPro, a Sun Microsystems, Inc. business. 7 | * Permission to use, copy, modify, and distribute this 8 | * software is freely granted, provided that this notice 9 | * is preserved. 10 | * ==================================================== 11 | */ 12 | 13 | #include "cdefs-compat.h" 14 | //__FBSDID("$FreeBSD: src/lib/msun/src/s_copysign.c,v 1.10 2008/02/22 02:30:35 das Exp $"); 15 | 16 | /* 17 | * copysign(double x, double y) 18 | * copysign(x,y) returns a value with the magnitude of x and 19 | * with the sign bit of y. 20 | */ 21 | 22 | #include "openlibm.h" 23 | #include "math_private.h" 24 | 25 | DLLEXPORT double 26 | copysign(double x, double y) 27 | { 28 | u_int32_t hx,hy; 29 | GET_HIGH_WORD(hx,x); 30 | GET_HIGH_WORD(hy,y); 31 | SET_HIGH_WORD(x,(hx&0x7fffffff)|(hy&0x80000000)); 32 | return x; 33 | } 34 | -------------------------------------------------------------------------------- /libm/src/s_copysignf.c: -------------------------------------------------------------------------------- 1 | /* s_copysignf.c -- float version of s_copysign.c. 2 | * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. 3 | */ 4 | 5 | /* 6 | * ==================================================== 7 | * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. 8 | * 9 | * Developed at SunPro, a Sun Microsystems, Inc. business. 10 | * Permission to use, copy, modify, and distribute this 11 | * software is freely granted, provided that this notice 12 | * is preserved. 13 | * ==================================================== 14 | */ 15 | 16 | #include "cdefs-compat.h" 17 | //__FBSDID("$FreeBSD: src/lib/msun/src/s_copysignf.c,v 1.10 2008/02/22 02:30:35 das Exp $"); 18 | 19 | /* 20 | * copysignf(float x, float y) 21 | * copysignf(x,y) returns a value with the magnitude of x and 22 | * with the sign bit of y. 23 | */ 24 | 25 | #include "openlibm.h" 26 | #include "math_private.h" 27 | 28 | DLLEXPORT float 29 | copysignf(float x, float y) 30 | { 31 | u_int32_t ix,iy; 32 | GET_FLOAT_WORD(ix,x); 33 | GET_FLOAT_WORD(iy,y); 34 | SET_FLOAT_WORD(x,(ix&0x7fffffff)|(iy&0x80000000)); 35 | return x; 36 | } 37 | -------------------------------------------------------------------------------- /libm/src/s_fabs.c: -------------------------------------------------------------------------------- 1 | /* @(#)s_fabs.c 5.1 93/09/24 */ 2 | /* 3 | * ==================================================== 4 | * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. 5 | * 6 | * Developed at SunPro, a Sun Microsystems, Inc. business. 7 | * Permission to use, copy, modify, and distribute this 8 | * software is freely granted, provided that this notice 9 | * is preserved. 10 | * ==================================================== 11 | */ 12 | 13 | /* 14 | * fabs(x) returns the absolute value of x. 15 | */ 16 | 17 | #include "openlibm.h" 18 | #include "math_private.h" 19 | 20 | DLLEXPORT double 21 | fabs(double x) 22 | { 23 | u_int32_t high; 24 | GET_HIGH_WORD(high,x); 25 | SET_HIGH_WORD(x,high&0x7fffffff); 26 | return x; 27 | } 28 | -------------------------------------------------------------------------------- /libm/src/s_fabsf.c: -------------------------------------------------------------------------------- 1 | /* s_fabsf.c -- float version of s_fabs.c. 2 | * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. 3 | */ 4 | 5 | /* 6 | * ==================================================== 7 | * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. 8 | * 9 | * Developed at SunPro, a Sun Microsystems, Inc. business. 10 | * Permission to use, copy, modify, and distribute this 11 | * software is freely granted, provided that this notice 12 | * is preserved. 13 | * ==================================================== 14 | */ 15 | 16 | #include "cdefs-compat.h" 17 | //__FBSDID("$FreeBSD: src/lib/msun/src/s_fabsf.c,v 1.8 2008/02/22 02:30:35 das Exp $"); 18 | 19 | /* 20 | * fabsf(x) returns the absolute value of x. 21 | */ 22 | 23 | #include "openlibm.h" 24 | #include "math_private.h" 25 | 26 | DLLEXPORT float 27 | fabsf(float x) 28 | { 29 | u_int32_t ix; 30 | GET_FLOAT_WORD(ix,x); 31 | SET_FLOAT_WORD(x,ix&0x7fffffff); 32 | return x; 33 | } 34 | -------------------------------------------------------------------------------- /libm/src/s_fabsl.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcn-ee/ti-opencl/b1dfed9af21a1236380b9d643c432e4f0c619fce/libm/src/s_fabsl.c -------------------------------------------------------------------------------- /libm/src/s_finite.c: -------------------------------------------------------------------------------- 1 | /* @(#)s_finite.c 5.1 93/09/24 */ 2 | /* 3 | * ==================================================== 4 | * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. 5 | * 6 | * Developed at SunPro, a Sun Microsystems, Inc. business. 7 | * Permission to use, copy, modify, and distribute this 8 | * software is freely granted, provided that this notice 9 | * is preserved. 10 | * ==================================================== 11 | */ 12 | 13 | #include "cdefs-compat.h" 14 | //__FBSDID("$FreeBSD: src/lib/msun/src/s_finite.c,v 1.9 2008/02/22 02:30:35 das Exp $"); 15 | 16 | /* 17 | * finite(x) returns 1 is x is finite, else 0; 18 | * no branching! 19 | */ 20 | 21 | #include "openlibm.h" 22 | #include "math_private.h" 23 | 24 | DLLEXPORT int 25 | finite(double x) 26 | { 27 | int32_t hx; 28 | GET_HIGH_WORD(hx,x); 29 | return (int)((u_int32_t)((hx&0x7fffffff)-0x7ff00000)>>31); 30 | } 31 | -------------------------------------------------------------------------------- /libm/src/s_finitef.c: -------------------------------------------------------------------------------- 1 | /* s_finitef.c -- float version of s_finite.c. 2 | * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. 3 | */ 4 | 5 | /* 6 | * ==================================================== 7 | * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. 8 | * 9 | * Developed at SunPro, a Sun Microsystems, Inc. business. 10 | * Permission to use, copy, modify, and distribute this 11 | * software is freely granted, provided that this notice 12 | * is preserved. 13 | * ==================================================== 14 | */ 15 | 16 | #include "cdefs-compat.h" 17 | //__FBSDID("$FreeBSD: src/lib/msun/src/s_finitef.c,v 1.7 2008/02/22 02:30:35 das Exp $"); 18 | 19 | /* 20 | * finitef(x) returns 1 is x is finite, else 0; 21 | * no branching! 22 | */ 23 | 24 | #include "openlibm.h" 25 | #include "math_private.h" 26 | 27 | DLLEXPORT int 28 | finitef(float x) 29 | { 30 | int32_t ix; 31 | GET_FLOAT_WORD(ix,x); 32 | return (int)((u_int32_t)((ix&0x7fffffff)-0x7f800000)>>31); 33 | } 34 | -------------------------------------------------------------------------------- /libm/src/s_frexpf.c: -------------------------------------------------------------------------------- 1 | /* s_frexpf.c -- float version of s_frexp.c. 2 | * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. 3 | */ 4 | 5 | /* 6 | * ==================================================== 7 | * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. 8 | * 9 | * Developed at SunPro, a Sun Microsystems, Inc. business. 10 | * Permission to use, copy, modify, and distribute this 11 | * software is freely granted, provided that this notice 12 | * is preserved. 13 | * ==================================================== 14 | */ 15 | 16 | #include "cdefs-compat.h" 17 | //__FBSDID("$FreeBSD: src/lib/msun/src/s_frexpf.c,v 1.10 2008/02/22 02:30:35 das Exp $"); 18 | 19 | #include "openlibm.h" 20 | #include "math_private.h" 21 | 22 | static const float 23 | two25 = 3.3554432000e+07; /* 0x4c000000 */ 24 | 25 | DLLEXPORT float 26 | frexpf(float x, int *eptr) 27 | { 28 | int32_t hx,ix; 29 | GET_FLOAT_WORD(hx,x); 30 | ix = 0x7fffffff&hx; 31 | *eptr = 0; 32 | if(ix>=0x7f800000||(ix==0)) return x; /* 0,inf,nan */ 33 | if (ix<0x00800000) { /* subnormal */ 34 | x *= two25; 35 | GET_FLOAT_WORD(hx,x); 36 | ix = hx&0x7fffffff; 37 | *eptr = -25; 38 | } 39 | *eptr += (ix>>23)-126; 40 | hx = (hx&0x807fffff)|0x3f000000; 41 | SET_FLOAT_WORD(x,hx); 42 | return x; 43 | } 44 | -------------------------------------------------------------------------------- /libm/src/s_ilogb.c: -------------------------------------------------------------------------------- 1 | /* @(#)s_ilogb.c 5.1 93/09/24 */ 2 | /* 3 | * ==================================================== 4 | * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. 5 | * 6 | * Developed at SunPro, a Sun Microsystems, Inc. business. 7 | * Permission to use, copy, modify, and distribute this 8 | * software is freely granted, provided that this notice 9 | * is preserved. 10 | * ==================================================== 11 | */ 12 | 13 | #include "cdefs-compat.h" 14 | //__FBSDID("$FreeBSD: src/lib/msun/src/s_ilogb.c,v 1.10 2008/02/22 02:30:35 das Exp $"); 15 | 16 | /* ilogb(double x) 17 | * return the binary exponent of non-zero x 18 | * ilogb(0) = FP_ILOGB0 19 | * ilogb(NaN) = FP_ILOGBNAN (no signal is raised) 20 | * ilogb(inf) = INT_MAX (no signal is raised) 21 | */ 22 | 23 | #include 24 | 25 | #include "openlibm.h" 26 | #include "math_private.h" 27 | 28 | DLLEXPORT int 29 | ilogb(double x) 30 | { 31 | int32_t hx,lx,ix; 32 | 33 | EXTRACT_WORDS(hx,lx,x); 34 | hx &= 0x7fffffff; 35 | if(hx<0x00100000) { 36 | if((hx|lx)==0) 37 | return FP_ILOGB0; 38 | else /* subnormal x */ 39 | if(hx==0) { 40 | for (ix = -1043; lx>0; lx<<=1) ix -=1; 41 | } else { 42 | for (ix = -1022,hx<<=11; hx>0; hx<<=1) ix -=1; 43 | } 44 | return ix; 45 | } 46 | else if (hx<0x7ff00000) return (hx>>20)-1023; 47 | else if (hx>0x7ff00000 || lx!=0) return FP_ILOGBNAN; 48 | else return INT_MAX; 49 | } 50 | -------------------------------------------------------------------------------- /libm/src/s_ilogbf.c: -------------------------------------------------------------------------------- 1 | /* s_ilogbf.c -- float version of s_ilogb.c. 2 | * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. 3 | */ 4 | 5 | /* 6 | * ==================================================== 7 | * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. 8 | * 9 | * Developed at SunPro, a Sun Microsystems, Inc. business. 10 | * Permission to use, copy, modify, and distribute this 11 | * software is freely granted, provided that this notice 12 | * is preserved. 13 | * ==================================================== 14 | */ 15 | 16 | #include "cdefs-compat.h" 17 | //__FBSDID("$FreeBSD: src/lib/msun/src/s_ilogbf.c,v 1.8 2008/02/22 02:30:35 das Exp $"); 18 | 19 | #include 20 | 21 | #include "openlibm.h" 22 | #include "math_private.h" 23 | 24 | DLLEXPORT int 25 | ilogbf(float x) 26 | { 27 | int32_t hx,ix; 28 | 29 | GET_FLOAT_WORD(hx,x); 30 | hx &= 0x7fffffff; 31 | if(hx<0x00800000) { 32 | if(hx==0) 33 | return FP_ILOGB0; 34 | else /* subnormal x */ 35 | for (ix = -126,hx<<=8; hx>0; hx<<=1) ix -=1; 36 | return ix; 37 | } 38 | else if (hx<0x7f800000) return (hx>>23)-127; 39 | else if (hx>0x7f800000) return FP_ILOGBNAN; 40 | else return INT_MAX; 41 | } 42 | -------------------------------------------------------------------------------- /libm/src/s_llrint.c: -------------------------------------------------------------------------------- 1 | #include "cdefs-compat.h" 2 | //__FBSDID("$FreeBSD: src/lib/msun/src/s_llrint.c,v 1.1 2005/01/11 23:12:55 das Exp $"); 3 | 4 | #define type double 5 | #define roundit rint 6 | #define dtype long long 7 | #define fn llrint 8 | 9 | #include "s_lrint.c" 10 | -------------------------------------------------------------------------------- /libm/src/s_llrintf.c: -------------------------------------------------------------------------------- 1 | #include "cdefs-compat.h" 2 | //__FBSDID("$FreeBSD: src/lib/msun/src/s_llrintf.c,v 1.1 2005/01/11 23:12:55 das Exp $"); 3 | 4 | #define type float 5 | #define roundit rintf 6 | #define dtype long long 7 | #define fn llrintf 8 | 9 | #include "s_lrint.c" 10 | -------------------------------------------------------------------------------- /libm/src/s_llrintl.c: -------------------------------------------------------------------------------- 1 | #include "cdefs-compat.h" 2 | //__FBSDID("$FreeBSD: src/lib/msun/src/s_llrintl.c,v 1.1 2008/01/14 02:12:06 das Exp $"); 3 | 4 | #define type long double 5 | #define roundit rintl 6 | #define dtype long long 7 | #define fn llrintl 8 | 9 | #include "s_lrint.c" 10 | -------------------------------------------------------------------------------- /libm/src/s_llround.c: -------------------------------------------------------------------------------- 1 | #include "cdefs-compat.h" 2 | //__FBSDID("$FreeBSD: src/lib/msun/src/s_llround.c,v 1.2 2005/04/08 00:52:27 das Exp $"); 3 | 4 | #define type double 5 | #define roundit round 6 | #define dtype long long 7 | #define DTYPE_MIN LLONG_MIN 8 | #define DTYPE_MAX LLONG_MAX 9 | #define fn llround 10 | 11 | #include "s_lround.c" 12 | -------------------------------------------------------------------------------- /libm/src/s_llroundf.c: -------------------------------------------------------------------------------- 1 | #include "cdefs-compat.h" 2 | //__FBSDID("$FreeBSD: src/lib/msun/src/s_llroundf.c,v 1.2 2005/04/08 00:52:27 das Exp $"); 3 | 4 | #define type float 5 | #define roundit roundf 6 | #define dtype long long 7 | #define DTYPE_MIN LLONG_MIN 8 | #define DTYPE_MAX LLONG_MAX 9 | #define fn llroundf 10 | 11 | #include "s_lround.c" 12 | -------------------------------------------------------------------------------- /libm/src/s_llroundl.c: -------------------------------------------------------------------------------- 1 | #include "cdefs-compat.h" 2 | //__FBSDID("$FreeBSD: src/lib/msun/src/s_llroundl.c,v 1.1 2005/04/08 01:24:08 das Exp $"); 3 | 4 | #define type long double 5 | #define roundit roundl 6 | #define dtype long long 7 | #define DTYPE_MIN LLONG_MIN 8 | #define DTYPE_MAX LLONG_MAX 9 | #define fn llroundl 10 | 11 | #include "s_lround.c" 12 | -------------------------------------------------------------------------------- /libm/src/s_logb.c: -------------------------------------------------------------------------------- 1 | /* @(#)s_logb.c 5.1 93/09/24 */ 2 | /* 3 | * ==================================================== 4 | * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. 5 | * 6 | * Developed at SunPro, a Sun Microsystems, Inc. business. 7 | * Permission to use, copy, modify, and distribute this 8 | * software is freely granted, provided that this notice 9 | * is preserved. 10 | * ==================================================== 11 | */ 12 | 13 | #include "cdefs-compat.h" 14 | //__FBSDID("$FreeBSD: src/lib/msun/src/s_logb.c,v 1.12 2008/02/08 01:22:13 bde Exp $"); 15 | 16 | /* 17 | * double logb(x) 18 | * IEEE 754 logb. Included to pass IEEE test suite. Not recommend. 19 | * Use ilogb instead. 20 | */ 21 | 22 | #include 23 | 24 | #include "openlibm.h" 25 | #include "math_private.h" 26 | 27 | static const double 28 | two54 = 1.80143985094819840000e+16; /* 43500000 00000000 */ 29 | 30 | DLLEXPORT double 31 | logb(double x) 32 | { 33 | int32_t lx,ix; 34 | EXTRACT_WORDS(ix,lx,x); 35 | ix &= 0x7fffffff; /* high |x| */ 36 | if((ix|lx)==0) return -1.0/fabs(x); 37 | if(ix>=0x7ff00000) return x*x; 38 | if(ix<0x00100000) { 39 | x *= two54; /* convert subnormal x to normal */ 40 | GET_HIGH_WORD(ix,x); 41 | ix &= 0x7fffffff; 42 | return (double) ((ix>>20)-1023-54); 43 | } else 44 | return (double) ((ix>>20)-1023); 45 | } 46 | 47 | #if (LDBL_MANT_DIG == 53) 48 | __weak_reference(logb, logbl); 49 | #endif 50 | -------------------------------------------------------------------------------- /libm/src/s_logbf.c: -------------------------------------------------------------------------------- 1 | /* s_logbf.c -- float version of s_logb.c. 2 | * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. 3 | */ 4 | 5 | /* 6 | * ==================================================== 7 | * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. 8 | * 9 | * Developed at SunPro, a Sun Microsystems, Inc. business. 10 | * Permission to use, copy, modify, and distribute this 11 | * software is freely granted, provided that this notice 12 | * is preserved. 13 | * ==================================================== 14 | */ 15 | 16 | #include "cdefs-compat.h" 17 | //__FBSDID("$FreeBSD: src/lib/msun/src/s_logbf.c,v 1.9 2008/02/22 02:30:35 das Exp $"); 18 | 19 | #include "openlibm.h" 20 | #include "math_private.h" 21 | 22 | 23 | DLLEXPORT float 24 | logbf(float x) 25 | { 26 | int32_t ix; 27 | GET_FLOAT_WORD(ix,x); 28 | ix &= 0x7fffffff; /* high |x| */ 29 | if(ix==0) return (float)-1.0/fabsf(x); 30 | if(ix>=0x7f800000) return x*x; 31 | if(ix<0x00800000) { 32 | #if _TMS320C6X 33 | float __fmpy_by_0x1p25(float); 34 | x = __fmpy_by_0x1p25(x); 35 | #else 36 | static const float 37 | two25 = 3.355443200e+07; /* 0x4c000000 */ 38 | 39 | x *= two25; /* subnormal number, scale up x */ 40 | #endif 41 | 42 | GET_FLOAT_WORD(ix,x); 43 | ix &= 0x7fffffff; 44 | return (float) ((ix>>23)-127-25); 45 | } else 46 | return (float) ((ix>>23)-127); 47 | } 48 | -------------------------------------------------------------------------------- /libm/src/s_logbl.c: -------------------------------------------------------------------------------- 1 | /* 2 | * From: @(#)s_ilogb.c 5.1 93/09/24 3 | * ==================================================== 4 | * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. 5 | * 6 | * Developed at SunPro, a Sun Microsystems, Inc. business. 7 | * Permission to use, copy, modify, and distribute this 8 | * software is freely granted, provided that this notice 9 | * is preserved. 10 | * ==================================================== 11 | */ 12 | 13 | #include 14 | #include 15 | #include 16 | #include "math_private.h" 17 | #include "fpmath.h" 18 | 19 | DLLEXPORT long double 20 | logbl(long double x) 21 | { 22 | union IEEEl2bits u; 23 | unsigned long m; 24 | int b; 25 | 26 | u.e = x; 27 | if (u.bits.exp == 0) { 28 | if ((u.bits.manl | u.bits.manh) == 0) { /* x == 0 */ 29 | u.bits.sign = 1; 30 | return (1.0L / u.e); 31 | } 32 | /* denormalized */ 33 | if (u.bits.manh == 0) { 34 | m = 1lu << (LDBL_MANL_SIZE - 1); 35 | for (b = LDBL_MANH_SIZE; !(u.bits.manl & m); m >>= 1) 36 | b++; 37 | } else { 38 | m = 1lu << (LDBL_MANH_SIZE - 1); 39 | for (b = 0; !(u.bits.manh & m); m >>= 1) 40 | b++; 41 | } 42 | #ifdef LDBL_IMPLICIT_NBIT 43 | b++; 44 | #endif 45 | return ((long double)(LDBL_MIN_EXP - b - 1)); 46 | } 47 | if (u.bits.exp < (LDBL_MAX_EXP << 1) - 1) /* normal */ 48 | return ((long double)(u.bits.exp - LDBL_MAX_EXP + 1)); 49 | else /* +/- inf or nan */ 50 | return (x * x); 51 | } 52 | -------------------------------------------------------------------------------- /libm/src/s_lrintf.c: -------------------------------------------------------------------------------- 1 | #include "cdefs-compat.h" 2 | //__FBSDID("$FreeBSD: src/lib/msun/src/s_lrintf.c,v 1.1 2005/01/11 23:12:55 das Exp $"); 3 | 4 | #define type float 5 | #define roundit rintf 6 | #define dtype long 7 | #define fn lrintf 8 | 9 | #include "s_lrint.c" 10 | -------------------------------------------------------------------------------- /libm/src/s_lrintl.c: -------------------------------------------------------------------------------- 1 | #include "cdefs-compat.h" 2 | //__FBSDID("$FreeBSD: src/lib/msun/src/s_lrintl.c,v 1.1 2008/01/14 02:12:06 das Exp $"); 3 | 4 | #define type long double 5 | #define roundit rintl 6 | #define dtype long 7 | #define fn lrintl 8 | 9 | #include "s_lrint.c" 10 | -------------------------------------------------------------------------------- /libm/src/s_lroundf.c: -------------------------------------------------------------------------------- 1 | #include "cdefs-compat.h" 2 | //__FBSDID("$FreeBSD: src/lib/msun/src/s_lroundf.c,v 1.2 2005/04/08 00:52:27 das Exp $"); 3 | 4 | #define type float 5 | #define roundit roundf 6 | #define dtype long 7 | #define DTYPE_MIN LONG_MIN 8 | #define DTYPE_MAX LONG_MAX 9 | #define fn lroundf 10 | 11 | #include "s_lround.c" 12 | -------------------------------------------------------------------------------- /libm/src/s_lroundl.c: -------------------------------------------------------------------------------- 1 | #include "cdefs-compat.h" 2 | //__FBSDID("$FreeBSD: src/lib/msun/src/s_lroundl.c,v 1.1 2005/04/08 01:24:08 das Exp $"); 3 | 4 | #define type long double 5 | #define roundit roundl 6 | #define dtype long 7 | #define DTYPE_MIN LONG_MIN 8 | #define DTYPE_MAX LONG_MAX 9 | #define fn lroundl 10 | 11 | #include "s_lround.c" 12 | -------------------------------------------------------------------------------- /libm/src/s_signgam.c: -------------------------------------------------------------------------------- 1 | #include "openlibm.h" 2 | #include "math_private.h" 3 | int signgam = 0; 4 | -------------------------------------------------------------------------------- /libm/src/s_significand.c: -------------------------------------------------------------------------------- 1 | /* @(#)s_signif.c 5.1 93/09/24 */ 2 | /* 3 | * ==================================================== 4 | * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. 5 | * 6 | * Developed at SunPro, a Sun Microsystems, Inc. business. 7 | * Permission to use, copy, modify, and distribute this 8 | * software is freely granted, provided that this notice 9 | * is preserved. 10 | * ==================================================== 11 | */ 12 | 13 | #include "cdefs-compat.h" 14 | //__FBSDID("$FreeBSD: src/lib/msun/src/s_significand.c,v 1.10 2008/02/22 02:30:35 das Exp $"); 15 | 16 | /* 17 | * significand(x) computes just 18 | * scalb(x, (double) -ilogb(x)), 19 | * for exercising the fraction-part(F) IEEE 754-1985 test vector. 20 | */ 21 | 22 | #include "openlibm.h" 23 | #include "math_private.h" 24 | 25 | DLLEXPORT double 26 | significand(double x) 27 | { 28 | return __ieee754_scalb(x,(double) -ilogb(x)); 29 | } 30 | -------------------------------------------------------------------------------- /libm/src/s_significandf.c: -------------------------------------------------------------------------------- 1 | /* s_significandf.c -- float version of s_significand.c. 2 | * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. 3 | */ 4 | 5 | /* 6 | * ==================================================== 7 | * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. 8 | * 9 | * Developed at SunPro, a Sun Microsystems, Inc. business. 10 | * Permission to use, copy, modify, and distribute this 11 | * software is freely granted, provided that this notice 12 | * is preserved. 13 | * ==================================================== 14 | */ 15 | 16 | #include "cdefs-compat.h" 17 | //__FBSDID("$FreeBSD: src/lib/msun/src/s_significandf.c,v 1.8 2008/02/22 02:30:36 das Exp $"); 18 | 19 | #include "openlibm.h" 20 | #include "math_private.h" 21 | 22 | DLLEXPORT float 23 | significandf(float x) 24 | { 25 | return __ieee754_scalbf(x,(float) -ilogbf(x)); 26 | } 27 | -------------------------------------------------------------------------------- /libm/src/s_sincosl.c: -------------------------------------------------------------------------------- 1 | /* s_sincosl.c -- long double version of s_sincos.c 2 | * 3 | * Copyright (C) 2013 Elliot Saba 4 | * Developed at the University of Washington 5 | * 6 | * Permission to use, copy, modify, and distribute this 7 | * software is freely granted, provided that this notice 8 | * is preserved. 9 | * ==================================================== 10 | */ 11 | 12 | #include "cdefs-compat.h" 13 | 14 | #include 15 | 16 | #include "openlibm.h" 17 | #include "math_private.h" 18 | #if LDBL_MANT_DIG == 64 19 | #include "../ld80/e_rem_pio2l.h" 20 | #elif LDBL_MANT_DIG == 113 21 | #include "../ld128/e_rem_pio2l.h" 22 | #else 23 | #error "Unsupported long double format" 24 | #endif 25 | 26 | DLLEXPORT void 27 | sincosl( long double x, long double * s, long double * c ) 28 | { 29 | *s = cosl( x ); 30 | *c = sinl( x ); 31 | } 32 | -------------------------------------------------------------------------------- /libm/src/w_cabs.c: -------------------------------------------------------------------------------- 1 | /* 2 | * cabs() wrapper for hypot(). 3 | * 4 | * Written by J.T. Conklin, 5 | * Placed into the Public Domain, 1994. 6 | */ 7 | 8 | #include "cdefs-compat.h" 9 | //__FBSDID("$FreeBSD: src/lib/msun/src/w_cabs.c,v 1.7 2008/03/30 20:03:06 das Exp $"); 10 | 11 | #include 12 | #include 13 | #include 14 | #include "math_private.h" 15 | 16 | DLLEXPORT double 17 | cabs(double complex z) 18 | { 19 | return hypot(creal(z), cimag(z)); 20 | } 21 | 22 | #if LDBL_MANT_DIG == 53 23 | __weak_reference(cabs, cabsl); 24 | #endif 25 | -------------------------------------------------------------------------------- /libm/src/w_cabsf.c: -------------------------------------------------------------------------------- 1 | /* 2 | * cabsf() wrapper for hypotf(). 3 | * 4 | * Written by J.T. Conklin, 5 | * Placed into the Public Domain, 1994. 6 | */ 7 | 8 | #ifndef lint 9 | static const char rcsid[] = 10 | "$FreeBSD: src/lib/msun/src/w_cabsf.c,v 1.3 2001/06/13 15:16:30 ru Exp $"; 11 | #endif /* not lint */ 12 | 13 | #include 14 | #include 15 | #include "math_private.h" 16 | 17 | DLLEXPORT float 18 | cabsf(z) 19 | float complex z; 20 | { 21 | 22 | return hypotf(crealf(z), cimagf(z)); 23 | } 24 | -------------------------------------------------------------------------------- /libm/src/w_cabsl.c: -------------------------------------------------------------------------------- 1 | /* 2 | * cabs() wrapper for hypot(). 3 | * 4 | * Written by J.T. Conklin, 5 | * Placed into the Public Domain, 1994. 6 | * 7 | * Modified by Steven G. Kargl for the long double type. 8 | */ 9 | 10 | #include "cdefs-compat.h" 11 | //__FBSDID("$FreeBSD: src/lib/msun/src/w_cabsl.c,v 1.1 2008/03/30 20:02:03 das Exp $"); 12 | 13 | #include 14 | #include 15 | #include "math_private.h" 16 | 17 | DLLEXPORT long double 18 | cabsl(long double complex z) 19 | { 20 | return hypotl(creall(z), cimagl(z)); 21 | } 22 | -------------------------------------------------------------------------------- /libm/src/w_drem.c: -------------------------------------------------------------------------------- 1 | /* 2 | * drem() wrapper for remainder(). 3 | * 4 | * Written by J.T. Conklin, 5 | * Placed into the Public Domain, 1994. 6 | */ 7 | 8 | #include 9 | #include "math_private.h" 10 | 11 | DLLEXPORT double 12 | drem(x, y) 13 | double x, y; 14 | { 15 | return remainder(x, y); 16 | } 17 | -------------------------------------------------------------------------------- /libm/src/w_dremf.c: -------------------------------------------------------------------------------- 1 | /* 2 | * dremf() wrapper for remainderf(). 3 | * 4 | * Written by J.T. Conklin, 5 | * Placed into the Public Domain, 1994. 6 | */ 7 | /* $FreeBSD: src/lib/msun/src/w_dremf.c,v 1.3 2004/07/28 05:53:18 kan Exp $ */ 8 | 9 | #include "openlibm.h" 10 | #include "math_private.h" 11 | 12 | DLLEXPORT float 13 | dremf(float x, float y) 14 | { 15 | return remainderf(x, y); 16 | } 17 | -------------------------------------------------------------------------------- /libm/test/.gitignore: -------------------------------------------------------------------------------- 1 | /test-float 2 | /test-float-system 3 | /test-float.dSYM 4 | /test-double 5 | /test-double-system 6 | /test-double.dSYM 7 | /*.exe 8 | -------------------------------------------------------------------------------- /libm/test/Makefile: -------------------------------------------------------------------------------- 1 | OPENLIBM_HOME=$(abspath ..) 2 | include ../Make.inc 3 | 4 | all: test-double test-float # test-double-system test-float-system 5 | 6 | test-double: test-double.c libm-test.c 7 | $(CC) -g $@.c -D__BSD_VISIBLE -I ../include -I../src ../libopenlibm.a -o $@ 8 | 9 | test-float: test-float.c libm-test.c 10 | $(CC) -g $@.c -D__BSD_VISIBLE -I ../include -I../src ../libopenlibm.a -o $@ 11 | 12 | test-double-system: test-double.c libm-test.c 13 | $(CC) -g $< -DSYS_MATH_H -lm -o $@ 14 | 15 | test-float-system: test-float.c libm-test.c 16 | $(CC) -g $< -DSYS_MATH_H -lm -o $@ 17 | -------------------------------------------------------------------------------- /libm/test/test-double.c: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1997, 1999 Free Software Foundation, Inc. 2 | This file is part of the GNU C Library. 3 | Contributed by Andreas Jaeger , 1997. 4 | 5 | The GNU C Library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | The GNU C Library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with the GNU C Library; if not, write to the Free 17 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 18 | 02111-1307 USA. */ 19 | 20 | #define FUNC(function) function 21 | #define FLOAT double 22 | #define TEST_MSG "testing double (without inline functions)\n" 23 | #define MATHCONST(x) x 24 | #define CHOOSE(Clongdouble,Cdouble,Cfloat,Cinlinelongdouble,Cinlinedouble,Cinlinefloat) Cdouble 25 | #define PRINTF_EXPR "e" 26 | #define PRINTF_XEXPR "a" 27 | #define PRINTF_NEXPR "f" 28 | #define TEST_DOUBLE 1 29 | 30 | #ifndef __NO_MATH_INLINES 31 | # define __NO_MATH_INLINES 32 | #endif 33 | 34 | #include "libm-test.c" 35 | -------------------------------------------------------------------------------- /libm/test/test-float.c: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1997, 1999 Free Software Foundation, Inc. 2 | This file is part of the GNU C Library. 3 | Contributed by Andreas Jaeger , 1997. 4 | 5 | The GNU C Library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | The GNU C Library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with the GNU C Library; if not, write to the Free 17 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 18 | 02111-1307 USA. */ 19 | 20 | #define FUNC(function) function ## f 21 | #define FLOAT float 22 | #define TEST_MSG "testing float (without inline functions)\n" 23 | #define MATHCONST(x) x 24 | #define CHOOSE(Clongdouble,Cdouble,Cfloat,Cinlinelongdouble,Cinlinedouble,Cinlinefloat) Cfloat 25 | #define PRINTF_EXPR "e" 26 | #define PRINTF_XEXPR "a" 27 | #define PRINTF_NEXPR "f" 28 | #define TEST_FLOAT 1 29 | 30 | #ifndef __NO_MATH_INLINES 31 | # define __NO_MATH_INLINES 32 | #endif 33 | 34 | #include "libm-test.c" 35 | -------------------------------------------------------------------------------- /monitor/config.bld: -------------------------------------------------------------------------------- 1 | var rootDir = "" + java.lang.System.getenv("TI_OCL_CGT_INSTALL") 2 | 3 | var C66 = xdc.useModule('ti.targets.elf.C66'); 4 | C66.rootDir = rootDir; 5 | //C66.ccOpts.suffix += " -mi10 -mo"; 6 | C66.ccOpts.suffix += " -mi10 -mo --mem_model:data=far --mem_model:const=data"; 7 | 8 | Build.targets = [ C66 ]; 9 | -------------------------------------------------------------------------------- /monitor/export_syms: -------------------------------------------------------------------------------- 1 | |kernel_config_l2 2 | |edmamgr 3 | |EdmaMgr_ 4 | |GOMP_ 5 | |omp_ 6 | |__gomp_flush0 7 | |memcpy 8 | |printf 9 | |puts 10 | |_minit 11 | |malloc 12 | |memalign 13 | |free 14 | |calloc 15 | |realloc 16 | |__c6xabi_ 17 | |memset 18 | |memcpy 19 | |puts 20 | |ti_sysbios_family_c66_Cache 21 | |ti_sysbios_family_c66_Cache 22 | |ti_sysbios_knl 23 | |ti_sysbios_heaps 24 | |ti_sdo_ipc_MessageQ_* 25 | |MessageQ_* 26 | |ECPY_directConfigure 27 | |ECPY_directConfigure32 28 | |ECPY_directSetFinal 29 | |ECPY_directStartEdma 30 | |ECPY_directWait 31 | |exp 32 | |expf 33 | |exp10 34 | |exp10f 35 | |remquo 36 | |remquof 37 | |sincos 38 | |sincosf 39 | |fabs 40 | |ldexp 41 | |log 42 | |__heap_init_ 43 | |__malloc_ 44 | |__calloc_ 45 | |__realloc_ 46 | |__free_ 47 | |__memalign_ 48 | |__kernel_exit 49 | |__kernel_abort 50 | |__trace_print* 51 | |ocl_dsp_tidl_* 52 | |__clock* 53 | |__scratch_l1d_start 54 | -------------------------------------------------------------------------------- /monitor/platforms/am57x/Makefile: -------------------------------------------------------------------------------- 1 | # DEPENDS ON THE XDC ENVIRONMENT VARIABLE 2 | 3 | all: Platform.xdc 4 | @$(XDC_DIR)/xdc --xdcpath=$(BIOS_DIR)/packages -PR . 5 | 6 | clean: 7 | @$(XDC_DIR)/xdc clean --xdcpath=$(BIOS_DIR)/packages -PR . 8 | -------------------------------------------------------------------------------- /monitor/platforms/am57x/Platform.xs: -------------------------------------------------------------------------------- 1 | /*! 2 | * File generated by platform wizard. DO NOT MODIFY. 3 | * 4 | */ 5 | 6 | function getCpuDataSheet(cpuId) 7 | { 8 | return this.$module.CPU.getCpuDataSheet(cpuId); 9 | } 10 | 11 | function getCreateArgs() 12 | { 13 | return this.$module.CPU.getCreateArgs(); 14 | } 15 | 16 | function getExeContext(prog) 17 | { 18 | return this.$module.CPU.getExeContext(prog); 19 | } 20 | 21 | 22 | function getExecCmd(prog) 23 | { 24 | return this.$module.CPU.getExecCmd(prog); 25 | } 26 | 27 | 28 | function getLinkTemplate(prog) 29 | { 30 | return this.$module.CPU.getLinkTemplate(prog); 31 | } 32 | 33 | 34 | -------------------------------------------------------------------------------- /monitor/platforms/am57x/config.bld: -------------------------------------------------------------------------------- 1 | /*! 2 | * File generated by platform wizard. DO NOT MODIFY 3 | * 4 | */ 5 | 6 | Build.useTargets = null; 7 | -------------------------------------------------------------------------------- /monitor/platforms/am57x/package.bld: -------------------------------------------------------------------------------- 1 | /*! 2 | * File generated by platform wizard. DO NOT MODIFY. 3 | * 4 | */ 5 | 6 | Pkg.attrs.archiver = "zip"; 7 | Pkg.attrs.exportAll = true; 8 | 9 | 10 | -------------------------------------------------------------------------------- /monitor/platforms/am57x/package.xdc: -------------------------------------------------------------------------------- 1 | package platforms.am57x { 2 | module Platform; 3 | } 4 | 5 | -------------------------------------------------------------------------------- /monitor/platforms/dspc868x/Makefile: -------------------------------------------------------------------------------- 1 | # DEPENDS ON THE XDC ENVIRONMENT VARIABLE 2 | 3 | all: Platform.xdc 4 | @$(XDC)/xdc --xdcpath=$(BIOS_DIR)/packages -PR . 5 | 6 | clean: 7 | @$(XDC)/xdc clean -PR . 8 | @rm -f package/*.ccs 9 | @rm -f package/*.class 10 | @rm -f package/*.java 11 | @rm -f package/package.defs.h 12 | @rm -f package/package.xdc.dep 13 | @rm -f package/package.xdc.inc 14 | @rm -f package/*.c 15 | @rm -f package/.xdc-y23 16 | @rm -f package/.vers_r170 17 | @rm -f package/.vers_g180 18 | @rm -f package/.vers_b150 19 | @rm -f package/*.sch 20 | @rm -f -r package/cfg 21 | @rm -f -r package/lib 22 | @rm -f -r package/internal 23 | @rm -f -r package/external 24 | -------------------------------------------------------------------------------- /monitor/platforms/dspc868x/Platform.xs: -------------------------------------------------------------------------------- 1 | /*! 2 | * File generated by platform wizard. DO NOT MODIFY. 3 | * 4 | */ 5 | 6 | function getCpuDataSheet(cpuId) 7 | { 8 | return this.$module.CPU.getCpuDataSheet(cpuId); 9 | } 10 | 11 | function getCreateArgs() 12 | { 13 | return this.$module.CPU.getCreateArgs(); 14 | } 15 | 16 | function getExeContext(prog) 17 | { 18 | return this.$module.CPU.getExeContext(prog); 19 | } 20 | 21 | 22 | function getExecCmd(prog) 23 | { 24 | return this.$module.CPU.getExecCmd(prog); 25 | } 26 | 27 | 28 | function getLinkTemplate(prog) 29 | { 30 | return this.$module.CPU.getLinkTemplate(prog); 31 | } 32 | 33 | 34 | -------------------------------------------------------------------------------- /monitor/platforms/dspc868x/config.bld: -------------------------------------------------------------------------------- 1 | /*! 2 | * File generated by platform wizard. DO NOT MODIFY 3 | * 4 | */ 5 | 6 | Build.useTargets = null; 7 | -------------------------------------------------------------------------------- /monitor/platforms/dspc868x/package.bld: -------------------------------------------------------------------------------- 1 | /*! 2 | * File generated by platform wizard. DO NOT MODIFY. 3 | * 4 | */ 5 | 6 | Pkg.attrs.archiver = "zip"; 7 | Pkg.attrs.exportAll = true; 8 | 9 | 10 | -------------------------------------------------------------------------------- /monitor/platforms/dspc868x/package.xdc: -------------------------------------------------------------------------------- 1 | package platforms.dspc868x { 2 | module Platform; 3 | } 4 | 5 | -------------------------------------------------------------------------------- /monitor/platforms/evmk2e/Makefile: -------------------------------------------------------------------------------- 1 | # DEPENDS ON THE XDC ENVIRONMENT VARIABLE 2 | 3 | all: Platform.xdc 4 | @$(XDC)/xdc --xdcpath=$(BIOS_DIR)/packages -PR . 5 | 6 | clean: 7 | @$(XDC)/xdc clean -PR . 8 | -------------------------------------------------------------------------------- /monitor/platforms/evmk2e/Platform.xs: -------------------------------------------------------------------------------- 1 | /*! 2 | * File generated by platform wizard. DO NOT MODIFY. 3 | * 4 | */ 5 | 6 | function getCpuDataSheet(cpuId) 7 | { 8 | return this.$module.CPU.getCpuDataSheet(cpuId); 9 | } 10 | 11 | function getCreateArgs() 12 | { 13 | return this.$module.CPU.getCreateArgs(); 14 | } 15 | 16 | function getExeContext(prog) 17 | { 18 | return this.$module.CPU.getExeContext(prog); 19 | } 20 | 21 | 22 | function getExecCmd(prog) 23 | { 24 | return this.$module.CPU.getExecCmd(prog); 25 | } 26 | 27 | 28 | function getLinkTemplate(prog) 29 | { 30 | return this.$module.CPU.getLinkTemplate(prog); 31 | } 32 | 33 | 34 | -------------------------------------------------------------------------------- /monitor/platforms/evmk2e/config.bld: -------------------------------------------------------------------------------- 1 | /*! 2 | * File generated by platform wizard. DO NOT MODIFY 3 | * 4 | */ 5 | 6 | Build.useTargets = null; 7 | -------------------------------------------------------------------------------- /monitor/platforms/evmk2e/package.bld: -------------------------------------------------------------------------------- 1 | /*! 2 | * File generated by platform wizard. DO NOT MODIFY. 3 | * 4 | */ 5 | 6 | Pkg.attrs.archiver = "zip"; 7 | Pkg.attrs.exportAll = true; 8 | 9 | 10 | -------------------------------------------------------------------------------- /monitor/platforms/evmk2e/package.xdc: -------------------------------------------------------------------------------- 1 | package platforms.evmk2e { 2 | module Platform; 3 | } 4 | 5 | -------------------------------------------------------------------------------- /monitor/platforms/evmk2g/Makefile: -------------------------------------------------------------------------------- 1 | # DEPENDS ON THE XDC ENVIRONMENT VARIABLE 2 | 3 | all: Platform.xdc 4 | @$(XDC_DIR)/xdc --xdcpath=$(BIOS_DIR)/packages -PR . 5 | 6 | clean: 7 | @$(XDC_DIR)/xdc clean --xdcpath=$(BIOS_DIR)/packages -PR . 8 | -------------------------------------------------------------------------------- /monitor/platforms/evmk2g/Platform.xs: -------------------------------------------------------------------------------- 1 | /*! 2 | * File generated by platform wizard. DO NOT MODIFY. 3 | * 4 | */ 5 | 6 | function getCpuDataSheet(cpuId) 7 | { 8 | return this.$module.CPU.getCpuDataSheet(cpuId); 9 | } 10 | 11 | function getCreateArgs() 12 | { 13 | return this.$module.CPU.getCreateArgs(); 14 | } 15 | 16 | function getExeContext(prog) 17 | { 18 | return this.$module.CPU.getExeContext(prog); 19 | } 20 | 21 | 22 | function getExecCmd(prog) 23 | { 24 | return this.$module.CPU.getExecCmd(prog); 25 | } 26 | 27 | 28 | function getLinkTemplate(prog) 29 | { 30 | return this.$module.CPU.getLinkTemplate(prog); 31 | } 32 | 33 | 34 | -------------------------------------------------------------------------------- /monitor/platforms/evmk2g/config.bld: -------------------------------------------------------------------------------- 1 | /*! 2 | * File generated by platform wizard. DO NOT MODIFY 3 | * 4 | */ 5 | 6 | Build.useTargets = null; 7 | -------------------------------------------------------------------------------- /monitor/platforms/evmk2g/package.bld: -------------------------------------------------------------------------------- 1 | /*! 2 | * File generated by platform wizard. DO NOT MODIFY. 3 | * 4 | */ 5 | 6 | Pkg.attrs.archiver = "zip"; 7 | Pkg.attrs.exportAll = true; 8 | 9 | 10 | -------------------------------------------------------------------------------- /monitor/platforms/evmk2g/package.xdc: -------------------------------------------------------------------------------- 1 | package platforms.evmk2g { 2 | module Platform; 3 | } 4 | 5 | -------------------------------------------------------------------------------- /monitor/platforms/evmk2h/Makefile: -------------------------------------------------------------------------------- 1 | # DEPENDS ON THE XDC ENVIRONMENT VARIABLE 2 | 3 | all: Platform.xdc 4 | @$(XDC)/xdc --xdcpath=$(BIOS_DIR)/packages -PR . 5 | 6 | clean: 7 | @$(XDC)/xdc clean -PR . 8 | -------------------------------------------------------------------------------- /monitor/platforms/evmk2h/Platform.xs: -------------------------------------------------------------------------------- 1 | /*! 2 | * File generated by platform wizard. DO NOT MODIFY. 3 | * 4 | */ 5 | 6 | function getCpuDataSheet(cpuId) 7 | { 8 | return this.$module.CPU.getCpuDataSheet(cpuId); 9 | } 10 | 11 | function getCreateArgs() 12 | { 13 | return this.$module.CPU.getCreateArgs(); 14 | } 15 | 16 | function getExeContext(prog) 17 | { 18 | return this.$module.CPU.getExeContext(prog); 19 | } 20 | 21 | 22 | function getExecCmd(prog) 23 | { 24 | return this.$module.CPU.getExecCmd(prog); 25 | } 26 | 27 | 28 | function getLinkTemplate(prog) 29 | { 30 | return this.$module.CPU.getLinkTemplate(prog); 31 | } 32 | 33 | 34 | -------------------------------------------------------------------------------- /monitor/platforms/evmk2h/config.bld: -------------------------------------------------------------------------------- 1 | /*! 2 | * File generated by platform wizard. DO NOT MODIFY 3 | * 4 | */ 5 | 6 | Build.useTargets = null; 7 | -------------------------------------------------------------------------------- /monitor/platforms/evmk2h/package.bld: -------------------------------------------------------------------------------- 1 | /*! 2 | * File generated by platform wizard. DO NOT MODIFY. 3 | * 4 | */ 5 | 6 | Pkg.attrs.archiver = "zip"; 7 | Pkg.attrs.exportAll = true; 8 | 9 | 10 | -------------------------------------------------------------------------------- /monitor/platforms/evmk2h/package.xdc: -------------------------------------------------------------------------------- 1 | package platforms.evmk2h { 2 | module Platform; 3 | } 4 | 5 | -------------------------------------------------------------------------------- /monitor/platforms/evmk2l/Makefile: -------------------------------------------------------------------------------- 1 | # DEPENDS ON THE XDC ENVIRONMENT VARIABLE 2 | 3 | all: Platform.xdc 4 | @$(XDC)/xdc --xdcpath=$(BIOS_DIR)/packages -PR . 5 | 6 | clean: 7 | @$(XDC)/xdc clean -PR . 8 | -------------------------------------------------------------------------------- /monitor/platforms/evmk2l/Platform.xs: -------------------------------------------------------------------------------- 1 | /*! 2 | * File generated by platform wizard. DO NOT MODIFY. 3 | * 4 | */ 5 | 6 | function getCpuDataSheet(cpuId) 7 | { 8 | return this.$module.CPU.getCpuDataSheet(cpuId); 9 | } 10 | 11 | function getCreateArgs() 12 | { 13 | return this.$module.CPU.getCreateArgs(); 14 | } 15 | 16 | function getExeContext(prog) 17 | { 18 | return this.$module.CPU.getExeContext(prog); 19 | } 20 | 21 | 22 | function getExecCmd(prog) 23 | { 24 | return this.$module.CPU.getExecCmd(prog); 25 | } 26 | 27 | 28 | function getLinkTemplate(prog) 29 | { 30 | return this.$module.CPU.getLinkTemplate(prog); 31 | } 32 | 33 | 34 | -------------------------------------------------------------------------------- /monitor/platforms/evmk2l/config.bld: -------------------------------------------------------------------------------- 1 | /*! 2 | * File generated by platform wizard. DO NOT MODIFY 3 | * 4 | */ 5 | 6 | Build.useTargets = null; 7 | -------------------------------------------------------------------------------- /monitor/platforms/evmk2l/package.bld: -------------------------------------------------------------------------------- 1 | /*! 2 | * File generated by platform wizard. DO NOT MODIFY. 3 | * 4 | */ 5 | 6 | Pkg.attrs.archiver = "zip"; 7 | Pkg.attrs.exportAll = true; 8 | 9 | 10 | -------------------------------------------------------------------------------- /monitor/platforms/evmk2l/package.xdc: -------------------------------------------------------------------------------- 1 | package platforms.evmk2l { 2 | module Platform; 3 | } 4 | 5 | -------------------------------------------------------------------------------- /monitor/src/edma_config.c: -------------------------------------------------------------------------------- 1 | #ifdef TI_66AK2X 2 | #include "edma3_config_evmTCI6638K2K.c" 3 | #else 4 | #ifdef TI_C6678 5 | #else 6 | #error "No edma config file exists" 7 | #endif 8 | #endif 9 | -------------------------------------------------------------------------------- /monitor/src/touch.asm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcn-ee/ti-opencl/b1dfed9af21a1236380b9d643c432e4f0c619fce/monitor/src/touch.asm -------------------------------------------------------------------------------- /monitor/src/trace.h: -------------------------------------------------------------------------------- 1 | #ifndef _TRACE_H 2 | #define _TRACE_H 3 | 4 | #if defined(ULM_ENABLED) 5 | #define TRACE(state, kid, wgid) ulm_put_statemsg(state, kid, wgid) 6 | #else 7 | #define TRACE(code, kid, wgid) 8 | #endif 9 | 10 | #endif // _TRACE_H 11 | 12 | -------------------------------------------------------------------------------- /monitor_ipu/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Build monitor_ipu 2 | 3 | if (BUILD_OUTPUT STREQUAL "all") 4 | install(CODE "execute_process(COMMAND make -f Makefile BUILD_AM57=1 BUILD_EVE_FIRMWARE=${BUILD_EVE_FIRMWARE} WORKING_DIRECTORY ${OCL_MONITOR_IPU_DIR})") 5 | endif() 6 | 7 | # Install monitor_eve firmware 8 | if (BUILD_OUTPUT STREQUAL "all") 9 | install(FILES bin/release/server_ipu1.xem4 DESTINATION /lib/firmware 10 | RENAME dra7-ipu1-fw.xem4.opencl-monitor ${OCL_FPERMS}) 11 | endif() 12 | -------------------------------------------------------------------------------- /monitor_ipu/lib/sbl_lib_1_9_0_9.aem4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcn-ee/ti-opencl/b1dfed9af21a1236380b9d643c432e4f0c619fce/monitor_ipu/lib/sbl_lib_1_9_0_9.aem4 -------------------------------------------------------------------------------- /opencl-manifest.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcn-ee/ti-opencl/b1dfed9af21a1236380b9d643c432e4f0c619fce/opencl-manifest.html -------------------------------------------------------------------------------- /packages/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Create and install the OpenCL RTSC module 2 | 3 | if (${BUILD_OS} MATCHES "SYS_BIOS") 4 | install(CODE "execute_process(COMMAND make WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ti/opencl)") 5 | if (${BUILD_TARGET} MATCHES "ARM_AM57") 6 | install(CODE "execute_process(COMMAND make WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ti/opencl/platforms/am57x_rtos)") 7 | endif() 8 | install(DIRECTORY ti/opencl/ DESTINATION /. ${OCL_DPERMS}) 9 | endif() 10 | -------------------------------------------------------------------------------- /packages/ti/opencl/config.bld: -------------------------------------------------------------------------------- 1 | var A15 = xdc.useModule('gnu.targets.arm.A15F'); 2 | A15.rootDir = "" + java.lang.System.getenv("GCC_ARM_NONE_TOOLCHAIN") 3 | 4 | var DSP = xdc.useModule('ti.targets.elf.C66'); 5 | DSP.rootDir = "" + java.lang.System.getenv("TI_OCL_CGT_INSTALL") 6 | 7 | Build.targets = [ 8 | A15, DSP, 9 | ]; 10 | -------------------------------------------------------------------------------- /packages/ti/opencl/package.bld: -------------------------------------------------------------------------------- 1 | /* explicit references to global objects */ 2 | var Build = xdc.useModule('xdc.bld.BuildEnvironment'); 3 | var Pkg = xdc.useModule('xdc.bld.PackageContents'); 4 | 5 | Pkg.attrs.profile = 'release'; 6 | 7 | for each (var targ in Build.targets) { 8 | if (targ.name == "A15F") 9 | { 10 | Pkg.addLibrary("lib/" + Pkg.name, targ).addObjects( 11 | ["configuration.c"]); 12 | } 13 | if (targ.name == "C66") 14 | { 15 | Pkg.addLibrary("lib/" + Pkg.name, targ).addObjects( 16 | ["configuration_dsp.c"]); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /packages/ti/opencl/platforms/am57x_rtos/Makefile: -------------------------------------------------------------------------------- 1 | # DEPENDS ON THE XDC ENVIRONMENT VARIABLE 2 | 3 | # If not specified, pick a default location for TI dependent packages 4 | include ../../../../../host/Makefile.inc 5 | 6 | XDC_DIR ?= $(wildcard $(DEFAULT_PSDK_RTOS)/xdctools_*) 7 | BIOS_DIR ?= $(wildcard $(DEFAULT_PSDK_RTOS)/bios_*) 8 | 9 | all: Platform.xdc 10 | @$(XDC_DIR)/xdc --xdcpath=$(BIOS_DIR)/packages -PR . 11 | 12 | clean: 13 | @$(XDC_DIR)/xdc clean --xdcpath=$(BIOS_DIR)/packages -PR . 14 | -------------------------------------------------------------------------------- /packages/ti/opencl/platforms/am57x_rtos/config.bld: -------------------------------------------------------------------------------- 1 | /*! 2 | * File generated by platform wizard. DO NOT MODIFY 3 | * 4 | */ 5 | 6 | Build.useTargets = null; 7 | -------------------------------------------------------------------------------- /packages/ti/opencl/platforms/am57x_rtos/package.bld: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 by Texas Instruments and others. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Texas Instruments - initial implementation 10 | * 11 | * */ 12 | 13 | /* 14 | * @(#) ti.platforms.evmDRA7XX; 1, 0, 0, 0,; 1-29-2016 10:02:10; /db/ztree/library/trees/platform/platform-q17/src/ 15 | */ 16 | 17 | -------------------------------------------------------------------------------- /profiling/classes/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | empty __init__.py file for importing from subdirectories 3 | """ 4 | -------------------------------------------------------------------------------- /profiling/classes/core.py: -------------------------------------------------------------------------------- 1 | """Class Used to Contain Profile Data for an event's core""" 2 | class core_data(object): 3 | def __init__(self): 4 | core_name = "" 5 | core_number = -1 6 | counter0_diff = None 7 | counter1_diff = None 8 | --------------------------------------------------------------------------------