{ "name": "reference_loop_101", "definition": "loop_101", "dataset": "simd-loop", "author": "reference", "spec": { "language": "cpp", "target_hardware": [ "aarch64" ], "entry_point": "kernel.cpp::inner_loop_101", "dependencies": [], "isa_features": [], "compile_flags": [ "-O2", "-std=c++14", "-fno-vectorize", "-fno-slp-vectorize" ], "link_flags": [] }, "sources": [ { "path": "loop_101.h", "content": "// Auto-generated by scripts/gen_simd_loop_harness.py \u2014 do not hand-edit.\n#pragma once\n#include \n\nstruct loop_101_data {\n uint8_t *a;\n uint8_t *b;\n int n;\n};\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\nint armbench_entry_loop_101(void *b, int64_t n, void *res_out);\n#ifdef __cplusplus\n}\n#endif\n" }, { "path": "loop_101.cpp", "content": "// Auto-generated by scripts/gen_simd_loop_harness.py \u2014 do not hand-edit.\n#include \"loop_101.h\"\n#include \n\nextern \"C\" void inner_loop_101(struct loop_101_data *data);\n\nextern \"C\" int armbench_entry_loop_101(void *b, int64_t n, void *res_out) {\n struct loop_101_data _kd;\n _kd.b = static_cast(b);\n _kd.a = static_cast(res_out);\n _kd.n = static_cast(n);\n inner_loop_101(&_kd);\n return 0;\n}\n" }, { "path": "kernel.cpp", "content": "#include \"loop_101.h\"\n#include \n\nextern \"C\" void inner_loop_101(struct loop_101_data *data) {\n uint8_t *a = data->a;\n uint8_t *b = data->b;\n int n = data->n;\n for (int i = 0; i < n - 1; i++) {\n uint16_t s1 = b[i];\n uint16_t s2 = b[i + 1];\n a[2 * i] = (3 * s1 + s2 + 2) >> 2;\n a[2 * i + 1] = (3 * s2 + s1 + 2) >> 2;\n }\n}\n" } ], "description": "Scalar reference (auto-vectorization disabled) for loop_101. Baseline for speedup measurement." }