I want to enable the Neon hardware on the AM335x (Beaglebone Black) processor.
I see on one of the processors.wiki.ti.com pages there is the following assembler instruction to enable the neon hardware:
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 tried to implement this in the following way in my source code:
asm("mrc p15, #0, r1, c1, c0, #2");
asm("ORR r1, r1, #(0xf << 20)");
asm("MCR p15, #0, r1, c1, c0, #2");
asm("MOV r1, #0");
asm("MCR p15, #0, r1, c7, c5, #4");
asm("MOV r0,#0x40000000");
asm("FMXR FPEXC, r0");
But the mrc, mcr, and fmxr instructions throw an "Illegal Instruction" error and kills the app.
Is there a good way to enable the neon FP core?