{"id":26633019,"url":"https://github.com/bhavjitchauhan/llsimd","last_synced_at":"2026-04-28T22:35:06.293Z","repository":{"id":281937930,"uuid":"941711251","full_name":"bhavjitChauhan/llsimd","owner":"bhavjitChauhan","description":"Portable SIMD intrinsics through LLVM IR.","archived":false,"fork":false,"pushed_at":"2025-03-23T14:49:52.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-23T15:35:44.265Z","etag":null,"topics":["llvm","simd"],"latest_commit_sha":null,"homepage":"","language":"C++","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/bhavjitChauhan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-02T22:56:00.000Z","updated_at":"2025-03-23T14:55:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"9a7def32-88bb-49d0-af65-f94d08650fa2","html_url":"https://github.com/bhavjitChauhan/llsimd","commit_stats":null,"previous_names":["bhavjitchauhan/psimd"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhavjitChauhan%2Fllsimd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhavjitChauhan%2Fllsimd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhavjitChauhan%2Fllsimd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhavjitChauhan%2Fllsimd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bhavjitChauhan","download_url":"https://codeload.github.com/bhavjitChauhan/llsimd/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245294776,"owners_count":20591909,"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":["llvm","simd"],"created_at":"2025-03-24T15:13:20.664Z","updated_at":"2026-04-28T22:35:06.282Z","avatar_url":"https://github.com/bhavjitChauhan.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# llsimd\n\nPortable SIMD intrinsics through LLVM IR.\n\n## Overview\n\nThe llsimd project enables program written in SIMD intrinsics to be run on any\nCPU architecture. We do this by leveraging the target-independent nature of LLVM\nIR’s first-class support of vector operations. This allows preexisting projects\nto become more widely accessible and future-proof against the rise and decline\nof specific architectures over time.\n\nFor more information, see [llsimd.pdf](llsimd.pdf).\n\n## Example\n\n```diff\n-%result = call \u003c8 x i16\u003e @llvm.x86.sse2.pslli.w(\u003c8 x i16\u003e %m, i32 %count)\n+%trunc = trunc i32 %count to i16\n+%insert = insertelement \u003c8 x i16\u003e undef, i16 %trunc, i32 0\n+%shuffle = shufflevector \u003c8 x i16\u003e %insert, \u003c8 x i16\u003e undef, \u003c8 x i32\u003e zeroinitializer\n+%result = shl \u003c8 x i16\u003e %m, %shuffle\n```\n\n## Usage\n\n### Requirements\n\n- LLVM/Clang 20\n- CMake 3.20+\n- an x86 cross-compilation toolchain\n\nOn Debian/Ubuntu, these requirements can be fulfilled with:\n\n```bash\nwget https://apt.llvm.org/llvm.sh\nchmod +x llvm.sh\nsudo ./llvm.sh 20\nsudo apt install cmake gcc-multilib-x86-64-linux-gnu\n```\n\n### Build\n\n```bash\ncmake -B build\ncmake --build build\n```\n\n### Run\n\nExecute the [llsimd.sh](llsimd.sh) script in the same directory as the built `libllsimd.so`:\n\n```bash\ncd build\n../llsimd.sh ../in.c\n```\n\n## Development\n\n### Get LLVM/Clang\n\n#### Building from Source\n\nRequirements:\n- Git\n- Ninja (optional)\n\n\u003e [!WARNING]\n\u003e Debug builds need 10-15 GB of disk space. Confirm that just enabling assertion\n\u003e checks or a `RelWithDebInfo` build doesn't cover your needs.\n\nSee the official\n[Getting Started with the LLVM System](https://llvm.org/docs/GettingStarted.html)\ntutorial for more information.\n\n```bash\ngit clone -b llvmorg-20.1.0 --depth 1 https://github.com/llvm/llvm-project\ncmake -S llvm -B build -G Ninja -DLLVM_ENABLE_PROJECTS=clang -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON\ncmake --build build\n# Optionally install the build (to `/usr/local` by default)\nsudo cmake --install build\n```\n\n#### Installing Pre-built Binaries\n\n##### Debian/Ubuntu\n\nInstall the official APT packages:\n\n```bash\nwget https://apt.llvm.org/llvm.sh\nchmod +x llvm.sh\nsudo ./llvm.sh 20\n```\n\n##### Other\n\nDownload the binaries from LLVM's\n[GitHub releases](https://github.com/llvm/llvm-project/tree/llvmorg-20.1.0).\n\n### Test\n\n#### Unit Tests\n\nRequirements:\n\n- an x86 machine\n- Python 3\n- [lit](https://pypi.org/project/lit/)\n\n```bash\ncmake --build build --target check\n```\n\n#### Manual\n\n```bash\n# C/C++ -\u003e IR\nclang -S -emit-llvm ../in.c\n# Run pass on IR\nopt -load-pass-plugin ./libllsimd.so -passes=llsimd -S in.ll -stats -o out.ll\n# Interpret IR\nlli in.ll\nlli out.ll\n```\n\nTo see pass statistics, LLVM needs to be compiled with assertion checks enabled.\n\nThe output assembly can be compared to the original:\n\n```bash\n# C/C++ -\u003e assembly\nclang -S ../in.c -o in.s\n# IR -\u003e assembly\nllc out.ll\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbhavjitchauhan%2Fllsimd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbhavjitchauhan%2Fllsimd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbhavjitchauhan%2Fllsimd/lists"}