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.

[参考译文] TMS320F28377S:CLA 和无符号长整型的饱和函数

Guru**** 2470150 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/981620/tms320f28377s-saturation-function-for-cla-and-unsigned-long

器件型号:TMS320F28377S

我需要在 CLA 中为无符号长整型变量实现饱和函数(类似于_IQsat)。  可以使用 if-then 来完成、但我已经尝试过这种方法、速度更快:

#define uint_Sat (Data、SatVal)   Data =(uint32_t)(__mminf32 (((float32) Data、(float32) SatVal));

其中 Data 和 SatVal 是输入数据和饱和/钳位值。  两者都是无符号长整型变量。

我已经测试过这个、它可以正常工作、但我缺少什么东西、还是有一个专用内在函数可以满足我的需求、但我忽略了。   

提前感谢您的任何见解。