{"id":22751970,"url":"https://github.com/aandreba/llml_simd","last_synced_at":"2025-09-10T14:20:31.460Z","repository":{"id":40570774,"uuid":"444920335","full_name":"Aandreba/llml_simd","owner":"Aandreba","description":"SIMD extension for a variety of targets","archived":false,"fork":false,"pushed_at":"2024-02-28T15:52:51.000Z","size":99,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T17:47:44.076Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Aandreba.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-01-05T19:06:07.000Z","updated_at":"2025-01-30T19:27:24.000Z","dependencies_parsed_at":"2022-07-27T08:02:01.397Z","dependency_job_id":null,"html_url":"https://github.com/Aandreba/llml_simd","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aandreba%2Fllml_simd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aandreba%2Fllml_simd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aandreba%2Fllml_simd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aandreba%2Fllml_simd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Aandreba","download_url":"https://codeload.github.com/Aandreba/llml_simd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248893833,"owners_count":21179103,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-11T05:09:12.366Z","updated_at":"2025-04-14T13:57:20.190Z","avatar_url":"https://github.com/Aandreba.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Crates.io](https://img.shields.io/crates/v/llml_simd)](https://crates.io/crates/llml_simd)\n[![NPM](https://img.shields.io/npm/v/llml_simd)](https://www.npmjs.com/package/llml_simd)\n[![Rust docs](https://img.shields.io/docsrs/llml_simd)](https://docs.rs/llml_simd/latest/llml_simd/)\n\n# LLML's SIMD\nSIMD (**S**ingle **I**nstruction **M**ultiple **D**ata) extension for a variety of targets.\nThis project was initially started to facilitate the expansion of [LLML](https://github.com/Aandreba/llml)'s suported targets \u0026 features\n\n## Contents ##\nThis crate/library contains bindings to native-level SIMD instructions (alongside some polyfill) for SSE, AVX (see [AVX support](#AVX-Support)), NEON \u0026 WASM. It also contains naive implementations of all data-types (see [naive implementation](#Naive-implementation))\n\n## No std ##\n```llml_simd``` is a no_std crate. This means that it can be used for embeded systems projects seamlessly.\n\n## Naive implementation ##\nIf no supported target is detected (or if you enable the feature ```force_naive```), Rust will compile the the SIMD vectors in naive mode. This mode represent's all data types as an array, executing most of the methods via iterators. This mode, while **not recommended**, is usefull if you intend to share code with some other programm that doesn't have SIMD support.\n\n\u003e **Warning**\\\n\u003e While not explicitly SIMD, ```rustc``` might still optimize some parts of the code to utilize SIMD instructions if it can and you allow it to.\n\u003e If you want to fully disable SIMD instructions, use ```--target-feature=-sse``` on x86/x86_64 and ```--target-feature=-neon``` on arm/aarch64 (naive mode will be used automatically in those cases, not requiring to enable ```force_naive```)\n\n## AVX Support ##\nIf Rust detects ```avx``` as a target feature **and** you have the ```use_avx``` feature enabled (see [features](##Features)), ```llml_simd``` will compile all vectors over 128-bit long with AVX instructions, increasing performance significantly.\n\n## JavaScript Library ##\nThanks to WASM, ```llml_simd``` is available for JavaScript/TypeScript via npm.\\\nYou can install it into your Node project with ```npm i llml_simd```\n\n## Features ##\n| Feature                 | Description                                                                                                                         |\n| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |\n| ```use_std```           | Enables standard library functionality. Enabled by default                                                                          |\n| ```force_naive```       | Forces naive types (see [Naive implementation](#Naive-implementation))                                                              |\n| ```use_avx```           | Enables the use of AVX SIMD types (see [AVX support](#AVX-Support))                                                                 |\n| ```random```            | Enables random generation of vectors via [rand](https://github.com/rust-random/rand)                                                |\n| ```serialize```         | Enables serialization and deserialization of vectors via [serde](https://github.com/serde-rs/serde)                                 |\n\n## Examples ##\n### Dot product (Rust) ###\n```rust\nuse llml_simd::float::single::f32x4;\n\npub fn main() {\n    let alpha = f32x4::new([1., 2., 3., 4.]);\n    let beta = f32x4::new([5., 6., 7., 8.]);\n\n    let dot = (alpha * beta).sum();\n    assert_eq!(dot, 70.);\n}\n```\n\n### Dot product (JavaScript) ###\n```js\nimport { f32x4 } from llml_simd\n\nlet alpha = new f32x4(new Float32Array([1, 2, 3, 4]))\nlet beta = new f32x4(new Float32Array([5, 6, 7, 8]))\n\nlet dot = alpha.mul(beta).sum()\nconsole.assert(dot === 70)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faandreba%2Fllml_simd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faandreba%2Fllml_simd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faandreba%2Fllml_simd/lists"}