assembly - Enable neon on ARM cortex-a series -


i want initialize on bare metal cortex a-15 neon cp, following arm's directives:

wrote sequence @ end of init sequence:

mov r0, #0x00f00000 mrc p15, 0, r0, c1, c1, 2 orr r0, r0, #0x0c00  bic r0, r0, #0xc000  mcr p15, 0, r0, c1, c1, 2 isb mrc p15, 4, r0, c1, c1, 2 bic r0, r0,  #0x0c00 bic r0, r0, #(3<<14) mcr p15, 4, r0, c1, c1, 2 isb mov r3, #0x40000000 vmsr fpexc, r3 

i error:

error: operand 0 must fpscr -- `vmsr fpexc,r3' 

i using arm-eabi-as --version:

gnu assembler (gnu binutils) 2.21 copyright 2010 free software foundation, inc. program free software; may redistribute under terms of gnu general public license version 3 or later. program has absolutely no warranty. assembler configured target of `arm-eabi'. 

if change fpexc fpscr program compiles , running raise unhandler exception:

mrc p15, 4, r0, c1, c1, 2 

a sequence initializing vfpu can found in u-boot source.

.macro init_vfpu   ldr r0, =(0xf << 20)   mcr p15, 0, r0, c1, c0, 2   mov r3, #0x40000000   .long 0xeee83a10   /* vmsr fpexc, r3 */ .endm /* init_vfpu */ 

as documented in binutils mailing list, vmsr fpexc bug has been fixed in binutils 2.23 branch head , 2.24 development branch released shortly. fixes exist in 2.23.1 , 2.23.2 releases of binutils.

here sample session,

$ cat t.s init_vpu:   ldr r0, =(0xf << 20)   mcr p15, 0, r0, c1, c0, 2   mov r3, #0x40000000   vmsr fpexc, r3   bx  lr   .ltorg $ arm-none-linux-gnueabi-as -march=armv7-a -mcpu=cortex-a15 -mfpu=neon t.s -o t.o $ arm-none-linux-gnueabi-as --version | grep assembler gnu assembler (crosstool-ng hg+default-86a8d1d467c8) 2.23.1 assembler configured target of `arm-none-linux-gnueabi'. $ objdump --version | grep binutils gnu objdump (gnu binutils ubuntu) 2.23.2 $ objdump -s t.o   t.o:     file format elf32-littlearm  disassembly of section .text:  00000000 <init_vpu>:    0:   e3a0060f        mov     r0, #15728640   ; 0xf00000    4:   ee010f50        mcr     15, 0, r0, cr1, cr0, {2}    8:   e3a03101        mov     r3, #1073741824 ; 0x40000000    c:   eee83a10        vmsr    fpexc, r3   10:   e12fff1e        bx      lr 

the above sequence should work of cortex-a series. sequence system without virtualization or trustzone active.


Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

c++ - Correct method for redrawing a layered window -

java.util.scanner - How to read and add only numbers to array from a text file -