12.07.2015 Views

RealView Compilation Tools コンパイラユーザガイド - ARM ...

RealView Compilation Tools コンパイラユーザガイド - ARM ...

RealView Compilation Tools コンパイラユーザガイド - ARM ...

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

NEON ベ ク ト ル 化 コ ンパイ ラの 使 用BIC r4,r4,#0x00000002 // disable alignment faults (A=0)// MMU not enabled: no page tablesMCR p15,0,r4,c1,c0,0#ifdef __BIG_ENDIANSETEND BE#endifMRC p15,0,r4,c1,c0,2 // Enable VFP access in the CAR -ORR r4,r4,#0x00f00000 // must be done before any VFP instructionsMCR p15,0,r4,c1,c0,2MOV r4,#0x40000000 // Set EN bit in FPEXCMSR FPEXC,r4IMPORT __mainB __main}#endif例 3-23 DSP ベク トル 化 コード/** DSP Vectorizable example code.* Copyright 2006 <strong>ARM</strong> Limited. All rights reserved.** Includes embedded assembly to initialize cpu; link using '--entry=init_cpu'.** Build using:* armcc -c dsp_vector_example.c --cpu Cortex-A8 -Otime --vectorize* armlink -o dsp_vector_example.axf dsp_vector_example.o --entry=init_cpu*/#include #include "dspfns.h"void fn(short *__restrict r, int n, const short *__restrict a, const short *__restrict b){int i;for (i = 0; i < n; ++i){r[i] = add(a[i], b[i]);}}int main(){static const short x[128] ={0x0000, 0x0647, 0x0c8b, 0x12c8, 0x18f8, 0x1f19, 0x2528, 0x2b1f,0x30fb, 0x36ba, 0x3c56, 0x41ce, 0x471c, 0x4c3f, 0x5133, 0x55f5,0x5a82, 0x5ed7, 0x62f2, 0x66cf, 0x6a6d, 0x6dca, 0x70e2, 0x73b5,0x7641, 0x7884, 0x7a7d, 0x7c29, 0x7d8a, 0x7e9d, 0x7f62, 0x7fd8,<strong>ARM</strong> DUI 0205IJ Copyright © 2002-2010 <strong>ARM</strong> Limited. All rights reserved. 3-21ID 100419Non-Confidential,

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!