This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28027: CCS在使用C语言编程的时候,浮点数能否使用移位运算?移位运算快还是乘法快?

Part Number: TMS320F28027


float M_factor;

uint32_t pwm_duty_tmp;

因为M_factor为浮点数据而 pwm_duty_tmp为整型数,涉及的运算如下:

第一种:

pwm_duty_tmp= M_factor*256;

第一种:

pwm_duty_tmp= M_factor<<8;

q请问以上两种哪种运算速度快?

 M_factor在移位的过程中是否会丢失数据(前提是pwm_duty_tmp= M_factor*256 这种运算结果是对的)?

浮点数如果能使用移位运算的话请问涉及的指令是什么?

谢谢!