// vim: ft=arm

.{{label}}:
    ldr         x2, [x0, #8]

{% capture mr_over_8 %}{{ mr | divided_by: 8 }}{%endcapture%}
{% capture mr_over_8_min_1 %}{{ mr | divided_by: 8 | minus: 1 }}{%endcapture%}

{% for reg in (0..mr_over_8_min_1) %}
    ldr         q{{reg}}, [ x2 ], #16
{% endfor %}

{% if flipped %}
    {% for acc in (from..to) %}
        {% capture other%}{{acc | minus: from | modulo: mr_over_8}}{%endcapture%}
        {{op}} v{{acc}}.8h, v{{acc}}.8h, v{{other}}.8h
    {% endfor %}
{% else %}
    {% for acc in (from..to) %}
        {% capture other%}{{acc | minus: from | modulo: mr_over_8}}{%endcapture%}
        {{op}} v{{acc}}.8h, v{{other}}.8h, v{{acc}}.8h
    {% endfor %}
{% endif %}

b           .non_linear_loop
