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

    .cc_top FUNCTION_NAME.function
    .type   FUNCTION_NAME,@function

    .issue_mode dual
    .align 4
evens:
    .word 0x40000000
odds:
    .word 0,0x40000000,0,0x40000000,0,0x40000000,0,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, 4 }
    { ldc r3, 32                  ; nop }
    { vldc r1[0]                  ; add r1, r1, r3 }
    { vstc r11[0]                 ; add r11, r11, r3 }
    { vlmaccr r2[0]               ; add r2, r2, r3 }
    { vlmaccr r2[0]               ; add r2, r2, r3 }
    { vldc r1[0]                  ; add r1, r1, r3 }
    { vstc r11[0]                 ; add r11, r11, r3 }
    { vlmaccr r2[0]               ; add r2, r2, r3 }
    { vlmaccr r2[0]               ; ldaw r11, sp[0] }
    { vstr r11[0]                 ; nop }
    { vldc r11[0]                 ; nop }
    { vclrdr                      ; ldap r11, evens }
    { vlmaccr r11[0]              ; ldap r11, odds }
    { vlmaccr r11[0]              ; mkmsk r3, 8 }
    vstrpv r0[0], r3
    retsp 8
    
    .cc_bottom FUNCTION_NAME.function
