File size: 2,396 Bytes
f25167e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{
  "name": "reference_loop_110",
  "definition": "loop_110",
  "dataset": "simd-loop",
  "author": "reference",
  "spec": {
    "language": "cpp",
    "target_hardware": [
      "aarch64"
    ],
    "entry_point": "kernel.cpp::inner_loop_110",
    "dependencies": [],
    "isa_features": [],
    "compile_flags": [
      "-O2",
      "-std=c++14",
      "-fno-vectorize",
      "-fno-slp-vectorize"
    ],
    "link_flags": []
  },
  "sources": [
    {
      "path": "loop_110.h",
      "content": "// Auto-generated by scripts/gen_simd_loop_harness.py \u2014 do not hand-edit.\n#pragma once\n#include <stdint.h>\n\ntypedef struct { int8_t re; int8_t im; } cint8_t;\ntypedef struct { int32_t re; int32_t im; } cint32_t;\n\nstruct loop_110_data {\n    cint8_t *a0;\n    cint8_t *b0;\n    cint32_t *c0;\n    uint64_t size;\n};\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\nint armbench_entry_loop_110(void *a0, void *b0, int64_t size, void *res_out);\n#ifdef __cplusplus\n}\n#endif\n"
    },
    {
      "path": "loop_110.cpp",
      "content": "// Auto-generated by scripts/gen_simd_loop_harness.py \u2014 do not hand-edit.\n#include \"loop_110.h\"\n#include <stdint.h>\n\nextern \"C\" void inner_loop_110(struct loop_110_data *data);\n\nextern \"C\" int armbench_entry_loop_110(void *a0, void *b0, int64_t size, void *res_out) {\n    struct loop_110_data _kd;\n    _kd.a0 = static_cast<cint8_t *>(a0);\n    _kd.b0 = static_cast<cint8_t *>(b0);\n    _kd.c0 = static_cast<cint32_t *>(res_out);\n    _kd.size = static_cast<uint64_t>(size);\n    inner_loop_110(&_kd);\n    return 0;\n}\n"
    },
    {
      "path": "kernel.cpp",
      "content": "#include \"loop_110.h\"\n#include <stdint.h>\n\nextern \"C\" void inner_loop_110(struct loop_110_data *data) {\n    cint8_t *a = data->a0; cint8_t *b = data->b0; cint32_t *c = data->c0;\n    uint64_t size = data->size;\n    for (uint64_t i = 0; i < size; i++) {\n        c[i].re = (int32_t)(((a[2*i].re * b[2*i].re) - (a[2*i].im * b[2*i].im)) +\n                            ((a[2*i+1].re * b[2*i+1].re) - (a[2*i+1].im * b[2*i+1].im)));\n        c[i].im = (int32_t)(((a[2*i].im * b[2*i].re) + (a[2*i].re * b[2*i].im)) +\n                            ((a[2*i+1].im * b[2*i+1].re) + (a[2*i+1].re * b[2*i+1].im)));\n    }\n}\n"
    }
  ],
  "description": "Scalar reference (auto-vectorization disabled) for loop_110. Baseline for speedup measurement."
}