// Copyright 2025-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#define FUNCTION_NAME ds_vpu_asm

    .cc_top FUNCTION_NAME.function
    .type   FUNCTION_NAME,@function

    .issue_mode dual
    .align 4
ones:
    .word 0x40000000,0x40000000,0x40000000,0x40000000,0x40000000,0x40000000,0x40000000,0x40000000
    .align 16
    .globl FUNCTION_NAME
.globl FUNCTION_NAME.nstackwords
.set   FUNCTION_NAME.nstackwords, 8
FUNCTION_NAME:
    { dualentsp 8                 ; ldc r11, 0 }
    { vsetc r11                   ; add r11, r1, 0 }
    { vclrdr                      ; add r1, r1, 8 }
    { ldc r3, 32                  ; nop }
    { vldc r1[0]                  ; add r1, r1, r3 }
    { vstc r11[0]                 ; add r11, r11, r3 }
    { vlmaccr r0[0]               ; add r0, r0, r3 }
    { vldc r1[0]                  ; add r1, r1, r3 }
    { vstc r11[0]                 ; add r11, r11, r3 }
    { vlmaccr r0[0]               ; add r0, r0, r3 }
    { vldc r1[0]                  ; add r1, r1, r3 }
    { vstc r11[0]                 ; add r11, r11, r3 }
    { vlmaccr r0[0]               ; add r0, r0, r3 }
    { vldc r1[0]                  ; nop }
    { vstc r11[0]                 ; nop }
    { vlmaccr r0[0]               ; ldaw r11, sp[0] }
    { vstr r11[0]                 ; nop }
    { vldc r11[0]                 ; nop }
    { vclrdr                      ; ldap r11, ones }
    { vlmaccr r11[0]              ; ldaw r11, sp[0] }
    vstr r11[0]
    ldw r0, sp[0]
    retsp 8
    
    .cc_bottom FUNCTION_NAME.function
