{"id":50128616,"url":"https://github.com/intel/optimization-manual","last_synced_at":"2026-06-09T13:01:14.974Z","repository":{"id":37703817,"uuid":"366178205","full_name":"intel/optimization-manual","owner":"intel","description":"Contains the source code examples described in the \"Intel® 64 and IA-32 Architectures Optimization Reference Manual\"","archived":true,"fork":false,"pushed_at":"2024-05-03T22:09:10.000Z","size":462,"stargazers_count":761,"open_issues_count":3,"forks_count":86,"subscribers_count":42,"default_branch":"main","last_synced_at":"2024-08-09T00:29:22.883Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Assembly","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"0bsd","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/intel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"COPYING","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}},"created_at":"2021-05-10T21:18:32.000Z","updated_at":"2024-08-07T09:47:10.000Z","dependencies_parsed_at":"2024-01-31T20:43:58.457Z","dependency_job_id":null,"html_url":"https://github.com/intel/optimization-manual","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/intel/optimization-manual","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intel%2Foptimization-manual","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intel%2Foptimization-manual/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intel%2Foptimization-manual/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intel%2Foptimization-manual/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/intel","download_url":"https://codeload.github.com/intel/optimization-manual/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intel%2Foptimization-manual/sbom","scorecard":{"id":490792,"data":{"date":"2025-08-11","repo":{"name":"github.com/intel/optimization-manual","commit":"8993291d54951e25617a47e8b345451db404cf2c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":6.7,"checks":[{"name":"Code-Review","score":5,"reason":"Found 7/12 approved changesets -- score normalized to 5","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"project is archived","details":["Warn: Repository is archived."],"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":10,"reason":"GitHub workflow tokens follow principle of least privilege","details":["Info: topLevel permissions set to 'read-all': .github/workflows/main.yml:4","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: COPYING:0","Info: FSF or OSI recognized license: BSD Zero Clause License: COPYING:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: github.com/intel/.github/SECURITY.md:1","Info: Found linked content: github.com/intel/.github/SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/intel/.github/SECURITY.md:1","Info: Found text in security policy: github.com/intel/.github/SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":10,"reason":"all dependencies are pinned","details":["Info:   1 out of   1 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 20 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-19T19:04:58.860Z","repository_id":37703817,"created_at":"2025-08-19T19:04:58.860Z","updated_at":"2025-08-19T19:04:58.860Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34107866,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2026-05-23T21:00:29.529Z","updated_at":"2026-06-09T13:01:14.968Z","avatar_url":"https://github.com/intel.png","language":"Assembly","funding_links":[],"categories":["Assembly"],"sub_categories":[],"readme":"# Intel® 64 and IA-32 Architectures Optimization Reference Manual Code Samples\n\nThis repository contains buildable versions of the example source files in the\nIntel Optimization Manual available here\n(https://software.intel.com/en-us/articles/intel-sdm).  Assembly source code\nis provided for GCC, Clang and MSVC, using the Intel syntax.  Unit tests are\nalso provided for each of the samples.\n\n## Building on Linux and macOS\n\nTo run the unit tests\n\n1. cd to the root folder of this project\n2. mkdir build\n3. cd build\n4. cmake ..\n5. make \u0026\u0026 make test\n\nGCC 8.1 (or clang 12 on macOS) or higher is required to build the unit tests.  However,\nmany of the newer examples, e.g, those that use AMX or AVX-512 FP16 instructions, require newer\nversions of the compilers to build; GCC 12 or clang 14.  No errors will be reported\nwhen building, but examples built with toolchains that do not support the instructions\nthat they test will simple report an error when run and exit.\n\nThe unit tests are\ncompiled with --march=haswell and so a fourth-generation Intel® Core™ (Haswell)\nCPU or later is required to run them.  Tests that execute instructions not present\non fourth-generation Intel® Core™ (Haswell) will be\nskipped if the CPU on which they are run does not support those instructions.\n\nThe code samples can also be compiled with clang:\n\n1. cd to the root folder of this project\n2. mkdir clang-build\n3. cd clang-build\n4. CC=clang CXX=clang++ cmake ..\n5. make \u0026\u0026 make test\n\n\n## Building on Windows\n\nTo run the tests on Windows machine-\nDependency- Visual Studio 2022\n\n1. go to optimization repo on your local machine.\n2. mkdir bld\n3. cd bld\n4. (inside x64 Native tools command prompt)\n   \"cmake -G \"Visual Studio 17 2022\" ..\" =\u003e this will generate visual studio solution files.\n   open optimization.sln file using visual studio.\n5. To Build- build \"ALL_BUILD\" project\n6. To Run tests- build \"RUN_TESTS\" project.\n\n## Building the Benchmarks\n\nBenchmark code is supplied for some of the code samples.  These benchmarks are\nbuilt using [Google's Benchmark project](https://github.com/google/benchmark).\nIf Benchmark is installed and discoverable by CMake, the benchmarks for the code\nsamples will be automatically built when you type make.\n\nIn Windows, ensure you build the benchmark code with the same build type \n(Release/Debug) as Google's Benchmark to prevent debug level mismatch errors \nwhile linking.\n\n## CPU Requirements\n\nThe code samples assume that they are being run on a fourth-generation Intel® Core™ (Haswell) processor\nor later and do not perform runtime checks for the instructions that\nthey use that are present in fourth-generation Intel® Core™ (Haswell), for example, FMA or AVX-2.\nSome of the code samples may then crash if they are run\non a device that does not support these instructions.\n\nThe code samples do however check for post fourth-generation Intel® Core™ (Haswell) instruction sets such as AVX-512 and VNNI\nbefore running.  Tests will skip if they detect that the post fourth-generation Intel® Core™ (Haswell) instructions\nthey need are not present.   Some of the newest examples use new instructions only found\nin seventh-generation Intel® Core™ (SkylakeX) or later processors.  If you have an older CPU\nin your PC you may find that everything builds on your system\nbut that some of the tests are skipped or crash (if you don't have AVX2) when run. In this case,\nto fully run the tests, you need to run them under the SDE.\n\nhttps://software.intel.com/en-us/articles/intel-software-development-emulator\n\n\n## Code Sample Constraints\n\nMany of the code samples in the Optimization Manual are code snippets.\nThey contain the minimum amount of code needed to illustrate a particular\nconcept that is discussed in the manual.  The code samples typically make\nassumptions about the data they process.  These assumptions are often\nnot documented in the manual.  They are however documented in this\nrepository.  Each code sample is implemented as a function and each\nof these functions is accompanied by a wrapper function that documents\nand enforces the assumptions of the code sample.  For example, for two\nfunctions are defined for Chapter 18 example 22\n\n```\nvoid lookup128_novbmi(const uint8_t *in, uint8_t *dict, uint8_t *out,\n\t\t      size_t len);\nbool lookup128_novbmi_check(const uint8_t *in, uint8_t *dict, uint8_t *out,\n\t\t\t    size_t len);\n```\n\nlookup128_novbmi corresponds to the code in the Optimization Manual and\nlookup128_novbmi_check is a wrapper function that checks the validity of\nits parameters and then calls lookup128_novbmi.  The code for\nlookup128_novbmi_check is as follows.\n\n```\nbool lookup128_novbmi_check(const uint8_t *in, uint8_t *dict, uint8_t *out,\n\t\t\t    size_t len)\n{\n\t/*\n\t * in, dict and out must be non-NULL.  dict must contain at least 128\n\t * bytes.\n\t */\n\n\tif (!in || !dict || !out)\n\t\treturn false;\n\n\t/*\n\t * len must be \u003e 0 and a multiple of 32.\n\t */\n\n\tif (len == 0 || len % 32 != 0)\n\t\treturn false;\n\n\tlookup128_novbmi(in, dict, out, len);\n\n\treturn true;\n}\n```\n\nNote how the input constraints are documented and, where possible, enforced.\n\n\n## Register usage\n\nAssembly language code samples in the .s files, that are designed to be\ncompiled by gcc or clang on Linux, contain almost exact copies of the\ncode snippets that appear in the manual.  The core of these functions\nuse the same set of registers as used by the corresponding examples in\nthe manual.  Sometimes these code samples in the repository contain\nsome additional setup code that ensures that the registers are set up\nin the way that the code snippets in the manual expect.  This setup\ncode is kept to a minimum by carefully choosing the order of the\nparameters in the prototypes for the code samples.  This is why the\nordering of the parameters may seem a bit weird and inconsistent from\none example to the next.  As the MASM versions of the code samples in\nthe .asm files use the same prototypes as the samples in the .s files\nand as Windows has a different calling convention to Linux, large\namounts of setup code would need to appear in the .asm files for the\nMASM versions of the code samples to use the same set of registers\nthat are used by the code snippets in the manual and the .s files.\nConsequently, the MASM versions of the code samples, tend to use\ndifferent sets of registers to keep the setup code to a minimum.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintel%2Foptimization-manual","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fintel%2Foptimization-manual","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintel%2Foptimization-manual/lists"}