Hello,
I have a few issues getting started with the neon-core on my A8-3552. I use CCS Version: 6.0.1.00040 ; Compiler: TI 5.1.6
I am trying to get a basic add-function running. The VADD command works
VADD.I32 d0, d0, d1
but the VLD1 command stops the programm
VLD1.32 {d2}, [r1]
.
First I initialize the neon with the code from the TI-Wiki:
neoninit: MRC p15, #0, r1, c1, c0, #2 ; r1 = Access Control Register ORR r1, r1, #(0xf << 20) ; enable full access for p10,11 MCR p15, #0, r1, c1, c0, #2 ; Access Control Register = r1 MOV r1, #0 MCR p15, #0, r1, c7, c5, #4 ; flush prefetch buffer because of FMXR below ; and CP 10 & 11 were only just enabled ; Enable VFP itself MOV r0,#0x40000000 FMXR FPEXC, r0 ; FPEXC = r0
(This part must work because if i don't include it, even the VADD does not work.)
Then I call the add-function:
neonadd: VLD1.32 {d0}, [r0] VLD1.32 {d1}, [r1] VADD.I32 d0, d0, d1 VST1.16 {d0},[r0] BX LR
After that I send the result over UART. Here is the complete Code:
neon.c :
#include "uartStdio.h" #include "stdint.h" extern uint32_t neonadd(uint32_t a, uint32_t b); extern void neoninit(); void neontest(){ UARTprintf("Neontest\n"); uint32_t B = 1; uint32_t C = 2; uint32_t D = 0; UARTprintf("NEONADD\n"); neoninit(); UARTprintf("neon initialized\n"); D = neonadd(B,C); UARTprintf("Result: %d\n", D); }
neonadd.asm:
.global neonadd .global neoninit neonadd: VLD1.32 {d0}, [r0] VLD1.32 {d1}, [r1] VADD.I32 d0, d0, d1 VST1.16 {d0},[r0] BX LR neoninit: MRC p15, #0, r1, c1, c0, #2 ; r1 = Access Control Register ORR r1, r1, #(0xf << 20) ; enable full access for p10,11 MCR p15, #0, r1, c1, c0, #2 ; Access Control Register = r1 MOV r1, #0 MCR p15, #0, r1, c7, c5, #4 ; flush prefetch buffer because of FMXR below ; and CP 10 & 11 were only just enabled ; Enable VFP itself MOV r0,#0x40000000 FMXR FPEXC, r0 ; FPEXC = r0
I am new to assembly and only understand the basics so please be patient with me.
Thanks a lot for your help in advance.
Regards,
Andi