LPC4370 Single cycle Multiply

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

LPC4370 Single cycle Multiply

2,138 次查看
cpchen
Contributor III

Dear Sir,  

I like to use the single cycle multily capability of LPC4370 M4 core,   can you advise what should I do speicifically for this ? in code or in compiler ?

Best Regards,

标签 (1)
标记 (3)
0 项奖励
10 回复数

1,943 次查看
converse
Senior Contributor V

If you use a compiler, and a multiply in your code (i.e. a = b * c), it will automatically use the correct single cycle multiply instruction. There is no need to write it by hand.

0 项奖励

1,943 次查看
cpchen
Contributor III

Hi Con Verse, 

THanks for the reply.  I am first time with Cortex M4 and LPC4370,  could you advise following clarification 

1. Do I need to define FPU exitence or include certain h file before compilier can automatically generate the correct single cycle multiplt istruction

2. Is there any way I can verify the compiled assembly code, I am useing MCUExpresso 

3. Have you use the FPU before, what's the processor you use ?

THansk for help !

0 项奖励

1,944 次查看
converse
Senior Contributor V

1. Single cycle multiply (integer) is nothing to do with FPU (floating point). No, you don't need to do anything. Just write your code.

2. What, don't you trust the compiler? You can generate assembly output if you want to see what is generated. See https://mcuoneclipse.com/2018/07/08/creatin… 

3. Yes, I use FPU. DOn't forget it is single precision (32-bit, or 'float' in C). If you use double precision in your code ('double' in C), then it is emulated, so it will be slow. Take a look at this https://mcuoneclipse.com/2018/07/08/creatin… 

Also, make sure you read section 19.4 (Floating point support) in the latest MCUXpresso IDE User Guide. 

0 项奖励

1,944 次查看
cpchen
Contributor III

Hi Con Verse, 

I just found out both links you provide above is not exist anymore, is there any other place I can see the article ?

pastedImage_1.png

0 项奖励

1,944 次查看
converse
Senior Contributor V
0 项奖励

1,943 次查看
cpchen
Contributor III

Thanks , appreciated !

0 项奖励

1,943 次查看
cpchen
Contributor III

Thanks a lot for the reply. it's very helpful.  

I mix single cycle multiply with FPU,  what I need in my application is multiply with floating numbers, I will look into it. 

Thanks again !

0 项奖励

1,943 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Chen,

If you would like to get single cycle multiply operation, I suppose that you can use the assembly language to finish the job in order to maximize the effiency. I attach the Cortex-M4 generic user guide, which includes the assembly instruction of the core. You can develop project in C language, you can declare an api function and implement the body of the api function with assembly language, there is calling convention for api function based compiler, but it is compiler by compiler.

Hope it can help you

BR

XiangJun Rong

0 项奖励

1,943 次查看
cpchen
Contributor III

Got  the attachment, thank you !

0 项奖励

1,942 次查看
cpchen
Contributor III

Hi Xiangjun, 

Thank you for the reply, I did not see the attachment,  can you send it again ?

Best Regards,

0 项奖励