hello, everyone
The neon unit was recently used on the imx6ull platform to calculate some data. On linux, I use the Ne10 library and Neon Intrinsics,the runtime of the code is significantly improved. Now I want to use neon units on bare boards or rtos.In this case, the Ne10 library method cannot be used, so I want to use Neon Intrinsics to optimize the code. I tried to compile the rtos code to run on imx6ull and unfortunately failed. Then try to compile the bare board code and reference the neon unit to calculate the data,the code works, but there is currently no test to see if the resulting data is correct. But there were some problems.
The procedure for loading the bare board is like this ,In linux, I will move the bare board bin file to mmc,the bin file in the mmc is then loaded into the ddr during the boot phase, and the code is then run using the go instruction to jump to the specified ddr address.In theory, the code should work this way.
When I added neon calculations, there was a print error,For example, if you define a variable, its value will change very strange.The code looks like this:
void EnableNEON(void)
{
asm("mrc p15,0,r0,c1,c0,2");
asm("orr r0,r0,#0x00f00000");
asm("mcr p15,0,r0,c1,c0,2");
asm("mov r0,#0x40000000");
asm("fmxr FPEXC,r0");
}
int main(void)
{
unsigned char state = OFF;
int a = 1, b =12, c, d;
int8x8_t sum1_v, sum2_v, sum_v;
int8x8_t test_v;
int_init();
imx6u_clkinit();
delay_init();
clk_enable();
uart_init();
printf("\r\n%d \r\n\r\n", 100);
for(i = 0; i < 4; i++)
{
test[i] = i;
test1[i] = i;
}
for(i = 0; i < 2; i++)
{
printf("\r\n%d \r\n\r\n", test[i]);
}
EnableNEON();
sum1_v = vld1_s8(&test[4*i]);
sum2_v = vld1_s8(&test1[4*i]);
sum_v = vadd_s8(sum1_v, sum2_v);
vst1q_s8(test, test_v);
vst1_s8(&test2[4*i], sum_v) ;
while(1)
{
printf("\r\%d \r\n\r\n", test2[2]);
}
The results are as follows:
I would like to ask the staff of nxp,is there any documentation or tutorial available for reference?
thank you
Sorry, we don't have reference for this.
Can you give me some comments or suggestions.
thank you