This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Unable to run the neon instructions in startup_Cortex-R52

Hi,

I am planning to execute few neon add instructions using startup_Cortex-R52 example project. I have created assembly file with neon instructions and added it to project. I have modified the target settings to use -march "armv8-r", mfpu to "neon" and float-abi to "Hardware(Software FPO Linkage)".

Is there any startup code that I need to add for enabling neon extension. Let me know how can I proceed regarding this.

Thanks,

Praveen. 

Parents
  • Hi Praveen

    The startup_Cortex-R52 example already has the necessary code to enable NEON in startup.S:

    #ifdef __ARM_FP
    //----------------------------------------------------------------
    // Enable access to VFP by enabling access to Coprocessors 10 and 11.
    // Enables Full Access i.e. in both privileged and non privileged modes
    //----------------------------------------------------------------
    
            MRC     p15, 0, r0, c1, c0, 2      // Read Coprocessor Access Control Register (CPACR)
            ORR     r0, r0, #(0xF << 20)       // Enable access to CP 10 & 11
            MCR     p15, 0, r0, c1, c0, 2      // Write Coprocessor Access Control Register (CPACR)
            ISB
    
    //----------------------------------------------------------------
    // Switch on the VFP hardware
    //----------------------------------------------------------------
    
            MOV     r0, #0x40000000
            VMSR    FPEXC, r0                   // Write FPEXC register, EN bit set
    #endif

    In All Tools Settings > Target, I suggest you set
    Target CPU = Cortex-R52
    Target FPU = Armv8 (Neon)
    Float ABI = Hardware

    which results in the compiler command-line:
    armclang --target=arm-arm-none-eabi -mcpu=cortex-r52 -mfpu=neon-fp-armv8 -mfloat-abi=hard

    Hope this helps

    Stephen

Reply
  • Hi Praveen

    The startup_Cortex-R52 example already has the necessary code to enable NEON in startup.S:

    #ifdef __ARM_FP
    //----------------------------------------------------------------
    // Enable access to VFP by enabling access to Coprocessors 10 and 11.
    // Enables Full Access i.e. in both privileged and non privileged modes
    //----------------------------------------------------------------
    
            MRC     p15, 0, r0, c1, c0, 2      // Read Coprocessor Access Control Register (CPACR)
            ORR     r0, r0, #(0xF << 20)       // Enable access to CP 10 & 11
            MCR     p15, 0, r0, c1, c0, 2      // Write Coprocessor Access Control Register (CPACR)
            ISB
    
    //----------------------------------------------------------------
    // Switch on the VFP hardware
    //----------------------------------------------------------------
    
            MOV     r0, #0x40000000
            VMSR    FPEXC, r0                   // Write FPEXC register, EN bit set
    #endif

    In All Tools Settings > Target, I suggest you set
    Target CPU = Cortex-R52
    Target FPU = Armv8 (Neon)
    Float ABI = Hardware

    which results in the compiler command-line:
    armclang --target=arm-arm-none-eabi -mcpu=cortex-r52 -mfpu=neon-fp-armv8 -mfloat-abi=hard

    Hope this helps

    Stephen

Children